unsigned int usb_sendbyte(unsigned char sendbyte) {
  unsigned int i = 0;
  *(volatile unsigned int *)0xCC006814 = 0x000000D0;
  *(volatile unsigned int *)0xCC006824 = 0xB0000000 | (sendbyte << 20);
  *(volatile unsigned int *)0xCC006820 = 0x19;
  while ((*(volatile unsigned int *)0xCC006820) & 1)
    ;
  i = *(volatile unsigned int *)0xCC006824;
  *(volatile unsigned int *)0xCC006814 = 0x0;
  if (i & 0x04000000) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usb_sendbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0xcc006814,%eax
movl   $0xd0,(%rax)
movzbl -0x5(%rbp),%ecx
shl    $0x14,%ecx
or     $0xb0000000,%ecx
mov    $0xcc006824,%eax
mov    %ecx,(%rax)
mov    $0xcc006820,%eax
movl   $0x19,(%rax)
mov    $0xcc006820,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1153 <usb_sendbyte+0x53>
jmp    113b <usb_sendbyte+0x3b>
mov    $0xcc006824,%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcc006814,%eax
movl   $0x0,(%rax)
mov    -0xc(%rbp),%eax
and    $0x4000000,%eax
cmp    $0x0,%eax
je     1185 <usb_sendbyte+0x85>
movl   $0x1,-0x4(%rbp)
jmp    118c <usb_sendbyte+0x8c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_sendbyte>:
mov    $0xcc006814,%ecx
movl   $0xd0,(%rcx)
shl    $0x14,%edi
or     $0xb0000000,%edi
mov    %edi,0x10(%rcx)
movl   $0x19,0xc(%rcx)
xchg   %ax,%ax
mov    0xc(%rcx),%eax
test   $0x1,%al
jne    1120 <usb_sendbyte+0x20>
mov    0x10(%rcx),%eax
movl   $0x0,(%rcx)
shr    $0x1a,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @usb_sendbyte(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 20
%8 = or i32 -1342177280, %7
store volatile i32 %8, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %9
9: ; preds = %13, %1
%10 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
%15 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store i32 %15, i32* %4
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%16 = load i32, i32* %4
%17 = and i32 %16, 67108864
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %2
br label %21
20: ; preds = %14
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @usb_sendbyte(i8 zeroext %0) {
store volatile i32 208, i32* inttoptr (i64 3422578708 to i32*)
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 20
%4 = or i32 %3, -1342177280
store volatile i32 %4, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 25, i32* inttoptr (i64 3422578720 to i32*)
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* inttoptr (i64 3422578720 to i32*)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = load volatile i32, i32* inttoptr (i64 3422578724 to i32*)
store volatile i32 0, i32* inttoptr (i64 3422578708 to i32*)
%11 = lshr i32 %10, 26
%12 = and i32 %11, 1
ret i32 %12
}