// File: /workspace/github_cpp_makefile_star2_O3/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 0xbee2(%rip), %rsi      # 0x15338
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 0xbeb9(%rip), %rsi      # 0x1534e
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 0xbe8e(%rip), %rsi      # 0x15362
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 0xbe62(%rip), %rsi      # 0x15375
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 0xbe60(%rip), %rsi      # 0x153b2
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 0xbe5b(%rip), %rsi      # 0x153ec
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 0xbe59(%rip), %rsi      # 0x15429
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 0xbe54(%rip), %rsi      # 0x15463
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 0xbe59(%rip), %rsi      # 0x154ae
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)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x118(%rbp), %rcx
movq %rax, 0x8(%rcx)
movaps %xmm0, -0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x5e8(%rbp), %rdi
leaq 0xbddc(%rip), %rsi      # 0x154ba
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 0xbd9f(%rip), %rsi      # 0x154c4
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 0xa416
leaq -0x460(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x97b2
callq 0x3230
leaq 0x13b77(%rip), %r13     # 0x1d330
movq 0x18(%r13), %rbx
addq $0x8, %r13
cmpq %r13, %rbx
je 0x98ae
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 0xaaaf
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0x9873
callq 0x3230
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x9885
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x989a
callq 0x3230
movq %rbx, %rdi
callq 0x3190
movq %rax, %rbx
cmpq %r13, %rax
jne 0x97d8
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 0x13aae(%rip), %rsi     # 0x1d3a0
movq 0x13aaf(%rip), %rdx     # 0x1d3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xbbc1(%rip), %rsi      # 0x154d0
movl $0xa, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13a9d(%rip), %rsi     # 0x1d3c0
movq 0x13a9e(%rip), %rdx     # 0x1d3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13a67(%rip), %rsi     # 0x1d3a0
movq 0x13a68(%rip), %rdx     # 0x1d3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xbb85(%rip), %rsi      # 0x154db
movl $0xe, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13a56(%rip), %rsi     # 0x1d3c0
movq 0x13a57(%rip), %rdx     # 0x1d3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13a20(%rip), %rsi     # 0x1d3a0
movq 0x13a21(%rip), %rdx     # 0x1d3a8
leaq -0x5e8(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xbb4d(%rip), %rsi      # 0x154ea
movl $0x9, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13a0f(%rip), %rsi     # 0x1d3c0
movq 0x13a10(%rip), %rdx     # 0x1d3c8
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 0xbb02(%rip), %rsi      # 0x154f4
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 0x139c7(%rip), %rbx     # 0x1d3f8
leaq 0x139b0(%rip), %rax     # 0x1d3e8
cmpq %rax, %rbx
je 0x9c62
leaq -0x38(%rbp), %r13
leaq -0xe0(%rbp), %r15
leaq 0xb879(%rip), %r12      # 0x152cc
leaq 0x20(%rbx), %rsi
leaq -0x90(%rbp), %rdi
callq 0xc71a
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 0xa284
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x5, %edx
leaq -0x440(%rbp), %rdi
leaq 0xba4a(%rip), %rsi      # 0x15512
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 0xb5fe(%rip), %rsi      # 0x150f1
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
jmp 0x9bee
movl $0xc, %edx
leaq -0x440(%rbp), %rdi
leaq 0xb9dd(%rip), %rsi      # 0x15501
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 0xb9bf(%rip), %rsi      # 0x1550e
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 0xb575(%rip), %rsi      # 0x150f1
callq 0x32b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
jmp 0x9bee
movl $0x6, %edx
leaq -0x440(%rbp), %rdi
leaq 0xb96e(%rip), %rsi      # 0x15518
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 0xb51c(%rip), %rsi      # 0x150f1
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 0x9c12
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x9c20
callq 0x3230
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x9c32
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x9c47
callq 0x3230
movq %rbx, %rdi
callq 0x3190
movq %rax, %rbx
leaq 0x1378f(%rip), %rax     # 0x1d3e8
cmpq %rax, %rbx
jne 0x9a53
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 0x9cd3
callq 0x3230
leaq 0xb855(%rip), %rsi      # 0x1552f
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 0x9e9e
leaq -0xd0(%rbp), %r14
leaq 0xd029(%rip), %r12      # 0x16d6f
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xcee2
leaq -0xc8(%rbp), %rcx
cmpq %rcx, %rax
je 0x9dbc
movq %r14, %rdi
movq %r15, %rsi
callq 0xcf80
movq %r14, %rdi
movq %rax, %rsi
callq 0xd03c
movl $0x7, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xb7bd(%rip), %rsi      # 0x15547
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 0xb79a(%rip), %rsi      # 0x1554f
callq 0x32b0
jmp 0x9dff
movl $0x7, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xb778(%rip), %rsi      # 0x15547
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 0xb75e(%rip), %rsi      # 0x15558
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 0x9e4d
movl $0x1, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xb719(%rip), %rsi      # 0x15561
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 0x9d46
leaq 0xb6be(%rip), %rsi      # 0x15563
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 0x9ff0
leaq 0xb63d(%rip), %r14      # 0x15547
leaq 0xb669(%rip), %r15      # 0x1557a
leaq 0xce57(%rip), %r12      # 0x16d6f
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 0x9f9f
movl $0x1, %edx
leaq -0x2b8(%rbp), %rdi
leaq 0xb5c7(%rip), %rsi      # 0x15561
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 0x9f18
leaq 0xb58b(%rip), %rsi      # 0x15582
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 0xb54f(%rip), %rsi      # 0x15594
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 0xb53d(%rip), %rsi      # 0x155d0
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 0xb4f6(%rip), %rsi      # 0x155d7
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 0xb37d(%rip), %rsi      # 0x154ac
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 0xa1b8
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 0xa1f6
callq 0x3230
leaq -0x120(%rbp), %rdi
callq 0xcd94
leaq -0xd0(%rbp), %rdi
callq 0xcd94
movq 0x12d83(%rip), %rbx     # 0x1cf98
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 0x12d45(%rip), %rdi     # 0x1cfd0
leaq 0xb28d(%rip), %rsi      # 0x1551f
movl $0xf, %edx
callq 0x32b0
movq 0x12d2d(%rip), %rdi     # 0x1cfd0
callq 0x3110
movl $0x1, %edi
callq 0x3310
jmp 0xa2b9
jmp 0xa396
movq %rbx, %rcx
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xa356
jmp 0xa399
jmp 0xa396
movq %rax, %rbx
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0xa351
jmp 0xa396
movq %rax, %rbx
jmp 0xa3d0
movq %rax, %rbx
jmp 0xa3ef
jmp 0xa364
jmp 0xa396
jmp 0xa396
movq %rax, %rbx
jmp 0xa386
movq %rax, %rbx
jmp 0xa378
jmp 0xa396
movq %rax, %rbx
jmp 0xa346
movq %rax, %rbx
jmp 0xa334
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r15, %rdi
je 0xa334
callq 0x3230
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa346
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xa399
callq 0x3230
jmp 0xa399
movq %rax, %rbx
jmp 0xa3b1
jmp 0xa396
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0xa378
callq 0x3230
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xa386
callq 0x3230
leaq -0x90(%rbp), %rdi
callq 0xc786
jmp 0xa399
jmp 0xa396
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0xcd94
leaq -0xd0(%rbp), %rdi
callq 0xcd94
movq 0x12be0(%rip), %rsi     # 0x1cf98
leaq -0x5f8(%rbp), %rdi
callq 0x31c0
leaq -0x578(%rbp), %rdi
callq 0x30c0
movq 0x12bc1(%rip), %rsi     # 0x1cf98
leaq -0x2c8(%rbp), %rdi
callq 0x31c0
leaq -0x248(%rbp), %rdi
callq 0x30c0
movq 0x12ba2(%rip), %rsi     # 0x1cf98
leaq -0x450(%rbp), %rdi
callq 0x31c0
leaq -0x3d0(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3470