// File: menhits[P]phplus/src/PhplusStdLib.cpp
// Function: int getValFromTuple<int>(void*, std::shared_ptr<TypeBase>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline T getValFromTuple(void* data, Type type, string name)
{
	while (type->getType()==TypeBase::PTR)
	{
		type=type->getSubType();
		data=*(void**)data;
	}
	
	OffsetAndType a=type->getSubType(name);
	
	if (!a.type)
		throw PhplusError("tried to get invalid property '"+name+"' from type "+type->getString(), INTERNAL_ERROR);
		
	return *((T*)((char*)data+a.offset));
}

// Assembly:
subq $0x148, %rsp            # imm = 0x148
movq %rsi, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
movq %rdi, 0x140(%rsp)
movq %rsi, 0x138(%rsp)
movq %rdx, 0x130(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1a660
movq %rax, %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x5, %eax
jne 0x98b40
movq 0x30(%rsp), %rdi
callq 0x1a660
movq %rax, %rsi
movq (%rsi), %rax
leaq 0x120(%rsp), %rdi
callq *0x48(%rax)
movq 0x30(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x1bae0
leaq 0x120(%rsp), %rdi
callq 0x1a950
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x140(%rsp)
jmp 0x98ad9
movq 0x30(%rsp), %rdi
callq 0x1a660
movq 0x38(%rsp), %rsi
movq %rax, 0x20(%rsp)
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xb1a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq (%rsi), %rax
movq 0x50(%rax), %rax
leaq 0x108(%rsp), %rdi
callq *%rax
jmp 0x98b83
leaq 0xe8(%rsp), %rdi
callq 0xb6e8
leaq 0x108(%rsp), %rdi
addq $0x8, %rdi
callq 0x1d820
testb $0x1, %al
jne 0x98d6b
movb $0x1, 0x47(%rsp)
movl $0x38, %edi
callq 0xb1f0
movq 0x38(%rsp), %rdx
movq %rax, 0x18(%rsp)
leaq 0x3caf4(%rip), %rsi     # 0xd56bd
leaq 0x78(%rsp), %rdi
callq 0xfab0
jmp 0x98bd5
leaq 0x3cac3(%rip), %rdx     # 0xd569f
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xfa60
jmp 0x98bf0
movq 0x30(%rsp), %rdi
callq 0x1a660
movq %rax, %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq 0x58(%rsp), %rdi
callq *%rax
jmp 0x98c0d
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x1bf20
jmp 0x98c29
xorl %eax, %eax
movl %eax, %esi
leaq 0x48(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xfbe0
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rcx
leaq 0xb8(%rsp), %rsi
movl $0x3, %edx
callq 0x35600
jmp 0x98c5a
movq 0x18(%rsp), %rdi
movb $0x0, 0x47(%rsp)
leaq 0x7c95d(%rip), %rsi     # 0x1155c8
leaq -0x7e602(%rip), %rdx    # 0x1a670
callq 0xb640
jmp 0x98da8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0xb6e8
jmp 0x98d9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x98d49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x98d3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x98d32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
jmp 0x98d28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe0(%rsp)
movl %eax, 0xdc(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xfc00
leaq 0xb8(%rsp), %rdi
callq 0xb6e8
leaq 0x58(%rsp), %rdi
callq 0xb6e8
leaq 0x98(%rsp), %rdi
callq 0xb6e8
leaq 0x78(%rsp), %rdi
callq 0xb6e8
testb $0x1, 0x47(%rsp)
jne 0x98d52
jmp 0x98d5c
movq 0x18(%rsp), %rdi
callq 0xb2d0
leaq 0x108(%rsp), %rdi
callq 0x3eec0
jmp 0x98d9b
movq 0x140(%rsp), %rax
movq 0x108(%rsp), %rcx
movl (%rax,%rcx), %eax
movl %eax, 0xc(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x3eec0
movl 0xc(%rsp), %eax
addq $0x148, %rsp            # imm = 0x148
retq
movq 0xe0(%rsp), %rdi
callq 0xb680
nopl (%rax,%rax)