void initClock(void) {
  (*(volatile unsigned int *)(0x7E00F000)) = 0x0000FFFF;
  (*(volatile unsigned int *)(0x7E00F004)) = 0x0000FFFF;
  (*(volatile unsigned int *)(0x7E00F008)) = 0x0000FFFF;
  (*(volatile unsigned int *)(0x7E00F900)) &= 0xFFFFFF3F;
  while (1) {
    if (((*(volatile unsigned int *)(0x7E00F900)) & 0x00000F00) == 0)
      break;
  }
  (*(volatile unsigned int *)(0x7E00F00C)) =
      (1 << 31) | (266 << 16) | (3 << 8) | 1;
  (*(volatile unsigned int *)(0x7E00F010)) =
      (1 << 31) | (266 << 16) | (3 << 8) | 2;
  (*(volatile unsigned int *)(0x7E00F020)) =
      ((*(volatile unsigned int *)(0x7E00F020)) & 0xFFFF0000) | 0x00003100;
  (*(volatile unsigned int *)(0x7E00F01C)) = 3;
  return;
}


x86 assembly (clang, -O0):
<initClock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00f000,%eax
movl   $0xffff,(%rax)
mov    $0x7e00f004,%eax
movl   $0xffff,(%rax)
mov    $0x7e00f008,%eax
movl   $0xffff,(%rax)
mov    $0x7e00f900,%eax
mov    (%rax),%ecx
and    $0xffffff3f,%ecx
mov    $0x7e00f900,%eax
mov    %ecx,(%rax)
mov    $0x7e00f900,%eax
mov    (%rax),%eax
and    $0xf00,%eax
cmp    $0x0,%eax
jne    1153 <initClock+0x53>
jmp    1158 <initClock+0x58>
jmp    1139 <initClock+0x39>
mov    $0x7e00f00c,%eax
movl   $0x810a0301,(%rax)
mov    $0x7e00f010,%eax
movl   $0x810a0302,(%rax)
mov    $0x7e00f020,%eax
mov    (%rax),%ecx
and    $0xffff0000,%ecx
or     $0x3100,%ecx
mov    $0x7e00f020,%eax
mov    %ecx,(%rax)
mov    $0x7e00f01c,%eax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initClock>:
movl   $0xffff,0x7e00f000
movl   $0xffff,0x7e00f004
movl   $0xffff,0x7e00f008
andl   $0xffffff3f,0x7e00f900
3f ff ff ff
nopl   0x0(%rax)
testl  $0xf00,0x7e00f900
jne    1130 <initClock+0x30>
movl   $0x810a0301,0x7e00f00c
01 03 0a 81
movl   $0x810a0302,0x7e00f010
02 03 0a 81
mov    $0xffff0000,%eax
and    0x7e00f020,%eax
or     $0x3100,%eax
mov    %eax,0x7e00f020
movl   $0x3,0x7e00f01c
ret

LLVM IR (-O0):
define void @initClock() {
store volatile i32 65535, i32* inttoptr (i64 2113990656 to i32*)
store volatile i32 65535, i32* inttoptr (i64 2113990660 to i32*)
store volatile i32 65535, i32* inttoptr (i64 2113990664 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2113992960 to i32*)
%2 = and i32 %1, -193
store volatile i32 %2, i32* inttoptr (i64 2113992960 to i32*)
br label %3
3: ; preds = %0, %8
%4 = load volatile i32, i32* inttoptr (i64 2113992960 to i32*)
%5 = and i32 %4, 3840
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
store volatile i32 -2130050303, i32* inttoptr (i64 2113990668 to i32*)
store volatile i32 -2130050302, i32* inttoptr (i64 2113990672 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 2113990688 to i32*)
%11 = and i32 %10, -65536
%12 = or i32 %11, 12544
store volatile i32 %12, i32* inttoptr (i64 2113990688 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113990684 to i32*)
ret void
}

LLVM IR (-O2):
define void @initClock() {
store volatile i32 65535, i32* inttoptr (i64 2113990656 to i32*)
store volatile i32 65535, i32* inttoptr (i64 2113990660 to i32*)
store volatile i32 65535, i32* inttoptr (i64 2113990664 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 2113992960 to i32*)
%2 = and i32 %1, -193
store volatile i32 %2, i32* inttoptr (i64 2113992960 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 2113992960 to i32*)
%5 = and i32 %4, 3840
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
store volatile i32 -2130050303, i32* inttoptr (i64 2113990668 to i32*)
store volatile i32 -2130050302, i32* inttoptr (i64 2113990672 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 2113990688 to i32*)
%9 = and i32 %8, -65536
%10 = or i32 %9, 12544
store volatile i32 %10, i32* inttoptr (i64 2113990688 to i32*)
store volatile i32 3, i32* inttoptr (i64 2113990684 to i32*)
ret void
}