#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, int);
void SensorSetMode_SIV100B(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x32, 0x10);
    VIM_SIF_I2cWriteByte(0x40, 0x82);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x32, 0x10);
    VIM_SIF_I2cWriteByte(0x40, 0x80);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x40, 0x00);
    VIM_SIF_I2cWriteByte(0x32, 0x40);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x32, 0x10);
    VIM_SIF_I2cWriteByte(0x40, 0x82);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11d1 <SensorSetMode_SIV100B+0xc1>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x32,%edi
mov    $0x10,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
mov    $0x82,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11d6 <SensorSetMode_SIV100B+0xc6>
mov    $0x32,%edi
mov    $0x10,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
mov    $0x80,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11d6 <SensorSetMode_SIV100B+0xc6>
mov    $0x40,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
mov    $0x40,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11d6 <SensorSetMode_SIV100B+0xc6>
mov    $0x32,%edi
mov    $0x10,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
mov    $0x82,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11d6 <SensorSetMode_SIV100B+0xc6>
jmp    11d6 <SensorSetMode_SIV100B+0xc6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
add    $0xff,%dil
cmp    $0x3,%dil
ja     114e <SensorSetMode_SIV100B+0x3e>
movzbl %dil,%eax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x32,%edi
mov    $0x10,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
mov    $0x82,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
pop    %rax
ret
mov    $0x32,%edi
mov    $0x10,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
mov    $0x80,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x40,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
mov    $0x40,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetMode_SIV100B(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %17 [
i32 1, label %5
i32 2, label %8
i32 4, label %11
i32 3, label %14
]
5: ; preds = %1
%6 = call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 130)
br label %18
8: ; preds = %1
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 128)
br label %18
11: ; preds = %1
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 0)
%13 = call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 64)
br label %18
14: ; preds = %1
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%16 = call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 130)
br label %18
17: ; preds = %1
br label %18
18: ; preds = %17, %14, %11, %8, %5
ret void
}

LLVM IR (-O2):
define void @SensorSetMode_SIV100B(i8 zeroext %0) {
switch i8 %0, label %14 [
i8 1, label %2
i8 2, label %5
i8 4, label %8
i8 3, label %11
]
2: ; preds = %1
%3 = tail call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 130)
br label %14
5: ; preds = %1
%6 = tail call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%7 = tail call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 128)
br label %14
8: ; preds = %1
%9 = tail call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 0)
%10 = tail call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 64)
br label %14
11: ; preds = %1
%12 = tail call i32 @VIM_SIF_I2cWriteByte(i32 50, i32 16)
%13 = tail call i32 @VIM_SIF_I2cWriteByte(i32 64, i32 130)
br label %14
14: ; preds = %1, %11, %8, %5, %2
ret void
}