// File: /workspace/github_cpp_makefile_star2_O1/johan-bjareholt[P]lua-compiler/src/convert.cc
// Function: outMainBlock(std::ostream&, BBlock&)
void outMainBlock(std::ostream& ss, BBlock& startblock){
    std::stringstream headss;
    std::stringstream mainss;
    std::stringstream bodyss;
    
    // Standard functions
    headss << "// Standard functions" << std::endl;
	headss << "#include <stdlib.h>" << std::endl;
	headss << "#include <stdio.h>" << std::endl;
    headss << "long io_write(const char* msg){printf(\"%s\", msg); return 0;}" << std::endl;
    headss << "long io_write_i(long num){ printf(\"%ld\", num); return 0;}" << std::endl;
    headss << "long print(const char* msg){ printf(\"%s\\n\", msg); return 0;}" << std::endl;
    headss << "long print_i(long num){ printf(\"%ld\\n\", num);; return 0;}" << std::endl;
    headss << "long io_read(const char* msg){ long num; scanf(\"%ld\", &num); return num; }" << std::endl;
	
    mainss << "int main(){" << std::endl;

	std::set<std::string> inputSymbols = std::set<std::string>();
	
    std::set<std::string> outputSymbols = std::set<std::string>();

	bodyss << "    asm (" << std::endl;
    bodyss << "    // main" << std::endl;
    // Output global
	outBlock(startblock, bodyss, outputSymbols, inputSymbols, true, false);
    // Output functions
    for (auto funcentry : funcdefs){
        std::string funcname = funcentry.first;
        BBlock* funcblock = funcentry.second;
        outFunctionBlock(funcname, *funcblock, bodyss, outputSymbols, inputSymbols);
    }
    bodyss << std::endl;
    bodyss << pre_in << "label_end:" << post_in;
    bodyss << pre_in << "movq $0, %%rdi" << post_in;
    bodyss << pre_in << "call exit" << post_in;
    
    // Define storage variables
    headss << std::endl;
    headss << "// Variables" << std::endl;
    for (auto var : vars2){
        std::string name = var.first;
        std::string val = var.second.second;
        int type = var.second.first;
        switch (type){
            case VT_STRING:
                headss << "const char* " << name << " = " << val << ";"<< std::endl;
                break;
            case VT_INT:
            case VT_UNKNOWN:
	            headss << "long " << name << ";" << std::endl;
                break;
            case VT_POINTER:
                headss << "void* " << name << ";" << std::endl;
                break;
            case VT_FUNCTION:
            case VT_LABEL:
                break;
            default:
                std::cout << "Unknown vartype" << std::endl;
                exit(1);
                break;
        }
    }
    headss << std::endl;

    // Strings
    //mainss << "    // Strings decl" << std::endl;
    //for (std::pair<int, std::string> strp : strings){
    //    mainss << "    const char* " << "_s" << strp.first << " = " << strp.second << ";"<< std::endl;
    //}

	mainss << bodyss.str();
	mainss << "    : // Output symbols" << std::endl;
	for (auto iter = outputSymbols.begin(); iter!=outputSymbols.end(); iter++){
        if (inputSymbols.find(*iter) != inputSymbols.end()){
            inputSymbols.erase(*iter);
		    mainss << "      [" << *iter << "] \"+m\" (" << *iter << ")";
        }
        else
		    mainss << "      [" << *iter << "] \"=m\" (" << *iter << ")";
		if (std::next(iter) != outputSymbols.end())
			mainss << ",";
		mainss << std::endl;
	}
	mainss << "    : // Input symbols" << std::endl;
	for (auto iter = inputSymbols.begin(); iter!=inputSymbols.end(); iter++){
		mainss << "      [" << *iter << "] \"m\" (" << *iter << ")";
		if (std::next(iter) != inputSymbols.end())
			mainss << ",";
		mainss << std::endl;
	}

    mainss << "    : // Clobbers" << std::endl;
    mainss << "      \"cc\", \"rax\", \"rbx\", \"rcx\", \"rdx\", \"rsi\", \"rdi\", \"rsp\"" << std::endl;
    //mainss << "      ,\"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"r15\"" << std::endl;
	mainss << "    );" << std::endl;
	mainss << "    return 0;" << std::endl;
	mainss << "}" << std::endl;

    ss << headss.str();
    ss << mainss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
movq %rsi, %rbx
movq %rdi, -0x98(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x31a0
leaq -0x2c8(%rbp), %rdi
callq 0x31a0
leaq -0x5f8(%rbp), %rdi
callq 0x31a0
leaq -0x440(%rbp), %r14
leaq 0xcea6(%rip), %rsi      # 0x16338
movl $0x15, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce7d(%rip), %rsi      # 0x1634e
movl $0x13, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce52(%rip), %rsi      # 0x16362
movl $0x12, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce26(%rip), %rsi      # 0x16375
movl $0x3c, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce24(%rip), %rsi      # 0x163b2
movl $0x39, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce1f(%rip), %rsi      # 0x163ec
movl $0x3c, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce1d(%rip), %rsi      # 0x16429
movl $0x39, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xce18(%rip), %rsi      # 0x16463
movl $0x4a, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x2b8(%rbp), %rdi
leaq 0xce1d(%rip), %rsi      # 0x164ae
movl $0xb, %edx
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0xc8(%rbp), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x8(%rcx)
movaps %xmm0, 0x18(%rcx)
movaps %xmm0, -0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
xorl %eax, %eax
movq %rax, 0x20(%rcx)
leaq -0x118(%rbp), %rcx
movaps %xmm0, 0x8(%rcx)
movaps %xmm0, 0x18(%rcx)
movaps %xmm0, -0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x5e8(%rbp), %rdi
leaq 0xcd98(%rip), %rsi      # 0x164ba
movl $0x9, %edx
callq 0x32b0
movq -0x5e8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x5e8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x5e8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xcd5b(%rip), %rsi      # 0x164c4
movl $0xb, %edx
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq -0x5e8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x5e8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x5e8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movl $0x0, (%rsp)
leaq -0x470(%rbp), %rdi
leaq -0x120(%rbp), %rcx
leaq -0xd0(%rbp), %r8
movq %rbx, %rsi
leaq -0x5e8(%rbp), %rdx
movl $0x1, %r9d
callq 0xa45a
leaq -0x460(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97f6
callq 0x3230
leaq 0x15b33(%rip), %r13     # 0x1f330
movq 0x18(%r13), %rbx
addq $0x8, %r13
cmpq %r13, %rbx
je 0x98f2
leaq -0x130(%rbp), %r15
leaq -0x140(%rbp), %r14
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x4baa
movq 0x40(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x4baa
movq -0x70(%rbp), %r12
movq %r15, -0x140(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x4baa
movq %r14, %rdi
movq %r12, %rsi
leaq -0x5e8(%rbp), %rdx
leaq -0x120(%rbp), %rcx
leaq -0xd0(%rbp), %r8
callq 0xaaf3
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0x98b7
callq 0x3230
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x98c9
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x98de
callq 0x3230
movq %rbx, %rdi
callq 0x3190
movq %rax, %rbx
cmpq %r13, %rax
jne 0x981c
movq -0x5e8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x5e8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
leaq -0x440(%rbp), %r14
movsbl %al, %esi
leaq -0x5e8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq 0x15a6a(%rip), %rsi     # 0x1f3a0
movq 0x15a6b(%rip), %rdx     # 0x1f3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xcb7d(%rip), %rsi      # 0x164d0
movl $0xa, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x15a59(%rip), %rsi     # 0x1f3c0
movq 0x15a5a(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x15a23(%rip), %rsi     # 0x1f3a0
movq 0x15a24(%rip), %rdx     # 0x1f3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xcb41(%rip), %rsi      # 0x164db
movl $0xe, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x15a12(%rip), %rsi     # 0x1f3c0
movq 0x15a13(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x159dc(%rip), %rsi     # 0x1f3a0
movq 0x159dd(%rip), %rdx     # 0x1f3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xcb09(%rip), %rsi      # 0x164ea
movl $0x9, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x159cb(%rip), %rsi     # 0x1f3c0
movq 0x159cc(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xcabe(%rip), %rsi      # 0x164f4
movl $0xc, %edx
movq %r14, %rdi
callq 0x32b0
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq 0x15983(%rip), %rbx     # 0x1f3f8
leaq 0x1596c(%rip), %rax     # 0x1f3e8
cmpq %rax, %rbx
je 0x9ca6
leaq -0x38(%rbp), %r13
leaq -0xe0(%rbp), %r15
leaq 0xc835(%rip), %r12      # 0x162cc
leaq 0x20(%rbx), %rsi
leaq -0x90(%rbp), %rdi
callq 0xc776
movq %r13, -0x48(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x4baa
movq %r15, -0xf0(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x4baa
movl -0x70(%rbp), %eax
cmpq $0x5, %rax
ja 0xa2c8
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x5, %edx
leaq -0x440(%rbp), %rdi
leaq 0xca06(%rip), %rsi      # 0x16512
callq 0x32b0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x440(%rbp), %rdi
callq 0x32b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc5ba(%rip), %rsi      # 0x160f1
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
jmp 0x9c32
movl $0xc, %edx
leaq -0x440(%rbp), %rdi
leaq 0xc999(%rip), %rsi      # 0x16501
callq 0x32b0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x440(%rbp), %rdi
callq 0x32b0
movq %rax, %r14
movl $0x3, %edx
movq %rax, %rdi
leaq 0xc97b(%rip), %rsi      # 0x1650e
callq 0x32b0
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq %r14, %rdi
callq 0x32b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc531(%rip), %rsi      # 0x160f1
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
jmp 0x9c32
movl $0x6, %edx
leaq -0x440(%rbp), %rdi
leaq 0xc92a(%rip), %rsi      # 0x16518
callq 0x32b0
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x440(%rbp), %rdi
callq 0x32b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xc4d8(%rip), %rsi      # 0x160f1
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x9c56
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x9c64
callq 0x3230
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x9c76
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x9c8b
callq 0x3230
movq %rbx, %rdi
callq 0x3190
movq %rax, %rbx
leaq 0x1574b(%rip), %rax     # 0x1f3e8
cmpq %rax, %rbx
jne 0x9a97
movq -0x440(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x440(%rbp), %rbx
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x5e0(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3400
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9d17
callq 0x3230
leaq 0xc811(%rip), %rsi      # 0x1652f
movl $0x17, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq -0x108(%rbp), %rbx
leaq -0x118(%rbp), %rax
cmpq %rax, %rbx
je 0x9ee2
leaq -0xd0(%rbp), %r14
leaq 0xe005(%rip), %r12      # 0x17d8f
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xcf3e
leaq -0xc8(%rbp), %rcx
cmpq %rcx, %rax
je 0x9e00
movq %r14, %rdi
movq %r15, %rsi
callq 0xcfdc
movq %r14, %rdi
movq %rax, %rsi
callq 0xd08e
movl $0x7, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xc779(%rip), %rsi      # 0x16547
callq 0x32b0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq %rax, %r13
movl $0x8, %edx
movq %rax, %rdi
leaq 0xc756(%rip), %rsi      # 0x1654f
callq 0x32b0
jmp 0x9e43
movl $0x7, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xc734(%rip), %rsi      # 0x16547
callq 0x32b0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq %rax, %r13
movl $0x8, %edx
movq %rax, %rdi
leaq 0xc71a(%rip), %rsi      # 0x16558
callq 0x32b0
leaq 0x28(%rbx), %rax
movq (%r15), %rsi
movq (%rax), %rdx
movq %r13, %rdi
callq 0x32b0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x32c0
leaq -0x118(%rbp), %rcx
cmpq %rcx, %rax
je 0x9e91
movl $0x1, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xc6d5(%rip), %rsi      # 0x16561
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rbx
leaq -0x118(%rbp), %rax
cmpq %rax, %rbx
jne 0x9d8a
leaq 0xc67a(%rip), %rsi      # 0x16563
movl $0x16, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq -0xb8(%rbp), %rbx
leaq -0xc8(%rbp), %rax
cmpq %rax, %rbx
je 0xa034
leaq 0xc5f9(%rip), %r14      # 0x16547
leaq 0xc625(%rip), %r15      # 0x1657a
leaq 0xde33(%rip), %r12      # 0x17d8f
movl $0x7, %edx
leaq -0x2b8(%rbp), %rdi
movq %r14, %rsi
callq 0x32b0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq %rax, %r13
movl $0x7, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32b0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r13, %rdi
callq 0x32b0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x32c0
leaq -0xc8(%rbp), %rcx
cmpq %rcx, %rax
je 0x9fe3
movl $0x1, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xc583(%rip), %rsi      # 0x16561
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x32c0
movq %rax, %rbx
leaq -0xc8(%rbp), %rax
cmpq %rax, %rbx
jne 0x9f5c
leaq 0xc547(%rip), %rsi      # 0x16582
movl $0x11, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xc50b(%rip), %rsi      # 0x16594
movl $0x3b, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xc4f9(%rip), %rsi      # 0x165d0
movl $0x6, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xc4b2(%rip), %rsi      # 0x165d7
movl $0xd, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq 0xc339(%rip), %rsi      # 0x164ac
movl $0x1, %edx
leaq -0x2b8(%rbp), %rdi
callq 0x32b0
movq -0x2b8(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x2b8(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
leaq -0x2b8(%rbp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x438(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3400
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %rbx
callq 0x32b0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa1fc
callq 0x3230
leaq -0x2b0(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x3400
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x98(%rbp), %rdi
callq 0x32b0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa23a
callq 0x3230
leaq -0x120(%rbp), %rdi
callq 0xcdf0
leaq -0xd0(%rbp), %rdi
callq 0xcdf0
movq 0x14d3f(%rip), %rbx     # 0x1ef98
leaq -0x5f8(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x31c0
movl $0x80, %r14d
addq %r14, %r15
movq %r15, %rdi
callq 0x30c0
leaq -0x2c8(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x31c0
addq %r14, %r15
movq %r15, %rdi
callq 0x30c0
leaq -0x450(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x31c0
addq %r14, %r15
movq %r15, %rdi
callq 0x30c0
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x14d01(%rip), %rdi     # 0x1efd0
leaq 0xc249(%rip), %rsi      # 0x1651f
movl $0xf, %edx
callq 0x32b0
movq 0x14ce9(%rip), %rdi     # 0x1efd0
callq 0x3110
movl $0x1, %edi
callq 0x3310
jmp 0xa2fd
jmp 0xa3da
movq %rbx, %rcx
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xa39a
jmp 0xa3dd
jmp 0xa3da
movq %rax, %rbx
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xa395
jmp 0xa3da
movq %rax, %rbx
jmp 0xa414
movq %rax, %rbx
jmp 0xa433
jmp 0xa3a8
jmp 0xa3da
jmp 0xa3da
movq %rax, %rbx
jmp 0xa3ca
movq %rax, %rbx
jmp 0xa3bc
jmp 0xa3da
movq %rax, %rbx
jmp 0xa38a
movq %rax, %rbx
jmp 0xa378
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0xa378
callq 0x3230
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa38a
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xa3dd
callq 0x3230
jmp 0xa3dd
movq %rax, %rbx
jmp 0xa3f5
jmp 0xa3da
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0xa3bc
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xa3ca
callq 0x3230
leaq -0x90(%rbp), %rdi
callq 0xc7e2
jmp 0xa3dd
jmp 0xa3da
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0xcdf0
leaq -0xd0(%rbp), %rdi
callq 0xcdf0
movq 0x14b9c(%rip), %rsi     # 0x1ef98
leaq -0x5f8(%rbp), %rdi
callq 0x31c0
leaq -0x578(%rbp), %rdi
callq 0x30c0
movq 0x14b7d(%rip), %rsi     # 0x1ef98
leaq -0x2c8(%rbp), %rdi
callq 0x31c0
leaq -0x248(%rbp), %rdi
callq 0x30c0
movq 0x14b5e(%rip), %rsi     # 0x1ef98
leaq -0x450(%rbp), %rdi
callq 0x31c0
leaq -0x3d0(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3470