// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]cproc/expr.c
// Function: inttype
static struct type *
inttype(unsigned long long val, bool decimal, char *end)
{
	static struct {
		struct type *type;
		const char *end1, *end2;
	} limits[] = {
		{&typeint,    "",    NULL},
		{&typeuint,   "u",   NULL},
		{&typelong,   "l",   NULL},
		{&typeulong,  "ul",  "lu"},
		{&typellong,  "ll",  NULL},
		{&typeullong, "ull", "llu"},
	};
	struct type *t;
	size_t i, step;

	for (i = 0; end[i]; ++i)
		end[i] = tolower(end[i]);
	for (i = 0; i < LEN(limits); ++i) {
		if (strcmp(end, limits[i].end1) == 0)
			break;
		if (limits[i].end2 && strcmp(end, limits[i].end2) == 0)
			break;
	}
	if (i == LEN(limits))
		error(&tok.loc, "invalid integer constant suffix '%s'", end);
	step = i % 2 || decimal ? 2 : 1;
	for (; i < LEN(limits); i += step) {
		t = limits[i].type;
		if (typehasint(t, val, false))
			return t;
	}
	error(&tok.loc, "no suitable type for constant '%s'", tok.lit);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0xb97a
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x31a0
movb %al, %dl
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xb940
movq $0x0, -0x30(%rbp)
cmpq $0x6, -0x30(%rbp)
jae 0xb9f5
movq -0x20(%rbp), %rdi
leaq 0x157bc(%rip), %rax     # 0x21150
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x3160
cmpl $0x0, %eax
jne 0xb9ac
jmp 0xb9f5
leaq 0x1579d(%rip), %rax     # 0x21150
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
je 0xb9e5
movq -0x20(%rbp), %rdi
leaq 0x15783(%rip), %rax     # 0x21150
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x3160
cmpl $0x0, %eax
jne 0xb9e5
jmp 0xb9f5
jmp 0xb9e7
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xb982
cmpq $0x6, -0x30(%rbp)
jne 0xba19
movq -0x20(%rbp), %rdx
leaq 0x167a1(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xe519(%rip), %rsi      # 0x19f2b
movb $0x0, %al
callq 0x11190
movq -0x30(%rbp), %rcx
andq $0x1, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x39(%rbp)
jne 0xba32
movb -0x11(%rbp), %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %dl
movl $0x1, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
movq %rax, -0x38(%rbp)
cmpq $0x6, -0x30(%rbp)
jae 0xba97
leaq 0x156f7(%rip), %rax     # 0x21150
imulq $0x18, -0x30(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x12070
testb $0x1, %al
jne 0xba7d
jmp 0xba87
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xbac3
jmp 0xba89
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xba4b
leaq 0x1670a(%rip), %rax     # 0x221a8
movq 0x20(%rax), %rdx
leaq 0x166ff(%rip), %rdi     # 0x221a8
addq $0x8, %rdi
leaq 0xe49c(%rip), %rsi      # 0x19f50
movb $0x0, %al
callq 0x11190
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)