// File: /workspace/github_c_makefile_star2_O1/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 0x39668
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movq %r15, 0x10(%rsp)
movq %rsi, %rdi
callq 0x32c63
movq %rax, %r12
movq %rax, 0x8(%rsp)
testq %r15, %r15
setne %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x39677
testq %r13, %r13
je 0x39530
movq (%r13), %rax
testq %rax, %rax
je 0x39518
movq 0x10(%rax), %rdx
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0x37001
jmp 0x39530
cmpb $0x3, (%r12)
movq %r12, %rax
jne 0x39527
movq 0x60(%r12), %rax
cmpb $0x9, (%rax)
jne 0x39530
movq %r14, (%r13)
cmpb $0x3, (%r15)
jne 0x3953a
movq 0x60(%r15), %r15
cmpb $0xa, (%r15)
jne 0x39554
movq %r15, %rdi
callq 0x2b5f4
movq %rax, %r15
cmpb $0x3, (%rax)
jne 0x39554
movq 0x60(%r15), %r15
cmpb $0x9, (%r15)
jne 0x3955e
movq 0x60(%r15), %r15
movq %r15, 0x10(%rsp)
movzbl (%r15), %eax
cmpq $0x2, %rax
jne 0x39583
movq 0x60(%r15), %rcx
cmpq 0x27a08(%rip), %rcx     # 0x60f80
je 0x3958f
cmpq 0x279bf(%rip), %rcx     # 0x60f40
je 0x39596
leaq 0x116b6(%rip), %rcx     # 0x4ac40
movl (%rcx,%rax,4), %ebp
jmp 0x3959b
movl $0x1, %ebp
jmp 0x3959b
movl $0x9, %ebp
cmpb $0x3, (%r12)
jne 0x395a7
movq 0x60(%r12), %r12
cmpb $0xa, (%r12)
jne 0x395c3
movq %r12, %rdi
callq 0x2b5f4
movq %rax, %r12
cmpb $0x3, (%rax)
jne 0x395c3
movq 0x60(%r12), %r12
cmpb $0x9, (%r12)
jne 0x395cf
movq 0x60(%r12), %r12
movq %r12, 0x8(%rsp)
movzbl (%r12), %eax
cmpq $0x2, %rax
jne 0x395f6
movq 0x60(%r12), %rcx
cmpq 0x27995(%rip), %rcx     # 0x60f80
je 0x39603
cmpq 0x2794c(%rip), %rcx     # 0x60f40
je 0x3960b
leaq 0x11643(%rip), %rcx     # 0x4ac40
movl (%rcx,%rax,4), %r13d
jmp 0x39611
movl $0x1, %r13d
jmp 0x39611
movl $0x9, %r13d
movl %ebp, %eax
andl %r13d, %eax
testb $0x1, %al
je 0x39677
movl %r13d, %eax
orl %ebp, %eax
testb $0x8, %al
jne 0x39677
testb $0x4, %al
je 0x39668
movq %r15, (%rsp)
movl $0x10a, %edi            # imm = 0x10A
movq %r14, %rsi
movq %rbx, %rdx
movl %r13d, %ecx
movl %ebp, %r8d
movq %r12, %r9
callq 0x37510
testq %rax, %rax
jne 0x39668
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %r13d, %esi
callq 0x375be
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x375be
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123d5(%rip), %rsi     # 0x4ba53
movq %r14, %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11abc