// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Table.cpp
// Function: Table::updateRecords(std::vector<std::pair<int, Any>, std::allocator<std::pair<int, Any>>>&, std::vector<WhereStmt, std::allocator<WhereStmt>>&)
int Table::updateRecords(vector<Pia> &set, vector<WhereStmt> &where) {
    for (auto it: set) {
        if (col_ty[it.first].beNull() == false && it.second.isNull() == true) return -1;
    }
    vector<uint> _cols = findWheres(where), cols;
    vector<Anys> pk_add, pk_del, _pk_add, _pk_del;
    for (auto i: _cols) {
        Pointer p(this, i);
        Anys data = p.get();
        if (checkWheres(data, where)) {
            bool modify = false;
            for (auto it: set) for (auto _i: p_key->v) if (_i == (uint)it.first) {
                modify = true;
                goto BK1;
            }
            BK1: if (modify) pk_del.push_back(chooseData(data, p_key->v));
            for (auto it: set) data[it.first] = it.second;
            if (modify) pk_add.push_back(chooseData(data, p_key->v));
            for (auto it: f_key) {
                for (auto _it: set) for (auto _i: it->v) if (_i == (uint)_it.first) goto BK2;
                continue;
                BK2: Anys val = chooseData(data, it->v);
                vector<int> ans;
                Table* p_table = it->p->table;
                ans = p_table->index[p_table->p_key_index].queryRecord(&val);
                printf("%d %d\n", val[0].anyRefCast<int>(), val.size());
                if (ans.size() == 0) goto FAIL;
            }
            cols.push_back(i);
            FAIL:;
        }
    }

    sort(pk_add.begin(), pk_add.end());
    sort(pk_del.begin(), pk_del.end());
    vector<Anys>::iterator add_it = pk_add.begin(), del_it = pk_del.begin(), it;
    while (add_it != pk_add.end() && del_it != pk_del.end()) {
        if (*add_it == *del_it) add_it++, del_it++; 
        else if (*add_it < *del_it) _pk_add.push_back(*add_it), add_it++;
        else _pk_del.push_back(*del_it), del_it++;
    }
    while (add_it != pk_add.end()) _pk_add.push_back(*add_it), add_it++;
    while (del_it != pk_del.end()) _pk_del.push_back(*del_it), del_it++;

    for (uint i = 1; i < _pk_add.size(); i++) if (_pk_add[i-1] == _pk_add[i]) return -5;
    for (uint i = 0; i < _pk_add.size(); i++) {
        vector<int> ans = this->index[p_key_index].queryRecord(&_pk_add[i]);
        if (ans.size() != 0) return -7;
    }
    
    for (auto i: cols) updateRecord(i, set);
    for (auto it: pk_del) {
        for (uint i = 0;i < db->table_num;i ++){
            for(uint j = 0;j < db->table[i]->f_key.size();j ++){
                if(db->table[i]->f_key[j]->p->table == this){
                    std::vector <int> ans;
                    if(db->table[i]->index[db->table[i]->f_key_index[j]].fileID == -1){
                        db->table[i]->index[db->table[i]->f_key_index[j]].open();
                        ans = db->table[i]->index[db->table[i]->f_key_index[j]].queryRecord(&it);
                        db->table[i]->index[db->table[i]->f_key_index[j]].close();
                    }
                    else {
                        ans = db->table[i]->index[db->table[i]->f_key_index[j]].queryRecord(&it);
                    }
                    for(uint k = 0;k < ans.size();k ++){
                        if(db->table[i]->index[db->table[i]->f_key_index[j]].fileID == -1){
                            db->table[i]->index[db->table[i]->f_key_index[j]].open();
                            db->table[i]->index[db->table[i]->f_key_index[j]].removeRecord(&it,ans[k]);
                            Anys nullkey;
                            for(uint m = 0;m < it.size();m ++)nullkey.push_back(Any());
                            db->table[i]->index[db->table[i]->f_key_index[j]].insertRecord(&nullkey,ans[k]);
                            db->table[i]->index[db->table[i]->f_key_index[j]].close();
                        }
                        else {
                            db->table[i]->index[db->table[i]->f_key_index[j]].removeRecord(&it,ans[k]);
                            Anys nullkey;
                            for(uint m = 0;m < it.size();m ++)nullkey.push_back(Any());
                            db->table[i]->index[db->table[i]->f_key_index[j]].insertRecord(&nullkey,ans[k]);
                        }
                        Anys pre = db->table[i]->queryRecord(ans[k]);
                        Anys after;
                        vector<bool> mark;
                        for(uint m = 0;m < pre.size();m ++)mark.push_back(true);
                        for(uint m = 0;m < db->table[i]->f_key[j]->v.size();m ++)mark[db->table[i]->f_key[j]->v[m]] = false;
                        for(uint m = 0;m < pre.size();m ++){
                            if(mark[m]) after.push_back(pre[m]);
                            else after.push_back(Any());
                        }
                        int index;
                        BufType buf = bpm->getPage(main_file, ans[k] / record_onepg, index);
                        buf += (record_onepg - 1) / 8 + 1;
                        buf += record_size * (ans[k] % record_onepg);
                        for (uint i = 0; i < col_num; i++) {
                            insert(after[i], col_ty[i].ty, col_ty[i].size(), buf);
                        }
                        bpm->markDirty(index);
                    }
                }
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdx, 0x68(%rsp)
movq %rdi, %r12
movq (%rsi), %r14
movq %rsi, 0x8(%rsp)
movq 0x8(%rsi), %r15
leaq 0x58(%rdi), %rax
movq %rax, 0x90(%rsp)
pushq $-0x1
popq %rax
movq %rax, 0x40(%rsp)
cmpq %r15, %r14
je 0x1fb78
movslq (%r14), %rbx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x1fb49
movq (%rdi), %rax
callq *0x10(%rax)
imulq $0x38, %rbx, %rcx
movq 0x90(%rsp), %rdx
cmpb $0x0, (%rdx,%rcx)
je 0x1fb60
testq %rax, %rax
jne 0x1fb69
jmp 0x1fb72
imulq $0x38, %rbx, %rax
movq 0x90(%rsp), %rcx
cmpb $0x0, (%rcx,%rax)
jne 0x1fb72
jmp 0x2016d
testq %rax, %rax
je 0x2016d
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
addq $0x10, %r14
jmp 0x1fb19
leaq 0x1d0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq 0x68(%rsp), %rdx
callq 0x1f78c
xorps %xmm0, %xmm0
leaq 0x1a0(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x140(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0xd0(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movaps %xmm0, (%rax)
andq $0x0, 0x130(%rsp)
movaps %xmm0, (%rcx)
andq $0x0, 0x190(%rsp)
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x180(%rsp)
movq (%r14), %rbx
movq 0x8(%r14), %rax
movq %rax, 0x40(%rsp)
leaq 0xf0(%rsp), %r14
leaq 0x48(%rsp), %r15
leaq 0x1b8(%rsp), %r13
movq %r12, 0x18(%rsp)
cmpq 0x40(%rsp), %rbx
je 0x1ff5b
movl (%rbx), %edx
movl %edx, 0xa0(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1aa18
movq %r15, %rdi
movq %r14, %rsi
callq 0x1aa4a
movq %rbx, 0x88(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x9158
movq %r12, %rdi
movq %r13, %rsi
movq 0x68(%rsp), %rdx
callq 0x1f634
movl %eax, %ebp
movq %r13, %rdi
callq 0x9268
testb %bpl, %bpl
je 0x1ff2d
movq 0x8(%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %r13
xorl %r12d, %r12d
cmpq %r13, %r14
je 0x1fcd4
movl (%r14), %ebx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x1fc93
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x1fc95
xorl %eax, %eax
movq 0x18(%rsp), %rcx
movq 0x758(%rcx), %rdx
movq 0x30(%rdx), %rcx
movq 0x38(%rdx), %r15
movq %rcx, %rbp
cmpq %r15, %rcx
je 0x1fcbd
leaq 0x4(%rbp), %rcx
cmpl %ebx, (%rbp)
jne 0x1fca9
movb $0x1, %r12b
testq %rax, %rax
je 0x1fccb
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
addq $0x10, %r14
cmpq %r15, %rbp
je 0x1fc7a
testb $0x1, %r12b
je 0x1fd14
movq 0x18(%rsp), %rax
movq 0x758(%rax), %rcx
addq $0x30, %rcx
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x48(%rsp), %rdx
callq 0x1d010
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x222da
movq %rbx, %rdi
callq 0x9268
movq 0x8(%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x1fd75
movl (%r14), %ebx
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x1fd65
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %rbp
movq 0x48(%rsp), %r13
andq $0x0, (%r13,%rbx,8)
testq %rax, %rax
je 0x1fd6f
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x10(%rax)
movq %rax, (%r13,%rbx,8)
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x8(%rax)
jmp 0x1fd6f
movq 0x48(%rsp), %rax
andq $0x0, (%rax,%rbx,8)
addq $0x10, %r14
jmp 0x1fd20
testb $0x1, %r12b
movq 0x18(%rsp), %r12
je 0x1fdb6
movq 0x758(%r12), %rcx
addq $0x30, %rcx
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0x48(%rsp), %rdx
callq 0x1d010
leaq 0x140(%rsp), %rdi
movq %rbx, %rsi
callq 0x222da
movq %rbx, %rdi
callq 0x9268
movq 0x760(%r12), %rax
movq 0x768(%r12), %rcx
movq %rcx, 0x10(%rsp)
cmpq 0x10(%rsp), %rax
je 0x1ff18
movq %rax, 0x60(%rsp)
movq (%rax), %r14
movq 0x8(%rsp), %rax
movq (%rax), %r15
movq 0x8(%rax), %r13
leaq 0x30(%r14), %rax
movq %rax, 0x98(%rsp)
cmpq %r13, %r15
je 0x1ff0a
movl (%r15), %ebx
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x1fe13
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x1fe15
xorl %eax, %eax
movq 0x30(%r14), %rcx
movq 0x38(%r14), %rbp
movq %rcx, %r12
cmpq %rbp, %rcx
je 0x1fe30
leaq 0x4(%r12), %rcx
cmpl %ebx, (%r12)
jne 0x1fe1d
testq %rax, %rax
je 0x1fe3e
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
addq $0x10, %r15
cmpq %rbp, %r12
movq 0x18(%rsp), %r12
je 0x1fdf6
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x48(%rsp), %rdx
movq 0x98(%rsp), %rcx
callq 0x1d010
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movq 0x50(%r14), %rax
movq 0x48(%rax), %rax
movslq 0x778(%rax), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15da2
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21d54
movq %rbx, %rdi
callq 0x8c8c
movq 0x20(%rsp), %rdi
callq 0x8b08
movl (%rax), %esi
movq 0x28(%rsp), %rdx
subq 0x20(%rsp), %rdx
shrq $0x3, %rdx
leaq 0x18196(%rip), %rdi     # 0x3807a
xorl %eax, %eax
callq 0x5070
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %r14
movq %r13, %rdi
callq 0x8c8c
movq %r15, %rdi
callq 0x9268
cmpq %r14, %rbx
je 0x1ff2d
movq 0x60(%rsp), %rax
addq $0x8, %rax
jmp 0x1fdcb
leaq 0x1a0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x17fbe
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x9268
movq 0x88(%rsp), %rbx
addq $0x4, %rbx
leaq 0xf0(%rsp), %r14
leaq 0x1b8(%rsp), %r13
jmp 0x1fc0b
movq 0x140(%rsp), %rdi
movq 0x148(%rsp), %rsi
callq 0x223f5
movq 0xd0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x223f5
movq 0x140(%rsp), %r12
movq 0xd0(%rsp), %r14
leaq 0x120(%rsp), %r13
leaq 0x180(%rsp), %rbp
movq 0x148(%rsp), %rax
cmpq %rax, %r12
je 0x2001e
cmpq 0xd8(%rsp), %r14
je 0x2001e
movq %r12, %rdi
movq %r14, %rsi
callq 0x85ea
testb %al, %al
jne 0x1ffeb
movq %r12, %rdi
movq %r14, %rsi
callq 0x866e
testb %al, %al
je 0x1fff1
movq %r13, %rdi
movq %r12, %rsi
callq 0x8808
addq $0x18, %r12
jmp 0x1ffa5
addq $0x18, %r12
jmp 0x1fffc
movq %rbp, %rdi
movq %r14, %rsi
callq 0x8808
addq $0x18, %r14
jmp 0x1ffa5
leaq 0x120(%rsp), %rdi
movq %r12, %rsi
callq 0x8808
addq $0x18, %r12
movq 0x148(%rsp), %rax
cmpq %rax, %r12
jne 0x20002
leaq 0x180(%rsp), %r12
cmpq 0xd8(%rsp), %r14
je 0x20046
movq %r12, %rdi
movq %r14, %rsi
callq 0x8808
addq $0x18, %r14
jmp 0x2002b
xorl %ecx, %ecx
pushq $0x18
popq %r12
pushq $-0x5
popq %rax
movq %rax, 0x40(%rsp)
leal 0x1(%rcx), %ebx
movq 0x120(%rsp), %r8
movq 0x128(%rsp), %rax
subq %r8, %rax
cqto
idivq %r12
cmpq %rbx, %rax
jbe 0x20094
movl %ecx, %eax
imulq $0x18, %rax, %rdi
addq %r8, %rdi
imulq $0x18, %rbx, %rsi
addq %r8, %rsi
callq 0x85ea
movl %ebx, %ecx
testb %al, %al
je 0x20054
jmp 0x2011f
movq 0x18(%rsp), %rax
leaq 0x7a0(%rax), %r15
xorl %r13d, %r13d
leaq 0xf0(%rsp), %r14
pushq $-0x7
popq %rax
movq %rax, 0x40(%rsp)
movl %r13d, %r13d
movq 0x120(%rsp), %rcx
movq 0x128(%rsp), %rax
subq %rcx, %rax
cqto
idivq %r12
cmpq %r13, %rax
jbe 0x20184
movq 0x18(%rsp), %rax
movslq 0x778(%rax), %rax
imulq $0x98, %rax, %rsi
addq %r15, %rsi
imulq $0x18, %r13, %rax
addq %rax, %rcx
movq %r14, %rdi
movq %rcx, %rdx
callq 0x15da2
movq 0xf8(%rsp), %rbx
movq 0xf0(%rsp), %rbp
movq %r14, %rdi
callq 0x8c8c
incl %r13d
cmpq %rbp, %rbx
je 0x200b3
leaq 0x180(%rsp), %rdi
callq 0x20f30
leaq 0x120(%rsp), %rdi
callq 0x20f30
leaq 0xd0(%rsp), %rdi
callq 0x20f30
leaq 0x140(%rsp), %rdi
callq 0x20f30
leaq 0x1a0(%rsp), %rdi
callq 0x18566
leaq 0x1d0(%rsp), %rdi
callq 0x18566
movq 0x40(%rsp), %rax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1a0(%rsp), %rbx
movq 0x1a8(%rsp), %r14
movq 0x18(%rsp), %r12
cmpq %r14, %rbx
je 0x201b3
movl (%rbx), %esi
movq %r12, %rdi
movq 0x8(%rsp), %rdx
callq 0x1cdcc
addq $0x4, %rbx
jmp 0x20199
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %r13
movq $0x0, 0x40(%rsp)
leaq 0xf0(%rsp), %rbp
movq %r13, 0x88(%rsp)
cmpq %r13, %rsi
je 0x2011f
leaq 0x48(%rsp), %rdi
movq %rsi, 0x68(%rsp)
callq 0x9158
movq 0x38(%r12), %rax
xorl %r14d, %r14d
movl 0x820(%rax), %ecx
cmpq %rcx, %r14
jae 0x20812
xorl %edi, %edi
movq %r14, 0x60(%rsp)
movl %edi, %edi
movq 0x20(%rax,%r14,8), %rdx
movq 0x760(%rdx), %rcx
movq 0x768(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rdi, %rdx
jbe 0x2080a
movq (%rcx,%rdi,8), %rcx
movq 0x50(%rcx), %rcx
cmpq %r12, 0x48(%rcx)
jne 0x20803
andq $0x0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x20(%rax,%r14,8), %rcx
leaq 0x7a0(%rcx), %rsi
movq 0x780(%rcx), %rax
movq %rdi, 0x8(%rsp)
movslq (%rax,%rdi,4), %rax
imulq $0x98, %rax, %rax
cmpl $-0x1, 0x814(%rcx,%rax)
je 0x202ae
addq %rax, %rsi
movq %rbp, %rdi
leaq 0x48(%rsp), %rdx
callq 0x15da2
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x21d54
movq %rbp, %rdi
callq 0x8c8c
jmp 0x20333
addq %rax, %rsi
movq %rsi, %rdi
callq 0x155f8
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq 0x8(%rsp), %rbx
movslq (%rcx,%rbx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
movq %rbp, %rdi
leaq 0x48(%rsp), %rdx
callq 0x15da2
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x21d54
movq %rbp, %rdi
callq 0x8c8c
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movslq (%rcx,%rbx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
callq 0x15638
xorl %ebx, %ebx
movl %ebx, %ebx
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x207ef
movq %rbx, 0x10(%rsp)
movq 0x38(%r12), %rcx
movq 0x20(%rcx,%r14,8), %rcx
movq 0x780(%rcx), %rdx
movq 0x8(%rsp), %rsi
movslq (%rdx,%rsi,4), %rdx
imulq $0x98, %rdx, %rdx
leaq (%rcx,%rdx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
cmpl $-0x1, 0x74(%rdi)
je 0x2043c
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x48(%rsp), %rsi
callq 0x168cc
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
andq $0x0, 0x100(%rsp)
xorl %ebx, %ebx
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %ebx
jae 0x203f6
andq $0x0, 0xb8(%rsp)
movq %rbp, %rdi
leaq 0xb8(%rsp), %rsi
callq 0x8ea0
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x203f2
movq (%rdi), %rax
callq *0x8(%rax)
incl %ebx
jmp 0x203b4
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq 0x8(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq %rbp, %rsi
callq 0x16790
jmp 0x20549
callq 0x155f8
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq 0x8(%rsp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x48(%rsp), %rsi
callq 0x168cc
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
andq $0x0, 0x100(%rsp)
xorl %ebx, %ebx
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %ebx
jae 0x204dc
andq $0x0, 0xc0(%rsp)
movq %rbp, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x8ea0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x204d8
movq (%rdi), %rax
callq *0x8(%rax)
incl %ebx
jmp 0x2049a
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq 0x8(%rsp), %rbx
movslq (%rcx,%rbx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq %rbp, %rsi
callq 0x16790
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movslq (%rcx,%rbx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
callq 0x15638
movq %rbp, %rdi
callq 0x9268
movq 0x38(%r12), %rax
movq 0x20(%rax,%r14,8), %rsi
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x70(%rsp), %rdi
callq 0x1cc4e
andq $0x0, 0x170(%rsp)
andq $0x0, 0xf0(%rsp)
andl $0x0, 0xf8(%rsp)
andq $0x0, 0x100(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x160(%rsp)
andl $0x0, 0x108(%rsp)
andq $0x0, 0x110(%rsp)
xorl %ebx, %ebx
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %ebx
jae 0x205d4
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0x10498
incl %ebx
jmp 0x205b3
xorl %r14d, %r14d
movl %r14d, %r14d
movq 0x38(%r12), %rax
movq 0x60(%rsp), %rcx
movq 0x20(%rax,%rcx,8), %rax
movq 0x760(%rax), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq 0x30(%rcx), %rax
movq 0x38(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x20624
movl (%rax,%r14,4), %esi
movq %rbp, %rdi
callq 0x20f52
notq %rdx
andq %rdx, (%rax)
incl %r14d
jmp 0x205d7
xorl %r15d, %r15d
movq 0x60(%rsp), %r14
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
shrq $0x3, %rax
movl %eax, %eax
cmpq %rax, %r15
jae 0x206cd
movq %rbp, %rdi
movq %r15, %rsi
callq 0x20f52
testq %rdx, (%rax)
je 0x2066b
movq 0x70(%rsp), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x20693
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x20695
andq $0x0, 0xa8(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x8ea0
movq 0xa8(%rsp), %rdi
jmp 0x206ba
xorl %eax, %eax
movq %rax, 0xb0(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x8ea0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x206c5
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
jmp 0x2062c
movq 0x48(%r12), %rdi
movl 0x9fa4(%r12), %esi
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rbx
movl (%rax,%rbx,4), %eax
xorl %edx, %edx
divl 0x9fac(%r12)
movl %eax, %edx
leaq 0xcc(%rsp), %rcx
callq 0x5d50
movq %rax, %rcx
movl 0x9fac(%r12), %esi
leal -0x1(%rsi), %eax
shrl $0x3, %eax
addq %rax, %rcx
movq 0x20(%rsp), %rax
movl (%rax,%rbx,4), %eax
xorl %edx, %edx
divl %esi
imull 0x9fa8(%r12), %edx
leaq (%rdx,%rcx), %rax
incq %rax
movq %rax, 0xa0(%rsp)
movq 0x90(%rsp), %r15
xorl %ebx, %ebx
xorl %ecx, %ecx
movq 0x18(%rsp), %r12
movl 0x54(%r12), %eax
cmpq %rax, %rcx
jae 0x207ab
movq %rcx, %r14
movq %rbp, %r13
movq 0x160(%rsp), %rbp
addq %rbx, %rbp
movl 0x24(%r15), %eax
movl %eax, 0x98(%rsp)
movq %r15, %rdi
callq 0x17ffa
movq %r12, %rdi
movq %rbp, %rsi
movl 0x98(%rsp), %edx
movl %eax, %ecx
leaq 0xa0(%rsp), %r8
callq 0x1bed4
movq %r14, %rcx
incq %rcx
addq $0x8, %rbx
addq $0x38, %r15
movq %r13, %rbp
movq 0x60(%rsp), %r14
jmp 0x20744
movq 0x48(%r12), %rdi
movl 0xcc(%rsp), %esi
callq 0x5e0a
movq 0x10(%rsp), %rbx
movq %rbp, %rdi
callq 0x104d6
leaq 0x160(%rsp), %rdi
callq 0x9268
leaq 0x70(%rsp), %rdi
callq 0x9268
incl %ebx
movq 0x88(%rsp), %r13
jmp 0x20335
leaq 0x20(%rsp), %rdi
callq 0x8c8c
movq 0x38(%r12), %rax
movq 0x8(%rsp), %rdi
incl %edi
jmp 0x20212
incq %r14
jmp 0x201fc
leaq 0x48(%rsp), %rdi
callq 0x9268
movq 0x68(%rsp), %rsi
addq $0x18, %rsi
jmp 0x201dc
jmp 0x20860
jmp 0x20860
jmp 0x20860
jmp 0x20834
jmp 0x208b1
movq %rax, %rbx
jmp 0x20879
jmp 0x208b1
jmp 0x20860
jmp 0x20860
jmp 0x208b1
jmp 0x208a7
jmp 0x20860
jmp 0x208a7
jmp 0x208a7
jmp 0x20860
jmp 0x20860
jmp 0x20860
jmp 0x20860
jmp 0x208b1
movq %rax, %rbx
leaq 0x1b8(%rsp), %rdi
jmp 0x2087e
movq %rax, %rbx
jmp 0x2094e
jmp 0x208b1
jmp 0x2086c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x8c8c
leaq 0x20(%rsp), %rdi
callq 0x9268
jmp 0x20944
jmp 0x208b1
movq %rax, %rbx
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x8(%rax)
jmp 0x20944
jmp 0x208b1
jmp 0x208a0
movq %rax, %rbx
jmp 0x20903
jmp 0x208a7
movq %rax, %rbx
jmp 0x2093a
jmp 0x20913
movq %rax, %rbx
jmp 0x20944
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
jmp 0x208e0
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
jmp 0x208f8
jmp 0x20913
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x20916
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x20916
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x20903
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0xf0(%rsp), %rdi
jmp 0x20935
jmp 0x20913
jmp 0x20913
jmp 0x20913
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x104d6
leaq 0x160(%rsp), %rdi
callq 0x9268
leaq 0x70(%rsp), %rdi
callq 0x9268
leaq 0x20(%rsp), %rdi
callq 0x8c8c
leaq 0x48(%rsp), %rdi
callq 0x9268
leaq 0x180(%rsp), %rdi
callq 0x20f30
leaq 0x120(%rsp), %rdi
callq 0x20f30
leaq 0xd0(%rsp), %rdi
callq 0x20f30
leaq 0x140(%rsp), %rdi
callq 0x20f30
leaq 0x1a0(%rsp), %rdi
callq 0x18566
leaq 0x1d0(%rsp), %rdi
callq 0x18566
movq %rbx, %rdi
callq 0x56f0