// File: eniac[P]Mantis/src/compile/compile_p4.cpp
// Function: generateInitTableForIng(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>*, std::vector<AstNode*, std::allocator<AstNode*>>*, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, P4RMalleableValueNode*, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, P4RMalleableValueNode*>>> const&, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, P4RMalleableFieldNode*, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, P4RMalleableFieldNode*>>> const&, int, bool)
int generateInitTableForIng(unordered_map<string, int>* mblUsages,
                               vector<AstNode*>* newNodes,
                               const unordered_map<string,
                                                   P4RMalleableValueNode*>& mblValues,
                               const unordered_map<string,
                                                   P4RMalleableFieldNode*>& mblFields,
                               int iso_opt, bool forIng) {

    // As the set of mbls in practice is small, currently a monolithic init for ing or egr
    ostringstream oss;
    string p4rInitActionName;
    string p4rSetVarTblName;
    string p4rMetadataName;
    
    if(forIng) {
        p4rInitActionName = string(kP4rIngInitAction);
        p4rSetVarTblName = "__tiSetVars";
        p4rMetadataName = string(kP4rIngMetadataName);
    } else {
        p4rInitActionName = string(kP4rEgrInitAction);
        p4rSetVarTblName = "__teSetVars";
        p4rMetadataName = string(kP4rEgrMetadataName);
    }

    oss << "action " << p4rInitActionName << "(";
    bool first = true;
    bool has_var = false;
    int num_vars = 0;
    for (auto kv : mblValues) {
        if(forIng && mblUsages->at(kv.first)==USAGE::EGRESS) {
            continue;
        } 
        if(!forIng && mblUsages->at(kv.first)==USAGE::INGRESS) {
            continue;
        }  
        if (first) {
            first = false;
        } else {
            oss << ", ";
        }
        has_var = true;
        oss << "p__" << kv.first;
        num_vars += 1;
    }
    for (auto kv : mblFields) {
        if(forIng && mblUsages->at(kv.first)==USAGE::EGRESS) {
            continue;
        } 
        if(!forIng && mblUsages->at(kv.first)==USAGE::INGRESS) {
            continue;
        }         
        if (first) {
            first = false;
        } else {
            oss << ", ";
        }
        has_var = true;
        oss << "p__" << kv.first << kP4rIndexSuffix;
        num_vars += 1;
    }

    if(has_var && iso_opt != 0) {
        oss << ", ";
    }

    if(iso_opt == 1) {
        oss << "__mv";
        num_vars += 1;
    } else if(iso_opt == 2) {
        oss << "__vv";
        num_vars += 1;
    } else if (iso_opt == 3) {
        oss << "__mv , __vv";
        num_vars += 2;
    }
    if(forIng) {
        PRINT_VERBOSE("Number of ing vars to set in init: %d\n", num_vars);
    } else {
        PRINT_VERBOSE("Number of egr vars to set in init: %d\n", num_vars);
    }

    oss << ") {\n";

    for (auto kv : mblValues) {
        if(forIng && mblUsages->at(kv.first)==USAGE::EGRESS) {
            continue;
        } 
        if(!forIng && mblUsages->at(kv.first)==USAGE::INGRESS) {
            continue;
        }        
        oss << "  modify_field(" << p4rMetadataName << "." << kv.first
                                << ", p__" << kv.first << ");\n";
    }

    for (auto kv : mblFields) {
        if(forIng && mblUsages->at(kv.first)==USAGE::EGRESS) {
            continue;
        } 
        if(!forIng && mblUsages->at(kv.first)==USAGE::INGRESS) {
            continue;
        }         
        oss << "  modify_field(" << p4rMetadataName << "."
                                << kv.first << kP4rIndexSuffix
                                << ", p__" << kv.first << kP4rIndexSuffix
                                << ");\n";
    }

    if(((unsigned int)iso_opt) & 0b1) {
        oss << "  modify_field(" << p4rMetadataName << "."
                                << "__mv, __mv"
                                << ");\n";
    } 
    if (((unsigned int)iso_opt) & 0b10) {
        oss << "  modify_field(" << p4rMetadataName << "."
                                << "__vv, __vv"
                                << ");\n";
    } 

    // pragma stage 0 not required due to the match dependency of later tables matching on __vv, __mv, field_alt
    oss << "}\n\n"
        << "table "
        << p4rSetVarTblName
        << " {\n"
        << "  actions {\n"
        << "    " << p4rInitActionName << ";\n"
        << "  }\n"
        << "  size : 1;\n"
        << "}\n\n";

    string* codeStr = new string(oss.str());
    string* objType = new string("table");
    string* tableName = new string(p4rSetVarTblName);

    newNodes->push_back(new UnanchoredNode(codeStr, objType, tableName));

    return num_vars;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5b0, %rsp            # imm = 0x5B0
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
andb $0x1, %al
movb %al, -0x25(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0xaa7b0
leaq -0x1c0(%rbp), %rdi
callq 0xaa7f0
leaq -0x1e0(%rbp), %rdi
callq 0xaa7f0
leaq -0x200(%rbp), %rdi
callq 0xaa7f0
testb $0x1, -0x25(%rbp)
je 0x124153
leaq -0x221(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0xaaa70
movq -0x3e8(%rbp), %rdx
leaq 0x17ff6(%rip), %rsi     # 0x13c038
leaq -0x220(%rbp), %rdi
callq 0xaa7d0
jmp 0x124050
leaq -0x1c0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
movq %rsi, -0x3f0(%rbp)
callq 0xaa6d0
movq -0x3f0(%rbp), %rdi
callq 0xaabe8
leaq -0x221(%rbp), %rdi
callq 0xaa5f0
leaq 0x1a10c(%rip), %rsi     # 0x13e195
leaq -0x1e0(%rbp), %rdi
callq 0xaa7c0
jmp 0x124097
leaq -0x259(%rbp), %rdi
movq %rdi, -0x3f8(%rbp)
callq 0xaaa70
movq -0x3f8(%rbp), %rdx
leaq 0x17e0b(%rip), %rsi     # 0x13bec3
leaq -0x258(%rbp), %rdi
callq 0xaa7d0
jmp 0x1240c6
leaq -0x200(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0xaa6d0
leaq -0x258(%rbp), %rdi
callq 0xaabe8
leaq -0x259(%rbp), %rdi
callq 0xaa5f0
jmp 0x12426b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x221(%rbp), %rdi
callq 0xaa5f0
jmp 0x124fa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x124fa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x259(%rbp), %rdi
callq 0xaa5f0
jmp 0x124fa3
leaq -0x281(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0xaaa70
movq -0x400(%rbp), %rdx
leaq 0x17f19(%rip), %rsi     # 0x13c08d
leaq -0x280(%rbp), %rdi
callq 0xaa7d0
jmp 0x124182
leaq -0x1c0(%rbp), %rdi
leaq -0x280(%rbp), %rsi
movq %rsi, -0x408(%rbp)
callq 0xaa6d0
movq -0x408(%rbp), %rdi
callq 0xaabe8
leaq -0x281(%rbp), %rdi
callq 0xaa5f0
leaq 0x19fe6(%rip), %rsi     # 0x13e1a1
leaq -0x1e0(%rbp), %rdi
callq 0xaa7c0
jmp 0x1241c9
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0xaaa70
movq -0x410(%rbp), %rdx
leaq 0x17cf7(%rip), %rsi     # 0x13bee1
leaq -0x2a8(%rbp), %rdi
callq 0xaa7d0
jmp 0x1241f8
leaq -0x200(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0xaa6d0
leaq -0x2a8(%rbp), %rdi
callq 0xaabe8
leaq -0x2a9(%rbp), %rdi
callq 0xaa5f0
jmp 0x12426b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x281(%rbp), %rdi
callq 0xaa5f0
jmp 0x124fa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x2a9(%rbp), %rdi
callq 0xaa5f0
jmp 0x124fa3
leaq 0x16089(%rip), %rsi     # 0x13a2fb
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x418(%rbp)
jmp 0x124287
movq -0x418(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x420(%rbp)
jmp 0x1242a3
movq -0x420(%rbp), %rdi
leaq 0x19cd8(%rip), %rsi     # 0x13df89
callq 0xaa540
jmp 0x1242b8
movb $0x1, -0x2aa(%rbp)
movb $0x0, -0x2ab(%rbp)
movl $0x0, -0x2b0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rdi
callq 0x127e60
movq %rax, -0x2c0(%rbp)
movq -0x2b8(%rbp), %rdi
callq 0x1278c0
movq %rax, -0x2c8(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x127860
testb $0x1, %al
jne 0x12431d
jmp 0x124475
leaq -0x2c0(%rbp), %rdi
callq 0x127e90
movq %rax, %rsi
leaq -0x2f0(%rbp), %rdi
callq 0xcf880
jmp 0x12433a
testb $0x1, -0x25(%rbp)
je 0x124397
movq -0x8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x428(%rbp)
jmp 0x124359
movq -0x428(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x124397
movl $0x3, -0x2f4(%rbp)
jmp 0x124448
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xcd9c0
jmp 0x124fa3
testb $0x1, -0x25(%rbp)
jne 0x1243ce
movq -0x8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x430(%rbp)
jmp 0x1243b6
movq -0x430(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x1243ce
movl $0x3, -0x2f4(%rbp)
jmp 0x124448
testb $0x1, -0x2aa(%rbp)
je 0x1243e0
movb $0x0, -0x2aa(%rbp)
jmp 0x1243f7
leaq 0x17e60(%rip), %rsi     # 0x13c247
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x1243f5
jmp 0x1243f7
movb $0x1, -0x2ab(%rbp)
leaq 0x19dc6(%rip), %rsi     # 0x13e1cb
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x438(%rbp)
jmp 0x12441a
movq -0x438(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0xaa4c0
jmp 0x12442f
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
movl $0x0, -0x2f4(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0xcd9c0
movl -0x2f4(%rbp), %eax
testl %eax, %eax
je 0x124462
jmp 0x124460
jmp 0x124464
jmp 0x124464
leaq -0x2c0(%rbp), %rdi
callq 0x127ec0
jmp 0x124301
movq -0x20(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x300(%rbp), %rdi
callq 0x127ef0
movq %rax, -0x308(%rbp)
movq -0x300(%rbp), %rdi
callq 0x127950
movq %rax, -0x310(%rbp)
leaq -0x308(%rbp), %rdi
leaq -0x310(%rbp), %rsi
callq 0x1278f0
testb $0x1, %al
jne 0x1244c2
jmp 0x124639
leaq -0x308(%rbp), %rdi
callq 0x127f20
movq %rax, %rsi
leaq -0x338(%rbp), %rdi
callq 0xd01f0
jmp 0x1244df
testb $0x1, -0x25(%rbp)
je 0x12453c
movq -0x8(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x440(%rbp)
jmp 0x1244fe
movq -0x440(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x12453c
movl $0x5, -0x2f4(%rbp)
jmp 0x12460c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x338(%rbp), %rdi
callq 0xcdfe0
jmp 0x124fa3
testb $0x1, -0x25(%rbp)
jne 0x124576
movq -0x8(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x448(%rbp)
jmp 0x12455b
movq -0x448(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x124576
movl $0x5, -0x2f4(%rbp)
jmp 0x12460c
testb $0x1, -0x2aa(%rbp)
je 0x124588
movb $0x0, -0x2aa(%rbp)
jmp 0x12459f
leaq 0x17cb8(%rip), %rsi     # 0x13c247
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x12459d
jmp 0x12459f
movb $0x1, -0x2ab(%rbp)
leaq 0x19c1e(%rip), %rsi     # 0x13e1cb
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x450(%rbp)
jmp 0x1245c2
movq -0x450(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x458(%rbp)
jmp 0x1245de
movq -0x458(%rbp), %rdi
leaq 0x17c1a(%rip), %rsi     # 0x13c206
callq 0xaa540
jmp 0x1245f3
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
movl $0x0, -0x2f4(%rbp)
leaq -0x338(%rbp), %rdi
callq 0xcdfe0
movl -0x2f4(%rbp), %eax
testl %eax, %eax
je 0x124626
jmp 0x124624
jmp 0x124628
jmp 0x124628
leaq -0x308(%rbp), %rdi
callq 0x127ff0
jmp 0x1244a6
testb $0x1, -0x2ab(%rbp)
je 0x12465f
cmpl $0x0, -0x24(%rbp)
je 0x12465f
leaq 0x17bf8(%rip), %rsi     # 0x13c247
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x12465d
jmp 0x12465f
cmpl $0x1, -0x24(%rbp)
jne 0x12468b
leaq 0x19b69(%rip), %rsi     # 0x13e1d5
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x12467a
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
jmp 0x1246e5
cmpl $0x2, -0x24(%rbp)
jne 0x1246b7
leaq 0x19b1c(%rip), %rsi     # 0x13e1b4
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x1246a6
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
jmp 0x1246e3
cmpl $0x3, -0x24(%rbp)
jne 0x1246e1
leaq 0x19ae9(%rip), %rsi     # 0x13e1ad
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x1246d2
movl -0x2b0(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x2b0(%rbp)
jmp 0x1246e3
jmp 0x1246e5
testb $0x1, -0x25(%rbp)
je 0x1246ed
jmp 0x1246ef
jmp 0x1246ef
leaq 0x198a0(%rip), %rsi     # 0x13df96
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
jmp 0x124704
movq -0x18(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x340(%rbp), %rdi
callq 0x127e60
movq %rax, -0x348(%rbp)
movq -0x340(%rbp), %rdi
callq 0x1278c0
movq %rax, -0x350(%rbp)
leaq -0x348(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x127860
testb $0x1, %al
jne 0x124751
jmp 0x1248f9
leaq -0x348(%rbp), %rdi
callq 0x127e90
movq %rax, %rsi
leaq -0x378(%rbp), %rdi
callq 0xcf880
jmp 0x12476e
testb $0x1, -0x25(%rbp)
je 0x1247cb
movq -0x8(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x460(%rbp)
jmp 0x12478d
movq -0x460(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x1247cb
movl $0x7, -0x2f4(%rbp)
jmp 0x1248cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x378(%rbp), %rdi
callq 0xcd9c0
jmp 0x124fa3
testb $0x1, -0x25(%rbp)
jne 0x124805
movq -0x8(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x468(%rbp)
jmp 0x1247ea
movq -0x468(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x124805
movl $0x7, -0x2f4(%rbp)
jmp 0x1248cc
leaq 0x199ad(%rip), %rsi     # 0x13e1b9
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x470(%rbp)
jmp 0x124821
movq -0x470(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x478(%rbp)
jmp 0x12483d
movq -0x478(%rbp), %rdi
leaq 0x173a6(%rip), %rsi     # 0x13bbf1
callq 0xaa540
movq %rax, -0x480(%rbp)
jmp 0x124859
movq -0x480(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x488(%rbp)
jmp 0x124875
movq -0x488(%rbp), %rdi
leaq 0x19946(%rip), %rsi     # 0x13e1c9
callq 0xaa540
movq %rax, -0x490(%rbp)
jmp 0x124891
movq -0x490(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x498(%rbp)
jmp 0x1248ad
movq -0x498(%rbp), %rdi
leaq 0x15579(%rip), %rsi     # 0x139e34
callq 0xaa540
jmp 0x1248c2
movl $0x0, -0x2f4(%rbp)
leaq -0x378(%rbp), %rdi
callq 0xcd9c0
movl -0x2f4(%rbp), %eax
testl %eax, %eax
je 0x1248e6
jmp 0x1248e4
jmp 0x1248e8
jmp 0x1248e8
leaq -0x348(%rbp), %rdi
callq 0x127ec0
jmp 0x124735
movq -0x20(%rbp), %rax
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rdi
callq 0x127ef0
movq %rax, -0x388(%rbp)
movq -0x380(%rbp), %rdi
callq 0x127950
movq %rax, -0x390(%rbp)
leaq -0x388(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x1278f0
testb $0x1, %al
jne 0x124946
jmp 0x124b26
leaq -0x388(%rbp), %rdi
callq 0x127f20
movq %rax, %rsi
leaq -0x3b8(%rbp), %rdi
callq 0xd01f0
jmp 0x124963
testb $0x1, -0x25(%rbp)
je 0x1249c0
movq -0x8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x4a0(%rbp)
jmp 0x124982
movq -0x4a0(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x1249c0
movl $0x9, -0x2f4(%rbp)
jmp 0x124af9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xcdfe0
jmp 0x124fa3
testb $0x1, -0x25(%rbp)
jne 0x1249fa
movq -0x8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0xe35a0
movq %rax, -0x4a8(%rbp)
jmp 0x1249df
movq -0x4a8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x1249fa
movl $0x9, -0x2f4(%rbp)
jmp 0x124af9
leaq 0x197b8(%rip), %rsi     # 0x13e1b9
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x4b0(%rbp)
jmp 0x124a16
movq -0x4b0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x4b8(%rbp)
jmp 0x124a32
movq -0x4b8(%rbp), %rdi
leaq 0x171b1(%rip), %rsi     # 0x13bbf1
callq 0xaa540
movq %rax, -0x4c0(%rbp)
jmp 0x124a4e
movq -0x4c0(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x4c8(%rbp)
jmp 0x124a6a
movq -0x4c8(%rbp), %rdi
leaq 0x1778e(%rip), %rsi     # 0x13c206
callq 0xaa540
movq %rax, -0x4d0(%rbp)
jmp 0x124a86
movq -0x4d0(%rbp), %rdi
leaq 0x19735(%rip), %rsi     # 0x13e1c9
callq 0xaa540
movq %rax, -0x4d8(%rbp)
jmp 0x124aa2
movq -0x4d8(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x4e0(%rbp)
jmp 0x124abe
movq -0x4e0(%rbp), %rdi
leaq 0x1773a(%rip), %rsi     # 0x13c206
callq 0xaa540
movq %rax, -0x4e8(%rbp)
jmp 0x124ada
movq -0x4e8(%rbp), %rdi
leaq 0x1534c(%rip), %rsi     # 0x139e34
callq 0xaa540
jmp 0x124aef
movl $0x0, -0x2f4(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0xcdfe0
movl -0x2f4(%rbp), %eax
testl %eax, %eax
je 0x124b13
jmp 0x124b11
jmp 0x124b15
jmp 0x124b15
leaq -0x388(%rbp), %rdi
callq 0x127ff0
jmp 0x12492a
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x124bbc
leaq 0x1967d(%rip), %rsi     # 0x13e1b9
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x4f0(%rbp)
jmp 0x124b51
movq -0x4f0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x4f8(%rbp)
jmp 0x124b6d
movq -0x4f8(%rbp), %rdi
leaq 0x17076(%rip), %rsi     # 0x13bbf1
callq 0xaa540
movq %rax, -0x500(%rbp)
jmp 0x124b89
movq -0x500(%rbp), %rdi
leaq 0x19638(%rip), %rsi     # 0x13e1cf
callq 0xaa540
movq %rax, -0x508(%rbp)
jmp 0x124ba5
movq -0x508(%rbp), %rdi
leaq 0x15281(%rip), %rsi     # 0x139e34
callq 0xaa540
jmp 0x124bba
jmp 0x124bbc
movl -0x24(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x124c52
leaq 0x195e7(%rip), %rsi     # 0x13e1b9
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x510(%rbp)
jmp 0x124be7
movq -0x510(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x518(%rbp)
jmp 0x124c03
movq -0x518(%rbp), %rdi
leaq 0x16fe0(%rip), %rsi     # 0x13bbf1
callq 0xaa540
movq %rax, -0x520(%rbp)
jmp 0x124c1f
movq -0x520(%rbp), %rdi
leaq 0x195ad(%rip), %rsi     # 0x13e1da
callq 0xaa540
movq %rax, -0x528(%rbp)
jmp 0x124c3b
movq -0x528(%rbp), %rdi
leaq 0x151eb(%rip), %rsi     # 0x139e34
callq 0xaa540
jmp 0x124c50
jmp 0x124c52
leaq 0x197fc(%rip), %rsi     # 0x13e455
leaq -0x1a0(%rbp), %rdi
callq 0xaa540
movq %rax, -0x530(%rbp)
jmp 0x124c6e
movq -0x530(%rbp), %rdi
leaq 0x1515a(%rip), %rsi     # 0x139dd6
callq 0xaa540
movq %rax, -0x538(%rbp)
jmp 0x124c8a
movq -0x538(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x540(%rbp)
jmp 0x124ca6
movq -0x540(%rbp), %rdi
leaq 0x192e3(%rip), %rsi     # 0x13df97
callq 0xaa540
movq %rax, -0x548(%rbp)
jmp 0x124cc2
movq -0x548(%rbp), %rdi
leaq 0x15118(%rip), %rsi     # 0x139de8
callq 0xaa540
movq %rax, -0x550(%rbp)
jmp 0x124cde
movq -0x550(%rbp), %rdi
leaq 0x150d2(%rip), %rsi     # 0x139dbe
callq 0xaa540
movq %rax, -0x558(%rbp)
jmp 0x124cfa
movq -0x558(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xaa4c0
movq %rax, -0x560(%rbp)
jmp 0x124d16
movq -0x560(%rbp), %rdi
leaq 0x15111(%rip), %rsi     # 0x139e35
callq 0xaa540
movq %rax, -0x568(%rbp)
jmp 0x124d32
movq -0x568(%rbp), %rdi
leaq 0x1693e(%rip), %rsi     # 0x13b67e
callq 0xaa540
movq %rax, -0x570(%rbp)
jmp 0x124d4e
movq -0x570(%rbp), %rdi
leaq 0x19489(%rip), %rsi     # 0x13e1e5
callq 0xaa540
movq %rax, -0x578(%rbp)
jmp 0x124d6a
movq -0x578(%rbp), %rdi
leaq 0x196dd(%rip), %rsi     # 0x13e455
callq 0xaa540
jmp 0x124d7f
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x580(%rbp)
jmp 0x124d92
movq -0x580(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0xaa580
jmp 0x124da7
movq -0x580(%rbp), %rax
movq %rax, -0x3c0(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x588(%rbp)
jmp 0x124dc8
movb $0x1, -0x3ca(%rbp)
leaq -0x3c9(%rbp), %rdi
movq %rdi, -0x590(%rbp)
callq 0xaaa70
movq -0x588(%rbp), %rdi
movq -0x590(%rbp), %rdx
leaq 0x192d2(%rip), %rsi     # 0x13e0c9
callq 0xaa7d0
jmp 0x124dfe
movb $0x0, -0x3ca(%rbp)
leaq -0x3c9(%rbp), %rdi
callq 0xaa5f0
movq -0x588(%rbp), %rax
movq %rax, -0x3c8(%rbp)
movl $0x20, %edi
callq 0xaa560
movq %rax, -0x598(%rbp)
jmp 0x124e32
movq -0x598(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xaa290
jmp 0x124e47
movq -0x598(%rbp), %rax
movq %rax, -0x3d8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x5a8(%rbp)
movl $0x58, %edi
callq 0xaa560
movq %rax, -0x5a0(%rbp)
jmp 0x124e73
movq -0x5a0(%rbp), %rdi
movq -0x3c0(%rbp), %rsi
movq -0x3c8(%rbp), %rdx
movq -0x3d8(%rbp), %rcx
callq 0xcaee0
jmp 0x124e96
movq -0x5a8(%rbp), %rdi
movq -0x5a0(%rbp), %rax
movq %rax, -0x3e0(%rbp)
leaq -0x3e0(%rbp), %rsi
callq 0xb2540
jmp 0x124eb9
movl -0x2b0(%rbp), %eax
movl %eax, -0x5ac(%rbp)
movl $0x1, -0x2f4(%rbp)
leaq -0x200(%rbp), %rdi
callq 0xaabe8
leaq -0x1e0(%rbp), %rdi
callq 0xaabe8
leaq -0x1c0(%rbp), %rdi
callq 0xaabe8
leaq -0x1a0(%rbp), %rdi
callq 0xaa130
movl -0x5ac(%rbp), %eax
addq $0x5b0, %rsp            # imm = 0x5B0
popq %rbp
retq
movq -0x580(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
callq 0xaa4e0
jmp 0x124fa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x3c9(%rbp), %rdi
callq 0xaa5f0
testb $0x1, -0x3ca(%rbp)
jne 0x124f57
jmp 0x124f63
movq -0x588(%rbp), %rdi
callq 0xaa4e0
jmp 0x124fa3
movq -0x598(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
callq 0xaa4e0
jmp 0x124fa3
movq -0x5a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
callq 0xaa4e0
leaq -0x200(%rbp), %rdi
callq 0xaabe8
leaq -0x1e0(%rbp), %rdi
callq 0xaabe8
leaq -0x1c0(%rbp), %rdi
callq 0xaabe8
leaq -0x1a0(%rbp), %rdi
callq 0xaa130
movq -0x230(%rbp), %rdi
callq 0xaaa60
nop