// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x18(%rsp)
movq 0x88(%rax), %r12
testq %r12, %r12
je 0x2af77
movq %r12, %r13
cmpb $0x0, (%r13)
jg 0x2af80
movq 0x10(%r13), %r13
cmpq %r12, %r13
jne 0x2af63
xorl %esi, %esi
jmp 0x2af7c
xorl %esi, %esi
xorl %r13d, %r13d
xorl %ebx, %ebx
jmp 0x2af8b
movq 0x18(%r13), %rsi
andq $-0x4, %rsi
pushq $0x1
popq %rbx
movq 0x28(%rdi), %rax
xorl %edx, %edx
testq %rax, %rax
je 0x2b08d
movq %rdi, 0x8(%rsp)
movq %rax, %r15
movq $0x0, 0x10(%rsp)
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %rbp
jge 0x2b06b
movq 0x18(%r15,%rbp,8), %r14
cmpw $0x100, %ax             # imm = 0x100
jb 0x2afd6
testq %r14, %r14
je 0x2b063
cmpb $0x3, (%rsi)
movq %rsi, %rax
jne 0x2afe2
movq 0x60(%rsi), %rax
incl %edx
cmpq 0x2ef55(%rip), %rax     # 0x59f40
jne 0x2b02d
movq 0x10(%rsp), %rax
movq %rax, %rsi
testq %rax, %rax
jne 0x2b02d
movq 0x10(%r14), %rsi
xorl %eax, %eax
testq %rsi, %rsi
je 0x2b0db
cmpb $0x3, (%rsi)
jne 0x2b01b
movq 0x60(%rsi), %rsi
testq %rsi, %rsi
je 0x2b0db
movq %rsi, 0x10(%rsp)
leaq 0x39e51(%rip), %rax     # 0x64e78
cmpq %rax, 0x60(%rsi)
jne 0x2b099
movq %rdx, %r14
leaq 0x18(%rsp), %rdi
callq 0x1fae9
movsbl (%r13), %eax
cmpl %eax, %ebx
jl 0x2b052
movq 0x10(%r13), %r13
xorl %ebx, %ebx
cmpq %r12, %r13
jne 0x2b03a
xorl %esi, %esi
jmp 0x2b060
movslq %ebx, %rax
movq 0x18(%r13,%rax,8), %rsi
andq $-0x4, %rsi
incl %ebx
movq %r14, %rdx
incq %rbp
jmp 0x2afb2
movq 0x10(%r15), %r15
movq 0x20(%rsp), %rax
cmpq %rax, %r15
jne 0x2afb0
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rdx
jmp 0x2b08f
xorl %edi, %edi
movq %rdx, %rsi
callq 0x2ce31
jmp 0x2b0db
movq 0x8(%r14), %rdi
leaq 0x1696c(%rip), %rsi     # 0x41a10
xorl %eax, %eax
callq 0x1120e
movq 0x10(%r14), %rdi
callq 0x20b5a
movq 0x8(%r14), %rdi
leaq 0x16973(%rip), %rsi     # 0x41a32
movq %rax, %rdx
xorl %eax, %eax
callq 0x10ddc
leaq 0x3b7e8(%rip), %rax     # 0x668b8
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