// File: /workspace/github_c_makefile_star2_O2/zyearn[P]SmallC/codegen.cpp
// Function: genStmt(treeNode*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void genStmt(treeNode* node, int type, string scope, int labelN)
{
    switch(type)
    {
        case 1:
        genExp(node->child[0],node->child[0]->type, scope);
        break;
        case 2:
        genStmtblock(node->child[0],node->child[0]->type, scope, labelN);
        break;
        case 3: 
        {
            genExp(node->child[1],node->child[1]->type, scope);
            /*
            if(scope == "main")
            {
                cout << "li $v0, 1" << endl;
                cout << "move $a0, $t0" << endl;
                cout << "syscall" << endl;
                cout << "li $v0, 4" << endl;
                cout << "la $a0, newline" << endl;
                cout << "syscall" << endl;
            }*/
            cout << "lw $s1 -4($s0)" << endl;
            cout << "jr $s1" << endl;
        }
        break;
        case 4:
        {
            int local = labelNumber;
            labelNumber++;
            genExp(node->child[2], node->child[2]->type, scope);
            cout << "beqz $t0, _labelExit" << local+1 << endl;
            genStmt(node->child[4], node->child[4]->type, scope, labelN);
            cout << "_labelExit" << local+1 << ":"<< endl;
            break;
        }
        case 5:
        {
            int local = labelNumber;
            labelNumber = labelNumber + 2;
            genExp(node->child[2],node->child[2]->type, scope);
            cout << "beqz $t0, _labelElse" << local+1 << endl;
            genStmt(node->child[4], node->child[4]->type, scope, labelN);
            cout << "j _labelExit" << local+2 << endl;
            cout << "_labelElse" << local+1 << ":" << endl;
            genStmt(node->child[6], node->child[6]->type, scope, labelN);
            cout << "_labelExit" << local+2 << ":" << endl;
            break;
        }
        case 6:
        {
            int local = labelNumber;
            labelNumber = labelNumber + 3;
            genExp(node->child[2], node->child[2]->type, scope);
            cout << "_labelFor" << local+1 <<":"<< endl;
            genExp(node->child[4], node->child[4]->type, scope);
            cout << "beqz $t0, _labelExit" << local+3 << endl;
            genStmt(node->child[8], node->child[8]->type, scope, labelNumber);
            cout << "_labelUpdate" << local+2 << ":" << endl;
            genExp(node->child[6], node->child[6]->type, scope);
            cout << "j _labelFor" << local+1 << endl;
            cout << "_labelExit" << local+3 << ":" << endl;
            break;
        }
        case 7:
        {
            if(labelN != 0)
            {
                cout << "j _labelUpdate" << labelN-1 << endl;
            }
            else
                cout << "j _labelUpdate" << labelNumber-1 << endl;
        }
        case 8:
        {
            if(labelN != 0)
                cout << "j _labelExit" << labelN << endl;
            else
                cout << "j _labelExit" << labelNumber << endl;
            break;
        }
        case 9:     //read
        {
            cout << "li $v0, 5" << endl;
            cout << "syscall" << endl;
            if(node->child[2]->type == 35)  //int int[]
            {

            //  genExp(node->child[2], node->child[2]->type, scope);
                node = node->child[2];
                if(node->child[1]->type == 2) //int
                {
                    if((*FT[scope])[node->child[0]->data] != 0)
                        cout << "sw $v0, " << 4 + (*FT[scope])["#"] - (*FT[scope])[node->child[0]->data] << "($s0)" << endl;
                    else if ( (*FT["_G"])[node->child[0]->data] != 0)   
                        cout << "sw $v0, " << (*FT["_G"])["#"] - (*FT["_G"])[node->child[0]->data] << "($s2)" << endl;
                }
                else    //int[]
                {
                    genExp(node->child[1]->child[1], node->child[1]->child[1]->type, scope);
                    cout << "mul $t0, $t0, 4" << endl;
                    if((*FT[scope])[node->child[0]->data] != 0 && (*ISA[scope])[node->child[0]->data]== 1)
                    {
                        cout << "add $t0, $t0, " << 4 + (*FT[scope])["#"] - (*FT[scope])[node->child[0]->data] << endl;
                        cout << "add $t0, $t0, $s0" << endl;
                        cout << "sw $v0, 0($t0)" << endl;
                    }
                    else if ((*FT["_G"])[node->child[0]->data] != 0 && (*ISA["_G"])[node->child[0]->data]== 1)  
                    {
                        cout << "add $t0, $t0, " << (*FT["_G"])["#"] - (*FT["_G"])[node->child[0]->data] << endl;
                        cout << "add $t0, $t0, $s2" << endl;
                        cout << "sw $v0, 0($t0)" << endl;
                    }
                    else
                    {
                        freopen(outputFile.c_str(), "w", stdout);
                        cout << "Error.";
                        fprintf(stderr, "\nCompile fail!\n");
                        fprintf(stderr, "error occurs, %s is not defined\n",  (node->child[0]->data).c_str() );
                        exit(0);
                    }
                }
            }
            else if(node->child[2]->type == 36)
            {
                node = node->child[2];
                string stname = STAC[node->child[0]->child[0]->data];
                
                if(stname != "")
                {
                if((*FT[scope])[node->child[0]->child[0]->data] != 0)
                    cout << "sw $v0, " << 4 + (*FT[scope])["#"] - (*FT[scope])[node->child[0]->child[0]->data]
                            +(*ST[stname])["#"] - (*ST[stname])[node->child[2]->data]
                        << "($s0)" << endl;
                else if ((*FT["_G"])[node->child[0]->child[0]->data] != 0)  
                    cout << "sw $v0, " << (*FT["_G"])["#"] - (*FT["_G"])[node->child[0]->child[0]->data] 
                    +(*ST[stname])["#"] - (*ST[stname])[node->child[2]->data]
                    << "($s2)" << endl;
                }
                else
                {
                    freopen(outputFile.c_str(), "w", stdout);
                    cout << "Error.";
                    fprintf(stderr, "\nCompile fail!\n");
                    fprintf(stderr, "error occurs, %s is not defined\n",  (node->child[0]->child[0]->data).c_str() );
                    exit(0);

                }

            }
            else
            {
                freopen(outputFile.c_str(), "w", stdout);
                cout << "Error.";
                fprintf(stderr, "\nCompile fail!\n");
                fprintf(stderr, "error occurs,can't assign a value to a left value.\n" );
                exit(0);
            }
            break;
        }
        case 10:
        {
            genExp(node->child[2], node->child[2]->type, scope);
            cout << "li $v0, 1" << endl;
            cout << "move $a0, $t0" << endl;
            cout << "syscall" << endl;
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
decl %esi
cmpl $0x9, %esi
ja 0xafd4
movl %ecx, %r15d
movq %rdx, %r13
movq %rdi, %r14
leaq 0xea4b(%rip), %rax      # 0x18ba0
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x28(%r14), %rax
movq (%rax), %r14
movl 0x24(%r14), %r15d
leaq -0x2a8(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2280
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x2a8(%rbp), %rdi
jmp 0xafcf
leaq 0x15112(%rip), %rax     # 0x1f2b0
movq %r13, %rsi
movl (%rax), %r13d
leal 0x2(%r13), %ecx
movl %ecx, -0x30(%rbp)
movl %ecx, (%rax)
movq 0x28(%r14), %rax
movq 0x10(%rax), %rbx
movl 0x24(%rbx), %r12d
leaq -0x128(%rbp), %rdi
movq %rsi, -0x38(%rbp)
callq 0x2280
movq %rbx, %rdi
movl %r12d, %esi
leaq -0x128(%rbp), %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x128(%rbp), %rdi
callq 0x23c8
movq 0x14de0(%rip), %rdi     # 0x1efd0
leaq 0xeb7a(%rip), %rsi      # 0x18d71
callq 0x21a0
incl %r13d
movq %rax, %rdi
movl %r13d, %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x20(%rax), %rbx
movl 0x24(%rbx), %r12d
leaq -0x108(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
movq %rbx, %rdi
movl %r12d, %esi
leaq -0x108(%rbp), %rdx
movl %r15d, %ecx
callq 0xa126
leaq -0x108(%rbp), %rdi
callq 0x23c8
movq 0x14d7a(%rip), %rbx     # 0x1efd0
leaq 0xeb29(%rip), %rsi      # 0x18d86
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
movl -0x30(%rbp), %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
leaq 0xeafc(%rip), %rsi      # 0x18d7b
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r13d, %esi
callq 0x2320
leaq 0xea58(%rip), %rsi      # 0x18cf1
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x30(%rax), %rbx
movl 0x24(%rbx), %r14d
leaq -0x228(%rbp), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
movq %rbx, %rdi
movl %r14d, %esi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xa126
leaq -0x228(%rbp), %rdi
callq 0x23c8
movq 0x14ce4(%rip), %rdi     # 0x1efd0
leaq 0xea73(%rip), %rsi      # 0x18d66
jmp 0xa6c0
movq 0x28(%r14), %rax
movq 0x10(%rax), %rbx
movl 0x24(%rbx), %r14d
leaq -0x168(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x2280
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x168(%rbp), %rdi
callq 0x23c8
movq 0x14c97(%rip), %rbx     # 0x1efd0
leaq 0xeb15(%rip), %rsi      # 0x18e55
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0xeb08(%rip), %rsi      # 0x18e5f
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0xea4a(%rip), %rsi      # 0x18db8
jmp 0xa3cf
movq 0x28(%r14), %rax
movq 0x8(%rax), %r14
movl 0x24(%r14), %r15d
leaq -0x268(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2280
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x268(%rbp), %rdi
callq 0x23c8
movq 0x14c1f(%rip), %rbx     # 0x1efd0
leaq 0xe98e(%rip), %rsi      # 0x18d46
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0xe986(%rip), %rsi      # 0x18d55
movq %rbx, %rdi
jmp 0xa6da
leaq 0x14ed2(%rip), %rax     # 0x1f2b0
movl (%rax), %r12d
incl %r12d
movl %r12d, (%rax)
movq 0x28(%r14), %rax
movq %r13, %rsi
movq 0x10(%rax), %r13
movl 0x24(%r13), %ebx
leaq -0x148(%rbp), %rdi
movq %rsi, -0x38(%rbp)
callq 0x2280
movq %r13, %rdi
movl %ebx, %esi
leaq -0x148(%rbp), %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x148(%rbp), %rdi
callq 0x23c8
movq 0x14ba4(%rip), %rdi     # 0x1efd0
leaq 0xe929(%rip), %rsi      # 0x18d5c
callq 0x21a0
movq %rax, %rdi
movl %r12d, %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x20(%rax), %rbx
movl 0x24(%rbx), %r14d
leaq -0x248(%rbp), %r13
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
movq %rbx, %rdi
movl %r14d, %esi
movq %r13, %rdx
movl %r15d, %ecx
callq 0xa126
leaq -0x248(%rbp), %rdi
callq 0x23c8
movq 0x14b42(%rip), %rdi     # 0x1efd0
leaq 0xe8d1(%rip), %rsi      # 0x18d66
callq 0x21a0
movq %rax, %rdi
movl %r12d, %esi
jmp 0xa6cb
testl %r15d, %r15d
jne 0xa71c
jmp 0xa9f6
movq 0x28(%r14), %rax
movq (%rax), %r14
leaq -0x288(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x2280
movq %r14, %rdi
movq %r12, %rdx
movl %r15d, %ecx
callq 0x9790
leaq -0x288(%rbp), %rdi
jmp 0xafcf
leaq 0x14dc3(%rip), %rcx     # 0x1f2b0
movq %r13, %rsi
movl (%rcx), %r13d
leal 0x3(%r13), %eax
movl %eax, -0x30(%rbp)
movl %eax, (%rcx)
movq 0x28(%r14), %rax
movq 0x10(%rax), %rbx
movl 0x24(%rbx), %r12d
leaq -0x208(%rbp), %r15
movq %r15, %rdi
movq %rsi, -0x38(%rbp)
callq 0x2280
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x208(%rbp), %rdi
callq 0x23c8
movq 0x14a92(%rip), %rdi     # 0x1efd0
leaq 0xe850(%rip), %rsi      # 0x18d95
callq 0x21a0
leal 0x1(%r13), %esi
movq %rax, %rdi
movl %esi, -0xa4(%rbp)
callq 0x2320
leaq 0xe78e(%rip), %rsi      # 0x18cf1
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x20(%rax), %rbx
movl 0x24(%rbx), %r15d
leaq -0x1e8(%rbp), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x1e8(%rbp), %rdi
callq 0x23c8
movq 0x14a1b(%rip), %rdi     # 0x1efd0
leaq 0xe7a0(%rip), %rsi      # 0x18d5c
callq 0x21a0
movq %rax, %rdi
movl -0x30(%rbp), %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x40(%rax), %rbx
movl 0x24(%rbx), %r15d
leaq -0x1c8(%rbp), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
leaq 0x14cb6(%rip), %rax     # 0x1f2b0
movl (%rax), %ecx
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0xa126
leaq -0x1c8(%rbp), %rdi
callq 0x23c8
movq 0x149b3(%rip), %rdi     # 0x1efd0
leaq 0xe77d(%rip), %rsi      # 0x18da1
callq 0x21a0
addl $0x2, %r13d
movq %rax, %rdi
movl %r13d, %esi
callq 0x2320
leaq 0xe6b2(%rip), %rsi      # 0x18cf1
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x30(%rax), %rbx
movl 0x24(%rbx), %r14d
leaq -0x1a8(%rbp), %r15
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x2280
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x1a8(%rbp), %rdi
callq 0x23c8
movq 0x1493f(%rip), %rbx     # 0x1efd0
leaq 0xe6fb(%rip), %rsi      # 0x18d93
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
movl -0xa4(%rbp), %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
leaq 0xe6a9(%rip), %rsi      # 0x18d66
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
movl -0x30(%rbp), %esi
callq 0x2320
leaq 0xe61a(%rip), %rsi      # 0x18cf1
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
jmp 0xafd4
movq 0x148dd(%rip), %rdi     # 0x1efd0
leaq 0xe6a5(%rip), %rsi      # 0x18d9f
callq 0x21a0
testl %r15d, %r15d
je 0xa9db
leal -0x1(%r15), %esi
movq %rax, %rdi
callq 0x2320
movq %rax, %rdi
callq 0x2120
movq 0x148ad(%rip), %rdi     # 0x1efd0
leaq 0xe65c(%rip), %rsi      # 0x18d86
callq 0x21a0
movq %rax, %rdi
movl %r15d, %esi
jmp 0xaa15
movq 0x1488f(%rip), %rbx     # 0x1efd0
leaq 0xe666(%rip), %rsi      # 0x18dae
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0xe659(%rip), %rsi      # 0x18db8
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
movq 0x28(%r14), %rax
movq 0x10(%rax), %r12
movl 0x24(%r12), %eax
cmpl $0x24, %eax
je 0xa861
cmpl $0x23, %eax
jne 0xafe6
movq 0x28(%r12), %rax
movq 0x8(%rax), %rax
cmpl $0x2, 0x24(%rax)
jne 0xaa33
leaq 0x14b10(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
cmpl $0x0, (%rax)
je 0xaeaa
movq 0x14800(%rip), %rdi     # 0x1efd0
leaq 0xe5e9(%rip), %rsi      # 0x18dc0
callq 0x21a0
movq %rax, %r14
leaq 0x14ad2(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %r15
leaq 0xe4c0(%rip), %rsi      # 0x18cb8
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x70d8
leaq -0x58(%rbp), %rsi
movq %r15, %rdi
callq 0x15500
movl (%rax), %r15d
leaq 0x14a9d(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
addl $0x4, %r15d
subl (%rax), %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x2320
leaq 0xe9d5(%rip), %rsi      # 0x19221
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
jmp 0xafcb
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
leaq 0x14ad1(%rip), %rdi     # 0x1f348
callq 0x1564a
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2280
leaq 0xe3e4(%rip), %rsi      # 0x18c76
movq %rbx, %rdi
callq 0x1563d
testb %al, %al
je 0xb052
leaq 0x14a0f(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1556a
cmpl $0x0, (%rax)
je 0xab78
movq 0x146f8(%rip), %rdi     # 0x1efd0
leaq 0xe4e1(%rip), %rsi      # 0x18dc0
callq 0x21a0
movq %rax, %r14
leaq 0x149ca(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %r15
leaq 0xe3b8(%rip), %rsi      # 0x18cb8
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x70d8
leaq -0x80(%rbp), %rsi
movq %r15, %rdi
callq 0x15500
movl (%rax), %r15d
leaq 0x14992(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1556a
movl (%rax), %r13d
leaq 0x14999(%rip), %rdi     # 0x1f2e8
leaq -0x58(%rbp), %rsi
callq 0x155d4
movq (%rax), %rbx
leaq 0xe356(%rip), %rsi      # 0x18cb8
leaq -0xa0(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0x70d8
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x15500
movl (%rax), %ebx
leaq 0x1495b(%rip), %rdi     # 0x1f2e8
leaq -0x58(%rbp), %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq 0x10(%rax), %rsi
callq 0x1556a
addl %ebx, %r15d
addl (%rax), %r13d
subl %r13d, %r15d
addl $0x4, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x2320
leaq 0xe85b(%rip), %rsi      # 0x19221
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
jmp 0xafb6
leaq 0x148ce(%rip), %rcx     # 0x1f2b0
movl (%rcx), %esi
decl %esi
movq %rax, %rdi
callq 0x2320
movq %rax, %rdi
callq 0x2120
movq 0x145d3(%rip), %rdi     # 0x1efd0
leaq 0xe382(%rip), %rsi      # 0x18d86
callq 0x21a0
leaq 0x148a0(%rip), %rcx     # 0x1f2b0
movl (%rcx), %esi
movq %rax, %rdi
callq 0x2320
movq %rax, %rdi
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
movq 0x28(%rax), %rax
movq 0x8(%rax), %rbx
movl 0x24(%rbx), %r14d
leaq -0x188(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x2280
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0xb2d0
leaq -0x188(%rbp), %rdi
callq 0x23c8
movq 0x1455c(%rip), %rdi     # 0x1efd0
leaq 0xe354(%rip), %rsi      # 0x18dcf
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0x14829(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
cmpl $0x0, (%rax)
je 0xad18
leaq 0x14861(%rip), %rdi     # 0x1f318
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
cmpl $0x1, (%rax)
jne 0xad18
movq 0x144f1(%rip), %rdi     # 0x1efd0
leaq 0xe2f9(%rip), %rsi      # 0x18ddf
callq 0x21a0
movq %rax, %r14
leaq 0x147c3(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %r15
leaq 0xe1b1(%rip), %rsi      # 0x18cb8
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x70d8
leaq -0x58(%rbp), %rsi
movq %r15, %rdi
callq 0x15500
movl (%rax), %r15d
leaq 0x1478e(%rip), %rdi     # 0x1f2b8
movq %r13, %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
addl $0x4, %r15d
subl (%rax), %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x23c8
movq 0x14464(%rip), %rbx     # 0x1efd0
leaq 0xe27b(%rip), %rsi      # 0x18dee
jmp 0xae8e
leaq 0xdd0d(%rip), %rsi      # 0x1888c
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x70d8
leaq 0x14722(%rip), %rdi     # 0x1f2b8
leaq -0x80(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1556a
movl (%rax), %ebx
leaq -0x80(%rbp), %rdi
callq 0x23c8
testl %ebx, %ebx
je 0xafcb
movq 0x14400(%rip), %rdi     # 0x1efd0
leaq 0xe1e9(%rip), %rsi      # 0x18dc0
callq 0x21a0
movq %rax, %rbx
leaq 0xdca6(%rip), %rsi      # 0x1888c
leaq -0x80(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x70d8
leaq 0x146be(%rip), %rdi     # 0x1f2b8
leaq -0x80(%rbp), %rsi
callq 0x718c
movq (%rax), %r14
leaq 0xe0ab(%rip), %rsi      # 0x18cb8
leaq -0xa0(%rbp), %rdi
leaq -0x5b(%rbp), %rdx
callq 0x70d8
leaq -0xa0(%rbp), %rsi
movq %r14, %rdi
callq 0x15500
movl (%rax), %r14d
leaq 0xdc56(%rip), %rsi      # 0x1888c
leaq -0xc8(%rbp), %rdi
leaq -0x5a(%rbp), %rdx
callq 0x70d8
leaq 0x1466b(%rip), %rdi     # 0x1f2b8
leaq -0xc8(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rsi
callq 0x1556a
movl (%rax), %r13d
leaq 0x1466e(%rip), %rdi     # 0x1f2e8
leaq -0x58(%rbp), %rsi
callq 0x155d4
movq (%rax), %r15
leaq 0xe02b(%rip), %rsi      # 0x18cb8
leaq -0xe8(%rbp), %rdi
leaq -0x59(%rbp), %rdx
callq 0x70d8
leaq -0xe8(%rbp), %rsi
movq %r15, %rdi
callq 0x15500
movl (%rax), %r15d
leaq 0x14632(%rip), %rdi     # 0x1f2e8
leaq -0x58(%rbp), %rsi
callq 0x155d4
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq 0x10(%rax), %rsi
callq 0x1556a
addl %r15d, %r14d
addl (%rax), %r13d
subl %r13d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2320
leaq 0xe0de(%rip), %rsi      # 0x18dc9
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq -0xe8(%rbp), %rdi
callq 0x23c8
leaq -0xc8(%rbp), %rdi
callq 0x23c8
jmp 0xafb6
leaq 0xdb6d(%rip), %rsi      # 0x1888c
leaq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x70d8
leaq 0x14582(%rip), %rdi     # 0x1f2b8
leaq -0x58(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
cmpl $0x0, (%rax)
je 0xb0b2
leaq 0xdb2d(%rip), %rsi      # 0x1888c
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x70d8
leaq 0x145a2(%rip), %rdi     # 0x1f318
leaq -0x80(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
movl (%rax), %ebx
leaq -0x80(%rbp), %rdi
callq 0x23c8
leaq -0x58(%rbp), %rdi
callq 0x23c8
cmpl $0x1, %ebx
jne 0xb0bb
movq 0x1421d(%rip), %rdi     # 0x1efd0
leaq 0xe025(%rip), %rsi      # 0x18ddf
callq 0x21a0
movq %rax, %rbx
leaq 0xdac3(%rip), %rsi      # 0x1888c
leaq -0x58(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x70d8
leaq 0x144d8(%rip), %rdi     # 0x1f2b8
leaq -0x58(%rbp), %rsi
callq 0x718c
movq (%rax), %r14
leaq 0xdec5(%rip), %rsi      # 0x18cb8
leaq -0x80(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0x70d8
leaq -0x80(%rbp), %rsi
movq %r14, %rdi
callq 0x15500
movl (%rax), %r14d
leaq 0xda73(%rip), %rsi      # 0x1888c
leaq -0xa0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x70d8
leaq 0x14488(%rip), %rdi     # 0x1f2b8
leaq -0xa0(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
subl (%rax), %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2320
movq %rax, %rdi
callq 0x2120
leaq -0xa0(%rbp), %rdi
callq 0x23c8
leaq -0x80(%rbp), %rdi
callq 0x23c8
leaq -0x58(%rbp), %rdi
callq 0x23c8
movq 0x14149(%rip), %rbx     # 0x1efd0
leaq 0xdf81(%rip), %rsi      # 0x18e0f
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq 0xdf5b(%rip), %rsi      # 0x18e00
jmp 0xa3cf
leaq 0xd9db(%rip), %rsi      # 0x1888c
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rdx
callq 0x70d8
leaq 0x143f3(%rip), %rdi     # 0x1f2b8
leaq -0x58(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
movl (%rax), %ebx
leaq -0x58(%rbp), %rdi
callq 0x23c8
testl %ebx, %ebx
je 0xafd4
movq 0x140d8(%rip), %rdi     # 0x1efd0
leaq 0xdec1(%rip), %rsi      # 0x18dc0
callq 0x21a0
movq %rax, %rbx
leaq 0xd97e(%rip), %rsi      # 0x1888c
leaq -0x58(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x70d8
leaq 0x14393(%rip), %rdi     # 0x1f2b8
leaq -0x58(%rbp), %rsi
callq 0x718c
movq (%rax), %r14
leaq 0xdd80(%rip), %rsi      # 0x18cb8
leaq -0x80(%rbp), %rdi
leaq -0xe8(%rbp), %rdx
callq 0x70d8
leaq -0x80(%rbp), %rsi
movq %r14, %rdi
callq 0x15500
movl (%rax), %r14d
leaq 0xd92e(%rip), %rsi      # 0x1888c
leaq -0xa0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x70d8
leaq 0x14343(%rip), %rdi     # 0x1f2b8
leaq -0xa0(%rbp), %rsi
callq 0x718c
movq (%rax), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rsi
callq 0x1556a
subl (%rax), %r14d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2320
leaq 0xde23(%rip), %rsi      # 0x18dc9
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x2120
leaq -0xa0(%rbp), %rdi
callq 0x23c8
leaq -0x80(%rbp), %rdi
callq 0x23c8
leaq -0x58(%rbp), %rdi
callq 0x23c8
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x142a3(%rip), %rax     # 0x1f290
movq (%rax), %rdi
movq 0x13fb1(%rip), %rax     # 0x1efa8
movq (%rax), %rdx
leaq 0xdae8(%rip), %rsi      # 0x18ae9
callq 0x2210
movq 0x13fc3(%rip), %rdi     # 0x1efd0
leaq 0xdc4c(%rip), %rsi      # 0x18c60
callq 0x21a0
movq 0x13fb8(%rip), %r14     # 0x1efd8
movq (%r14), %rcx
leaq 0xdc3d(%rip), %rdi      # 0x18c67
pushq $0xf
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2390
movq (%r14), %rcx
leaq 0xdddf(%rip), %rdi      # 0x18e21
pushq $0x33
popq %rsi
movq %rbx, %rdx
callq 0x2390
jmp 0xb126
leaq 0x14237(%rip), %rax     # 0x1f290
movq (%rax), %rdi
movq 0x13f45(%rip), %rax     # 0x1efa8
movq (%rax), %rdx
leaq 0xda7c(%rip), %rsi      # 0x18ae9
callq 0x2210
movq 0x13f57(%rip), %rdi     # 0x1efd0
leaq 0xdbe0(%rip), %rsi      # 0x18c60
callq 0x21a0
movq 0x13f4c(%rip), %rbx     # 0x1efd8
movq (%rbx), %rcx
leaq 0xdbd1(%rip), %rdi      # 0x18c67
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
movq (%rbx), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
jmp 0xb112
leaq -0x58(%rbp), %rdi
callq 0x23c8
leaq 0x141ce(%rip), %rax     # 0x1f290
movq (%rax), %rdi
movq 0x13edc(%rip), %rax     # 0x1efa8
movq (%rax), %rdx
leaq 0xda13(%rip), %rsi      # 0x18ae9
callq 0x2210
movq 0x13eee(%rip), %rdi     # 0x1efd0
leaq 0xdb77(%rip), %rsi      # 0x18c60
callq 0x21a0
movq 0x13ee3(%rip), %rbx     # 0x1efd8
movq (%rbx), %rcx
leaq 0xdb68(%rip), %rdi      # 0x18c67
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
movq (%rbx), %rdi
movq 0x28(%r12), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq 0xdb77(%rip), %rsi      # 0x18c96
xorl %eax, %eax
callq 0x2290
xorl %edi, %edi
callq 0x2240
jmp 0xb29d
jmp 0xb29d
jmp 0xb2bc
jmp 0xb2bc
jmp 0xb17f
jmp 0xb17f
jmp 0xb17f
jmp 0xb1b9
jmp 0xb2a2
jmp 0xb2a2
jmp 0xb29d
jmp 0xb29d
jmp 0xb2bc
jmp 0xb17f
jmp 0xb29d
jmp 0xb29d
jmp 0xb2bc
jmp 0xb2bc
jmp 0xb17f
jmp 0xb2bc
movq %rax, %rbx
jmp 0xb2c8
jmp 0xb2bc
jmp 0xb2bc
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
jmp 0xb2c3
jmp 0xb2a2
jmp 0xb29d
jmp 0xb2bc
jmp 0xb29d
jmp 0xb2bc
movq %rax, %rbx
jmp 0xb1dc
jmp 0xb29d
jmp 0xb2bc
jmp 0xb2a2
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x23c8
leaq -0xc8(%rbp), %rdi
callq 0x23c8
jmp 0xb2a5
jmp 0xb2bc
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x1e8(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0xb2c3
movq %rax, %rbx
jmp 0xb2b1
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x23c8
leaq -0x80(%rbp), %rdi
callq 0x23c8
jmp 0xb2bf
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x23c8
movq %rbx, %rdi
callq 0x2340