// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/evaluate.c
// Function: check_case_type
static void check_case_type(struct expression *switch_expr,
			    struct expression *case_expr,
			    struct expression **enumcase)
{
	struct symbol *switch_type, *case_type;
	int sclass, cclass;

	if (!case_expr)
		return;

	switch_type = switch_expr->ctype;
	case_type = evaluate_expression(case_expr);

	if (!switch_type || !case_type)
		goto Bad;
	if (enumcase) {
		if (*enumcase)
			warn_for_different_enum_types(case_expr->pos, case_type, (*enumcase)->ctype);
		else if (is_enum_type(case_type))
			*enumcase = case_expr;
	}

	sclass = classify_type(switch_type, &switch_type);
	cclass = classify_type(case_type, &case_type);

	/* both should be arithmetic */
	if (!(sclass & cclass & TYPE_NUM))
		goto Bad;

	/* neither should be floating */
	if ((sclass | cclass) & TYPE_FLOAT)
		goto Bad;

	/* if neither is restricted, we are OK */
	if (!((sclass | cclass) & TYPE_RESTRICT))
		return;

	if (!restricted_binop_type(SPECIAL_EQUAL, case_expr, switch_expr,
				   cclass, sclass, case_type, switch_type)) {
		unrestrict(case_expr, cclass, &case_type);
		unrestrict(switch_expr, sclass, &switch_type);
	}
	return;

Bad:
	expression_error(case_expr, "incompatible types for 'case' statement");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x38af3
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %r12
movq %rsi, %rdi
callq 0x32223
movq %rax, %r15
movq %rax, 0x8(%rsp)
testq %r12, %r12
setne %al
testq %r15, %r15
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x38b02
testq %r13, %r13
je 0x389a3
movq (%r13), %rax
testq %rax, %rax
je 0x3898a
movq 0x10(%rax), %rdx
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0x364ef
jmp 0x389a3
movzbl (%r15), %eax
cmpl $0x3, %eax
jne 0x3899a
movq 0x60(%r15), %rax
movzbl (%rax), %eax
cmpl $0x9, %eax
jne 0x389a3
movq %r14, (%r13)
movzbl (%r12), %eax
cmpl $0x3, %eax
jne 0x389b7
movq 0x60(%r12), %r12
movzbl (%r12), %eax
cmpl $0xa, %eax
jne 0x389d9
movq %r12, %rdi
callq 0x2b0b8
movq %rax, %r12
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x389d9
movq 0x60(%r12), %r12
movzbl (%r12), %eax
cmpl $0x9, %eax
jne 0x389e3
movq 0x60(%r12), %r12
movq %r12, 0x10(%rsp)
movzbl (%r12), %eax
cmpq $0x2, %rax
jne 0x38a0a
movq 0x60(%r12), %rcx
cmpq 0x27589(%rip), %rcx     # 0x5ff88
je 0x38a16
cmpq 0x27548(%rip), %rcx     # 0x5ff50
je 0x38a1d
leaq 0x1119f(%rip), %rcx     # 0x49bb0
movl (%rcx,%rax,4), %ebp
jmp 0x38a22
movl $0x1, %ebp
jmp 0x38a22
movl $0x9, %ebp
movzbl (%r15), %eax
cmpl $0x3, %eax
jne 0x38a33
movq 0x60(%r15), %r15
movzbl (%r15), %eax
cmpl $0xa, %eax
jne 0x38a53
movq %r15, %rdi
callq 0x2b0b8
movq %rax, %r15
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x38a53
movq 0x60(%r15), %r15
movzbl (%r15), %eax
cmpl $0x9, %eax
jne 0x38a5c
movq 0x60(%r15), %r15
movq %r15, 0x8(%rsp)
movzbl (%r15), %eax
cmpq $0x2, %rax
jne 0x38a81
movq 0x60(%r15), %rcx
cmpq 0x27512(%rip), %rcx     # 0x5ff88
je 0x38a8e
cmpq 0x274d1(%rip), %rcx     # 0x5ff50
je 0x38a96
leaq 0x11128(%rip), %rcx     # 0x49bb0
movl (%rcx,%rax,4), %r13d
jmp 0x38a9c
movl $0x1, %r13d
jmp 0x38a9c
movl $0x9, %r13d
movl %ebp, %eax
andl %r13d, %eax
testb $0x1, %al
je 0x38b02
movl %r13d, %eax
orl %ebp, %eax
testb $0x8, %al
jne 0x38b02
testb $0x4, %al
je 0x38af3
movq %r12, (%rsp)
movl $0x10a, %edi            # imm = 0x10A
movq %r14, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl %ebp, %r8d
movq %r15, %r9
callq 0x36a1f
testq %rax, %rax
jne 0x38af3
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %r13d, %esi
callq 0x36abe
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x36abe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11eba(%rip), %rsi     # 0x4a9c3
movq %r14, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11b04