// File: 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:
subq $0x288, %rsp            # imm = 0x288
movb %dl, %al
movq %rdi, 0x278(%rsp)
movq %rsi, 0x270(%rsp)
andb $0x1, %al
movb %al, 0x26f(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xb630
testb $0x1, 0x26f(%rsp)
je 0xacda3
movq 0x6b283(%rip), %rdi     # 0x117fb0
leaq 0x29d71(%rip), %rsi     # 0xd6aa5
callq 0xb380
movq %rax, 0x50(%rsp)
jmp 0xacd40
movq 0x50(%rsp), %rdi
movq 0x278(%rsp), %rsi
callq 0xb340
movq %rax, 0x48(%rsp)
jmp 0xacd59
movq 0x48(%rsp), %rdi
leaq 0x29ceb(%rip), %rsi     # 0xd6a50
callq 0xb380
movq %rax, 0x40(%rsp)
jmp 0xacd71
movq 0x40(%rsp), %rdi
movq 0x6b203(%rip), %rsi     # 0x117f80
callq 0xb3c0
jmp 0xacd84
jmp 0xacda3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xb570
jmp 0xacf45
movq 0x278(%rsp), %rsi
leaq 0x68(%rsp), %rdi
movl $0x10, %edx
callq 0xb1e0
jmp 0xacdbc
leaq 0x68(%rsp), %rdi
callq 0xb2f0
movb %al, 0x3f(%rsp)
jmp 0xacdcc
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0xace59
jmp 0xacdda
testb $0x1, 0x26f(%rsp)
je 0xace44
movq 0x6b1c5(%rip), %rdi     # 0x117fb0
leaq 0x29ca8(%rip), %rsi     # 0xd6a9a
callq 0xb380
movq %rax, 0x30(%rsp)
jmp 0xacdfe
movq 0x30(%rsp), %rdi
movq 0x278(%rsp), %rsi
callq 0xb340
movq %rax, 0x28(%rsp)
jmp 0xace17
movq 0x28(%rsp), %rdi
leaq 0x29c32(%rip), %rsi     # 0xd6a55
callq 0xb380
movq %rax, 0x20(%rsp)
jmp 0xace2f
movq 0x20(%rsp), %rdi
movq 0x6b145(%rip), %rsi     # 0x117f80
callq 0xb3c0
jmp 0xace42
jmp 0xace44
movb $0x0, 0x287(%rsp)
movl $0x1, 0x58(%rsp)
jmp 0xacf2a
testb $0x1, 0x26f(%rsp)
je 0xace92
movq 0x6b146(%rip), %rdi     # 0x117fb0
leaq 0x29c4d(%rip), %rsi     # 0xd6abe
callq 0xb380
movq %rax, 0x18(%rsp)
jmp 0xace7d
movq 0x18(%rsp), %rdi
movq 0x6b0f7(%rip), %rsi     # 0x117f80
callq 0xb3c0
jmp 0xace90
jmp 0xace92
movq 0x270(%rsp), %rsi
leaq 0x68(%rsp), %rdi
callq 0xb340
jmp 0xacea6
leaq 0x68(%rsp), %rdi
callq 0xb550
jmp 0xaceb2
testb $0x1, 0x26f(%rsp)
je 0xacf1a
movq 0x6b0ed(%rip), %rdi     # 0x117fb0
leaq 0x29bbd(%rip), %rsi     # 0xd6a87
callq 0xb380
movq %rax, 0x10(%rsp)
jmp 0xaced6
movq 0x10(%rsp), %rdi
movq 0x278(%rsp), %rsi
callq 0xb340
movq %rax, 0x8(%rsp)
jmp 0xaceef
movq 0x8(%rsp), %rdi
leaq 0x29ba1(%rip), %rsi     # 0xd6a9c
callq 0xb380
movq %rax, (%rsp)
jmp 0xacf06
movq (%rsp), %rdi
movq 0x6b06f(%rip), %rsi     # 0x117f80
callq 0xb3c0
jmp 0xacf18
jmp 0xacf1a
movb $0x1, 0x287(%rsp)
movl $0x1, 0x58(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xb570
movb 0x287(%rsp), %al
andb $0x1, %al
addq $0x288, %rsp            # imm = 0x288
retq
movq 0x60(%rsp), %rdi
callq 0xb680
nop