void si2cMasterReadByte(char *byte) {
  printf("%s\n", __FUNCTION__);
  int bit;
  *byte = 0;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 128;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 64;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 32;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 16;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 8;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 4;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 2;
  bit = si2cMasterReadBit();
  if (bit == 1)
    *byte |= 1;
}


x86 assembly (clang, -O0):
<si2cMasterReadByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    116b <si2cMasterReadByte+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    118b <si2cMasterReadByte+0x6b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x40,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11ab <si2cMasterReadByte+0x8b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11cb <si2cMasterReadByte+0xab>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x10,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11eb <si2cMasterReadByte+0xcb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x8,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    120b <si2cMasterReadByte+0xeb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x4,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    122b <si2cMasterReadByte+0x10b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x2,%ecx
mov    %cl,(%rax)
mov    $0x0,%al
call   1040 <si2cMasterReadBit@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    124b <si2cMasterReadByte+0x12b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si2cMasterReadByte>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
movb   $0x0,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    1142 <si2cMasterReadByte+0x22>
orb    $0x80,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    1151 <si2cMasterReadByte+0x31>
orb    $0x40,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    1160 <si2cMasterReadByte+0x40>
orb    $0x20,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    116f <si2cMasterReadByte+0x4f>
orb    $0x10,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    117e <si2cMasterReadByte+0x5e>
orb    $0x8,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    118d <si2cMasterReadByte+0x6d>
orb    $0x4,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    119c <si2cMasterReadByte+0x7c>
orb    $0x2,(%rbx)
xor    %eax,%eax
call   1040 <si2cMasterReadBit@plt>
cmp    $0x1,%eax
jne    11ab <si2cMasterReadByte+0x8b>
orb    $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__FUNCTION__.si2cMasterReadByte = [19 x i8] c"si2cMasterReadByte\00"
define void @si2cMasterReadByte(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.si2cMasterReadByte, i64 0, i64 0))
%5 = load i8*, i8** %2
store i8 0, i8* %5
%6 = call i32 (...) @si2cMasterReadBit()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = or i32 %12, 128
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
br label %15
15: ; preds = %9, %1
%16 = call i32 (...) @si2cMasterReadBit()
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = or i32 %22, 64
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %15
%26 = call i32 (...) @si2cMasterReadBit()
store i32 %26, i32* %3
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load i8*, i8** %2
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = or i32 %32, 32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %30
br label %35
35: ; preds = %29, %25
%36 = call i32 (...) @si2cMasterReadBit()
store i32 %36, i32* %3
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %45
39: ; preds = %35
%40 = load i8*, i8** %2
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = or i32 %42, 16
%44 = trunc i32 %43 to i8
store i8 %44, i8* %40
br label %45
45: ; preds = %39, %35
%46 = call i32 (...) @si2cMasterReadBit()
store i32 %46, i32* %3
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %55
49: ; preds = %45
%50 = load i8*, i8** %2
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = or i32 %52, 8
%54 = trunc i32 %53 to i8
store i8 %54, i8* %50
br label %55
55: ; preds = %49, %45
%56 = call i32 (...) @si2cMasterReadBit()
store i32 %56, i32* %3
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = load i8*, i8** %2
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = or i32 %62, 4
%64 = trunc i32 %63 to i8
store i8 %64, i8* %60
br label %65
65: ; preds = %59, %55
%66 = call i32 (...) @si2cMasterReadBit()
store i32 %66, i32* %3
%67 = load i32, i32* %3
%68 = icmp eq i32 %67, 1
br i1 %68, label %69, label %75
69: ; preds = %65
%70 = load i8*, i8** %2
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = or i32 %72, 2
%74 = trunc i32 %73 to i8
store i8 %74, i8* %70
br label %75
75: ; preds = %69, %65
%76 = call i32 (...) @si2cMasterReadBit()
store i32 %76, i32* %3
%77 = load i32, i32* %3
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %85
79: ; preds = %75
%80 = load i8*, i8** %2
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = or i32 %82, 1
%84 = trunc i32 %83 to i8
store i8 %84, i8* %80
br label %85
85: ; preds = %79, %75
ret void
}

LLVM IR (-O2):
@__FUNCTION__.si2cMasterReadByte = [19 x i8] c"si2cMasterReadByte\00"
define void @si2cMasterReadByte(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.si2cMasterReadByte, i64 0, i64 0))
store i8 0, i8* %0
%3 = tail call i32 (...) @si2cMasterReadBit()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8, i8* %0
%7 = or i8 %6, -128
store i8 %7, i8* %0
br label %8
8: ; preds = %5, %1
%9 = tail call i32 (...) @si2cMasterReadBit()
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i8, i8* %0
%13 = or i8 %12, 64
store i8 %13, i8* %0
br label %14
14: ; preds = %11, %8
%15 = tail call i32 (...) @si2cMasterReadBit()
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8, i8* %0
%19 = or i8 %18, 32
store i8 %19, i8* %0
br label %20
20: ; preds = %17, %14
%21 = tail call i32 (...) @si2cMasterReadBit()
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i8, i8* %0
%25 = or i8 %24, 16
store i8 %25, i8* %0
br label %26
26: ; preds = %23, %20
%27 = tail call i32 (...) @si2cMasterReadBit()
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i8, i8* %0
%31 = or i8 %30, 8
store i8 %31, i8* %0
br label %32
32: ; preds = %29, %26
%33 = tail call i32 (...) @si2cMasterReadBit()
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i8, i8* %0
%37 = or i8 %36, 4
store i8 %37, i8* %0
br label %38
38: ; preds = %35, %32
%39 = tail call i32 (...) @si2cMasterReadBit()
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i8, i8* %0
%43 = or i8 %42, 2
store i8 %43, i8* %0
br label %44
44: ; preds = %41, %38
%45 = tail call i32 (...) @si2cMasterReadBit()
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load i8, i8* %0
%49 = or i8 %48, 1
store i8 %49, i8* %0
br label %50
50: ; preds = %47, %44
ret void
}