// File: /workspace/github_cpp_makefile_star2_O1/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), %r15
movq %r15, -0x10(%r15)
leaq 0x4a71e(%rip), %rsi     # 0x79577
leaq 0x4a721(%rip), %rdx     # 0x79581
leaq 0xd0(%rsp), %rdi
callq 0xdf6a
leaq 0xd0(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c806
movl %eax, %ebp
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0x2ee94
callq 0xa2b0
testb %bpl, %bpl
jne 0x2f0b7
leaq 0x6a5bc(%rip), %rax     # 0x99460
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x2eecf
movq 0x6a0e7(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2eecb
incl 0x8(%rax)
jmp 0x2eecf
lock
incl 0x8(%rax)
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x1a7f4
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2eef0
callq 0xdcba
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4a673(%rip), %rsi     # 0x79577
leaq 0x4a676(%rip), %rdx     # 0x79581
leaq 0x90(%rsp), %rdi
callq 0xdf6a
leaq 0x4aef3(%rip), %rdx     # 0x79e12
leaq 0x18(%rsp), %rsi
movq %r14, %r15
movq %r14, %rdi
callq 0x4e466
leaq 0x110(%rsp), %r15
leaq 0x4a47d(%rip), %rdx     # 0x793bb
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x4e466
leaq 0x58(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x2, %edx
callq 0x4e2a2
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xdde2
leaq 0x4a5f1(%rip), %rsi     # 0x79582
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xdbef
leaq 0x4a68d(%rip), %rsi     # 0x79637
leaq 0xb0(%rsp), %rdi
callq 0xa560
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2efde
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x2efe5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
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 0x1c826
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x2f02a
callq 0xa2b0
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f040
callq 0xa2b0
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f04f
callq 0xa2b0
leaq 0x58(%rsp), %rdi
callq 0x4e2e4
movq $-0x80, %rbx
leaq 0x140(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2f076
callq 0xa2b0
movq -0x30(%r14), %rdi
leaq -0x20(%r14), %rax
cmpq %rdi, %rax
je 0x2f088
callq 0xa2b0
addq $-0x40, %r14
addq $0x40, %rbx
jne 0x2f068
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f0a4
callq 0xa2b0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f0b7
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 %r15, %rdi
je 0x2f0de
callq 0xa2b0
jmp 0x2f0de
movq %rax, %rbx
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f0f9
callq 0xa2b0
jmp 0x2f0f9
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f10d
callq 0xa2b0
jmp 0x2f10d
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4e2e4
jmp 0x2f11c
movq %rax, %rbx
movl $0x40, %r14d
leaq (%rsp,%r14), %rdi
addq $0xd0, %rdi
callq 0x4e278
addq $-0x40, %r14
cmpq $-0x40, %r14
jne 0x2f122
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x2f153
callq 0xa2b0
jmp 0x2f153
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2f1aa
jmp 0x2f1b4
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2f1b4
callq 0xdcba
jmp 0x2f1b4
movq %rax, %rbx
cmpq %r15, %r14
je 0x2f13c
leaq 0xd0(%rsp), %r14
addq $-0x40, %r15
movq %r15, %rdi
callq 0x4e278
cmpq %r14, %r15
jne 0x2f187
jmp 0x2f13c
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0x2f1b4
callq 0xa2b0
jmp 0x2f1b4
movq %rax, %rbx
movq %rbx, %rdi
callq 0xa510