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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rbx
leaq 0xe0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4aebf(%rip), %rsi     # 0x790c9
leaq 0x4aebf(%rip), %rdx     # 0x790d0
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 0x2e245
callq 0xa2b0
testb %bpl, %bpl
jne 0x2e488
leaq 0x6b20b(%rip), %rax     # 0x99460
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x2e280
movq 0x6ad36(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2e27c
incl 0x8(%rax)
jmp 0x2e280
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 0x2e2a1
callq 0xdcba
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4ae14(%rip), %rsi     # 0x790c9
leaq 0x4ae14(%rip), %rdx     # 0x790d0
leaq 0x90(%rsp), %rdi
callq 0xdf6a
leaq 0x48bdd(%rip), %rdx     # 0x76ead
leaq 0x18(%rsp), %rsi
movq %r14, %r15
movq %r14, %rdi
callq 0x4e30c
leaq 0x110(%rsp), %r15
leaq 0x48926(%rip), %rsi     # 0x76c15
leaq 0x4bb1c(%rip), %rdx     # 0x79e12
movq %r15, %rdi
callq 0x4e37a
leaq 0x150(%rsp), %r15
leaq 0x48908(%rip), %rsi     # 0x76c15
leaq 0x4b0a7(%rip), %rdx     # 0x793bb
movq %r15, %rdi
callq 0x4e37a
leaq 0x58(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x3, %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 0x4ad6f(%rip), %rsi     # 0x790d1
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xdbef
leaq 0x4adc8(%rip), %rsi     # 0x79143
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 0x2e3af
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x2e3b6
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 0x2e3fb
callq 0xa2b0
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e411
callq 0xa2b0
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e420
callq 0xa2b0
leaq 0x58(%rsp), %rdi
callq 0x4e2e4
movq $-0xc0, %rbx
leaq 0x180(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2e447
callq 0xa2b0
movq -0x30(%r14), %rdi
leaq -0x20(%r14), %rax
cmpq %rdi, %rax
je 0x2e459
callq 0xa2b0
addq $-0x40, %r14
addq $0x40, %rbx
jne 0x2e439
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e475
callq 0xa2b0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e488
callq 0xa2b0
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x2e4af
callq 0xa2b0
jmp 0x2e4af
movq %rax, %rbx
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e4ca
callq 0xa2b0
jmp 0x2e4ca
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e4de
callq 0xa2b0
jmp 0x2e4de
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4e2e4
jmp 0x2e4ed
movq %rax, %rbx
movl $0x80, %r14d
leaq (%rsp,%r14), %rdi
addq $0xd0, %rdi
callq 0x4e278
addq $-0x40, %r14
cmpq $-0x40, %r14
jne 0x2e4f3
jmp 0x2e560
movq %rax, %rbx
jmp 0x2e572
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2e585
callq 0xdcba
jmp 0x2e585
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
jne 0x2e580
jmp 0x2e585
movq %rax, %rbx
jmp 0x2e585
movq %rax, %rbx
cmpq %r15, %r14
je 0x2e560
leaq 0xd0(%rsp), %r14
addq $-0x40, %r15
movq %r15, %rdi
callq 0x4e278
cmpq %r14, %r15
jne 0x2e54f
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x2e572
callq 0xa2b0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e585
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510