#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*/ SCK(int);
int /*<<< orphan*/ SI(int);
void Send_Byte(unsigned char out) {
  unsigned char i = 0;
  for (i = 0; i < 8; i++) {
    if ((out & 0x80) == 0x80)
      SI(1);
    else
      SI(0);
    SCK(1);
    out = (out << 1);
    SCK(0);
  }
}


x86 assembly (clang, -O0):
<Send_Byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    1195 <Send_Byte+0x75>
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1166 <Send_Byte+0x46>
mov    $0x1,%edi
call   1040 <SI@plt>
jmp    116d <Send_Byte+0x4d>
xor    %edi,%edi
call   1040 <SI@plt>
mov    $0x1,%edi
call   1030 <SCK@plt>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
xor    %edi,%edi
call   1030 <SCK@plt>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1136 <Send_Byte+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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