// File: menhits[P]phplus/src/PhplusStdLib.cpp
// Function: populateTypeInfoFuncs()
void populateTypeInfoFuncs()
{
	globalNamespace->addNode(
		AstWhatevToActionFactory::make(
			[](Type leftType, Type rightType) -> Action
			{
				if (leftType->isVoid() || !rightType->isVoid())
					return nullptr;
				
				string val=leftType->getName();
				
				return lambdaAction(
					leftType,
					rightType,
					String,
					
					[=](void* leftIn, void* rightIn) -> void*
					{
						return cppStr2PncnStr(val);
					},
					
					[=](Action inLeft, Action inRight, CppProgram* prog)
					{
						void* ppStr=cppStr2PncnStr(val);
						constGetAction(ppStr, String, val, globalNamespace)->addToProg(prog);
						free(ppStr);
					},
					"typeName"
				);
			}
		),
		"typeName"
	);
	
	globalNamespace->addNode(
		AstWhatevToActionFactory::make(
			[](Type leftType, Type rightType) -> Action
			{
				if (leftType->isVoid() || !rightType->isVoid())
					return nullptr;
				
				int val=leftType->getSize();
				
				return lambdaAction(
					leftType,
					rightType,
					Int,
					
					[=](void* leftIn, void* rightIn) -> void*
					{
						return &(*(int*)malloc(sizeof(int))=val);
					},
					
					[=](Action inLeft, Action inRight, CppProgram* prog)
					{
						constGetAction(&val, Int, to_string(val), globalNamespace)->addToProg(prog);
					},
					"typeSize"
				);
			}
		),
		"typeSize"
	);
}

// Assembly:
subq $0xf8, %rsp
leaq 0xb94da(%rip), %rdi     # 0x118428
callq 0x1a6a0
movq %rax, 0x28(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
leaq 0xcf(%rsp), %rsi
callq 0x5f1a0
movq 0x30(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x96f70
jmp 0x5ef86
leaq 0x97(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb690
movq 0x20(%rsp), %rdx
leaq 0x765e3(%rip), %rsi     # 0xd5587
leaq 0x98(%rsp), %rdi
callq 0xb4c0
jmp 0x5efb3
movq 0x28(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x3b150
jmp 0x5efcf
leaq 0x98(%rsp), %rdi
callq 0xb6e8
leaq 0x97(%rsp), %rdi
callq 0xb3f0
leaq 0xf0(%rsp), %rdi
callq 0x1b3f0
leaq 0xd0(%rsp), %rdi
callq 0x97050
leaq 0xb941e(%rip), %rdi     # 0x118428
callq 0x1a6a0
movq %rax, 0x10(%rsp)
leaq 0x68(%rsp), %rdi
movq %rdi, 0x18(%rsp)
leaq 0x67(%rsp), %rsi
callq 0x5f230
movq 0x18(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x96f70
jmp 0x5f03c
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xb690
movq 0x8(%rsp), %rdx
leaq 0x76539(%rip), %rsi     # 0xd5590
leaq 0x40(%rsp), %rdi
callq 0xb4c0
jmp 0x5f063
movq 0x10(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x3b150
jmp 0x5f07c
leaq 0x40(%rsp), %rdi
callq 0xb6e8
leaq 0x3f(%rsp), %rdi
callq 0xb3f0
leaq 0x88(%rsp), %rdi
callq 0x1b3f0
leaq 0x68(%rsp), %rdi
callq 0x97050
addq $0xf8, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x5f116
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x5f0fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x98(%rsp), %rdi
callq 0xb6e8
leaq 0x97(%rsp), %rdi
callq 0xb3f0
leaq 0xf0(%rsp), %rdi
callq 0x1b3f0
leaq 0xd0(%rsp), %rdi
callq 0x97050
jmp 0x5f190
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x5f186
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x5f16f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xb6e8
leaq 0x3f(%rsp), %rdi
callq 0xb3f0
leaq 0x88(%rsp), %rdi
callq 0x1b3f0
leaq 0x68(%rsp), %rdi
callq 0x97050
movq 0xc0(%rsp), %rdi
callq 0xb680
nopl (%rax)