#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);
unsigned char SO();
unsigned char Get_Byte() {
  unsigned char i = 0, in = 0, temp = 0;
  for (i = 0; i < 8; i++) {
    in = (in << 1);
    temp = SO();
    SCK(1);
    if (temp == 1)
      in = in | 0x01;
    SCK(0);
  }
  return in;
}


x86 assembly (clang, -O0):
<Get_Byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    118e <Get_Byte+0x6e>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <SO@plt>
mov    %al,-0x3(%rbp)
mov    $0x1,%edi
call   1030 <SCK@plt>
movzbl -0x3(%rbp),%eax
cmp    $0x1,%eax
jne    117a <Get_Byte+0x5a>
movzbl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x2(%rbp)
xor    %edi,%edi
call   1030 <SCK@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1138 <Get_Byte+0x18>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Byte>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bl
sete   %r14b
xor    %edi,%edi
call   1030 <SCK@plt>
add    %r14b,%r14b
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bpl
sete   %r15b
or     %r14b,%r15b
xor    %edi,%edi
call   1030 <SCK@plt>
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bpl
sete   %bl
xor    %edi,%edi
call   1030 <SCK@plt>
shl    $0x2,%r15b
add    %bl,%bl
or     %r15b,%bl
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bpl
sete   %bpl
or     %bl,%bpl
xor    %edi,%edi
call   1030 <SCK@plt>
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bl
sete   %bl
xor    %edi,%edi
call   1030 <SCK@plt>
shl    $0x2,%bpl
add    %bl,%bl
or     %bpl,%bl
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bpl
sete   %bpl
or     %bl,%bpl
xor    %edi,%edi
call   1030 <SCK@plt>
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bl
sete   %r14b
xor    %edi,%edi
call   1030 <SCK@plt>
shl    $0x2,%bpl
add    %r14b,%r14b
or     %bpl,%r14b
xor    %eax,%eax
call   1040 <SO@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <SCK@plt>
cmp    $0x1,%bl
sete   %bl
or     %r14b,%bl
xor    %edi,%edi
call   1030 <SCK@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @Get_Byte() {
%1 = tail call zeroext i8 (...) @SO()
%2 = tail call i32 @SCK(i32 1)
%3 = icmp eq i8 %1, 1
%4 = tail call i32 @SCK(i32 0)
%5 = select i1 %3, i8 2, i8 0
%6 = tail call zeroext i8 (...) @SO()
%7 = tail call i32 @SCK(i32 1)
%8 = icmp eq i8 %6, 1
%9 = zext i1 %8 to i8
%10 = or i8 %5, %9
%11 = tail call i32 @SCK(i32 0)
%12 = tail call zeroext i8 (...) @SO()
%13 = tail call i32 @SCK(i32 1)
%14 = icmp eq i8 %12, 1
%15 = tail call i32 @SCK(i32 0)
%16 = shl nuw nsw i8 %10, 2
%17 = select i1 %14, i8 2, i8 0
%18 = or i8 %16, %17
%19 = tail call zeroext i8 (...) @SO()
%20 = tail call i32 @SCK(i32 1)
%21 = icmp eq i8 %19, 1
%22 = zext i1 %21 to i8
%23 = or i8 %18, %22
%24 = tail call i32 @SCK(i32 0)
%25 = tail call zeroext i8 (...) @SO()
%26 = tail call i32 @SCK(i32 1)
%27 = icmp eq i8 %25, 1
%28 = tail call i32 @SCK(i32 0)
%29 = shl nuw nsw i8 %23, 2
%30 = select i1 %27, i8 2, i8 0
%31 = or i8 %29, %30
%32 = tail call zeroext i8 (...) @SO()
%33 = tail call i32 @SCK(i32 1)
%34 = icmp eq i8 %32, 1
%35 = zext i1 %34 to i8
%36 = or i8 %31, %35
%37 = tail call i32 @SCK(i32 0)
%38 = tail call zeroext i8 (...) @SO()
%39 = tail call i32 @SCK(i32 1)
%40 = icmp eq i8 %38, 1
%41 = tail call i32 @SCK(i32 0)
%42 = shl i8 %36, 2
%43 = select i1 %40, i8 2, i8 0
%44 = or i8 %42, %43
%45 = tail call zeroext i8 (...) @SO()
%46 = tail call i32 @SCK(i32 1)
%47 = icmp eq i8 %45, 1
%48 = zext i1 %47 to i8
%49 = or i8 %44, %48
%50 = tail call i32 @SCK(i32 0)
ret i8 %49
}