// File: /workspace/github_cpp_makefile_star2_O2/menhits[P]phplus/src/ResolveLiteral.cpp
// Function: resolveIntLiteral(std::shared_ptr<TokenData>, std::shared_ptr<TypeBase>)
Action resolveIntLiteral(Token token, Type type)
{
	string in=token->getText();
	
	int val=0;
	
	for (auto i=in.begin(); i!=in.end(); ++i)
	{
		if (*i<'0' || *i>'9')
		{
			error.log(string() + "bad character '" + *i + "' tersedian pada nomor '" + in + "'", SOURCE_ERROR, token);
			return nullptr;
		}
		
		val=val*10+(*i-'0');
	}
	
	if (type==Bool)
	{
		bool out=(val!=0);
		return constGetAction(&out, type, token->getText(), globalNamespace);
	}
	else
	{
		int out=val;
		return constGetAction(&out, type, token->getText(), globalNamespace);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x170, %rsp            # imm = 0x170
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x150(%rsp), %r12
movq %r12, %rdi
callq 0xa3b0
movq (%r12), %r13
movq 0x8(%r12), %rcx
xorl %r12d, %r12d
xorl %eax, %eax
cmpq %r12, %rcx
je 0x3b797
movzbl (%r13,%r12), %edx
leal -0x3a(%rdx), %esi
cmpb $-0xb, %sil
jbe 0x3b810
imull $0xa, %eax, %eax
addl %edx, %eax
addl $-0x30, %eax
incq %r12
jmp 0x3b772
movq (%r15), %rcx
leaq 0x3ec5f(%rip), %rdx     # 0x7a400
cmpq (%rdx), %rcx
je 0x3b930
movl %eax, 0x20(%rsp)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x12c0a
movq (%r14), %rsi
leaq 0x70(%rsp), %rdi
callq 0xa3b0
leaq 0x3eb93(%rip), %rsi     # 0x7a360
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x12bf6
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
callq 0x4e48c
leaq 0x48(%rsp), %rdi
callq 0xc984
leaq 0x70(%rsp), %rdi
callq 0xa558
leaq 0x8(%rsp), %rdi
jmp 0x3b9a1
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1c935(%rip), %rdx     # 0x58160
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xc882
movsbl (%r13,%r12), %edx
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x1aaca
leaq 0x1c90e(%rip), %rdx     # 0x58170
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xc882
leaq 0x20(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x150(%rsp), %rdx
callq 0x184b5
leaq 0x1d9ba(%rip), %rdx     # 0x59252
leaq 0x130(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xc882
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x12e2e
leaq 0x3ea3a(%rip), %rdi     # 0x7a2fb
leaq 0x130(%rsp), %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x19a6e
leaq 0x68(%rsp), %rdi
callq 0xc984
leaq 0x130(%rsp), %rdi
callq 0xa558
leaq 0x20(%rsp), %rdi
callq 0xa558
leaq 0x110(%rsp), %rdi
callq 0xa558
leaq 0xf0(%rsp), %rdi
callq 0xa558
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0xb0(%rsp), %rdi
callq 0xa558
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x3b9a6
testl %eax, %eax
setne 0x20(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x12c0a
movq (%r14), %rsi
leaq 0x90(%rsp), %rdi
callq 0xa3b0
leaq 0x3ea05(%rip), %rsi     # 0x7a360
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x12bf6
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x90(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
callq 0x4e48c
leaq 0x58(%rsp), %rdi
callq 0xc984
leaq 0x90(%rsp), %rdi
callq 0xa558
leaq 0x18(%rsp), %rdi
callq 0xc984
leaq 0x150(%rsp), %rdi
callq 0xa558
movq %rbx, %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xc984
leaq 0x90(%rsp), %rdi
callq 0xa558
jmp 0x3b9e6
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x3ba0e
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xc984
leaq 0x70(%rsp), %rdi
callq 0xa558
jmp 0x3ba09
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xc984
jmp 0x3ba81
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xc984
leaq 0x130(%rsp), %rdi
callq 0xa558
jmp 0x3ba34
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa558
jmp 0x3ba43
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xa558
jmp 0x3ba55
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0xa558
jmp 0x3ba67
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xa558
leaq 0xb0(%rsp), %rdi
callq 0xa558
leaq 0x150(%rsp), %rdi
callq 0xa558
movq %rbx, %rdi
callq 0xa500
movq %rax, %rbx
jmp 0x3ba74