// File: /workspace/github_cpp_makefile_star2_O1/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 0x151e(%rip), %rsi      # 0x5829
movq %r14, %rdi
movl $0x10, %edx
callq 0x2050
leaq 0x90(%rsp), %rdi
callq 0x2080
testb %al, %al
je 0x4787
leaq 0x1536(%rip), %rsi      # 0x586a
leaq 0x20(%rsp), %rdi
movl $0x4, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3bb0
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 0x43a6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x14c2(%rip), %rsi      # 0x586f
leaq 0x20(%rsp), %rdi
movl $0x5, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3cc2
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 0x441a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x1454(%rip), %rsi      # 0x5875
leaq 0x20(%rsp), %rdi
movl $0x4, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3bd2
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 0x448e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c56
testb %al, %al
je 0x4510
leaq 0x13d9(%rip), %rsi      # 0x587a
leaq 0x20(%rsp), %rdi
movl $0x9, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3c6e
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 0x4554
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x4554
leaq 0x1363(%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 0x3c5e
testb %al, %al
je 0x45d6
leaq 0x131d(%rip), %rsi      # 0x5884
leaq 0x20(%rsp), %rdi
movl $0x15, %edx
callq 0x21b0
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3c98
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 0x461a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x461a
leaq 0x12a7(%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 0x481c
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x464b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c4e
testb %al, %al
je 0x4688
movq %rsp, %rdi
callq 0x48c4
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x4688
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c3e
testb %al, %al
je 0x46c5
movq %rsp, %rdi
callq 0x493f
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x46c5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rbx, %rdi
callq 0x3c46
testb %al, %al
je 0x470d
movq %rbx, %rdi
callq 0x3c3e
movzbl %al, %esi
movq %rsp, %rdi
callq 0x49c9
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x470d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
movq %rsp, %rdi
callq 0x4a96
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x21b0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x473e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
leaq 0x20(%rsp), %rdi
callq 0x2200
movq 0x3879(%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 0x3842(%rip), %rdi      # 0x7fd0
leaq 0x109d(%rip), %rsi      # 0x5832
movl $0x37, %edx
callq 0x21b0
movq 0x382a(%rip), %rdi      # 0x7fd0
callq 0x20e0
movl $0x1, %edi
callq 0x21d0
jmp 0x47d9
jmp 0x47d9
jmp 0x4807
jmp 0x47d9
jmp 0x4807
jmp 0x4807
jmp 0x4807
jmp 0x47d9
jmp 0x4807
jmp 0x4807
jmp 0x47d9
jmp 0x4807
jmp 0x4807
jmp 0x4807
jmp 0x4807
jmp 0x47d9
jmp 0x47d9
jmp 0x47d9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x47f8
jmp 0x480a
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x480a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2190
jmp 0x480a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x2290