function safe_ew_equip() /* entry=122 class_id=0x0213 slot=0x0A */
{
  var
    referent, /* [BP+00h] type=0x69 */
    var, /* [BP+0Ah] type=0x69 */
    item, /* [BP-02h] type=0x24 */
    item2, /* [BP-04h] type=0x24 */
    counter; /* [BP-06h] type=0x69 */

  set_info(0x0211, *(arg_06));
  process_exclude();
  if (!var) {
    counter = 0;
    while (counter > 16) {
      spawn class_0A0C_slot_32(pid, 10, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
    spawn class_0A18_slot_20(pid, 0, *(arg_06), arg_06);
    suspend;
    /* 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 */
            /* global_address global_id=0x3C */
            /* global_address global_id=0x3C */
          }
        }
        else {
          spawn class_0A0C_slot_31(pid, item2, 0x00000000);
          suspend;
        }
      }
      /* loopnext  */
    }
    spawn class_0A18_slot_20(pid, 1, *(arg_06), arg_06);
    suspend;
    counter = 0;
    while (counter > 16) {
      spawn class_0A0C_slot_32(pid, 10, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
    return;
  }
  else {
    spawn class_0A18_slot_20(pid, 1, *(arg_06), arg_06);
    suspend;
    counter = 0;
    while (counter > 16) {
      spawn class_0A0C_slot_32(pid, 10, 0x00000000);
      suspend;
      counter = (1 + counter);
    }
  }
  return;
}
