// File: /workspace/github_cpp_makefile_star2_O1/JameyWoo[P]re2graph/algorithms.cpp
// Function: writeNfaData(NFA, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void writeNfaData(NFA nfa, string filename) {
    /**
     * 将dfa数据写入到filename文件中.
     * 按照输入的格式, 相当于将输入反了一遍. 
     */
    ofstream write;
    write.open(filename, ios::out | ios::trunc);  // ? 是否设置成没有则创建
    write << nfa.chars.size() << endl;
    for (auto c : nfa.chars) {
        write << c << ' ';
    }
    write << endl
          << nfa.state_cnt << endl;
    for (auto c : nfa.states) {
        write << c << ' ';
    }
    write << endl
          << nfa.start_state << endl
          << nfa.end_state_cnt << endl;
    for (auto c : nfa.end_states) {
        write << c << ' ';
    }
    write << endl;
    // 转换条件的写入
    vector<string> jumps;
    for (auto s : nfa.states) {
        for (auto m : nfa.jump[s]) {
            for (auto v : m.second) {
                jumps.push_back(to_string(s) + " " + m.first + " " + to_string(v) + "\n");
            }
        }
    }
    write << jumps.size() << endl;
    for (auto s : jumps) {
        write << s;
    }
    // cout << "NFA write over!" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
