// File: Bartor[P]kompilator/middle/abstract_assembler/AbstractAssembler.cpp
// Function: AbstractAssembler::resolve(AbstractIdentifier&, bool)
Resolution *AbstractAssembler::resolve(AbstractIdentifier &identifier, bool checkInit = true) {
    Variable *var = scopedVariables->resolveVariable(identifier.name);
    if (checkInit && !var->initialized) {
        std::cout << "   [w] Variable " << var->name << " may not have been initialized" << std::endl;
        warning = true;
    }
    var->initialized = true; // assume it was initialized at this point

    if (auto numVar = dynamic_cast<NumberVariable *>(var)) {
        try {
            VariableIdentifier &varId = dynamic_cast<VariableIdentifier &>(identifier); // check if the identifier was actually a var id

            return new Resolution(
                    *new InstructionList(),
                    numVar->getAddress(),
                    VARIABLE,
                    false,
                    0, // zero temp vars used
                    !numVar->readOnly // if it's readOnly, it's not writable -- used for iterators
            );
        } catch (std::bad_cast _) {
            throw "Trying to access a number variable like an array";
        }
    } else if (auto arrayVar = dynamic_cast<NumberArrayVariable *>(var)) {
        try { // ACCESS VALUE - a[0]
            AccessIdentifier &accId = dynamic_cast<AccessIdentifier &>(identifier);

            if ((accId.index < arrayVar->start || accId.index > arrayVar->end) && !arrayVar->warned) {
                std::cout << "   [w] Trying to access " + arrayVar->toString() + " at index " + std::to_string(accId.index) << "; you won't be warned about this array anymore" << std::endl;
                warning = true;
                arrayVar->warned = true;
            }

            ResolvableAddress &address = *new ResolvableAddress(arrayVar->getAddress().getAddress()); // copy address
            address.setOffset(accId.index - arrayVar->start); // set proper offset

            return new Resolution(
                    *new InstructionList(),
                    address,
                    CONSTANT_ARRAY,
                    false
            );
        } catch (std::bad_cast _) {
            try { // VARIABLE ACCESS VALUE - a[b]
                VariableAccessIdentifier &varAccId = dynamic_cast<VariableAccessIdentifier &>(identifier);

                ResolvableAddress &startValueAddress = constants->getConstant(arrayVar->start)->getAddress(); // arr start
                Variable *variable = scopedVariables->resolveVariable(varAccId.accessName); // "b" variable
                if (!variable->initialized) {
                    std::cout << "   [w] Variable " << variable->name << " may not have been initialized" << std::endl;
                    warning = true;
                }
                variable->initialized = true; // assume it was initialized at this point

                ResolvableAddress &arrAddressAddress = constants->getConstant(arrayVar->getAddress().getAddress())->getAddress();

                InstructionList &instructionList = *new InstructionList();

                Load *load = new Load(variable->getAddress()); // load value of b
                Sub *sub = new Sub(startValueAddress); // subtract value of starting index
                Add *add = new Add(arrAddressAddress); // add value of array address

                instructionList.append(load)
                        .append(sub)
                        .append(add);

                return new Resolution(
                        instructionList,
                        *new ResolvableAddress(),
                        VARIABLE_ARRAY,
                        true
                );
            } catch (std::bad_cast __) {
                throw "Trying to use array identifier as variable";
            }
        }
    } else throw "Variable resolution error";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x246a0
movq %rax, -0x28(%rbp)
testb $0x1, -0x19(%rbp)
je 0x13f45
movq -0x28(%rbp), %rax
testb $0x1, 0x10(%rax)
jne 0x13f45
movq 0x2d0c7(%rip), %rdi     # 0x40fc8
leaq 0x1e61a(%rip), %rsi     # 0x32522
callq 0x6250
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x6240
movq %rax, %rdi
leaq 0x1e60c(%rip), %rsi     # 0x32533
callq 0x6250
movq %rax, %rdi
movq 0x2d05a(%rip), %rsi     # 0x40f90
callq 0x6280
leaq 0x2d520(%rip), %rax     # 0x41462
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x10(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, %rax
je 0x13f85
movq -0x170(%rbp), %rdi
leaq 0x2c6ec(%rip), %rsi     # 0x40658
leaq 0x2c77d(%rip), %rdx     # 0x406f0
xorl %eax, %eax
movl %eax, %ecx
callq 0x62f0
movq %rax, -0x178(%rbp)
jmp 0x13f90
xorl %eax, %eax
movq %rax, -0x178(%rbp)
jmp 0x13f90
movq -0x178(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x14140
movq -0x18(%rbp), %rdi
leaq 0x2c10f(%rip), %rsi     # 0x400c0
leaq 0x2c150(%rip), %rdx     # 0x40108
xorl %eax, %eax
movl %eax, %ecx
callq 0x62f0
movq %rax, -0x180(%rbp)
cmpq $0x0, %rax
jne 0x13fd5
callq 0x6530
jmp 0x13fd5
movq -0x180(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x28, %edi
callq 0x6260
movq %rax, -0x188(%rbp)
jmp 0x13ff3
movl $0x20, %edi
callq 0x6260
movq %rax, -0x190(%rbp)
jmp 0x14006
movq -0x190(%rbp), %rdi
callq 0x2b0c0
jmp 0x14014
movq -0x30(%rbp), %rdi
callq 0x25230
movq %rax, -0x198(%rbp)
jmp 0x14026
movq -0x198(%rbp), %rdx
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdi
movq -0x30(%rbp), %rax
movb 0x28(%rax), %al
notb %al
movzbl %al, %ecx
andl $0x1, %ecx
movq %rsp, %rax
movl %ecx, (%rax)
xorl %r8d, %r8d
movl %r8d, %r9d
movl $0x1, %ecx
callq 0x20490
jmp 0x14061
movq -0x188(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x14a79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x140bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x140aa
movq -0x190(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
movq -0x188(%rbp), %rdi
movl $0x28, %esi
callq 0x6270
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x14a86
movq -0x40(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x6360
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x203d0
movq -0x1a0(%rbp), %rdi
callq 0x60f0
movl $0x8, %edi
callq 0x6130
movq %rax, %rdi
leaq 0x1e44b(%rip), %rax     # 0x32552
movq %rax, (%rdi)
movq 0x2ce87(%rip), %rsi     # 0x40f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6490
jmp 0x14a97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6500
callq 0x6450
jmp 0x1413b
jmp 0x14a86
movq -0x28(%rbp), %rax
movq %rax, -0x1a8(%rbp)
cmpq $0x0, %rax
je 0x14178
movq -0x1a8(%rbp), %rdi
leaq 0x2c4f9(%rip), %rsi     # 0x40658
leaq 0x2c5ca(%rip), %rdx     # 0x40730
xorl %eax, %eax
movl %eax, %ecx
callq 0x62f0
movq %rax, -0x1b0(%rbp)
jmp 0x14183
xorl %eax, %eax
movq %rax, -0x1b0(%rbp)
jmp 0x14183
movq -0x1b0(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x14a4e
movq -0x18(%rbp), %rdi
leaq 0x2bf1c(%rip), %rsi     # 0x400c0
leaq 0x2bfa5(%rip), %rdx     # 0x40150
xorl %eax, %eax
movl %eax, %ecx
callq 0x62f0
movq %rax, -0x1b8(%rbp)
cmpq $0x0, %rax
jne 0x141c8
callq 0x6530
jmp 0x141c8
movq -0x1b8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jl 0x141fb
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jle 0x143b2
movq -0x58(%rbp), %rax
testb $0x1, 0x40(%rax)
jne 0x143b2
movq -0x58(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0xe0(%rbp), %rdi
callq *%rax
jmp 0x1421e
leaq 0x1e35e(%rip), %rsi     # 0x32583
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0xf5b0
jmp 0x1423a
leaq 0x1e35b(%rip), %rdx     # 0x3259c
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xf310
jmp 0x14256
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x100(%rbp), %rdi
callq 0xf480
jmp 0x1426c
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0xf3b0
jmp 0x14285
movq 0x2cd3c(%rip), %rdi     # 0x40fc8
leaq -0x80(%rbp), %rsi
callq 0x6240
movq %rax, -0x1c0(%rbp)
jmp 0x1429e
movq -0x1c0(%rbp), %rdi
leaq 0x1e2fb(%rip), %rsi     # 0x325a7
callq 0x6250
movq %rax, -0x1c8(%rbp)
jmp 0x142ba
movq -0x1c8(%rbp), %rdi
movq 0x2ccc8(%rip), %rsi     # 0x40f90
callq 0x6280
jmp 0x142cf
leaq -0x80(%rbp), %rdi
callq 0x6598
leaq -0x100(%rbp), %rdi
callq 0x6598
leaq -0xa0(%rbp), %rdi
callq 0x6598
leaq -0xc0(%rbp), %rdi
callq 0x6598
leaq -0xe0(%rbp), %rdi
callq 0x6598
leaq 0x2d153(%rip), %rax     # 0x41462
movb $0x1, (%rax)
movq -0x58(%rbp), %rax
movb $0x1, 0x40(%rax)
jmp 0x143b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x144ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x143a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14395
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14389
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1437d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6598
leaq -0x100(%rbp), %rdi
callq 0x6598
leaq -0xa0(%rbp), %rdi
callq 0x6598
leaq -0xc0(%rbp), %rdi
callq 0x6598
leaq -0xe0(%rbp), %rdi
callq 0x6598
jmp 0x144ff
movl $0x10, %edi
callq 0x6260
movq %rax, -0x1d0(%rbp)
jmp 0x143c5
movq -0x58(%rbp), %rdi
callq 0x25230
movq %rax, -0x1d8(%rbp)
jmp 0x143d7
movq -0x1d8(%rbp), %rdi
callq 0x24490
movq %rax, -0x1e0(%rbp)
jmp 0x143ec
movq -0x1e0(%rbp), %rsi
movq -0x1d0(%rbp), %rdi
callq 0x1fa40
jmp 0x14401
movq -0x1d0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rax
subq %rax, %rsi
callq 0x24470
jmp 0x14430
movl $0x28, %edi
callq 0x6260
movq %rax, -0x1e8(%rbp)
jmp 0x14443
movl $0x20, %edi
callq 0x6260
movq %rax, -0x1f0(%rbp)
jmp 0x14456
movq -0x1f0(%rbp), %rdi
callq 0x2b0c0
jmp 0x14464
movq -0x1f0(%rbp), %rsi
movq -0x1e8(%rbp), %rdi
movq -0x108(%rbp), %rdx
movq %rsp, %rax
movl $0x1, (%rax)
xorl %r8d, %r8d
movl %r8d, %r9d
movl $0x2, %ecx
callq 0x20490
jmp 0x14494
movq -0x1e8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x14a79
movq -0x1d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x10, %esi
callq 0x6270
jmp 0x144ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x144ee
movq -0x1f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
movq -0x1e8(%rbp), %rdi
movl $0x28, %esi
callq 0x6270
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x14a86
movq -0x40(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x6360
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0x203d0
movq -0x200(%rbp), %rdi
callq 0x60f0
movq -0x18(%rbp), %rdi
leaq 0x2bb7b(%rip), %rsi     # 0x400c0
leaq 0x2bc4c(%rip), %rdx     # 0x40198
xorl %eax, %eax
movl %eax, %ecx
callq 0x62f0
movq %rax, -0x1f8(%rbp)
cmpq $0x0, %rax
jne 0x14569
callq 0x6530
jmp 0x14569
movq -0x168(%rbp), %rax
movq -0x1f8(%rbp), %rcx
movq %rcx, -0x118(%rbp)
movq 0x30(%rax), %rdi
movq -0x58(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x23910
movq %rax, -0x208(%rbp)
jmp 0x14598
movq -0x208(%rbp), %rdi
callq 0x230c0
movq %rax, -0x210(%rbp)
jmp 0x145ad
movq -0x168(%rbp), %rax
movq -0x210(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movq 0x28(%rax), %rdi
movq -0x118(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x246a0
movq %rax, -0x218(%rbp)
jmp 0x145df
movq -0x218(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
testb $0x1, 0x10(%rax)
jne 0x14688
movq 0x2c9c3(%rip), %rdi     # 0x40fc8
leaq 0x1df16(%rip), %rsi     # 0x32522
callq 0x6250
movq %rax, -0x220(%rbp)
jmp 0x1461a
movq -0x220(%rbp), %rdi
movq -0x128(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x6240
movq %rax, -0x228(%rbp)
jmp 0x1463a
movq -0x228(%rbp), %rdi
leaq 0x1deeb(%rip), %rsi     # 0x32533
callq 0x6250
movq %rax, -0x230(%rbp)
jmp 0x14656
movq -0x230(%rbp), %rdi
movq 0x2c92c(%rip), %rsi     # 0x40f90
callq 0x6280
jmp 0x1466b
leaq 0x2cdf0(%rip), %rax     # 0x41462
movb $0x1, (%rax)
jmp 0x14688
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1498e
movq -0x168(%rbp), %rax
movq -0x128(%rbp), %rcx
movb $0x1, 0x10(%rcx)
movq 0x30(%rax), %rax
movq %rax, -0x240(%rbp)
movq -0x58(%rbp), %rdi
callq 0x25230
movq %rax, -0x238(%rbp)
jmp 0x146b7
movq -0x238(%rbp), %rdi
callq 0x24490
movq %rax, -0x248(%rbp)
jmp 0x146cc
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rdi
callq 0x23910
movq %rax, -0x250(%rbp)
jmp 0x146e8
movq -0x250(%rbp), %rdi
callq 0x230c0
movq %rax, -0x258(%rbp)
jmp 0x146fd
movq -0x258(%rbp), %rax
movq %rax, -0x130(%rbp)
movl $0x20, %edi
callq 0x6260
movq %rax, -0x260(%rbp)
jmp 0x1471e
movq -0x260(%rbp), %rdi
callq 0x2b0c0
jmp 0x1472c
movq -0x260(%rbp), %rax
movq %rax, -0x138(%rbp)
movl $0x20, %edi
callq 0x6260
movq %rax, -0x268(%rbp)
jmp 0x1474d
movq -0x128(%rbp), %rdi
callq 0x25230
movq %rax, -0x270(%rbp)
jmp 0x14762
movq -0x270(%rbp), %rsi
movq -0x268(%rbp), %rdi
callq 0x201a0
jmp 0x14777
movq -0x268(%rbp), %rax
movq %rax, -0x140(%rbp)
movl $0x20, %edi
callq 0x6260
movq %rax, -0x278(%rbp)
jmp 0x14798
movq -0x278(%rbp), %rdi
movq -0x120(%rbp), %rsi
callq 0x20220
jmp 0x147ad
movq -0x278(%rbp), %rax
movq %rax, -0x148(%rbp)
movl $0x20, %edi
callq 0x6260
movq %rax, -0x280(%rbp)
jmp 0x147ce
movq -0x280(%rbp), %rdi
movq -0x130(%rbp), %rsi
callq 0x20410
jmp 0x147e3
movq -0x280(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x138(%rbp), %rdi
movq -0x140(%rbp), %rsi
callq 0x2b3a0
movq %rax, -0x288(%rbp)
jmp 0x1480d
movq -0x288(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0x2b3a0
movq %rax, -0x290(%rbp)
jmp 0x14829
movq -0x290(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x2b3a0
jmp 0x1483e
movl $0x28, %edi
callq 0x6260
movq %rax, -0x298(%rbp)
jmp 0x14851
movq -0x138(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movl $0x10, %edi
callq 0x6260
movq %rax, -0x2a0(%rbp)
jmp 0x14872
movq -0x2a0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1fa40
jmp 0x14884
movq -0x2a0(%rbp), %rdx
movq -0x2a8(%rbp), %rsi
movq -0x298(%rbp), %rdi
movq %rsp, %rax
movl $0x1, (%rax)
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %ecx
movl $0x1, %r8d
callq 0x20490
jmp 0x148b9
movq -0x298(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x154(%rbp)
jmp 0x14a16
movq -0x260(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
jmp 0x1498e
movq -0x268(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
jmp 0x1498e
movq -0x278(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
jmp 0x1498e
movq -0x280(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x20, %esi
callq 0x6270
jmp 0x1498e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1497d
movq -0x2a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x10, %esi
callq 0x6270
movq -0x298(%rbp), %rdi
movl $0x28, %esi
callq 0x6270
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x14a39
movq -0x40(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x6360
movq %rax, %rsi
leaq -0x160(%rbp), %rdi
callq 0x203d0
movq -0x2b0(%rbp), %rdi
callq 0x60f0
movl $0x8, %edi
callq 0x6130
movq %rax, %rdi
leaq 0x1dbf9(%rip), %rax     # 0x325d6
movq %rax, (%rdi)
movq 0x2c5b1(%rip), %rsi     # 0x40f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6490
jmp 0x14a97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x6500
callq 0x6450
jmp 0x14a14
jmp 0x14a39
leaq -0x110(%rbp), %rdi
callq 0x6500
callq 0x6450
movl -0x154(%rbp), %eax
testl %eax, %eax
je 0x14a35
jmp 0x14a33
jmp 0x14a79
jmp 0x14a37
jmp 0x14a75
leaq -0x110(%rbp), %rdi
callq 0x6500
callq 0x6450
jmp 0x14a4c
jmp 0x14a86
movl $0x8, %edi
callq 0x6130
movq %rax, %rdi
leaq 0x1db9f(%rip), %rax     # 0x32601
movq %rax, (%rdi)
movq 0x2c52c(%rip), %rsi     # 0x40f98
xorl %eax, %eax
movl %eax, %edx
callq 0x6490
jmp 0x14a77
ud2
movq -0x8(%rbp), %rax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x64d0
movq %rax, %rdi
callq 0x9470
nopw (%rax,%rax)