function surcamew_slot_21() /* entry=284 class_id=0x04DE slot=0x21 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    screen, /* [BP-02h] type=0x24 */
    cameraEgg, /* [BP-04h] type=0x24 */
    trueRef, /* [BP-06h] type=0x69 */
    npc, /* [BP-08h] type=0x24 */
    therma, /* [BP-0Ah] type=0x24 */
    x1, /* [BP-0Ch] type=0x69 */
    y1, /* [BP-0Eh] type=0x69 */
    z1, /* [BP-0Fh] type=0x62 */
    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, 0x0470, screen) goto block_05DA;

  block_05AE:

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

  block_061F:
    if condition goto block_0AF7;

  block_0622:
    if (Item.getQLo(cameraEgg) != Item.getQLo(arg_06)) goto block_0AF3;

  block_063E:
    if (Item.getQLo(arg_06) != 0x00FE) goto block_084F;

  block_0651:
    /* 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_06FC:
    if condition goto block_073B;

  block_06FF:
    if Actor.isNPC(npc) goto block_0737;

  block_070E:
    if (Actor.GetNPCDataField0x63_00B(npc) != Item.getQLo(arg_06)) goto block_0737;

  block_072A:
    therma = npc;
    goto block_073B;

  block_0737:
    /* loopnext  */
    goto block_06FC;

  block_073B:
    if therma goto block_0786;

  block_0745:
    spawn NPC.slot_28(pid, therma);
    suspend;
    goto block_0B4B;

  block_0783:
    goto block_084C;

  block_0786:
    /* 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_07B3:
    if (!Kernel.getCurrentKeyDown()) goto block_07EB;

  block_07C2:
    spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
    suspend;
    goto block_07B3;

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

  block_084C:
    goto block_0AF3;

  block_084F:
    if (Item.getQLo(arg_06) != 0x00FD) goto block_08B8;

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

  block_08B8:
    if (Item.getQLo(arg_06) > 0x00F9) goto block_0948;

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

  block_0945:
    goto block_0AF3;

  block_0948:
    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_0A23;

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

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

  block_0A49:
    if (!Kernel.getCurrentKeyDown()) goto block_0A81;

  block_0A58:
    spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
    suspend;
    goto block_0A49;

  block_0A81:
    /* 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_0AF7;

  block_0AF3:
    /* loopnext  */
    goto block_061F;

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

  block_0B27:

  block_0B32:

  block_0B4B:
    return;

}
