#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*/ liic_delay_(unsigned int);
scalar_t__ liic_scl_(unsigned int, int);
scalar_t__ liic_sda_(unsigned int, int);
scalar_t__ reset(unsigned int);
int start(unsigned num) {
  if ((liic_sda_(num, 1) == 0) || (liic_scl_(num, 1) == 0))
    if (reset(num) != 0)
      return -1;
  liic_sda_(num, 0);
  liic_delay_(num);
  return 0;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1060 <liic_sda_@plt>
cmp    $0x0,%rax
je     1179 <start+0x39>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <liic_scl_@plt>
cmp    $0x0,%rax
jne    119c <start+0x5c>
mov    -0x8(%rbp),%edi
call   1050 <reset@plt>
cmp    $0x0,%rax
je     1197 <start+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b5 <start+0x75>
jmp    119c <start+0x5c>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1060 <liic_sda_@plt>
mov    -0x8(%rbp),%edi
call   1040 <liic_delay_@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%esi
call   1060 <liic_sda_@plt>
test   %rax,%rax
je     1165 <start+0x25>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <liic_scl_@plt>
test   %rax,%rax
jne    1176 <start+0x36>
mov    %ebx,%edi
call   1050 <reset@plt>
mov    $0xffffffff,%ebp
test   %rax,%rax
jne    1188 <start+0x48>
xor    %ebp,%ebp
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <liic_sda_@plt>
mov    %ebx,%edi
call   1040 <liic_delay_@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @start(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @liic_sda_(i32 %4, i32 1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @liic_scl_(i32 %8, i32 1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = call i64 @reset(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %22
16: ; preds = %11
br label %17
17: ; preds = %16, %7
%18 = load i32, i32* %3
%19 = call i64 @liic_sda_(i32 %18, i32 0)
%20 = load i32, i32* %3
%21 = call i32 @liic_delay_(i32 %20)
store i32 0, i32* %2
br label %22
22: ; preds = %17, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @start(i32 %0) {
%2 = tail call i64 @liic_sda_(i32 %0, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @liic_scl_(i32 %0, i32 1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4, %1
%8 = tail call i64 @reset(i32 %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7, %4
%11 = tail call i64 @liic_sda_(i32 %0, i32 0)
%12 = tail call i32 @liic_delay_(i32 %0)
br label %13
13: ; preds = %7, %10
%14 = phi i32 [ 0, %10 ], [ -1, %7 ]
ret i32 %14
}