#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);
int /*<<< orphan*/ VIM_USER_DelayMs(int);
void SensorSetMode_NOON30PC11(unsigned char val) {
  unsigned char uTemp;
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x0b, 0x10);
    VIM_SIF_I2cWriteByte(0x71, 0x01);
    VIM_SIF_I2cWriteByte(0x72, 0x24);
    VIM_SIF_I2cWriteByte(0x73, 0xf8);
    VIM_USER_DelayMs(50);
    VIM_SIF_I2cWriteByte(0x0b, 0x9c);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x0b, 0x00);
    VIM_SIF_I2cWriteByte(0x71, 0x00);
    VIM_SIF_I2cWriteByte(0x72, 0xf4);
    VIM_SIF_I2cWriteByte(0x73, 0x24);
    VIM_USER_DelayMs(50);
    VIM_SIF_I2cWriteByte(0x0b, 0x8c);
    break;
  case 4:
    VIM_SIF_I2cReadByte(0x0b, &uTemp);
    if (uTemp == 0x9c) {
      VIM_SIF_I2cWriteByte(0x0b, 0x10);
      VIM_SIF_I2cWriteByte(0x71, 0x02);
      VIM_SIF_I2cWriteByte(0x72, 0x49);
      VIM_SIF_I2cWriteByte(0x73, 0xf0);
      VIM_USER_DelayMs(50);
      VIM_SIF_I2cWriteByte(0x0b, 0x9c);
    } else {
      VIM_SIF_I2cWriteByte(0x0b, 0x00);
      VIM_SIF_I2cWriteByte(0x71, 0x01);
      VIM_SIF_I2cWriteByte(0x72, 0xe8);
      VIM_SIF_I2cWriteByte(0x73, 0x48);
      VIM_USER_DelayMs(50);
      VIM_SIF_I2cWriteByte(0x0b, 0x8c);
    }
    break;
  case 3:
    VIM_SIF_I2cReadByte(0x0b, &uTemp);
    if (uTemp == 0x9c) {
      VIM_SIF_I2cWriteByte(0x0b, 0x10);
      VIM_SIF_I2cWriteByte(0x71, 0x01);
      VIM_SIF_I2cWriteByte(0x72, 0x24);
      VIM_SIF_I2cWriteByte(0x73, 0xf8);
      VIM_USER_DelayMs(50);
      VIM_SIF_I2cWriteByte(0x0b, 0x9c);
    } else {
      VIM_SIF_I2cWriteByte(0x0b, 0x00);
      VIM_SIF_I2cWriteByte(0x71, 0x00);
      VIM_SIF_I2cWriteByte(0x72, 0xf4);
      VIM_SIF_I2cWriteByte(0x73, 0x24);
      VIM_USER_DelayMs(50);
      VIM_SIF_I2cWriteByte(0x0b, 0x8c);
    }
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetMode_NOON30PC11>:
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     13af <SensorSetMode_NOON30PC11+0x27f>
mov    -0x10(%rbp),%rax
lea    0xea1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf8,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x9c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    13b4 <SensorSetMode_NOON30PC11+0x284>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xf4,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x8c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    13b4 <SensorSetMode_NOON30PC11+0x284>
mov    $0xb,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x9c,%eax
jne    128d <SensorSetMode_NOON30PC11+0x15d>
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x49,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf0,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x9c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    12df <SensorSetMode_NOON30PC11+0x1af>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xe8,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x48,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x8c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    13b4 <SensorSetMode_NOON30PC11+0x284>
mov    $0xb,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x9c,%eax
jne    135b <SensorSetMode_NOON30PC11+0x22b>
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf8,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x9c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    13aa <SensorSetMode_NOON30PC11+0x27a>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xf4,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x8c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
jmp    13b4 <SensorSetMode_NOON30PC11+0x284>
jmp    13b4 <SensorSetMode_NOON30PC11+0x284>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetMode_NOON30PC11>:
push   %rax
add    $0xff,%dil
cmp    $0x3,%dil
ja     1340 <SensorSetMode_NOON30PC11+0x210>
movzbl %dil,%eax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf8,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x9c,%esi
pop    %rax
jmp    1040 <VIM_SIF_I2cWriteByte@plt>
lea    0x7(%rsp),%rsi
mov    $0xb,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
cmpb   $0x9c,0x7(%rsp)
jne    12bb <SensorSetMode_NOON30PC11+0x18b>
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf8,%esi
jmp    124d <SensorSetMode_NOON30PC11+0x11d>
lea    0x7(%rsp),%rsi
mov    $0xb,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
cmpb   $0x9c,0x7(%rsp)
jne    12ee <SensorSetMode_NOON30PC11+0x1be>
mov    $0xb,%edi
mov    $0x10,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x2,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0x49,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0xf0,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x9c,%esi
jmp    133b <SensorSetMode_NOON30PC11+0x20b>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xf4,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x24,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x8c,%esi
pop    %rax
jmp    1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xf4,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x24,%esi
jmp    1322 <SensorSetMode_NOON30PC11+0x1f2>
mov    $0xb,%edi
xor    %esi,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x71,%edi
mov    $0x1,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x72,%edi
mov    $0xe8,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x73,%edi
mov    $0x48,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
mov    $0x32,%edi
call   1050 <VIM_USER_DelayMs@plt>
mov    $0xb,%edi
mov    $0x8c,%esi
call   1040 <VIM_SIF_I2cWriteByte@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SensorSetMode_NOON30PC11(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 %60 [
i32 1, label %6
i32 2, label %13
i32 4, label %20
i32 3, label %40
]
6: ; preds = %1
%7 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%8 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%9 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 36)
%10 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 248)
%11 = call i32 @VIM_USER_DelayMs(i32 50)
%12 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %61
13: ; preds = %1
%14 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%15 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 0)
%16 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 244)
%17 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 36)
%18 = call i32 @VIM_USER_DelayMs(i32 50)
%19 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %61
20: ; preds = %1
%21 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %3)
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = icmp eq i32 %23, 156
br i1 %24, label %25, label %32
25: ; preds = %20
%26 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%27 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 2)
%28 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 73)
%29 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 240)
%30 = call i32 @VIM_USER_DelayMs(i32 50)
%31 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %39
32: ; preds = %20
%33 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%34 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%35 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 232)
%36 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 72)
%37 = call i32 @VIM_USER_DelayMs(i32 50)
%38 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %39
39: ; preds = %32, %25
br label %61
40: ; preds = %1
%41 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %3)
%42 = load i8, i8* %3
%43 = zext i8 %42 to i32
%44 = icmp eq i32 %43, 156
br i1 %44, label %45, label %52
45: ; preds = %40
%46 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%47 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%48 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 36)
%49 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 248)
%50 = call i32 @VIM_USER_DelayMs(i32 50)
%51 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %59
52: ; preds = %40
%53 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%54 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 0)
%55 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 244)
%56 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 36)
%57 = call i32 @VIM_USER_DelayMs(i32 50)
%58 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %59
59: ; preds = %52, %45
br label %61
60: ; preds = %1
br label %61
61: ; preds = %60, %59, %39, %13, %6
ret void
}

