// File: /workspace/github_cpp_makefile_star2_O1/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 0x44e2
leaq 0xb072(%rip), %rsi      # 0x13169
movl $0x4, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x2340
leaq 0xb0b5(%rip), %rcx      # 0x131c2
movl $0x4, %edx
movl $0x4, %r8d
movq %r15, %rdi
movq %rax, %rsi
callq 0x2220
leaq 0xb091(%rip), %rsi      # 0x131bb
leaq 0x68(%rsp), %rdi
movq %rax, %rdx
callq 0xdd15
leaq 0xe8(%rsp), %rdi
movq %r14, %rsi
callq 0x3a32
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x44e2
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x8527
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x819f
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x140(%rsp), %r14
movq %r14, %rdi
callq 0x412e
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x81c8
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x81e5
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x8202
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb416(%rip), %rsi      # 0x13628
leaq 0xb412(%rip), %rdx      # 0x1362b
leaq 0x28(%rsp), %rdi
callq 0x4572
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x44e2
leaq 0xaf7d(%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 0x8298
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x829f
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 0xaf0a(%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 0x82f1
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x82f9
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 0x832e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x8345
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
cmpq $0x0, 0x8(%rbx)
je 0x837c
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 0xae58(%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 0x83d8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x83ef
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x840a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x8427
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 0x8460
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x8460
jmp 0x845d
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x84d0
movq 0x58(%rsp), %rsi
jmp 0x84c8
movq %rax, %rbx
jmp 0x84d0
jmp 0x84ac
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x849d
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x849d
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x3ae6
jmp 0x84e7
movq %rax, %rbx
jmp 0x84e7
movq %rax, %rbx
jmp 0x8502
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x84d0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x84e7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8502
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x851f
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350