// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/example.c
// Function: set_up_arch_entry
static void set_up_arch_entry(struct entrypoint *ep, struct instruction *entry)
{
	pseudo_t arg;
	struct symbol *sym, *argtype;
	int i, offset, regparm;

	sym = ep->name;
	regparm = 0;
	if (!(sym->ctype.modifiers & MOD_ADDRESSABLE))
		regparm = 3;
	sym = sym->ctype.base_type;
	i = 0;
	offset = 0;
	PREPARE_PTR_LIST(sym->arguments, argtype);
	FOR_EACH_PTR(entry->arg_list, arg) {
		struct storage *in = lookup_storage(entry->bb, arg, STOR_IN);
		if (!in) {
			in = alloc_storage();
			add_storage(in, entry->bb, arg, STOR_IN);
		}
		if (i < regparm) {
			in->type = REG_REG;
			in->regno = i;
		} else {
			int bits = argtype ? argtype->bit_size : 0;

			if (bits < bits_in_int)
				bits = bits_in_int;

			in->type = REG_FRAME;
			in->offset = offset;
			
			offset += bits_to_bytes(bits);
		}
		i++;
		NEXT_PTR_LIST(argtype);
	} END_FOR_EACH_PTR(arg);
	FINISH_PTR_LIST(argtype);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
jne 0x118d0
movl $0x3, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x11975
jmp 0x11919
movl -0x4c(%rbp), %eax
movq -0x48(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11952
movq -0x48(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x28(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x11973
movq $0x0, -0x28(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq -0x40(%rbp), %rax
jne 0x11919
jmp 0x11975
jmp 0x11977
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x1199f
jmp 0x11b41
jmp 0x119a1
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x60(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11b29
movq -0x60(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x60(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x119f3
cmpq $0x0, -0x18(%rbp)
jne 0x119f3
jmp 0x11b1b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x48690
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x11a31
callq 0x11c80
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0x487f0
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x11a4f
movq -0x78(%rbp), %rax
movl $0x1, (%rax)
movl -0x2c(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0x11aab
cmpq $0x0, -0x28(%rbp)
je 0x11a62
movq -0x28(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x80(%rbp)
jmp 0x11a69
xorl %eax, %eax
movl %eax, -0x80(%rbp)
jmp 0x11a69
movl -0x80(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
leaq 0x821bf(%rip), %rcx     # 0x93c38
cmpl (%rcx), %eax
jge 0x11a89
leaq 0x821b4(%rip), %rax     # 0x93c38
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x78(%rbp), %rax
movl $0x3, (%rax)
movl -0x30(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x7c(%rbp), %edi
callq 0x11c90
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x11b19
jmp 0x11abd
movl -0x4c(%rbp), %eax
movq -0x48(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11af6
movq -0x48(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x28(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x11b17
movq $0x0, -0x28(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq -0x40(%rbp), %rax
jne 0x11abd
jmp 0x11b19
jmp 0x11b1b
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x119a8
jmp 0x11b2b
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
cmpq -0x58(%rbp), %rax
jne 0x119a1
jmp 0x11b43
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)