void _ath_serial_putc(char byte) {
  if (byte == '\n')
    _ath_serial_putc('\r');
  while (
      (((*(volatile unsigned int *)(((((0x18000000 + 0x00020000) + (5 * 4))) &
                                     0x1fffffff) |
                                    0xa0000000))) &
       0x20) == 0x0)
    ;
  do {
    ((*(volatile unsigned int *)(((((0x18000000 + 0x00020000) + (0 * 4))) &
                                  0x1fffffff) |
                                 0xa0000000)) = (byte));
    (*(volatile unsigned int *)(((((0x18000000 + 0x00020000) + (0 * 4))) &
                                 0x1fffffff) |
                                0xa0000000));
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<_ath_serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <_ath_serial_putc+0x25>
mov    $0xd,%edi
call   1030 <_ath_serial_putc@plt>
jmp    113a <_ath_serial_putc+0x2a>
mov    $0xb8020014,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1152 <_ath_serial_putc+0x42>
jmp    113a <_ath_serial_putc+0x2a>
jmp    1157 <_ath_serial_putc+0x47>
movsbl -0x1(%rbp),%ecx
mov    $0xb8020000,%eax
mov    %ecx,(%rax)
mov    $0xb8020000,%eax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ath_serial_putc>:
mov    $0xb8020000,%eax
cmp    $0xa,%dil
jne    1130 <_ath_serial_putc+0x30>
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x14(%rax)
je     1110 <_ath_serial_putc+0x10>
movl   $0xd,(%rax)
mov    (%rax),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testl  $0x20,0x14(%rax)
je     1130 <_ath_serial_putc+0x30>
movsbl %dil,%ecx
mov    %ecx,(%rax)
mov    (%rax),%eax
ret

LLVM IR (-O0):
define void @_ath_serial_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
br label %8
8: ; preds = %12, %7
%9 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%10 = and i32 %9, 32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
br label %14
14: ; preds = %13
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
store volatile i32 %16, i32* inttoptr (i64 3087138816 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 3087138816 to i32*)
br label %18
18: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @_ath_serial_putc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
store volatile i32 13, i32* inttoptr (i64 3087138816 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 3087138816 to i32*)
br label %9
9: ; preds = %7, %1
br label %10
10: ; preds = %9, %10
%11 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%12 = and i32 %11, 32
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
%15 = sext i8 %0 to i32
store volatile i32 %15, i32* inttoptr (i64 3087138816 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 3087138816 to i32*)
ret void
}