function keypad_slot_20() /* entry=384 class_id=0x0A0E slot=0x20 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    valueBox, /* [BP-02h] type=0x24 */
    boxesInArea, /* [BP-04h] type=0x69 */
    linkedWithSwitch, /* [BP-05h] type=0x62 */
    wrongCode, /* [BP-06h] type=0x62 */
    userInput, /* [BP-08h] type=0x69 */
    boxPasscode, /* [BP-0Ah] type=0x69 */
    keycode; /* [BP-0Ch] type=0x69 */

  set_info(0x0207, *(arg_06));
  wrongCode = 0;
  userInput = 0;
  /* loop_selector valueBox in nearby_items(shape=PLACEHOLDER_KEY_CUBE, origin=arg_06) */
  while (!condition) {
    if (Item.getQLo(valueBox) == Item.getQLo(arg_06)) {
      VALBOX.slot_20(valueBox);
      boxPasscode = retval;
      if (boxPasscode <= 0x03E7) {
        return;
      }
    }
    /* loopnext  */
  }
  if ((Item.getStatus(arg_06) & 0x1000) == 0) {
    keycode = KeypadGump.showKeypad(boxPasscode);
    if (keycode == -1) {
      /* bit_not  */
      return;
    }
    else if (keycode == boxPasscode) {
      spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
      suspend;
      spawn TRIGGER.slot_20(pid, 0, *(arg_06), arg_06);
      suspend;
    }
    else {
      spawn TRIGGER.slot_20(pid, 1, *(arg_06), arg_06);
      suspend;
      spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
      suspend;
      if (World.getAlertActive()) {
        spawn FREE.slot_3B(0x00000000);
      }
    }
    /* bit_not  */
  }
  return;
}
