#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_SP80818(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x26, 0x8e);
    VIM_SIF_I2cWriteByte(0x13, 0x60);
    VIM_SIF_I2cWriteByte(0x14, 0x60);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x26, 0x8e);
    VIM_SIF_I2cWriteByte(0x13, 0x70);
    VIM_SIF_I2cWriteByte(0x14, 0x70);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x26, 0x8e);
    VIM_SIF_I2cWriteByte(0x13, 0x80);
    VIM_SIF_I2cWriteByte(0x14, 0x80);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x26, 0x8e);
    VIM_SIF_I2cWriteByte(0x13, 0x90);
    VIM_SIF_I2cWriteByte(0x14, 0x90);
    break;
  case 5:
    VIM_SIF_I2cWriteByte(0x26, 0x8e);
    VIM_SIF_I2cWriteByte(0x13, 0xa0);
    VIM_SIF_I2cWriteByte(0x14, 0xa0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetContrast_SP80818>:
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     1242 <SensorSetContrast_SP80818+0x132>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0x60,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    $0x60,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetContrast_SP80818+0x137>
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0x70,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    $0x70,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetContrast_SP80818+0x137>
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0x80,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    $0x80,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetContrast_SP80818+0x137>
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0x90,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    $0x90,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetContrast_SP80818+0x137>
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xa0,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    $0xa0,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetContrast_SP80818+0x137>
jmp    1247 <SensorSetContrast_SP80818+0x137>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetContrast_SP80818>:
add    $0xff,%dil
cmp    $0x4,%dil
ja     114d <SensorSetContrast_SP80818+0x3d>
push   %rbx
movzbl %dil,%ebx
shl    $0x4,%ebx
add    $0x60,%ebx
mov    $0x26,%edi
mov    $0x8e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    %ebx,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x14,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
ret

LLVM IR (-O0):
define void @SensorSetContrast_SP80818(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 %25 [
i32 1, label %5
i32 2, label %9
i32 3, label %13
i32 4, label %17
i32 5, label %21
]
5: ; preds = %1
%6 = call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 96)
%8 = call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 96)
br label %26
9: ; preds = %1
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%11 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 112)
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 112)
br label %26
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 128)
%16 = call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 128)
br label %26
17: ; preds = %1
%18 = call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%19 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 144)
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 144)
br label %26
21: ; preds = %1
%22 = call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%23 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 160)
%24 = call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 160)
br label %26
25: ; preds = %1
br label %26
26: ; preds = %25, %21, %17, %13, %9, %5
ret void
}

LLVM IR (-O2):
define void @SensorSetContrast_SP80818(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 5
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = zext i8 %2 to i32
%6 = shl nuw nsw i32 %5, 4
%7 = add nuw nsw i32 %6, 96
%8 = tail call i32 @VIM_SIF_I2cWriteByte(i32 38, i32 142)
%9 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 %7)
%10 = tail call i32 @VIM_SIF_I2cWriteByte(i32 20, i32 %7)
br label %11
11: ; preds = %1, %4
ret void
}