// File: chrissimpkins[P]octopus/src/io.cpp
// Function: IO::write_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void IO::write_file(string& outstring) {
	if (!path.empty()) {
		ofstream outfile(path);
		if (outfile.good()) {
			ofstream& outr = outfile;
			write_filestring(outr, outstring);
			outfile.close();
		}
		else{
			throw runtime_error("Unable to open the output file " + path);
		}
	}
	else if (!opath.empty()) {
		ofstream outfile(opath);
		if (outfile.good()) {
			ofstream& outr = outfile;
			write_filestring(outr, outstring);
			outfile.close();
		}
		else{
			throw runtime_error("Unable to open the output file " + opath);
		}
	}
	else{
		throw runtime_error("Missing a filepath for the output file.");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x34c0
testb $0x1, %al
jne 0x113dc
movq -0x488(%rbp), %rsi
leaq -0x210(%rbp), %rdi
movl $0x10, %edx
callq 0x3550
movq -0x210(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x210(%rbp,%rax), %rdi
callq 0x34d0
movb %al, -0x489(%rbp)
jmp 0x112a3
movb -0x489(%rbp), %al
testb $0x1, %al
jne 0x112af
jmp 0x11300
movq -0x488(%rbp), %rdi
leaq -0x210(%rbp), %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x115e0
jmp 0x112d6
leaq -0x210(%rbp), %rdi
callq 0x3430
jmp 0x112e4
jmp 0x113ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x113cb
movb $0x1, -0x249(%rbp)
movl $0x10, %edi
callq 0x3160
movq -0x488(%rbp), %rdx
movq %rax, -0x498(%rbp)
leaq 0x24d5(%rip), %rsi      # 0x137fb
leaq -0x248(%rbp), %rdi
callq 0xca10
jmp 0x11334
movq -0x498(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x34a0
jmp 0x11349
movq -0x498(%rbp), %rdi
movb $0x0, -0x249(%rbp)
movq 0x6c92(%rip), %rsi      # 0x17ff0
movq 0x6c4b(%rip), %rdx      # 0x17fb0
callq 0x34e0
jmp 0x115dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x113a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x31b0
testb $0x1, -0x249(%rbp)
jne 0x113ac
jmp 0x113b8
movq -0x498(%rbp), %rdi
callq 0x3200
jmp 0x113cb
leaq -0x210(%rbp), %rdi
callq 0x3450
jmp 0x115c8
leaq -0x210(%rbp), %rdi
callq 0x3450
jmp 0x115d1
movq -0x488(%rbp), %rdi
addq $0x40, %rdi
callq 0x34c0
testb $0x1, %al
jne 0x11567
movq -0x488(%rbp), %rsi
addq $0x40, %rsi
leaq -0x450(%rbp), %rdi
movl $0x10, %edx
callq 0x3550
movq -0x450(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x450(%rbp,%rax), %rdi
callq 0x34d0
movb %al, -0x499(%rbp)
jmp 0x11430
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0x1143c
jmp 0x1148d
movq -0x488(%rbp), %rdi
leaq -0x450(%rbp), %rax
movq %rax, -0x458(%rbp)
movq -0x458(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x115e0
jmp 0x11463
leaq -0x450(%rbp), %rdi
callq 0x3430
jmp 0x11471
jmp 0x1154b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x11559
movb $0x1, -0x479(%rbp)
movl $0x10, %edi
callq 0x3160
movq -0x488(%rbp), %rdx
movq %rax, -0x4a8(%rbp)
addq $0x40, %rdx
leaq 0x2344(%rip), %rsi      # 0x137fb
leaq -0x478(%rbp), %rdi
callq 0xca10
jmp 0x114c5
movq -0x4a8(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x34a0
jmp 0x114da
movq -0x4a8(%rbp), %rdi
movb $0x0, -0x479(%rbp)
movq 0x6b01(%rip), %rsi      # 0x17ff0
movq 0x6aba(%rip), %rdx      # 0x17fb0
callq 0x34e0
jmp 0x115dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x11532
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x31b0
testb $0x1, -0x479(%rbp)
jne 0x1153d
jmp 0x11549
movq -0x4a8(%rbp), %rdi
callq 0x3200
jmp 0x11559
leaq -0x450(%rbp), %rdi
callq 0x3450
jmp 0x115c6
leaq -0x450(%rbp), %rdi
callq 0x3450
jmp 0x115d1
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x4b0(%rbp)
leaq 0x2296(%rip), %rsi      # 0x1381b
callq 0x30f0
jmp 0x1158c
movq -0x4b0(%rbp), %rdi
movq 0x6a56(%rip), %rsi      # 0x17ff0
movq 0x6a0f(%rip), %rdx      # 0x17fb0
callq 0x34e0
movq -0x4b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
callq 0x3200
jmp 0x115d1
jmp 0x115c8
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
movq -0x218(%rbp), %rdi
callq 0x3500
nopl (%rax)