#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 SensorSetMode_OV7660(unsigned char val) {
  unsigned char uTemp;
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x3b, 0x0a);
    VIM_SIF_I2cWriteByte(0x92, 0x66);
    VIM_SIF_I2cWriteByte(0x93, 0x00);
    VIM_SIF_I2cWriteByte(0x13, 0xe2);
    VIM_SIF_I2cWriteByte(0x2d, 0x00);
    VIM_SIF_I2cWriteByte(0x2e, 0x00);
    VIM_SIF_I2cWriteByte(0x9d, 0x4c);
    VIM_SIF_I2cWriteByte(0x9e, 0x3f);
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x3b, 0x02);
    VIM_SIF_I2cWriteByte(0x92, 0x00);
    VIM_SIF_I2cWriteByte(0x93, 0x00);
    VIM_SIF_I2cWriteByte(0x13, 0xe2);
    VIM_SIF_I2cWriteByte(0x2d, 0x00);
    VIM_SIF_I2cWriteByte(0x2e, 0x00);
    VIM_SIF_I2cWriteByte(0x9d, 0x4c);
    VIM_SIF_I2cWriteByte(0x9e, 0x3f);
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    break;
  case 4:
    VIM_SIF_I2cReadByte(0x3b, &uTemp);
    VIM_SIF_I2cWriteByte(0x3b, (unsigned char)((0xa0) | (uTemp & 0x08)));
    break;
  case 3:
    VIM_SIF_I2cReadByte(0x3b, &uTemp);
    VIM_SIF_I2cWriteByte(0x3b, (unsigned char)((0x02) | (uTemp & 0x08)));
    VIM_SIF_I2cWriteByte(0x13, 0xe2);
    VIM_SIF_I2cWriteByte(0x2d, 0x00);
    VIM_SIF_I2cWriteByte(0x2e, 0x00);
    VIM_SIF_I2cWriteByte(0x13, 0xe7);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetMode_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    $0x3,%eax
ja     12e7 <SensorSetMode_OV7660+0x1c7>
mov    -0x10(%rbp),%rax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3b,%edi
mov    $0xa,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x92,%edi
mov    $0x66,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x93,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9d,%edi
mov    $0x4c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9e,%edi
mov    $0x3f,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    12ec <SensorSetMode_OV7660+0x1cc>
mov    $0x3b,%edi
mov    $0x2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x92,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x93,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9d,%edi
mov    $0x4c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9e,%edi
mov    $0x3f,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    12ec <SensorSetMode_OV7660+0x1cc>
mov    $0x3b,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0x8,%eax
or     $0xa0,%eax
movzbl %al,%esi
mov    $0x3b,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    12ec <SensorSetMode_OV7660+0x1cc>
mov    $0x3b,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
and    $0x8,%eax
or     $0x2,%eax
movzbl %al,%esi
mov    $0x3b,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe7,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    12ec <SensorSetMode_OV7660+0x1cc>
jmp    12ec <SensorSetMode_OV7660+0x1cc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMode_OV7660>:
push   %rax
add    $0xff,%dil
cmp    $0x3,%dil
ja     1258 <SensorSetMode_OV7660+0x138>
movzbl %dil,%eax
lea    0xec6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3b,%edi
mov    $0xa,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x92,%edi
mov    $0x66,%esi
jmp    1174 <SensorSetMode_OV7660+0x54>
mov    $0x3b,%edi
mov    $0x2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x92,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x93,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9d,%edi
mov    $0x4c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x9e,%edi
mov    $0x3f,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe7,%esi
pop    %rax
jmp    1040 <VIM_SIF_I2cWriteByte@plt>
lea    0x7(%rsp),%rsi
mov    $0x3b,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl 0x7(%rsp),%esi
and    $0x8,%esi
or     $0x2,%esi
mov    $0x3b,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2d,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2e,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x13,%edi
mov    $0xe7,%esi
jmp    1253 <SensorSetMode_OV7660+0x133>
lea    0x7(%rsp),%rsi
mov    $0x3b,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl 0x7(%rsp),%esi
and    $0x8,%esi
or     $0xa0,%esi
mov    $0x3b,%edi
call   1040 <VIM_SIF_I2cWriteByte@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SensorSetMode_OV7660(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 %48 [
i32 1, label %6
i32 2, label %16
i32 4, label %26
i32 3, label %35
]
6: ; preds = %1
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 10)
%8 = call i32 @VIM_SIF_I2cWriteByte(i32 146, i32 102)
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 147, i32 0)
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%11 = call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%13 = call i32 @VIM_SIF_I2cWriteByte(i32 157, i32 76)
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 158, i32 63)
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %49
16: ; preds = %1
%17 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 2)
%18 = call i32 @VIM_SIF_I2cWriteByte(i32 146, i32 0)
%19 = call i32 @VIM_SIF_I2cWriteByte(i32 147, i32 0)
%20 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%21 = call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%22 = call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%23 = call i32 @VIM_SIF_I2cWriteByte(i32 157, i32 76)
%24 = call i32 @VIM_SIF_I2cWriteByte(i32 158, i32 63)
%25 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %49
26: ; preds = %1
%27 = call i32 @VIM_SIF_I2cReadByte(i32 59, i8* %3)
%28 = load i8, i8* %3
%29 = zext i8 %28 to i32
%30 = and i32 %29, 8
%31 = or i32 160, %30
%32 = trunc i32 %31 to i8
%33 = zext i8 %32 to i32
%34 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 %33)
br label %49
35: ; preds = %1
%36 = call i32 @VIM_SIF_I2cReadByte(i32 59, i8* %3)
%37 = load i8, i8* %3
%38 = zext i8 %37 to i32
%39 = and i32 %38, 8
%40 = or i32 2, %39
%41 = trunc i32 %40 to i8
%42 = zext i8 %41 to i32
%43 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 %42)
%44 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%45 = call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%46 = call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%47 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %49
48: ; preds = %1
br label %49
49: ; preds = %48, %35, %26, %16, %6
ret void
}

