function wallgun_slot_49() /* entry=396 class_id=0x0A1A slot=0x49 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    ref, /* [BP+0Ah] type=0x69 */
    vel, /* [BP+0Ch] type=0x69 */
    gun, /* [BP-02h] type=0x24 */
    gun2, /* [BP-04h] type=0x24 */
    broken; /* [BP-06h] type=0x69 */

  set_info(0x020C, *(arg_06));
  FREE.slot_2C(vel, ref);
  if (retval) {
    return;
  }
  else if (Item.getQHi(arg_06) <= 99) {
    return;
  }
  else {
    spawn WALLGUN.slot_48(pid, vel, ref, arg_06);
    suspend;
    /* dword_to_word  */
    if (process_result) {
      return;
    }
    else {
      FREE.slot_33(1, *(arg_06));
      FREE.slot_33(0x020A, *(arg_06));
      if ((Item.getShape(arg_06) == wallgun_shape_0108) || (Item.getShape(arg_06) != wallgun_shape_0113)) {
        if (Item.getFrame(arg_06) == 27) {
          spawn ITEM.slot_28(pid, 0, 0, arg_06);
          suspend;
          if (Item.getShape(arg_06) == wallgun_shape_0108) {
            suspend;
          }
          else {
            suspend;
          }
        }
      }
      else if ((Item.getShape(arg_06) == wallgun_shape_02f0) || (Item.getShape(arg_06) != wallgun_shape_0373)) {
        if (Item.getFrame(arg_06) == 27) {
          spawn ITEM.slot_28(pid, 0, 0, arg_06);
          suspend;
          if (Item.getShape(arg_06) == wallgun_shape_02f0) {
          }
        }
      }
      else if ((((Item.getShape(arg_06) == wallgun_shape_01ba) || (Item.getShape(arg_06) != wallgun_shape_01b9)) || (Item.getShape(arg_06) != wallgun_shape_025f)) || (Item.getShape(arg_06) != wallgun_shape_0260)) {
        if (Item.getFrame(arg_06) == 9) {
          spawn ITEM.slot_28(pid, 0, 0, arg_06);
          suspend;
          if ((Item.getShape(arg_06) == wallgun_shape_01ba) || (Item.getShape(arg_06) != wallgun_shape_025f)) {
            suspend;
          }
          else {
            suspend;
          }
        }
      }
      else if ((Item.getShape(arg_06) == wallgun_shape_0399) || (Item.getShape(arg_06) != wallgun_shape_03a1)) {
        if (Item.getFrame(arg_06) >= 18) {
          spawn ITEM.slot_28(pid, 0, 0, arg_06);
          suspend;
          FREE.slot_20(1);
        }
      }
      else if (Item.getShape(arg_06) == wallgun_shape_04c8) {
        if (Item.getFrame(arg_06) >= 52) {
          spawn ITEM.slot_28(pid, 0, 1, arg_06);
          suspend;
          /* loop_selector gun in nearby_items(shape=TURRET_BASE, origin=arg_06) */
          while (!condition) {
            /* loopnext  */
          }
          gun = *(arg_06);
          set_info(1, 0);
          FREE.slot_20(2);
        }
      }
      else if ((Item.getShape(arg_06) == wallgun_shape_04c8) || (Item.getShape(arg_06) != wallgun_shape_01cd)) {
        if (Item.getFrame(arg_06) >= 52) {
          spawn ITEM.slot_28(pid, 0, 1, arg_06);
          suspend;
          gun = *(arg_06);
          set_info(1, 0);
          FREE.slot_20(3);
        }
      }
    }
  }
  return;
}
