// File: /workspace/github_cpp_makefile_star2_O1/menhits[P]phplus/src/msclStringFuncs.cpp
// Function: writeFile(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&, bool)
bool writeFile(const string& filename, const string& contents, bool debug)
{
	std::ofstream outFile;
	
	if (debug)
		cout << "attempting to write to '" << filename << "'..." << endl;
	
	outFile.open(filename);
	
	if (!outFile.is_open())
	{
		if (debug)
			cout << "'" << filename << "' failed to open :(" << endl;
		return false;
	}
	else
	{
		if (debug)
			cout << "file opended, writing to file..." << endl;
		
		outFile << contents;
		
		outFile.close();
		
		if (debug)
			cout << "file reading done, '" << filename << "' closed" << endl;
		
		return true;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
movq %rsp, %rdi
callq 0xa4e0
testl %ebp, %ebp
je 0x5da4a
movq 0x3b5c8(%rip), %rdi     # 0x98fb0
leaq 0x1d8c6(%rip), %rsi     # 0x7b2b5
movl $0x18, %edx
callq 0xa320
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3b5a9(%rip), %rdi     # 0x98fb0
callq 0xa320
movq %rax, %rbx
leaq 0x1d84a(%rip), %rsi     # 0x7b260
movl $0x4, %edx
movq %rax, %rdi
callq 0xa320
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq %rsp, %rdi
movq %r14, %rsi
movl $0x10, %edx
callq 0xa190
leaq 0x70(%rsp), %rdi
callq 0xa0c0
movl %eax, %ebx
testb %al, %al
je 0x5db32
testb %bpl, %bpl
je 0x5daba
movq 0x3b536(%rip), %r12     # 0x98fb0
leaq 0x1d84d(%rip), %rsi     # 0x7b2ce
movl $0x20, %edx
movq %r12, %rdi
callq 0xa320
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq 0x3b503(%rip), %rdi     # 0x98fb0
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rsp, %rdi
callq 0xa320
movq %rsp, %rdi
callq 0xa430
testb %bpl, %bpl
je 0x5dba0
movq 0x3b4cf(%rip), %rdi     # 0x98fb0
leaq 0x1d7af(%rip), %rsi     # 0x7b297
movl $0x14, %edx
callq 0xa320
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3b4b0(%rip), %rdi     # 0x98fb0
callq 0xa320
movq %rax, %r14
leaq 0x1d79d(%rip), %rsi     # 0x7b2ac
movl $0x8, %edx
movq %rax, %rdi
callq 0xa320
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xa2c0
jmp 0x5db8d
testb %bpl, %bpl
je 0x5dba0
movq 0x3b472(%rip), %rdi     # 0x98fb0
leaq 0x1d765(%rip), %rsi     # 0x7b2aa
movl $0x1, %edx
callq 0xa320
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3b453(%rip), %rdi     # 0x98fb0
callq 0xa320
movq %rax, %r14
leaq 0x1d6f9(%rip), %rsi     # 0x7b265
movl $0x13, %edx
movq %rax, %rdi
callq 0xa320
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xa2c0
movsbl %al, %esi
movq %r14, %rdi
callq 0xa030
movq %rax, %rdi
callq 0xa200
movq 0x3b3f1(%rip), %rax     # 0x98f98
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x8(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, (%rsp,%rcx)
callq 0xa280
leaq 0xf8(%rsp), %rdi
callq 0xa120
movl %ebx, %eax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xa450
movq %rbx, %rdi
callq 0xa510