// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/CppProgram.cpp
// Function: CppProgram::declareVar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::shared_ptr<TypeBase>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void CppProgram::declareVar(const string& nameIn, Type typeIn, string initialValue)
{
	/*
	CppNameContainer* names=&*activeFunc->namespaceStack.back();
	
	while (names)
	{
		if (names->hasPpMe(nameIn))
			return;
		
		names=names->getParent();
	}
	*/
	
	if (isMain())
	{
		declareGlobal(nameIn, typeIn, initialValue);
		return;
	}
	
	if (activeFunc->namespaceStack.back()->hasPp(nameIn))
	{
		return;
	}
	
	activeFunc->namespaceStack.back()->addPp(nameIn);
	activeFunc->namespaceStack[0]->reserveCpp(ppToCpp(nameIn), true);
	
	activeFunc->varDeclareSource+=getTypeCode(typeIn)+" "+ppToCpp(nameIn);
	if (!initialValue.empty())
	{
		activeFunc->varDeclareSource+=" = "+initialValue;
	}
	activeFunc->varDeclareSource+=";\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq 0xb8(%rdi), %rax
subq 0xb0(%rdi), %rax
cmpq $0x20, %rax
jne 0x16d3e
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x12c0a
leaq 0xa8(%rsp), %rdi
movq %r14, %rsi
callq 0xa3b0
leaq 0x28(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16f74
leaq 0xa8(%rsp), %rdi
callq 0xa558
leaq 0x30(%rsp), %rdi
callq 0xc984
jmp 0x16eda
movq 0xa0(%rbx), %rax
movq 0xa0(%rax), %rax
movq -0x10(%rax), %rdi
movq %r15, %rsi
callq 0x142a2
testb %al, %al
jne 0x16eda
movq 0xa0(%rbx), %rax
movq 0xa0(%rax), %rax
movq -0x10(%rax), %r13
leaq 0x3db9c(%rip), %rsi     # 0x54915
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0xa150
leaq 0x8(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x13de2
leaq 0x8(%rsp), %rdi
callq 0xa558
movq 0xa0(%rbx), %rax
movq 0x98(%rax), %rax
movq (%rax), %r13
leaq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x184d4
pushq $0x1
popq %rdx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1416a
leaq 0x8(%rsp), %rdi
callq 0xa558
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x12c0a
leaq 0x88(%rsp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x15e88
leaq 0x3dc64(%rip), %rdx     # 0x54a6c
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xc882
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x184d4
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1205e
movq 0xa0(%rbx), %rdi
addq $0x30, %rdi
leaq 0x8(%rsp), %rsi
callq 0xa540
leaq 0x8(%rsp), %rdi
callq 0xa558
leaq 0x68(%rsp), %rdi
callq 0xa558
leaq 0x48(%rsp), %rdi
callq 0xa558
leaq 0x88(%rsp), %rdi
callq 0xa558
leaq 0x40(%rsp), %rdi
callq 0xc984
cmpq $0x0, 0x8(%r14)
je 0x16ec3
leaq 0x40b7c(%rip), %rsi     # 0x57a12
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0xc8a1
movq 0xa0(%rbx), %rdi
addq $0x30, %rdi
movq %r15, %rsi
callq 0xa540
leaq 0x8(%rsp), %rdi
callq 0xa558
movq 0xa0(%rbx), %rdi
addq $0x30, %rdi
leaq 0x408be(%rip), %rsi     # 0x57793
callq 0xa520
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16f39
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa558
jmp 0x16f00
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xa558
jmp 0x16f0f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xa558
jmp 0x16f1e
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xa558
jmp 0x16f30
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x16f67
jmp 0x16f39
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xa558
jmp 0x16f6c
movq %rax, %rbx
jmp 0x16f6c
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xa558
jmp 0x16f62
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc984
movq %rbx, %rdi
callq 0xa500