#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 SensorSetContrast_HV7131RP(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x5a, 0x6d);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x5a, 0x7d);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x5a, 0x8d);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x5a, 0x9d);
    break;
  case 5:
    VIM_SIF_I2cWriteByte(0x5a, 0xa6);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetContrast_HV7131RP>:
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    $0x4,%eax
ja     11ac <SensorSetContrast_HV7131RP+0x9c>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x5a,%edi
mov    $0x6d,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
mov    $0x5a,%edi
mov    $0x7d,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
mov    $0x5a,%edi
mov    $0x8d,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
mov    $0x5a,%edi
mov    $0x9d,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
mov    $0x5a,%edi
mov    $0xa6,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
jmp    11b1 <SensorSetContrast_HV7131RP+0xa1>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetContrast_HV7131RP>:
add    $0xff,%dil
cmp    $0x4,%dil
ja     1132 <SensorSetContrast_HV7131RP+0x22>
movsbq %dil,%rax
lea    0xedb(%rip),%rcx
mov    (%rcx,%rax,4),%esi
mov    $0x5a,%edi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
ret

LLVM IR (-O0):
define void @SensorSetContrast_HV7131RP(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 %15 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
i32 4, label %11
i32 5, label %13
]
5: ; preds = %1
%6 = call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 109)
br label %16
7: ; preds = %1
%8 = call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 125)
br label %16
9: ; preds = %1
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 141)
br label %16
11: ; preds = %1
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 157)
br label %16
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 166)
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %13, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@switch.table.SensorSetContrast_HV7131RP = [5 x i32] [i32 109, i32 125, i32 141, i32 157, i32 166]
define void @SensorSetContrast_HV7131RP(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 5
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.SensorSetContrast_HV7131RP, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @VIM_SIF_I2cWriteByte(i32 90, i32 %7)
br label %9
9: ; preds = %1, %4
ret void
}