// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x2230
leaq 0xe78(%rip), %rsi       # 0x47e5
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x2040
leaq 0x98(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x3c18
leaq 0xe92(%rip), %rsi       # 0x4826
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x35ae
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0xe57(%rip), %rsi       # 0x482b
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x364e
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0xe1d(%rip), %rsi       # 0x4831
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x35bc
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x360a
testb %al, %al
je 0x3a9b
leaq 0xdd6(%rip), %rsi       # 0x4836
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3622
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x20b0
jmp 0x3ab4
leaq 0xd94(%rip), %rsi       # 0x4836
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x3612
testb %al, %al
je 0x3b02
leaq 0xd79(%rip), %rsi       # 0x4840
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3638
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2140
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x20b0
jmp 0x3b1b
leaq 0xd37(%rip), %rsi       # 0x4840
leaq 0x28(%rsp), %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x3c85
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2140
leaq 0x8(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x3602
testb %al, %al
je 0x3b6d
leaq 0x8(%rsp), %rdi
callq 0x3d20
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2140
leaq 0x8(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x35f2
testb %al, %al
je 0x3b9c
leaq 0x8(%rsp), %rdi
callq 0x3d8e
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2140
leaq 0x8(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x35fa
testb %al, %al
je 0x3bd6
movq %rbx, %rdi
callq 0x35f2
movzbl %al, %esi
leaq 0x8(%rsp), %rdi
callq 0x3e0b
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2140
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0x8(%rsp), %rdi
callq 0x3ecb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2140
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0x28(%rsp), %rdi
callq 0x21d0
leaq 0x28(%rsp), %rdi
callq 0x21e0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r14
retq
movq 0x33b1(%rip), %rdi      # 0x6fd0
leaq 0xbc8(%rip), %rsi       # 0x47ee
callq 0x2160
movq %rax, %rdi
callq 0x20c0
pushq $0x1
popq %rdi
callq 0x2190
jmp 0x3c61
jmp 0x3c61
jmp 0x3c70
jmp 0x3c61
jmp 0x3c70
jmp 0x3c70
jmp 0x3c70
jmp 0x3c61
jmp 0x3c70
jmp 0x3c70
jmp 0x3c61
jmp 0x3c70
jmp 0x3c61
jmp 0x3c61
jmp 0x3c70
jmp 0x3c70
jmp 0x3c70
jmp 0x3c61
jmp 0x3c61
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20b0
jmp 0x3c73
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2240