// File: /workspace/github_c_makefile_star2_O1/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 %rdi, %r14
movq 0x20(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x60(%rax), %rax
movq $0x0, 0x18(%rsp)
movq 0x88(%rax), %r12
xorl %edx, %edx
testq %r12, %r12
je 0x30453
movq %r12, %r13
cmpb $0x0, (%r13)
jg 0x3045c
movq 0x10(%r13), %r13
cmpq %r12, %r13
jne 0x3043f
xorl %esi, %esi
jmp 0x30458
xorl %esi, %esi
xorl %r13d, %r13d
xorl %ebp, %ebp
jmp 0x30469
movq 0x18(%r13), %rsi
andq $-0x4, %rsi
movl $0x1, %ebp
movq 0x28(%r14), %rax
testq %rax, %rax
je 0x30577
movq %r14, (%rsp)
xorl %edx, %edx
movq %rax, %r15
movq $0x0, 0x8(%rsp)
movq %rax, 0x20(%rsp)
movzwl (%r15), %eax
testb %al, %al
jle 0x30561
xorl %r14d, %r14d
movq 0x18(%r15,%r14,8), %rbx
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0x304b4
testq %rbx, %rbx
je 0x3054e
cmpb $0x3, (%rsi)
movq %rsi, %rax
jne 0x304c0
movq 0x60(%rsi), %rax
incl %edx
cmpq 0x30a67(%rip), %rax     # 0x60f30
jne 0x3050e
movq 0x8(%rsp), %rax
movq %rax, %rsi
testq %rax, %rax
jne 0x3050e
movq 0x10(%rbx), %rsi
movl $0x1, %eax
testq %rsi, %rsi
je 0x30583
cmpb $0x3, (%rsi)
jne 0x304f3
movq 0x60(%rsi), %rsi
testq %rsi, %rsi
je 0x30583
movq %rsi, 0x8(%rsp)
leaq 0x3b970(%rip), %rax     # 0x6be78
cmpq %rax, 0x60(%rsi)
jne 0x3057e
movq %rbx, 0x10(%rsp)
movq %rdx, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2285b
movsbl (%r13), %eax
cmpl %eax, %ebp
jl 0x30538
movq 0x10(%r13), %r13
xorl %ebp, %ebp
cmpq %r12, %r13
jne 0x30520
xorl %esi, %esi
jmp 0x30546
movslq %ebp, %rax
movq 0x18(%r13,%rax,8), %rsi
andq $-0x4, %rsi
incl %ebp
movq %rbx, %rdx
movq 0x10(%rsp), %rbx
incq %r14
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r14
jl 0x3049c
movq 0x10(%r15), %r15
movq 0x20(%rsp), %rax
cmpq %rax, %r15
jne 0x3048d
xorl %eax, %eax
jmp 0x30583
movl $0x6, %eax
jmp 0x30587
movl $0xd, %eax
movq (%rsp), %r14
cmpl $0x6, %eax
je 0x30590
testl %eax, %eax
jne 0x30592
xorl %eax, %eax
cmpl $0xd, %eax
je 0x305af
xorl %ebp, %ebp
testl %eax, %eax
jne 0x305ec
movq 0x18(%rsp), %rdi
movq 0x28(%r14), %rsi
callq 0x328e8
movl %eax, %ebp
jmp 0x305ec
movq 0x8(%rbx), %rdi
leaq 0x19336(%rip), %rsi     # 0x498f0
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x11a38
movq 0x10(%rbx), %rdi
callq 0x2386c
movq 0x8(%rbx), %rdi
leaq 0x1933b(%rip), %rsi     # 0x49912
movq %rax, %rdx
xorl %eax, %eax
callq 0x11744
leaq 0x3d2d0(%rip), %rax     # 0x6d8b8
movq %rax, 0x10(%r14)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq