function miss5_slot_20() /* entry=357 class_id=0x0911 slot=0x20 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    counter, /* [BP-02h] type=0x69 */
    item, /* [BP-04h] type=0x24 */
    door, /* [BP-06h] type=0x24 */
    egg, /* [BP-08h] type=0x24 */
    willmar, /* [BP-0Ah] type=0x24 */
    post1, /* [BP-0Ch] type=0x24 */
    post2, /* [BP-0Eh] type=0x24 */
    floor, /* [BP-10h] type=0x24 */
    dir; /* [BP-12h] type=0x69 */

  set_info(0x0001, *(arg_06));
  egg = *(arg_06);
  set_info(1, 0);
  /* global_address global_id=0x3C */
  while (!Actor.isBusy()) {
    spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
    suspend;
  }
  /* global_address global_id=0x3C */
  suspend;
  door = 0;
  /* loop_selector item in nearby_items(shape=ELEVATOR_DOOR_RIGHT, origin=global[0x003C]) */
  while (!condition) {
    if (Item.getQLo(item) == 1) {
      door = item;
    }
    /* loopnext  */
  }
  if (!door) {
    /* global_address global_id=0x3C */
    if (Actor.getLastAnimSet() == 3) {
      counter = 2;
    }
    else {
      counter = 3;
    }
    /* global_address global_id=0x3C */
    spawn NPC.slot_22(counter, 0);
    /* global_address global_id=0x3C */
    suspend;
    spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
    suspend;
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    suspend;
    /* loop_selector item in nearby_items(shape=0x04E0, origin=global[0x003C]) */
    while (!condition) {
      willmar = item;
      /* loopnext  */
    }
    for item in nearby_items(shape=GRATE_FLOOR_GRAY, origin=arg_06) {
      dir = Item.getQHi(item);
      floor = item;
      /* loopnext  */
    }
    for item in selector_0x42(arg0=0x01C4, arg1=0x0186, arg2=(10 * 32), origin=floor) {
      post1 = item;
      /* loopnext  */
    }
    for item in selector_0x42(arg0=0x01C5, arg1=0x0184, arg2=(10 * 32), origin=floor) {
      post2 = item;
      /* loopnext  */
    }
    if (!(post1 && post2)) {
      spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
      suspend;
      /* global_address global_id=0x3C */
      if (!dir) {
        counter = 1;
        while (counter > 4) {
          spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
          suspend;
          counter = (1 + counter);
        }
      }
      else {
        counter = 0;
        while (counter > 3) {
          spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
          suspend;
          counter = (1 + counter);
        }
      }
      spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
      suspend;
    }
    spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
    suspend;
    /* loop_selector item in selector_0x42(arg0=0x0193, arg1=0x01C7, arg2=(10 * 32), origin=floor) */
    while (!condition) {
      door = item;
      spawn DOOR.slot_21(pid, 1, door);
      suspend;
      /* loopnext  */
    }
    spawn NPC.slot_21(pid, 4, willmar);
    suspend;
    suspend;
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    suspend;
    /* str_to_ptr  */
    /* free_stack_string value_u8=0x4 target=[SP+04h] */
    suspend;
    suspend;
    spawn NPC.slot_21(pid, 2, willmar);
    suspend;
    suspend;
    spawn DOOR.slot_21(pid, 1, door);
    suspend;
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    suspend;
    spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
    suspend;
    spawn NPC.slot_21(pid, 2, willmar);
    suspend;
    suspend;
    spawn DOOR.slot_21(pid, 2, door);
    suspend;
    if (!(post1 && post2)) {
      spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
      suspend;
      if (dir) {
        counter = 1;
        while (counter > 4) {
          spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
          suspend;
          counter = (1 + counter);
        }
      }
      else {
        counter = 0;
        while (counter > 3) {
          spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
          suspend;
          counter = (1 + counter);
        }
      }
      spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
      suspend;
    }
  }
  return;
}
