// File: JameyWoo[P]re2graph/algorithms.cpp
// Function: parse_re(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&)
Graph parse_re(string rexp, int &state) {
    // cout << "exp = " << rexp << endl;
    if (rexp.size() == 1) {  // ! 当只有一个字符时, 构造基本的转移函数, 然后返回. 这是这个函数的递归基例
        Graph base;
        base.start = state++;
        base.end   = state++;
        Edge edge(base.start, rexp[0], base.end);
        base.edges.push_back(edge);
        return base;
    }
    vector<Graph> graphes;  // 这个rexp可以解析出来的所有graph, 用vector存储, 方便合并

    // 一种特殊情况 (ac)*|b, 要和 (ac | b*)) 这种区分开来.
    // ! 也就是说如果存在不在括号中的 | , 但括号再rexp中存在的情况, 要先处理 |
    bool has_bra = count(rexp.begin(), rexp.end(), '(');  // 是否有括号
    bool or_out  = false;                                 // | 是否在括号外面
    int or_loc   = 0;
    if (has_bra) {
        stack<char> in_or_out;
        int i = 0;
        for (auto s : rexp) {
            i++;
            if (s == '(') {
                in_or_out.push('*');
            } else if (s == ')') {
                in_or_out.pop();
            }
            if (s == '|' && in_or_out.size() == 0) {
                or_out = true;
                or_loc = i - 1;
            }
        }
    }

    if (has_bra && or_out == false) {  // 存在括号, 且如果出现 | , 都在括号之中
        // 检测到有括号, 解析括号
        stack<char> bra;  // 括号, 用来处理括号嵌套的情况
        string sub_rexp;
        for (int i = 0; i < rexp.size(); ++i) {
            char c = rexp[i];
            if (c == '(') {
                if (sub_rexp.size() && bra.size() == 0) {
                    graphes.push_back(parse_re(sub_rexp, state));
                    sub_rexp.clear();
                }
                bra.push('*');
                if (bra.size() != 1) sub_rexp.push_back('(');
            } else if (c == ')') {
                // cout << "2 - " << sub_rexp << endl;
                bra.pop();
                if (bra.size() != 0) sub_rexp.push_back(')');
                if (bra.size() == 0) {  // 最外层括号被弹出, 将括号包裹的部分进行解析
                    // cout << "bar = 0: " << sub_rexp << endl;
                    // 增加对括号闭包的操作
                    if (i + 1 < rexp.size() && (rexp[i + 1] == '*' || rexp[i + 1] == '+')) {  // * 对 * 和 + 的解析
                        if (rexp[i + 1] == '+')
                            graphes.push_back(parse_re(sub_rexp, state));
                        int start = state++;
                        graphes.push_back(parse_re(sub_rexp, state));
                        int end = state++;
                        graphes.back().edges.push_back(Edge(start, '~', graphes.back().start));
                        graphes.back().edges.push_back(Edge(graphes.back().end, '~', graphes.back().start));
                        graphes.back().edges.push_back(Edge(graphes.back().end, '~', end));
                        graphes.back().edges.push_back(Edge(start, '~', end));
                        graphes.back().start = start;
                        graphes.back().end   = end;
                        i++;
                    } else {
                        graphes.push_back(parse_re(sub_rexp, state));
                    }
                    sub_rexp.clear();
                }

                // cout << "1 - " << sub_rexp << endl;
            } else {
                sub_rexp += c;
            }
        }
        // cout << "sub_rexp = " << sub_rexp << endl;
        if (sub_rexp.size()) {
            graphes.push_back(parse_re(sub_rexp, state));
            sub_rexp.clear();
        }
    } else if (count(rexp.begin(), rexp.end(), '|')) {  // ! 解析或, 没有括号的存在
        string sub_rexp;
        Graph merge;
        merge.start = state++;  // 先编号开始, 顺序好看些
        int i       = 0;
        for (auto s : rexp) {
            i++;
            if (s == '|') {
                if (or_out && or_loc != (i - 1)) {
                    sub_rexp += s;
                    continue;
                }
                if (sub_rexp.size()) {
                    graphes.push_back(parse_re(sub_rexp, state));
                    sub_rexp.clear();
                }
            } else {
                sub_rexp += s;
            }
        }
        if (sub_rexp.size()) {
            graphes.push_back(parse_re(sub_rexp, state));
            sub_rexp.clear();
        }
        merge.end = state++;
        for (auto graph : graphes) {
            merge.edges.push_back(Edge(merge.start, '~', graph.start));
            merge.edges.insert(merge.edges.end(), graph.edges.begin(), graph.edges.end());
            merge.edges.push_back(Edge(graph.end, '~', merge.end));
        }
        return merge;  // ! 处理或的直接返回, 因为和处理简单的并或者括号不一样
    } else {           // 处理普通的没有 | , 也没有括号的情况
        // cout << "rexp = " << rexp << endl;
        for (int i = 0; i < rexp.size(); ++i) {
            string next_rexp;
            next_rexp += rexp[i];
            if (i + 1 < rexp.size() && (rexp[i + 1] == '*' || rexp[i + 1] == '+')) {  // * 对 * 和 + 的解析
                if (rexp[i + 1] == '+')
                    graphes.push_back(parse_re(next_rexp, state));
                int start = state++;
                graphes.push_back(parse_re(next_rexp, state));
                int end = state++;
                graphes.back().edges.push_back(Edge(start, '~', graphes.back().start));
                graphes.back().edges.push_back(Edge(graphes.back().end, '~', graphes.back().start));
                graphes.back().edges.push_back(Edge(graphes.back().end, '~', end));
                graphes.back().edges.push_back(Edge(start, '~', end));
                graphes.back().start = start;
                graphes.back().end   = end;
                i++;
            } else {
                graphes.push_back(parse_re(next_rexp, state));
            }
            next_rexp.clear();
        }
    }

    // 解析多原子单位的合并
    Graph merge;
    merge.start = graphes[0].start;
    merge.end   = graphes.back().end;
    merge.edges = graphes[0].edges;
    for (int i = 1; i < graphes.size(); ++i) {
        merge.edges.push_back(Edge(graphes[i - 1].end, '~', graphes[i].start));
        merge.edges.insert(merge.edges.end(), graphes[i].edges.begin(), graphes[i].edges.end());
    }
    // for (auto edge: merge.edges) {
    //     cout << edge.from << ' ' << edge.cond << ' ' << edge.to << endl;
    // }
    return merge;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x780, %rsp            # imm = 0x780
movq %rsi, -0x5c8(%rbp)
movq %rdi, %rax
movq -0x5c8(%rbp), %rdi
movq %rax, -0x5c0(%rbp)
movq %rax, %rcx
movq %rcx, -0x5b8(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
callq 0x3210
cmpq $0x1, %rax
jne 0x9642
movq -0x5c0(%rbp), %rdi
movb $0x0, -0x19(%rbp)
callq 0x14ab0
movq -0x5c0(%rbp), %rax
movq -0x5c8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movl %ecx, (%rax)
movq -0x18(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
incl %esi
movl %esi, (%rdx)
movl %ecx, 0x4(%rax)
movl (%rax), %eax
movl %eax, -0x5d4(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x3550
movq %rax, -0x5d0(%rbp)
jmp 0x95cd
movl -0x5d4(%rbp), %esi
movq -0x5c0(%rbp), %rax
movq -0x5d0(%rbp), %rcx
movsbl (%rcx), %edx
movl 0x4(%rax), %ecx
leaq -0x28(%rbp), %rdi
callq 0x14ad0
jmp 0x95f2
movq -0x5c0(%rbp), %rdi
addq $0x8, %rdi
leaq -0x28(%rbp), %rsi
callq 0x14b00
jmp 0x9608
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x963d
jmp 0x9631
movq -0x5c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x12580
jmp 0xac9b
movq -0x5c0(%rbp), %rdi
callq 0x12580
jmp 0xac8b
leaq -0x50(%rbp), %rdi
callq 0x14b70
movq -0x5c8(%rbp), %rdi
callq 0x3290
movq -0x5c8(%rbp), %rdi
movq %rax, -0x60(%rbp)
callq 0x3180
movq %rax, -0x68(%rbp)
movb $0x28, -0x69(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x69(%rbp), %rdx
callq 0x4a50
movq %rax, -0x5e0(%rbp)
jmp 0x9689
movq -0x5e0(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x51(%rbp)
movb $0x0, -0x6a(%rbp)
movl $0x0, -0x70(%rbp)
testb $0x1, -0x51(%rbp)
je 0x980f
leaq -0xc0(%rbp), %rdi
callq 0x14b90
jmp 0x96bf
movq -0x5c8(%rbp), %rax
movl $0x0, -0xc4(%rbp)
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x3290
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x3180
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x8b00
testb $0x1, %al
jne 0x9719
jmp 0x9803
leaq -0xd8(%rbp), %rdi
callq 0x8bb0
movb (%rax), %al
movb %al, -0xe1(%rbp)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
movsbl -0xe1(%rbp), %eax
cmpl $0x28, %eax
jne 0x9794
movb $0x2a, -0xe2(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xe2(%rbp), %rsi
callq 0x14bc0
jmp 0x9764
jmp 0x97b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xac80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x14c30
jmp 0xac80
movsbl -0xe1(%rbp), %eax
cmpl $0x29, %eax
jne 0x97b0
leaq -0xc0(%rbp), %rdi
callq 0x14bf0
jmp 0x97ae
jmp 0x97b0
jmp 0x97b2
movsbl -0xe1(%rbp), %eax
cmpl $0x7c, %eax
jne 0x97f0
leaq -0xc0(%rbp), %rdi
callq 0x14c10
movq %rax, -0x5e8(%rbp)
jmp 0x97d3
movq -0x5e8(%rbp), %rax
cmpq $0x0, %rax
jne 0x97f0
movb $0x1, -0x6a(%rbp)
movl -0xc4(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x97f2
leaq -0xd8(%rbp), %rdi
callq 0x8b80
jmp 0x96fd
leaq -0xc0(%rbp), %rdi
callq 0x14c30
testb $0x1, -0x51(%rbp)
je 0x9ff3
movb -0x6a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x9ff3
leaq -0x138(%rbp), %rdi
callq 0x14b90
jmp 0x9838
leaq -0x158(%rbp), %rdi
callq 0x3410
movl $0x0, -0x15c(%rbp)
movq -0x5c8(%rbp), %rdi
movslq -0x15c(%rbp), %rax
movq %rax, -0x5f0(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x5f0(%rbp), %rax
cmpq %rcx, %rax
jae 0x9f09
movq -0x5c8(%rbp), %rdi
movslq -0x15c(%rbp), %rsi
callq 0x3550
movq %rax, -0x5f8(%rbp)
jmp 0x9897
movq -0x5f8(%rbp), %rax
movb (%rax), %al
movb %al, -0x15d(%rbp)
movsbl -0x15d(%rbp), %eax
cmpl $0x28, %eax
jne 0x99f8
leaq -0x158(%rbp), %rdi
callq 0x3210
cmpq $0x0, %rax
je 0x99a0
leaq -0x138(%rbp), %rdi
callq 0x14c10
movq %rax, -0x600(%rbp)
jmp 0x98e1
movq -0x600(%rbp), %rax
cmpq $0x0, %rax
jne 0x99a0
leaq -0x1a0(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3120
jmp 0x9907
movq -0x18(%rbp), %rdx
leaq -0x180(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x9530
jmp 0x9920
leaq -0x50(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x14c50
jmp 0x9932
leaq -0x180(%rbp), %rdi
callq 0x12580
leaq -0x1a0(%rbp), %rdi
callq 0x31c0
leaq -0x158(%rbp), %rdi
callq 0x33f0
jmp 0x99a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9fd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x998f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x12580
leaq -0x1a0(%rbp), %rdi
callq 0x31c0
jmp 0x9fd6
movb $0x2a, -0x1a1(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x1a1(%rbp), %rsi
callq 0x14bc0
jmp 0x99bc
leaq -0x138(%rbp), %rdi
callq 0x14c10
movq %rax, -0x608(%rbp)
jmp 0x99d1
movq -0x608(%rbp), %rax
cmpq $0x1, %rax
je 0x99f3
leaq -0x158(%rbp), %rdi
movl $0x28, %esi
callq 0x3280
jmp 0x99f1
jmp 0x99f3
jmp 0x9ef3
movsbl -0x15d(%rbp), %eax
cmpl $0x29, %eax
jne 0x9eda
leaq -0x138(%rbp), %rdi
callq 0x14bf0
jmp 0x9a16
leaq -0x138(%rbp), %rdi
callq 0x14c10
movq %rax, -0x610(%rbp)
jmp 0x9a2b
movq -0x610(%rbp), %rax
cmpq $0x0, %rax
je 0x9a4d
leaq -0x158(%rbp), %rdi
movl $0x29, %esi
callq 0x3280
jmp 0x9a4b
jmp 0x9a4d
leaq -0x138(%rbp), %rdi
callq 0x14c10
movq %rax, -0x618(%rbp)
jmp 0x9a62
movq -0x618(%rbp), %rax
cmpq $0x0, %rax
jne 0x9ed8
movq -0x5c8(%rbp), %rdi
movl -0x15c(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0x620(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x620(%rbp), %rax
cmpq %rcx, %rax
jae 0x9e3b
movq -0x5c8(%rbp), %rdi
movl -0x15c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x628(%rbp)
jmp 0x9ac4
movq -0x628(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0x9b06
movq -0x5c8(%rbp), %rdi
movl -0x15c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x630(%rbp)
jmp 0x9af3
movq -0x630(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x9e3b
movq -0x5c8(%rbp), %rdi
movl -0x15c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x638(%rbp)
jmp 0x9b26
movq -0x638(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x9bca
leaq -0x1e8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3120
jmp 0x9b4e
movq -0x18(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x9530
jmp 0x9b67
leaq -0x50(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x14c50
jmp 0x9b79
leaq -0x1c8(%rbp), %rdi
callq 0x12580
leaq -0x1e8(%rbp), %rdi
callq 0x31c0
jmp 0x9bca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9bb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x12580
leaq -0x1e8(%rbp), %rdi
callq 0x31c0
jmp 0x9fd6
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
incl %edx
movl %edx, (%rcx)
movl %eax, -0x1ec(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3120
jmp 0x9bf1
movq -0x18(%rbp), %rdx
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x9530
jmp 0x9c0a
leaq -0x50(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x14c50
jmp 0x9c1c
leaq -0x210(%rbp), %rdi
callq 0x12580
leaq -0x230(%rbp), %rdi
callq 0x31c0
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
incl %edx
movl %edx, (%rcx)
movl %eax, -0x234(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x650(%rbp)
callq 0x14c80
movq -0x650(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x648(%rbp)
movl -0x1ec(%rbp), %eax
movl %eax, -0x63c(%rbp)
callq 0x14c80
movl -0x63c(%rbp), %esi
movl (%rax), %ecx
leaq -0x240(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0x9c94
movq -0x648(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x14cc0
jmp 0x9ca9
leaq -0x50(%rbp), %rdi
movq %rdi, -0x660(%rbp)
callq 0x14c80
movq -0x660(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x668(%rbp)
callq 0x14c80
movq -0x660(%rbp), %rdi
movl 0x4(%rax), %eax
movl %eax, -0x654(%rbp)
callq 0x14c80
movl -0x654(%rbp), %esi
movl (%rax), %ecx
leaq -0x24c(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0x9d00
movq -0x668(%rbp), %rdi
leaq -0x24c(%rbp), %rsi
callq 0x14cc0
jmp 0x9d15
leaq -0x50(%rbp), %rdi
movq %rdi, -0x678(%rbp)
callq 0x14c80
movq -0x678(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x670(%rbp)
callq 0x14c80
movl 0x4(%rax), %esi
movl -0x234(%rbp), %ecx
leaq -0x258(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0x9d58
movq -0x670(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x14cc0
jmp 0x9d6d
leaq -0x50(%rbp), %rdi
callq 0x14c80
addq $0x8, %rax
movq %rax, -0x680(%rbp)
movl -0x1ec(%rbp), %esi
movl -0x234(%rbp), %ecx
leaq -0x264(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0x9da0
movq -0x680(%rbp), %rdi
leaq -0x264(%rbp), %rsi
callq 0x14cc0
jmp 0x9db5
movl -0x1ec(%rbp), %eax
movl %eax, -0x688(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x14c80
movl -0x688(%rbp), %ecx
movl %ecx, (%rax)
movl -0x234(%rbp), %eax
movl %eax, -0x684(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x14c80
movl -0x684(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x9ecc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9e2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x12580
leaq -0x230(%rbp), %rdi
callq 0x31c0
jmp 0x9fd6
leaq -0x2a8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3120
jmp 0x9e50
movq -0x18(%rbp), %rdx
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x9530
jmp 0x9e69
leaq -0x50(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x14c50
jmp 0x9e7b
leaq -0x288(%rbp), %rdi
callq 0x12580
leaq -0x2a8(%rbp), %rdi
callq 0x31c0
jmp 0x9ecc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9ebb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x12580
leaq -0x2a8(%rbp), %rdi
callq 0x31c0
jmp 0x9fd6
leaq -0x158(%rbp), %rdi
callq 0x33f0
jmp 0x9ef1
movsbl -0x15d(%rbp), %esi
leaq -0x158(%rbp), %rdi
callq 0x31d0
jmp 0x9eef
jmp 0x9ef1
jmp 0x9ef3
jmp 0x9ef5
movl -0x15c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x15c(%rbp)
jmp 0x984e
leaq -0x158(%rbp), %rdi
callq 0x3210
cmpq $0x0, %rax
je 0x9fb9
leaq -0x2e8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x3120
jmp 0x9f34
movq -0x18(%rbp), %rdx
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x9530
jmp 0x9f4d
leaq -0x50(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x14c50
jmp 0x9f5f
leaq -0x2c8(%rbp), %rdi
callq 0x12580
leaq -0x2e8(%rbp), %rdi
callq 0x31c0
leaq -0x158(%rbp), %rdi
callq 0x33f0
jmp 0x9fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9fab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x12580
leaq -0x2e8(%rbp), %rdi
callq 0x31c0
jmp 0x9fd6
leaq -0x158(%rbp), %rdi
callq 0x31c0
leaq -0x138(%rbp), %rdi
callq 0x14c30
jmp 0xaa35
leaq -0x158(%rbp), %rdi
callq 0x31c0
leaq -0x138(%rbp), %rdi
callq 0x14c30
jmp 0xac80
movq -0x5c8(%rbp), %rdi
callq 0x3290
movq -0x5c8(%rbp), %rdi
movq %rax, -0x2f0(%rbp)
callq 0x3180
movq %rax, -0x2f8(%rbp)
movb $0x7c, -0x2f9(%rbp)
movq -0x2f0(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
leaq -0x2f9(%rbp), %rdx
callq 0x4a50
movq %rax, -0x690(%rbp)
jmp 0xa043
movq -0x690(%rbp), %rax
cmpq $0x0, %rax
je 0xa516
leaq -0x320(%rbp), %rdi
callq 0x3410
movq -0x5c0(%rbp), %rdi
movb $0x0, -0x321(%rbp)
callq 0x14ab0
movq -0x5c0(%rbp), %rcx
movq -0x5c8(%rbp), %rax
movq -0x18(%rbp), %rsi
movl (%rsi), %edx
movl %edx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movl %edx, (%rcx)
movl $0x0, -0x328(%rbp)
movq %rax, -0x330(%rbp)
movq -0x330(%rbp), %rdi
callq 0x3290
movq %rax, -0x338(%rbp)
movq -0x330(%rbp), %rdi
callq 0x3180
movq %rax, -0x340(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x8b00
testb $0x1, %al
jne 0xa0e3
jmp 0xa236
leaq -0x338(%rbp), %rdi
callq 0x8bb0
movb (%rax), %al
movb %al, -0x341(%rbp)
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
movsbl -0x341(%rbp), %eax
cmpl $0x7c, %eax
jne 0xa20c
testb $0x1, -0x6a(%rbp)
je 0xa157
movl -0x70(%rbp), %eax
movl -0x328(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0xa157
movsbl -0x341(%rbp), %esi
leaq -0x320(%rbp), %rdi
callq 0x31d0
jmp 0xa141
jmp 0xa225
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa4f9
leaq -0x320(%rbp), %rdi
callq 0x3210
cmpq $0x0, %rax
je 0xa20a
leaq -0x388(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x3120
jmp 0xa182
movq -0x18(%rbp), %rdx
leaq -0x368(%rbp), %rdi
leaq -0x388(%rbp), %rsi
callq 0x9530
jmp 0xa19b
leaq -0x50(%rbp), %rdi
leaq -0x368(%rbp), %rsi
callq 0x14c50
jmp 0xa1ad
leaq -0x368(%rbp), %rdi
callq 0x12580
leaq -0x388(%rbp), %rdi
callq 0x31c0
leaq -0x320(%rbp), %rdi
callq 0x33f0
jmp 0xa20a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa1f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x12580
leaq -0x388(%rbp), %rdi
callq 0x31c0
jmp 0xa4f9
jmp 0xa223
movsbl -0x341(%rbp), %esi
leaq -0x320(%rbp), %rdi
callq 0x31d0
jmp 0xa221
jmp 0xa223
jmp 0xa225
leaq -0x338(%rbp), %rdi
callq 0x8b80
jmp 0xa0c7
leaq -0x320(%rbp), %rdi
callq 0x3210
cmpq $0x0, %rax
je 0xa2e9
leaq -0x3c8(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x3120
jmp 0xa261
movq -0x18(%rbp), %rdx
leaq -0x3a8(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
callq 0x9530
jmp 0xa27a
leaq -0x50(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x14c50
jmp 0xa28c
leaq -0x3a8(%rbp), %rdi
callq 0x12580
leaq -0x3c8(%rbp), %rdi
callq 0x31c0
leaq -0x320(%rbp), %rdi
callq 0x33f0
jmp 0xa2e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa2d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x12580
leaq -0x3c8(%rbp), %rdi
callq 0x31c0
jmp 0xa4f9
movq -0x5c0(%rbp), %rax
movq -0x18(%rbp), %rdx
movl (%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, (%rdx)
movl %ecx, 0x4(%rax)
leaq -0x50(%rbp), %rax
movq %rax, -0x3d0(%rbp)
movq -0x3d0(%rbp), %rdi
callq 0x14cf0
movq %rax, -0x3d8(%rbp)
movq -0x3d0(%rbp), %rdi
callq 0x14d20
movq %rax, -0x3e0(%rbp)
leaq -0x3d8(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x14d50
testb $0x1, %al
jne 0xa34d
jmp 0xa4c2
leaq -0x3d8(%rbp), %rdi
callq 0x14d90
movq %rax, %rsi
leaq -0x400(%rbp), %rdi
callq 0x14db0
jmp 0xa36a
movq -0x5c0(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x698(%rbp)
movl (%rax), %esi
movl -0x400(%rbp), %ecx
leaq -0x40c(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa39a
movq -0x698(%rbp), %rdi
leaq -0x40c(%rbp), %rsi
callq 0x14cc0
jmp 0xa3af
movq -0x5c0(%rbp), %rdi
addq $0x8, %rdi
movq %rdi, -0x6a8(%rbp)
callq 0x12160
movq %rax, -0x420(%rbp)
leaq -0x418(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x14ea0
leaq -0x3f8(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
callq 0x12130
movq -0x6b0(%rbp), %rdi
movq %rax, -0x428(%rbp)
callq 0x12160
movq -0x6a8(%rbp), %rdi
movq %rax, -0x430(%rbp)
movq -0x418(%rbp), %rsi
movq -0x428(%rbp), %rdx
movq -0x430(%rbp), %rcx
callq 0x14df0
movq %rax, -0x6a0(%rbp)
jmp 0xa437
movq -0x5c0(%rbp), %rax
movq -0x6a0(%rbp), %rcx
movq %rcx, -0x438(%rbp)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x6b8(%rbp)
movl -0x3fc(%rbp), %esi
movl 0x4(%rax), %ecx
leaq -0x444(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa476
movq -0x6b8(%rbp), %rdi
leaq -0x444(%rbp), %rsi
callq 0x14cc0
jmp 0xa48b
leaq -0x400(%rbp), %rdi
callq 0x12580
leaq -0x3d8(%rbp), %rdi
callq 0x14ee0
jmp 0xa331
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x12580
jmp 0xa4f9
movb $0x1, -0x321(%rbp)
movl $0x1, -0x448(%rbp)
testb $0x1, -0x321(%rbp)
jne 0xa4e8
movq -0x5c0(%rbp), %rdi
callq 0x12580
leaq -0x320(%rbp), %rdi
callq 0x31c0
jmp 0xac75
movq -0x5c0(%rbp), %rdi
callq 0x12580
leaq -0x320(%rbp), %rdi
callq 0x31c0
jmp 0xac80
movl $0x0, -0x44c(%rbp)
movq -0x5c8(%rbp), %rdi
movslq -0x44c(%rbp), %rax
movq %rax, -0x6c0(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x6c0(%rbp), %rax
cmpq %rcx, %rax
jae 0xaa31
leaq -0x470(%rbp), %rdi
callq 0x3410
movq -0x5c8(%rbp), %rdi
movslq -0x44c(%rbp), %rsi
callq 0x3550
movq %rax, -0x6c8(%rbp)
jmp 0xa575
movq -0x6c8(%rbp), %rax
movsbl (%rax), %esi
leaq -0x470(%rbp), %rdi
callq 0x31d0
jmp 0xa58d
movq -0x5c8(%rbp), %rdi
movl -0x44c(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0x6d0(%rbp)
callq 0x3210
movq %rax, %rcx
movq -0x6d0(%rbp), %rax
cmpq %rcx, %rax
jae 0xa966
movq -0x5c8(%rbp), %rdi
movl -0x44c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x6d8(%rbp)
jmp 0xa5de
movq -0x6d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
je 0xa620
movq -0x5c8(%rbp), %rdi
movl -0x44c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x6e0(%rbp)
jmp 0xa60d
movq -0x6e0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0xa966
movq -0x5c8(%rbp), %rdi
movl -0x44c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x3550
movq %rax, -0x6e8(%rbp)
jmp 0xa640
movq -0x6e8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0xa6f5
leaq -0x4b0(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x3120
jmp 0xa668
movq -0x18(%rbp), %rdx
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x9530
jmp 0xa681
leaq -0x50(%rbp), %rdi
leaq -0x490(%rbp), %rsi
callq 0x14c50
jmp 0xa693
leaq -0x490(%rbp), %rdi
callq 0x12580
leaq -0x4b0(%rbp), %rdi
callq 0x31c0
jmp 0xa6f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xaa20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa6e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x12580
leaq -0x4b0(%rbp), %rdi
callq 0x31c0
jmp 0xaa20
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
incl %edx
movl %edx, (%rcx)
movl %eax, -0x4b4(%rbp)
leaq -0x4f8(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x3120
jmp 0xa71c
movq -0x18(%rbp), %rdx
leaq -0x4d8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x9530
jmp 0xa735
leaq -0x50(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x14c50
jmp 0xa747
leaq -0x4d8(%rbp), %rdi
callq 0x12580
leaq -0x4f8(%rbp), %rdi
callq 0x31c0
movq -0x18(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
incl %edx
movl %edx, (%rcx)
movl %eax, -0x4fc(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x700(%rbp)
callq 0x14c80
movq -0x700(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x6f8(%rbp)
movl -0x4b4(%rbp), %eax
movl %eax, -0x6ec(%rbp)
callq 0x14c80
movl -0x6ec(%rbp), %esi
movl (%rax), %ecx
leaq -0x508(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa7bf
movq -0x6f8(%rbp), %rdi
leaq -0x508(%rbp), %rsi
callq 0x14cc0
jmp 0xa7d4
leaq -0x50(%rbp), %rdi
movq %rdi, -0x710(%rbp)
callq 0x14c80
movq -0x710(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x718(%rbp)
callq 0x14c80
movq -0x710(%rbp), %rdi
movl 0x4(%rax), %eax
movl %eax, -0x704(%rbp)
callq 0x14c80
movl -0x704(%rbp), %esi
movl (%rax), %ecx
leaq -0x514(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa82b
movq -0x718(%rbp), %rdi
leaq -0x514(%rbp), %rsi
callq 0x14cc0
jmp 0xa840
leaq -0x50(%rbp), %rdi
movq %rdi, -0x728(%rbp)
callq 0x14c80
movq -0x728(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x720(%rbp)
callq 0x14c80
movl 0x4(%rax), %esi
movl -0x4fc(%rbp), %ecx
leaq -0x520(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa883
movq -0x720(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x14cc0
jmp 0xa898
leaq -0x50(%rbp), %rdi
callq 0x14c80
addq $0x8, %rax
movq %rax, -0x730(%rbp)
movl -0x4b4(%rbp), %esi
movl -0x4fc(%rbp), %ecx
leaq -0x52c(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xa8cb
movq -0x730(%rbp), %rdi
leaq -0x52c(%rbp), %rsi
callq 0x14cc0
jmp 0xa8e0
movl -0x4b4(%rbp), %eax
movl %eax, -0x738(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x14c80
movl -0x738(%rbp), %ecx
movl %ecx, (%rax)
movl -0x4fc(%rbp), %eax
movl %eax, -0x734(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x14c80
movl -0x734(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl -0x44c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44c(%rbp)
jmp 0xa9f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa955
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0x12580
leaq -0x4f8(%rbp), %rdi
callq 0x31c0
jmp 0xaa20
leaq -0x570(%rbp), %rdi
leaq -0x470(%rbp), %rsi
callq 0x3120
jmp 0xa97b
movq -0x18(%rbp), %rdx
leaq -0x550(%rbp), %rdi
leaq -0x570(%rbp), %rsi
callq 0x9530
jmp 0xa994
leaq -0x50(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x14c50
jmp 0xa9a6
leaq -0x550(%rbp), %rdi
callq 0x12580
leaq -0x570(%rbp), %rdi
callq 0x31c0
jmp 0xa9f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xa9e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x550(%rbp), %rdi
callq 0x12580
leaq -0x570(%rbp), %rdi
callq 0x31c0
jmp 0xaa20
leaq -0x470(%rbp), %rdi
callq 0x33f0
leaq -0x470(%rbp), %rdi
callq 0x31c0
movl -0x44c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44c(%rbp)
jmp 0xa520
leaq -0x470(%rbp), %rdi
callq 0x31c0
jmp 0xac80
jmp 0xaa33
jmp 0xaa35
movq -0x5c0(%rbp), %rdi
movb $0x0, -0x571(%rbp)
callq 0x14ab0
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x740(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x748(%rbp)
callq 0x14f00
movq -0x748(%rbp), %rdi
movq %rax, %rcx
movq -0x5c0(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, (%rax)
callq 0x14c80
movq -0x748(%rbp), %rdi
movq -0x740(%rbp), %rsi
movq %rax, %rcx
movq -0x5c0(%rbp), %rax
movl 0x4(%rcx), %ecx
movl %ecx, 0x4(%rax)
callq 0x14f00
movq -0x5c0(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
addq $0x8, %rdi
callq 0x14f20
jmp 0xaab9
movl $0x1, -0x578(%rbp)
movslq -0x578(%rbp), %rax
movq %rax, -0x750(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x15170
movq %rax, %rcx
movq -0x750(%rbp), %rax
cmpq %rcx, %rax
jae 0xac4d
movq -0x5c0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x768(%rbp)
movl -0x578(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x760(%rbp)
callq 0x14f00
movq -0x760(%rbp), %rdi
movl 0x4(%rax), %eax
movl %eax, -0x754(%rbp)
movslq -0x578(%rbp), %rsi
callq 0x14f00
movl -0x754(%rbp), %esi
movl (%rax), %ecx
leaq -0x584(%rbp), %rdi
movl $0x7e, %edx
callq 0x14ad0
jmp 0xab51
movq -0x768(%rbp), %rdi
leaq -0x584(%rbp), %rsi
callq 0x14cc0
jmp 0xab66
movq -0x5c0(%rbp), %rdi
addq $0x8, %rdi
movq %rdi, -0x778(%rbp)
callq 0x12160
movq %rax, -0x598(%rbp)
leaq -0x590(%rbp), %rdi
leaq -0x598(%rbp), %rsi
callq 0x14ea0
movslq -0x578(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x780(%rbp)
callq 0x14f00
movq %rax, %rdi
addq $0x8, %rdi
callq 0x12130
movq -0x780(%rbp), %rdi
movq %rax, -0x5a0(%rbp)
movslq -0x578(%rbp), %rsi
callq 0x14f00
movq %rax, %rdi
addq $0x8, %rdi
callq 0x12160
movq -0x778(%rbp), %rdi
movq %rax, -0x5a8(%rbp)
movq -0x590(%rbp), %rsi
movq -0x5a0(%rbp), %rdx
movq -0x5a8(%rbp), %rcx
callq 0x14df0
movq %rax, -0x770(%rbp)
jmp 0xac11
movq -0x770(%rbp), %rax
movq %rax, -0x5b0(%rbp)
movl -0x578(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x578(%rbp)
jmp 0xaac3
movq -0x5c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x12580
jmp 0xac80
movb $0x1, -0x571(%rbp)
movl $0x1, -0x448(%rbp)
testb $0x1, -0x571(%rbp)
jne 0xac73
movq -0x5c0(%rbp), %rdi
callq 0x12580
jmp 0xac75
leaq -0x50(%rbp), %rdi
callq 0x15190
jmp 0xac8b
leaq -0x50(%rbp), %rdi
callq 0x15190
jmp 0xac9b
movq -0x5b8(%rbp), %rax
addq $0x780, %rsp            # imm = 0x780
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x34e0
nopw %cs:(%rax,%rax)