#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*/ SCL(int);
int /*<<< orphan*/ SDA(int);
void SetupBytes(unsigned char Value) {
  int i = 128;
  while (i > 0) {
    if (Value & i) {
      SDA(1);
    } else {
      SDA(0);
    }
    SCL(1);
    SCL(0);
    i = i / 2;
  }
  SDA(1);
  SCL(1);
  SCL(0);
}


x86 assembly (clang, -O0):
<SetupBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x80,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1189 <SetupBytes+0x69>
movzbl -0x1(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     115e <SetupBytes+0x3e>
mov    $0x1,%edi
call   1040 <SDA@plt>
jmp    1165 <SetupBytes+0x45>
xor    %edi,%edi
call   1040 <SDA@plt>
mov    $0x1,%edi
call   1030 <SCL@plt>
xor    %edi,%edi
call   1030 <SCL@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1135 <SetupBytes+0x15>
mov    $0x1,%edi
call   1040 <SDA@plt>
mov    $0x1,%edi
call   1030 <SCL@plt>
xor    %edi,%edi
call   1030 <SCL@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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