// File: 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:
subq $0x208, %rsp            # imm = 0x208
movq %rdx, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, %rax
movq 0x30(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq %rax, %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x200(%rsp)
movq %rdi, 0x1f8(%rsp)
movq %rdx, 0x1f0(%rsp)
callq 0x1bb70
movq %rax, %rsi
leaq 0x1d0(%rsp), %rdi
callq 0x1bb80
movl $0x0, 0x1cc(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xb320
movq %rax, 0x1c0(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0xb230
movq %rax, 0x1b8(%rsp)
leaq 0x1c0(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x9b600
testb $0x1, %al
jne 0x99e66
jmp 0x9a119
leaq 0x1c0(%rsp), %rdi
callq 0x9b640
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x99e94
leaq 0x1c0(%rsp), %rdi
callq 0x9b640
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x9a0d8
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xb4e0
movq 0x20(%rsp), %rsi
leaq 0x3bb06(%rip), %rdx     # 0xd59b8
leaq 0x118(%rsp), %rdi
callq 0xfa60
jmp 0x99ec1
leaq 0x1c0(%rsp), %rdi
callq 0x9b640
movsbl (%rax), %edx
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x37040
jmp 0x99ee8
leaq 0x3bad9(%rip), %rdx     # 0xd59c8
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0xfa60
jmp 0x99f06
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x2e070
jmp 0x99f25
leaq 0x3cb6e(%rip), %rdx     # 0xd6a9a
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0xfa60
jmp 0x99f43
movq 0x30(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1bc90
movq 0x18(%rsp), %rcx
leaq 0x7e45d(%rip), %rdi     # 0x1183c3
leaq 0x198(%rsp), %rsi
xorl %edx, %edx
callq 0x34c70
jmp 0x99f77
leaq 0xd8(%rsp), %rdi
callq 0xfc00
leaq 0x198(%rsp), %rdi
callq 0xb6e8
leaq 0x178(%rsp), %rdi
callq 0xb6e8
leaq 0x158(%rsp), %rdi
callq 0xb6e8
leaq 0x138(%rsp), %rdi
callq 0xb6e8
leaq 0x118(%rsp), %rdi
callq 0xb6e8
leaq 0xf8(%rsp), %rdi
callq 0xb6e8
movq 0x38(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1bcd0
movl $0x1, 0xd4(%rsp)
jmp 0x9a323
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a0c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a0b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a0ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a09f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a092
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xfc00
leaq 0x198(%rsp), %rdi
callq 0xb6e8
leaq 0x178(%rsp), %rdi
callq 0xb6e8
leaq 0x158(%rsp), %rdi
callq 0xb6e8
leaq 0x138(%rsp), %rdi
callq 0xb6e8
leaq 0x118(%rsp), %rdi
callq 0xb6e8
leaq 0xf8(%rsp), %rdi
callq 0xb6e8
jmp 0x9a33d
imull $0xa, 0x1cc(%rsp), %eax
movl %eax, 0x14(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x9b640
movq %rax, %rcx
movl 0x14(%rsp), %eax
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, 0x1cc(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x9b650
jmp 0x99e33
movq 0x28(%rsp), %rdi
leaq 0x7e3a3(%rip), %rsi     # 0x1184c8
callq 0x9b670
testb $0x1, %al
jne 0x9a133
jmp 0x9a241
movq 0x28(%rsp), %rsi
movl 0x1cc(%rsp), %eax
testl %eax, %eax
setne 0xd3(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x1a920
movq 0x30(%rsp), %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0xa0(%rsp), %rdi
callq 0x1bb80
jmp 0x9a172
leaq 0x7e2af(%rip), %rsi     # 0x118428
leaq 0x90(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1a8f0
movq 0x38(%rsp), %rdi
movq 0x8(%rsp), %r8
leaq 0xd3(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0xc5050
jmp 0x9a1b4
leaq 0x90(%rsp), %rdi
callq 0x1a6e0
leaq 0xa0(%rsp), %rdi
callq 0xb6e8
leaq 0xc0(%rsp), %rdi
callq 0x1a950
movl $0x1, 0xd4(%rsp)
jmp 0x9a323
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a22f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x1a6e0
leaq 0xa0(%rsp), %rdi
callq 0xb6e8
leaq 0xc0(%rsp), %rdi
callq 0x1a950
jmp 0x9a33d
movq 0x28(%rsp), %rsi
movl 0x1cc(%rsp), %eax
movl %eax, 0x8c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1a920
movq 0x30(%rsp), %rdi
callq 0x1bb70
movq %rax, %rsi
leaq 0x58(%rsp), %rdi
callq 0x1bb80
jmp 0x9a277
leaq 0x7e1aa(%rip), %rsi     # 0x118428
leaq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x1a8f0
movq 0x38(%rsp), %rdi
movq (%rsp), %r8
leaq 0x8c(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0xc5050
jmp 0x9a2ae
leaq 0x48(%rsp), %rdi
callq 0x1a6e0
leaq 0x58(%rsp), %rdi
callq 0xb6e8
leaq 0x78(%rsp), %rdi
callq 0x1a950
movl $0x1, 0xd4(%rsp)
jmp 0x9a323
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x9a317
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x1a6e0
leaq 0x58(%rsp), %rdi
callq 0xb6e8
leaq 0x78(%rsp), %rdi
callq 0x1a950
jmp 0x9a33d
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
movq 0x40(%rsp), %rax
addq $0x208, %rsp            # imm = 0x208
retq
leaq 0x1d0(%rsp), %rdi
callq 0xb6e8
movq 0xf0(%rsp), %rdi
callq 0xb680
nopw (%rax,%rax)