// File: zimpha[P]MiniSQL/API.cc
// Function: API::Delete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Filter const&)
Response API::Delete(const std::string &tableName, const Filter &filter) {
    if (!cm.hasTable(tableName + ".table")) {
        return Response("Table does not exist");
    }
    
    Table nt = cm.loadTable(tableName + ".table");
    std::string dbName = tableName + ".db";
    for (size_t i = 0; i < filter.rules.size(); ++ i) {
        element val = filter.rules[i].val;
        int attrIndex = filter.rules[i].index;
        if (nt.attributes[attrIndex].type != val.type) {
            return Response("Type mismatch");
        }
    }
    
    for (size_t i = 0; i < filter.rules.size(); ++ i) {
        if (filter.rules[i].type == 2) { // =
            element val = filter.rules[i].val;
            int attrIndex = filter.rules[i].index;
            if (!nt.attributes[attrIndex].indices.empty()) { // has index on it
                std::string indexFileName = tableName + "." + nt.attributes[attrIndex].name;
                long offset = getOffset(indexFileName, val);
                // offset == -1 表示没有这个val
                // Record Manager delete records by using index
                // 传入数据库文件名（dbName），偏移量(offset)，过滤器(filter)，当前表(nt)
                rm.RecordManagerRecordDelete(dbName, offset, filter, nt);
                return Response();
            }
        }
    }
    /*
    if (filter.rules.empty()) {
        // Record Manager delete records without index
        // 传入数据库文件名（dbName），过滤器(filter)，当前表(nt)
        rm.rmDeleteWithoutIndex(dbName, filter, nt);
        return Response();
    }
    */
    std::set<long> offset;
    // Record Manager get offset according to dbName
    // 传入数据库文件名(daName)，返回一个offset的集合(类型set)
    offset = rm.RecordManagerGetAllOffsets(dbName, nt);
    for (size_t i = 0; i < filter.rules.size(); ++ i) {
        Rule rule = filter.rules[i];
        int attrIndex = rule.index;
        if (nt.attributes[attrIndex].indices.empty()) {
            continue;
        }
        element val = rule.val;
        std::string indexFileName = tableName + "." + nt.attributes[attrIndex].name;
        std::set<long> newOffset;
        long tmpOffset;
        // B plus tree get offset according to filter rules
        // 传入文件名(indexFileName)，属性的值(val)
        switch (rule.type) {
            case 0: // <
                newOffset = getLessOffset(indexFileName, val);
                break;
            case 1: // <=
                newOffset = getLessOffset(indexFileName, val);
                tmpOffset = getOffset(indexFileName, val);
                if (tmpOffset != -1) {
                    newOffset.insert(tmpOffset);
                }
                break;
            case 2: // =
                assert(false);
                break;
            case 3: // >=
                newOffset = getMoreOffset(indexFileName, val);
                tmpOffset = getOffset(indexFileName, val);
                if (tmpOffset != -1) {
                    newOffset.insert(tmpOffset);
                }
                break;
            case 4: // >
                newOffset = getMoreOffset(indexFileName, val);
                break;
            case 5: // <>
                newOffset = offset;
                break;
            default: 
                assert(false);
                break;
        }
        std::vector<long> tmp(offset.size());
        std::vector<long>::iterator end = std::set_intersection(offset.begin(), offset.end(), newOffset.begin(), newOffset.end(), tmp.begin());
        offset.clear();
        for (std::vector<long>::iterator it = tmp.begin(); it != end; ++ it) {
            offset.insert(*it);
        }
    }
    
    for (auto x : offset) {
        // Record Manager delete records by using index
        // 传入数据库文件名（dbName），偏移量(x)，过滤器(filter)，当前表(nt)
        rm.RecordManagerRecordDelete(dbName, x, filter, nt);
    }
    return Response();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x840, %rsp            # imm = 0x840
movq %rdi, -0x760(%rbp)
movq %rdi, %rax
movq %rax, -0x758(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x750(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x210e3(%rip), %rdx     # 0x27035
leaq -0x40(%rbp), %rdi
movq %rdi, -0x748(%rbp)
callq 0x76d0
movq -0x750(%rbp), %rdi
movq -0x748(%rbp), %rsi
callq 0x1b550
movb %al, -0x739(%rbp)
jmp 0x5f7d
movb -0x739(%rbp), %al
xorb $-0x1, %al
movb %al, -0x761(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x35b8
movb -0x761(%rbp), %al
testb $0x1, %al
jne 0x5fa3
jmp 0x6040
leaq -0x71(%rbp), %rdi
movq %rdi, -0x770(%rbp)
callq 0x3500
movq -0x770(%rbp), %rdx
leaq 0x2107b(%rip), %rsi     # 0x2703c
leaq -0x70(%rbp), %rdi
callq 0x3400
jmp 0x5fcc
movq -0x760(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x24ba0
jmp 0x5fde
leaq -0x70(%rbp), %rdi
callq 0x35b8
leaq -0x71(%rbp), %rdi
callq 0x3320
jmp 0x7082
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x35b8
jmp 0x7092
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6032
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x35b8
leaq -0x71(%rbp), %rdi
callq 0x3320
jmp 0x7092
movq -0x18(%rbp), %rsi
leaq 0x20fea(%rip), %rdx     # 0x27035
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x778(%rbp)
callq 0x76d0
movq -0x750(%rbp), %rsi
movq -0x778(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x1b750
jmp 0x607a
leaq -0xe0(%rbp), %rdi
callq 0x35b8
movq -0x18(%rbp), %rsi
leaq 0x21011(%rip), %rdx     # 0x270a2
leaq -0x100(%rbp), %rdi
callq 0x76d0
jmp 0x609f
movq $0x0, -0x108(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0x780(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7a50
movq %rax, %rcx
movq -0x780(%rbp), %rax
cmpq %rcx, %rax
jae 0x6263
movq -0x20(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x7a80
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x138(%rbp), %rdi
callq 0x7aa0
jmp 0x60f9
movq -0x20(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x7a80
movl (%rax), %eax
movl %eax, -0x13c(%rbp)
leaq -0xc0(%rbp), %rdi
addq $0x28, %rdi
movslq -0x13c(%rbp), %rsi
callq 0x7810
movl 0x20(%rax), %eax
cmpl -0x110(%rbp), %eax
je 0x6224
leaq -0x161(%rbp), %rdi
movq %rdi, -0x788(%rbp)
callq 0x3500
movq -0x788(%rbp), %rdx
leaq 0x20ffd(%rip), %rsi     # 0x27155
leaq -0x160(%rbp), %rdi
callq 0x3400
jmp 0x6166
movq -0x760(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x24ba0
jmp 0x617b
leaq -0x160(%rbp), %rdi
callq 0x35b8
leaq -0x161(%rbp), %rdi
callq 0x3320
movl $0x1, -0x168(%rbp)
jmp 0x622e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x35b8
jmp 0x7092
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7074
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7068
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6207
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x35b8
leaq -0x161(%rbp), %rdi
callq 0x3320
leaq -0x138(%rbp), %rdi
callq 0x7af0
jmp 0x7068
movl $0x0, -0x168(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x7af0
movl -0x168(%rbp), %eax
testl %eax, %eax
jne 0x704e
jmp 0x624a
jmp 0x624c
movq -0x108(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x108(%rbp)
jmp 0x60aa
movq $0x0, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x790(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7a50
movq %rax, %rcx
movq -0x790(%rbp), %rax
cmpq %rcx, %rax
jae 0x6548
movq -0x20(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x7a80
cmpl $0x2, 0x4(%rax)
jne 0x652f
movq -0x20(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x7a80
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x7aa0
jmp 0x62d7
movq -0x20(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x7a80
movl (%rax), %eax
movl %eax, -0x1a4(%rbp)
leaq -0xc0(%rbp), %rdi
addq $0x28, %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x7810
movq %rax, %rdi
addq $0x30, %rdi
callq 0x7b10
testb $0x1, %al
jne 0x64f6
movq -0x18(%rbp), %rsi
leaq 0x20f65(%rip), %rdx     # 0x2728a
leaq -0x1e8(%rbp), %rdi
callq 0x76d0
jmp 0x6333
leaq -0x98(%rbp), %rdi
movslq -0x1a4(%rbp), %rsi
callq 0x7810
movq %rax, %rdx
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x78a0
jmp 0x635e
leaq -0x1e8(%rbp), %rdi
callq 0x35b8
leaq -0x210(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x3130
jmp 0x637f
leaq -0x240(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x7aa0
jmp 0x6394
movq -0x750(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x240(%rbp), %rdx
callq 0x5e60
movq %rax, -0x798(%rbp)
jmp 0x63b7
leaq -0x240(%rbp), %rdi
callq 0x7af0
leaq -0x210(%rbp), %rdi
callq 0x35b8
movq -0x798(%rbp), %rcx
movq -0x750(%rbp), %rax
movq %rcx, -0x1f0(%rbp)
addq $0x30, %rax
movq %rax, -0x7a0(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3130
jmp 0x6404
movq -0x7a0(%rbp), %rdi
movq -0x1f0(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x260(%rbp), %rsi
leaq -0xc0(%rbp), %r8
callq 0x23240
jmp 0x642b
leaq -0x260(%rbp), %rdi
callq 0x35b8
movq -0x760(%rbp), %rdi
callq 0x24b60
jmp 0x6445
movl $0x1, -0x168(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x35b8
jmp 0x6500
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x651e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x35b8
jmp 0x651e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x64e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x64c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x7af0
leaq -0x210(%rbp), %rdi
callq 0x35b8
jmp 0x64e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x35b8
leaq -0x1c8(%rbp), %rdi
callq 0x35b8
jmp 0x651e
movl $0x0, -0x168(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x7af0
movl -0x168(%rbp), %eax
testl %eax, %eax
jne 0x704e
jmp 0x651c
jmp 0x652f
leaq -0x1a0(%rbp), %rdi
callq 0x7af0
jmp 0x7068
jmp 0x6531
movq -0x170(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x170(%rbp)
jmp 0x626e
leaq -0x290(%rbp), %rdi
callq 0x7b90
movq -0x750(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x7a8(%rbp)
leaq -0x2e0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3130
jmp 0x657b
movq -0x7a8(%rbp), %rsi
leaq -0x2c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x23ca0
jmp 0x659e
leaq -0x290(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x7bb0
leaq -0x2c0(%rbp), %rdi
callq 0x7be0
leaq -0x2e0(%rbp), %rdi
callq 0x35b8
movq $0x0, -0x2e8(%rbp)
movq -0x2e8(%rbp), %rax
movq %rax, -0x7b0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x7a50
movq %rax, %rcx
movq -0x7b0(%rbp), %rax
cmpq %rcx, %rax
jae 0x6f2c
movq -0x20(%rbp), %rdi
movq -0x2e8(%rbp), %rsi
callq 0x7a80
movq %rax, %rsi
leaq -0x320(%rbp), %rdi
callq 0x7c00
jmp 0x661f
movl -0x320(%rbp), %eax
movl %eax, -0x324(%rbp)
leaq -0xc0(%rbp), %rdi
addq $0x28, %rdi
movslq -0x324(%rbp), %rsi
callq 0x7810
movq %rax, %rdi
addq $0x30, %rdi
callq 0x7b10
testb $0x1, %al
jne 0x6654
jmp 0x6691
movl $0xa, -0x168(%rbp)
jmp 0x6ec4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x7040
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x35b8
jmp 0x7040
leaq -0x318(%rbp), %rsi
leaq -0x358(%rbp), %rdi
callq 0x7aa0
jmp 0x66a6
movq -0x18(%rbp), %rsi
leaq 0x20bd9(%rip), %rdx     # 0x2728a
leaq -0x398(%rbp), %rdi
callq 0x76d0
jmp 0x66bf
leaq -0x98(%rbp), %rdi
movslq -0x324(%rbp), %rsi
callq 0x7810
movq %rax, %rdx
leaq -0x378(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0x78a0
jmp 0x66ea
leaq -0x398(%rbp), %rdi
callq 0x35b8
leaq -0x3c8(%rbp), %rdi
callq 0x7b90
movl -0x31c(%rbp), %eax
movq %rax, -0x7b8(%rbp)
subq $0x5, %rax
ja 0x6cad
movq -0x7b8(%rbp), %rax
leaq 0x208f5(%rip), %rcx     # 0x2701c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6f1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6f0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x398(%rbp), %rdi
callq 0x35b8
jmp 0x6f0f
leaq -0x420(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x6784
leaq -0x450(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x6799
movq -0x750(%rbp), %rsi
leaq -0x400(%rbp), %rdi
leaq -0x420(%rbp), %rdx
leaq -0x450(%rbp), %rcx
callq 0x5e90
jmp 0x67bc
leaq -0x3c8(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x7bb0
leaq -0x400(%rbp), %rdi
callq 0x7be0
leaq -0x450(%rbp), %rdi
callq 0x7af0
leaq -0x420(%rbp), %rdi
callq 0x35b8
jmp 0x6ccc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6ef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x682f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x7af0
leaq -0x420(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
leaq -0x4a0(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x6855
leaq -0x4d0(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x686a
movq -0x750(%rbp), %rsi
leaq -0x480(%rbp), %rdi
leaq -0x4a0(%rbp), %rdx
leaq -0x4d0(%rbp), %rcx
callq 0x5e90
jmp 0x688d
leaq -0x3c8(%rbp), %rdi
leaq -0x480(%rbp), %rsi
movq %rsi, -0x7c0(%rbp)
callq 0x7bb0
movq -0x7c0(%rbp), %rdi
callq 0x7be0
leaq -0x4d0(%rbp), %rdi
callq 0x7af0
leaq -0x4a0(%rbp), %rdi
callq 0x35b8
leaq -0x4f0(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x68e0
leaq -0x520(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x68f5
movq -0x750(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
leaq -0x520(%rbp), %rdx
callq 0x5e60
movq %rax, -0x7c8(%rbp)
jmp 0x6918
movq -0x7c8(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x520(%rbp), %rdi
callq 0x7af0
leaq -0x4f0(%rbp), %rdi
callq 0x35b8
cmpq $-0x1, -0x3d0(%rbp)
je 0x69f8
leaq -0x3c8(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x7c40
movb %dl, -0x7d1(%rbp)
movq %rax, -0x7d0(%rbp)
jmp 0x696e
movb -0x7d1(%rbp), %al
movq -0x7d0(%rbp), %rcx
movq %rcx, -0x530(%rbp)
movb %al, -0x528(%rbp)
jmp 0x69f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x69b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x7af0
leaq -0x4a0(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x69e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x520(%rbp), %rdi
callq 0x7af0
leaq -0x4f0(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
jmp 0x6ccc
leaq 0x2075f(%rip), %rdi     # 0x27163
leaq 0x206e2(%rip), %rsi     # 0x270ed
movl $0x10f, %edx            # imm = 0x10F
leaq 0x2078c(%rip), %rcx     # 0x271a3
callq 0x31f0
leaq -0x580(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x6a31
leaq -0x5b0(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x6a46
movq -0x750(%rbp), %rsi
leaq -0x560(%rbp), %rdi
leaq -0x580(%rbp), %rdx
leaq -0x5b0(%rbp), %rcx
callq 0x5ed0
jmp 0x6a69
leaq -0x3c8(%rbp), %rdi
leaq -0x560(%rbp), %rsi
movq %rsi, -0x7e0(%rbp)
callq 0x7bb0
movq -0x7e0(%rbp), %rdi
callq 0x7be0
leaq -0x5b0(%rbp), %rdi
callq 0x7af0
leaq -0x580(%rbp), %rdi
callq 0x35b8
leaq -0x5d0(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x6abc
leaq -0x600(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x6ad1
movq -0x750(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
leaq -0x600(%rbp), %rdx
callq 0x5e60
movq %rax, -0x7e8(%rbp)
jmp 0x6af4
movq -0x7e8(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x600(%rbp), %rdi
callq 0x7af0
leaq -0x5d0(%rbp), %rdi
callq 0x35b8
cmpq $-0x1, -0x3d0(%rbp)
je 0x6bd4
leaq -0x3c8(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x7c40
movb %dl, -0x7f1(%rbp)
movq %rax, -0x7f0(%rbp)
jmp 0x6b4a
movb -0x7f1(%rbp), %al
movq -0x7f0(%rbp), %rcx
movq %rcx, -0x610(%rbp)
movb %al, -0x608(%rbp)
jmp 0x6bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6b8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x5b0(%rbp), %rdi
callq 0x7af0
leaq -0x580(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6bc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x600(%rbp), %rdi
callq 0x7af0
leaq -0x5d0(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
jmp 0x6ccc
leaq -0x660(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x3130
jmp 0x6bee
leaq -0x690(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x7aa0
jmp 0x6c03
movq -0x750(%rbp), %rsi
leaq -0x640(%rbp), %rdi
leaq -0x660(%rbp), %rdx
leaq -0x690(%rbp), %rcx
callq 0x5ed0
jmp 0x6c26
leaq -0x3c8(%rbp), %rdi
leaq -0x640(%rbp), %rsi
callq 0x7bb0
leaq -0x640(%rbp), %rdi
callq 0x7be0
leaq -0x690(%rbp), %rdi
callq 0x7af0
leaq -0x660(%rbp), %rdi
callq 0x35b8
jmp 0x6ccc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6c85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x690(%rbp), %rdi
callq 0x7af0
leaq -0x660(%rbp), %rdi
callq 0x35b8
jmp 0x6ef7
leaq -0x3c8(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x7c90
jmp 0x6cab
jmp 0x6ccc
leaq 0x204af(%rip), %rdi     # 0x27163
leaq 0x20432(%rip), %rsi     # 0x270ed
movl $0x11f, %edx            # imm = 0x11F
leaq 0x204dc(%rip), %rcx     # 0x271a3
callq 0x31f0
leaq -0x290(%rbp), %rdi
callq 0x7cc0
movq %rax, -0x808(%rbp)
leaq -0x6a9(%rbp), %rdi
movq %rdi, -0x800(%rbp)
callq 0x7ce0
movq -0x808(%rbp), %rsi
movq -0x800(%rbp), %rdx
leaq -0x6a8(%rbp), %rdi
callq 0x7d00
jmp 0x6d0e
leaq -0x6a9(%rbp), %rdi
callq 0x7d70
leaq -0x290(%rbp), %rdi
movq %rdi, -0x820(%rbp)
callq 0x7e00
movq -0x820(%rbp), %rdi
movq %rax, -0x6c0(%rbp)
callq 0x7e30
movq %rax, -0x6c8(%rbp)
leaq -0x3c8(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x7e00
movq -0x818(%rbp), %rdi
movq %rax, -0x6d0(%rbp)
callq 0x7e30
movq %rax, -0x6d8(%rbp)
leaq -0x6a8(%rbp), %rdi
callq 0x7e60
movq %rax, -0x6e0(%rbp)
movq -0x6c0(%rbp), %rdi
movq -0x6c8(%rbp), %rsi
movq -0x6d0(%rbp), %rdx
movq -0x6d8(%rbp), %rcx
movq -0x6e0(%rbp), %r8
callq 0x7d90
movq %rax, -0x810(%rbp)
jmp 0x6db8
movq -0x810(%rbp), %rax
movq %rax, -0x6b8(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x7e90
leaq -0x6a8(%rbp), %rdi
callq 0x7e60
movq %rax, -0x6e8(%rbp)
leaq -0x6e8(%rbp), %rdi
leaq -0x6b8(%rbp), %rsi
callq 0x7eb0
testb $0x1, %al
jne 0x6e01
jmp 0x6e8a
leaq -0x6e8(%rbp), %rdi
callq 0x7ef0
movq %rax, %rsi
leaq -0x290(%rbp), %rdi
callq 0x7c40
movb %dl, -0x829(%rbp)
movq %rax, -0x828(%rbp)
jmp 0x6e2b
movb -0x829(%rbp), %al
movq -0x828(%rbp), %rcx
movq %rcx, -0x6f8(%rbp)
movb %al, -0x6f0(%rbp)
leaq -0x6e8(%rbp), %rdi
callq 0x7f10
jmp 0x6de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x6a9(%rbp), %rdi
callq 0x7d70
jmp 0x6ef7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x6a8(%rbp), %rdi
callq 0x7f30
jmp 0x6ef7
leaq -0x6a8(%rbp), %rdi
callq 0x7f30
leaq -0x3c8(%rbp), %rdi
callq 0x7be0
leaq -0x378(%rbp), %rdi
callq 0x35b8
leaq -0x358(%rbp), %rdi
callq 0x7af0
movl $0x0, -0x168(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x7f90
movl -0x168(%rbp), %eax
testl %eax, %eax
je 0x6ede
jmp 0x6edc
jmp 0x6ee0
jmp 0x6ee0
movq -0x2e8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2e8(%rbp)
jmp 0x65d4
leaq -0x3c8(%rbp), %rdi
callq 0x7be0
leaq -0x378(%rbp), %rdi
callq 0x35b8
leaq -0x358(%rbp), %rdi
callq 0x7af0
leaq -0x320(%rbp), %rdi
callq 0x7f90
jmp 0x7040
leaq -0x290(%rbp), %rax
movq %rax, -0x700(%rbp)
movq -0x700(%rbp), %rdi
callq 0x7e00
movq %rax, -0x708(%rbp)
movq -0x700(%rbp), %rdi
callq 0x7e30
movq %rax, -0x710(%rbp)
leaq -0x708(%rbp), %rdi
leaq -0x710(%rbp), %rsi
callq 0x7fd0
testb $0x1, %al
jne 0x6f7c
jmp 0x701a
leaq -0x708(%rbp), %rdi
callq 0x8000
movq %rax, %rcx
movq -0x750(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x718(%rbp)
addq $0x30, %rax
movq %rax, -0x838(%rbp)
leaq -0x738(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3130
jmp 0x6fbc
movq -0x838(%rbp), %rdi
movq -0x718(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x738(%rbp), %rsi
leaq -0xc0(%rbp), %r8
callq 0x23240
jmp 0x6fe3
leaq -0x738(%rbp), %rdi
callq 0x35b8
leaq -0x708(%rbp), %rdi
callq 0x8110
jmp 0x6f60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x738(%rbp), %rdi
callq 0x35b8
jmp 0x7040
movq -0x760(%rbp), %rdi
callq 0x24b60
jmp 0x7028
movl $0x1, -0x168(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x7be0
jmp 0x704e
leaq -0x290(%rbp), %rdi
callq 0x7be0
jmp 0x7068
leaq -0x100(%rbp), %rdi
callq 0x35b8
leaq -0xc0(%rbp), %rdi
callq 0x7920
jmp 0x7082
leaq -0x100(%rbp), %rdi
callq 0x35b8
leaq -0xc0(%rbp), %rdi
callq 0x7920
jmp 0x7092
movq -0x758(%rbp), %rax
addq $0x840, %rsp            # imm = 0x840
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)