// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4b13f(%rip), %rsi     # 0x79059
leaq 0x4b13d(%rip), %rdx     # 0x7905e
leaq 0x20(%rsp), %rdi
callq 0xdf6a
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x1c806
movl %eax, %ebp
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2df49
callq 0xa2b0
testb %bpl, %bpl
jne 0x2e126
leaq 0x20(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x4b0f8(%rip), %rsi     # 0x79059
leaq 0x4b0f6(%rip), %rdx     # 0x7905e
callq 0xdf6a
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x1c806
movl %eax, %ebp
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2df8b
callq 0xa2b0
testb %bpl, %bpl
jne 0x2e126
leaq 0x6b4c5(%rip), %rax     # 0x99460
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x2dfc6
movq 0x6aff0(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2dfc2
incl 0x8(%rax)
jmp 0x2dfc6
lock
incl 0x8(%rax)
leaq 0xd8(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %rbx, %rsi
callq 0x1a7f4
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2dfea
callq 0xdcba
leaq 0xc8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4b05c(%rip), %rsi     # 0x79059
leaq 0x4b05a(%rip), %rdx     # 0x7905e
leaq 0xb8(%rsp), %rdi
callq 0xdf6a
leaq 0x48e95(%rip), %rdx     # 0x76ead
leaq 0x20(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x4e30c
leaq 0x60(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x4e2a2
leaq 0xa8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4afaf(%rip), %rsi     # 0x79006
leaq 0x4afae(%rip), %rdx     # 0x7900c
leaq 0x98(%rsp), %rdi
callq 0xdf6a
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4afe1(%rip), %rsi     # 0x7905f
leaq 0x4b043(%rip), %rdx     # 0x790c8
leaq 0x78(%rsp), %rdi
callq 0xdf6a
leaq 0xb8(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x98(%rsp), %rcx
leaq 0x78(%rsp), %r8
movq %rbx, %rdi
callq 0x1c826
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e0c0
callq 0xa2b0
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e0d2
callq 0xa2b0
leaq 0x60(%rsp), %rdi
callq 0x4e2e4
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e0ef
callq 0xa2b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e0fe
callq 0xa2b0
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e110
callq 0xa2b0
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e126
callq 0xa2b0
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e14f
callq 0xa2b0
jmp 0x2e14f
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e166
callq 0xa2b0
jmp 0x2e166
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x4e2e4
jmp 0x2e175
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4e278
jmp 0x2e184
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e19b
callq 0xa2b0
jmp 0x2e19b
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2e1d3
jmp 0x2e1dd
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x2e1dd
callq 0xdcba
jmp 0x2e1dd
jmp 0x2e1c6
jmp 0x2e1da
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e1dd
callq 0xa2b0
jmp 0x2e1dd
movq %rax, %rbx
movq %rbx, %rdi
callq 0xa510