// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/builtin.c
// Function: eval_atomic_common
static int eval_atomic_common(struct expression *expr)
{
	struct symbol *fntype = expr->fn->ctype->ctype.base_type;
	struct symbol_list *types = NULL;
	struct symbol *ctype = NULL;
	struct symbol *t;
	struct expression *arg;
	int n = 0;

	// The number of arguments has already be verified.
	// The first arg must be a pointer to an integral type.
	PREPARE_PTR_LIST(fntype->arguments, t);
	FOR_EACH_PTR(expr->args, arg) {
		struct symbol *ptrtype = NULL;

		if (++n == 1) {
			t = arg->ctype;
			if (!t)
				return 0;
			if (t->type == SYM_NODE)
				t = t->ctype.base_type;
			if (!t)
				return 0;
			if (t->type != SYM_PTR)
				goto err;
			ptrtype = t;
			t = t->ctype.base_type;
			if (!t)
				return 0;
			if (t->type == SYM_NODE)
				t = t->ctype.base_type;
			if (!t)
				return 0;
			if (t->type != SYM_PTR && t->ctype.base_type != &int_type)
				goto err;
			ctype = t;
			t = ptrtype;
		} else if (is_dynamic_type(t)) {
			t = ctype;
		} else if (t == &ptr_ctype) {
			t = ptrtype;
		}
		add_ptr_list(&types, t);
		NEXT_PTR_LIST(t);
	} END_FOR_EACH_PTR(arg);
	FINISH_PTR_LIST(t);

	if (!expr->ctype)	// set the return type, if needed
		expr->ctype = ctype;
	return evaluate_arguments(types, expr->args);

err:
	sparse_error(arg->pos, "invalid type for argument %d:", n);
	info(arg->pos, "        %s", show_typename(arg->ctype));
	expr->ctype = &bad_ctype;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rax
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x47eb5
jmp 0x47e59
movl -0x54(%rbp), %eax
movq -0x50(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x47e92
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x30(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x47eb3
movq $0x0, -0x30(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x47e59
jmp 0x47eb5
jmp 0x47eb7
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x47edf
jmp 0x4811f
jmp 0x47ee1
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x68(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x48107
movq -0x68(%rbp), %rax
movslq -0x74(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x68(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x47f33
cmpq $0x0, -0x38(%rbp)
jne 0x47f33
jmp 0x480f9
movq $0x0, -0x80(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x1, %eax
jne 0x4803e
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x47f6c
movl $0x0, -0x4(%rbp)
jmp 0x481b1
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x3, %eax
jne 0x47f88
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x47f9b
movl $0x0, -0x4(%rbp)
jmp 0x481b1
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x4, %eax
je 0x47fb0
jmp 0x4814e
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x47fd7
movl $0x0, -0x4(%rbp)
jmp 0x481b1
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x3, %eax
jne 0x47ff3
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x48006
movl $0x0, -0x4(%rbp)
jmp 0x481b1
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x4, %eax
je 0x4802c
movq -0x30(%rbp), %rax
leaq 0x49237(%rip), %rcx     # 0x91258
cmpq %rcx, 0x60(%rax)
je 0x4802c
jmp 0x4814e
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x48070
movq -0x30(%rbp), %rdi
callq 0x47bf0
testb $0x1, %al
jne 0x4804d
jmp 0x48057
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x4806e
leaq 0x4a8ba(%rip), %rax     # 0x92918
cmpq %rax, -0x30(%rbp)
jne 0x4806c
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x4806e
jmp 0x48070
leaq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x31370
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x480f7
jmp 0x4809b
movl -0x54(%rbp), %eax
movq -0x50(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x480d4
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
andq $-0x4, %rax
movq %rax, -0x30(%rbp)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x480f5
movq $0x0, -0x30(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x4809b
jmp 0x480f7
jmp 0x480f9
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x47ee8
jmp 0x48109
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq -0x60(%rbp), %rax
jne 0x47ee1
jmp 0x48121
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x48138
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x4b830
movl %eax, -0x4(%rbp)
jmp 0x481b1
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %edx
movq 0x8(%rax), %rdi
leaq 0x2317c(%rip), %rsi     # 0x6b2dc
movb $0x0, %al
callq 0x16f90
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x222ca(%rip), %rsi     # 0x6a45e
movb $0x0, %al
callq 0x16c10
movq -0x10(%rbp), %rax
leaq 0x4aaf2(%rip), %rcx     # 0x92c98
movq %rcx, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)