void mk20dx256_uart0_init() {
  *((volatile unsigned int *)0x40048038) |= (1 << 10);
  *((volatile unsigned int *)0x40048034) &= ~(1 << 10);
  *((volatile unsigned int *)0x4004A040) =
      ((3) << 8) | (1 << 0) | (1 << 4) | (1 << 1);
  *((volatile unsigned int *)0x4004A044) = ((3) << 8) | (1 << 6) | (1 << 2);
  *((volatile unsigned int *)0x40048034) |= (1 << 10);
  *((volatile unsigned char *)0x4006A003) &= ~((1 << 3) | (1 << 2));
  *((volatile unsigned char *)0x4006A002) = 0;
  *((volatile unsigned char *)0x4006A000) = 0;
  *((volatile unsigned char *)0x4006A001) = 0x9C;
  *((volatile unsigned char *)0x4006A00A) = 5;
  *((volatile unsigned char *)0x4006A003) |= ((1 << 3) | (1 << 2));
}


x86 assembly (clang, -O0):
<mk20dx256_uart0_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048038,%eax
mov    (%rax),%ecx
or     $0x400,%ecx
mov    $0x40048038,%eax
mov    %ecx,(%rax)
mov    $0x40048034,%eax
mov    (%rax),%ecx
and    $0xfffffbff,%ecx
mov    $0x40048034,%eax
mov    %ecx,(%rax)
mov    $0x4004a040,%eax
movl   $0x313,(%rax)
mov    $0x4004a044,%eax
movl   $0x344,(%rax)
mov    $0x40048034,%eax
mov    (%rax),%ecx
or     $0x400,%ecx
mov    $0x40048034,%eax
mov    %ecx,(%rax)
mov    $0x4006a003,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xfffffff3,%eax
mov    %al,%cl
mov    $0x4006a003,%eax
mov    %cl,(%rax)
mov    $0x4006a002,%eax
movb   $0x0,(%rax)
mov    $0x4006a000,%eax
movb   $0x0,(%rax)
mov    $0x4006a001,%eax
movb   $0x9c,(%rax)
mov    $0x4006a00a,%eax
movb   $0x5,(%rax)
mov    $0x4006a003,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0xc,%eax
mov    %al,%cl
mov    $0x4006a003,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk20dx256_uart0_init>:
orl    $0x400,0x40048038
andl   $0xfffffbff,0x40048034
ff fb ff ff
movl   $0x313,0x4004a040
movl   $0x344,0x4004a044
orl    $0x400,0x40048034
andb   $0xf3,0x4006a003
f3
movb   $0x0,0x4006a002
movb   $0x0,0x4006a000
movb   $0x9c,0x4006a001
9c
movb   $0x5,0x4006a00a
05
orb    $0xc,0x4006a003
0c
ret

LLVM IR (-O0):
define void @mk20dx256_uart0_init() {
%1 = load volatile i32, i32* inttoptr (i64 1074036792 to i32*)
%2 = or i32 %1, 1024
store volatile i32 %2, i32* inttoptr (i64 1074036792 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074036788 to i32*)
%4 = and i32 %3, -1025
store volatile i32 %4, i32* inttoptr (i64 1074036788 to i32*)
store volatile i32 787, i32* inttoptr (i64 1074044992 to i32*)
store volatile i32 836, i32* inttoptr (i64 1074044996 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1074036788 to i32*)
%6 = or i32 %5, 1024
store volatile i32 %6, i32* inttoptr (i64 1074036788 to i32*)
%7 = load volatile i8, i8* inttoptr (i64 1074176003 to i8*)
%8 = zext i8 %7 to i32
%9 = and i32 %8, -13
%10 = trunc i32 %9 to i8
store volatile i8 %10, i8* inttoptr (i64 1074176003 to i8*)
store volatile i8 0, i8* inttoptr (i64 1074176002 to i8*)
store volatile i8 0, i8* inttoptr (i64 1074176000 to i8*)
store volatile i8 -100, i8* inttoptr (i64 1074176001 to i8*)
store volatile i8 5, i8* inttoptr (i64 1074176010 to i8*)
%11 = load volatile i8, i8* inttoptr (i64 1074176003 to i8*)
%12 = zext i8 %11 to i32
%13 = or i32 %12, 12
%14 = trunc i32 %13 to i8
store volatile i8 %14, i8* inttoptr (i64 1074176003 to i8*)
ret void
}

LLVM IR (-O2):
define void @mk20dx256_uart0_init() {
%1 = load volatile i32, i32* inttoptr (i64 1074036792 to i32*)
%2 = or i32 %1, 1024
store volatile i32 %2, i32* inttoptr (i64 1074036792 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074036788 to i32*)
%4 = and i32 %3, -1025
store volatile i32 %4, i32* inttoptr (i64 1074036788 to i32*)
store volatile i32 787, i32* inttoptr (i64 1074044992 to i32*)
store volatile i32 836, i32* inttoptr (i64 1074044996 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1074036788 to i32*)
%6 = or i32 %5, 1024
store volatile i32 %6, i32* inttoptr (i64 1074036788 to i32*)
%7 = load volatile i8, i8* inttoptr (i64 1074176003 to i8*)
%8 = and i8 %7, -13
store volatile i8 %8, i8* inttoptr (i64 1074176003 to i8*)
store volatile i8 0, i8* inttoptr (i64 1074176002 to i8*)
store volatile i8 0, i8* inttoptr (i64 1074176000 to i8*)
store volatile i8 -100, i8* inttoptr (i64 1074176001 to i8*)
store volatile i8 5, i8* inttoptr (i64 1074176010 to i8*)
%9 = load volatile i8, i8* inttoptr (i64 1074176003 to i8*)
%10 = or i8 %9, 12
store volatile i8 %10, i8* inttoptr (i64 1074176003 to i8*)
ret void
}