// File: /workspace/github_cpp_makefile_star2_O1/eniac[P]Mantis/src/compile/compile_p4.cpp
// Function: augmentRegisterArgProgForIng(std::vector<AstNode*, std::allocator<AstNode*>>*, std::vector<AstNode*, std::allocator<AstNode*>>*, std::vector<ReactionArgNode*, std::allocator<ReactionArgNode*>> const&, int, bool)
void augmentRegisterArgProgForIng(vector<AstNode*>* newNodes,
                         vector<AstNode*>* nodeArray,
                         const vector<ReactionArgNode*>& reaction_args,
                         int iso_opt, bool forIng) {
    string p4rRegMetadataType;
    string p4rRegMetadataName;
    if(forIng) {
        p4rRegMetadataType = string(kP4rIngRegMetadataType);
        p4rRegMetadataName = string(kP4rIngRegMetadataName);
    } else {
        p4rRegMetadataType = string(kP4rEgrRegMetadataType);
        p4rRegMetadataName = string(kP4rEgrRegMetadataName);
    }

    // Generate meta data for storing latest value of register index, value
    if (((unsigned int)iso_opt) & 0b1) {
        ostringstream oss;
        oss << "header_type "<< p4rRegMetadataType << " {\n"
            << " fields {\n";        
        vector<P4RegisterNode*> regNodes = findP4RegisterNode(*nodeArray);

        for (auto ra : reaction_args) {    
            if (ra->argType_==ReactionArgNode::REGISTER) {
                if(forIng) {
                    if(!findRegargInIng(ra, *nodeArray)) {
                        continue;
                    }
                } else {
                    if(findRegargInIng(ra, *nodeArray)) {
                        continue;
                    }
                }
                for(auto reg : regNodes) {
                    if(reg->name_->toString().compare(ra->toString())==0) {
                        oss << "  " << ra->toString() << kP4rRegMetadataOutputSuffix << "  : "<< reg->width_ << ";\n";
                        int index_width = int(ceil(log2(reg->instanceCount_)));
                        if (index_width==0) {
                            index_width = 1;
                        }
                        oss << "  " << ra->toString() << kP4rRegMetadataIndexSuffix << "  : "<< index_width << ";\n";
                        break;
                    }
                }
            }
        }        

        oss << " }" << endl;
        oss << "}" << endl;
        oss << "metadata " << p4rRegMetadataType << " "
                           << p4rRegMetadataName << ";\n\n";

        newNodes->push_back(new UnanchoredNode(new string(oss.str()),
                                               new string("metadata"),
                                               new string(p4rRegMetadataName)));

        // Transform original blackbox program 
        // Currently assume the reg to isolation has no HI member and no output instruction
        // If original blackbox has output instruction already, just mirror that the output meta data

        vector<P4ExprNode*> blackboxes = findBlackbox(*nodeArray);
        for (auto blackbox : blackboxes) {
            std::string prog_name = blackbox->name2_->toString();
            std::stringstream ss(blackbox->body_->toString());
            std::string reg_name;
            std::string item;
            while (std::getline(ss, item, ';'))
            {
                std::stringstream ss_(item);
                std::string item_;
                while (std::getline(ss_, item_, ':')) {
                    boost::algorithm::trim(item_);
                    if(item_.compare("reg")==0) {
                        std::getline(ss_, item_, ':');
                        boost::algorithm::trim(item_);
                        reg_name = item_;
                    }
                }
            }
            ostringstream oss_dst_field, oss_index_field;
            oss_dst_field << p4rRegMetadataName
                             << "."
                             << reg_name
                             << kP4rRegMetadataOutputSuffix;       
            oss_index_field << p4rRegMetadataName
                            << "."
                            << reg_name
                            << kP4rRegMetadataIndexSuffix;                                      
            ostringstream oss_cmd;
            oss_cmd << "  " << "output_value : alu_lo;\n"
                    << "  " << "output_dst : "
                    << oss_dst_field.str()
                    << ";\n";
            string newbodystr = blackbox->body_->toString()+oss_cmd.str();
            blackbox->body_ = new BodyNode(NULL, NULL, new BodyWordNode(BodyWordNode::STRING, new StrNode(new string(newbodystr))));

            // Singleton action that executes the prog
            // Locate the action that executes the stateful prog and mirror the index to meta
            bool transformed = false;
            for (auto tmp_node : *nodeArray) {
                if(typeContains(tmp_node, "ActionNode") && !typeContains(tmp_node, "P4R")) {
                    ActionNode* tmp_action_node = dynamic_cast<ActionNode*>(tmp_node);
                    string tmp_action_name = tmp_action_node->name_->toString();
                    ActionStmtsNode* actionstmts = tmp_action_node->stmts_;
                    for (ActionStmtNode* as : *actionstmts->list_) {
                        if(as->toString().find("execute_stateful_alu")!=string::npos &&
                            as->toString().find(prog_name)!=string::npos) {
                            // Extract the index or index metadata/field
                            unsigned first = as->toString().find("(");
                            unsigned last = as->toString().find(")");
                            string index = as->toString().substr (first+1,last-first-1);
                            
                            // Mirror the index to p4r reg metadata
                            auto tmp_args = new ArgsNode();
                            tmp_args->push_back(new BodyWordNode(
                                BodyWordNode::STRING,
                                new StrNode(new string(oss_index_field.str()))));
                            tmp_args->push_back(new BodyWordNode(
                                BodyWordNode::STRING,
                                new StrNode(new string(index))));                            
                            actionstmts->push_back(new ActionStmtNode(
                                                        new NameNode(new string("modify_field")),
                                                        tmp_args,
                                                        ActionStmtNode::NAME_ARGLIST,
                                                        NULL,
                                                        NULL
                                                    ));     
                            transformed = true;
                            break;
                        }
                    }
                    if (transformed) {
                        break;
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x988, %rsp            # imm = 0x988
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, -0x80(%rbp)
movq %rdi, -0x98(%rbp)
leaq -0x118(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xd8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x3a8(%rbp), %r14
movl %r8d, -0xa0(%rbp)
leaq -0x3b8(%rbp), %rdi
testl %r8d, %r8d
je 0x6883c
movq %r14, (%rdi)
leaq 0x1151a(%rip), %rsi     # 0x79d07
leaq 0x11524(%rip), %rdx     # 0x79d18
callq 0x33112
leaq -0x128(%rbp), %rdi
leaq -0x3b8(%rbp), %r12
movq %r12, %rsi
callq 0x2e4c0
movq (%r12), %rdi
cmpq %r14, %rdi
je 0x6881d
callq 0x2e360
leaq -0x3b8(%rbp), %rdi
movq %r14, (%rdi)
leaq 0x11473(%rip), %rsi     # 0x79ca1
leaq 0x1147b(%rip), %rdx     # 0x79cb0
callq 0x33112
jmp 0x68893
movq %r14, (%rdi)
leaq 0x114d3(%rip), %rsi     # 0x79d19
leaq 0x114dd(%rip), %rdx     # 0x79d2a
callq 0x33112
leaq -0x128(%rbp), %rdi
leaq -0x3b8(%rbp), %r12
movq %r12, %rsi
callq 0x2e4c0
movq (%r12), %rdi
cmpq %r14, %rdi
je 0x68876
callq 0x2e360
leaq -0x3b8(%rbp), %rdi
movq %r14, (%rdi)
leaq 0x114a4(%rip), %rsi     # 0x79d2b
leaq 0x114ac(%rip), %rdx     # 0x79d3a
callq 0x33112
leaq -0xe8(%rbp), %rdi
movq %r12, %rsi
callq 0x2e4c0
movq (%r12), %rdi
cmpq %r14, %rdi
movq %r14, %r12
je 0x688b3
callq 0x2e360
testb $0x1, %r15b
je 0x698c0
leaq -0x6b8(%rbp), %rdi
callq 0x2e550
leaq 0xd515(%rip), %rsi      # 0x75de5
leaq -0x6b8(%rbp), %rdi
movl $0xc, %edx
callq 0x2e440
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x2e440
movq %rax, %r15
leaq 0x112ca(%rip), %rsi     # 0x79bcf
movl $0x3, %edx
movq %rax, %rdi
callq 0x2e440
leaq 0xd4da(%rip), %rsi      # 0x75df3
movl $0xa, %edx
movq %r15, %rdi
callq 0x2e440
leaq -0x1c0(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x6ff51
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, -0xa8(%rbp)
cmpq %rcx, %rax
je 0x68c26
movq %rax, -0x88(%rbp)
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpl $0x4, 0x3c(%rax)
jne 0x68c0e
cmpb $0x0, -0xa0(%rbp)
je 0x689aa
leaq -0x1f0(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x32d96
movq -0x30(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x708a0
movl %eax, %ebx
movq -0x1f0(%rbp), %rdi
testq %rdi, %rdi
je 0x689a1
callq 0x2e360
testb %bl, %bl
jne 0x689e5
jmp 0x68c0e
leaq -0x1d8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x32d96
movq -0x30(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x708a0
movl %eax, %ebx
movq -0x1d8(%rbp), %rdi
testq %rdi, %rdi
je 0x689dd
callq 0x2e360
testb %bl, %bl
jne 0x68c0e
movq -0x1c0(%rbp), %rbx
movq -0x1b8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq %rax, %rbx
je 0x68c0e
movq (%rbx), %r14
movq 0x40(%r14), %rsi
movq (%rsi), %rax
leaq -0x3b8(%rbp), %rdi
callq *(%rax)
movq %r12, %r13
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
leaq -0x540(%rbp), %rdi
callq *(%rax)
movq %r14, -0x90(%rbp)
movq -0x3b0(%rbp), %r15
movq -0x538(%rbp), %r12
cmpq %r15, %r12
movq %r15, %rdx
cmovbq %r12, %rdx
testq %rdx, %rdx
je 0x68a65
movq -0x540(%rbp), %rsi
movq -0x3b8(%rbp), %rdi
callq 0x2e3c0
testl %eax, %eax
sete %r14b
jmp 0x68a68
movb $0x1, %r14b
cmpq %r12, %r15
sete %r15b
movq -0x540(%rbp), %rdi
leaq -0x530(%rbp), %rax
cmpq %rax, %rdi
je 0x68a87
callq 0x2e360
movq -0x3b8(%rbp), %rdi
movq %r13, %r12
cmpq %r13, %rdi
je 0x68a9b
callq 0x2e360
andb %r15b, %r14b
jne 0x68ab3
addq $0x8, %rbx
cmpq -0x38(%rbp), %rbx
jne 0x68a00
jmp 0x68c0e
movl $0x2, %edx
leaq -0x6b8(%rbp), %rdi
leaq 0xf5aa(%rip), %rsi      # 0x78070
callq 0x2e440
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
leaq -0x3b8(%rbp), %rdi
callq *(%rax)
movq -0x90(%rbp), %r14
movq -0x3b8(%rbp), %rsi
movq -0x3b0(%rbp), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x2e440
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0x111a3(%rip), %rsi     # 0x79cb1
callq 0x2e440
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x11219(%rip), %rsi     # 0x79d3b
callq 0x2e440
movl 0x50(%r14), %esi
movq %rbx, %rdi
callq 0x2e700
movl $0x2, %edx
movq %rax, %rdi
leaq 0xd2e3(%rip), %rsi      # 0x75e25
callq 0x2e440
movq -0x3b8(%rbp), %rdi
cmpq %r12, %rdi
je 0x68b58
callq 0x2e360
cvtsi2sdl 0x54(%r14), %xmm0
callq 0x2e740
callq 0x2e0a0
cvttsd2si %xmm0, %ebx
cmpl $0x1, %ebx
adcl $0x0, %ebx
movl $0x2, %edx
leaq -0x6b8(%rbp), %rdi
leaq 0xf4eb(%rip), %rsi      # 0x78070
callq 0x2e440
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
leaq -0x3b8(%rbp), %rdi
callq *(%rax)
movq -0x3b8(%rbp), %rsi
movq -0x3b0(%rbp), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x2e440
movq %rax, %r15
movl $0x7, %edx
movq %rax, %rdi
leaq 0x11120(%rip), %rsi     # 0x79ce6
callq 0x2e440
movl $0x4, %edx
movq %r15, %rdi
leaq 0x11161(%rip), %rsi     # 0x79d3b
callq 0x2e440
movq %r15, %rdi
movl %ebx, %esi
callq 0x2e700
movl $0x2, %edx
movq %rax, %rdi
leaq 0xd22d(%rip), %rsi      # 0x75e25
callq 0x2e440
movq -0x3b8(%rbp), %rdi
cmpq %r12, %rdi
je 0x68c0e
callq 0x2e360
movq -0x88(%rbp), %rax
addq $0x8, %rax
cmpq -0xa8(%rbp), %rax
jne 0x6894d
leaq 0x1119d(%rip), %rsi     # 0x79dca
leaq -0x6b8(%rbp), %rbx
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2e440
movq -0x6b8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2e370
movsbl %al, %esi
leaq -0x6b8(%rbp), %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x2e2b0
leaq 0xf059(%rip), %rsi      # 0x77cd0
leaq -0x6b8(%rbp), %rbx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2e440
movq -0x6b8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2e370
movsbl %al, %esi
leaq -0x6b8(%rbp), %rdi
callq 0x2e040
movq %rax, %rdi
callq 0x2e2b0
leaq 0xd145(%rip), %rsi      # 0x75e06
leaq -0x6b8(%rbp), %rdi
movl $0x9, %edx
callq 0x2e440
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x6b8(%rbp), %rdi
callq 0x2e440
movq %rax, %rbx
leaq 0xf37b(%rip), %rsi      # 0x78071
movl $0x1, %edx
movq %rax, %rdi
callq 0x2e440
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq %rbx, %rdi
callq 0x2e440
leaq 0xe4b4(%rip), %rsi      # 0x771d4
movl $0x3, %edx
movq %rax, %rdi
callq 0x2e440
movl $0x58, %edi
callq 0x2e3a0
movq %rax, %r14
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r12
leaq -0x6b0(%rbp), %rsi
movq %rax, %rdi
callq 0x2e660
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r15
addq $0x10, %rax
movq %rax, (%r15)
movb $0x1, %al
movl %eax, -0x30(%rbp)
leaq 0x10fca(%rip), %rsi     # 0x79d40
leaq 0x10fcb(%rip), %rdx     # 0x79d48
movb $0x1, %bl
movq %r15, %rdi
callq 0x33112
xorl %ebx, %ebx
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r13
addq $0x10, %rax
movq %rax, (%r13)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x32f92
xorl %ebx, %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3e566
movq %r14, -0x3b8(%rbp)
movq -0x98(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x68dec
movq %r14, (%rsi)
addq $0x8, 0x8(%rdi)
jmp 0x68e01
movl $0x0, -0x30(%rbp)
leaq -0x3b8(%rbp), %rdx
xorl %ebx, %ebx
callq 0x333de
leaq -0x1a8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x6f770
movq -0x1a8(%rbp), %rax
movq -0x1a0(%rbp), %rcx
movq %rcx, -0x158(%rbp)
cmpq %rcx, %rax
je 0x6987f
leaq -0x9a0(%rbp), %r12
movl $0x80, %ecx
leaq -0x540(%rbp), %rdx
addq %rcx, %rdx
movq %rdx, -0x98(%rbp)
leaq -0x3b8(%rbp), %rdx
addq %rdx, %rcx
movq %rcx, -0x150(%rbp)
leaq -0x9a8(%rbp), %r13
leaq -0x230(%rbp), %rbx
movq %rax, -0x160(%rbp)
movq (%rax), %r14
movq 0x50(%r14), %rsi
movq (%rsi), %rax
leaq -0x190(%rbp), %rdi
callq *(%rax)
movq %r14, -0x30(%rbp)
movq 0x60(%r14), %rsi
movq (%rsi), %rax
leaq -0x540(%rbp), %r14
movq %r14, %rdi
callq *(%rax)
leaq -0x3b8(%rbp), %rdi
movq %r14, %rsi
movl $0x18, %edx
callq 0x2e670
movq -0x540(%rbp), %rdi
leaq -0x530(%rbp), %rax
cmpq %rax, %rdi
je 0x68ec8
callq 0x2e360
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x100(%rbp)
movb %cl, -0xf8(%rbp)
leaq -0x138(%rbp), %rax
movq %rax, -0x148(%rbp)
movq %rcx, -0x140(%rbp)
movb %cl, -0x138(%rbp)
leaq -0x3b8(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movl $0x3b, %edx
callq 0x2e790
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6909e
leaq -0x540(%rbp), %rdi
leaq -0x148(%rbp), %rsi
movl $0x18, %edx
callq 0x2e670
leaq -0x820(%rbp), %rax
movq %rax, -0x830(%rbp)
movq $0x0, -0x828(%rbp)
movb $0x0, -0x820(%rbp)
leaq -0x830(%rbp), %r13
leaq -0x540(%rbp), %rdi
movq %r13, %rsi
movl $0x3a, %edx
callq 0x2e790
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6905b
movq %r12, %r15
movq %rbx, %r12
leaq -0x78(%rbp), %r14
movq %r14, %rdi
callq 0x2e800
movw $0x2000, -0x9a8(%rbp)   # imm = 0x2000
leaq -0x9a0(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2e270
movq %r13, %rdi
leaq -0x9a8(%rbp), %rsi
callq 0x39c99
movq %rbx, %rdi
callq 0x2e580
movq %r14, %rdi
callq 0x2e580
movq %r13, %rdi
leaq 0x1100b(%rip), %rsi     # 0x79ff0
callq 0x2e0f0
testl %eax, %eax
movq %r12, %rbx
movq %r15, %r12
jne 0x68f69
leaq -0x540(%rbp), %rdi
movq %r13, %rsi
movl $0x3a, %edx
callq 0x2e790
movq %r14, %rdi
callq 0x2e800
movw $0x2000, -0x9a8(%rbp)   # imm = 0x2000
movq %r12, %rdi
movq %r14, %rsi
callq 0x2e270
movq %r13, %rdi
leaq -0x9a8(%rbp), %rsi
callq 0x39c99
movq %r12, %rdi
callq 0x2e580
movq %r14, %rdi
callq 0x2e580
leaq -0x108(%rbp), %rdi
movq %r13, %rsi
callq 0x2e240
jmp 0x68f69
movq -0x830(%rbp), %rdi
leaq -0x820(%rbp), %rax
cmpq %rax, %rdi
je 0x69073
callq 0x2e360
leaq -0x540(%rbp), %rdi
movq 0x24ed7(%rip), %rsi     # 0x8df58
callq 0x2e2f0
movq -0x98(%rbp), %rdi
callq 0x2e150
leaq -0x9a8(%rbp), %r13
jmp 0x68f00
leaq -0x540(%rbp), %rdi
callq 0x2e550
leaq -0x830(%rbp), %rdi
callq 0x2e550
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x540(%rbp), %rdi
callq 0x2e440
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe847(%rip), %rsi      # 0x77929
callq 0x2e440
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %r14, %rdi
callq 0x2e440
movl $0x8, %edx
movq %rax, %rdi
leaq 0x10ba5(%rip), %rsi     # 0x79cb1
callq 0x2e440
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x830(%rbp), %rdi
callq 0x2e440
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0xe7ec(%rip), %rsi      # 0x77929
callq 0x2e440
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq %r14, %rdi
callq 0x2e440
movl $0x7, %edx
movq %rax, %rdi
leaq 0x10b7f(%rip), %rsi     # 0x79ce6
callq 0x2e440
movq %r13, %rdi
callq 0x2e550
movl $0x2, %edx
movq %r13, %rdi
leaq 0xeeed(%rip), %rsi      # 0x78070
callq 0x2e440
movl $0x17, %edx
movq %r13, %rdi
leaq 0x10bb2(%rip), %rsi     # 0x79d49
callq 0x2e440
movl $0x2, %edx
movq %r13, %rdi
leaq 0xeec5(%rip), %rsi      # 0x78070
callq 0x2e440
movl $0xd, %edx
movq %r13, %rdi
leaq 0x10ba2(%rip), %rsi     # 0x79d61
callq 0x2e440
leaq -0x78(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x2e660
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %r13, %rdi
callq 0x2e440
movl $0x2, %edx
movq %rax, %rdi
leaq 0xcc32(%rip), %rsi      # 0x75e25
callq 0x2e440
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x6920a
callq 0x2e360
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rsi
movq (%rsi), %rax
leaq -0xc8(%rbp), %rdi
callq *(%rax)
leaq -0x58(%rbp), %rdi
leaq -0x9a0(%rbp), %rsi
callq 0x2e660
movq -0xc8(%rbp), %rcx
movl $0xf, %esi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rcx
je 0x6924d
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %r8
movq -0x50(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0x69279
movl $0xf, %esi
leaq -0x48(%rbp), %rdi
cmpq %rdi, -0x58(%rbp)
je 0x69274
movq -0x48(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x6928b
movq -0x58(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x2e130
jmp 0x69298
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2e420
leaq -0x68(%rbp), %rsi
movq %rsi, -0x78(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x692b9
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x692c1
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x692ef
callq 0x2e360
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x69307
callq 0x2e360
movl $0x60, %edi
callq 0x2e3a0
movq %rax, -0x38(%rbp)
movl $0x50, %edi
callq 0x2e3a0
movq %rax, %r15
movl $0x48, %edi
callq 0x2e3a0
movq %rax, %r13
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r14
addq $0x10, %rax
movq %rax, (%r14)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x32f92
movq %r13, %rdi
movq %r14, %rsi
callq 0x32b5a
movq %r15, %rdi
movl $0x3, %esi
movq %r13, %rdx
callq 0x3526c
movq -0x38(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3578c
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x80(%rbp), %rax
movq (%rax), %r15
movq 0x8(%rax), %rax
movq %rax, -0x170(%rbp)
cmpq %rax, %r15
je 0x69793
xorl %r13d, %r13d
movq (%r15), %r14
movq %r14, %rdi
leaq 0xe5b7(%rip), %rsi      # 0x7796f
callq 0x6f390
testb %al, %al
je 0x693d4
movq %r14, %rdi
leaq 0xe4ff(%rip), %rsi      # 0x778ca
callq 0x6f390
testb %al, %al
je 0x693db
xorl %eax, %eax
jmp 0x6977e
testq %r14, %r14
je 0x693fd
movq %r14, %rdi
leaq 0x23246(%rip), %rsi     # 0x8c630
leaq 0x23aff(%rip), %rdx     # 0x8cef0
xorl %ecx, %ecx
callq 0x2e430
movq %rax, %r14
jmp 0x69400
xorl %r14d, %r14d
movq 0x40(%r14), %rsi
movq (%rsi), %rax
leaq -0xc8(%rbp), %rdi
callq *(%rax)
movq %r15, -0x168(%rbp)
movq 0x50(%r14), %rax
movq %rax, -0xa0(%rbp)
movq 0x40(%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
cmpq %rax, %rcx
je 0x6975c
addq $0x8, %rcx
movq %rcx, -0x38(%rbp)
movq -0x8(%rcx), %r15
movq (%r15), %rax
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq *(%rax)
movl $0x14, %ecx
movq %r14, %rdi
leaq 0x10908(%rip), %rsi     # 0x79d6f
xorl %edx, %edx
callq 0x2e710
movq %rax, %r14
cmpq $-0x1, %rax
je 0x694a3
movq (%r15), %rax
movq %rbx, %rdi
movq %r15, %rsi
callq *(%rax)
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rcx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2e710
cmpq $-0x1, %rax
setne %al
jmp 0x694a5
xorl %eax, %eax
movq %rax, -0x30(%rbp)
cmpq $-0x1, %r14
je 0x694c7
movq -0x230(%rbp), %rdi
leaq -0x220(%rbp), %rax
cmpq %rax, %rdi
je 0x694c7
callq 0x2e360
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x694d9
callq 0x2e360
movq -0x30(%rbp), %rdx
testb %dl, %dl
je 0x69740
movq (%r15), %rax
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq *(%rax)
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x106be(%rip), %rsi     # 0x79bc1
xorl %edx, %edx
callq 0x2e710
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x6951f
callq 0x2e360
movq (%r15), %rax
movq %r12, %rdi
movq %r15, %rsi
callq *(%rax)
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x10ed0(%rip), %rsi     # 0x7a409
xorl %edx, %edx
callq 0x2e710
movq %rax, %r13
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x69555
callq 0x2e360
movq (%r15), %rax
leaq -0x210(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq *(%rax)
leal 0x1(%r14), %edx
notl %r14d
addl %r14d, %r13d
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rcx
callq 0x2e3d0
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0x69597
callq 0x2e360
movl $0x48, %edi
callq 0x2e3a0
movq %rax, %rbx
movq %rax, %rdi
callq 0x386a0
movl $0x50, %edi
callq 0x2e3a0
movq %rax, %r14
movl $0x48, %edi
callq 0x2e3a0
movq %rax, %r15
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r13
movq %rax, %rdi
leaq -0x828(%rbp), %rsi
callq 0x2e660
movq %r15, %rdi
movq %r13, %rsi
callq 0x32b5a
movq %r14, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq 0x3526c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32998
movl $0x50, %edi
callq 0x2e3a0
movq %rax, %r14
movl $0x48, %edi
callq 0x2e3a0
movq %rax, %r15
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r13
addq $0x10, %rax
movq %rax, (%r13)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x32f92
movq %r15, %rdi
movq %r13, %rsi
callq 0x32b5a
movq %r14, %rdi
movl $0x3, %esi
movq %r15, %rdx
callq 0x3526c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32998
movl $0x60, %edi
callq 0x2e3a0
movq %rax, -0x88(%rbp)
movl $0x48, %edi
callq 0x2e3a0
movq %rax, -0x90(%rbp)
movl $0x20, %edi
callq 0x2e3a0
movq %rax, %r15
movq %rbx, %r14
addq $0x10, %rax
movq %rax, (%r15)
movb $0x1, %r13b
movb $0x1, %r12b
movb $0x1, %bl
movq %r15, %rdi
leaq 0x106c9(%rip), %rsi     # 0x79d84
leaq 0x106ce(%rip), %rdx     # 0x79d90
callq 0x33112
xorl %r12d, %r12d
movb $0x1, %bl
movq -0x90(%rbp), %rdi
movq %r15, %rsi
callq 0x329d8
xorl %r12d, %r12d
xorl %ebx, %ebx
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x38bc2
xorl %r12d, %r12d
xorl %ebx, %ebx
xorl %r13d, %r13d
movq -0xa0(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x32958
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x6972b
callq 0x2e360
movb $0x1, %r13b
leaq -0x9a0(%rbp), %r12
leaq -0x230(%rbp), %rbx
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
cmpq -0xa8(%rbp), %rcx
sete %al
orb %al, %dl
addq $0x8, %rcx
testb %dl, %dl
je 0x69441
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x69774
callq 0x2e360
movl %r13d, %eax
movq -0x168(%rbp), %r15
testb $0x1, %al
jne 0x69793
addq $0x8, %r15
cmpq -0x170(%rbp), %r15
jne 0x693ab
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x697a5
callq 0x2e360
leaq -0x9a8(%rbp), %r13
movq %r13, %rdi
movq 0x247f2(%rip), %r14     # 0x8dfa8
movq %r14, %rsi
callq 0x2e230
leaq -0x938(%rbp), %rdi
callq 0x2e150
leaq -0x830(%rbp), %rdi
movq %r14, %rsi
callq 0x2e230
leaq -0x7c0(%rbp), %rdi
callq 0x2e150
leaq -0x540(%rbp), %rdi
movq %r14, %rsi
callq 0x2e230
leaq -0x4d0(%rbp), %rdi
callq 0x2e150
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0x69818
callq 0x2e360
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x69830
callq 0x2e360
leaq -0x3b8(%rbp), %rdi
movq 0x2471a(%rip), %rsi     # 0x8df58
callq 0x2e2f0
movq -0x150(%rbp), %rdi
callq 0x2e150
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x69867
callq 0x2e360
movq -0x160(%rbp), %rax
addq $0x8, %rax
cmpq -0x158(%rbp), %rax
jne 0x68e6b
movq -0x1a8(%rbp), %rdi
testq %rdi, %rdi
je 0x69890
callq 0x2e360
movq -0x1c0(%rbp), %rdi
testq %rdi, %rdi
je 0x698a1
callq 0x2e360
movq 0x24700(%rip), %rsi     # 0x8dfa8
leaq -0x6b8(%rbp), %rdi
callq 0x2e230
leaq -0x648(%rbp), %rdi
callq 0x2e150
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x698d8
callq 0x2e360
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x698f0
callq 0x2e360
addq $0x988, %rsp            # imm = 0x988
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x699be
movq %rax, -0x38(%rbp)
movq %r13, %rdi
callq 0x2e360
movb $0x1, %al
movl %eax, -0x30(%rbp)
xorl %ebx, %ebx
jmp 0x69959
movq %rax, -0x38(%rbp)
movq %r12, %rdi
callq 0x2e360
jmp 0x6994e
movq %rax, -0x38(%rbp)
jmp 0x69973
jmp 0x6997c
jmp 0x6993a
jmp 0x6993a
jmp 0x6993a
jmp 0x6993a
movq %rax, %r13
jmp 0x69d09
jmp 0x699be
jmp 0x699be
jmp 0x699be
jmp 0x699be
movq %rax, -0x38(%rbp)
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x69965
movq %rax, -0x38(%rbp)
testb %bl, %bl
je 0x69965
movq %r15, %rdi
callq 0x2e360
cmpb $0x0, -0x30(%rbp)
je 0x69973
movq %r14, %rdi
callq 0x2e360
movq -0x38(%rbp), %r13
jmp 0x69cd9
movq %rax, %r13
jmp 0x69cea
movq %rax, %r13
movq -0x1f0(%rbp), %rdi
jmp 0x69ccf
movq %rax, %r13
movq -0x1d8(%rbp), %rdi
jmp 0x69ccf
jmp 0x699a4
movq %rax, %r13
movq -0x3b8(%rbp), %rdi
cmpq %r12, %rdi
jne 0x69cd4
jmp 0x69cd9
jmp 0x699be
movq %rax, %r13
jmp 0x69cd9
jmp 0x69aa9
jmp 0x69ac5
movq %rax, %rbx
movq %r14, %rdi
callq 0x2e360
jmp 0x69a65
movq %rax, %r13
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x69a11
callq 0x2e360
jmp 0x69a11
jmp 0x69aa9
movq %rax, %r13
jmp 0x69bed
jmp 0x69ab3
jmp 0x69abb
movq %rax, %r13
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
jmp 0x69ba5
movq %rax, %r13
movq -0x540(%rbp), %rdi
leaq -0x530(%rbp), %rax
cmpq %rax, %rdi
je 0x69cb0
callq 0x2e360
jmp 0x69cb0
movq %rax, %r13
jmp 0x69cc8
movq %rax, %r13
jmp 0x69cb0
movq %rax, %rbx
jmp 0x69a75
movq %rax, %rbx
jmp 0x69a6d
movq %rax, %rbx
movq %r13, %rdi
callq 0x2e360
movq %r15, %rdi
callq 0x2e360
movq -0x38(%rbp), %rdi
callq 0x2e360
movq %rbx, %r13
jmp 0x69b9d
jmp 0x69abb
movq %rax, %rbx
jmp 0x69aa1
movq %rax, %rbx
movq -0x3b8(%rbp), %rdi
cmpq %r13, %rdi
je 0x69aa1
callq 0x2e360
movq %rbx, %r13
jmp 0x69cd9
movq %rax, %r13
jmp 0x69baf
jmp 0x69abb
movq %rax, %r13
jmp 0x69bce
movq %rax, %r13
jmp 0x69b9d
jmp 0x69ac5
movq %rax, %r13
jmp 0x69c61
movq %rax, %r14
movb $0x1, %r13b
jmp 0x69b5a
jmp 0x69b35
movq %rax, %r13
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
jmp 0x69b7b
jmp 0x69afc
jmp 0x69b35
movq %rax, %r13
movq %rbx, %rdi
jmp 0x69b2e
movq %r13, %rdi
movq %rax, %r13
callq 0x2e360
jmp 0x69b1e
movq %rax, %r14
movb $0x1, %bl
movb $0x1, %r13b
jmp 0x69b4a
jmp 0x69b35
jmp 0x69b70
jmp 0x69b1b
jmp 0x69b28
movq %rax, %r13
movq %r15, %rdi
callq 0x2e360
jmp 0x69b2b
movq %rax, %r13
movq %r14, %rdi
callq 0x2e360
jmp 0x69b73
movq %rax, %r13
jmp 0x69b85
movq %rax, %r14
testb %r12b, %r12b
je 0x69b4a
movq %r15, %rdi
callq 0x2e360
testb %bl, %bl
je 0x69b5a
movq -0x90(%rbp), %rdi
callq 0x2e360
testb %r13b, %r13b
je 0x69b6b
movq -0x88(%rbp), %rdi
callq 0x2e360
movq %r14, %r13
jmp 0x69b73
movq %rax, %r13
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x69b85
callq 0x2e360
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x69b9d
callq 0x2e360
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x69baf
callq 0x2e360
movq 0x243f2(%rip), %rsi     # 0x8dfa8
leaq -0x9a8(%rbp), %rdi
callq 0x2e230
leaq -0x938(%rbp), %rdi
callq 0x2e150
movq 0x243d3(%rip), %rsi     # 0x8dfa8
leaq -0x830(%rbp), %rdi
callq 0x2e230
leaq -0x7c0(%rbp), %rdi
callq 0x2e150
movq 0x243b4(%rip), %rsi     # 0x8dfa8
leaq -0x540(%rbp), %rdi
callq 0x2e230
leaq -0x4d0(%rbp), %rdi
jmp 0x69c5c
movq %rax, %r13
movq %r12, %rdi
jmp 0x69c17
movq %rax, %r13
movq %rbx, %rdi
callq 0x2e580
leaq -0x78(%rbp), %rdi
callq 0x2e580
jmp 0x69c2a
movq %rax, %r13
movq -0x830(%rbp), %rdi
leaq -0x820(%rbp), %rax
cmpq %rax, %rdi
je 0x69c42
callq 0x2e360
movq 0x2430f(%rip), %rsi     # 0x8df58
leaq -0x540(%rbp), %rdi
callq 0x2e2f0
leaq -0x4c0(%rbp), %rdi
callq 0x2e150
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0x69c79
callq 0x2e360
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x69c91
callq 0x2e360
movq 0x242c0(%rip), %rsi     # 0x8df58
leaq -0x3b8(%rbp), %rdi
callq 0x2e2f0
leaq -0x338(%rbp), %rdi
callq 0x2e150
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0x69cc8
callq 0x2e360
movq -0x1a8(%rbp), %rdi
testq %rdi, %rdi
je 0x69cd9
callq 0x2e360
movq -0x1c0(%rbp), %rdi
testq %rdi, %rdi
je 0x69cea
callq 0x2e360
movq 0x242b7(%rip), %rsi     # 0x8dfa8
leaq -0x6b8(%rbp), %rdi
callq 0x2e230
leaq -0x648(%rbp), %rdi
callq 0x2e150
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x69d21
callq 0x2e360
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x69d39
callq 0x2e360
movq %r13, %rdi
callq 0x2e730