function door3_slot_27() /* entry=378 class_id=0x0A08 slot=0x27 */
{
  var
    referent, /* [BP+00h] type=0x69 */
    doorList, /* [BP-02h] type=0x6C */
    doorList2, /* [BP-04h] type=0x6C */
    counter, /* [BP-06h] type=0x69 */
    counter2, /* [BP-08h] type=0x69 */
    door1, /* [BP-0Ah] type=0x24 */
    door2, /* [BP-0Ch] type=0x24 */
    item, /* [BP-0Eh] type=0x24 */
    nonLegalDoor1, /* [BP-0Fh] type=0x62 */
    nonLegalDoor2, /* [BP-10h] type=0x62 */
    bool, /* [BP-11h] type=0x62 */
    maxFrame; /* [BP-13h] type=0x69 */

  entry:
    set_info(0x0207, *(arg_06));
    /* create_list element_size=0x2 count=0x5 */
    /* free_local_list bp_offset=0xFE target=[BP-02h] */
    doorList = 0x0100;
    /* create_list element_size=0x2 count=0x5 */
    /* free_local_list bp_offset=0xFC target=[BP-04h] */
    doorList2 = 0x00A5;
    class_0A0C_slot_3A(0x009B, 0x00D3, 0x00E4, 0x00DA, 0x016C, 0x016D, 0x016E, 0x016F, doorList);
    /* free_stack_list value_u8=0x0 target=[SP+00h] */
    maxFrame = retval;
    /* loopscr value_u8=0x24 */
    /* loopscr value_u8=0x3D */
    /* loopscr value_u8=0x40 */
    /* loopscr value_u8=0x25 */
    /* loop current_var=0xF2 string_bytes=0x6 loop_type=0x2 */

  block_1B73:
    if condition goto block_1B81;

  block_1B76:
    door1 = item;
    /* loopnext  */
    goto block_1B73;

  block_1B81:
    /* loopscr value_u8=0x24 */
    /* loopscr value_u8=0x3D */
    /* loopscr value_u8=0x40 */
    /* loopscr value_u8=0x25 */
    /* loop current_var=0xF2 string_bytes=0x6 loop_type=0x2 */

  block_1BA1:
    if condition goto block_1BAF;

  block_1BA4:
    door2 = item;
    /* loopnext  */
    goto block_1BA1;

  block_1BAF:
    if (door1 && door2) goto block_1F19;

  block_1BC2:
    counter = 1;

  block_1BD7:
    if (counter <= (maxFrame - 1)) goto block_1F19;

  block_1BE8:
    class_0A0C_slot_2D(Item.getZ(door1), Item.getY(door1), Item.getX(door1), 0, doorList, (maxFrame - counter), list_element(size=0x2), door1);
    if (!retval) goto block_1C2A;

  block_1C23:
    nonLegalDoor1 = 1;

  block_1C2A:
    if ((!bool) && (!nonLegalDoor1)) goto block_1C86;

  block_1C3A:
    class_0A0C_slot_2D(Item.getZ(door2), Item.getY(door2), Item.getX(door2), 0, doorList2, (maxFrame - counter), list_element(size=0x2), door2);
    if (!retval) goto block_1C7C;

  block_1C75:
    nonLegalDoor2 = 1;

  block_1C7C:
    bool = 1;
    goto block_1CCB;

  block_1C86:
    class_0A0C_slot_2D(Item.getZ(door2), (Item.getY(door2) + 16), Item.getX(door2), 0, doorList2, (maxFrame - counter), list_element(size=0x2), door2);
    if (!retval) goto block_1CCB;

  block_1CC4:
    nonLegalDoor2 = 1;

  block_1CCB:
    if ((!nonLegalDoor1) && (!nonLegalDoor2)) goto block_1D1D;

  block_1CDB:
    spawn class_0A0C_slot_32(pid, (5 + counter), 0x00000000);
    suspend;
    goto block_1F0C;

  block_1D1D:
    bool = 0;
    if nonLegalDoor2 goto block_1D5E;

  block_1D46:

  block_1D5E:
    if ((nonLegalDoor1 != 1) && (nonLegalDoor2 != 0)) goto block_1DBE;

  block_1D72:

  block_1DBE:
    counter2 = ((maxFrame - counter) + 1);

  block_1DCB:
    if (counter2 <= (maxFrame - 1)) goto block_1EC8;

  block_1DDC:
    if (!bool) goto block_1E4F;

  block_1E02:
    bool = 1;
    goto block_1E95;

  block_1E4F:

  block_1E95:
    spawn class_0A0C_slot_32(pid, 10, 0x00000000);
    suspend;
    counter2 = (1 + counter2);
    goto block_1DCB;

  block_1EC8:
    /* word_to_dword  */
    /* pop_result  */
    goto block_1F47;

  block_1F0C:
    counter = (1 + counter);
    goto block_1BD7;

  block_1F19:
    /* word_to_dword  */
    /* pop_result  */
    goto block_1F47;

  block_1F47:
    /* free_local_list bp_offset=0xFE target=[BP-02h] */
    /* free_local_list bp_offset=0xFC target=[BP-04h] */
    return;

}
