// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1b8, %rsp            # imm = 0x1B8
movq %rdx, 0x18(%rsp)
movq %rdi, %rbx
movq (%rsi), %r14
movq %rsi, 0x8(%rsp)
movq 0x8(%rsi), %r15
cmpq %r15, %r14
sete %bpl
je 0x26da1
leaq 0x58(%rbx), %r12
movslq (%r14), %r13
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x26d62
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x26d64
xorl %eax, %eax
testq %rax, %rax
jne 0x26d74
imulq $0x38, %r13, %rcx
cmpb $0x0, (%r12,%rcx)
je 0x26d91
testq %rax, %rax
je 0x26d82
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
addq $0x10, %r14
cmpq %r15, %r14
sete %bpl
jne 0x26d4e
jmp 0x26da1
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb $0x1, %bpl
je 0x27d5f
leaq 0x188(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
callq 0x2684e
xorl %eax, %eax
movq %rax, 0x100(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movq %rax, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movq %rax, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movq %rax, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %rax, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %rcx, 0x108(%rsp)
cmpq %rcx, %rax
je 0x27232
leaq 0x48(%rsp), %r14
leaq 0x1a0(%rsp), %r15
movq %rax, 0x110(%rsp)
movl (%rax), %eax
movl %eax, 0x68(%rsp)
movq %rbx, 0x20(%rsp)
movl %eax, 0x28(%rsp)
cmpl $-0x1, %eax
je 0x26e6d
movq 0x48(%rbx), %rdi
movl 0x9fa4(%rbx), %esi
xorl %edx, %edx
divl 0x9fac(%rbx)
movl %eax, %edx
callq 0x6768
movq %rax, 0x30(%rsp)
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x20100
movq %r15, %rdi
movq %r14, %rsi
callq 0xa450
movq %rbx, %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
callq 0x26616
movl %eax, %ebp
movq %r15, %rdi
callq 0xa564
testb %bpl, %bpl
je 0x27210
movq 0x8(%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %r15
xorl %ebp, %ebp
cmpq %r15, %r14
je 0x26f44
movl (%r14), %r12d
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x26ed3
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x26ed5
xorl %eax, %eax
movq 0x758(%rbx), %rcx
movq 0x30(%rcx), %rdx
movq 0x38(%rcx), %rcx
cmpq %rcx, %rdx
sete %r13b
je 0x26f23
movzbl %bpl, %ebp
cmpl %r12d, (%rdx)
movl $0x1, %esi
cmovel %esi, %ebp
je 0x26f23
addq $0x4, %rdx
cmpq %rcx, %rdx
sete %r13b
je 0x26f23
leaq 0x4(%rdx), %rsi
cmpl %r12d, (%rdx)
movzbl %bpl, %ebp
movl $0x1, %edx
cmovel %edx, %ebp
movq %rsi, %rdx
jne 0x26f02
testq %rax, %rax
je 0x26f31
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
addq $0x10, %r14
cmpq %r15, %r14
setne %al
testb %al, %r13b
jne 0x26ebf
testb $0x1, %bpl
je 0x26f7f
movq 0x758(%rbx), %rcx
addq $0x30, %rcx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0x2330a
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x296b6
movq %r14, %rdi
callq 0xa564
movq 0x8(%rsp), %rax
movq (%rax), %r14
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq %rax, %r14
je 0x26fe5
movl (%r14), %r13d
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x26fab
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
jmp 0x26fae
xorl %r15d, %r15d
movq 0x48(%rsp), %r12
movq $0x0, (%r12,%r13,8)
testq %r15, %r15
je 0x26fdb
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
movq %rax, (%r12,%r13,8)
testq %r15, %r15
je 0x26fdb
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
addq $0x10, %r14
cmpq (%rsp), %r14
jne 0x26f94
testb $0x1, %bpl
je 0x27020
movq 0x758(%rbx), %rcx
addq $0x30, %rcx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0x2330a
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0x296b6
movq %r14, %rdi
callq 0xa564
movq 0x760(%rbx), %rax
movq 0x768(%rbx), %rcx
movq %rcx, 0x88(%rsp)
cmpq %rcx, %rax
sete 0x60(%rsp)
je 0x271c4
movq %rax, 0x10(%rsp)
movq (%rax), %r15
movq 0x8(%rsp), %rax
movq (%rax), %rbp
movq 0x8(%rax), %rax
movq %rax, (%rsp)
cmpq %rax, %rbp
je 0x270c7
movl (%rbp), %r12d
movq 0x8(%rbp), %rdi
testq %rdi, %rdi
je 0x27076
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x27078
xorl %eax, %eax
movq 0x30(%r15), %rcx
movq 0x38(%r15), %rdx
movl $0x11, %r13d
cmpq %rdx, %rcx
je 0x2709f
cmpl %r12d, (%rcx)
setne %r14b
je 0x270a4
addq $0x4, %rcx
cmpq %rdx, %rcx
jne 0x2708b
jmp 0x270aa
movb $0x1, %r14b
jmp 0x270aa
movl $0x13, %r13d
testq %rax, %rax
je 0x270b8
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
testb %r14b, %r14b
je 0x270cd
addq $0x10, %rbp
cmpq (%rsp), %rbp
jne 0x27061
movl $0xf, %r13d
cmpl $0x13, %r13d
je 0x270ed
cmpl $0xf, %r13d
movq 0x10(%rsp), %rax
jne 0x271a8
movl $0xe, %r13d
jmp 0x271a8
leaq 0x30(%r15), %rcx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rdx
callq 0x2330a
movq 0x50(%r15), %rax
movq 0x48(%rax), %rax
movslq 0x778(%rax), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
leaq 0x140(%rsp), %rdi
movq %r14, %rdx
callq 0x1a1fe
movq 0x140(%rsp), %rbp
movq 0x148(%rsp), %r14
movq 0x150(%rsp), %r15
movq 0x70(%rsp), %rdi
callq 0x9fbe
movl (%rax), %esi
movq 0x78(%rsp), %rdx
subq 0x70(%rsp), %rdx
shrq $0x3, %rdx
leaq 0x1aaf5(%rip), %rdi     # 0x41c62
xorl %eax, %eax
callq 0x5080
cmpq %rbp, %r14
movl $0x0, %r13d
movl $0x14, %eax
cmovel %eax, %r13d
testq %rbp, %rbp
je 0x27199
subq %rbp, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x53a0
leaq 0x70(%rsp), %rdi
callq 0xa564
movq 0x10(%rsp), %rax
cmpl $0xe, %r13d
je 0x271b3
testl %r13d, %r13d
jne 0x271c4
addq $0x8, %rax
cmpq 0x88(%rsp), %rax
jmp 0x27039
testb $0x1, 0x60(%rsp)
leaq 0x48(%rsp), %r14
leaq 0x1a0(%rsp), %r15
je 0x27210
movq 0xf8(%rsp), %rsi
cmpq 0x100(%rsp), %rsi
je 0x271fe
movl 0x68(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xf8(%rsp)
jmp 0x27210
leaq 0xf0(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x1d780
movq %r14, %rdi
callq 0xa564
movq 0x110(%rsp), %rax
addq $0x4, %rax
cmpq 0x108(%rsp), %rax
jne 0x26e33
movq 0xd0(%rsp), %r15
movq 0xd8(%rsp), %r12
cmpq %r12, %r15
je 0x27282
movq %r12, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2987b
movq %r15, %rdi
movq %r12, %rsi
callq 0x2993a
movq 0xb0(%rsp), %r15
movq 0xb8(%rsp), %r12
cmpq %r12, %r15
je 0x272d2
movq %r12, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2987b
movq %r15, %rdi
movq %r12, %rsi
callq 0x2993a
movq 0xd0(%rsp), %r12
movq 0xb0(%rsp), %r15
cmpq 0xd8(%rsp), %r12
je 0x2735e
cmpq 0xb8(%rsp), %r15
je 0x2735e
leaq 0x90(%rsp), %r13
leaq 0x160(%rsp), %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0x9abe
testb %al, %al
je 0x2731b
addq $0x18, %r12
jmp 0x27346
movq %r12, %rdi
movq %r15, %rsi
callq 0x9b3e
testb %al, %al
je 0x2733b
movq %r13, %rdi
movq %r12, %rsi
callq 0x9c86
addq $0x18, %r12
jmp 0x2734a
movq %rbp, %rdi
movq %r15, %rsi
callq 0x9c86
addq $0x18, %r15
cmpq 0xd8(%rsp), %r12
je 0x2735e
cmpq 0xb8(%rsp), %r15
jne 0x27306
cmpq 0xd8(%rsp), %r12
je 0x27389
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x9c86
addq $0x18, %r12
cmpq 0xd8(%rsp), %r12
jne 0x27370
cmpq 0xb8(%rsp), %r15
je 0x273b4
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x9c86
addq $0x18, %r15
cmpq 0xb8(%rsp), %r15
jne 0x2739b
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpq $0x2, %rcx
setae %bpl
jb 0x2744d
movl $0x1, %ecx
movl $0x2, %r14d
leal -0x2(%r14), %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%rax,%rdx,8), %rdi
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rsi
callq 0x9abe
testb %al, %al
jne 0x27447
movl %r14d, %ecx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incl %r14d
cmpq %rcx, %rdx
seta %bpl
ja 0x273f4
jmp 0x2744d
movl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
testb $0x1, %bpl
jne 0x27cf1
movl %r13d, %r14d
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
setne %bpl
je 0x27513
leaq 0x7a0(%rbx), %rcx
movq %rcx, (%rsp)
movl $0x1, %r13d
xorl %ecx, %ecx
movslq 0x778(%rbx), %rdx
imulq $0x98, %rdx, %rsi
addq (%rsp), %rsi
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdx
leaq 0x20(%rsp), %rdi
callq 0x1a1fe
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r15
cmpq %r12, %r15
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
cmovnel %eax, %r14d
testq %r12, %r12
je 0x274d6
movq 0x30(%rsp), %rsi
subq %r12, %rsi
movq %r12, %rdi
callq 0x53a0
cmpq %r12, %r15
jne 0x27513
movl %r13d, %ecx
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
incl %r13d
cmpq %rcx, %rdx
seta %bpl
ja 0x27487
testb $0x1, %bpl
movl %r14d, %r13d
jne 0x27cf1
movq 0xf0(%rsp), %r14
movq 0xf8(%rsp), %r15
cmpq %r15, %r14
je 0x2754b
movl (%r14), %esi
movq %rbx, %rdi
movq 0x8(%rsp), %rdx
callq 0x2307a
addq $0x4, %r14
jmp 0x27530
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rax
movq %rax, 0x180(%rsp)
cmpq %rax, %rsi
je 0x27cee
movabsq $0x7fffffff8, %r15      # imm = 0x7FFFFFFF8
leaq 0x80(%rbx), %rax
movq %rax, 0x110(%rsp)
leaq 0x48(%rsp), %r14
leaq 0x20(%rsp), %rbp
leaq 0x1a5b2(%rip), %r12     # 0x41b48
movq %r14, %rdi
movq %rsi, 0x108(%rsp)
callq 0xa450
movq 0x38(%rbx), %rax
cmpl $0x0, 0x820(%rax)
je 0x27cc2
xorl %esi, %esi
movq 0x38(%rbx), %rax
movq 0x20(%rax,%rsi,8), %rdi
movq 0x760(%rdi), %rcx
cmpq %rcx, 0x768(%rdi)
je 0x27cac
leaq (%rax,%rsi,8), %rax
addq $0x20, %rax
xorl %r14d, %r14d
movq %rsi, 0x10(%rsp)
movq (%rcx,%r14,8), %rcx
movq 0x50(%rcx), %rcx
cmpq %rbx, 0x48(%rcx)
jne 0x27c77
movq 0x780(%rdi), %rcx
movslq (%rcx,%r14,4), %rcx
imulq $0x98, %rcx, %rcx
cmpl $-0x1, 0x814(%rdi,%rcx)
movq %r14, 0x8(%rsp)
je 0x2765f
movq (%rax), %rax
movq 0x780(%rax), %rcx
movslq (%rcx,%r14,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
movq %rbp, %rdi
leaq 0x48(%rsp), %rdx
callq 0x1a1fe
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x2770d
addq $0x7a0, %rdi            # imm = 0x7A0
addq %rcx, %rdi
xorl %r13d, %r13d
movq $0x0, 0x18(%rsp)
callq 0x19846
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %r14
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq 0x8(%rsp), %rdx
movq %rdx, %r15
movslq (%rcx,%rdx,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rsi
addq $0x7a0, %rsi            # imm = 0x7A0
movq %rbp, %rdi
leaq 0x48(%rsp), %rdx
callq 0x1a1fe
movq 0x20(%rsp), %r13
movq 0x28(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rbx), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movslq (%rcx,%r15,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
callq 0x19886
movq 0x60(%rsp), %rcx
movabsq $0x7fffffff8, %r15      # imm = 0x7FFFFFFF8
subq %r13, %rcx
je 0x27c5d
sarq $0x2, %rcx
movq $0x0, (%rsp)
movq %r13, 0x88(%rsp)
movq %rcx, 0x60(%rsp)
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rax,%rcx,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
cmpl $-0x1, 0x74(%rdi)
je 0x27832
movq (%rsp), %rax
movl (%r13,%rax,4), %edx
leaq 0x48(%rsp), %rsi
callq 0x1afe8
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
testq %r15, %rax
je 0x277e4
xorl %r14d, %r14d
movq $0x0, 0x128(%rsp)
movq %rbp, %rdi
leaq 0x128(%rsp), %rsi
callq 0xa1bc
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x277ce
movq (%rdi), %rax
callq *0x8(%rax)
incl %r14d
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %r14d
jb 0x2779f
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rax,%rcx,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 (%rsp), %rax
movl (%r13,%rax,4), %edx
movq %rbp, %rsi
callq 0x1ae86
movq %rbp, %rdi
callq 0xa564
jmp 0x2796a
callq 0x19846
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rax,%rcx,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 (%rsp), %rax
movl (%r13,%rax,4), %edx
leaq 0x48(%rsp), %rsi
callq 0x1afe8
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
testq %r15, %rax
je 0x278e2
xorl %r14d, %r14d
movq $0x0, 0x130(%rsp)
movq %rbp, %rdi
leaq 0x130(%rsp), %rsi
callq 0xa1bc
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x278cc
movq (%rdi), %rax
callq *0x8(%rax)
incl %r14d
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %r14d
jb 0x2789d
movq %r15, %r12
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %r14
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movq %r13, %rdx
movq 0x8(%rsp), %r13
movslq (%rcx,%r13,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
movq %rdx, %r15
movq (%rsp), %rax
movl (%rdx,%rax,4), %edx
movq %rbp, %rsi
callq 0x1ae86
movq 0x38(%rbx), %rax
movq 0x20(%rax,%r14,8), %rax
movq 0x780(%rax), %rcx
movslq (%rcx,%r13,4), %rcx
imulq $0x98, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0x7a0, %rdi            # imm = 0x7A0
callq 0x19886
movq %rbp, %rdi
callq 0xa564
movq %r15, %r13
movq %r12, %r15
leaq 0x1a1de(%rip), %r12     # 0x41b48
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %rcx
movq 0x20(%rax,%rcx,8), %rsi
movq (%rsp), %rax
movl (%r13,%rax,4), %edx
leaq 0x70(%rsp), %rdi
callq 0x22ea4
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
xorl %eax, %eax
movq %rax, 0x150(%rsp)
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
testq %r15, %rax
je 0x279ec
xorl %r14d, %r14d
movq %rbp, %rdi
movl $0x1, %esi
callq 0x12d56
incl %r14d
movq 0x78(%rsp), %rax
subq 0x70(%rsp), %rax
shrq $0x3, %rax
cmpl %eax, %r14d
jb 0x279c9
movq 0x38(%rbx), %rax
movq 0x10(%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), %rdx
subq %rax, %rdx
je 0x27a44
sarq $0x2, %rdx
movq 0x20(%rsp), %rsi
xorl %edi, %edi
movl (%rax,%rdi,4), %ecx
movl %ecx, %r8d
movq $-0x2, %r9
rolq %cl, %r9
shrl $0x6, %r8d
andq %r9, (%rsi,%r8,8)
incq %rdi
movl %edi, %ecx
cmpq %rcx, %rdx
ja 0x27a22
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
testq %r15, %rcx
je 0x27b00
xorl %r15d, %r15d
movq 0x20(%rsp), %rcx
movq %r15, %rdx
shrq $0x6, %rdx
movq (%rcx,%rdx,8), %rcx
btq %r15, %rcx
jae 0x27a84
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x27aaf
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x27ab1
movq $0x0, 0x118(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xa1bc
movq 0x118(%rsp), %rdi
jmp 0x27ad6
xorl %eax, %eax
movq %rax, 0x120(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0xa1bc
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x27ae1
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
movq 0x70(%rsp), %rax
movq 0x78(%rsp), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movl %ecx, %ecx
cmpq %rcx, %r15
jb 0x27a5d
movq 0x48(%rbx), %rdi
movl 0x9fa4(%rbx), %esi
movq (%rsp), %rax
movl (%r13,%rax,4), %eax
xorl %edx, %edx
divl 0x9fac(%rbx)
movl %eax, %edx
leaq 0x13c(%rsp), %rcx
callq 0x6834
movq %rax, 0x68(%rsp)
movl 0x9fac(%rbx), %ecx
leal -0x1(%rcx), %edx
shrl $0x3, %edx
leaq (%rax,%rdx), %rsi
addq %rdx, %rax
incq %rax
movq %rax, 0x68(%rsp)
movq (%rsp), %rax
movl (%r13,%rax,4), %eax
xorl %edx, %edx
divl %ecx
imull 0x9fa8(%rbx), %edx
leaq (%rdx,%rsi), %rax
incq %rax
movq %rax, 0x68(%rsp)
cmpl $0x0, 0x54(%rbx)
je 0x27bdc
movq 0x110(%rsp), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movl -0x4(%r15), %edx
cmpq $0x4, %rdx
ja 0x27bac
movslq (%r12,%rdx,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x4, %ecx
jmp 0x27bb1
movl $0x10, %ecx
jmp 0x27bb1
movzbl (%r15), %ecx
jmp 0x27bb1
movl $0x8, %ecx
jmp 0x27bb1
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x140(%rsp), %rsi
addq %r13, %rsi
movq %rbx, %rdi
leaq 0x68(%rsp), %r8
callq 0x21df2
incq %r14
movl 0x54(%rbx), %eax
addq $0x8, %r13
addq $0x38, %r15
cmpq %rax, %r14
jb 0x27b7e
movq 0x48(%rbx), %rdi
movl 0x13c(%rsp), %esi
movq 0x88(%rsp), %r13
callq 0x68ee
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x27c24
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xa564
leaq 0x70(%rsp), %rdi
callq 0xa564
movq (%rsp), %rdx
incl %edx
movq 0x60(%rsp), %rcx
movq %rdx, (%rsp)
cmpq %rdx, %rcx
movabsq $0x7fffffff8, %r15      # imm = 0x7FFFFFFF8
ja 0x2772f
testq %r13, %r13
movq 0x8(%rsp), %r14
je 0x27c77
movq 0x18(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0x53a0
incl %r14d
movq 0x38(%rbx), %rax
movq 0x10(%rsp), %rsi
leaq (%rax,%rsi,8), %rax
addq $0x20, %rax
movq (%rax), %rdi
movq 0x760(%rdi), %rcx
movq 0x768(%rdi), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
ja 0x275e6
incq %rsi
movq 0x38(%rbx), %rax
movl 0x820(%rax), %eax
cmpq %rax, %rsi
jb 0x275b9
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0xa564
movq 0x108(%rsp), %rsi
addq $0x18, %rsi
xorl %r13d, %r13d
cmpq 0x180(%rsp), %rsi
jne 0x27596
jmp 0x27cf1
xorl %r13d, %r13d
leaq 0x160(%rsp), %rdi
callq 0x28798
leaq 0x90(%rsp), %rdi
callq 0x28798
leaq 0xb0(%rsp), %rdi
callq 0x28798
leaq 0xd0(%rsp), %rdi
callq 0x28798
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x27d42
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x27d5f
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
movl %r13d, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27dad
jmp 0x27e11
jmp 0x27dad
jmp 0x27d84
jmp 0x27e11
movq %rax, %rbx
jmp 0x27dd7
jmp 0x27e11
jmp 0x27dad
jmp 0x27dad
jmp 0x27dad
jmp 0x27dad
jmp 0x27dad
jmp 0x27e11
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
jmp 0x27ddc
jmp 0x27dad
jmp 0x27dad
jmp 0x27de6
movq %rax, %rbx
jmp 0x27ef9
jmp 0x27e11
movq %rax, %rbx
xorl %r15d, %r15d
xorl %ebp, %ebp
jmp 0x27dc4
movq %rax, %rbx
testq %rbp, %rbp
je 0x27dd7
subq %rbp, %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x53a0
leaq 0x70(%rsp), %rdi
callq 0xa564
jmp 0x27eef
movq %rax, %rbx
xorl %r13d, %r13d
movq $0x0, 0x18(%rsp)
jmp 0x27eda
jmp 0x27e28
jmp 0x27e11
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
jmp 0x27eef
jmp 0x27e11
movq %rax, %rbx
jmp 0x27eef
movq %rax, %rbx
jmp 0x27e7c
movq %rax, %rbx
movq %r15, %r13
jmp 0x27e7c
jmp 0x27e28
movq %rax, %rbx
jmp 0x27eda
jmp 0x27e90
movq %rax, %rbx
movq 0x118(%rsp), %rdi
jmp 0x27e59
movq %rax, %rbx
movq 0x130(%rsp), %rdi
jmp 0x27e71
jmp 0x27e90
movq %rax, %rbx
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x27e93
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x27e93
movq %rax, %rbx
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x27e7c
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x20(%rsp), %rdi
jmp 0x27ed5
movq %rax, %rbx
movq 0x88(%rsp), %r13
jmp 0x27e93
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x27ec3
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xa564
leaq 0x70(%rsp), %rdi
callq 0xa564
testq %r13, %r13
je 0x27eef
movq 0x18(%rsp), %rsi
subq %r13, %rsi
movq %r13, %rdi
callq 0x53a0
leaq 0x48(%rsp), %rdi
callq 0xa564
leaq 0x160(%rsp), %rdi
callq 0x28798
leaq 0x90(%rsp), %rdi
callq 0x28798
leaq 0xb0(%rsp), %rdi
callq 0x28798
leaq 0xd0(%rsp), %rdi
callq 0x28798
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x27f4a
movq 0x100(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x27f67
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x53a0
movq %rbx, %rdi
callq 0x56e0
nop