#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*/ I2CAL_output_clock(int);
int /*<<< orphan*/ I2CAL_output_data(int);
void SendI2CData(unsigned char inData) {
  unsigned char bit;
  for (bit = 0x80; bit != 0; bit >>= 1) {
    if (inData & bit)
      I2CAL_output_data(1);
    else
      I2CAL_output_data(0);
    I2CAL_output_clock(1);
    I2CAL_output_clock(0);
  }
}


x86 assembly (clang, -O0):
<SendI2CData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x80,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1188 <SendI2CData+0x68>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1161 <SendI2CData+0x41>
mov    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
jmp    1168 <SendI2CData+0x48>
xor    %edi,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
movzbl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x2(%rbp)
jmp    1132 <SendI2CData+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendI2CData>:
push   %rbx
mov    %edi,%ebx
shr    $0x7,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
call   1040 <I2CAL_output_clock@plt>
and    $0x1,%ebx
mov    %ebx,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <I2CAL_output_clock@plt>

LLVM IR (-O0):
define void @SendI2CData(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 -128, i8* %3
br label %4
4: ; preds = %22, %1
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %4
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = call i32 @I2CAL_output_data(i32 1)
br label %19
17: ; preds = %8
%18 = call i32 @I2CAL_output_data(i32 0)
br label %19
19: ; preds = %17, %15
%20 = call i32 @I2CAL_output_clock(i32 1)
%21 = call i32 @I2CAL_output_clock(i32 0)
br label %22
22: ; preds = %19
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %4
27: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @SendI2CData(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = lshr i32 %2, 7
%4 = tail call i32 @I2CAL_output_data(i32 %3)
%5 = tail call i32 @I2CAL_output_clock(i32 1)
%6 = tail call i32 @I2CAL_output_clock(i32 0)
%7 = lshr i32 %2, 6
%8 = and i32 %7, 1
%9 = tail call i32 @I2CAL_output_data(i32 %8)
%10 = tail call i32 @I2CAL_output_clock(i32 1)
%11 = tail call i32 @I2CAL_output_clock(i32 0)
%12 = lshr i32 %2, 5
%13 = and i32 %12, 1
%14 = tail call i32 @I2CAL_output_data(i32 %13)
%15 = tail call i32 @I2CAL_output_clock(i32 1)
%16 = tail call i32 @I2CAL_output_clock(i32 0)
%17 = lshr i32 %2, 4
%18 = and i32 %17, 1
%19 = tail call i32 @I2CAL_output_data(i32 %18)
%20 = tail call i32 @I2CAL_output_clock(i32 1)
%21 = tail call i32 @I2CAL_output_clock(i32 0)
%22 = lshr i32 %2, 3
%23 = and i32 %22, 1
%24 = tail call i32 @I2CAL_output_data(i32 %23)
%25 = tail call i32 @I2CAL_output_clock(i32 1)
%26 = tail call i32 @I2CAL_output_clock(i32 0)
%27 = lshr i32 %2, 2
%28 = and i32 %27, 1
%29 = tail call i32 @I2CAL_output_data(i32 %28)
%30 = tail call i32 @I2CAL_output_clock(i32 1)
%31 = tail call i32 @I2CAL_output_clock(i32 0)
%32 = lshr i32 %2, 1
%33 = and i32 %32, 1
%34 = tail call i32 @I2CAL_output_data(i32 %33)
%35 = tail call i32 @I2CAL_output_clock(i32 1)
%36 = tail call i32 @I2CAL_output_clock(i32 0)
%37 = and i32 %2, 1
%38 = tail call i32 @I2CAL_output_data(i32 %37)
%39 = tail call i32 @I2CAL_output_clock(i32 1)
%40 = tail call i32 @I2CAL_output_clock(i32 0)
ret void
}