function elevator_slot_20() /* entry=124 class_id=0x021E slot=0x20 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    dir, /* [BP+0Ah] type=0x69 */
    mapNum, /* [BP+0Ch] type=0x69 */
    eggNum, /* [BP+0Eh] type=0x69 */
    post1, /* [BP-02h] type=0x24 */
    post2, /* [BP-04h] type=0x24 */
    item, /* [BP-06h] type=0x24 */
    counter, /* [BP-08h] type=0x69 */
    door, /* [BP-0Ah] type=0x24 */
    door1; /* [BP-0Ch] type=0x24 */

  set_info(1, 0);
  /* loop_selector item in selector_0x42(arg0=0x0189, arg1=0x0289, arg2=(10 * 32), origin=arg_06) */
  while (!condition) {
    door = item;
    /* loopnext  */
  }
  if (door) {
    return;
  }
  else if (Item.getShape(door) == ELEVATOR_DOOR_SEGMENT) {
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
  }
  else {
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
    /* global_address global_id=0x3C */
    suspend;
  }
  /* global_address global_id=0x3C */
  spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
  suspend;
  spawn DOOR.slot_21(pid, 2, door);
  suspend;
  /* loop_selector item in selector_0x42(arg0=0x01C4, arg1=0x0186, arg2=(20 * 32), origin=arg_06) */
  while (!condition) {
    post1 = item;
    /* loopnext  */
  }
  for item in selector_0x42(arg0=0x01C5, arg1=0x0184, arg2=(20 * 32), origin=arg_06) {
    post2 = item;
    /* loopnext  */
  }
  if (!(post1 && post2)) {
    spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
    suspend;
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    while (!AudioProcess.isSFXPlayingForObject(0x00F4)) {
      spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
      suspend;
    }
    /* global_address global_id=0x3C */
    if (!dir) {
      counter = 5;
      while (counter > 7) {
        spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
        suspend;
        counter = (1 + counter);
      }
      spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
      suspend;
    }
    else {
      counter = 1;
      while (counter > 4) {
        spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
        suspend;
        counter = (1 + counter);
      }
    }
  }
  spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
  suspend;
  suspend;
  spawn FREE.slot_3C(pid, 0x00000000);
  suspend;
  /* global_address global_id=0x3C */
  suspend;
  /* loop_selector item in nearby_items(shape=GRATE_FLOOR_GRAY, origin=global[0x003C]) */
  while (!condition) {
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    suspend;
    FREE.slot_33(12, item);
    /* loopnext  */
  }
  if (eggNum == 18) {
    /* global_address global_id=0x3C */
    suspend;
  }
  suspend;
  spawn FREE.waitNTimerTicks(pid, 30, 0x00000000);
  suspend;
  /* loop_selector item in selector_0x42(arg0=0x01C4, arg1=0x0186, arg2=(10 * 32), origin=global[0x003C]) */
  while (!condition) {
    post1 = item;
    /* loopnext  */
  }
  for item in selector_0x42(arg0=0x01C5, arg1=0x0184, arg2=(10 * 32), origin=global[0x003C]) {
    post2 = item;
    /* loopnext  */
  }
  if (!(post1 && post2)) {
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    /* global_address global_id=0x3C */
    while (!AudioProcess.isSFXPlayingForObject(0x00F2)) {
      spawn FREE.waitNTimerTicks(pid, 2, 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, 120, 0x00000000);
  suspend;
  /* loop_selector item in selector_0x42(arg0=0x0193, arg1=0x01C7, arg2=(10 * 32), origin=global[0x003C]) */
  while (!condition) {
    door = item;
    spawn DOOR.slot_21(pid, 1, door);
    suspend;
    /* loopnext  */
  }
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  suspend;
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  suspend;
  /* global_address global_id=0x3C */
  /* global_address global_id=0x3C */
  suspend;
  /* global_address global_id=0x3C */
  return;
}
