// File: /workspace/github_cpp_makefile_star2_O3/rvthak[P]Makefile-Maker/output.cpp
// Function: Output(Makefile&)
void Output(Makefile &mk){
	// Safely Create the output file
	ofstream file;
	file.open("makefile");
	if(!file.is_open()){
		cout << " (!) Fatal Error: Failed to create makefile. Exiting.. " << endl;
		exit(1);
	}

	// Write the Makefile info 
	file << "OUT=" << mk.getName() << endl;
	file << "OBJS=" << mk.getFileList() << endl;
	file << "CXX=" << mk.getCompiler() << endl;

	if(mk.getCompParam()){
		file << "CXXFLAGS=" << mk.getCompParamList() << endl;
	}
	else{
		file << "CXXFLAGS=" << endl;
	}

	if(mk.getExecParam()){
		file << "EXECUTION_PARAMETERS=" << mk.getExecParamList() << endl;
	}
	else{
		file << "EXECUTION_PARAMETERS=" << endl;
	}
	
	// Write Body + any other part
	file << mkflBody();

	if(mk.getInstall()){
		file << mkflInst();
	}

	if(mk.getDebug()){
		file << mkflDB();
	}

	if(mk.getValgrind()){
		file << mkflVal(mk.getDebug());
	}

	file << mkflClean();

	file.close();
	return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2280
leaq 0x1542(%rip), %rsi      # 0x5829
movq %r14, %rdi
movl $0x10, %edx
callq 0x2050
leaq 0x90(%rsp), %rdi
callq 0x2080
testb %al, %al
je 0x4763
leaq 0x155a(%rip), %rsi      # 0x586a
leaq 0x20(%rsp), %rdi
movl $0x4, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3b88
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x4382
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x14e6(%rip), %rsi      # 0x586f
leaq 0x20(%rsp), %rdi
movl $0x5, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3c9a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x43f6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x1478(%rip), %rsi      # 0x5875
leaq 0x20(%rsp), %rdi
movl $0x4, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3baa
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x446a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c2e
testb %al, %al
je 0x44ec
leaq 0x13fd(%rip), %rsi      # 0x587a
leaq 0x20(%rsp), %rdi
movl $0x9, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3c46
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4530
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x4530
leaq 0x1387(%rip), %rsi      # 0x587a
leaq 0x20(%rsp), %r14
movl $0x9, %edx
movq %r14, %rdi
callq 0x21b0
movq 0x20(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
leaq 0x20(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x3c36
testb %al, %al
je 0x45b2
leaq 0x1341(%rip), %rsi      # 0x5884
leaq 0x20(%rsp), %rdi
movl $0x15, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3c70
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x45f6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x45f6
leaq 0x12cb(%rip), %rsi      # 0x5884
leaq 0x20(%rsp), %r14
movl $0x15, %edx
movq %r14, %rdi
callq 0x21b0
movq 0x20(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
leaq 0x20(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq %rsp, %rdi
callq 0x47f8
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4627
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c26
testb %al, %al
je 0x4664
movq %rsp, %rdi
callq 0x48a0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4664
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c16
testb %al, %al
je 0x46a1
movq %rsp, %rdi
callq 0x491b
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46a1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c1e
testb %al, %al
je 0x46e9
movq %rbx, %rdi
callq 0x3c16
movzbl %al, %esi
movq %rsp, %rdi
callq 0x49a5
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46e9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rsp, %rdi
callq 0x4a72
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x471a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x20(%rsp), %rdi
callq 0x2200
movq 0x389d(%rip), %rax      # 0x7fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x28(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x20(%rsp,%rcx)
callq 0x2150
leaq 0x118(%rsp), %rdi
callq 0x20c0
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
movq 0x3866(%rip), %rdi      # 0x7fd0
leaq 0x10c1(%rip), %rsi      # 0x5832
movl $0x37, %edx
callq 0x21b0
movq 0x384e(%rip), %rdi      # 0x7fd0
callq 0x20e0
movl $0x1, %edi
callq 0x21d0
jmp 0x47b5
jmp 0x47b5
jmp 0x47e3
jmp 0x47b5
jmp 0x47e3
jmp 0x47e3
jmp 0x47e3
jmp 0x47b5
jmp 0x47e3
jmp 0x47e3
jmp 0x47b5
jmp 0x47e3
jmp 0x47e3
jmp 0x47e3
jmp 0x47e3
jmp 0x47b5
jmp 0x47b5
jmp 0x47b5
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x47d4
jmp 0x47e6
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x47e6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x47e6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x2290