// File: /workspace/github_cpp_makefile_star2_O3/JameyWoo[P]re2graph/algorithms.cpp
// Function: nfa2png(NFA, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void nfa2png(NFA nfa, string png_file, string pattern) {
    string raw_png_file = png_file;
    string dot_file     = "./tmp/" + png_file.replace(png_file.find(".png"), 4, ".dot");
    nfa2dot(nfa, dot_file);
    string his_pat = "dot";
    string cmd     = his_pat + " -Tpng " + dot_file + " -o ./image/{test.png}";
    if (pattern.size()) cmd.replace(cmd.find(his_pat), his_pat.size(), pattern);
    cmd.replace(cmd.find("{test.png}"), 10, raw_png_file);
    // cout << "nfa cmd: " << cmd << endl;
    system(cmd.c_str());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x44cc
leaq 0xb0ef(%rip), %rsi      # 0x13169
movl $0x4, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x2340
leaq 0xb132(%rip), %rcx      # 0x131c2
movl $0x4, %edx
movl $0x4, %r8d
movq %r15, %rdi
movq %rax, %rsi
callq 0x2220
leaq 0xb10e(%rip), %rsi      # 0x131bb
leaq 0x68(%rsp), %rdi
movq %rax, %rdx
callq 0xdccd
leaq 0xe8(%rsp), %rdi
movq %r14, %rsi
callq 0x3a10
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x44cc
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x84aa
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x8122
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x140(%rsp), %r14
movq %r14, %rdi
callq 0x410c
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x814b
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x8168
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x8185
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb493(%rip), %rsi      # 0x13628
leaq 0xb48f(%rip), %rdx      # 0x1362b
leaq 0x28(%rsp), %rdi
callq 0x4562
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x44cc
leaq 0xaffa(%rip), %rsi      # 0x131c7
leaq 0x48(%rsp), %rdi
callq 0x2380
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x2090
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x821b
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x8222
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x88(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xaf87(%rip), %rsi      # 0x131cf
callq 0x2380
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8274
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x827c
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x82b1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x82c8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
cmpq $0x0, 0x8(%rbx)
je 0x82ff
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rcx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x2340
movq 0x30(%rsp), %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %r8
movq %r14, %rdi
movq %rax, %rsi
callq 0x2220
leaq 0xaed5(%rip), %rsi      # 0x131db
leaq 0x8(%rsp), %rbx
movl $0xa, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2340
movq 0xa8(%rsp), %rcx
movq 0xb0(%rsp), %r8
movl $0xa, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2220
movq 0x8(%rsp), %rdi
callq 0x21b0
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x835b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x8372
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x838d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x83aa
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x83e3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x83e3
jmp 0x83e0
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x8453
movq 0x58(%rsp), %rsi
jmp 0x844b
movq %rax, %rbx
jmp 0x8453
jmp 0x842f
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x8420
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x8420
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x3ac4
jmp 0x846a
movq %rax, %rbx
jmp 0x846a
movq %rax, %rbx
jmp 0x8485
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8453
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x846a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8485
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x84a2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350