#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*/ GPIOPinTypeGPIOOutput(int, int);
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
void Send1byteB(unsigned int byte) {
  unsigned char cByte = byte;
  unsigned char i = 0;
  for (i = 0; i < 8; i++) {
    if (cByte & 0x80)
      GPIOPinWrite(0x40007000, 0x00000020, 0xff);
    else
      GPIOPinWrite(0x40007000, 0x00000020, 0x00);
    cByte <<= 1;
    GPIOPinWrite(0x40007000, 0x00000010, 0xff);
    GPIOPinWrite(0x40007000, 0x00000010, 0x00);
  }
  GPIOPinWrite(0x40007000, 0x00000020, 0xff);
  GPIOPinWrite(0x40007000, 0x00000010, 0xff);
  GPIOPinWrite(0x40007000, 0x00000010, 0x00);
  GPIOPinTypeGPIOOutput(0x40007000, 0x00000020);
}


x86 assembly (clang, -O0):
<Send1byteB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x8,%eax
jge    11be <Send1byteB+0x9e>
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1171 <Send1byteB+0x51>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
jmp    1182 <Send1byteB+0x62>
mov    $0x40007000,%edi
mov    $0x20,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
movzbl -0x5(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x5(%rbp)
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1139 <Send1byteB+0x19>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1030 <GPIOPinTypeGPIOOutput@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Send1byteB>:
push   %rbx
mov    %edi,%ebx
movsbl %bl,%eax
shr    $0x7,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x19,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x1a,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x1b,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x1c,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x1d,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%eax
shl    $0x1e,%eax
sar    $0x1f,%eax
movzbl %al,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
and    $0x1,%ebx
neg    %ebx
movzbl %bl,%edx
mov    $0x40007000,%edi
mov    $0x20,%esi
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40007000,%edi
mov    $0x20,%esi
pop    %rbx
jmp    1030 <GPIOPinTypeGPIOOutput@plt>

LLVM IR (-O0):
define void @Send1byteB(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
store i8 0, i8* %4
store i8 0, i8* %4
br label %7
7: ; preds = %27, %1
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = and i32 %13, 128
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
br label %20
18: ; preds = %11
%19 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 0)
br label %20
20: ; preds = %18, %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* %3
%25 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%26 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
br label %27
27: ; preds = %20
%28 = load i8, i8* %4
%29 = add i8 %28, 1
store i8 %29, i8* %4
br label %7
30: ; preds = %7
%31 = call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
%32 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%33 = call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%34 = call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
ret void
}

LLVM IR (-O2):
define void @Send1byteB(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %4)
%6 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%7 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%8 = and i32 %0, 64
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 255
%11 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %10)
%12 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%13 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%14 = and i32 %0, 32
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i32 0, i32 255
%17 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %16)
%18 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%19 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%20 = and i32 %0, 16
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 0, i32 255
%23 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %22)
%24 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%25 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%26 = and i32 %0, 8
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i32 0, i32 255
%29 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %28)
%30 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%31 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%32 = and i32 %0, 4
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 0, i32 255
%35 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %34)
%36 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%37 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%38 = and i32 %0, 2
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i32 0, i32 255
%41 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %40)
%42 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%43 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%44 = and i32 %0, 1
%45 = icmp eq i32 %44, 0
%46 = select i1 %45, i32 0, i32 255
%47 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 %46)
%48 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%49 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%50 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 32, i32 255)
%51 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 255)
%52 = tail call i32 @GPIOPinWrite(i32 1073770496, i32 16, i32 0)
%53 = tail call i32 @GPIOPinTypeGPIOOutput(i32 1073770496, i32 32)
ret void
}