// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_stmt.c
// Function: parseForInHeader
static void parseForInHeader(Compiler *comp, ForPostStmt *postStmt)
{
    IdentName indexOrKeyName = {0}, itemName = {0};
    bool iterateByPtr = false;

    // ident ["," ident ["^"]] "in"
    lexCheck(&comp->lex, TOK_IDENT);
    strcpy(indexOrKeyName, comp->lex.tok.name);
    lexNext(&comp->lex);

    if (comp->lex.tok.kind == TOK_COMMA)
    {
        lexNext(&comp->lex);
        lexCheck(&comp->lex, TOK_IDENT);
        strcpy(itemName, comp->lex.tok.name);
        lexNext(&comp->lex);

        if (comp->lex.tok.kind == TOK_CARET)
        {
            iterateByPtr = true;
            lexNext(&comp->lex);
        }
    }

    lexEat(&comp->lex, TOK_IN);

    // expr
    const Type *collectionType = NULL;
    parseExpr(comp, &collectionType, NULL);

    // Implicit dereferencing: x in a^ == x in a
    if (collectionType->kind == TYPE_PTR || collectionType->kind == TYPE_WEAKPTR)
    {
        if (collectionType->kind == TYPE_WEAKPTR)
            genStrengthenPtr(&comp->gen);

        genDeref(&comp->gen, collectionType->base->kind);
        collectionType = collectionType->base;
    }

    // Check collection type
    if (collectionType->kind != TYPE_ARRAY && collectionType->kind != TYPE_DYNARRAY && collectionType->kind != TYPE_MAP && collectionType->kind != TYPE_STR)
    {
        char typeBuf[DEFAULT_STR_LEN + 1];
        comp->error.handler(comp->error.context, "Expression of type %s is not iterable", typeSpelling(collectionType, typeBuf));
    }

    if (collectionType->kind == TYPE_STR && iterateByPtr)
        comp->error.handler(comp->error.context, "String is not iterable by pointer");

    // Declare variable for the collection length and assign len(expr) to it
    if (collectionType->kind == TYPE_ARRAY)
        genPushIntConst(&comp->gen, collectionType->numItems);
    else
    {
        genDup(&comp->gen);
        genCallBuiltin(&comp->gen, collectionType->kind, BUILTIN_LEN);
    }

    const Ident *lenIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, "#len", comp->intType, false);
    doPushVarPtr(comp, lenIdent);
    genSwapAssign(&comp->gen, lenIdent->type->kind, typeSize(&comp->types, lenIdent->type));

    const Ident *collectionIdent = NULL;
    if (itemName[0] != '\0' || collectionType->kind == TYPE_MAP)
    {
        // Declare variable for the collection and assign expr to it
        const Type *collectionIdentType = collectionType;
        if (collectionType->kind == TYPE_ARRAY)
            collectionIdentType = typeAddPtrTo(&comp->types, &comp->blocks, collectionType);    // Avoid copying the whole static array - use a pointer instead

        collectionIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, "#collection", collectionIdentType, false);
        doZeroVar(comp, collectionIdent);
        doPushVarPtr(comp, collectionIdent);
        genSwapChangeRefCntAssign(&comp->gen, collectionIdent->type);
    }
    else
    {
        // Remove expr
        genPop(&comp->gen);
    }

    // Declare variable for the collection index (for maps, it will be used for indexing keys())
    const char *indexName = (collectionType->kind == TYPE_MAP) ? "#index" : indexOrKeyName;
    
    postStmt->indexIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, indexName, comp->intType, false);
    postStmt->op = TOK_PLUSPLUS;
    postStmt->isDeferred = true;

    identSetUsed(postStmt->indexIdent);                    // Do not warn about unused index
    doZeroVar(comp, postStmt->indexIdent);

    const Ident *keyIdent = NULL, *keysIdent = NULL;
    if (collectionType->kind == TYPE_MAP)
    {
        // Declare variable for the map key
        keyIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, indexOrKeyName, typeMapKey(collectionType), false);
        identSetUsed(keyIdent);                            // Do not warn about unused key
        doZeroVar(comp, keyIdent);

        // Declare variable for the map keys
        Type *keysType = typeAdd(&comp->types, &comp->blocks, TYPE_DYNARRAY);
        keysType->base = typeMapKey(collectionType);
        keysIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, "#keys", keysType, false);
        doZeroVar(comp, keysIdent);

        // Call keys()
        const int resultOffset = identAllocStack(&comp->idents, &comp->types, &comp->blocks, keysType);
        doPushVarPtr(comp, collectionIdent);        // Map
        genPushLocalPtr(&comp->gen, resultOffset);  // Pointer to result (hidden parameter)
        genCallTypedBuiltin(&comp->gen, keysType, BUILTIN_KEYS);

        // Assign map keys
        doPushVarPtr(comp, keysIdent);
        genSwapAssign(&comp->gen, keysType->kind, typeSize(&comp->types, keysType));
    }

    const Ident *itemIdent = NULL;
    if (itemName[0] != '\0')
    {
        // Declare variable for the collection item
        const Type *itemType = NULL;

        if (collectionType->kind == TYPE_MAP)
            itemType = typeMapItem(collectionType);
        else if (collectionType->kind == TYPE_STR)
            itemType = comp->charType;
        else
            itemType = collectionType->base;

        if (iterateByPtr)
            itemType = typeAddPtrTo(&comp->types, &comp->blocks, itemType);

        itemIdent = identAllocVar(&comp->idents, &comp->types, &comp->modules, &comp->blocks, itemName, itemType, false);
        doZeroVar(comp, itemIdent);
    }

    genWhileCondProlog(&comp->gen);

    // Implicit conditional expression: #index < #len
    doPushVarPtr(comp, postStmt->indexIdent);
    genDeref(&comp->gen, TYPE_INT);
    doPushVarPtr(comp, lenIdent);
    genDeref(&comp->gen, TYPE_INT);
    genBinary(&comp->gen, TOK_LESS, TYPE_INT, 0);

    genWhileCondEpilog(&comp->gen);

    if (collectionType->kind == TYPE_MAP)
    {
        // Assign key = #keys[#index]
        doPushVarPtr(comp, keysIdent);
        doPushVarPtr(comp, postStmt->indexIdent);
        genDeref(&comp->gen, TYPE_INT);
        genGetDynArrayPtr(&comp->gen);
        genDeref(&comp->gen, keyIdent->type->kind);

        doPushVarPtr(comp, keyIdent);
        genSwapChangeRefCntAssign(&comp->gen, keyIdent->type);
    }

    // Assign collection item
    if (itemIdent)
    {
        doPushVarPtr(comp, collectionIdent);
        genDeref(&comp->gen, collectionIdent->type->kind);

        if (collectionType->kind == TYPE_MAP)
        {
            // Push item key
            doPushVarPtr(comp, keyIdent);
            genDeref(&comp->gen, keyIdent->type->kind);
        }
        else
        {
            // Push item index
            doPushVarPtr(comp, postStmt->indexIdent);
            genDeref(&comp->gen, TYPE_INT);
        }

        switch (collectionType->kind)
        {
            case TYPE_ARRAY:     genGetArrayPtr(&comp->gen, typeSize(&comp->types, collectionType->base), collectionType->numItems); break;
            case TYPE_DYNARRAY:  genGetDynArrayPtr(&comp->gen);                                                                      break;
            case TYPE_STR:       genGetArrayPtr(&comp->gen, typeSize(&comp->types, comp->charType), INT_MAX);                        break; // No range checking
            case TYPE_MAP:       genGetMapPtr(&comp->gen, collectionType);                                                           break;
            default:             break;
        }

        // Get collection item value
        if (!iterateByPtr)
            genDeref(&comp->gen, itemIdent->type->kind);

        // Assign collection item to iteration variable
        doPushVarPtr(comp, itemIdent);
        genSwapChangeRefCntAssign(&comp->gen, itemIdent->type);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3190
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x3190
movb $0x0, -0x211(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
movl $0x45, %esi
callq 0x1b080
leaq -0x110(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x4ba8, %rsi           # imm = 0x4BA8
addq $0x28, %rsi
addq $0x8, %rsi
callq 0x30a0
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
movq -0x8(%rbp), %rax
cmpl $0x3f, 0x4bd0(%rax)
jne 0x209db
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
movl $0x45, %esi
callq 0x1b080
leaq -0x210(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x4ba8, %rsi           # imm = 0x4BA8
addq $0x28, %rsi
addq $0x8, %rsi
callq 0x30a0
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
movq -0x8(%rbp), %rax
cmpl $0x3e, 0x4bd0(%rax)
jne 0x209d9
movb $0x1, -0x211(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
callq 0x1ad90
jmp 0x209db
movq -0x8(%rbp), %rdi
addq $0x4ba8, %rdi           # imm = 0x4BA8
movl $0xd, %esi
callq 0x1b150
movq $0x0, -0x220(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xe8c0
movq -0x220(%rbp), %rax
cmpl $0x10, (%rax)
je 0x20a27
movq -0x220(%rbp), %rax
cmpl $0x11, (%rax)
jne 0x20a72
movq -0x220(%rbp), %rax
cmpl $0x11, (%rax)
jne 0x20a43
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x17d80
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x220(%rbp), %rax
movq 0x8(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
movq -0x220(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rax
cmpl $0x12, (%rax)
je 0x20af5
movq -0x220(%rbp), %rax
cmpl $0x13, (%rax)
je 0x20af5
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
je 0x20af5
movq -0x220(%rbp), %rax
cmpl $0x14, (%rax)
je 0x20af5
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rax
movq %rax, -0x378(%rbp)
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rax
movq %rax, -0x380(%rbp)
movq -0x220(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x22070
movq -0x380(%rbp), %rdi
movq -0x378(%rbp), %rcx
movq %rax, %rdx
leaq 0x1b90a2(%rip), %rsi    # 0x1d9b93
movb $0x0, %al
callq *%rcx
movq -0x220(%rbp), %rax
cmpl $0x14, (%rax)
jne 0x20b2b
testb $0x1, -0x211(%rbp)
je 0x20b2b
movq -0x8(%rbp), %rax
movq 0x50f8(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x5118(%rax), %rdi
leaq 0x1b9092(%rip), %rsi    # 0x1d9bb9
movb $0x0, %al
callq *%rcx
movq -0x220(%rbp), %rax
cmpl $0x12, (%rax)
jne 0x20b54
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x220(%rbp), %rax
movslq 0x10(%rax), %rsi
callq 0x16850
jmp 0x20b82
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x16eb0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x220(%rbp), %rax
movl (%rax), %esi
movl $0x22, %edx
callq 0x18040
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
movq -0x8(%rbp), %rax
movq 0x5240(%rax), %r9
leaq 0x1b7707(%rip), %r8     # 0x1d82c7
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, -0x328(%rbp)
movq -0x8(%rbp), %rdi
movq -0x328(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rax
addq $0x4e70, %rax           # imm = 0x4E70
movq %rax, -0x390(%rbp)
movq -0x328(%rbp), %rax
movq 0x108(%rax), %rax
movl (%rax), %eax
movl %eax, -0x384(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x328(%rbp), %rax
movq 0x108(%rax), %rsi
callq 0x21fe0
movq -0x390(%rbp), %rdi
movl -0x384(%rbp), %esi
movl %eax, %edx
callq 0x17120
movq $0x0, -0x330(%rbp)
movsbl -0x210(%rbp), %eax
cmpl $0x0, %eax
jne 0x20c65
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x20d37
movq -0x220(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x220(%rbp), %rax
cmpl $0x12, (%rax)
jne 0x20ca8
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x8(%rbp), %rsi
addq $0x4220, %rsi           # imm = 0x4220
movq -0x220(%rbp), %rdx
callq 0x21fa0
movq %rax, -0x338(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
movq -0x338(%rbp), %r9
leaq 0x1b8ef9(%rip), %r8     # 0x1d9bdb
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, -0x330(%rbp)
movq -0x8(%rbp), %rdi
movq -0x330(%rbp), %rsi
callq 0x1d5e0
movq -0x8(%rbp), %rdi
movq -0x330(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x330(%rbp), %rax
movq 0x108(%rax), %rsi
callq 0x17500
jmp 0x20d47
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x16d30
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x20d63
leaq 0x1b8e8d(%rip), %rax    # 0x1d9be7
movq %rax, -0x398(%rbp)
jmp 0x20d71
leaq -0x110(%rbp), %rax
movq %rax, -0x398(%rbp)
movq -0x398(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
movq -0x340(%rbp), %r8
movq -0x8(%rbp), %rax
movq 0x5240(%rax), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl $0x2c, 0x8(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1ed60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x1d5e0
movq $0x0, -0x348(%rbp)
movq $0x0, -0x350(%rbp)
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x2104f
movq -0x8(%rbp), %rax
addq $0x4e38, %rax           # imm = 0x4E38
movq %rax, -0x3d0(%rbp)
movq -0x8(%rbp), %rax
addq $0x4e18, %rax           # imm = 0x4E18
movq %rax, -0x3c8(%rbp)
movq -0x8(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x3c0(%rbp)
movq -0x8(%rbp), %rax
addq $0x4220, %rax           # imm = 0x4220
movq %rax, -0x3b8(%rbp)
leaq -0x110(%rbp), %rax
movq %rax, -0x3b0(%rbp)
movq -0x220(%rbp), %rdi
callq 0x217b0
movq -0x3d0(%rbp), %rdi
movq -0x3c8(%rbp), %rsi
movq -0x3c0(%rbp), %rdx
movq -0x3b8(%rbp), %rcx
movq -0x3b0(%rbp), %r8
movq %rax, %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, -0x348(%rbp)
movq -0x348(%rbp), %rdi
callq 0x1ed60
movq -0x8(%rbp), %rdi
movq -0x348(%rbp), %rsi
callq 0x1d5e0
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x8(%rbp), %rsi
addq $0x4220, %rsi           # imm = 0x4220
movl $0x13, %edx
callq 0x21950
movq %rax, -0x358(%rbp)
movq -0x220(%rbp), %rdi
callq 0x217b0
movq %rax, %rcx
movq -0x358(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
movq -0x358(%rbp), %r9
leaq 0x1b8c94(%rip), %r8     # 0x1d9bee
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, -0x350(%rbp)
movq -0x8(%rbp), %rdi
movq -0x350(%rbp), %rsi
callq 0x1d5e0
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x4220, %rdx           # imm = 0x4220
movq -0x358(%rbp), %rcx
callq 0x1a320
movl %eax, -0x35c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x330(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl -0x35c(%rbp), %esi
callq 0x169a0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x358(%rbp), %rsi
movl $0x2c, %edx
callq 0x182e0
movq -0x8(%rbp), %rdi
movq -0x350(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rax
addq $0x4e70, %rax           # imm = 0x4E70
movq %rax, -0x3a8(%rbp)
movq -0x358(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x39c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x358(%rbp), %rsi
callq 0x21fe0
movq -0x3a8(%rbp), %rdi
movl -0x39c(%rbp), %esi
movl %eax, %edx
callq 0x17120
movq $0x0, -0x368(%rbp)
movsbl -0x210(%rbp), %eax
cmpl $0x0, %eax
je 0x2115b
movq $0x0, -0x370(%rbp)
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x21096
movq -0x220(%rbp), %rdi
callq 0x217e0
movq %rax, -0x370(%rbp)
jmp 0x210ca
movq -0x220(%rbp), %rax
cmpl $0x14, (%rax)
jne 0x210b6
movq -0x8(%rbp), %rax
movq 0x5270(%rax), %rax
movq %rax, -0x370(%rbp)
jmp 0x210c8
movq -0x220(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x370(%rbp)
jmp 0x210ca
testb $0x1, -0x211(%rbp)
je 0x210fc
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x8(%rbp), %rsi
addq $0x4220, %rsi           # imm = 0x4220
movq -0x370(%rbp), %rdx
callq 0x21fa0
movq %rax, -0x370(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e38, %rdi           # imm = 0x4E38
movq -0x8(%rbp), %rsi
addq $0x4e18, %rsi           # imm = 0x4E18
movq -0x8(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
movq -0x8(%rbp), %rcx
addq $0x4220, %rcx           # imm = 0x4220
leaq -0x210(%rbp), %r8
movq -0x370(%rbp), %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x1a450
movq %rax, -0x368(%rbp)
movq -0x8(%rbp), %rdi
movq -0x368(%rbp), %rsi
callq 0x1d5e0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x188a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl $0x7, %esi
callq 0x16fa0
movq -0x8(%rbp), %rdi
movq -0x328(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl $0x7, %esi
callq 0x16fa0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl $0x2f, %esi
movl $0x7, %edx
xorl %ecx, %ecx
callq 0x17790
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x188c0
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x21284
movq -0x8(%rbp), %rdi
movq -0x350(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl $0x7, %esi
callq 0x16fa0
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x17b00
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x348(%rbp), %rax
movq 0x108(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
movq -0x8(%rbp), %rdi
movq -0x348(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x348(%rbp), %rax
movq 0x108(%rax), %rsi
callq 0x17500
cmpq $0x0, -0x368(%rbp)
je 0x21465
movq -0x8(%rbp), %rdi
movq -0x330(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x330(%rbp), %rax
movq 0x108(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
movq -0x220(%rbp), %rax
cmpl $0x15, (%rax)
jne 0x21300
movq -0x8(%rbp), %rdi
movq -0x348(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x348(%rbp), %rax
movq 0x108(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
jmp 0x21325
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movl $0x7, %esi
callq 0x16fa0
movq -0x220(%rbp), %rax
movl (%rax), %eax
addl $-0x12, %eax
movl %eax, %ecx
movq %rcx, -0x3d8(%rbp)
subl $0x3, %eax
ja 0x2140c
movq -0x3d8(%rbp), %rax
leaq 0x1b8667(%rip), %rcx    # 0x1d99b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
addq $0x4e70, %rax           # imm = 0x4E70
movq %rax, -0x3e0(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x220(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x21fe0
movq -0x3e0(%rbp), %rdi
movl %eax, %esi
movq -0x220(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x179b0
jmp 0x2140e
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
callq 0x17b00
jmp 0x2140e
movq -0x8(%rbp), %rax
addq $0x4e70, %rax           # imm = 0x4E70
movq %rax, -0x3e8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4e18, %rdi           # imm = 0x4E18
movq -0x8(%rbp), %rax
movq 0x5270(%rax), %rsi
callq 0x21fe0
movq -0x3e8(%rbp), %rdi
movl %eax, %esi
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
callq 0x179b0
jmp 0x2140e
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x220(%rbp), %rsi
callq 0x17b50
jmp 0x2140e
jmp 0x2140e
testb $0x1, -0x211(%rbp)
jne 0x21437
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x368(%rbp), %rax
movq 0x108(%rax), %rax
movl (%rax), %esi
callq 0x16fa0
movq -0x8(%rbp), %rdi
movq -0x368(%rbp), %rsi
callq 0xd010
movq -0x8(%rbp), %rdi
addq $0x4e70, %rdi           # imm = 0x4E70
movq -0x368(%rbp), %rax
movq 0x108(%rax), %rsi
callq 0x17500
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
nop