// File: /workspace/github_c_makefile_star2_O0/algorithm-archivists[P]GathVL/src/objects/tex_string.cpp
// Function: tex_to_png(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static int tex_to_png(const std::string& str, const std::string& url) {
    std::ofstream tex_file(url + "tex", std::ios_base::out);

    tex_file.write(tex_template, sizeof(tex_template) - 1);
    tex_file.write(str.c_str(), str.size());
    tex_file.write("\n\\end{document}", 15);

    tex_file.close();

    std::vector<std::string> latex_args =
        {"latex", url + "tex"};

    if (subprocess("/usr/bin/latex", latex_args)) {
        return 1;
    }

    std::vector<std::string> png_args = {"dvipng", url + "dvi", "-D", "2000",
        "-bg", "transparent","-o", url + "png"};

    return subprocess("/usr/bin/dvipng", png_args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x6af2(%rip), %rdx      # 0x3d650
leaq -0x238(%rbp), %rdi
movq %rdi, -0x400(%rbp)
callq 0x377d0
movq -0x400(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x10, %edx
callq 0x5590
jmp 0x36b8b
leaq -0x238(%rbp), %rdi
callq 0x5830
leaq 0x6b22(%rip), %rsi      # 0x3d6c0
leaq -0x218(%rbp), %rdi
movl $0x60, %edx
callq 0x56c0
jmp 0x36bb1
movq -0x10(%rbp), %rdi
callq 0x5530
movq %rax, -0x408(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5630
movq -0x408(%rbp), %rsi
movq %rax, %rdx
leaq -0x218(%rbp), %rdi
callq 0x56c0
jmp 0x36be2
leaq 0x6a4c(%rip), %rsi      # 0x3d635
leaq -0x218(%rbp), %rdi
movl $0xf, %edx
callq 0x56c0
jmp 0x36bfc
leaq -0x218(%rbp), %rdi
callq 0x5410
jmp 0x36c0a
movb $0x1, -0x2ba(%rbp)
leaq -0x2b0(%rbp), %rax
movq %rax, -0x418(%rbp)
movq %rax, -0x2b8(%rbp)
leaq -0x2b9(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x5400
movq -0x418(%rbp), %rdi
movq -0x410(%rbp), %rdx
leaq 0x6a00(%rip), %rsi      # 0x3d64e
callq 0x8b90
jmp 0x36c55
leaq -0x290(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x69e2(%rip), %rdx      # 0x3d650
callq 0x377d0
jmp 0x36c75
movb $0x0, -0x2ba(%rbp)
leaq -0x2b0(%rbp), %rax
movq %rax, -0x270(%rbp)
movq $0x2, -0x268(%rbp)
leaq -0x2bb(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0x38010
movq -0x420(%rbp), %rcx
movq -0x270(%rbp), %rsi
movq -0x268(%rbp), %rdx
leaq -0x260(%rbp), %rdi
callq 0x38030
jmp 0x36ccb
leaq -0x2bb(%rbp), %rdi
callq 0x380b0
leaq -0x2b0(%rbp), %rax
movq %rax, -0x430(%rbp)
addq $0x40, %rax
movq %rax, -0x428(%rbp)
movq -0x428(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x438(%rbp)
callq 0x5830
movq -0x430(%rbp), %rcx
movq -0x438(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x428(%rbp)
jne 0x36cf0
leaq -0x2b9(%rbp), %rdi
callq 0x5050
leaq 0x6911(%rip), %rdi      # 0x3d645
leaq -0x260(%rbp), %rsi
callq 0x39b90
movl %eax, -0x43c(%rbp)
jmp 0x36d48
movl -0x43c(%rbp), %eax
cmpl $0x0, %eax
je 0x36ea5
movl $0x1, -0x4(%rbp)
movl $0x1, -0x2c0(%rbp)
jmp 0x3736e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5830
jmp 0x373aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x3739e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x36e25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x2bb(%rbp), %rdi
callq 0x380b0
leaq -0x2b0(%rbp), %rax
movq %rax, -0x450(%rbp)
addq $0x40, %rax
movq %rax, -0x448(%rbp)
movq -0x448(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x458(%rbp)
callq 0x5830
movq -0x450(%rbp), %rcx
movq -0x458(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x448(%rbp)
jne 0x36df2
jmp 0x36e25
leaq -0x2b9(%rbp), %rdi
callq 0x5050
testb $0x1, -0x2ba(%rbp)
jne 0x36e3c
jmp 0x36e89
movq -0x2b8(%rbp), %rax
leaq -0x2b0(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x460(%rbp)
je 0x36e87
movq -0x460(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x468(%rbp)
callq 0x5830
movq -0x468(%rbp), %rax
leaq -0x2b0(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x460(%rbp)
jne 0x36e56
jmp 0x36e89
jmp 0x3739e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x37392
movb $0x1, -0x3f7(%rbp)
leaq -0x3e8(%rbp), %rax
movq %rax, -0x478(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f1(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x5400
movq -0x478(%rbp), %rdi
movq -0x470(%rbp), %rdx
leaq 0x678f(%rip), %rsi      # 0x3d678
callq 0x8b90
jmp 0x36ef0
leaq -0x3c8(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x6704(%rip), %rdx      # 0x3d60d
callq 0x377d0
jmp 0x36f10
leaq -0x3a8(%rbp), %rax
movq %rax, -0x488(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f2(%rbp), %rdi
movq %rdi, -0x480(%rbp)
callq 0x5400
movq -0x488(%rbp), %rdi
movq -0x480(%rbp), %rdx
leaq 0x6707(%rip), %rsi      # 0x3d654
callq 0x8b90
jmp 0x36f54
leaq -0x388(%rbp), %rax
movq %rax, -0x498(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f3(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x5400
movq -0x498(%rbp), %rdi
movq -0x490(%rbp), %rdx
leaq 0x66c6(%rip), %rsi      # 0x3d657
callq 0x8b90
jmp 0x36f98
leaq -0x368(%rbp), %rax
movq %rax, -0x4a8(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f4(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x5400
movq -0x4a8(%rbp), %rdi
movq -0x4a0(%rbp), %rdx
leaq 0x6687(%rip), %rsi      # 0x3d65c
callq 0x8b90
jmp 0x36fdc
leaq -0x348(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f5(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x5400
movq -0x4b8(%rbp), %rdi
movq -0x4b0(%rbp), %rdx
leaq 0x6647(%rip), %rsi      # 0x3d660
callq 0x8b90
jmp 0x37020
leaq -0x328(%rbp), %rax
movq %rax, -0x4c8(%rbp)
movq %rax, -0x3f0(%rbp)
leaq -0x3f6(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x5400
movq -0x4c8(%rbp), %rdi
movq -0x4c0(%rbp), %rdx
leaq 0x660f(%rip), %rsi      # 0x3d66c
callq 0x8b90
jmp 0x37064
leaq -0x308(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x66ab(%rip), %rdx      # 0x3d728
callq 0x377d0
jmp 0x37084
movb $0x0, -0x3f7(%rbp)
leaq -0x3e8(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq $0x8, -0x2e0(%rbp)
leaq -0x3f8(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x38010
movq -0x4d0(%rbp), %rcx
movq -0x2e8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
leaq -0x2d8(%rbp), %rdi
callq 0x38030
jmp 0x370da
leaq -0x3f8(%rbp), %rdi
callq 0x380b0
leaq -0x3e8(%rbp), %rax
movq %rax, -0x4e0(%rbp)
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x4d8(%rbp)
movq -0x4d8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x5830
movq -0x4e0(%rbp), %rcx
movq -0x4e8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4d8(%rbp)
jne 0x37101
leaq -0x3f6(%rbp), %rdi
callq 0x5050
leaq -0x3f5(%rbp), %rdi
callq 0x5050
leaq -0x3f4(%rbp), %rdi
callq 0x5050
leaq -0x3f3(%rbp), %rdi
callq 0x5050
leaq -0x3f2(%rbp), %rdi
callq 0x5050
leaq -0x3f1(%rbp), %rdi
callq 0x5050
leaq 0x64ee(%rip), %rdi      # 0x3d66f
leaq -0x2d8(%rbp), %rsi
callq 0x39b90
movl %eax, -0x4ec(%rbp)
jmp 0x37195
movl -0x4ec(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x2c0(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x380d0
jmp 0x3736e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x372ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0x380b0
leaq -0x3e8(%rbp), %rax
movq %rax, -0x500(%rbp)
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x508(%rbp)
callq 0x5830
movq -0x500(%rbp), %rcx
movq -0x508(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4f8(%rbp)
jne 0x37279
jmp 0x372ac
leaq -0x3f6(%rbp), %rdi
callq 0x5050
leaq -0x3f5(%rbp), %rdi
callq 0x5050
leaq -0x3f4(%rbp), %rdi
callq 0x5050
leaq -0x3f3(%rbp), %rdi
callq 0x5050
leaq -0x3f2(%rbp), %rdi
callq 0x5050
leaq -0x3f1(%rbp), %rdi
callq 0x5050
testb $0x1, -0x3f7(%rbp)
jne 0x372ff
jmp 0x3734c
movq -0x3f0(%rbp), %rax
leaq -0x3e8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x510(%rbp)
je 0x3734a
movq -0x510(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x518(%rbp)
callq 0x5830
movq -0x518(%rbp), %rax
leaq -0x3e8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x510(%rbp)
jne 0x37319
jmp 0x3734c
jmp 0x37392
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x380d0
jmp 0x37392
leaq -0x260(%rbp), %rdi
callq 0x380d0
leaq -0x218(%rbp), %rdi
callq 0x5870
movl -0x4(%rbp), %eax
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
leaq -0x260(%rbp), %rdi
callq 0x380d0
leaq -0x218(%rbp), %rdi
callq 0x5870
movq -0x240(%rbp), %rdi
callq 0x52d0
nopw %cs:(%rax,%rax)