// File: menhits[P]phplus/src/PhplusStdLib.cpp
// Function: addToProgStrWithEscapedNames(CppProgram*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void addToProgStrWithEscapedNames(CppProgram * prog, string str)
{
	int i=0;
	string buffer = "";
	
	while (i < (int)str.size())
	{
		if (str[i] == '$')
		{
			i++;
			prog->code(buffer);
			buffer = "";
			while (i < (int)str.size())
			{
				char c = str[i];
				
				if (!(
					(c >= '0' && c <= '9') ||
					(c >= 'a' && c <= 'z') ||
					(c >= 'A' && c <= 'Z')
				)) break;
				
				buffer += c;
				i++;
			}
			if (buffer.empty())
				prog->code("$");
			else
				prog->name(buffer);
			buffer = "";
		}
		else
		{
			buffer += str[i];
			i++;
		}
	}
	
	prog->code(buffer);
}

// Assembly:
subq $0xc8, %rsp
movq %rsi, 0x40(%rsp)
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movl $0x0, 0xb4(%rsp)
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xb690
movq 0x48(%rsp), %rdx
leaq 0x7dcda(%rip), %rsi     # 0xd1a1f
leaq 0x90(%rsp), %rdi
callq 0xb4c0
jmp 0x53d54
leaq 0x8f(%rsp), %rdi
callq 0xb3f0
movq 0x40(%rsp), %rdi
movl 0xb4(%rsp), %eax
movl %eax, 0x3c(%rsp)
callq 0xb2a0
movq %rax, %rcx
movl 0x3c(%rsp), %eax
cmpl %ecx, %eax
jge 0x53ffc
movq 0x40(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0xb6d0
movq %rax, 0x30(%rsp)
jmp 0x53d9e
movq 0x30(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x24, %eax
jne 0x53fb6
movl 0xb4(%rsp), %eax
incl %eax
movl %eax, 0xb4(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x96750
jmp 0x53dd6
leaq 0x7dc42(%rip), %rsi     # 0xd1a1f
leaq 0x90(%rsp), %rdi
callq 0xb4b0
jmp 0x53dec
jmp 0x53dee
movq 0x40(%rsp), %rdi
movl 0xb4(%rsp), %eax
movl %eax, 0x2c(%rsp)
callq 0xb2a0
movq %rax, %rcx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jge 0x53ed7
movq 0x40(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0xb6d0
movq %rax, 0x20(%rsp)
jmp 0x53e2b
movq 0x20(%rsp), %rax
movb (%rax), %al
movb %al, 0x7b(%rsp)
movsbl 0x7b(%rsp), %eax
cmpl $0x30, %eax
jl 0x53e4a
movsbl 0x7b(%rsp), %eax
cmpl $0x39, %eax
jle 0x53ead
movsbl 0x7b(%rsp), %eax
cmpl $0x61, %eax
jl 0x53e5e
movsbl 0x7b(%rsp), %eax
cmpl $0x7a, %eax
jle 0x53ead
movsbl 0x7b(%rsp), %eax
cmpl $0x41, %eax
jl 0x53e72
movsbl 0x7b(%rsp), %eax
cmpl $0x5a, %eax
jle 0x53ead
jmp 0x53ed7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x8f(%rsp), %rdi
callq 0xb3f0
jmp 0x54035
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x54028
movsbl 0x7b(%rsp), %esi
leaq 0x90(%rsp), %rdi
callq 0xb260
jmp 0x53ec1
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x53dee
leaq 0x90(%rsp), %rdi
callq 0xb610
testb $0x1, %al
jne 0x53eed
jmp 0x53f85
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x57(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xb690
movq 0x18(%rsp), %rdx
leaq 0x81747(%rip), %rsi     # 0xd565c
leaq 0x58(%rsp), %rdi
callq 0xb4c0
jmp 0x53f21
movq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x96750
jmp 0x53f32
leaq 0x58(%rsp), %rdi
callq 0xb6e8
leaq 0x57(%rsp), %rdi
callq 0xb3f0
jmp 0x53f9e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x53f76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xb6e8
leaq 0x57(%rsp), %rdi
callq 0xb3f0
jmp 0x54028
movq 0xc0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x96790
jmp 0x53f9c
jmp 0x53f9e
leaq 0x7da7a(%rip), %rsi     # 0xd1a1f
leaq 0x90(%rsp), %rdi
callq 0xb4b0
jmp 0x53fb4
jmp 0x53ff7
movq 0x40(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0xb6d0
movq %rax, 0x8(%rsp)
jmp 0x53fcf
movq 0x8(%rsp), %rax
movsbl (%rax), %esi
leaq 0x90(%rsp), %rdi
callq 0xb260
jmp 0x53fe6
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x53d61
movq 0xc0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x96750
jmp 0x54013
leaq 0x90(%rsp), %rdi
callq 0xb6e8
addq $0xc8, %rsp
retq
leaq 0x90(%rsp), %rdi
callq 0xb6e8
movq 0x80(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)