// File: /workspace/github_cpp_makefile_star2_O3/menhits[P]phplus/src/CppProgram.cpp
// Function: CppProgram::getCppCode[abi:cxx11]()
string CppProgram::getCppCode()
{
	string out;
	
	if (!globalTopCode.empty())
		out+=globalTopCode+"\n";
	
	if (!globalIncludesCode.empty())
		out+=globalIncludesCode+"\n";
	
	if (!globalTypesCode.empty())
		out+=globalTypesCode+"\n";
	
	if (funcs.size()>1)
	{
		for (auto i: funcs)
		{
			if (i.first!="main")
				out+=i.second->getPrototype()+";\n";
		}
		
		out+="\n";
	}
	
	if (!globalVarCode.empty())
		out+=globalVarCode+"\n";
	
	for (auto i: funcs)
	{
		out+=i.second->getPrototype();
		
		string funcSrc=i.second->getSource();
		
		if (funcSrc.size()<2)
		{
			out+="\n{\n\t// empty function\n}\n\n";
		}
		else
		{
			if (i.second->getIfReturnsVal() && funcSrc[0]!='{' && searchInString(funcSrc, ";")==int(funcSrc.size())-2)
				funcSrc="return "+funcSrc;
			out+="\n{\n";
			if (!i.second->varDeclareSource.empty())
				out+=indentString(i.second->varDeclareSource+"\n", indent);
			out+=indentString(funcSrc, indent);
			if (!out.empty() && out.back()!='\n')
				out+=";\n";
			//if (i.first=="main")
			//	out+=indentString("return 0;\n", indent);
			//if (out.substr(out.size()-2, 2)!=";\n")
			//	out+=";\n";
			out+="}\n\n";
		}
	}
	
	out+=
"int main(int argcIn, char** argvIn)\n\
{\n\
	argc = argcIn;\n\
	argv = argvIn;\n\
	if (argc >= 2 && strcmp(argv[1], \"--running-from-Phplus\") == 0)\n\
	{\n\
		argc -= 2;\n\
		if (argc == 0)\n\
			argv = 0;\n\
		else\n\
			argv += 2;\n\
	}\n\
	_main();\n\
	return 0;\n\
}\n";
	
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %r14
leaq 0x10(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, (%rsp)
movb $0x0, 0x10(%rdi)
movq 0x28(%rsi), %rdx
testq %rdx, %rdx
je 0x1dbe2
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%r14), %rsi
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xde0c
leaq 0x5a372(%rip), %rsi     # 0x77f28
leaq 0x10(%rsp), %rdi
callq 0xa560
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1dbe2
callq 0xa2b0
movq 0x48(%r14), %rdx
testq %rdx, %rdx
je 0x1dc38
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%r14), %rsi
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xde0c
leaq 0x5a31c(%rip), %rsi     # 0x77f28
leaq 0x10(%rsp), %rdi
callq 0xa560
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1dc38
callq 0xa2b0
movq 0x88(%r14), %rdx
testq %rdx, %rdx
je 0x1dc94
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x80(%r14), %rsi
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xde0c
leaq 0x5a2c0(%rip), %rsi     # 0x77f28
leaq 0x10(%rsp), %rdi
callq 0xa560
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1dc94
callq 0xa2b0
cmpq $0x2, 0xf0(%r14)
jb 0x1dddb
movq 0xe0(%r14), %r15
leaq 0xd0(%r14), %r13
cmpq %r13, %r15
je 0x1ddcb
leaq 0x70(%rsp), %rbp
leaq 0x10(%rsp), %r12
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x1e7a6
movq %r12, %rdi
leaq 0x5a104(%rip), %rsi     # 0x77ddd
callq 0xa0e0
testl %eax, %eax
je 0x1dd94
movq 0x30(%rsp), %rax
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq 0x70(%rax), %rsi
movq 0x78(%rax), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0xde0c
movq %rbx, %rdi
leaq 0x5c9a5(%rip), %rsi     # 0x7a6bc
callq 0xa560
movq %rbp, 0x60(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1dd3f
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x1dd46
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x68(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1dd80
callq 0xa2b0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1dd94
callq 0xa2b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1dda3
callq 0xdce4
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1ddb7
callq 0xa2b0
movq %r15, %rdi
callq 0xa210
movq %rax, %r15
cmpq %r13, %rax
jne 0x1dcc3
leaq 0x5a156(%rip), %rsi     # 0x77f28
movq (%rsp), %rdi
callq 0xa560
movq 0x68(%r14), %rdx
testq %rdx, %rdx
je 0x1de31
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x60(%r14), %rsi
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xde0c
leaq 0x5a123(%rip), %rsi     # 0x77f28
leaq 0x10(%rsp), %rdi
callq 0xa560
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1de31
callq 0xa2b0
movq 0xe0(%r14), %r15
leaq 0xd0(%r14), %rax
movq %rax, 0xa0(%rsp)
cmpq %rax, %r15
je 0x1e1a1
leaq 0x60(%rsp), %r12
leaq 0x40(%rsp), %r13
leaq 0x20(%r15), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1e7a6
movq 0x30(%rsp), %rax
leaq 0x70(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq 0x70(%rax), %rsi
movq 0x78(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xde0c
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1deb1
callq 0xa2b0
movq 0x30(%rsp), %rax
leaq 0x70(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xde0c
cmpq $0x2, 0x68(%rsp)
leaq 0x5a030(%rip), %rsi     # 0x77f10
jb 0x1e148
movq 0x30(%rsp), %rax
cmpb $0x1, 0x90(%rax)
jne 0x1df95
movq 0x60(%rsp), %rax
cmpb $0x7b, (%rax)
je 0x1df95
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %r13, %rdi
leaq 0x5d7d0(%rip), %rsi     # 0x7b6ea
leaq 0x5d7ca(%rip), %rdx     # 0x7b6eb
callq 0xdfa8
movq %r13, %rsi
movq %r14, %rbx
movq %r12, %rbp
movq %r12, %rdi
xorl %edx, %edx
callq 0x5abd1
movl %eax, %r12d
movl 0x68(%rsp), %r14d
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1df55
callq 0xa2b0
addl $-0x2, %r14d
cmpl %r14d, %r12d
movq %rbx, %r14
movq %rbp, %r12
jne 0x1df95
movq %r13, %rdi
leaq 0x5c8f4(%rip), %rsi     # 0x7a862
movq %r12, %rdx
callq 0xdc11
movq %r12, %rdi
movq %r13, %rsi
callq 0xa370
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1df95
callq 0xa2b0
movq (%rsp), %rdi
leaq 0x59e5f(%rip), %rsi     # 0x77dff
callq 0xa560
movq 0x30(%rsp), %rax
movq 0x38(%rax), %rdx
testq %rdx, %rdx
je 0x1e08a
leaq 0x90(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movq 0x30(%rax), %rsi
addq %rsi, %rdx
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0xde0c
movq %rbx, %rdi
leaq 0x59f40(%rip), %rsi     # 0x77f28
callq 0xa560
leaq 0xd8(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
callq 0xde0c
movq %r13, %rdi
leaq 0x80(%rsp), %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x5ae1f
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1e056
callq 0xa2b0
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x1e070
callq 0xa2b0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x1e08a
callq 0xa2b0
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0xde0c
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x5ae1f
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq (%rsp), %rdi
callq 0xa110
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1e0ee
callq 0xa2b0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1e108
callq 0xa2b0
movq (%rsp), %rax
movq 0x8(%rax), %rax
leaq 0x59e0f(%rip), %rsi     # 0x77f26
testq %rax, %rax
je 0x1e148
movq (%rsp), %rcx
movq (%rcx), %rcx
cmpb $0xa, -0x1(%rcx,%rax)
leaq 0x59df7(%rip), %rsi     # 0x77f26
je 0x1e148
movq (%rsp), %rdi
leaq 0x5c580(%rip), %rsi     # 0x7a6bc
callq 0xa560
leaq 0x59dde(%rip), %rsi     # 0x77f26
movq (%rsp), %rdi
callq 0xa560
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1e165
callq 0xa2b0
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1e174
callq 0xdce4
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e188
callq 0xa2b0
movq %r15, %rdi
callq 0xa210
movq %rax, %r15
cmpq 0xa0(%rsp), %rax
jne 0x1de5a
leaq 0x59d82(%rip), %rsi     # 0x77f2a
movq (%rsp), %rdi
callq 0xa560
movq (%rsp), %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e1e4
jmp 0x1e1e4
jmp 0x1e2f1
jmp 0x1e1e4
jmp 0x1e1e4
jmp 0x1e1e4
jmp 0x1e2f1
jmp 0x1e1e4
jmp 0x1e1e4
jmp 0x1e2f1
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e2f4
callq 0xa2b0
jmp 0x1e2f4
jmp 0x1e2f1
jmp 0x1e304
jmp 0x1e2f1
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
jmp 0x1e2e3
jmp 0x1e304
jmp 0x1e264
jmp 0x1e304
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1e248
callq 0xa2b0
jmp 0x1e248
movq %rax, %r14
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x1e267
callq 0xa2b0
jmp 0x1e267
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
jmp 0x1e2e3
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e295
callq 0xa2b0
jmp 0x1e295
movq %rax, %r14
jmp 0x1e2a9
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1e2a9
callq 0xa2b0
leaq 0x10(%rsp), %rdi
callq 0x1e7f8
jmp 0x1e2f4
jmp 0x1e304
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1e2d3
callq 0xa2b0
jmp 0x1e2d3
movq %rax, %r14
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1e307
callq 0xa2b0
jmp 0x1e307
jmp 0x1e2f1
movq %rax, %r14
movq 0x8(%rsp), %r15
jmp 0x1e32a
jmp 0x1e2ff
jmp 0x1e304
movq %rax, %r14
jmp 0x1e31b
movq %rax, %r14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1e31b
callq 0xa2b0
movq 0x8(%rsp), %r15
leaq 0x10(%rsp), %rdi
callq 0x1e7f8
movq (%rsp), %rax
movq (%rax), %rdi
cmpq %r15, %rdi
je 0x1e33b
callq 0xa2b0
movq %r14, %rdi
callq 0xa510
nop