// File: /workspace/github_cpp_makefile_star2_O1/JameyWoo[P]re2graph/algorithms.cpp
// Function: dfa2png(DFA, 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 dfa2png(DFA dfa, string png_file, string pattern) {
    string raw_png_file = png_file;
    string dot_file     = "./tmp/" + png_file.replace(png_file.find(".png"), 4, ".dot");
    dfa2dot(dfa, 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);
    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 0x9a9a(%rip), %rsi      # 0x13169
movl $0x4, %ecx
movq %r15, %rdi
xorl %edx, %edx
callq 0x2340
leaq 0x9add(%rip), %rcx      # 0x131c2
movl $0x4, %edx
movl $0x4, %r8d
movq %r15, %rdi
movq %rax, %rsi
callq 0x2220
leaq 0x9ab9(%rip), %rsi      # 0x131bb
leaq 0x68(%rsp), %rdi
movq %rax, %rdx
callq 0xdd15
leaq 0xe8(%rsp), %rdi
movq %r14, %rsi
callq 0x3b36
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 0x9aff
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9777
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x140(%rsp), %r14
movq %r14, %rdi
callq 0x44a0
movq -0x18(%r14), %rdi
testq %rdi, %rdi
je 0x97a0
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x97bd
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x97da
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x2200
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9e3e(%rip), %rsi      # 0x13628
leaq 0x9e3a(%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 0x99a5(%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 0x9870
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
jmp 0x9877
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 0x9932(%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 0x98c9
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x98d1
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 0x9906
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x991d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
cmpq $0x0, 0x8(%rbx)
je 0x9954
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 0x9880(%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 0x99b0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x99c7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x99e2
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x99ff
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 0x9a38
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x9a38
jmp 0x9a35
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x9aa8
movq 0x58(%rsp), %rsi
jmp 0x9aa0
movq %rax, %rbx
jmp 0x9aa8
jmp 0x9a84
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x9a75
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x9a75
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x3bea
jmp 0x9abf
movq %rax, %rbx
jmp 0x9abf
movq %rax, %rbx
jmp 0x9ada
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x9aa8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x9abf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9ada
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x9af7
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350