#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 SensorSetBrightness_OV7660(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    VIM_SIF_I2cWriteByte(0x24, 0x48);
    VIM_SIF_I2cWriteByte(0x25, 0x38);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    VIM_SIF_I2cWriteByte(0x24, 0x58);
    VIM_SIF_I2cWriteByte(0x25, 0x48);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    VIM_SIF_I2cWriteByte(0x24, 0x75);
    VIM_SIF_I2cWriteByte(0x25, 0x68);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    VIM_SIF_I2cWriteByte(0x24, 0x98);
    VIM_SIF_I2cWriteByte(0x25, 0x88);
    break;
  case 5:
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    VIM_SIF_I2cWriteByte(0x24, 0xb8);
    VIM_SIF_I2cWriteByte(0x25, 0xa8);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetBrightness_OV7660>:
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 <SensorSetBrightness_OV7660+0x132>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    $0x48,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    $0x38,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    $0x58,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    $0x48,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    $0x75,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    $0x68,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    $0x98,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    $0x88,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    $0xb8,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    $0xa8,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
jmp    1247 <SensorSetBrightness_OV7660+0x137>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetBrightness_OV7660>:
add    $0xff,%dil
cmp    $0x4,%dil
ja     1162 <SensorSetBrightness_OV7660+0x52>
push   %rbp
push   %rbx
push   %rax
movsbq %dil,%rax
lea    0xed8(%rip),%rcx
mov    (%rcx,%rax,4),%ebx
lea    0xee2(%rip),%rcx
mov    (%rcx,%rax,4),%ebp
mov    $0x13,%edi
mov    $0xe7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x24,%edi
mov    %ebx,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x25,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
ret

LLVM IR (-O0):
define void @SensorSetBrightness_OV7660(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 19, i32 231)
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 72)
%8 = call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 56)
br label %26
9: ; preds = %1
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
%11 = call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 88)
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 72)
br label %26
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 117)
%16 = call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 104)
br label %26
17: ; preds = %1
%18 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
%19 = call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 152)
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 136)
br label %26
21: ; preds = %1
%22 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
%23 = call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 184)
%24 = call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 168)
br label %26
25: ; preds = %1
br label %26
26: ; preds = %25, %21, %17, %13, %9, %5
ret void
}

LLVM IR (-O2):
@switch.table.SensorSetBrightness_OV7660 = [5 x i32] [i32 72, i32 88, i32 117, i32 152, i32 184]
@switch.table.SensorSetBrightness_OV7660.1 = [5 x i32] [i32 56, i32 72, i32 104, i32 136, i32 168]
define void @SensorSetBrightness_OV7660(i8 zeroext %0) {
%2 = add i8 %0, -1
%3 = icmp ult i8 %2, 5
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.SensorSetBrightness_OV7660, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = sext i8 %2 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.SensorSetBrightness_OV7660.1, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
%12 = tail call i32 @VIM_SIF_I2cWriteByte(i32 36, i32 %7)
%13 = tail call i32 @VIM_SIF_I2cWriteByte(i32 37, i32 %10)
br label %14
14: ; preds = %1, %4
ret void
}