#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*/ E2pDat();
int /*<<< orphan*/ IniAdj();
int /*<<< orphan*/ IniClAf();
int /*<<< orphan*/ IniClk();
scalar_t__ IniDgy();
scalar_t__ IniFil();
int /*<<< orphan*/ IniGyr();
int /*<<< orphan*/ IniIop();
int /*<<< orphan*/ IniSrv();
scalar_t__ OnsemiI2CCheck();
int /*<<< orphan*/ RegWriteA(int, int);
scalar_t__ VerInf();
int /*<<< orphan*/ WitTim(int);
int IniSet(void) {
  if (OnsemiI2CCheck() == 0)
    return -1;
  RegWriteA(0x0278, 0x30);
  WitTim(5);
  E2pDat();
  if (VerInf() != 0)
    return -2;
  IniClk();
  IniIop();
  IniSrv();
  IniGyr();
  if (IniFil() != 0)
    return -1;
  if (IniDgy() != 0)
    return -1;
  IniAdj();
  IniClAf();
  return 0;
}


x86 assembly (clang, -O0):
<IniSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   10d0 <OnsemiI2CCheck@plt>
cmp    $0x0,%rax
jne    11f5 <IniSet+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    129d <IniSet+0xcd>
mov    $0x278,%edi
mov    $0x30,%esi
call   10f0 <RegWriteA@plt>
mov    $0x5,%edi
call   10a0 <WitTim@plt>
mov    $0x0,%al
call   1040 <E2pDat@plt>
mov    $0x0,%al
call   1080 <VerInf@plt>
cmp    $0x0,%rax
je     1232 <IniSet+0x62>
movl   $0xfffffffe,-0x4(%rbp)
jmp    129d <IniSet+0xcd>
mov    $0x0,%al
call   1030 <IniClk@plt>
mov    $0x0,%al
call   1050 <IniIop@plt>
mov    $0x0,%al
call   10c0 <IniSrv@plt>
mov    $0x0,%al
call   1090 <IniGyr@plt>
mov    $0x0,%al
call   1060 <IniFil@plt>
cmp    $0x0,%rax
je     126b <IniSet+0x9b>
movl   $0xffffffff,-0x4(%rbp)
jmp    129d <IniSet+0xcd>
mov    $0x0,%al
call   10e0 <IniDgy@plt>
cmp    $0x0,%rax
je     1288 <IniSet+0xb8>
movl   $0xffffffff,-0x4(%rbp)
jmp    129d <IniSet+0xcd>
mov    $0x0,%al
call   10b0 <IniAdj@plt>
mov    $0x0,%al
call   1070 <IniClAf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSet>:
push   %rax
xor    %eax,%eax
call   10d0 <OnsemiI2CCheck@plt>
test   %rax,%rax
je     123b <IniSet+0x6b>
mov    $0x278,%edi
mov    $0x30,%esi
call   10f0 <RegWriteA@plt>
mov    $0x5,%edi
call   10a0 <WitTim@plt>
xor    %eax,%eax
call   1040 <E2pDat@plt>
xor    %eax,%eax
call   1080 <VerInf@plt>
mov    %rax,%rcx
mov    $0xfffffffe,%eax
test   %rcx,%rcx
je     1213 <IniSet+0x43>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <IniClk@plt>
xor    %eax,%eax
call   1050 <IniIop@plt>
xor    %eax,%eax
call   10c0 <IniSrv@plt>
xor    %eax,%eax
call   1090 <IniGyr@plt>
xor    %eax,%eax
call   1060 <IniFil@plt>
test   %rax,%rax
je     1242 <IniSet+0x72>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
call   10e0 <IniDgy@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1211 <IniSet+0x41>
xor    %eax,%eax
call   10b0 <IniAdj@plt>
xor    %eax,%eax
call   1070 <IniClAf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IniSet() {
%1 = alloca i32
%2 = call i64 (...) @OnsemiI2CCheck()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %27
5: ; preds = %0
%6 = call i32 @RegWriteA(i32 632, i32 48)
%7 = call i32 @WitTim(i32 5)
%8 = call i32 (...) @E2pDat()
%9 = call i64 (...) @VerInf()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %5
store i32 -2, i32* %1
br label %27
12: ; preds = %5
%13 = call i32 (...) @IniClk()
%14 = call i32 (...) @IniIop()
%15 = call i32 (...) @IniSrv()
%16 = call i32 (...) @IniGyr()
%17 = call i64 (...) @IniFil()
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 -1, i32* %1
br label %27
20: ; preds = %12
%21 = call i64 (...) @IniDgy()
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 -1, i32* %1
br label %27
24: ; preds = %20
%25 = call i32 (...) @IniAdj()
%26 = call i32 (...) @IniClAf()
store i32 0, i32* %1
br label %27
27: ; preds = %24, %23, %19, %11, %4
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @IniSet() {
%1 = tail call i64 (...) @OnsemiI2CCheck()
%2 = icmp eq i64 %1, 0
br i1 %2, label %22, label %3
3: ; preds = %0
%4 = tail call i32 @RegWriteA(i32 632, i32 48)
%5 = tail call i32 @WitTim(i32 5)
%6 = tail call i32 (...) @E2pDat()
%7 = tail call i64 (...) @VerInf()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %3
%10 = tail call i32 (...) @IniClk()
%11 = tail call i32 (...) @IniIop()
%12 = tail call i32 (...) @IniSrv()
%13 = tail call i32 (...) @IniGyr()
%14 = tail call i64 (...) @IniFil()
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %9
%17 = tail call i64 (...) @IniDgy()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = tail call i32 (...) @IniAdj()
%21 = tail call i32 (...) @IniClAf()
br label %22
22: ; preds = %16, %9, %3, %0, %19
%23 = phi i32 [ 0, %19 ], [ -1, %0 ], [ -2, %3 ], [ -1, %9 ], [ -1, %16 ]
ret i32 %23
}