// File: menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgCStr(CppProgram*)
void addToProgCStr(CppProgram * prog)
{
	if (!prog->hasFunc("$cStr"))
	{
		if (prog->hasFunc("$cStr"))
			return;
		
		string strType=prog->getTypeCode(String);
		
		prog->addFunc("$cStr", {{strType, "in"}}, "char *",
			"char * out = (char *)malloc(in._size+1);\n"
			"memcpy(out, in._data, in._size);\n"
			"out[in._size] = 0;\n"
			"return out;\n"
		);
	}
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x230(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x20f(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xb690
movq 0xa8(%rsp), %rdx
leaq 0x85412(%rip), %rsi     # 0xd4945
leaq 0x210(%rsp), %rdi
callq 0xb4c0
jmp 0x4f542
movq 0xa0(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x2a8a0
movb %al, 0x9f(%rsp)
jmp 0x4f560
movb 0x9f(%rsp), %al
xorb $-0x1, %al
movb %al, 0x9e(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xb6e8
leaq 0x20f(%rsp), %rdi
callq 0xb3f0
movb 0x9e(%rsp), %al
testb $0x1, %al
jne 0x4f59a
jmp 0x4faa2
movq 0x230(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xb690
movq 0x90(%rsp), %rdx
leaq 0x85377(%rip), %rsi     # 0xd4945
leaq 0x1d8(%rsp), %rdi
callq 0xb4c0
jmp 0x4f5dd
movq 0x88(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x2a8a0
movb %al, 0x87(%rsp)
jmp 0x4f5fb
leaq 0x1d8(%rsp), %rdi
callq 0xb6e8
leaq 0x1d7(%rsp), %rdi
callq 0xb3f0
movb 0x87(%rsp), %al
testb $0x1, %al
jne 0x4f625
jmp 0x4f6bc
jmp 0x4faa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4f661
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xb6e8
leaq 0x20f(%rsp), %rdi
callq 0xb3f0
jmp 0x4faaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4f6aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0xb6e8
leaq 0x1d7(%rsp), %rdi
callq 0xb3f0
jmp 0x4faaa
movq 0x230(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0xc8e38(%rip), %rsi     # 0x118508
leaq 0x1a0(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x1a920
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x1b0(%rsp), %rdi
callq 0x285b0
jmp 0x4f6fb
leaq 0x1a0(%rsp), %rdi
callq 0x1a950
movq 0x230(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x17f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xb690
movq 0x68(%rsp), %rdx
leaq 0x85212(%rip), %rsi     # 0xd4945
leaq 0x180(%rsp), %rdi
callq 0xb4c0
jmp 0x4f742
leaq 0x110(%rsp), %rdi
movq %rdi, 0x108(%rsp)
leaq 0x82724(%rip), %rdx     # 0xd1e7d
leaq 0x1b0(%rsp), %rsi
callq 0x96110
jmp 0x4f768
leaq 0x110(%rsp), %rax
movq %rax, 0x150(%rsp)
movq $0x1, 0x158(%rsp)
leaq 0x107(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x2f150
movq 0x58(%rsp), %rcx
movq 0x150(%rsp), %rsi
movq 0x158(%rsp), %rdx
leaq 0x160(%rsp), %rdi
callq 0x96080
jmp 0x4f7ba
leaq 0xdf(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xb690
movq 0x50(%rsp), %rdx
leaq 0x8511a(%rip), %rsi     # 0xd48f2
leaq 0xe0(%rsp), %rdi
callq 0xb4c0
jmp 0x4f7e7
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xb690
movq 0x48(%rsp), %rdx
leaq 0x85146(%rip), %rsi     # 0xd494b
leaq 0xb8(%rsp), %rdi
callq 0xb4c0
jmp 0x4f814
movq 0x60(%rsp), %rdi
leaq 0x180(%rsp), %rsi
leaq 0x160(%rsp), %rdx
leaq 0xe0(%rsp), %rcx
leaq 0xb8(%rsp), %r8
callq 0x2a900
jmp 0x4f840
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0xb7(%rsp), %rdi
callq 0xb3f0
leaq 0xe0(%rsp), %rdi
callq 0xb6e8
leaq 0xdf(%rsp), %rdi
callq 0xb3f0
leaq 0x160(%rsp), %rdi
callq 0x2e540
leaq 0x107(%rsp), %rdi
callq 0x33c90
leaq 0x110(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x40, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
addq $-0x40, %rdi
movq %rdi, 0x30(%rsp)
callq 0x2e470
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x4f8a4
leaq 0x180(%rsp), %rdi
callq 0xb6e8
leaq 0x17f(%rsp), %rdi
callq 0xb3f0
leaq 0x1b0(%rsp), %rdi
callq 0xb6e8
jmp 0x4faa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x1a950
jmp 0x4faaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4fa86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
movq 0x108(%rsp), %rax
leaq 0x110(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x4f98e
movq 0x28(%rsp), %rdi
addq $-0x40, %rdi
movq %rdi, 0x20(%rsp)
callq 0x2e470
movq 0x20(%rsp), %rax
leaq 0x110(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x4f964
jmp 0x4fa79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4fa2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4fa13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x4f9f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0xb7(%rsp), %rdi
callq 0xb3f0
leaq 0xe0(%rsp), %rdi
callq 0xb6e8
leaq 0xdf(%rsp), %rdi
callq 0xb3f0
leaq 0x160(%rsp), %rdi
callq 0x2e540
leaq 0x107(%rsp), %rdi
callq 0x33c90
leaq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x40, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x40, %rdi
movq %rdi, 0x8(%rsp)
callq 0x2e470
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x4fa50
jmp 0x4fa79
leaq 0x180(%rsp), %rdi
callq 0xb6e8
leaq 0x17f(%rsp), %rdi
callq 0xb3f0
leaq 0x1b0(%rsp), %rdi
callq 0xb6e8
jmp 0x4faaa
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x200(%rsp), %rdi
callq 0xb680
nopw (%rax,%rax)