leaq 0x168(%rsp), %r14
movq %r14, %rdi
callq 0x2320
movq %r14, %rdi
movq %rbx, %rsi
movl $0x30, %edx
callq 0x20e0
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rsi
subq 0x10(%rax), %rsi
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
callq 0x2140
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r12
movq 0x18(%rax), %r13
cmpq %r13, %r12
je 0xb356
leaq 0x168(%rsp), %r14
leaq 0x10(%rsp), %r15
movb (%r12), %al
movb %al, 0x10(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2240
movb $0x20, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
incq %r12
cmpq %r13, %r12
jne 0xb321
movq 0x168(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x2330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rax
movq 0x28(%rax), %r12
movq 0x30(%rax), %r13
cmpq %r13, %r12
je 0xb40d
leaq 0x168(%rsp), %r14
leaq 0x10(%rsp), %r15
movl (%r12), %esi
movq %r14, %rdi
callq 0x2330
movb $0x20, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
addq $0x4, %r12
cmpq %r13, %r12
jne 0xb3e3
movq 0x168(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
leaq 0x168(%rsp), %rbx
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x2330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rcx
movl 0xc(%rcx), %esi
movq %rax, %rdi
callq 0x2330
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0x8(%rsp), %rax
movq 0x40(%rax), %r12
movq 0x48(%rax), %r13
cmpq %r13, %r12
je 0xb4fe
leaq 0x168(%rsp), %r14
leaq 0x10(%rsp), %r15
movl (%r12), %esi
movq %r14, %rdi
callq 0x2330
movb $0x20, 0x10(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2240
addq $0x4, %r12
cmpq %r13, %r12
jne 0xb4d4
movq 0x168(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
leaq 0x168(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rax
movq %rax, 0x130(%rsp)
cmpq %rax, %rcx
je 0xbabf
leaq 0xa0(%rsp), %r13
movq %rcx, 0x138(%rsp)
movslq (%rcx), %rsi
movq 0x8(%rsp), %rcx
movq 0x58(%rcx), %rcx
leaq (%rsi,%rsi,2), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addq $0x8, %rcx
movq 0x10(%rcx), %rax
movq %rcx, 0x140(%rsp)
cmpq %rcx, %rax
je 0xbaa5
movl %esi, %ecx
movl %ecx, %r12d
negl %r12d
cmovsl %ecx, %r12d
shrl $0x1f, %ecx
movq %rcx, 0x150(%rsp)
movb 0x20(%rax), %cl
movb %cl, 0x10(%rsp)
movq %rax, 0x148(%rsp)
leaq 0x28(%rax), %rsi
leaq 0x18(%rsp), %rdi
callq 0x3c86
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x158(%rsp)
cmpq %rax, %rdi
je 0xba73
movl $0x1, %ebx
cmpl $0xa, %r12d
leaq 0xf0(%rsp), %r14
movq 0x150(%rsp), %rsi
jb 0xb650
movl $0x4, %ebx
movl %r12d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xb649
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xb64e
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xb650
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xb61b
addl $-0x3, %ebx
jmp 0xb650
addl $-0x2, %ebx
jmp 0xb650
decl %ebx
movl %r12d, %r15d
movq %rdi, 0x160(%rsp)
movl (%rdi), %ebp
movq %rsi, %r12
addl %ebx, %esi
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq %r14, %rdi
movl $0x2d, %edx
callq 0x2260
movq 0xf0(%rsp), %rdi
addq %r12, %rdi
movl %ebx, %esi
movl %r15d, %r12d
movl %r15d, %edx
callq 0xea40
movq %r14, %rdi
leaq 0x7a15(%rip), %rsi      # 0x130b6
callq 0x2380
leaq 0x80(%rsp), %rsi
movq %rsi, 0x70(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb6d4
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0xb6da
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movsbl 0x10(%rsp), %r8d
movq 0x78(%rsp), %rsi
movl $0x1, %ecx
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x2370
leaq 0xe0(%rsp), %rsi
movq %rsi, 0xd0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb742
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0xb748
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xd8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd0(%rsp), %rdi
leaq 0x7944(%rip), %rsi      # 0x130b6
callq 0x2380
movq %r13, 0x90(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb7a3
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0xb7ab
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %ebp, %r14d
negl %r14d
cmovsl %ebp, %r14d
movl $0x1, %ebx
cmpl $0xa, %r14d
jb 0xb81d
movl $0x4, %ebx
movl %r14d, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xb816
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xb81b
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xb81d
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xb7e8
addl $-0x3, %ebx
jmp 0xb81d
addl $-0x2, %ebx
jmp 0xb81d
decl %ebx
shrl $0x1f, %ebp
leal (%rbx,%rbp), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x2260
addq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0xea40
movq 0x90(%rsp), %rcx
movl $0xf, %esi
cmpq %r13, %rcx
je 0xb868
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
leaq 0x60(%rsp), %r15
leaq 0x120(%rsp), %r14
jbe 0xb8a6
movl $0xf, %esi
leaq 0x40(%rsp), %rdi
cmpq %rdi, 0x30(%rsp)
je 0xb8a1
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xb8ba
movq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x2090
jmp 0xb8c8
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
movq %r15, 0x50(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xb8e8
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xb8ef
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x50(%rsp), %rdi
leaq 0x7867(%rip), %rsi      # 0x1317f
callq 0x2380
movq %r14, 0x110(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb949
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
jmp 0xb950
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x118(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb0(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x115f4
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0xb99d
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xb9b4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xb9d0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0xb9ed
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xba12
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xba34
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xba59
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x160(%rsp), %rdi
addq $0x4, %rdi
cmpq 0x158(%rsp), %rdi
jne 0xb5f3
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xba8a
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x148(%rsp), %rdi
callq 0x2160
cmpq 0x140(%rsp), %rax
jne 0xb5bb
movq 0x138(%rsp), %rcx
addq $0x4, %rcx
cmpq 0x130(%rsp), %rcx
jne 0xb56c
movq 0xb8(%rsp), %rsi
subq 0xb0(%rsp), %rsi
sarq $0x5, %rsi
leaq 0x168(%rsp), %rdi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
movq 0xb0(%rsp), %r15
movq 0xb8(%rsp), %r13
cmpq %r13, %r15
je 0xbb7a
leaq 0x20(%rsp), %r12
leaq 0x10(%rsp), %rbx
leaq 0x168(%rsp), %r14
movq %r12, 0x10(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x44e2
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x2240
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xbb71
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x20, %r15
cmpq %r13, %r15
jne 0xbb31
leaq 0xb0(%rsp), %rdi
callq 0xdf0e
movq 0xd432(%rip), %rax      # 0x18fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x170(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x168(%rsp,%rcx)
callq 0x21a0
leaq 0x260(%rsp), %rdi
callq 0x20a0
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbc01
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xbd28
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0xbd23
jmp 0xbc01
jmp 0xbbf9
jmp 0xbbf9
jmp 0xbbf9
movq %rax, %rbx
jmp 0xbd35
movq %rax, %rbx
jmp 0xbd28
movq %rax, %rbx
jmp 0xbc88
movq %rax, %rbx
jmp 0xbcca
movq %rax, %rbx
jmp 0xbc55
movq %rax, %rbx
jmp 0xbd11
movq %rax, %rbx
jmp 0xbca5
movq %rax, %rbx
jmp 0xbc6c
movq %rax, %rbx
jmp 0xbcec
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0xbc55
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xbc6c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbc88
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0xbca5
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xbcca
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xbcec
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xbd11
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xbd28
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0xb0(%rsp), %rdi
callq 0xdf0e
movq 0xd284(%rip), %rax      # 0x18fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x170(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x168(%rsp,%rcx)
callq 0x21a0
leaq 0x260(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2350