function surcamns_slot_21() /* entry=269 class_id=0x04C6 slot=0x21 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    screen, /* [BP-02h] type=0x24 */
    cameraEgg, /* [BP-04h] type=0x24 */
    trueRef, /* [BP-06h] type=0x69 */
    x1, /* [BP-08h] type=0x69 */
    y1, /* [BP-0Ah] type=0x69 */
    z1, /* [BP-0Bh] type=0x62 */
    npc, /* [BP-0Dh] type=0x24 */
    therma, /* [BP-0Fh] type=0x24 */
    x, /* [BP-11h] type=0x69 */
    y, /* [BP-13h] type=0x69 */
    z; /* [BP-14h] type=0x62 */

  entry:
    set_info(0x021B, 0);
    trueRef = *(arg_06);
    if Item.create(0, 0x0471, screen) goto block_0534;

  block_0508:

  block_0534:
    spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
    suspend;
    /* loop_selector cameraEgg in nearby_items(shape=PLACEHOLDER_CUBE_RED_BLACK, origin=arg_06) */

  block_0579:
    if condition goto block_0B05;

  block_057C:
    if (Item.getQLo(cameraEgg) != Item.getQLo(arg_06)) goto block_0B01;

  block_0598:
    if (Item.getQLo(arg_06) != 0x00FE) goto block_085D;

  block_05AB:
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    /* loop_selector npc in nearby_items(shape=MECH_1, origin=cameraEgg) */

  block_0656:
    if condition goto block_0695;

  block_0659:
    if Actor.isNPC(npc) goto block_0691;

  block_0668:
    if (Actor.GetNPCDataField0x63_00B(npc) != Item.getQLo(arg_06)) goto block_0691;

  block_0684:
    therma = npc;
    goto block_0695;

  block_0691:
    /* loopnext  */
    goto block_0656;

  block_0695:
    if therma goto block_079B;

  block_069F:
    /* global_address global_id=0x3C */
    x1 = Item.getX();
    /* global_address global_id=0x3C */
    y1 = Item.getY();
    /* global_address global_id=0x3C */
    z1 = Item.getZ();
    spawn NPC.slot_28(pid, therma);
    suspend;

  block_06FD:
    if (getTargetNPCNumMaybe() != 1) goto block_0737;

  block_070E:
    spawn FREE.waitNTimerTicks(pid, 3, 0x00000000);
    suspend;
    goto block_06FD;

  block_0737:
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    goto block_0B05;

  block_0798:
    goto block_085A;

  block_079B:
    /* global_address global_id=0x3C */
    x1 = Item.getX();
    /* global_address global_id=0x3C */
    y1 = Item.getY();
    /* global_address global_id=0x3C */
    z1 = Item.getZ();

  block_07C8:
    if (!Kernel.getCurrentKeyDown()) goto block_0800;

  block_07D7:
    spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
    suspend;
    goto block_07C8;

  block_0800:
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    goto block_0B05;

  block_085A:
    goto block_0B01;

  block_085D:
    if (Item.getQLo(arg_06) != 0x00FD) goto block_08C6;

  block_0870:
    spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
    suspend;
    /* str_to_ptr  */
    /* free_stack_string value_u8=0x4 target=[SP+04h] */
    suspend;
    goto block_0B01;

  block_08C6:
    if (Item.getQLo(arg_06) > 0x00F9) goto block_0956;

  block_08D9:
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    spawn SURCAMNS.slot_22(cameraEgg, arg_06);
    goto block_0B05;

  block_0953:
    goto block_0B01;

  block_0956:
    x = Item.getX(cameraEgg);
    y = Item.getY(cameraEgg);
    z = Item.getZ(cameraEgg);
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
    suspend;
    if (Item.getMapArray(cameraEgg) != 0) goto block_0A31;

  block_0A0C:
    spawn TRIGGER.slot_20(pid, 0, cameraEgg, arg_06);
    suspend;

  block_0A31:
    spawn FREE.waitNTimerTicks(pid, 120, 0x00000000);
    suspend;

  block_0A57:
    if (!Kernel.getCurrentKeyDown()) goto block_0A8F;

  block_0A66:
    spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
    suspend;
    goto block_0A57;

  block_0A8F:
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
    suspend;
    goto block_0B05;

  block_0B01:
    /* loopnext  */
    goto block_0579;

  block_0B05:
    spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
    suspend;
    if screen goto block_0B40;

  block_0B35:

  block_0B40:
    return;

}
