// File: /workspace/github_cpp_makefile_star2_O1/johan-bjareholt[P]lua-compiler/src/convert.cc
// Function: convertThreeAd(ThreeAd&, std::ostream&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
void convertThreeAd(ThreeAd& op, std::ostream& ss, std::set<std::string>& outputSymbols, std::set<std::string>& inputSymbols, bool localScope){
	regVar(op.result);
	
	std::string lhs = op.lhs;
	std::string rhs = op.rhs;

	switch(op.op){
		case '+':
			{
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);
            formatSymbol(op.result, outputSymbols, localScope);

			ss << pre_in << "movq " << lhs << ", %%rax" << post_in;
			ss << pre_in << "addq " << rhs << ", %%rax" << post_in;
			ss << pre_in << "movq " << "%%rax, " << op.result << post_in;
			}
			break;
		case '-':
			{
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);
            formatSymbol(op.result, outputSymbols, localScope);

			ss << pre_in << "movq " << lhs << ", %%rax" << post_in;
			ss << pre_in << "subq " << rhs << ", %%rax" << post_in;
			ss << pre_in << "movq " << "%%rax, " << op.result << post_in;
			}
			break;
		case '*':
            {
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);
            formatSymbol(op.result, outputSymbols, localScope);

			ss << pre_in << "movq " << rhs << ", %%rax" << post_in;
			ss << pre_in << "movq " << lhs << ", %%rbx" << post_in;
			ss << pre_in << "imulq " << "%%rbx" << ", %%rax" << post_in;
			ss << pre_in << "movq " << "%%rax" << ", " << op.result << post_in;
            }
			break;
        case '/':
            {
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);
            formatSymbol(op.result, outputSymbols, localScope);
			
            ss << pre_in << "movq " << lhs << ", %%rax" << post_in;
            ss << pre_in << "movq " << rhs << ", %%rbx" << post_in;
			ss << pre_in << "cqto" << post_in; // Sign extend %rax to %rdx:rax
			ss << pre_in << "idivq " << "%%rbx" << post_in;
			ss << pre_in << "movq " << "%%rax" << ", " << op.result << post_in;
            }
            break;
        case '%':
            {
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);
            formatSymbol(op.result, outputSymbols, localScope);
			
            ss << pre_in << "movq " << lhs << ", %%rax" << post_in;
            ss << pre_in << "movq " << rhs << ", %%rbx" << post_in;
			ss << pre_in << "cqto" << post_in; // Sign extend %rax to %rdx:rax
			ss << pre_in << "idivq " << "%%rbx" << post_in;
			ss << pre_in << "movq " << "%%rdx" << ", " << op.result << post_in;
            }
            break;
		case '=':
        case 'e':
        case '<':
        case '>':
			{
            formatSymbol(rhs, inputSymbols, localScope);
            formatSymbol(lhs, inputSymbols, localScope);

			ss << pre_in << "movq " << lhs << ", %%rax" << post_in;
			ss << pre_in << "movq " << rhs << ", %%rbx" << post_in;
			ss << pre_in << "cmp "  << "%%rbx, %%rax" << post_in;
			}
			break;
		// Copy
		case 'c':
            {
            if (is_string(rhs)){
                //std::cout << "test1: " << lhs << "," << rhs << std::endl;
                formatSymbol(rhs, inputSymbols, localScope);
                addVar(lhs, VT_POINTER, "");
                add_brackets(lhs);
            }
            else if (is_digits(rhs)){
                formatSymbol(lhs, inputSymbols, localScope);
                std::stringstream tempss;
                tempss << "$" << rhs;
                rhs = tempss.str();
            }
            else {
                formatSymbol(lhs, inputSymbols, localScope);
                formatSymbol(rhs, inputSymbols, localScope);
            }
            ss << pre_in << "movq " << rhs << ", " << "%%rax" << post_in;
            ss << pre_in << "movq " << "%%rax" << ", " << lhs << post_in;
            }
			break;
        // Function argument
        case 'a':
            // TODO: Support for multiple arguments
            formatSymbol(lhs, inputSymbols, localScope);
            // Push to stack
            ss << pre_in << "movq %%rdi, " << lhs << post_in;
            break;
        // Function Return
		case 'r':
            {
            formatSymbol(lhs, inputSymbols, localScope);
			ss << pre_in << "movq " << lhs << ", " << "%%rax" << post_in;
            }
			break;
		// Call function
		case 'f':
            {
            // FIXME: Ugly type check and convertion
            std::string funcname = lhs;
            if (funcname == "print" || funcname == "io_write"){
                bool is_int = false;
                if (is_digits(rhs))
                    is_int = true;
                else {
                    auto arginfo = vars2.find(rhs);
                    if (arginfo != vars2.end()){
                        if ((*arginfo).second.first == VT_INT)
                            is_int = true;
                        else if ((*arginfo).second.first == VT_UNKNOWN)
                            is_int = true;
                    }
                }
                
                if (is_int){
                    if (lhs == "print")
                        funcname = "print_i";
                    else
                        funcname = "io_write_i";
                }
            }

            formatSymbol(op.result, outputSymbols, localScope);
            formatSymbol(rhs, inputSymbols, localScope);

            // Set arguments
            // FIXME: Only supports one argument :(
            ss << pre_in << "movq " << rhs << ", %%rdi" << post_in;
           
            // Call
            ss << pre_in << "call " << funcname << post_in;
            // Move return 
            ss << pre_in << "movq " << "%%rax, " << op.result << post_in;
            }
			break;
        default:
            std::cout << "Unknown 3ac: " << op.op << std::endl;
            exit(-1);
	 }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %r8d, %r14d
