#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_I2cReadByte(int, unsigned char *);
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(int, int);
void SensorSetContrast_OV7725(unsigned char val) {
  unsigned char x;
  switch (val) {
  case 1:
    VIM_SIF_I2cReadByte(0xa6, &x);
    VIM_SIF_I2cWriteByte(0xa6, (unsigned char)(x | 0x04));
    VIM_SIF_I2cWriteByte(0x9c, 0x10);
    break;
  case 2:
    VIM_SIF_I2cReadByte(0xa6, &x);
    VIM_SIF_I2cWriteByte(0xa6, (unsigned char)(x | 0x04));
    VIM_SIF_I2cWriteByte(0x9c, 0x18);
    break;
  case 3:
    VIM_SIF_I2cReadByte(0xa6, &x);
    VIM_SIF_I2cWriteByte(0xa6, (unsigned char)(x | 0x04));
    VIM_SIF_I2cWriteByte(0x9c, 0x20);
    break;
  case 4:
    VIM_SIF_I2cReadByte(0xa6, &x);
    VIM_SIF_I2cWriteByte(0xa6, (unsigned char)(x | 0x04));
    VIM_SIF_I2cWriteByte(0x9c, 0x28);
    break;
  case 5:
    VIM_SIF_I2cReadByte(0xa6, &x);
    VIM_SIF_I2cWriteByte(0xa6, (unsigned char)(x | 0x04));
    VIM_SIF_I2cWriteByte(0x9c, 0x30);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetContrast_OV7725>:
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     1266 <SensorSetContrast_OV7725+0x146>
mov    -0x10(%rbp),%rax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xa6,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
or     $0x4,%eax
movzbl %al,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    126b <SensorSetContrast_OV7725+0x14b>
mov    $0xa6,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
or     $0x4,%eax
movzbl %al,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    $0x18,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    126b <SensorSetContrast_OV7725+0x14b>
mov    $0xa6,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
or     $0x4,%eax
movzbl %al,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    $0x20,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    126b <SensorSetContrast_OV7725+0x14b>
mov    $0xa6,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
or     $0x4,%eax
movzbl %al,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    $0x28,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    126b <SensorSetContrast_OV7725+0x14b>
mov    $0xa6,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
or     $0x4,%eax
movzbl %al,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    $0x30,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    126b <SensorSetContrast_OV7725+0x14b>
jmp    126b <SensorSetContrast_OV7725+0x14b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetContrast_OV7725>:
add    $0xff,%dil
cmp    $0x4,%dil
ja     116c <SensorSetContrast_OV7725+0x4c>
push   %rbx
sub    $0x10,%rsp
movzbl %dil,%eax
lea    0x10(,%rax,8),%ebx
lea    0xf(%rsp),%rsi
mov    $0xa6,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl 0xf(%rsp),%esi
or     $0x4,%esi
mov    $0xa6,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9c,%edi
mov    %ebx,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @SensorSetContrast_OV7725(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
switch i32 %5, label %51 [
i32 1, label %6
i32 2, label %15
i32 3, label %24
i32 4, label %33
i32 5, label %42
]
6: ; preds = %1
%7 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %3)
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = or i32 %9, 4
%11 = trunc i32 %10 to i8
%12 = zext i8 %11 to i32
%13 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %12)
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 16)
br label %52
15: ; preds = %1
%16 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %3)
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = or i32 %18, 4
%20 = trunc i32 %19 to i8
%21 = zext i8 %20 to i32
%22 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %21)
%23 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 24)
br label %52
24: ; preds = %1
%25 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %3)
%26 = load i8, i8* %3
%27 = zext i8 %26 to i32
%28 = or i32 %27, 4
%29 = trunc i32 %28 to i8
%30 = zext i8 %29 to i32
%31 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %30)
%32 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 32)
br label %52
33: ; preds = %1
%34 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %3)
%35 = load i8, i8* %3
%36 = zext i8 %35 to i32
%37 = or i32 %36, 4
%38 = trunc i32 %37 to i8
%39 = zext i8 %38 to i32
%40 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %39)
%41 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 40)
br label %52
42: ; preds = %1
%43 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %3)
%44 = load i8, i8* %3
%45 = zext i8 %44 to i32
%46 = or i32 %45, 4
%47 = trunc i32 %46 to i8
%48 = zext i8 %47 to i32
%49 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %48)
%50 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 48)
br label %52
51: ; preds = %1
br label %52
52: ; preds = %51, %42, %33, %24, %15, %6
ret void
}

LLVM IR (-O2):
define void @SensorSetContrast_OV7725(i8 zeroext %0) {
%2 = alloca i8
%3 = add i8 %0, -1
%4 = icmp ult i8 %3, 5
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = zext i8 %3 to i32
%7 = shl nuw nsw i32 %6, 3
%8 = add nuw nsw i32 %7, 16
%9 = call i32 @VIM_SIF_I2cReadByte(i32 166, i8* %2)
%10 = load i8, i8* %2
%11 = or i8 %10, 4
%12 = zext i8 %11 to i32
%13 = call i32 @VIM_SIF_I2cWriteByte(i32 166, i32 %12)
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 156, i32 %8)
br label %15
15: ; preds = %1, %5
ret void
}