// File: /workspace/github_cpp_makefile_star2_O3/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 0xb2af
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 0xb27a
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 0xb366
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 0xb33c
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 0xb457
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 0xb42d
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 0xba2e
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 0xb9fe
movl %esi, %ecx
movl %ecx, %ebp
negl %ebp
cmovsl %ecx, %ebp
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 0x3c64
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0x158(%rsp)
cmpq %rax, %rdi
je 0xb9d1
movl $0x1, %ebx
cmpl $0xa, %ebp
leaq 0xf0(%rsp), %r15
movq 0x150(%rsp), %rsi
jb 0xb5a4
movl $0x4, %ebx
movl %ebp, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xb59d
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xb5a2
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xb5a4
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xb56f
addl $-0x3, %ebx
jmp 0xb5a4
addl $-0x2, %ebx
jmp 0xb5a4
decl %ebx
movl %ebp, %r12d
movq %rdi, 0x160(%rsp)
movl (%rdi), %r14d
movq %rsi, %rbp
addl %ebx, %esi
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2260
movq 0xf0(%rsp), %rdi
addq %rbp, %rdi
movl %ebx, %esi
movl %r12d, %ebp
movl %r12d, %edx
callq 0xea32
movq %r15, %rdi
leaq 0x7ac0(%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 0xb629
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0xb62f
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 0xb697
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0xb69d
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 0x79ef(%rip), %rsi      # 0x130b6
callq 0x2380
movq %r13, 0x90(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb6f8
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0xb700
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 %r14d, %ebx
negl %ebx
cmovsl %r14d, %ebx
movl $0x1, %r15d
cmpl $0xa, %ebx
jb 0xb775
movl $0x4, %r15d
movl %ebx, %eax
movl $0xd1b71759, %edx       # imm = 0xD1B71759
cmpl $0x63, %eax
jbe 0xb76c
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xb772
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xb775
movl %eax, %ecx
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xb73c
addl $-0x3, %r15d
jmp 0xb775
addl $-0x2, %r15d
jmp 0xb775
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
movl $0x2d, %edx
callq 0x2260
addq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0xea32
movq 0x90(%rsp), %rcx
movl $0xf, %edi
cmpq %r13, %rcx
je 0xb7c2
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %r8
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq 0x60(%rsp), %r12
leaq 0x120(%rsp), %r15
jbe 0xb803
movl $0xf, %edi
leaq 0x40(%rsp), %r9
cmpq %r9, %rsi
je 0xb7fe
movq 0x40(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xb812
leaq 0x90(%rsp), %rdi
callq 0x2090
jmp 0xb820
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
movq %r12, 0x50(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xb840
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xb848
movups (%rcx), %xmm0
movups %xmm0, (%r12)
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 0x790e(%rip), %rsi      # 0x1317f
callq 0x2380
movq %r15, 0x110(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb8a2
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
jmp 0xb8a9
movups (%rcx), %xmm0
movups %xmm0, (%r15)
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 0x115d8
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0xb8f6
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xb90d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xb929
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0xb946
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xb96b
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xb98d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xb9b2
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x160(%rsp), %rdi
addq $0x4, %rdi
cmpq 0x158(%rsp), %rdi
jne 0xb549
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xb9e3
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x148(%rsp), %rdi
callq 0x2160
cmpq 0x140(%rsp), %rax
jne 0xb511
movq 0x138(%rsp), %rcx
addq $0x4, %rcx
cmpq 0x130(%rsp), %rcx
jne 0xb4c5
movq 0xb8(%rsp), %rsi
subq 0xb0(%rsp), %rsi
sarq $0x5, %rsi
jmp 0xba30
xorl %esi, %esi
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 0xbad7
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 0x44cc
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x2240
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xbace
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x20, %r15
cmpq %r13, %r15
jne 0xba8e
leaq 0xb0(%rsp), %rdi
callq 0xded4
movq 0xd4d5(%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 0xbb5e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xbc85
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0xbc80
jmp 0xbb5e
jmp 0xbb56
jmp 0xbb56
jmp 0xbb56
movq %rax, %rbx
jmp 0xbc92
movq %rax, %rbx
jmp 0xbc85
movq %rax, %rbx
jmp 0xbbe5
movq %rax, %rbx
jmp 0xbc27
movq %rax, %rbx
jmp 0xbbb2
movq %rax, %rbx
jmp 0xbc6e
movq %rax, %rbx
jmp 0xbc02
movq %rax, %rbx
jmp 0xbbc9
movq %rax, %rbx
jmp 0xbc49
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0xbbb2
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xbbc9
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xbbe5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0xbc02
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xbc27
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xbc49
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xbc6e
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xbc85
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0xb0(%rsp), %rdi
callq 0xded4
movq 0xd327(%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