int sdmmc_is_selected_emmc(int device_id) {
  int ret = 0;
  switch (device_id) {
  case 0:
    break;
  case 1:
    break;
  case 2: {
    break;
  }
  default:
    break;
  }
  if (1 == ret)
    printk("%d..%s: RK SDMMC is setted to support eMMC.\n", 602, __FUNCTION__);
  else
    printk("%d..%s: RK SDMMC is not setted to support eMMC.\n", 604,
           __FUNCTION__);
  return ret;
}


x86 assembly (clang, -O0):
<sdmmc_is_selected_emmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1157 <sdmmc_is_selected_emmc+0x47>
jmp    1135 <sdmmc_is_selected_emmc+0x25>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     115c <sdmmc_is_selected_emmc+0x4c>
jmp    1146 <sdmmc_is_selected_emmc+0x36>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1161 <sdmmc_is_selected_emmc+0x51>
jmp    1166 <sdmmc_is_selected_emmc+0x56>
jmp    116b <sdmmc_is_selected_emmc+0x5b>
jmp    116b <sdmmc_is_selected_emmc+0x5b>
jmp    116b <sdmmc_is_selected_emmc+0x5b>
jmp    116b <sdmmc_is_selected_emmc+0x5b>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1198 <sdmmc_is_selected_emmc+0x88>
lea    0xe80(%rip),%rdi
mov    $0x25a,%esi
lea    0xea1(%rip),%rdx
mov    $0x0,%al
call   1030 <printk@plt>
jmp    11b2 <sdmmc_is_selected_emmc+0xa2>
lea    0xea5(%rip),%rdi
mov    $0x25c,%esi
lea    0xe82(%rip),%rdx
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_is_selected_emmc>:
push   %rax
lea    0xeff(%rip),%rdi
lea    0xee1(%rip),%rdx
mov    $0x25c,%esi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"%d..%s: RK SDMMC is setted to support eMMC.\0A\00"
@__FUNCTION__.sdmmc_is_selected_emmc = [23 x i8] c"sdmmc_is_selected_emmc\00"
@.str.1 = [49 x i8] c"%d..%s: RK SDMMC is not setted to support eMMC.\0A\00"
define i32 @sdmmc_is_selected_emmc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %3
%11 = icmp eq i32 1, %10
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 602, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__FUNCTION__.sdmmc_is_selected_emmc, i64 0, i64 0))
br label %16
14: ; preds = %9
%15 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 604, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__FUNCTION__.sdmmc_is_selected_emmc, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@__FUNCTION__.sdmmc_is_selected_emmc = [23 x i8] c"sdmmc_is_selected_emmc\00"
@.str.1 = [49 x i8] c"%d..%s: RK SDMMC is not setted to support eMMC.\0A\00"
define i32 @sdmmc_is_selected_emmc(i32 %0) {
%2 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i32 604, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__FUNCTION__.sdmmc_is_selected_emmc, i64 0, i64 0))
ret i32 0
}