#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 LLI2C_output_clock(int);
int LLI2C_output_data(int);
int send_i2c_start(void) {
  int err;
  err = LLI2C_output_data(1);
  if (err)
    return err;
  err = LLI2C_output_clock(1);
  if (err)
    return err;
  err = LLI2C_output_data(0);
  if (err)
    return err;
  err = LLI2C_output_clock(0);
  if (err)
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<send_i2c_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <LLI2C_output_data@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114a <send_i2c_start+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <send_i2c_start+0x91>
mov    $0x1,%edi
call   1040 <LLI2C_output_clock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116c <send_i2c_start+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <send_i2c_start+0x91>
xor    %edi,%edi
call   1030 <LLI2C_output_data@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118b <send_i2c_start+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <send_i2c_start+0x91>
xor    %edi,%edi
call   1040 <LLI2C_output_clock@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11aa <send_i2c_start+0x8a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b1 <send_i2c_start+0x91>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_i2c_start>:
push   %rax
mov    $0x1,%edi
call   1030 <LLI2C_output_data@plt>
test   %eax,%eax
jne    1148 <send_i2c_start+0x28>
mov    $0x1,%edi
call   1040 <LLI2C_output_clock@plt>
test   %eax,%eax
jne    1148 <send_i2c_start+0x28>
xor    %edi,%edi
call   1030 <LLI2C_output_data@plt>
test   %eax,%eax
je     114a <send_i2c_start+0x2a>
pop    %rcx
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <LLI2C_output_clock@plt>

LLVM IR (-O0):
define i32 @send_i2c_start() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @LLI2C_output_data(i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %27
8: ; preds = %0
%9 = call i32 @LLI2C_output_clock(i32 1)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %27
14: ; preds = %8
%15 = call i32 @LLI2C_output_data(i32 0)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %2
store i32 %19, i32* %1
br label %27
20: ; preds = %14
%21 = call i32 @LLI2C_output_clock(i32 0)
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %2
store i32 %25, i32* %1
br label %27
26: ; preds = %20
store i32 0, i32* %1
br label %27
27: ; preds = %26, %24, %18, %12, %6
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
define i32 @send_i2c_start() {
%1 = tail call i32 @LLI2C_output_data(i32 1)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 @LLI2C_output_clock(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i32 @LLI2C_output_data(i32 0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @LLI2C_output_clock(i32 0)
br label %11
11: ; preds = %9, %6, %3, %0
%12 = phi i32 [ %1, %0 ], [ %4, %3 ], [ %7, %6 ], [ %10, %9 ]
ret i32 %12
}