movq %rcx, %r12
movq %rdx, -0x78(%rbp)
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
leaq -0xc8(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %r15
movq %r15, %rdi
callq 0x4baa
movq %r15, %rdi
callq 0xc669
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
je 0xaf58
callq 0x3230
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x4baa
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x4baa
leaq 0x8(%rbx), %r15
leaq 0x10(%rbx), %r13
movzbl (%rbx), %eax
cmpl $0x60, %eax
jg 0xb1bb
leal -0x25(%rax), %ecx
cmpl $0xa, %ecx
ja 0xb221
leaq 0xb32d(%rip), %rax      # 0x162e4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x143ab(%rip), %rsi     # 0x1f3a0
movq 0x143ac(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb660(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb67e(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x14376(%rip), %rsi     # 0x1f3c0
movq 0x14377(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x14340(%rip), %rsi     # 0x1f3a0
movq 0x14341(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb5f5(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb5e8(%rip), %rsi      # 0x16689
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x1430b(%rip), %rsi     # 0x1f3c0
movq 0x1430c(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x142d5(%rip), %rsi     # 0x1f3a0
movq 0x142d6(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb5b3(%rip), %rsi      # 0x16698
movl $0x4, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x142c7(%rip), %rsi     # 0x1f3c0
movq 0x142c8(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x14291(%rip), %rsi     # 0x1f3a0
movq 0x14292(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb574(%rip), %rsi      # 0x1669d
movl $0x6, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xb54e(%rip), %rsi      # 0x1668b
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
movq 0x1426f(%rip), %rsi     # 0x1f3c0
movq 0x14270(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x14239(%rip), %rsi     # 0x1f3a0
movq 0x1423a(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb4ee(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xb50f(%rip), %rsi      # 0x166a4
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
leaq 0xb51d(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbed6
leal -0x61(%rax), %ecx
cmpl $0x5, %ecx
ja 0xb36a
leaq 0xb142(%rip), %rax      # 0x16310
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl %r14b, %edx
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xc1fc
movq 0x141af(%rip), %rsi     # 0x1f3a0
movq 0x141b0(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb4b1(%rip), %rsi      # 0x166bc
movl $0xc, %edx
movq %rax, %rdi
callq 0x32b0
leaq -0x68(%rbp), %r13
jmp 0xbed6
addl $-0x3c, %eax
cmpl $0x3, %eax
jae 0xbf34
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x1414c(%rip), %rsi     # 0x1f3a0
movq 0x1414d(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb401(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb41f(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x14117(%rip), %rsi     # 0x1f3c0
movq 0x14118(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x140e1(%rip), %rsi     # 0x1f3a0
movq 0x140e2(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb396(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb389(%rip), %rsi      # 0x16689
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x140ac(%rip), %rsi     # 0x1f3c0
movq 0x140ad(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x14076(%rip), %rsi     # 0x1f3a0
movq 0x14077(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb366(%rip), %rsi      # 0x166aa
movl $0x4, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xb357(%rip), %rsi      # 0x166af
movl $0xc, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbee8
cmpl $0x72, %eax
jne 0xbf34
movzbl %r14b, %edx
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0xc1fc
movq 0x14016(%rip), %rsi     # 0x1f3a0
movq 0x14017(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb2cb(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb2fb(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xb2d7(%rip), %rsi      # 0x166b6
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbee8
movq -0x50(%rbp), %rax
cmpb $0x22, (%rax)
jne 0xbd26
movq -0x48(%rbp), %rcx
cmpb $0x22, -0x1(%rax,%rcx)
jne 0xbd26
movzbl %r14b, %edx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0xc1fc
leaq -0xa8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x4baa
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd4aa(%rip), %rdx      # 0x188fc
leaq -0x98(%rbp), %rdi
movq %rdx, %rsi
callq 0x8e78
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rdx
movl $0x2, %esi
callq 0x9233
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0xb48a
callq 0x3230
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
je 0xb49b
callq 0x3230
leaq -0x70(%rbp), %rdi
callq 0xc11a
jmp 0xbdf9
leaq -0x270(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0x280(%rbp), %rdi
callq 0x4baa
leaq 0xb1f7(%rip), %rsi      # 0x166c9
leaq -0x280(%rbp), %rdi
callq 0x30a0
testl %eax, %eax
je 0xb4f9
leaq 0xb1e6(%rip), %rsi      # 0x166cf
leaq -0x280(%rbp), %rdi
callq 0x30a0
testl %eax, %eax
jne 0xb55d
leaq -0x50(%rbp), %rdi
callq 0xc031
testb %al, %al
jne 0xb52d
leaq 0x13ed3(%rip), %rdi     # 0x1f3e0
leaq -0x50(%rbp), %rsi
callq 0xceee
leaq 0x13ecb(%rip), %rcx     # 0x1f3e8
cmpq %rcx, %rax
je 0xb55d
movl 0x40(%rax), %eax
orl $0x4, %eax
cmpl $0x5, %eax
jne 0xb55d
leaq 0xb195(%rip), %rsi      # 0x166c9
leaq -0x70(%rbp), %rdi
callq 0x30a0
testl %eax, %eax
leaq 0xb192(%rip), %rax      # 0x166d8
leaq 0xb193(%rip), %rsi      # 0x166e0
cmoveq %rax, %rsi
leaq -0x280(%rbp), %rdi
callq 0x3350
movzbl %r14b, %ebx
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x13e1c(%rip), %rsi     # 0x1f3a0
movq 0x13e1d(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb0d1(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaf1d(%rip), %rsi      # 0x164e2
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13de7(%rip), %rsi     # 0x1f3c0
movq 0x13de8(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13db1(%rip), %rsi     # 0x1f3a0
movq 0x13db2(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb0e2(%rip), %rsi      # 0x166eb
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq 0x13d8d(%rip), %rsi     # 0x1f3c0
movq 0x13d8e(%rip), %rdx     # 0x1f3c8
movq %rax, %rdi
callq 0x32b0
movq 0x13d57(%rip), %rsi     # 0x1f3a0
movq 0x13d58(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xb00c(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xb004(%rip), %rsi      # 0x1667b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x32b0
movq (%r15), %rsi
movq (%r13), %rdx
movq %rbx, %rdi
callq 0x32b0
movq 0x13d26(%rip), %rsi     # 0x1f3c0
movq 0x13d27(%rip), %rdx     # 0x1f3c8
movq %rax, %rdi
callq 0x32b0
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0xbefe
callq 0x3230
jmp 0xbefe
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x13ca1(%rip), %rsi     # 0x1f3a0
movq 0x13ca2(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaf56(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaf74(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13c6c(%rip), %rsi     # 0x1f3c0
movq 0x13c6d(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13c36(%rip), %rsi     # 0x1f3a0
movq 0x13c37(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaeeb(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaede(%rip), %rsi      # 0x16689
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13c01(%rip), %rsi     # 0x1f3c0
movq 0x13c02(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13bcb(%rip), %rsi     # 0x1f3a0
movq 0x13bcc(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaea9(%rip), %rsi      # 0x16698
movl $0x4, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13bbd(%rip), %rsi     # 0x1f3c0
movq 0x13bbe(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13b87(%rip), %rsi     # 0x1f3a0
movq 0x13b88(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xae6a(%rip), %rsi      # 0x1669d
movl $0x6, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xae44(%rip), %rsi      # 0x1668b
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
movq 0x13b65(%rip), %rsi     # 0x1f3c0
movq 0x13b66(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13b2f(%rip), %rsi     # 0x1f3a0
movq 0x13b30(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xade4(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xae17(%rip), %rsi      # 0x166b6
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
leaq 0xae13(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbed6
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x13aa6(%rip), %rsi     # 0x1f3a0
movq 0x13aa7(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xad5b(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xad79(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13a71(%rip), %rsi     # 0x1f3c0
movq 0x13a72(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13a3b(%rip), %rsi     # 0x1f3a0
movq 0x13a3c(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xad04(%rip), %rsi      # 0x16683
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xad0e(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13a06(%rip), %rsi     # 0x1f3c0
movq 0x13a07(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x139d0(%rip), %rsi     # 0x1f3a0
movq 0x139d1(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xac85(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xac7d(%rip), %rsi      # 0x1667b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbed6
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x1395b(%rip), %rsi     # 0x1f3a0
movq 0x1395c(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xac10(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xac2e(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13926(%rip), %rsi     # 0x1f3c0
movq 0x13927(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x138f0(%rip), %rsi     # 0x1f3a0
movq 0x138f1(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xabab(%rip), %rsi      # 0x16675
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xabc3(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x138bb(%rip), %rsi     # 0x1f3c0
movq 0x138bc(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13885(%rip), %rsi     # 0x1f3a0
movq 0x13886(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xab3a(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xab32(%rip), %rsi      # 0x1667b
movl $0x7, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbed6
movzbl %r14b, %ebx
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq %r15, %rdi
movq -0x78(%rbp), %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x13810(%rip), %rsi     # 0x1f3a0
movq 0x13811(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaac5(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaae3(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x137db(%rip), %rsi     # 0x1f3c0
movq 0x137dc(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x137a5(%rip), %rsi     # 0x1f3a0
movq 0x137a6(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaa5a(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaa4d(%rip), %rsi      # 0x16689
movl $0x7, %edx
movq %rax, %rdi
callq 0x32b0
movq 0x13770(%rip), %rsi     # 0x1f3c0
movq 0x13771(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x1373a(%rip), %rsi     # 0x1f3a0
movq 0x1373b(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xaa11(%rip), %rsi      # 0x16691
movl $0x6, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xa9f7(%rip), %rsi      # 0x1668b
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
leaq 0xaa0c(%rip), %rsi      # 0x166b4
movl $0x7, %edx
movq %rbx, %rdi
callq 0x32b0
movq 0x13704(%rip), %rsi     # 0x1f3c0
movq 0x13705(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x136ce(%rip), %rsi     # 0x1f3a0
movq 0x136cf(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xa983(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xa9b6(%rip), %rsi      # 0x166b6
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
leaq 0xa9b2(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rbx, %rdi
callq 0x32b0
jmp 0xbed6
leaq -0x50(%rbp), %rdi
callq 0xc031
testb %al, %al
je 0xbdd9
movzbl %r14b, %edx
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0xc1fc
leaq -0x280(%rbp), %rdi
callq 0x31a0
leaq -0x270(%rbp), %rbx
leaq 0xa8ff(%rip), %rsi      # 0x16660
movl $0x1, %edx
movq %rbx, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
leaq -0x268(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x3400
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rbx
movq %rbx, %rsi
callq 0x3320
movq (%rbx), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xbdb8
callq 0x3230
movq 0x131d9(%rip), %rsi     # 0x1ef98
leaq -0x280(%rbp), %rdi
callq 0x31c0
leaq -0x200(%rbp), %rdi
callq 0x30c0
jmp 0xbdf9
movzbl %r14b, %ebx
leaq -0x70(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0xc1fc
movq 0x135a0(%rip), %rsi     # 0x1f3a0
movq 0x135a1(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xa855(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xa885(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xa861(%rip), %rsi      # 0x166b6
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
movq 0x13557(%rip), %rsi     # 0x1f3c0
movq 0x13558(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq 0x13521(%rip), %rsi     # 0x1f3a0
movq 0x13522(%rip), %rdx     # 0x1f3a8
movq -0x30(%rbp), %rdi
callq 0x32b0
movq %rax, %rbx
leaq 0xa7d6(%rip), %rsi      # 0x1666f
movl $0x5, %edx
movq %rax, %rdi
callq 0x32b0
leaq 0xa809(%rip), %rsi      # 0x166b6
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32b0
leaq 0xa805(%rip), %rsi      # 0x166c6
movl $0x2, %edx
movq %rbx, %rdi
callq 0x32b0
leaq -0x68(%rbp), %r13
leaq -0x70(%rbp), %r15
movq (%r15), %rsi
movq (%r13), %rdx
movq %rbx, %rdi
callq 0x32b0
movq %rax, %rbx
movq 0x134d1(%rip), %rsi     # 0x1f3c0
movq 0x134d2(%rip), %rdx     # 0x1f3c8
movq %rbx, %rdi
callq 0x32b0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xbf10
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xbf22
callq 0x3230
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x13095(%rip), %rdi     # 0x1efd0
leaq 0xa7af(%rip), %rsi      # 0x166f1
movl $0xd, %edx
callq 0x32b0
movb (%rbx), %al
leaq -0x280(%rbp), %rsi
movb %al, (%rsi)
movq 0x13072(%rip), %rdi     # 0x1efd0
movl $0x1, %edx
callq 0x32b0
movq %rax, %rdi
callq 0x3110
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3310
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0xbf93
callq 0x3230
jmp 0xbf93
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r14, %rdi
jne 0xbffb
jmp 0xc005
jmp 0xbfe5
jmp 0xbfa9
jmp 0xc002
jmp 0xbfe5
movq %rax, %rbx
movq 0x12fe5(%rip), %rsi     # 0x1ef98
leaq -0x280(%rbp), %rdi
callq 0x31c0
leaq -0x200(%rbp), %rdi
callq 0x30c0
jmp 0xc005
jmp 0xc002
movq %rax, %rbx
jmp 0xc017
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r13, %rdi
jne 0xc024
jmp 0xc029
movq %rax, %rbx
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0xc005
callq 0x3230
jmp 0xc005
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc017
callq 0x3230
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xc029
callq 0x3230
movq %rbx, %rdi
callq 0x3470