void si2cMasterSendByte(char byte) {
  printf("%s 0x%1x\n", __FUNCTION__, byte);
  if (byte & 0x80) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x40) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x20) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x10) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x08) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x04) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x02) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
  if (byte & 0x01) {
    si2cMasterSendBit(1);
  } else {
    si2cMasterSendBit(0);
  }
}


x86 assembly (clang, -O0):
<si2cMasterSendByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     116a <si2cMasterSendByte+0x4a>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    1173 <si2cMasterSendByte+0x53>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1194 <si2cMasterSendByte+0x74>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    119d <si2cMasterSendByte+0x7d>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     11be <si2cMasterSendByte+0x9e>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    11c7 <si2cMasterSendByte+0xa7>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11e8 <si2cMasterSendByte+0xc8>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    11f1 <si2cMasterSendByte+0xd1>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1212 <si2cMasterSendByte+0xf2>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    121b <si2cMasterSendByte+0xfb>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     123c <si2cMasterSendByte+0x11c>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    1245 <si2cMasterSendByte+0x125>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1266 <si2cMasterSendByte+0x146>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    126f <si2cMasterSendByte+0x14f>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1290 <si2cMasterSendByte+0x170>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
jmp    1299 <si2cMasterSendByte+0x179>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <si2cMasterSendBit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si2cMasterSendByte>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
shr    $0x7,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
xor    %eax,%eax
call   1040 <si2cMasterSendBit@plt>
and    $0x1,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <si2cMasterSendBit@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s 0x%1x\0A\00"
@__FUNCTION__.si2cMasterSendByte = [19 x i8] c"si2cMasterSendByte\00"
define void @si2cMasterSendByte(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.si2cMasterSendByte, i64 0, i64 0), i32 %2)
%4 = lshr i32 %2, 7
%5 = and i32 %4, 1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %5)
%7 = lshr i32 %2, 6
%8 = and i32 %7, 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %8)
%10 = lshr i32 %2, 5
%11 = and i32 %10, 1
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %11)
%13 = lshr i32 %2, 4
%14 = and i32 %13, 1
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %14)
%16 = lshr i32 %2, 3
%17 = and i32 %16, 1
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %17)
%19 = lshr i32 %2, 2
%20 = and i32 %19, 1
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %20)
%22 = lshr i32 %2, 1
%23 = and i32 %22, 1
%24 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %23)
%25 = and i32 %2, 1
%26 = tail call i32 (i32, ...) bitcast (i32 (...)* @si2cMasterSendBit to i32 (i32, ...)*)(i32 %25)
ret void
}