// File: menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgConcatStr(CppProgram*)
void addToProgConcatStr(CppProgram * prog)
{
	if (!prog->hasFunc("$concatStr"))
	{
		string strType=prog->getTypeCode(String);
		
		prog->addFunc("$concatStr", {{strType, "a"}, {strType, "b"}}, strType,
			"int newSize = a._size + b._size;\n"
			"unsigned char * newData = (unsigned char *)malloc(newSize);\n"
			"memcpy(newData, a._data, a._size);\n"
			"memcpy(newData + a._size, b._data, b._size);\n"
			"return "+strType+"(newSize, newData);\n"
		);
	}
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rdi, 0x230(%rsp)
movq 0x230(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x20f(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xb690
movq 0x80(%rsp), %rdx
leaq 0x83f33(%rip), %rsi     # 0xd4e63
leaq 0x210(%rsp), %rdi
callq 0xb4c0
jmp 0x50f3f
movq 0x78(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x2a8a0
movb %al, 0x77(%rsp)
jmp 0x50f57
movb 0x77(%rsp), %al
xorb $-0x1, %al
movb %al, 0x76(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xb6e8
leaq 0x20f(%rsp), %rdi
callq 0xb3f0
movb 0x76(%rsp), %al
testb $0x1, %al
jne 0x50f88
jmp 0x513d6
movq 0x230(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0xc756c(%rip), %rsi     # 0x118508
leaq 0x1c8(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x1a920
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x1d8(%rsp), %rdi
callq 0x285b0
jmp 0x50fc7
leaq 0x1c8(%rsp), %rdi
callq 0x1a950
movq 0x230(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x1a7(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xb690
movq 0x58(%rsp), %rdx
leaq 0x83e64(%rip), %rsi     # 0xd4e63
leaq 0x1a8(%rsp), %rdi
callq 0xb4c0
jmp 0x5100e
leaq 0xf8(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
leaq 0x846eb(%rip), %rdx     # 0xd5710
leaq 0x1d8(%rsp), %rsi
callq 0x96390
jmp 0x51034
leaq 0x138(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
leaq 0x83c5c(%rip), %rdx     # 0xd4ca7
leaq 0x1d8(%rsp), %rsi
callq 0x96390
jmp 0x5105a
leaq 0xf8(%rsp), %rax
movq %rax, 0x178(%rsp)
movq $0x2, 0x180(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x2f150
movq 0x48(%rsp), %rcx
movq 0x178(%rsp), %rsi
movq 0x180(%rsp), %rdx
leaq 0x188(%rsp), %rdi
callq 0x96080
jmp 0x510ac
leaq 0xc8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0xb1a0
jmp 0x510c3
leaq 0x83da4(%rip), %rsi     # 0xd4e6e
leaq 0x88(%rsp), %rdi
leaq 0x1d8(%rsp), %rdx
callq 0xfab0
jmp 0x510e1
leaq 0x83e3b(%rip), %rdx     # 0xd4f23
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xfa60
jmp 0x510ff
movq 0x50(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
leaq 0x188(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
leaq 0xa8(%rsp), %r8
callq 0x2a900
jmp 0x5112b
leaq 0xa8(%rsp), %rdi
callq 0xb6e8
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0xc8(%rsp), %rdi
callq 0xb6e8
leaq 0x188(%rsp), %rdi
callq 0x2e540
leaq 0xef(%rsp), %rdi
callq 0x33c90
leaq 0xf8(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x80, %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 0x51184
leaq 0x1a8(%rsp), %rdi
callq 0xb6e8
leaq 0x1a7(%rsp), %rdi
callq 0xb3f0
leaq 0x1d8(%rsp), %rdi
callq 0xb6e8
jmp 0x513d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5120e
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 0x513de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x1a950
jmp 0x513de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x513ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
movq 0xf0(%rsp), %rax
leaq 0xf8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x512b7
movq 0x28(%rsp), %rdi
addq $-0x40, %rdi
movq %rdi, 0x20(%rsp)
callq 0x2e470
movq 0x20(%rsp), %rax
leaq 0xf8(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x5128d
jmp 0x513ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x5135f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x51352
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x51345
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
jmp 0x51338
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x200(%rsp)
movl %eax, 0x1fc(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xb6e8
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0xc8(%rsp), %rdi
callq 0xb6e8
leaq 0x188(%rsp), %rdi
callq 0x2e540
leaq 0xef(%rsp), %rdi
callq 0x33c90
leaq 0xf8(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x80, %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 0x51384
jmp 0x513ad
leaq 0x1a8(%rsp), %rdi
callq 0xb6e8
leaq 0x1a7(%rsp), %rdi
callq 0xb3f0
leaq 0x1d8(%rsp), %rdi
callq 0xb6e8
jmp 0x513de
addq $0x238, %rsp            # imm = 0x238
retq
movq 0x200(%rsp), %rdi
callq 0xb680
nopl (%rax,%rax)