#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_ET8EC3(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x02, 0x00);
    VIM_SIF_I2cWriteByte(0x04, 0x1f);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x02, 0x40);
    VIM_SIF_I2cWriteByte(0x04, 0x1f);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x04, 0x2f);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x02, 0x00);
    VIM_SIF_I2cWriteByte(0x04, 0x1f);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetMode_ET8EC3>:
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     11bf <SensorSetMode_ET8EC3+0xaf>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x4,%edi
mov    $0x1f,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11c4 <SensorSetMode_ET8EC3+0xb4>
mov    $0x2,%edi
mov    $0x40,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x4,%edi
mov    $0x1f,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11c4 <SensorSetMode_ET8EC3+0xb4>
mov    $0x4,%edi
mov    $0x2f,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11c4 <SensorSetMode_ET8EC3+0xb4>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x4,%edi
mov    $0x1f,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11c4 <SensorSetMode_ET8EC3+0xb4>
jmp    11c4 <SensorSetMode_ET8EC3+0xb4>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMode_ET8EC3>:
add    $0xff,%dil
cmp    $0x3,%dil
ja     1157 <SensorSetMode_ET8EC3+0x47>
push   %rax
mov    $0x2f,%eax
xor    %esi,%esi
movzbl %dil,%ecx
lea    0xed3(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x40,%esi
mov    $0x2,%edi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x1f,%eax
mov    $0x4,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
ret

LLVM IR (-O0):
define void @SensorSetMode_ET8EC3(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 %16 [
i32 1, label %5
i32 2, label %8
i32 4, label %11
i32 3, label %13
]
5: ; preds = %1
%6 = call i32 @VIM_SIF_I2cWriteByte(i32 2, i32 0)
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 4, i32 31)
br label %17
8: ; preds = %1
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 2, i32 64)
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 4, i32 31)
br label %17
11: ; preds = %1
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 4, i32 47)
br label %17
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 2, i32 0)
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 4, i32 31)
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %13, %11, %8, %5
ret void
}

LLVM IR (-O2):
define void @SensorSetMode_ET8EC3(i8 zeroext %0) {
switch i8 %0, label %9 [
i8 1, label %3
i8 2, label %2
i8 4, label %6
i8 3, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %2
%4 = phi i32 [ 64, %2 ], [ 0, %1 ], [ 0, %1 ]
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i32 2, i32 %4)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ 47, %1 ], [ 31, %3 ]
%8 = tail call i32 @VIM_SIF_I2cWriteByte(i32 4, i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}