// File: 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:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xb690
movq 0x80(%rsp), %rdx
leaq 0x84eb5(%rip), %rsi     # 0xd49b5
leaq 0x250(%rsp), %rdi
callq 0xb4c0
jmp 0x4fb0f
movq 0x78(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x2a8a0
movb %al, 0x77(%rsp)
jmp 0x4fb27
movb 0x77(%rsp), %al
xorb $-0x1, %al
movb %al, 0x76(%rsp)
leaq 0x250(%rsp), %rdi
callq 0xb6e8
leaq 0x24f(%rsp), %rdi
callq 0xb3f0
movb 0x76(%rsp), %al
testb $0x1, %al
jne 0x4fb58
jmp 0x4ffca
movq 0x270(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0xc899c(%rip), %rsi     # 0x118508
leaq 0x208(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x1a920
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x218(%rsp), %rdi
callq 0x285b0
jmp 0x4fb97
leaq 0x208(%rsp), %rdi
callq 0x1a950
movq 0x270(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xb690
movq 0x58(%rsp), %rdx
leaq 0x84de6(%rip), %rsi     # 0xd49b5
leaq 0x1e8(%rsp), %rdi
callq 0xb4c0
jmp 0x4fbde
leaq 0xf8(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
leaq 0x82288(%rip), %rdx     # 0xd1e7d
leaq 0x218(%rsp), %rsi
callq 0x96110
jmp 0x4fc04
leaq 0x138(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
leaq 0x81fca(%rip), %rsi     # 0xd1be5
leaq 0x85aee(%rip), %rdx     # 0xd5710
callq 0x961b0
jmp 0x4fc29
leaq 0x178(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
leaq 0x81fa5(%rip), %rsi     # 0xd1be5
leaq 0x85060(%rip), %rdx     # 0xd4ca7
callq 0x961b0
jmp 0x4fc4e
leaq 0xf8(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq $0x3, 0x1c0(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x2f150
movq 0x48(%rsp), %rcx
movq 0x1b8(%rsp), %rsi
movq 0x1c0(%rsp), %rdx
leaq 0x1c8(%rsp), %rdi
callq 0x96080
jmp 0x4fca0
leaq 0xc8(%rsp), %rdi
leaq 0x218(%rsp), %rsi
callq 0xb1a0
jmp 0x4fcb7
leaq 0x84cff(%rip), %rsi     # 0xd49bd
leaq 0x88(%rsp), %rdi
leaq 0x218(%rsp), %rdx
callq 0xfab0
jmp 0x4fcd5
leaq 0x84d53(%rip), %rdx     # 0xd4a2f
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xfa60
jmp 0x4fcf3
movq 0x50(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
leaq 0x1c8(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
leaq 0xa8(%rsp), %r8
callq 0x2a900
jmp 0x4fd1f
leaq 0xa8(%rsp), %rdi
callq 0xb6e8
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0xc8(%rsp), %rdi
callq 0xb6e8
leaq 0x1c8(%rsp), %rdi
callq 0x2e540
leaq 0xef(%rsp), %rdi
callq 0x33c90
leaq 0xf8(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0xc0, %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 0x4fd78
leaq 0x1e8(%rsp), %rdi
callq 0xb6e8
leaq 0x1e7(%rsp), %rdi
callq 0xb3f0
leaq 0x218(%rsp), %rdi
callq 0xb6e8
jmp 0x4ffca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4fe02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x250(%rsp), %rdi
callq 0xb6e8
leaq 0x24f(%rsp), %rdi
callq 0xb3f0
jmp 0x4ffd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x208(%rsp), %rdi
callq 0x1a950
jmp 0x4ffd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4ffae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
movq 0xf0(%rsp), %rax
leaq 0xf8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x4feab
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 0x4fe81
jmp 0x4ffa1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4ff53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4ff46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4ff39
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x4ff2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0xb6e8
leaq 0x88(%rsp), %rdi
callq 0xb6e8
leaq 0xc8(%rsp), %rdi
callq 0xb6e8
leaq 0x1c8(%rsp), %rdi
callq 0x2e540
leaq 0xef(%rsp), %rdi
callq 0x33c90
leaq 0xf8(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0xc0, %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 0x4ff78
jmp 0x4ffa1
leaq 0x1e8(%rsp), %rdi
callq 0xb6e8
leaq 0x1e7(%rsp), %rdi
callq 0xb3f0
leaq 0x218(%rsp), %rdi
callq 0xb6e8
jmp 0x4ffd2
addq $0x278, %rsp            # imm = 0x278
retq
movq 0x240(%rsp), %rdi
callq 0xb680
nop