#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*/ hwI2CInit(int);
unsigned char hwI2CReadReg(int, int);
int /*<<< orphan*/ hwI2CWriteReg(int, int, unsigned char);
int sii164GetDeviceID();
int sii164GetVendorID();
long sii164InitChip(unsigned char edgeSelect, unsigned char busSelect,
                    unsigned char dualEdgeClkSelect, unsigned char hsyncEnable,
                    unsigned char vsyncEnable, unsigned char deskewEnable,
                    unsigned char deskewSetting,
                    unsigned char continuousSyncEnable,
                    unsigned char pllFilterEnable,
                    unsigned char pllFilterValue) {
  unsigned char config;
  hwI2CInit(1);
  if ((sii164GetVendorID() == 0x0001) && (sii164GetDeviceID() == 0x0006)) {
    if (edgeSelect == 0)
      config = 0x00;
    else
      config = 0x02;
    if (busSelect == 0)
      config |= 0x00;
    else
      config |= 0x04;
    if (dualEdgeClkSelect == 0)
      config |= 0x00;
    else
      config |= 0x08;
    if (hsyncEnable == 0)
      config |= 0x00;
    else
      config |= 0x10;
    if (vsyncEnable == 0)
      config |= 0x00;
    else
      config |= 0x20;
    hwI2CWriteReg(0x70, 0x08, config);
    if (deskewEnable == 0)
      config = 0x00;
    else
      config = 0x10;
    switch (deskewSetting) {
    case 0:
      config |= 0x00;
      break;
    case 1:
      config |= 0x20;
      break;
    case 2:
      config |= 0x40;
      break;
    case 3:
      config |= 0x60;
      break;
    case 4:
      config |= 0x80;
      break;
    case 5:
      config |= 0xA0;
      break;
    case 6:
      config |= 0xC0;
      break;
    case 7:
      config |= 0xE0;
      break;
    }
    hwI2CWriteReg(0x70, 0x0A, config);
    if (continuousSyncEnable == 0)
      config = 0x00;
    else
      config = 0x80;
    if (pllFilterEnable == 0)
      config |= 0x00;
    else
      config |= 0x01;
    config |= ((pllFilterValue & 0x07) << 1);
    hwI2CWriteReg(0x70, 0x0C, config);
    config = hwI2CReadReg(0x70, 0x08);
    config |= 0x01;
    hwI2CWriteReg(0x70, 0x08, config);
    return 0;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<sii164InitChip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x20(%rbp)
mov    %ecx,%eax
mov    -0x20(%rbp),%ecx
mov    %eax,-0x1c(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
mov    %eax,-0x18(%rbp)
mov    %esi,%eax
mov    -0x18(%rbp),%esi
mov    %eax,-0x14(%rbp)
mov    %edi,%r8d
mov    -0x14(%rbp),%edi
mov    %r9b,%al
mov    0x28(%rbp),%r9b
mov    0x20(%rbp),%r9b
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8b,-0x9(%rbp)
mov    %dil,-0xa(%rbp)
mov    %sil,-0xb(%rbp)
mov    %dl,-0xc(%rbp)
mov    %cl,-0xd(%rbp)
mov    %al,-0xe(%rbp)
mov    $0x1,%edi
call   1070 <hwI2CInit@plt>
mov    $0x0,%al
call   1040 <sii164GetVendorID@plt>
cmp    $0x1,%eax
jne    1401 <sii164InitChip+0x2b1>
mov    $0x0,%al
call   1030 <sii164GetDeviceID@plt>
cmp    $0x6,%eax
jne    1401 <sii164InitChip+0x2b1>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    11e2 <sii164InitChip+0x92>
movb   $0x0,-0xf(%rbp)
jmp    11e6 <sii164InitChip+0x96>
movb   $0x2,-0xf(%rbp)
movzbl -0xa(%rbp),%eax
cmp    $0x0,%eax
jne    1202 <sii164InitChip+0xb2>
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    120c <sii164InitChip+0xbc>
movzbl -0xf(%rbp),%eax
or     $0x4,%eax
mov    %al,-0xf(%rbp)
movzbl -0xb(%rbp),%eax
cmp    $0x0,%eax
jne    1228 <sii164InitChip+0xd8>
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    1232 <sii164InitChip+0xe2>
movzbl -0xf(%rbp),%eax
or     $0x8,%eax
mov    %al,-0xf(%rbp)
movzbl -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    124e <sii164InitChip+0xfe>
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    1258 <sii164InitChip+0x108>
movzbl -0xf(%rbp),%eax
or     $0x10,%eax
mov    %al,-0xf(%rbp)
movzbl -0xd(%rbp),%eax
cmp    $0x0,%eax
jne    1274 <sii164InitChip+0x124>
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    127e <sii164InitChip+0x12e>
movzbl -0xf(%rbp),%eax
or     $0x20,%eax
mov    %al,-0xf(%rbp)
mov    $0x70,%edi
mov    $0x8,%esi
movzbl -0xf(%rbp),%edx
call   1060 <hwI2CWriteReg@plt>
movzbl -0xe(%rbp),%eax
cmp    $0x0,%eax
jne    12a7 <sii164InitChip+0x157>
movb   $0x0,-0xf(%rbp)
jmp    12ab <sii164InitChip+0x15b>
movb   $0x10,-0xf(%rbp)
movzbl 0x10(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x7,%rax
ja     134c <sii164InitChip+0x1fc>
mov    -0x28(%rbp),%rax
lea    0xd38(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0x20,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0x40,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0x60,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0x80,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0xa0,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0xc0,%eax
mov    %al,-0xf(%rbp)
jmp    134c <sii164InitChip+0x1fc>
movzbl -0xf(%rbp),%eax
or     $0xe0,%eax
mov    %al,-0xf(%rbp)
mov    $0x70,%edi
mov    $0xa,%esi
movzbl -0xf(%rbp),%edx
call   1060 <hwI2CWriteReg@plt>
movzbl 0x18(%rbp),%eax
cmp    $0x0,%eax
jne    1375 <sii164InitChip+0x225>
movb   $0x0,-0xf(%rbp)
jmp    1379 <sii164InitChip+0x229>
movb   $0x80,-0xf(%rbp)
movzbl 0x20(%rbp),%eax
cmp    $0x0,%eax
jne    1395 <sii164InitChip+0x245>
movzbl -0xf(%rbp),%eax
or     $0x0,%eax
mov    %al,-0xf(%rbp)
jmp    139f <sii164InitChip+0x24f>
movzbl -0xf(%rbp),%eax
or     $0x1,%eax
mov    %al,-0xf(%rbp)
movzbl 0x28(%rbp),%ecx
and    $0x7,%ecx
shl    $0x1,%ecx
movzbl -0xf(%rbp),%eax
or     %ecx,%eax
mov    %al,-0xf(%rbp)
mov    $0x70,%edi
mov    $0xc,%esi
movzbl -0xf(%rbp),%edx
call   1060 <hwI2CWriteReg@plt>
mov    $0x70,%edi
mov    $0x8,%esi
call   1050 <hwI2CReadReg@plt>
mov    %al,-0xf(%rbp)
movzbl -0xf(%rbp),%eax
or     $0x1,%eax
mov    %al,-0xf(%rbp)
mov    $0x70,%edi
mov    $0x8,%esi
movzbl -0xf(%rbp),%edx
call   1060 <hwI2CWriteReg@plt>
movq   $0x0,-0x8(%rbp)
jmp    1409 <sii164InitChip+0x2b9>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sii164InitChip>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,0x4(%rsp)
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1070 <hwI2CInit@plt>
xor    %eax,%eax
call   1040 <sii164GetVendorID@plt>
mov    $0xffffffffffffffff,%r14
cmp    $0x1,%eax
jne    12a0 <sii164InitChip+0x150>
xor    %eax,%eax
call   1030 <sii164GetDeviceID@plt>
cmp    $0x6,%eax
jne    12a0 <sii164InitChip+0x150>
mov    0x58(%rsp),%r14b
test   %bpl,%bpl
setne  %al
add    %al,%al
lea    0x4(%rax),%ecx
test   %bl,%bl
movzbl %al,%eax
movzbl %cl,%ecx
cmove  %eax,%ecx
lea    0x8(%rcx),%eax
test   %r13b,%r13b
movzbl %al,%eax
cmove  %ecx,%eax
mov    0x40(%rsp),%bl
mov    %eax,%ecx
or     $0x10,%cl
test   %r12b,%r12b
movzbl %cl,%ecx
cmove  %eax,%ecx
mov    %ecx,%eax
or     $0x20,%al
test   %r15b,%r15b
movzbl %al,%eax
cmove  %ecx,%eax
movzbl %al,%edx
mov    $0x70,%edi
mov    $0x8,%esi
call   1060 <hwI2CWriteReg@plt>
cmpb   $0x0,0x4(%rsp)
setne  %al
shl    $0x4,%al
add    $0xff,%bl
cmp    $0x6,%bl
ja     1236 <sii164InitChip+0xe6>
movzbl %bl,%ecx
lea    0xded(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
or     $0x20,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0x40,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0x60,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0x80,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0xa0,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0xc0,%al
jmp    1236 <sii164InitChip+0xe6>
or     $0xe0,%al
movzbl %al,%edx
mov    $0x70,%edi
mov    $0xa,%esi
call   1060 <hwI2CWriteReg@plt>
cmpb   $0x0,0x48(%rsp)
setne  %al
shl    $0x7,%al
cmpb   $0x0,0x50(%rsp)
setne  %cl
or     %al,%cl
add    %r14b,%r14b
and    $0xe,%r14b
or     %cl,%r14b
movzbl %r14b,%edx
mov    $0x70,%edi
mov    $0xc,%esi
call   1060 <hwI2CWriteReg@plt>
mov    $0x70,%edi
mov    $0x8,%esi
call   1050 <hwI2CReadReg@plt>
or     $0x1,%al
movzbl %al,%edx
mov    $0x70,%edi
mov    $0x8,%esi
call   1060 <hwI2CWriteReg@plt>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @sii164InitChip(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8 zeroext %8, i8 zeroext %9) {
%11 = alloca i64
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
%17 = alloca i8
%18 = alloca i8
%19 = alloca i8
%20 = alloca i8
%21 = alloca i8
%22 = alloca i8
store i8 %0, i8* %12
store i8 %1, i8* %13
store i8 %2, i8* %14
store i8 %3, i8* %15
store i8 %4, i8* %16
store i8 %5, i8* %17
store i8 %6, i8* %18
store i8 %7, i8* %19
store i8 %8, i8* %20
store i8 %9, i8* %21
%23 = call i32 @hwI2CInit(i32 1)
%24 = call i32 (...) @sii164GetVendorID()
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %182
26: ; preds = %10
%27 = call i32 (...) @sii164GetDeviceID()
%28 = icmp eq i32 %27, 6
br i1 %28, label %29, label %182
29: ; preds = %26
%30 = load i8, i8* %12
%31 = zext i8 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29
store i8 0, i8* %22
br label %35
34: ; preds = %29
store i8 2, i8* %22
br label %35
35: ; preds = %34, %33
%36 = load i8, i8* %13
%37 = zext i8 %36 to i32
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = load i8, i8* %22
%41 = zext i8 %40 to i32
%42 = or i32 %41, 0
%43 = trunc i32 %42 to i8
store i8 %43, i8* %22
br label %49
44: ; preds = %35
%45 = load i8, i8* %22
%46 = zext i8 %45 to i32
%47 = or i32 %46, 4
%48 = trunc i32 %47 to i8
store i8 %48, i8* %22
br label %49
49: ; preds = %44, %39
%50 = load i8, i8* %14
%51 = zext i8 %50 to i32
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %58
53: ; preds = %49
%54 = load i8, i8* %22
%55 = zext i8 %54 to i32
%56 = or i32 %55, 0
%57 = trunc i32 %56 to i8
store i8 %57, i8* %22
br label %63
58: ; preds = %49
%59 = load i8, i8* %22
%60 = zext i8 %59 to i32
%61 = or i32 %60, 8
%62 = trunc i32 %61 to i8
store i8 %62, i8* %22
br label %63
63: ; preds = %58, %53
%64 = load i8, i8* %15
%65 = zext i8 %64 to i32
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %63
%68 = load i8, i8* %22
%69 = zext i8 %68 to i32
%70 = or i32 %69, 0
%71 = trunc i32 %70 to i8
store i8 %71, i8* %22
br label %77
72: ; preds = %63
%73 = load i8, i8* %22
%74 = zext i8 %73 to i32
%75 = or i32 %74, 16
%76 = trunc i32 %75 to i8
store i8 %76, i8* %22
br label %77
77: ; preds = %72, %67
%78 = load i8, i8* %16
%79 = zext i8 %78 to i32
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = load i8, i8* %22
%83 = zext i8 %82 to i32
%84 = or i32 %83, 0
%85 = trunc i32 %84 to i8
store i8 %85, i8* %22
br label %91
86: ; preds = %77
%87 = load i8, i8* %22
%88 = zext i8 %87 to i32
%89 = or i32 %88, 32
%90 = trunc i32 %89 to i8
store i8 %90, i8* %22
br label %91
91: ; preds = %86, %81
%92 = load i8, i8* %22
%93 = call i32 @hwI2CWriteReg(i32 112, i32 8, i8 zeroext %92)
%94 = load i8, i8* %17
%95 = zext i8 %94 to i32
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %98
97: ; preds = %91
store i8 0, i8* %22
br label %99
98: ; preds = %91
store i8 16, i8* %22
br label %99
99: ; preds = %98, %97
%100 = load i8, i8* %18
%101 = zext i8 %100 to i32
switch i32 %101, label %142 [
i32 0, label %102
i32 1, label %107
i32 2, label %112
i32 3, label %117
i32 4, label %122
i32 5, label %127
i32 6, label %132
i32 7, label %137
]
102: ; preds = %99
%103 = load i8, i8* %22
%104 = zext i8 %103 to i32
%105 = or i32 %104, 0
%106 = trunc i32 %105 to i8
store i8 %106, i8* %22
br label %142
107: ; preds = %99
%108 = load i8, i8* %22
%109 = zext i8 %108 to i32
%110 = or i32 %109, 32
%111 = trunc i32 %110 to i8
store i8 %111, i8* %22
br label %142
112: ; preds = %99
%113 = load i8, i8* %22
%114 = zext i8 %113 to i32
%115 = or i32 %114, 64
%116 = trunc i32 %115 to i8
store i8 %116, i8* %22
br label %142
117: ; preds = %99
%118 = load i8, i8* %22
%119 = zext i8 %118 to i32
%120 = or i32 %119, 96
%121 = trunc i32 %120 to i8
store i8 %121, i8* %22
br label %142
122: ; preds = %99
%123 = load i8, i8* %22
%124 = zext i8 %123 to i32
%125 = or i32 %124, 128
%126 = trunc i32 %125 to i8
store i8 %126, i8* %22
br label %142
127: ; preds = %99
%128 = load i8, i8* %22
%129 = zext i8 %128 to i32
%130 = or i32 %129, 160
%131 = trunc i32 %130 to i8
store i8 %131, i8* %22
br label %142
132: ; preds = %99
%133 = load i8, i8* %22
%134 = zext i8 %133 to i32
%135 = or i32 %134, 192
%136 = trunc i32 %135 to i8
store i8 %136, i8* %22
br label %142
137: ; preds = %99
%138 = load i8, i8* %22
%139 = zext i8 %138 to i32
%140 = or i32 %139, 224
%141 = trunc i32 %140 to i8
store i8 %141, i8* %22
br label %142
142: ; preds = %99, %137, %132, %127, %122, %117, %112, %107, %102
%143 = load i8, i8* %22
%144 = call i32 @hwI2CWriteReg(i32 112, i32 10, i8 zeroext %143)
%145 = load i8, i8* %19
%146 = zext i8 %145 to i32
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %149
148: ; preds = %142
store i8 0, i8* %22
br label %150
149: ; preds = %142
store i8 -128, i8* %22
br label %150
150: ; preds = %149, %148
%151 = load i8, i8* %20
%152 = zext i8 %151 to i32
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %159
154: ; preds = %150
%155 = load i8, i8* %22
%156 = zext i8 %155 to i32
%157 = or i32 %156, 0
%158 = trunc i32 %157 to i8
store i8 %158, i8* %22
br label %164
159: ; preds = %150
%160 = load i8, i8* %22
%161 = zext i8 %160 to i32
%162 = or i32 %161, 1
%163 = trunc i32 %162 to i8
store i8 %163, i8* %22
br label %164
164: ; preds = %159, %154
%165 = load i8, i8* %21
%166 = zext i8 %165 to i32
%167 = and i32 %166, 7
%168 = shl i32 %167, 1
%169 = load i8, i8* %22
%170 = zext i8 %169 to i32
%171 = or i32 %170, %168
%172 = trunc i32 %171 to i8
store i8 %172, i8* %22
%173 = load i8, i8* %22
%174 = call i32 @hwI2CWriteReg(i32 112, i32 12, i8 zeroext %173)
%175 = call zeroext i8 @hwI2CReadReg(i32 112, i32 8)
store i8 %175, i8* %22
%176 = load i8, i8* %22
%177 = zext i8 %176 to i32
%178 = or i32 %177, 1
%179 = trunc i32 %178 to i8
store i8 %179, i8* %22
%180 = load i8, i8* %22
%181 = call i32 @hwI2CWriteReg(i32 112, i32 8, i8 zeroext %180)
store i64 0, i64* %11
br label %183
182: ; preds = %26, %10
store i64 -1, i64* %11
br label %183
183: ; preds = %182, %164
%184 = load i64, i64* %11
ret i64 %184
}

LLVM IR (-O2):
define i64 @sii164InitChip(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5, i8 zeroext %6, i8 zeroext %7, i8 zeroext %8, i8 zeroext %9) {
%11 = tail call i32 @hwI2CInit(i32 1)
%12 = tail call i32 (...) @sii164GetVendorID()
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %64
14: ; preds = %10
%15 = tail call i32 (...) @sii164GetDeviceID()
%16 = icmp eq i32 %15, 6
br i1 %16, label %17, label %64
17: ; preds = %14
%18 = icmp eq i8 %0, 0
%19 = select i1 %18, i8 0, i8 2
%20 = icmp eq i8 %1, 0
%21 = or i8 %19, 4
%22 = select i1 %20, i8 %19, i8 %21
%23 = icmp eq i8 %2, 0
%24 = or i8 %22, 8
%25 = select i1 %23, i8 %22, i8 %24
%26 = icmp eq i8 %3, 0
%27 = or i8 %25, 16
%28 = select i1 %26, i8 %25, i8 %27
%29 = icmp eq i8 %4, 0
%30 = or i8 %28, 32
%31 = select i1 %29, i8 %28, i8 %30
%32 = tail call i32 @hwI2CWriteReg(i32 112, i32 8, i8 zeroext %31)
%33 = icmp eq i8 %5, 0
%34 = select i1 %33, i8 0, i8 16
switch i8 %6, label %49 [
i8 7, label %47
i8 1, label %35
i8 2, label %37
i8 3, label %39
i8 4, label %41
i8 5, label %43
i8 6, label %45
]
35: ; preds = %17
%36 = or i8 %34, 32
br label %49
37: ; preds = %17
%38 = or i8 %34, 64
br label %49
39: ; preds = %17
%40 = or i8 %34, 96
br label %49
41: ; preds = %17
%42 = or i8 %34, -128
br label %49
43: ; preds = %17
%44 = or i8 %34, -96
br label %49
45: ; preds = %17
%46 = or i8 %34, -64
br label %49
47: ; preds = %17
%48 = or i8 %34, -32
br label %49
49: ; preds = %17, %47, %45, %43, %41, %39, %37, %35
%50 = phi i8 [ %48, %47 ], [ %46, %45 ], [ %44, %43 ], [ %42, %41 ], [ %40, %39 ], [ %38, %37 ], [ %36, %35 ], [ %34, %17 ]
%51 = tail call i32 @hwI2CWriteReg(i32 112, i32 10, i8 zeroext %50)
%52 = icmp eq i8 %7, 0
%53 = select i1 %52, i8 0, i8 -128
%54 = icmp ne i8 %8, 0
%55 = zext i1 %54 to i8
%56 = or i8 %53, %55
%57 = shl i8 %9, 1
%58 = and i8 %57, 14
%59 = or i8 %56, %58
%60 = tail call i32 @hwI2CWriteReg(i32 112, i32 12, i8 zeroext %59)
%61 = tail call zeroext i8 @hwI2CReadReg(i32 112, i32 8)
%62 = or i8 %61, 1
%63 = tail call i32 @hwI2CWriteReg(i32 112, i32 8, i8 zeroext %62)
br label %64
64: ; preds = %10, %14, %49
%65 = phi i64 [ 0, %49 ], [ -1, %14 ], [ -1, %10 ]
ret i64 %65
}