#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 SensorSetMode_OV7725(unsigned char val) {
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x11, 0x01);
    VIM_SIF_I2cWriteByte(0x2b, 0x00);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x11, 0x01);
    VIM_SIF_I2cWriteByte(0x2b, 0x9e);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x11, 0x07);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x11, 0x01);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetMode_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    $0x3,%eax
ja     11b3 <SensorSetMode_OV7725+0xa3>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x11,%edi
mov    $0x1,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2b,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b8 <SensorSetMode_OV7725+0xa8>
mov    $0x11,%edi
mov    $0x1,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2b,%edi
mov    $0x9e,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b8 <SensorSetMode_OV7725+0xa8>
mov    $0x11,%edi
mov    $0x7,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b8 <SensorSetMode_OV7725+0xa8>
mov    $0x11,%edi
mov    $0x1,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11b8 <SensorSetMode_OV7725+0xa8>
jmp    11b8 <SensorSetMode_OV7725+0xa8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMode_OV7725>:
push   %rax
add    $0xff,%dil
cmp    $0x3,%dil
ja     114b <SensorSetMode_OV7725+0x3b>
movzbl %dil,%eax
lea    0xeda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x11,%edi
mov    $0x1,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2b,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
pop    %rax
ret
mov    $0x11,%edi
mov    $0x1,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x2b,%edi
mov    $0x9e,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x11,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
mov    $0x11,%edi
mov    $0x7,%esi
pop    %rax
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetMode_OV7725(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 %8
i32 4, label %11
i32 3, label %13
]
5: ; preds = %1
%6 = call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 43, i32 0)
br label %16
8: ; preds = %1
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 43, i32 158)
br label %16
11: ; preds = %1
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 7)
br label %16
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %13, %11, %8, %5
ret void
}

LLVM IR (-O2):
define void @SensorSetMode_OV7725(i8 zeroext %0) {
switch i8 %0, label %12 [
i8 1, label %2
i8 2, label %5
i8 4, label %8
i8 3, label %10
]
2: ; preds = %1
%3 = tail call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i32 43, i32 0)
br label %12
5: ; preds = %1
%6 = tail call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
%7 = tail call i32 @VIM_SIF_I2cWriteByte(i32 43, i32 158)
br label %12
8: ; preds = %1
%9 = tail call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 7)
br label %12
10: ; preds = %1
%11 = tail call i32 @VIM_SIF_I2cWriteByte(i32 17, i32 1)
br label %12
12: ; preds = %1, %10, %8, %5, %2
ret void
}