LLVM IR (-O2):
define void @SensorSetMode_NOON30PC11(i8 zeroext %0) {
%2 = alloca i8
switch i8 %0, label %53 [
i8 1, label %3
i8 2, label %10
i8 4, label %17
i8 3, label %35
]
3: ; preds = %1
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%6 = tail call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 36)
%7 = tail call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 248)
%8 = tail call i32 @VIM_USER_DelayMs(i32 50)
%9 = tail call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %53
10: ; preds = %1
%11 = tail call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%12 = tail call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 0)
%13 = tail call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 244)
%14 = tail call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 36)
%15 = tail call i32 @VIM_USER_DelayMs(i32 50)
%16 = tail call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %53
17: ; preds = %1
%18 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %2)
%19 = load i8, i8* %2
%20 = icmp eq i8 %19, -100
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%23 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 2)
%24 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 73)
%25 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 240)
%26 = call i32 @VIM_USER_DelayMs(i32 50)
%27 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %53
28: ; preds = %17
%29 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%30 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%31 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 232)
%32 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 72)
%33 = call i32 @VIM_USER_DelayMs(i32 50)
%34 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %53
35: ; preds = %1
%36 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %2)
%37 = load i8, i8* %2
%38 = icmp eq i8 %37, -100
br i1 %38, label %39, label %46
39: ; preds = %35
%40 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 16)
%41 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 1)
%42 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 36)
%43 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 248)
%44 = call i32 @VIM_USER_DelayMs(i32 50)
%45 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 156)
br label %53
46: ; preds = %35
%47 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 0)
%48 = call i32 @VIM_SIF_I2cWriteByte(i32 113, i32 0)
%49 = call i32 @VIM_SIF_I2cWriteByte(i32 114, i32 244)
%50 = call i32 @VIM_SIF_I2cWriteByte(i32 115, i32 36)
%51 = call i32 @VIM_USER_DelayMs(i32 50)
%52 = call i32 @VIM_SIF_I2cWriteByte(i32 11, i32 140)
br label %53
53: ; preds = %1, %39, %46, %21, %28, %10, %3
ret void
}