// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rdi, %rbx
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4b408(%rip), %rsi     # 0x7a537
leaq 0x4b40b(%rip), %rdx     # 0x7a541
leaq 0xd0(%rsp), %rdi
callq 0xdfa8
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x1cb42
movl %eax, %ebp
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f167
callq 0xa2b0
testb %bpl, %bpl
jne 0x2f38a
leaq 0x6b2e9(%rip), %rax     # 0x9a460
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x2f1a2
movq 0x6ae14(%rip), %rcx     # 0x99fa8
cmpb $0x0, (%rcx)
je 0x2f19e
incl 0x8(%rax)
jmp 0x2f1a2
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x1aab2
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2f1c3
callq 0xdce4
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4b361(%rip), %rsi     # 0x7a537
leaq 0x4b364(%rip), %rdx     # 0x7a541
leaq 0x90(%rsp), %rdi
callq 0xdfa8
leaq 0x4bbe1(%rip), %rdx     # 0x7add2
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4f22e
leaq 0x110(%rsp), %rdi
leaq 0x4b169(%rip), %rdx     # 0x7a37b
leaq 0x18(%rsp), %rsi
callq 0x4f22e
leaq 0x58(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x2, %edx
callq 0x4f06a
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xde0c
leaq 0x4b2e0(%rip), %rsi     # 0x7a542
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xdc11
leaq 0x4b37c(%rip), %rsi     # 0x7a5f7
leaq 0xb0(%rsp), %rdi
callq 0xa560
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2f2b0
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x2f2b8
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %r8
movq %rdx, 0x8(%r8)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x90(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
callq 0x1cb62
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f2fd
callq 0xa2b0
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f313
callq 0xa2b0
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x2f322
callq 0xa2b0
leaq 0x58(%rsp), %rdi
callq 0x4f0ac
movq $-0x80, %rbx
leaq 0x140(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2f349
callq 0xa2b0
movq -0x30(%r15), %rdi
leaq -0x20(%r15), %rax
cmpq %rdi, %rax
je 0x2f35b
callq 0xa2b0
addq $-0x40, %r15
addq $0x40, %rbx
jne 0x2f33b
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f377
callq 0xa2b0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f38a
callq 0xa2b0
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f3b1
callq 0xa2b0
jmp 0x2f3b1
movq %rax, %rbx
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f3cc
callq 0xa2b0
jmp 0x2f3cc
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x2f3e0
callq 0xa2b0
jmp 0x2f3e0
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4f0ac
jmp 0x2f3ef
movq %rax, %rbx
movl $0x40, %r15d
leaq (%rsp,%r15), %rdi
addq $0xd0, %rdi
callq 0x4f040
addq $-0x40, %r15
cmpq $-0x40, %r15
jne 0x2f3f5
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f43d
callq 0xa2b0
jmp 0x2f43d
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x4f040
jmp 0x2f40f
movq %rax, %rbx
jmp 0x2f40f
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2f471
jmp 0x2f47b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2f47b
callq 0xdce4
jmp 0x2f47b
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f47b
callq 0xa2b0
jmp 0x2f47b
movq %rax, %rbx
movq %rbx, %rdi
callq 0xa510