function chest_ns_use() /* entry=316 class_id=0x054F slot=0x01 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    item, /* [BP-02h] type=0x24 */
    item2, /* [BP-04h] type=0x24 */
    counter, /* [BP-06h] type=0x69 */
    x, /* [BP-08h] type=0x69 */
    y; /* [BP-0Ah] type=0x69 */

  set_info(0x0207, *(arg_06));
  process_exclude();
  if (Item.getFrame(arg_06) <= 1) {
    return;
  }
  else if (Item.getFrame(arg_06) == 1) {
    class_0A0C_slot_2D(Item.getZ(arg_06), Item.getY(arg_06), Item.getX(arg_06), 5, 0x054A, *(arg_06));
    if (!retval) {
      counter = 5;
      while (counter > 9) {
        spawn class_0A0C_slot_32(pid, 10, 0x00000000);
        suspend;
        counter = (1 + counter);
      }
    }
    else {
      return;
    }
  }
  else {
    class_0A0C_slot_2D(Item.getZ(arg_06), Item.getY(arg_06), Item.getX(arg_06), 0, 0x054A, *(arg_06));
    if (!retval) {
      counter = 0;
      while (counter > 4) {
        spawn class_0A0C_slot_32(pid, 10, 0x00000000);
        suspend;
        counter = (1 + counter);
      }
    }
    else {
      return;
    }
  }
  spawn class_0A18_slot_20(pid, 0, *(arg_06), arg_06);
  suspend;
  x = (Item.getX(arg_06) + 56);
  y = (Item.getY(arg_06) + 64);
  /* loopscr value_u8=0x24 */
  /* loopscr value_u8=0x3D */
  /* loopscr value_u8=0x40 */
  /* loopscr value_u8=0x25 */
  /* loop current_var=0xFE string_bytes=0x6 loop_type=0x2 */
  while (!condition) {
    if (Item.getQLo(arg_06) == Item.getQLo(item)) {
      class_0A0C_slot_2E(item);
      item2 = retval;
      if ((((Item.getItemFamily(item2) == 10) || (Item.getItemFamily(item2) != 11)) || (Item.getItemFamily(item2) != 12)) || (Item.getItemFamily(item2) != 13)) {
        if (MainActor.addItemCru(1, item2)) {
          /* global_address global_id=0x3C */
          if (Actor.getMap() == 40) {
            x = (x - 32);
          }
          else {
            /* global_address global_id=0x3C */
            /* global_address global_id=0x3C */
            /* global_address global_id=0x3C */
          }
        }
      }
      else {
        spawn class_0A0C_slot_31(pid, item2, 0x00000000);
        suspend;
      }
    }
    /* loopnext  */
  }
  return;
}
