// File: /workspace/github_cpp_makefile_star2_O1/Bartor[P]kompilator/middle/abstract_assembler/AbstractAssembler.cpp
// Function: AbstractAssembler::assembleCommands(CommandList&)
SimpleResolution *AbstractAssembler::assembleCommands(CommandList &commandList) {
    InstructionList &instructions = *new InstructionList();

    for (const auto &command : commandList.commands) {
        long long tempVars = 0;

        if (auto commandList = dynamic_cast<CommandList *>(command)) { // NESTED COMMANDLIST
            SimpleResolution *assmebledCommands = assembleCommands(*commandList);
            instructions.append(assmebledCommands->instructions);
            tempVars += assmebledCommands->temporaryVars;
        } else if (auto readNode = dynamic_cast<Read *>(command)) { // READ
            Resolution *idRes = resolve(readNode->identifier, false);

            if (!idRes->writable) throw "Trying to read to non-writable variable " + readNode->identifier.name;

            Get *get = new Get();
            if (idRes->indirect) {
                TemporaryVariable *tempAddressVar = new TemporaryVariable(TEMPORARY_NAMES, *new ResolvableAddress());
                scopedVariables->pushVariableScope(tempAddressVar);

                instructions.append(idRes->instructions).append(new Store(tempAddressVar->getAddress())).append(get).append(new Storei(tempAddressVar->getAddress()));
                tempVars += 1;
            } else {
                instructions.append(get).append(new Store(idRes->address));
            }

            tempVars += idRes->temporaryVars;
        } else if (auto writeNode = dynamic_cast<Write *>(command)) { // WRITE
            Resolution *valRes = resolve(writeNode->value);
            Put *put = new Put();

            if (valRes->indirect) {
                instructions.append(valRes->instructions).append(new Loadi(primaryAccumulator)).append(put);
            } else {
                instructions.append(new Load(valRes->address)).append(put);
            }

            tempVars += valRes->temporaryVars;
        } else if (auto assignNode = dynamic_cast<Assignment *>(command)) { // ASSIGN
            Resolution *idRes = resolve(assignNode->identifier, false);

            if (!idRes->writable) throw "Trying to assign to non-writable variable " + assignNode->identifier.name;

            SimpleResolution *expRes = assembleExpression(assignNode->expression);

            if (idRes->indirect) {
                TemporaryVariable *tempAddressVar = new TemporaryVariable(TEMPORARY_NAMES, *new ResolvableAddress());
                scopedVariables->pushVariableScope(tempAddressVar);

                instructions.append(idRes->instructions).append(new Store(tempAddressVar->getAddress())).append(expRes->instructions).append(new Storei(tempAddressVar->getAddress()));
                tempVars += 1;
            } else {
                instructions.append(expRes->instructions).append(new Store(idRes->address));
            }

            tempVars += idRes->temporaryVars + expRes->temporaryVars;
        } else if (auto ifNode = dynamic_cast<If *>(command)) { // IF
            SimpleResolution *codeResolution = assembleCommands(ifNode->commands); // assemble inner instructions
            SimpleResolution *conditionResolution = assembleCondition(ifNode->condition, codeResolution->instructions); // assemble condition

            instructions.append(conditionResolution->instructions) // add condition code
                    .append(codeResolution->instructions); // add inner block code

            tempVars += conditionResolution->temporaryVars;
        } else if (auto ifElseNode = dynamic_cast<IfElse *>(command)) { // IF ELSE
            SimpleResolution *ifCodeResolution = assembleCommands(ifElseNode->commands);
            SimpleResolution *conditionResolution = assembleCondition(ifElseNode->condition, ifCodeResolution->instructions);
            SimpleResolution *elseCodeResolution = assembleCommands(ifElseNode->elseCommands);

            Jump *jump = new Jump(elseCodeResolution->instructions.end());
            ifCodeResolution->instructions.append(jump);

            instructions.append(conditionResolution->instructions)
                    .append(ifCodeResolution->instructions)
                    .append(elseCodeResolution->instructions);

            tempVars += conditionResolution->temporaryVars;
        } else if (auto whileNode = dynamic_cast<While *>(command)) { // WHILE
            SimpleResolution *codeResolution = assembleCommands(whileNode->commands);

            if (whileNode->doWhile) {
                InstructionList *jumpBlock = new InstructionList();
                Jump *jump = new Jump(codeResolution->instructions.start());
                jumpBlock->append(jump);

                SimpleResolution *conditionResolution = assembleCondition(whileNode->condition, *jumpBlock);
                instructions.append(codeResolution->instructions)
                        .append(conditionResolution->instructions)
                        .append(*jumpBlock);

                tempVars += conditionResolution->temporaryVars;
            } else {
                SimpleResolution *conditionResolution = assembleCondition(whileNode->condition, codeResolution->instructions);
                Jump *jump = new Jump(conditionResolution->instructions.start());
                codeResolution->instructions.append(jump);

                instructions.append(conditionResolution->instructions)
                        .append(codeResolution->instructions);

                tempVars += conditionResolution->temporaryVars;
            }
        } else if (auto forNode = dynamic_cast<For *>(command)) {
            NumberVariable *iterator = new NumberVariable(
                    forNode->variableName,
                    *new ResolvableAddress(),
                    true
            );
            iterator->initialized = true;
            scopedVariables->pushVariableScope(iterator); // create iterator BEFORE commands would use it
            tempVars += 1;

            Resolution *startRes = resolve(forNode->startValue); // resolve start and end
            Resolution *endRes = resolve(forNode->endValue);
            tempVars += startRes->temporaryVars + endRes->temporaryVars;

            ResolvableAddress *iterationEndAddress; // we will need it in comparing

            if (endRes->type == CONSTANT) {
                iterationEndAddress = &endRes->address;
            } else {
                TemporaryVariable *iterationEnd = new TemporaryVariable(TEMPORARY_NAMES, *new ResolvableAddress());
                scopedVariables->pushVariableScope(iterationEnd);
                tempVars += 1;

                iterationEndAddress = &iterationEnd->getAddress();

                instructions.append(endRes->instructions)
                        .append(endRes->indirect ? static_cast<Instruction *>(new Loadi(primaryAccumulator)) : static_cast<Instruction *>(new Load(endRes->address)))
                        .append(new Store(*iterationEndAddress));
            }

            SimpleResolution *codeResolution = assembleCommands(forNode->commands); // assemble iterated commands

            InstructionList &forLoopInstructions = *new InstructionList();
            forLoopInstructions.append(new Sub(*iterationEndAddress))
                    .append(forNode->reversed ? static_cast<Instruction *>(new Jneg(codeResolution->instructions.end())) : static_cast<Instruction *>(new Jpos(codeResolution->instructions.end())));

            codeResolution->instructions.append(new Load(iterator->getAddress()))
                    .append(forNode->reversed ? static_cast<Instruction *>(new Dec()) : static_cast<Instruction *>(new Inc()))
                    .append(new Store(iterator->getAddress()))
                    .append(new Jump(forLoopInstructions.start()));

            instructions.append(startRes->instructions) // load start instructions
                    .append(startRes->indirect ? static_cast<Instruction *>(new Loadi(primaryAccumulator)) : static_cast<Instruction *>(new Load(startRes->address)))
                    .append(new Store(iterator->getAddress())); // store it in the iterator

            instructions.append(forLoopInstructions)
                    .append(codeResolution->instructions);
        }

        scopedVariables->popVariableScope(tempVars);
    }

    return new SimpleResolution(
            instructions,
            0
    );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movq %rdi, %r13
movl $0x20, %edi
callq 0x51f0
movq %rax, %r14
movq %rax, %rdi
callq 0x1ac28
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %rax
movq %rax, -0xd8(%rbp)
cmpq %rax, %r15
je 0xff97
leaq 0x8(%r13), %rax
movq %rax, -0x88(%rbp)
leaq 0x183df(%rip), %rax     # 0x276d0
addq $0x10, %rax
movq %rax, -0xc0(%rbp)
leaq 0x18705(%rip), %rax     # 0x27a08
addq $0x10, %rax
movq %rax, -0xb8(%rbp)
leaq 0x18883(%rip), %rax     # 0x27b98
addq $0x10, %rax
movq %rax, -0xb0(%rbp)
leaq 0x18551(%rip), %rax     # 0x27878
addq $0x10, %rax
movq %rax, -0x60(%rbp)
leaq 0x18592(%rip), %rax     # 0x278c8
addq $0x10, %rax
movq %rax, -0x40(%rbp)
leaq 0x18763(%rip), %rax     # 0x27aa8
addq $0x10, %rax
movq %rax, -0x58(%rbp)
leaq 0x185c4(%rip), %rax     # 0x27918
addq $0x10, %rax
movq %rax, -0x70(%rbp)
leaq 0x18795(%rip), %rax     # 0x27af8
addq $0x10, %rax
movq %rax, -0xa8(%rbp)
leaq 0x183db(%rip), %rax     # 0x27750
addq $0x10, %rax
movq %rax, -0x78(%rbp)
leaq 0x185e4(%rip), %rax     # 0x27968
addq $0x10, %rax
movq %rax, -0x98(%rbp)
leaq 0x188a2(%rip), %rax     # 0x27c38
addq $0x10, %rax
movq %rax, -0xc8(%rbp)
leaq 0x18840(%rip), %rax     # 0x27be8
addq $0x10, %rax
movq %rax, -0xd0(%rbp)
movq %r13, -0x30(%rbp)
movq %r14, -0x90(%rbp)
movq (%r15), %r12
testq %r12, %r12
je 0xf3e0
movq %r12, %rdi
leaq 0x17c58(%rip), %rsi     # 0x27028
leaq 0x17f19(%rip), %rdx     # 0x272f0
xorl %ecx, %ecx
callq 0x5240
jmp 0xf3e2
xorl %eax, %eax
testq %rax, %rax
je 0xf409
movq %r13, %rdi
movq %rax, %rsi
callq 0xf298
movq %rax, %rbx
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq 0x1acfc
movq (%rbx), %r12
jmp 0xf6ec
movq %r15, -0x38(%rbp)
testq %r12, %r12
je 0xf42f
movq %r12, %rdi
leaq 0x17c0c(%rip), %rsi     # 0x27028
leaq 0x1807d(%rip), %rdx     # 0x274a0
xorl %ecx, %ecx
callq 0x5240
movq %rax, %r15
jmp 0xf432
xorl %r15d, %r15d
testq %r15, %r15
je 0xf586
movq 0x8(%r15), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x100b0
cmpb $0x0, (%rax)
je 0xffbe
movq %rax, %r13
movl $0x18, %edi
callq 0x51f0
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xd0(%rbp), %rax
movq %rax, (%r12)
cmpb $0x1, 0x1(%r13)
jne 0xf5a5
movl $0x30, %edi
callq 0x51f0
movq %rax, %r15
movl $0x10, %edi
callq 0x51f0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x8(%r15)
movb $0x0, 0x10(%r15)
leaq 0x18e51(%rip), %rax     # 0x28310
movq %rax, 0x18(%r15)
movw $0x101, 0x28(%r15)      # imm = 0x101
movq -0x78(%rbp), %rax
movq %rax, (%r15)
movq $0x1, 0x20(%r15)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq %r15, %rsi
callq 0x17d40
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0x1acfc
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq %r15, %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x40(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq %rax, %rdi
movq %r12, %rsi
callq 0x1adbe
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq %r15, %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x98(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movl $0x1, %r12d
movq -0x90(%rbp), %r14
jmp 0xf5e6
testq %r12, %r12
je 0xf5f7
movq %r12, %rdi
leaq 0x17a93(%rip), %rsi     # 0x27028
leaq 0x17f4c(%rip), %rdx     # 0x274e8
xorl %ecx, %ecx
callq 0x5240
jmp 0xf5f9
movq %r14, %rdi
movq %r12, %rsi
callq 0x1adbe
movq %rax, %rbx
movl $0x20, %edi
callq 0x51f0
movq 0x18(%r13), %rcx
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1adbe
xorl %r12d, %r12d
movq -0x38(%rbp), %r15
addq 0x8(%r13), %r12
movq -0x30(%rbp), %r13
jmp 0xf6ec
xorl %eax, %eax
testq %rax, %rax
je 0xf683
movq 0x8(%rax), %rsi
movq %r13, %rdi
callq 0x10ae0
movq %rax, %r15
movl $0x18, %edi
callq 0x51f0
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0xc8(%rbp), %rax
movq %rax, (%r12)
cmpb $0x1, 0x1(%r15)
jne 0xf6a9
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x1acfc
movq %rax, %rbx
movl $0x20, %edi
callq 0x51f0
movq 0x8(%r13), %rcx
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
jmp 0xf6d1
testq %r12, %r12
je 0xf70e
movq %r12, %rdi
leaq 0x17992(%rip), %rsi     # 0x27028
leaq 0x17c9b(%rip), %rdx     # 0x27338
xorl %ecx, %ecx
callq 0x5240
movq %rax, %r15
jmp 0xf711
movl $0x20, %edi
callq 0x51f0
movq 0x18(%r15), %rcx
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x1adbe
movq %rax, %rdi
movq %r12, %rsi
callq 0x1adbe
movq 0x8(%r15), %r12
movq -0x38(%rbp), %r15
movq 0x28(%r13), %rdi
movq %r12, %rsi
callq 0x17e66
addq $0x8, %r15
cmpq -0xd8(%rbp), %r15
jne 0xf3be
jmp 0xff97
xorl %r15d, %r15d
testq %r15, %r15
je 0xf855
movq 0x8(%r15), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x100b0
cmpb $0x0, (%rax)
je 0xfff8
movq %r13, %rdi
movq %rax, %r13
movq 0x10(%r15), %rsi
callq 0x10cb0
cmpb $0x1, 0x1(%r13)
jne 0xf877
movq %rax, -0x48(%rbp)
movl $0x30, %edi
callq 0x51f0
movq %rax, %r12
movl $0x10, %edi
callq 0x51f0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x8(%r12)
movb $0x0, 0x10(%r12)
leaq 0x18b92(%rip), %rax     # 0x28310
movq %rax, 0x18(%r12)
movw $0x101, 0x28(%r12)      # imm = 0x101
movq -0x78(%rbp), %rax
movq %rax, (%r12)
movq $0x1, 0x20(%r12)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq %r12, %rsi
callq 0x17d40
movq 0x10(%r13), %rsi
movq %r14, %r15
movq %r14, %rdi
callq 0x1acfc
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq %r12, %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x40(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x1acfc
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq %r12, %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x98(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movl $0x1, %r12d
movq %r15, %r14
movq -0x38(%rbp), %r15
movq -0x48(%rbp), %rbx
jmp 0xf8c0
testq %r12, %r12
je 0xf8cc
movq %r12, %rdi
leaq 0x177c4(%rip), %rsi     # 0x27028
leaq 0x17b15(%rip), %rdx     # 0x27380
xorl %ecx, %ecx
callq 0x5240
movq %rax, %rbx
jmp 0xf8ce
movq 0x8(%rax), %rsi
movq %r14, %rdi
movq %rax, %rbx
callq 0x1acfc
movq %rax, %r15
movl $0x20, %edi
callq 0x51f0
movq 0x18(%r13), %rcx
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq %r15, %rdi
movq %rax, %rsi
callq 0x1adbe
xorl %r12d, %r12d
movq -0x38(%rbp), %r15
addq 0x8(%r13), %r12
addq (%rbx), %r12
jmp 0xf5ee
xorl %ebx, %ebx
testq %rbx, %rbx
je 0xf91a
movq 0x10(%rbx), %rsi
movq %r13, %rdi
callq 0xf298
movq 0x8(%rbx), %rsi
movq 0x8(%rax), %rbx
movq %r13, %rdi
movq %rbx, %rdx
callq 0x15df6
movq %r14, %r15
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x1acfc
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1acfc
movq (%r14), %r12
movq %r15, %r14
jmp 0xf6e8
testq %r12, %r12
je 0xf93c
movq %r12, %rdi
leaq 0x176ff(%rip), %rsi     # 0x27028
leaq 0x17a98(%rip), %rdx     # 0x273c8
xorl %ecx, %ecx
callq 0x5240
movq %rax, %r15
jmp 0xf93f
xorl %r15d, %r15d
testq %r15, %r15
je 0xf9e3
movq 0x10(%r15), %rsi
movq %r13, %rdi
callq 0xf298
movq 0x8(%r15), %rsi
movq 0x8(%rax), %r12
movq %r13, %rdi
movq %r12, %rdx
callq 0x15df6
movq %rax, %rbx
movq 0x18(%r15), %rsi
movq %r13, %rdi
callq 0xf298
movq %rax, %r13
movl $0x20, %edi
callq 0x51f0
movq %rax, %r15
movq 0x8(%r13), %r13
movq %r13, %rdi
callq 0x1acb4
movq $-0x1, 0x8(%r15)
movb $0x0, 0x10(%r15)
movq -0x58(%rbp), %rcx
movq %rcx, (%r15)
movq %rax, 0x18(%r15)
movq %r12, %rdi
movq %r15, %rsi
callq 0x1adbe
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x1acfc
movq %rax, %rdi
movq %r12, %rsi
callq 0x1acfc
movq %rax, %rdi
movq %r13, %rsi
callq 0x1acfc
movq (%rbx), %r12
movq -0x30(%rbp), %r13
jmp 0xf6e8
testq %r12, %r12
je 0xfa05
movq %r12, %rdi
leaq 0x17636(%rip), %rsi     # 0x27028
leaq 0x17a17(%rip), %rdx     # 0x27410
xorl %ecx, %ecx
callq 0x5240
movq %rax, %r13
jmp 0xfa08
xorl %r13d, %r13d
movq -0x38(%rbp), %r15
testq %r13, %r13
je 0xfac4
movq 0x10(%r13), %rsi
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0xf298
movq %rax, %r15
cmpb $0x1, 0x18(%r13)
jne 0xfaea
movl $0x20, %edi
callq 0x51f0
movq %rax, %r12
movq %rax, %rdi
callq 0x1ac28
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq 0x8(%r15), %r15
movq %r15, %rdi
callq 0x1acbe
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq -0x58(%rbp), %rcx
movq %rcx, (%rbx)
movq %rax, 0x18(%rbx)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq 0x8(%r13), %rsi
movq -0x30(%rbp), %r13
movq %r13, %rdi
movq %r12, %rdx
callq 0x15df6
movq %r12, %rbx
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x1acfc
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x1acfc
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1acfc
jmp 0xfb58
testq %r12, %r12
je 0xfb61
movq %r12, %rdi
leaq 0x17551(%rip), %rsi     # 0x27028
leaq 0x1797a(%rip), %rdx     # 0x27458
xorl %ecx, %ecx
callq 0x5240
movq %rax, %r12
jmp 0xfb64
movq 0x8(%r13), %rsi
movq 0x8(%r15), %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15df6
movq %rax, %r12
movl $0x20, %edi
callq 0x51f0
movq %rax, %r13
movq 0x8(%r12), %rbx
movq %rbx, %rdi
callq 0x1acbe
movq $-0x1, 0x8(%r13)
movb $0x0, 0x10(%r13)
movq -0x58(%rbp), %rcx
movq %rcx, (%r13)
movq %rax, 0x18(%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1adbe
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1acfc
movq %rax, %rdi
movq %r15, %rsi
callq 0x1acfc
movq -0x30(%rbp), %r13
movq (%r12), %r12
jmp 0xf6e8
xorl %r12d, %r12d
movq -0x30(%rbp), %r13
testq %r12, %r12
je 0xfcf5
movl $0x30, %edi
callq 0x51f0
movq %rax, %rbx
movl $0x10, %edi
callq 0x51f0
leaq 0x8(%r12), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x8(%rbx)
movq %rcx, 0x18(%rbx)
movb $0x1, %cl
movb %cl, 0x28(%rbx)
movq -0xc0(%rbp), %rax
movq %rax, (%rbx)
movq $0x1, 0x20(%rbx)
movb %cl, 0x10(%rbx)
movq 0x28(%r13), %rdi
movq %rbx, %rsi
callq 0x17d40
movq 0x28(%r12), %rsi
movq %r13, %rdi
callq 0x10ae0
movq %rax, %r15
movq %r12, -0x50(%rbp)
movq 0x30(%r12), %rsi
movq %r13, %rdi
callq 0x10ae0
movq %rax, %r13
movq 0x8(%rax), %r12
movq %r15, -0xa0(%rbp)
addq 0x8(%r15), %r12
cmpl $0x0, 0x20(%rax)
movq %rbx, -0x48(%rbp)
je 0xfcfd
movl $0x30, %edi
callq 0x51f0
movq %rax, %r15
movl $0x10, %edi
callq 0x51f0
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, 0x8(%r15)
xorl %eax, %eax
movb %al, 0x10(%r15)
leaq 0x186e0(%rip), %rax     # 0x28310
movq %rax, 0x18(%r15)
movw $0x101, 0x28(%r15)      # imm = 0x101
movq -0x78(%rbp), %rax
movq %rax, (%r15)
movq $0x1, 0x20(%r15)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq %r15, %rsi
callq 0x17d40
movq %r15, %rdi
callq 0x180e8
movq %rax, %r15
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0x1acfc
movq %rax, %rbx
movb 0x1(%r13), %al
xorl %ecx, %ecx
cmpb %cl, %al
movq -0x60(%rbp), %r14
cmovneq -0x70(%rbp), %r14
addq $0x18, %r13
cmpb %cl, %al
cmovneq -0x88(%rbp), %r13
addq $0x2, %r12
movl $0x20, %edi
callq 0x51f0
movq (%r13), %rcx
movq $-0x1, %r13
movq %r13, 0x8(%rax)
xorl %edx, %edx
movb %dl, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %r14, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1adbe
movq %rax, %rbx
movl $0x20, %edi
callq 0x51f0
movq %r13, 0x8(%rax)
xorl %ecx, %ecx
movb %cl, 0x10(%rax)
movq %r15, 0x18(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1adbe
jmp 0xfd04
xorl %r12d, %r12d
jmp 0xf6ec
incq %r12
movq 0x18(%r13), %r15
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rbx
movq 0x38(%rbx), %rsi
callq 0xf298
movq %rax, %r13
movl $0x20, %edi
callq 0x51f0
movq %rax, %r14
movq %rax, %rdi
callq 0x1ac28
movl $0x20, %edi
callq 0x51f0
movq $-0x1, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r15, 0x18(%rax)
movq -0xb8(%rbp), %rcx
movq %rcx, (%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x1adbe
movq %rax, -0x68(%rbp)
movb 0x40(%rbx), %bl
movl $0x20, %edi
callq 0x51f0
movq %rax, %r15
movq 0x8(%r13), %rdi
cmpb $0x1, %bl
jne 0xfd87
callq 0x1acb4
movq -0xb0(%rbp), %rcx
jmp 0xfd93
callq 0x1acb4
movq -0xa8(%rbp), %rcx
movq %r14, -0x80(%rbp)
movq $-0x1, 0x8(%r15)
movb $0x0, 0x10(%r15)
movq %rax, 0x18(%r15)
movq %rcx, (%r15)
movq -0x68(%rbp), %rdi
movq %r15, %rsi
callq 0x1adbe
movq 0x8(%r13), %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
callq 0x180e8
movq $-0x1, %rcx
movq %rcx, 0x8(%rbx)
xorl %r13d, %r13d
movb %r13b, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x60(%rbp), %rax
movq %rax, (%rbx)
movq %r14, -0x68(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq %rax, %rbx
leaq 0x17ed1(%rip), %r14     # 0x27cd8
xorl %r15d, %r15d
movq -0x50(%rbp), %rax
cmpb %r13b, 0x40(%rax)
movq -0x30(%rbp), %r13
je 0xfe1f
leaq 0x17f09(%rip), %r14     # 0x27d28
movl $0x18, %edi
callq 0x51f0
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movb %r15b, 0x10(%rax)
addq $0x10, %r14
movq %r14, (%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1adbe
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x40(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq %rax, %rbx
movl $0x20, %edi
callq 0x51f0
movq %rax, %r15
movq -0x80(%rbp), %rdi
callq 0x1acbe
movq $-0x1, %rcx
movq %rcx, 0x8(%r15)
xorl %ecx, %ecx
movb %cl, 0x10(%r15)
movq -0x58(%rbp), %rcx
movq %rcx, (%r15)
movq %rax, 0x18(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1adbe
movq -0xa0(%rbp), %rbx
movq 0x10(%rbx), %rsi
movq -0x90(%rbp), %r15
movq %r15, %rdi
callq 0x1acfc
movq %rax, -0x50(%rbp)
movb 0x1(%rbx), %al
xorl %ecx, %ecx
cmpb %cl, %al
movq -0x60(%rbp), %r14
cmovneq -0x70(%rbp), %r14
addq $0x18, %rbx
cmpb %cl, %al
cmovneq -0x88(%rbp), %rbx
movl $0x20, %edi
callq 0x51f0
movq (%rbx), %rcx
movq $-0x1, %rdx
movq %rdx, 0x8(%rax)
xorl %edx, %edx
movb %dl, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %r14, (%rax)
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x1adbe
movq %rax, %r14
movl $0x20, %edi
callq 0x51f0
movq %rax, %rbx
movq -0x48(%rbp), %rdi
callq 0x180e8
movq $-0x1, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq -0x40(%rbp), %rax
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1adbe
movq %r15, %rdi
movq -0x80(%rbp), %rsi
callq 0x1acfc
movq %rax, %rdi
movq -0x68(%rbp), %rsi
callq 0x1acfc
jmp 0xf912
movl $0x10, %edi
callq 0x51f0
movq $0x0, (%rax)
movq %r14, 0x8(%rax)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x5120
movq %rax, %rbx
movq 0x8(%r15), %rax
movq 0x8(%rax), %rdx
leaq 0x10478(%rip), %rsi     # 0x20452
movq %rbx, %rdi
callq 0x16793
leaq 0x17667(%rip), %rsi     # 0x27650
movq 0x17fa8(%rip), %rdx     # 0x27f98
movq %rbx, %rdi
callq 0x53a0
movl $0x20, %edi
callq 0x5120
movq %rax, %rbx
movq 0x8(%r15), %rax
movq 0x8(%rax), %rdx
leaq 0x10467(%rip), %rsi     # 0x2047b
movq %rbx, %rdi
callq 0x16793
jmp 0xffe2
jmp 0x10051
jmp 0x10051
jmp 0x1008a
jmp 0x1007d
jmp 0x10051
jmp 0x1007d
jmp 0x1007d
jmp 0x1006e
movq %rax, %r14
movl $0x30, %esi
jmp 0x10085
movq %rax, %r14
movl $0x20, %esi
movq %r13, %rdi
jmp 0x10095
jmp 0x1007d
movq %rax, %r14
movl $0x20, %esi
jmp 0x10067
movq %rax, %r14
movl $0x20, %esi
jmp 0x10092
jmp 0x1007d
jmp 0x1007d
movq %rax, %r14
movl $0x30, %esi
movq %r12, %rdi
jmp 0x10095
jmp 0x1009c
movq %r14, %rdi
movq %rax, %r14
movl $0x20, %esi
jmp 0x10095
jmp 0x1007d
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
jmp 0x10095
movq %rax, %r14
movl $0x30, %esi
movq %r15, %rdi
callq 0x5200
jmp 0x100a7
movq %rax, %r14
movq %rbx, %rdi
callq 0x5160
movq %r14, %rdi
callq 0x53d0
nop