#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 SensorSetMirrorFlip_OM6802(unsigned char val) {
  if (val == 0)
    VIM_SIF_I2cWriteByte(0xfd, 0x40);
  else if (val == 1)
    VIM_SIF_I2cWriteByte(0xfd, 0xc0);
  else if (val == 2)
    VIM_SIF_I2cWriteByte(0xfd, 0x00);
  else if (val == 3)
    VIM_SIF_I2cWriteByte(0xfd, 0x80);
}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_OM6802>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    113f <SensorSetMirrorFlip_OM6802+0x2f>
mov    $0xfd,%edi
mov    $0x40,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11a9 <SensorSetMirrorFlip_OM6802+0x99>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1160 <SensorSetMirrorFlip_OM6802+0x50>
mov    $0xfd,%edi
mov    $0xc0,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    11a4 <SensorSetMirrorFlip_OM6802+0x94>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    117e <SensorSetMirrorFlip_OM6802+0x6e>
mov    $0xfd,%edi
xor    %esi,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    119f <SensorSetMirrorFlip_OM6802+0x8f>
movzbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jne    119a <SensorSetMirrorFlip_OM6802+0x8a>
mov    $0xfd,%edi
mov    $0x80,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
jmp    119f <SensorSetMirrorFlip_OM6802+0x8f>
jmp    11a4 <SensorSetMirrorFlip_OM6802+0x94>
jmp    11a9 <SensorSetMirrorFlip_OM6802+0x99>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMirrorFlip_OM6802>:
cmp    $0x3,%dil
ja     112e <SensorSetMirrorFlip_OM6802+0x1e>
movsbq %dil,%rax
lea    0xedf(%rip),%rcx
mov    (%rcx,%rax,4),%esi
mov    $0xfd,%edi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>
ret

LLVM IR (-O0):
define void @SensorSetMirrorFlip_OM6802(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 253, i32 64)
br label %29
8: ; preds = %1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @VIM_SIF_I2cWriteByte(i32 253, i32 192)
br label %28
14: ; preds = %8
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @VIM_SIF_I2cWriteByte(i32 253, i32 0)
br label %27
20: ; preds = %14
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @VIM_SIF_I2cWriteByte(i32 253, i32 128)
br label %26
26: ; preds = %24, %20
br label %27
27: ; preds = %26, %18
br label %28
28: ; preds = %27, %12
br label %29
29: ; preds = %28, %6
ret void
}

LLVM IR (-O2):
@switch.table.SensorSetMirrorFlip_OM6802 = [4 x i32] [i32 64, i32 192, i32 0, i32 128]
define void @SensorSetMirrorFlip_OM6802(i8 zeroext %0) {
%2 = icmp ult i8 %0, 4
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.SensorSetMirrorFlip_OM6802, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @VIM_SIF_I2cWriteByte(i32 253, i32 %6)
br label %8
8: ; preds = %1, %3
ret void
}