// File: menhits[P]phplus/src/CppProgram.cpp
// Function: CppNameContainer::addPp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void CppNameContainer::addPp(const string& pp, const string& cppNameHint)
{
	string validCppHint;
	
	if (cppNameHint=="<- the value of that pp string please")
		validCppHint=getValidCppId(pp);
	else if (!cppNameHint.empty())
		validCppHint=getValidCppId(cppNameHint);
	
	if (ppToCppMap.find(pp)!=ppToCppMap.end())
	{
		throw PhplusError("Tried to add '"+pp+"' as a pp name to a CppNameContainer but that pp name already exists", INTERNAL_ERROR);
	}
	
	// now we need to find a unique C++ name, the Phplus name will almost always be unique, but there may be cases where Phplus treats scope differently or uses a keyword or something
	
	string cpp;
	
	if (validCppHint.empty())
	{
		cpp=getUniqueString(
				"nm",
				[this](string in) -> bool
				{
					return !hasCpp(in);
				},
				true
			);
	}
	else
	{
		cpp=getUniqueString(
				validCppHint,
				[this](string in) -> bool
				{
					return !hasCpp(in);
				},
				false
			);
	}
	
	ppToCppMap[pp]=cpp;
	cppSet.insert(cpp);
}

// Assembly:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
movq %rdx, 0x280(%rsp)
movq 0x290(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x260(%rsp), %rdi
callq 0xb4e0
movq 0x280(%rsp), %rdi
leaq 0xae5dd(%rip), %rsi     # 0xd1915
callq 0x2d740
movb %al, 0x5f(%rsp)
jmp 0x23343
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x23350
jmp 0x233f1
movq 0x288(%rsp), %rsi
leaq 0x210(%rsp), %rdi
callq 0xb1a0
jmp 0x23367
leaq 0x230(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x22dc0
jmp 0x2337e
leaq 0x260(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0xb450
leaq 0x230(%rsp), %rdi
callq 0xb6e8
leaq 0x210(%rsp), %rdi
callq 0xb6e8
jmp 0x2348d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x238bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x210(%rsp), %rdi
callq 0xb6e8
jmp 0x238bb
movq 0x280(%rsp), %rdi
callq 0xb610
testb $0x1, %al
jne 0x2348b
movq 0x280(%rsp), %rsi
leaq 0x1d0(%rsp), %rdi
callq 0xb1a0
jmp 0x2341d
leaq 0x1f0(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x22dc0
jmp 0x23434
leaq 0x260(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0xb450
leaq 0x1f0(%rsp), %rdi
callq 0xb6e8
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
jmp 0x2348b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
jmp 0x238bb
jmp 0x2348d
movq 0x50(%rsp), %rdi
addq $0x38, %rdi
movq 0x288(%rsp), %rsi
callq 0x2d790
movq %rax, 0x48(%rsp)
jmp 0x234aa
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x1c8(%rsp)
addq $0x38, %rdi
callq 0x2d7c0
movq %rax, 0x1c0(%rsp)
leaq 0x1c8(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x2d770
testb $0x1, %al
jne 0x234eb
jmp 0x23619
movb $0x1, 0x16f(%rsp)
movl $0x38, %edi
callq 0xb1f0
movq %rax, 0x40(%rsp)
movq 0x288(%rsp), %rdx
leaq 0xae42a(%rip), %rsi     # 0xd193b
leaq 0x180(%rsp), %rdi
callq 0xfab0
jmp 0x23520
leaq 0xae423(%rip), %rdx     # 0xd194a
leaq 0x1a0(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0xfa60
jmp 0x2353e
xorl %eax, %eax
movl %eax, %esi
leaq 0x170(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xfbe0
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rcx
leaq 0x1a0(%rsp), %rsi
movl $0x3, %edx
callq 0x35600
jmp 0x23572
movq 0x40(%rsp), %rdi
movb $0x0, 0x16f(%rsp)
leaq 0xf2042(%rip), %rsi     # 0x1155c8
leaq -0x8f1d(%rip), %rdx     # 0x1a670
callq 0xb640
jmp 0x238d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x235fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x235f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x170(%rsp), %rdi
callq 0xfc00
leaq 0x1a0(%rsp), %rdi
callq 0xb6e8
leaq 0x180(%rsp), %rdi
callq 0xb6e8
testb $0x1, 0x16f(%rsp)
jne 0x2360a
jmp 0x23614
movq 0x40(%rsp), %rdi
callq 0xb2d0
jmp 0x238bb
leaq 0x148(%rsp), %rdi
callq 0xb4e0
leaq 0x260(%rsp), %rdi
callq 0xb610
testb $0x1, %al
jne 0x2363c
jmp 0x23755
leaq 0x107(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xb690
movq 0x30(%rsp), %rdx
leaq 0xae335(%rip), %rsi     # 0xd198f
leaq 0x108(%rsp), %rdi
callq 0xb4c0
jmp 0x23669
movq 0x50(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0xe0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
leaq 0xd8(%rsp), %rsi
callq 0x238e0
movq 0x28(%rsp), %rdx
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
movl $0x1, %ecx
callq 0xacfd0
jmp 0x236b1
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0xb450
leaq 0x128(%rsp), %rdi
callq 0xb6e8
leaq 0xe0(%rsp), %rdi
callq 0x2d7f0
leaq 0x108(%rsp), %rdi
callq 0xb6e8
leaq 0x107(%rsp), %rdi
callq 0xb3f0
jmp 0x2382c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x23743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x2d7f0
leaq 0x108(%rsp), %rdi
callq 0xb6e8
leaq 0x107(%rsp), %rdi
callq 0xb3f0
jmp 0x238ae
leaq 0x98(%rsp), %rdi
leaq 0x260(%rsp), %rsi
callq 0xb1a0
jmp 0x2376c
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x70(%rsp), %rsi
callq 0x23970
movq 0x20(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
xorl %ecx, %ecx
callq 0xacfd0
jmp 0x237a8
leaq 0x148(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0xb450
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0x78(%rsp), %rdi
callq 0x2d7f0
leaq 0x98(%rsp), %rdi
callq 0xb6e8
jmp 0x2382c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x238ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x2d7f0
leaq 0x98(%rsp), %rdi
callq 0xb6e8
jmp 0x238ae
movq 0x50(%rsp), %rdi
addq $0x38, %rdi
movq 0x288(%rsp), %rsi
callq 0x2d800
movq %rax, 0x18(%rsp)
jmp 0x23849
movq 0x18(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0xb050
jmp 0x2385d
movq 0x50(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2d8f0
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x2387a
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movb %al, 0x68(%rsp)
leaq 0x148(%rsp), %rdi
callq 0xb6e8
leaq 0x260(%rsp), %rdi
callq 0xb6e8
addq $0x298, %rsp            # imm = 0x298
retq
leaq 0x148(%rsp), %rdi
callq 0xb6e8
leaq 0x260(%rsp), %rdi
callq 0xb6e8
movq 0x258(%rsp), %rdi
callq 0xb680
nopw %cs:(%rax,%rax)