// File: /workspace/github_cpp_makefile_star2_O3/Thilotilo[P]DoaERando/Rom.cpp
// Function: DoaERando::ROM::WriteRom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int, int, int)
void ROM::WriteRom(std::string path, int major, int minor, int patch, int seed)
{
    ostringstream oss;
    oss << path << "/DoaERando_v" << major << "_" << minor << "_" << patch << "_seed" << seed << ".nes";
    cout << "Writing to file " << oss.str() << endl;
    ofstream fout(oss.str(), ios::out | ios::binary);
    if (fout.fail()) throw 0;
    fout.write((char*)myContents.data(), myContents.size());
    fout.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
movl %r9d, -0x2c(%rbp)
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
leaq -0x3d0(%rbp), %r14
movq %r14, %rdi
callq 0x4827e0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x47a090
movq %rax, %rbx
leaq 0x187880(%rip), %rsi    # 0x58c004
movl $0xc, %edx
movq %rax, %rdi
callq 0x47a090
movq %rbx, %rdi
movl %r13d, %esi
callq 0x47a960
movq %rax, %rbx
leaq 0x18c2be(%rip), %rsi    # 0x590a64
movl $0x1, %edx
movq %rax, %rdi
callq 0x47a090
movq %rbx, %rdi
movl %r12d, %esi
callq 0x47a960
movq %rax, %rbx
leaq 0x18c29c(%rip), %rsi    # 0x590a64
movl $0x1, %edx
movq %rax, %rdi
callq 0x47a090
movq %rbx, %rdi
movl %r15d, %esi
callq 0x47a960
movq %rax, %rbx
leaq 0x187827(%rip), %rsi    # 0x58c011
movl $0x5, %edx
movq %rax, %rdi
callq 0x47a090
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
callq 0x47a960
leaq 0x187d6d(%rip), %rsi    # 0x58c576
movl $0x4, %edx
movq %rax, %rdi
callq 0x47a090
movq $0x6014a0, %rdi         # imm = 0x6014A0
leaq 0x1877f3(%rip), %rsi    # 0x58c017
movl $0x10, %edx
callq 0x47a090
leaq -0x3c8(%rbp), %r14
leaq -0x258(%rbp), %rdi
movq %r14, %rsi
callq 0x4801d0
movq -0x258(%rbp), %rsi
movq -0x250(%rbp), %rdx
movq $0x6014a0, %rdi         # imm = 0x6014A0
callq 0x47a090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x45b1e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x479b90
movq %rax, %rdi
callq 0x479160
leaq -0x248(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40489d
callq 0x410b90
leaq -0x58(%rbp), %rdi
movq %r14, %rsi
callq 0x4801d0
leaq -0x258(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movl $0x14, %edx
callq 0x456bf0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4048d0
callq 0x410b90
movq -0x258(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x238(%rbp,%rax)
jne 0x404976
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
leaq -0x258(%rbp), %rdi
callq 0x479d10
leaq -0x258(%rbp), %rdi
callq 0x457440
movq $0x5f97e8, %rax         # imm = 0x5F97E8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x250(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x258(%rbp,%rcx)
callq 0x4556d0
leaq -0x160(%rbp), %rdi
callq 0x45c600
movq $0x5fafc8, %rsi         # imm = 0x5FAFC8
leaq -0x3d0(%rbp), %rdi
callq 0x483090
leaq -0x360(%rbp), %rdi
callq 0x45c600
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x410e70
movl $0x0, (%rax)
movq $0x5f66e8, %rsi         # imm = 0x5F66E8
movq %rax, %rdi
xorl %edx, %edx
callq 0x411ec0
movq %rax, %rbx
leaq -0x48(%rbp), %rax
jmp 0x4049bf
jmp 0x4049cf
jmp 0x4049cf
movq %rax, %rbx
leaq -0x258(%rbp), %rdi
callq 0x457670
jmp 0x4049d2
movq %rax, %rbx
leaq -0x248(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4049d2
callq 0x410b90
jmp 0x4049d2
movq %rax, %rbx
movq $0x5fafc8, %rsi         # imm = 0x5FAFC8
leaq -0x3d0(%rbp), %rdi
callq 0x483090
leaq -0x360(%rbp), %rdi
callq 0x45c600
movq %rbx, %rdi
callq 0x4bb660
nop