LLVM IR (-O2):
define void @SensorSetMode_OV7660(i8 zeroext %0) {
%2 = alloca i8
switch i8 %0, label %41 [
i8 1, label %3
i8 2, label %13
i8 4, label %23
i8 3, label %30
]
3: ; preds = %1
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 10)
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i32 146, i32 102)
%6 = tail call i32 @VIM_SIF_I2cWriteByte(i32 147, i32 0)
%7 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%8 = tail call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%9 = tail call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%10 = tail call i32 @VIM_SIF_I2cWriteByte(i32 157, i32 76)
%11 = tail call i32 @VIM_SIF_I2cWriteByte(i32 158, i32 63)
%12 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %41
13: ; preds = %1
%14 = tail call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 2)
%15 = tail call i32 @VIM_SIF_I2cWriteByte(i32 146, i32 0)
%16 = tail call i32 @VIM_SIF_I2cWriteByte(i32 147, i32 0)
%17 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%18 = tail call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%19 = tail call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%20 = tail call i32 @VIM_SIF_I2cWriteByte(i32 157, i32 76)
%21 = tail call i32 @VIM_SIF_I2cWriteByte(i32 158, i32 63)
%22 = tail call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %41
23: ; preds = %1
%24 = call i32 @VIM_SIF_I2cReadByte(i32 59, i8* %2)
%25 = load i8, i8* %2
%26 = and i8 %25, 8
%27 = or i8 %26, -96
%28 = zext i8 %27 to i32
%29 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 %28)
br label %41
30: ; preds = %1
%31 = call i32 @VIM_SIF_I2cReadByte(i32 59, i8* %2)
%32 = load i8, i8* %2
%33 = and i8 %32, 8
%34 = or i8 %33, 2
%35 = zext i8 %34 to i32
%36 = call i32 @VIM_SIF_I2cWriteByte(i32 59, i32 %35)
%37 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 226)
%38 = call i32 @VIM_SIF_I2cWriteByte(i32 45, i32 0)
%39 = call i32 @VIM_SIF_I2cWriteByte(i32 46, i32 0)
%40 = call i32 @VIM_SIF_I2cWriteByte(i32 19, i32 231)
br label %41
41: ; preds = %1, %30, %23, %13, %3
ret void
}