// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/typecheck_expression.c
// Function: is_strictly_equal
static int is_strictly_equal(const struct AnalyzerState *ptr_ps,
                             const struct Type *ref_t1,
                             const struct Type *ref_t2)
{
	const struct Type t1 = *ref_t1;
	const struct Type t2 = *ref_t2;
	if (t1.type_category == INT_ && t2.type_category == INT_) {
		return 1;
	}

	if (t1.type_category == CHAR_ && t2.type_category == CHAR_) {
		return 1;
	}

	if (t1.type_category == VOID_ && t2.type_category == VOID_) {
		return 1;
	}

	if (t1.type_category == PTR_ && t2.type_category == PTR_) {

		/* pointer to incomplete types */
		if (t1.derived_from->type_category == STRUCT_NOT_UNION &&
		    t2.derived_from->type_category == STRUCT_NOT_UNION &&
		    strcmp(t1.derived_from->s.struct_or_union_tag,
		           t2.derived_from->s.struct_or_union_tag) == 0) {
			return 1;
		}

		/* pointer to incomplete types */
		if (t1.derived_from->type_category == UNION &&
		    t2.derived_from->type_category == UNION &&
		    strcmp(t1.derived_from->s.struct_or_union_tag,
		           t2.derived_from->s.struct_or_union_tag) == 0) {
			return 1;
		}

		return is_strictly_equal(ptr_ps, t1.derived_from, t2.derived_from);
	}

	if (t1.type_category == ARRAY && t2.type_category == ARRAY) {
		return is_strictly_equal(ptr_ps, t1.derived_from, t2.derived_from) &&
		       (t1.array_length == t2.array_length);
	}

	if (t1.type_category == STRUCT_NOT_UNION &&
	    t2.type_category == STRUCT_NOT_UNION) {
		if ((0)) { /* both are local */
			unsupported("struct type declared locally");
		}
		return strcmp(t1.s.struct_or_union_tag, t2.s.struct_or_union_tag) ==
		           0 &&
		       lookup(ptr_ps->global_struct_or_union_tag_map,
		              t1.s.struct_or_union_tag);
	}

	if (t1.type_category == UNION && t2.type_category == UNION) {
		if ((0)) { /* both are local */
			unsupported("union type declared locally");
		}
		return strcmp(t1.s.struct_or_union_tag, t2.s.struct_or_union_tag) ==
		           0 &&
		       lookup(ptr_ps->global_struct_or_union_tag_map,
		              t1.s.struct_or_union_tag);
	}

	if (t1.type_category == ENUM_ && t2.type_category == ENUM_) {
		if ((0)) { /* both are local */
			unsupported("enum type declared locally");
		}
		return strcmp(t1.e.enum_tag, t2.e.enum_tag) == 0;
	}

	if (t1.type_category == FN && t2.type_category == FN) {
		if (!is_strictly_equal(ptr_ps, t1.derived_from, t2.derived_from)) {
			return 0;
		}

		if (t1.param_infos_validity == VALID &&
		    t2.param_infos_validity == VALID) {
			if (t1.param_infos.length != t2.param_infos.length) {
				return 0;
			}

			for (int i = 0; i < t1.param_infos.length; i++) {
				if (!is_strictly_equal(ptr_ps, t1.param_infos.vector[i],
				                       t2.param_infos.vector[i])) {
					return 0;
				}
			}
			return 1;
		} else if (t1.param_infos_validity == INVALID ||
		           t2.param_infos_validity ==
		               INVALID) { /* when invalid, it matches no matter what */
			return 1;
		} else { /* one is VA_ARGS, the other is valid */
#ifdef __STDC__
#warning should typecheck
#endif
			return 1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
movq -0x20(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
cmpl $0x0, -0x70(%rbp)
jne 0x94c9
cmpl $0x0, -0xc0(%rbp)
jne 0x94c9
movl $0x1, -0x4(%rbp)
jmp 0x97ed
cmpl $0x4, -0x70(%rbp)
jne 0x94e4
cmpl $0x4, -0xc0(%rbp)
jne 0x94e4
movl $0x1, -0x4(%rbp)
jmp 0x97ed
cmpl $0x7, -0x70(%rbp)
jne 0x94ff
cmpl $0x7, -0xc0(%rbp)
jne 0x94ff
movl $0x1, -0x4(%rbp)
jmp 0x97ed
cmpl $0x1, -0x70(%rbp)
jne 0x95ae
cmpl $0x1, -0xc0(%rbp)
jne 0x95ae
movq -0x68(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x9554
movq -0xb8(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x9554
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0xb8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x10c0
cmpl $0x0, %eax
jne 0x9554
movl $0x1, -0x4(%rbp)
jmp 0x97ed
movq -0x68(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x9592
movq -0xb8(%rbp), %rax
cmpl $0x6, (%rax)
jne 0x9592
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0xb8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x10c0
cmpl $0x0, %eax
jne 0x9592
movl $0x1, -0x4(%rbp)
jmp 0x97ed
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x9470
movl %eax, -0x4(%rbp)
jmp 0x97ed
cmpl $0x2, -0x70(%rbp)
jne 0x9605
cmpl $0x2, -0xc0(%rbp)
jne 0x9605
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x9470
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xc5(%rbp)
je 0x95f2
movl -0x60(%rbp), %eax
cmpl -0xb0(%rbp), %eax
sete %al
movb %al, -0xc5(%rbp)
movb -0xc5(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x97ed
cmpl $0x5, -0x70(%rbp)
jne 0x9664
cmpl $0x5, -0xc0(%rbp)
jne 0x9664
movq -0x40(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x10c0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xc6(%rbp)
jne 0x9651
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0xcc00
cmpq $0x0, %rax
setne %al
movb %al, -0xc6(%rbp)
movb -0xc6(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x97ed
cmpl $0x6, -0x70(%rbp)
jne 0x96c3
cmpl $0x6, -0xc0(%rbp)
jne 0x96c3
movq -0x40(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x10c0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xc7(%rbp)
jne 0x96b0
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0xcc00
cmpq $0x0, %rax
setne %al
movb %al, -0xc7(%rbp)
movb -0xc7(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x97ed
cmpl $0x8, -0x70(%rbp)
jne 0x96f2
cmpl $0x8, -0xc0(%rbp)
jne 0x96f2
movq -0x30(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x10c0
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x97ed
cmpl $0x3, -0x70(%rbp)
jne 0x97e6
cmpl $0x3, -0xc0(%rbp)
jne 0x97e6
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x9470
cmpl $0x0, %eax
jne 0x972e
movl $0x0, -0x4(%rbp)
jmp 0x97ed
cmpl $0x1, -0x48(%rbp)
jne 0x97c5
cmpl $0x1, -0x98(%rbp)
jne 0x97c5
movl -0x58(%rbp), %eax
cmpl -0xa8(%rbp), %eax
je 0x975c
movl $0x0, -0x4(%rbp)
jmp 0x97ed
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x97bc
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movslq -0xc4(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0xa0(%rbp), %rax
movslq -0xc4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x9470
cmpl $0x0, %eax
jne 0x97a9
movl $0x0, -0x4(%rbp)
jmp 0x97ed
jmp 0x97ab
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x9766
movl $0x1, -0x4(%rbp)
jmp 0x97ed
cmpl $0x0, -0x48(%rbp)
je 0x97d4
cmpl $0x0, -0x98(%rbp)
jne 0x97dd
movl $0x1, -0x4(%rbp)
jmp 0x97ed
movl $0x1, -0x4(%rbp)
jmp 0x97ed
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)