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

	PREPARE_PTR_LIST(fntype->arguments, t);
	FOR_EACH_PTR(expr->args, arg) {
		n++;

		if (!is_dynamic_type(t)) {
			;
		} else if (!ctype) {
			// first 'dynamic' type, check that it's an integer
			t = arg->ctype;
			if (!t)
				return 0;
			if (t->type == SYM_NODE)
				t = t->ctype.base_type;
			if (!t)
				return 0;
			if (t->ctype.base_type != &int_type)
				goto err;

			// next 'dynamic' arguments will use this type
			ctype = t;
		} else {
			// use the previous 'dynamic' type
			t = ctype;
		}
		add_ptr_list(&types, t);
		NEXT_PTR_LIST(t);
	} END_FOR_EACH_PTR(arg);
	FINISH_PTR_LIST(t);
	return evaluate_arguments(types, expr->args);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x60(%rax), %rax
movq $0x0, 0x18(%rsp)
movq 0x88(%rax), %r12
testq %r12, %r12
je 0x2fe1a
movq %r12, %r13
cmpb $0x0, (%r13)
jg 0x2fe23
movq 0x10(%r13), %r13
cmpq %r12, %r13
jne 0x2fe06
xorl %esi, %esi
jmp 0x2fe1f
xorl %esi, %esi
xorl %r13d, %r13d
xorl %ebx, %ebx
jmp 0x2fe30
movq 0x18(%r13), %rsi
andq $-0x4, %rsi
movl $0x1, %ebx
movq 0x28(%rdi), %rax
xorl %edx, %edx
testq %rax, %rax
je 0x2ff3d
movq %rdi, 0x8(%rsp)
movq %rax, %r15
movq $0x0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
movzwl (%r15), %eax
testb %al, %al
jle 0x2ff1b
xorl %ebp, %ebp
movq 0x18(%r15,%rbp,8), %r14
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x2fe7b
testq %r14, %r14
je 0x2ff08
cmpb $0x3, (%rsi)
movq %rsi, %rax
jne 0x2fe87
movq 0x60(%rsi), %rax
incl %edx
cmpq 0x300b0(%rip), %rax     # 0x5ff40
jne 0x2fed2
movq 0x10(%rsp), %rax
movq %rax, %rsi
testq %rax, %rax
jne 0x2fed2
movq 0x10(%r14), %rsi
xorl %eax, %eax
testq %rsi, %rsi
je 0x2ff8b
cmpb $0x3, (%rsi)
jne 0x2fec0
movq 0x60(%rsi), %rsi
testq %rsi, %rsi
je 0x2ff8b
movq %rsi, 0x10(%rsp)
leaq 0x3afac(%rip), %rax     # 0x6ae78
cmpq %rax, 0x60(%rsi)
jne 0x2ff49
movq %rdx, %r14
leaq 0x18(%rsp), %rdi
callq 0x227b4
movsbl (%r13), %eax
cmpl %eax, %ebx
jl 0x2fef7
movq 0x10(%r13), %r13
xorl %ebx, %ebx
cmpq %r12, %r13
jne 0x2fedf
xorl %esi, %esi
jmp 0x2ff05
movslq %ebx, %rax
movq 0x18(%r13,%rax,8), %rsi
andq $-0x4, %rsi
incl %ebx
movq %r14, %rdx
incq %rbp
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jl 0x2fe63
movq 0x10(%r15), %r15
movq 0x20(%rsp), %rax
cmpq %rax, %r15
jne 0x2fe55
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdx
jmp 0x2ff3f
xorl %edi, %edi
movq %rdx, %rsi
callq 0x31eba
jmp 0x2ff8b
movq 0x8(%r14), %rdi
leaq 0x1890c(%rip), %rsi     # 0x48860
xorl %eax, %eax
callq 0x11a80
movq 0x10(%r14), %rdi
callq 0x237c5
movq 0x8(%r14), %rdi
leaq 0x18913(%rip), %rsi     # 0x48882
movq %rax, %rdx
xorl %eax, %eax
callq 0x1178c
leaq 0x3c938(%rip), %rax     # 0x6c8b8
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq