// File: /workspace/github_cpp_makefile_star2_O3/derekzwy[P]an-optimal-tcam-encoding-algorithm-for-packet-classification/rulesutils.cc
// Function: extend_rules(std::vector<pc_rule*, std::allocator<pc_rule*>>&, std::vector<pc_rule, std::allocator<pc_rule>>&)
void extend_rules(vector<pc_rule*> &in, vector<pc_rule> &out) 
{
    cout<<"Input ruleset: "<<in.size()<<endl;
    struct prefix *srcpf = new prefix();
    struct prefix *dstpf = new prefix();
    int numext;
    int numcmpl_vext;
    int numcmpl_hext;
    for(size_t i = 0; i < in.size(); i++) {
        srcpf = extend_prefix(in[i]->field[2].low, in[i]->field[2].high);
        dstpf = extend_prefix(in[i]->field[3].low, in[i]->field[3].high);
        if(check_cmpl(srcpf) == false || check_cmpl(dstpf) == false) {
            cout<<in[i]->priority<<" complement prefix error"<<endl;
            getchar();
        }
        numext = srcpf->nvalid * dstpf->nvalid;
        if(srcpf->nvalid > 1 && dstpf->nvalid > 1) {
            numcmpl_vext = srcpf->nvalid * dstpf->ninvalid + srcpf->ninvalid + 1;
            numcmpl_hext = dstpf->nvalid * srcpf->ninvalid + dstpf->ninvalid + 1;
        }
        else{
            numcmpl_vext = srcpf->nvalid * dstpf->ninvalid + srcpf->ninvalid;
            numcmpl_hext = dstpf->nvalid * srcpf->ninvalid + dstpf->ninvalid;
        }
        if(numext <=numcmpl_vext && numext <= numcmpl_hext) {
            for(size_t j = 0; j < srcpf->nvalid; j ++) {
              for(size_t k = 0; k < dstpf->nvalid; k ++) {
                if(numext > 32) {
                    cout<<"The theory may be wrong"<<endl;
                }
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->value[j];
                extrule.field[2].high = srcpf->value[j] + (int)pow(2, 16 - srcpf->length[j]) - 1;
                extrule.field[3].low = dstpf->value[k];
                extrule.field[3].high = dstpf->value[k] + (int)pow(2, 16 - dstpf->length[k]) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
        }
        }
        if(numcmpl_vext < numext && numcmpl_vext <= numcmpl_hext) {
            if(numcmpl_vext > 32) {
                cout<<"The theory may be wrong"<<endl;
            }
            if(srcpf->nvalid > 1 && dstpf->nvalid > 1) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->fullpf;
                extrule.field[2].high = srcpf->fullpf + (int)pow(2, 16 - srcpf->fpf_len) - 1;
                extrule.field[3].low = dstpf->fullpf;
                extrule.field[3].high = dstpf->fullpf + (int)pow(2, 16 - dstpf->fpf_len) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
            for(size_t j = 0; j < srcpf->ninvalid; j ++) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->cmplvalue[j];
                extrule.field[2].high = srcpf->cmplvalue[j] + (int)pow(2, 16-srcpf->cmpllength[j]) - 1;
                //output the fullpf
                extrule.field[3].low = dstpf->fullpf;
                extrule.field[3].high = dstpf->fullpf + (int)pow(2, 16-dstpf->fpf_len) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
            for(size_t j = 0; j < srcpf->nvalid; j ++) {
              for(size_t k = 0; k < dstpf->ninvalid; k ++) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->value[j];
                extrule.field[2].high = srcpf->value[j] + (int)pow(2, 16-srcpf->length[j]) - 1;
                extrule.field[3].low = dstpf->cmplvalue[k];
                extrule.field[3].high = dstpf->cmplvalue[k] + (int)pow(2, 16-dstpf->cmpllength[k]) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
        }
        }
        if(numcmpl_hext < numext && numcmpl_hext < numcmpl_vext) {
            if(numcmpl_hext > 32) {
                cout<<"The theory may be wrong"<<endl;
            }
            if(srcpf->nvalid > 1 && dstpf->nvalid > 1) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->fullpf;
                extrule.field[2].high = srcpf->fullpf + (int)pow(2, 16 - srcpf->fpf_len) - 1;
                extrule.field[3].low = dstpf->fullpf;
                extrule.field[3].high = dstpf->fullpf + (int)pow(2, 16 - dstpf->fpf_len) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
            for(size_t k = 0; k < dstpf->ninvalid; k ++) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->fullpf;
                extrule.field[2].high = srcpf->fullpf + (int)pow(2, 16-srcpf->fpf_len) - 1;
                extrule.field[3].low = dstpf->cmplvalue[k];
                extrule.field[3].high = dstpf->cmplvalue[k] + (int)pow(2, 16 - dstpf->cmpllength[k]) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
            for(size_t j = 0; j < srcpf->ninvalid; j ++) {
              for(size_t k = 0; k < dstpf->nvalid; k ++) {
                pc_rule extrule;
                extrule.priority = in[i]->priority;
                extrule.field[0].low = in[i]->field[0].low;
                extrule.field[0].high = in[i]->field[0].high;
                extrule.field[1].low = in[i]->field[1].low;
                extrule.field[1].high = in[i]->field[1].high;
                extrule.field[2].low = srcpf->cmplvalue[j];
                extrule.field[2].high = srcpf->cmplvalue[j] + (int)pow(2, 16 - srcpf->cmpllength[j]) - 1;
                extrule.field[3].low = dstpf->value[k];
                extrule.field[3].high = dstpf->value[k] + (int)pow(2, 16 - dstpf->length[k]) - 1;
                extrule.field[4].low = in[i]->field[4].low;
                extrule.field[4].high = in[i]->field[4].high;
                out.push_back(extrule);
            }
        }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %r13
movq 0x5903(%rip), %r14      # 0x9fd8
leaq 0x2ad3(%rip), %rsi      # 0x71af
movl $0xf, %edx
movq %r14, %rdi
callq 0x2190
movq 0x8(%r13), %rsi
subq (%r13), %rsi
sarq $0x3, %rsi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq (%r13), %rax
cmpq %rax, 0x8(%r13)
je 0x539b
xorl %r14d, %r14d
movq %r13, -0xe0(%rbp)
movq (%rax,%r14,8), %rax
movl 0x28(%rax), %edi
movl 0x30(%rax), %esi
callq 0x3b28
movq %rax, %r12
movq (%r13), %rax
movq (%rax,%r14,8), %rax
movl 0x38(%rax), %edi
movl 0x40(%rax), %esi
callq 0x3b28
movq %rax, %r15
movq %r12, %rdi
callq 0x44f8
testb %al, %al
je 0x477f
movq %r15, %rdi
callq 0x44f8
testb %al, %al
jne 0x47d8
movq (%r13), %rax
movq (%rax,%r14,8), %rax
movl (%rax), %esi
movq 0x5848(%rip), %rdi      # 0x9fd8
callq 0x2230
movq %rax, %rbx
movl $0x18, %edx
movq %rax, %rdi
leaq 0x2a18(%rip), %rsi      # 0x71bf
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
callq 0x21c0
movl 0x108(%r12), %eax
movl 0x10c(%r12), %esi
movl 0x108(%r15), %ecx
movl 0x10c(%r15), %edx
movl %edx, %edi
imull %eax, %edi
cmpl $0x2, %eax
jb 0x4812
cmpl $0x2, %ecx
jb 0x4812
addl %esi, %edi
incl %edi
imull %ecx, %esi
addl %edx, %esi
incl %esi
jmp 0x4819
addl %esi, %edi
imull %ecx, %esi
addl %edx, %esi
movq %rsi, %rdx
movl %ecx, %ebx
imull %eax, %ebx
movq %rdi, -0xe8(%rbp)
cmpl %edi, %ebx
movq %r14, -0x38(%rbp)
movq %r12, -0x48(%rbp)
movq %r15, -0x40(%rbp)
movl %ebx, -0x4c(%rbp)
movq %rsi, -0xf0(%rbp)
jg 0x4a15
cmpl %edx, %ebx
jg 0x4a15
testl %eax, %eax
je 0x4a13
xorl %r14d, %r14d
testl %ecx, %ecx
je 0x4a01
xorl %r12d, %r12d
cmpl $0x21, %ebx
jl 0x48ae
movl $0x17, %edx
movq 0x5763(%rip), %rbx      # 0x9fd8
movq %rbx, %rdi
leaq 0x2959(%rip), %rsi      # 0x71d8
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
movl -0x4c(%rbp), %ebx
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq -0xd0(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq (%r13), %rax
movq -0x38(%rbp), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rcx
movl (%rcx,%r14,4), %r13d
movq %r13, -0xb0(%rbp)
movl $0x10, %eax
subl 0x40(%rcx,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movq -0x40(%rbp), %rcx
movl (%rcx,%r12,4), %r13d
movq %r13, -0xa0(%rbp)
movl $0x10, %eax
subl 0x40(%rcx,%r12,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq -0xe0(%rbp), %r13
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x49cc
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x49dc
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
incq %r12
movq -0x40(%rbp), %r15
movl 0x108(%r15), %ecx
cmpq %rcx, %r12
jb 0x4864
movq -0x48(%rbp), %r12
movl 0x108(%r12), %eax
jmp 0x4a03
xorl %ecx, %ecx
incq %r14
movl %eax, %edx
cmpq %rdx, %r14
jb 0x4859
jmp 0x4a15
xorl %eax, %eax
movq -0xe8(%rbp), %rcx
cmpl %ebx, %ecx
jge 0x4ecf
cmpl -0xf0(%rbp), %ecx
jg 0x4ecf
cmpl $0x21, %ecx
jl 0x4a82
movl $0x17, %edx
movq 0x5597(%rip), %rbx      # 0x9fd8
movq %rbx, %rdi
leaq 0x278d(%rip), %rsi      # 0x71d8
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
movl -0x4c(%rbp), %ebx
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl 0x108(%r12), %eax
cmpl $0x2, %eax
jb 0x4bce
cmpl $0x2, 0x108(%r15)
jb 0x4bce
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movl 0x100(%r12), %r14d
movq %r14, -0xb0(%rbp)
movl $0x10, %eax
subl 0x104(%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r14d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movl 0x100(%r15), %r14d
movq %r14, -0xa0(%rbp)
movl $0x10, %eax
subl 0x104(%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r14d, %eax
decl %eax
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4bbe
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x4bce
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
cmpl $0x0, 0x10c(%r12)
je 0x4d2f
xorl %r14d, %r14d
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq -0x38(%rbp), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movq %r12, %rcx
movl 0x80(%r12,%r14,4), %r12d
movq %r12, -0xb0(%rbp)
movl $0x10, %eax
subl 0xc0(%rcx,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r12d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movq -0x40(%rbp), %rcx
movl 0x100(%rcx), %r12d
movq %r12, -0xa0(%rbp)
movl $0x10, %eax
subl 0x104(%rcx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r12d, %eax
decl %eax
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4d07
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x4d17
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
incq %r14
movq -0x48(%rbp), %r12
movl 0x10c(%r12), %eax
cmpq %rax, %r14
jb 0x4be0
movl 0x108(%r12), %eax
testl %eax, %eax
je 0x4ec9
movq -0x40(%rbp), %r15
movl 0x10c(%r15), %ecx
xorl %r14d, %r14d
testl %ecx, %ecx
je 0x4eb7
xorl %r12d, %r12d
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq -0x38(%rbp), %rbx
movq (%rax,%rbx,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rcx
movl (%rcx,%r14,4), %r13d
movq %r13, -0xb0(%rbp)
movl $0x10, %eax
subl 0x40(%rcx,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movl 0x80(%r15,%r12,4), %r13d
movq %r13, -0xa0(%rbp)
movl $0x10, %eax
subl 0xc0(%r15,%r12,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq -0xe0(%rbp), %r13
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%rbx,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x4e7f
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x4e8f
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
incq %r12
movq -0x40(%rbp), %r15
movl 0x10c(%r15), %ecx
cmpq %rcx, %r12
jb 0x4d58
movq -0x48(%rbp), %r12
movl 0x108(%r12), %eax
movl -0x4c(%rbp), %ebx
jmp 0x4eb9
xorl %ecx, %ecx
incq %r14
movl %eax, %edx
cmpq %rdx, %r14
jb 0x4d4d
jmp 0x4ecf
xorl %eax, %eax
movq -0x40(%rbp), %r15
movq -0xf0(%rbp), %rcx
cmpl %ecx, %ebx
jle 0x537c
cmpl %ecx, -0xe8(%rbp)
jle 0x537c
cmpl $0x21, %ecx
jl 0x4f39
movl $0x17, %edx
movq 0x50dd(%rip), %rbx      # 0x9fd8
movq %rbx, %rdi
leaq 0x22d3(%rip), %rsi      # 0x71d8
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl 0x108(%r12), %eax
cmpl $0x2, %eax
jb 0x5087
cmpl $0x2, 0x108(%r15)
jb 0x5087
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq %r15, %rbx
movq -0x38(%rbp), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movl 0x100(%r12), %r14d
movq %r14, -0xb0(%rbp)
movl $0x10, %eax
subl 0x104(%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r14d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movl 0x100(%rbx), %r14d
movq %r14, -0xa0(%rbp)
movl $0x10, %eax
subl 0x104(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r14d, %eax
decl %eax
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x5073
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x5083
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
movq -0x40(%rbp), %r15
cmpl $0x0, 0x10c(%r15)
je 0x51ea
xorl %r14d, %r14d
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq %r15, %rbx
movq -0x38(%rbp), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movq %r12, %rcx
movl 0x100(%r12), %r12d
movq %r12, -0xb0(%rbp)
movl $0x10, %eax
subl 0x104(%rcx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r12d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movl 0x80(%rbx,%r14,4), %r12d
movq %r12, -0xa0(%rbp)
movl $0x10, %eax
subl 0xc0(%rbx,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r12d, %eax
decl %eax
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x51bf
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x51cf
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
incq %r14
movq -0x40(%rbp), %r15
movl 0x10c(%r15), %eax
cmpq %rax, %r14
movq -0x48(%rbp), %r12
jb 0x5098
movl 0x10c(%r12), %ecx
testl %ecx, %ecx
je 0x537c
movl 0x108(%r15), %eax
xorl %r14d, %r14d
testl %eax, %eax
je 0x536c
xorl %r12d, %r12d
leaq -0xd0(%rbp), %rax
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq (%r13), %rax
movq %r15, %rbx
movq -0x38(%rbp), %r15
movq (%rax,%r15,8), %rax
movl (%rax), %ecx
movl %ecx, -0xd8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rcx
movq %rcx, -0xc0(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rcx
movl 0x80(%rcx,%r14,4), %r13d
movq %r13, -0xb0(%rbp)
movl $0x10, %eax
subl 0xc0(%rcx,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq %rax, -0xa8(%rbp)
movl (%rbx,%r12,4), %r13d
movq %r13, -0xa0(%rbp)
movl $0x10, %eax
subl 0x40(%rbx,%r12,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x2120
cvttsd2si %xmm0, %eax
addl %r13d, %eax
decl %eax
movq -0xe0(%rbp), %r13
movq %rax, -0x98(%rbp)
movq (%r13), %rax
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movq %rcx, -0x90(%rbp)
movq 0x50(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x5339
movl $0x88, %edx
movq %rsi, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2100
movq -0x30(%rbp), %rax
addq $0x88, 0x8(%rax)
jmp 0x5349
movq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x53ae
incq %r12
movq -0x40(%rbp), %r15
movl 0x108(%r15), %eax
cmpq %rax, %r12
jb 0x520f
movq -0x48(%rbp), %rcx
movl 0x10c(%rcx), %ecx
jmp 0x536e
xorl %eax, %eax
incq %r14
movl %ecx, %edx
cmpq %rdx, %r14
jb 0x5204
movq -0x38(%rbp), %r14
incq %r14
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r14
jb 0x473f
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop