// File: /workspace/github_cpp_makefile_star2_O1/JameyWoo[P]re2graph/algorithms.cpp
// Function: nfa2dfa(NFA, DFA&)
void nfa2dfa(NFA nfa, DFA &dfa) {
    /**
     * 思路: 
     * 先统一求出所有状态的闭包closure, 因为如果在线求解会导致总是重复计算. 
     * 可以以O(n)的代价求出所有状态的闭包.
     * 然后再进行复杂的子集构造算法
     */
    // ! 所有状态的闭包, 一次性算出, 避免重复计算
    vector<set<int>> closures = vector<set<int>>(nfa.state_cnt, set<int>());
    vector<bool> ext_start(nfa.state_cnt);
    for (int i = 0; i < nfa.state_cnt; ++i) {
        if (closures[i].size() == 0) {
            ext_start[i] = true;
            vector<bool> visted(nfa.state_cnt);
            visted[i] = true;
            get_closure(nfa, closures, i, visted);
            visted[i] = false;
        }
    }
    // * 如果闭包成环, 会出现一种闭包没有求完整的情况. 已用反向边遍历方法解决
    // 但有的状态的闭包一定是完整的. 就是环的开始部分, 所以还需要进行调整. 进行闭包的扩展, 进行边的反向扩展
    map<int, vector<int>> ext_closure_map;
    for (int i = 0; i < nfa.state_cnt; ++i) {
        for (auto m : nfa.jump[i]) {
            if (m.first == '~') {
                for (auto v : m.second) {
                    ext_closure_map[v].push_back(i);
                }
            }
        }
    }
    // cout << "ext_closure_map:" << endl;
    // for (auto m: ext_closure_map) {
    //     for (auto v: m.second) {
    //         cout << m.first << ' ' << v << endl;
    //     }
    // }
    for (int i = 0; i < nfa.state_cnt; ++i) {
        // if (ext_start[i]) { // 不需要判断, 如果环的入口不是起点这种情况会出错
            queue<int> inq;
            vector<int> visted(nfa.state_cnt);
            inq.push(i);
            visted[i] = true;
            while (not inq.empty()) {
                int now = inq.front();
                inq.pop();
                for (auto v : ext_closure_map[now]) {
                    if (visted[v] == false) {
                        closures[v].insert(closures[i].begin(), closures[i].end());
                        inq.push(v);
                        visted[v] = true;
                    }
                }
            // }
        }
    }

    // 查看闭包
    // cout << "closures: " << endl;
    // for (int i = 0; i < nfa.state_cnt; ++i) {
    //     cout << i << ": ";
    //     for (auto clo : closures[i]) {
    //         cout << clo << ' ';
    //     }
    //     cout << endl;
    // }

    // 进行接受状态的扩展, 因为后面可能会漏掉
    set<int> ext_end_states;
    for (auto x : nfa.end_states) {
        ext_end_states.insert(x);  // 先插入最基本的接受状态
    }
    int ic = 0;
    for (auto closure : closures) {
        ic++;
        for (auto x : closure) {
            if (ext_end_states.count(x)) {
                ext_end_states.insert(ic - 1);
                break;
            }
        }
    }
    // cout << "ext_end_states: ";
    // for (auto s : ext_end_states) {
    //     cout << s << ' ';
    // }
    // cout << endl;

    // ! 进行子集构造算法
    set<int> end_states;                                // dfa的终止状态
    if (ext_end_states.count(0)) end_states.insert(0);  // 因为先单独将起始状态0加入了工作列表, 所以对他的接收状态需要提前处理
    map<set<int>, int> set_hash;                        // 集合对整数的hash, 也就是对子集编码
    vector<map<char, int>> jump_dfa;                    // dfa的jump
    set<int> set_visted;                                // 保存一个set是否被访问过的信息
    int set_state                       = 0;            // 集合的整数状态
    set_hash[closures[nfa.start_state]] = set_state++;  // 初始状态编码为0
    // cout << "0: ";
    // for (auto s: closures[nfa.start_state]) {
    //     cout << s << ' ';
    // }
    // cout << endl;
    jump_dfa.push_back(map<char, int>());                     // 压入初始状态的map
    set_visted.insert(set_hash[closures[nfa.start_state]]);   // 标记访问过
                                                              // 初始化变量之后开始工作
    queue<set<int>> work_queue;                               // 队列
    work_queue.push(closures[nfa.start_state]);               // 将初始状态闭包集插入工作队列
    while (not work_queue.empty()) {                          // 当工作队列不为空
        set<int> now = work_queue.front();                    // 取出当前工作集合
        work_queue.pop();                                     // 弹出
        for (auto c : nfa.chars) {                            // 遍历每个字符
            if (c == '~') continue;                           // c 不能是~ 也就是ε, 它不可以接下一状态
            set<int> next_state_set;                          // 下一状态
            for (auto state : now) {                          // 遍历每个状态. 要获取当前集合所有状态对某字符的下一状态的闭包
                if (nfa.jump[state].count(c) != 0) {          // 当可以跳转的时候
                    for (auto v : nfa.jump[state][c]) {       // 一个状态对同一个字符可能有好几个下一状态
                        set<int> next_closure = closures[v];  // 求闭包
                        // 要获取所有可以走下去的状态的闭包, 都插入到集合中
                        next_state_set.insert(next_closure.begin(), next_closure.end());
                    }
                }
            }
            if (next_state_set.size() != 0) {                // 如果不是空, 说明是一个dfa状态
                if (set_hash.count(next_state_set) == 0) {   // 遇到新状态, 计次, 转化为dfa中的状态
                    set_hash[next_state_set] = set_state++;  // 新状态分配int型状态号
                    // cout << set_state - 1 << ": ";
                    // for (auto s: next_state_set) {
                    //     cout << s << ' ';
                    // }
                    // cout << endl;
                    for (auto s : next_state_set) {  // 查找当前集合是否存在nfa的接受状态, 如果存在, 那它也是dfa的终止状态
                        if (ext_end_states.count(s) != 0) {
                            end_states.insert(set_state - 1);  // 是终止状态
                            break;
                        }
                    }
                    jump_dfa.push_back(map<char, int>());  // 新状态的map, 用来存储dfa的转移函数
                }
                int set_hash_next_state    = set_hash[next_state_set];  // 一次得到hash值保存, 方便后面操作, 省的每次都查找set
                jump_dfa[set_hash[now]][c] = set_hash_next_state;       // 经过hash之后的dfa状态表示
                if (set_visted.count(set_hash_next_state) == 0) {       // 如果之前没访问过
                    set_visted.insert(set_hash_next_state);             // 插入set_visted中标记访问
                    work_queue.push(next_state_set);                    // 插入work_queu中, 由于set_visted的存在, 只会进一次work_queue
                }
            }
        }
    }

    // for (auto s: set_hash) {
    //     cout << s.second << ": ";
    //     for (auto v: s.first) {
    //         cout << ' ';
    //     }
    //     cout << endl;
    // }

    // 构造dfa, 按照DFA数据定义的顺序
    dfa.char_cnt      = nfa.char_cnt;
    dfa.state_cnt     = set_state;
    dfa.start_state   = 0;
    dfa.end_state_cnt = end_states.size();
    dfa.chars         = nfa.chars;
    for (int i = 0; i < dfa.state_cnt; ++i) {
        dfa.states.push_back(i);
    }
    for (auto s : end_states) {
        dfa.end_states.push_back(s);
    }
    dfa.jump_map = jump_dfa;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x4(%rdi), %rsi
leaq 0x28(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x8(%rax)
movaps %xmm0, 0x18(%rax)
movaps %xmm0, -0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq $0x0, 0x20(%rax)
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x238(%rsp), %rcx
callq 0xd682
movq %rbx, 0x118(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xe2fa
movslq 0x4(%r14), %rsi
movb $0x0, (%rbx)
leaq 0xf0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0x238(%rsp), %rcx
callq 0xf6d8
movq %r14, 0x10(%rsp)
movl 0x4(%r14), %eax
testl %eax, %eax
jle 0x63b1
movl $0x28, %r14d
xorl %r13d, %r13d
leaq 0x268(%rsp), %rbp
xorl %r12d, %r12d
movq 0xa8(%rsp), %rcx
cmpq $0x0, (%rcx,%r14)
jne 0x6398
movq 0xf0(%rsp), %rdx
movq %r12, %rbx
movl $0x1, %r15d
movl %r12d, %ecx
shlq %cl, %r15
shrq $0x6, %rbx
orq %r15, (%rdx,%rbx,8)
movslq %eax, %rsi
movb $0x0, 0x238(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x238(%rsp), %rdx
leaq 0x70(%rsp), %rcx
callq 0xf6d8
movq 0x20(%rsp), %rax
orq %r15, (%rax,%rbx,8)
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
callq 0x3a32
movq %rbp, %rdi
leaq 0xa8(%rsp), %rsi
movl %r12d, %edx
leaq 0x20(%rsp), %rcx
callq 0x717f
leaq 0x2c0(%rsp), %rdi
callq 0x412e
movq 0x2a8(%rsp), %rdi
testq %rdi, %rdi
je 0x6327
movq 0x2b8(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x290(%rsp), %rdi
testq %rdi, %rdi
je 0x6344
movq 0x2a0(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x278(%rsp), %rdi
testq %rdi, %rdi
je 0x6361
movq 0x288(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x20(%rsp), %rdi
notq %r15
andq %r15, (%rdi,%rbx,8)
testq %rdi, %rdi
je 0x6398
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq %r13, 0x20(%rsp)
movl %r13d, 0x28(%rsp)
movq %r13, 0x30(%rsp)
movl %r13d, 0x38(%rsp)
movq %r13, 0x40(%rsp)
incq %r12
movq 0x10(%rsp), %rax
movslq 0x4(%rax), %rax
addq $0x30, %r14
cmpq %rax, %r12
jl 0x627b
leaq 0x240(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movl %eax, 0x70(%rsp)
movq 0x10(%rsp), %rcx
cmpl %eax, 0x4(%rcx)
jle 0x64d0
leaq 0x238(%rsp), %r15
leaq 0xc0(%rsp), %r12
leaq 0x70(%rsp), %r13
cltq
movq 0x58(%rcx), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
movq 0x10(%rax), %rbp
movq %rax, 0xa0(%rsp)
cmpq %rax, %rbp
je 0x64b8
movb 0x20(%rbp), %al
movb %al, 0x20(%rsp)
leaq 0x28(%rbp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x3c86
cmpb $0x7e, 0x20(%rsp)
jne 0x6488
movq 0x28(%rsp), %rbx
movq 0x30(%rsp), %r14
cmpq %r14, %rbx
je 0x6488
movl (%rbx), %eax
movl %eax, 0xc0(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xd71c
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x6477
movl 0x70(%rsp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x6482
movq %rax, %rdi
movq %r13, %rdx
callq 0xef7e
addq $0x4, %rbx
jmp 0x6444
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x649f
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq %rbp, %rdi
callq 0x2160
movq %rax, %rbp
cmpq 0xa0(%rsp), %rax
jne 0x641e
movl 0x70(%rsp), %eax
incl %eax
movl %eax, 0x70(%rsp)
movq 0x10(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x63f4
movl $0x0, 0xc0(%rsp)
cmpl $0x0, 0x4(%rcx)
jle 0x66dc
leaq 0x20(%rsp), %rbx
leaq 0x208(%rsp), %r12
leaq 0x238(%rsp), %rbp
leaq 0x1d8(%rsp), %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0xfa1a
movq 0x10(%rsp), %rax
movslq 0x4(%rax), %rsi
leaq 0x70(%rsp), %rdi
movq %r12, %rdx
callq 0xd780
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x6565
movl 0xc0(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x50(%rsp)
jmp 0x6575
movq %rbx, %rdi
leaq 0xc0(%rsp), %rsi
callq 0xfb90
movslq 0xc0(%rsp), %rax
movq 0x70(%rsp), %rcx
movl $0x1, (%rcx,%rax,4)
movq 0x30(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x669c
movl (%rax), %ecx
movl %ecx, 0x208(%rsp)
movq 0x40(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x65b6
addq $0x4, %rax
jmp 0x65e8
movq 0x38(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x2200
movq 0x48(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x48(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x30(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0xd71c
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x6589
movslq (%r14), %rax
movl %eax, 0x1d8(%rsp)
movq 0x70(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0x6693
movq 0xa8(%rsp), %rcx
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq %rcx, %rdi
movslq 0xc0(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq (%rcx,%rax), %rdx
addq $0x8, %rdx
movq 0x10(%rdx), %rsi
callq 0xfda4
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x6674
movl 0x1d8(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x50(%rsp)
jmp 0x667f
movq %rbx, %rdi
movq %r13, %rsi
callq 0xfb90
movslq 0x1d8(%rsp), %rax
movq 0x70(%rsp), %rcx
movl $0x1, (%rcx,%rax,4)
addq $0x4, %r14
jmp 0x65ff
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x66b6
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq %rbx, %rdi
callq 0xe34a
movl 0xc0(%rsp), %eax
incl %eax
movl %eax, 0xc0(%rsp)
movq 0x10(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jl 0x6502
leaq 0x78(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x10(%rsp), %rax
movq 0x40(%rax), %r14
movq 0x48(%rax), %r12
cmpq %r12, %r14
je 0x6730
leaq 0x70(%rsp), %rbx
leaq 0x20(%rsp), %r15
movl (%r14), %eax
movl %eax, 0x20(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xffc0
addq $0x4, %r14
cmpq %r12, %r14
jne 0x6715
movq 0xa8(%rsp), %rbx
movq 0xb0(%rsp), %r14
cmpq %r14, %rbx
je 0x67fc
xorl %ebp, %ebp
leaq 0x20(%rsp), %r15
leaq 0xc0(%rsp), %r13
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe39a
movq 0x38(%rsp), %rax
leaq 0x28(%rsp), %rcx
cmpq %rcx, %rax
je 0x67e5
movq 0x80(%rsp), %r12
movl 0x20(%rax), %ecx
leaq 0x78(%rsp), %rdx
testq %r12, %r12
je 0x67a1
movq %r12, %rsi
xorl %edi, %edi
cmpl %ecx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x678a
leaq 0x78(%rsp), %rdi
movq %rdi, %rsi
cmpq %rdi, %rdx
je 0x67b8
cmpl 0x20(%rdx), %ecx
cmovlq %rdi, %rdx
movq %rdx, %rsi
cmpq %rdi, %rsi
jne 0x67d1
movq %rax, %rdi
callq 0x2250
leaq 0x28(%rsp), %rcx
cmpq %rcx, %rax
jne 0x677a
jmp 0x67e5
movl %ebp, 0xc0(%rsp)
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0xfff6
incl %ebp
movq %r15, %rdi
callq 0xe2fa
addq $0x30, %rbx
cmpq %r14, %rbx
jne 0x6758
leaq 0xc8(%rsp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x80(%rsp), %rcx
leaq 0x78(%rsp), %rsi
movq %rsi, %rax
testq %rcx, %rcx
je 0x684a
movq %rsi, %rax
movl 0x20(%rcx), %edx
testl %edx, %edx
cmovnsq %rcx, %rax
shrl $0x1f, %edx
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x6834
movq %rsi, %rcx
cmpq %rsi, %rax
movq 0x118(%rsp), %r12
je 0x6865
cmpl $0x0, 0x20(%rax)
cmovgq %rsi, %rax
movq %rax, %rcx
cmpq %rsi, %rcx
je 0x6882
leaq 0x20(%rsp), %rsi
movl $0x0, (%rsi)
leaq 0xc0(%rsp), %rdi
callq 0xfff6
leaq 0x210(%rsp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq %rax, 0x130(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x120(%rsp)
leaq 0x1e0(%rsp), %rcx
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x10(%rsp), %rax
movslq 0x8(%rax), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0xa8(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0xd80a
movl $0x0, (%rax)
leaq 0x20(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, (%rsi)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsi)
movq %rax, 0x20(%rsi)
movq $0x0, 0x28(%rsi)
leaq 0x120(%rsp), %rdi
callq 0x104ac
leaq 0x20(%rsp), %rdi
callq 0x448c
movq 0x10(%rsp), %rax
movslq 0x8(%rax), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0xa8(%rsp), %rsi
leaq 0x208(%rsp), %rdi
callq 0xd80a
leaq 0x1d8(%rsp), %rdi
movq %rax, %rsi
callq 0xffc0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x106b2
movq 0x10(%rsp), %rax
movslq 0x8(%rax), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0xa8(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x10850
movq 0x30(%rsp), %rsi
cmpq %rsi, 0x50(%rsp)
je 0x6d98
leaq 0x148(%rsp), %r15
movl $0x1, 0x1c(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x1a8(%rsp), %rbp
leaq 0x140(%rsp), %rbx
callq 0xe39a
leaq 0x20(%rsp), %rdi
callq 0x10ada
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movq %rax, 0xa0(%rsp)
cmpq %rax, %rcx
je 0x6d73
movb (%rcx), %al
movb %al, 0xf(%rsp)
cmpb $0x7e, %al
je 0x6d62
movq %rcx, 0x1a0(%rsp)
movl $0x0, 0x1b0(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x1b8(%rsp)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x1c0(%rsp)
movq %rax, 0x1c8(%rsp)
movq %rcx, 0x1d0(%rsp)
movq 0x188(%rsp), %r13
leaq 0x178(%rsp), %rax
cmpq %rax, %r13
je 0x6b5b
movslq 0x20(%r13), %rax
movq 0x10(%rsp), %rcx
movq 0x58(%rcx), %rdi
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq (%rdi,%rax), %rcx
addq $0x8, %rcx
movq 0x8(%rcx), %rsi
movq %rcx, %rdx
testq %rsi, %rsi
je 0x6ac4
movb 0xf(%rsp), %r8b
movq %rcx, %rdx
xorl %r9d, %r9d
cmpb %r8b, 0x20(%rsi)
setl %r9b
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%r9,8), %rsi
testq %rsi, %rsi
jne 0x6aab
movq %rcx, %rsi
cmpq %rcx, %rdx
je 0x6adc
movb 0xf(%rsp), %sil
cmpb 0x20(%rdx), %sil
cmovlq %rcx, %rdx
movq %rdx, %rsi
cmpq %rcx, %rsi
je 0x6b37
addq %rax, %rdi
leaq 0xf(%rsp), %rsi
callq 0xd4c0
movq (%rax), %r12
movq 0x8(%rax), %r14
cmpq %r14, %r12
je 0x6b37
movslq (%r12), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x4, %rsi
addq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0xe39a
movq 0x158(%rsp), %rsi
movq %rbp, %rdi
movq %r15, %rdx
callq 0xfda4
movq %rbx, %rdi
callq 0xe2fa
addq $0x4, %r12
jmp 0x6af5
movq %r13, %rdi
callq 0x2250
movq %rax, %r13
leaq 0x178(%rsp), %rax
cmpq %rax, %r13
movq 0x118(%rsp), %r12
jne 0x6a7a
cmpq $0x0, 0x1d0(%rsp)
je 0x6d52
leaq 0x208(%rsp), %rdi
movq %rbp, %rsi
callq 0x10b44
leaq 0x1e0(%rsp), %r13
leaq 0x210(%rsp), %rcx
cmpq %rcx, %rax
jne 0x6c96
leaq 0x208(%rsp), %rdi
movq %rbp, %rsi
callq 0xd80a
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x1c0(%rsp), %rax
leaq 0x1b0(%rsp), %rcx
cmpq %rcx, %rax
je 0x6c3b
movq 0x80(%rsp), %r13
movl 0x20(%rax), %ecx
leaq 0x78(%rsp), %rdx
testq %r13, %r13
je 0x6bed
movq %r13, %rsi
xorl %edi, %edi
cmpl %ecx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x6bd6
leaq 0x78(%rsp), %rdi
movq %rdi, %rsi
cmpq %rdi, %rdx
je 0x6c04
cmpl 0x20(%rdx), %ecx
cmovlq %rdi, %rdx
movq %rdx, %rsi
cmpq %rdi, %rsi
jne 0x6c20
movq %rax, %rdi
callq 0x2250
leaq 0x1b0(%rsp), %rcx
cmpq %rcx, %rax
jne 0x6bc6
jmp 0x6c3b
movl 0x1c(%rsp), %eax
movl %eax, 0x140(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq 0xfff6
xorps %xmm0, %xmm0
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x140(%rsp)
movq %r15, 0x158(%rsp)
movq %r15, 0x160(%rsp)
movq $0x0, 0x168(%rsp)
leaq 0x120(%rsp), %rdi
movq %rbx, %rsi
callq 0x104ac
incl 0x1c(%rsp)
movq %rbx, %rdi
callq 0x448c
leaq 0x1e0(%rsp), %r13
leaq 0x208(%rsp), %rdi
movq %rbp, %rsi
callq 0xd80a
movl (%rax), %r14d
movl %r14d, 0x140(%rsp)
leaq 0x208(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xd80a
movslq (%rax), %rax
leaq (%rax,%rax,2), %rdi
shlq $0x4, %rdi
addq 0x120(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0xd87a
movl %r14d, (%rax)
movq 0x1e8(%rsp), %rcx
movq %r13, %rax
testq %rcx, %rcx
je 0x6d17
movl 0x140(%rsp), %edx
movq %r13, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x6d00
movq %r13, %rcx
cmpq %r13, %rax
je 0x6d30
movl 0x140(%rsp), %ecx
cmpl 0x20(%rax), %ecx
cmovlq %r13, %rax
movq %rax, %rcx
cmpq %r13, %rcx
jne 0x6d52
leaq 0x1d8(%rsp), %rdi
movq %rbx, %rsi
callq 0xffc0
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x10850
movq %rbp, %rdi
callq 0xe2fa
movq 0x1a0(%rsp), %rcx
incq %rcx
cmpq 0xa0(%rsp), %rcx
jne 0x6a16
leaq 0x170(%rsp), %r14
movq %r14, %rdi
callq 0xe2fa
movq %r14, %rdi
movq 0x30(%rsp), %rsi
cmpq %rsi, 0x50(%rsp)
jne 0x69e9
jmp 0x6da0
movl $0x1, 0x1c(%rsp)
movq 0x10(%rsp), %rsi
movl (%rsi), %eax
movl %eax, (%r12)
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%r12)
movl $0x0, 0x8(%r12)
movl 0xe8(%rsp), %eax
movl %eax, 0xc(%r12)
addq $0x10, %rsi
leaq 0x10(%r12), %rdi
callq 0xd8de
movl $0x0, 0x170(%rsp)
cmpl $0x0, 0x4(%r12)
jle 0x6e34
leaq 0x28(%r12), %rbx
xorl %eax, %eax
leaq 0x170(%rsp), %r14
movq 0x30(%r12), %rsi
cmpq 0x38(%r12), %rsi
je 0x6e12
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%r12)
jmp 0x6e1d
movq %rbx, %rdi
movq %r14, %rdx
callq 0xef7e
movl 0x170(%rsp), %eax
incl %eax
movl %eax, 0x170(%rsp)
cmpl 0x4(%r12), %eax
jl 0x6df9
movq 0xd8(%rsp), %rbx
leaq 0xc8(%rsp), %rax
cmpq %rax, %rbx
je 0x6e9c
leaq 0x40(%r12), %r14
leaq 0x170(%rsp), %r15
movl 0x20(%rbx), %eax
movl %eax, 0x170(%rsp)
movq 0x48(%r12), %rsi
cmpq 0x50(%r12), %rsi
je 0x6e79
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%r12)
jmp 0x6e84
movq %r14, %rdi
movq %r15, %rdx
callq 0xef7e
movq %rbx, %rdi
callq 0x2250
movq %rax, %rbx
leaq 0xc8(%rsp), %rax
cmpq %rax, %rbx
jne 0x6e56
addq $0x58, %r12
leaq 0x120(%rsp), %rsi
movq %r12, %rdi
callq 0xd994
leaq 0x20(%rsp), %rdi
callq 0xe532
leaq 0x1d8(%rsp), %rdi
callq 0xe2fa
leaq 0x120(%rsp), %rdi
callq 0x44a0
leaq 0x208(%rsp), %rdi
callq 0xe66c
leaq 0xc0(%rsp), %rdi
callq 0xe2fa
leaq 0x70(%rsp), %rdi
callq 0xe2fa
leaq 0x238(%rsp), %rdi
callq 0xe6c4
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x6f4a
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
xorl %eax, %eax
movq %rax, 0xf0(%rsp)
movl %eax, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
movl %eax, 0x108(%rsp)
movq %rax, 0x110(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xdaf2
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7101
jmp 0x6fa1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x448c
jmp 0x70da
movq %rax, %rbx
jmp 0x716a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xe2fa
jmp 0x7177
jmp 0x701a
movq %rax, %rbx
jmp 0x70da
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x7109
jmp 0x701a
jmp 0x701a
jmp 0x7055
movq %rax, %rbx
jmp 0x6fdc
movq %rax, %rbx
jmp 0x7125
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x3ae6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7125
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %eax, 0x38(%rsp)
movq %rax, 0x40(%rsp)
jmp 0x7125
jmp 0x70a1
movq %rax, %rbx
jmp 0x70d0
jmp 0x7049
movq %rax, %rbx
jmp 0x7072
jmp 0x702b
movq %rax, %rbx
jmp 0x710e
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x448c
jmp 0x70b6
jmp 0x70a1
jmp 0x7055
movq %rax, %rbx
jmp 0x7118
jmp 0x70a1
jmp 0x70a1
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x7072
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0x20(%rsp), %rdi
callq 0xe34a
jmp 0x7118
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x7118
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
jmp 0x7118
movq %rax, %rbx
jmp 0x70b6
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xe2fa
leaq 0x1a8(%rsp), %rdi
callq 0xe2fa
leaq 0x170(%rsp), %rdi
callq 0xe2fa
leaq 0x20(%rsp), %rdi
callq 0xe532
leaq 0x1d8(%rsp), %rdi
callq 0xe2fa
leaq 0x120(%rsp), %rdi
callq 0x44a0
leaq 0x208(%rsp), %rdi
callq 0xe66c
leaq 0xc0(%rsp), %rdi
callq 0xe2fa
leaq 0x70(%rsp), %rdi
callq 0xe2fa
leaq 0x238(%rsp), %rdi
callq 0xe6c4
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x716a
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
xorl %eax, %eax
movq %rax, 0xf0(%rsp)
movl %eax, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
movl %eax, 0x108(%rsp)
movq %rax, 0x110(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xdaf2
movq %rbx, %rdi
callq 0x2350