#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 */
typedef int /*<<< orphan*/ pll_dividers;

/* Variables and functions */
int /*<<< orphan*/ IrqInterruptEnable();
int /*<<< orphan*/ LedInit();
int /*<<< orphan*/ TimerInit();
void Init(void) {
  unsigned char m_sel;
  unsigned char pll_dividers[] = {1, 2, 4, 8};
  unsigned char p_sel_cnt;
  unsigned long f_cco;
  m_sel = ((60000) + (((20000) + 1) / 2)) / (20000);
  m_sel--;
  for (p_sel_cnt = 0;
       p_sel_cnt < sizeof(pll_dividers) / sizeof(pll_dividers[0]);
       p_sel_cnt++) {
    f_cco = (60000) * 2 * pll_dividers[p_sel_cnt];
    if ((f_cco >= 156000) && (f_cco <= 320000)) {
      break;
    }
  }
  (*((volatile unsigned char *)0xE01FC084)) = (p_sel_cnt << 5) | m_sel;
  (*((volatile unsigned char *)0xE01FC08C)) = 0xAA;
  (*((volatile unsigned char *)0xE01FC08C)) = 0x55;
  (*((volatile unsigned char *)0xE01FC080)) = 0x1;
  (*((volatile unsigned char *)0xE01FC08C)) = 0xAA;
  (*((volatile unsigned char *)0xE01FC08C)) = 0x55;
  while (!((*((volatile unsigned short *)0xE01FC088)) & 0x400)) {
    ;
  }
  (*((volatile unsigned char *)0xE01FC080)) = 0x3;
  (*((volatile unsigned char *)0xE01FC08C)) = 0xAA;
  (*((volatile unsigned char *)0xE01FC08C)) = 0x55;
  (*((volatile unsigned char *)0xE01FC000)) = 0x0;
  (*((volatile unsigned char *)0xE01FC004)) = 4;
  (*((volatile unsigned char *)0xE01FC000)) = 0x2;
  (*((volatile unsigned char *)0xE01FC100)) = 0x1;
  LedInit();
  TimerInit();
  IrqInterruptEnable();
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
movb   $0x3,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x4,%rax
jae    11a7 <Init+0x77>
movzbl -0x6(%rbp),%eax
movzbl -0x5(%rbp,%rax,1),%eax
imul   $0x1d4c0,%eax,%eax
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x26160,-0x10(%rbp)
jb     1195 <Init+0x65>
cmpq   $0x4e200,-0x10(%rbp)
ja     1195 <Init+0x65>
jmp    11a7 <Init+0x77>
jmp    119a <Init+0x6a>
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    1151 <Init+0x21>
movzbl -0x6(%rbp),%eax
shl    $0x5,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    $0xe01fc084,%eax
mov    %cl,(%rax)
mov    $0xe01fc08c,%eax
movb   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movb   $0x55,(%rax)
mov    $0xe01fc080,%eax
movb   $0x1,(%rax)
mov    $0xe01fc08c,%eax
movb   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movb   $0x55,(%rax)
mov    $0xe01fc088,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x400,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    120a <Init+0xda>
jmp    120f <Init+0xdf>
jmp    11e5 <Init+0xb5>
mov    $0xe01fc080,%eax
movb   $0x3,(%rax)
mov    $0xe01fc08c,%eax
movb   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movb   $0x55,(%rax)
mov    $0xe01fc000,%eax
movb   $0x0,(%rax)
mov    $0xe01fc004,%eax
movb   $0x4,(%rax)
mov    $0xe01fc000,%eax
movb   $0x2,(%rax)
mov    $0xe01fc100,%eax
movb   $0x1,(%rax)
mov    $0x0,%al
call   1040 <LedInit@plt>
mov    $0x0,%al
call   1030 <TimerInit@plt>
mov    $0x0,%al
call   1050 <IrqInterruptEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rax
mov    $0xe01fc08c,%eax
movb   $0x22,-0x8(%rax)
movb   $0xaa,(%rax)
movb   $0x55,(%rax)
movb   $0x1,-0xc(%rax)
movb   $0xaa,(%rax)
movb   $0x55,(%rax)
nopw   0x0(%rax,%rax,1)
movzwl -0x4(%rax),%ecx
test   $0x400,%ecx
je     1150 <Init+0x20>
movb   $0x3,-0xc(%rax)
movb   $0xaa,(%rax)
movb   $0x55,(%rax)
movb   $0x0,-0x8c(%rax)
movb   $0x4,-0x88(%rax)
movb   $0x2,-0x8c(%rax)
movb   $0x1,0x74(%rax)
xor    %eax,%eax
call   1040 <LedInit@plt>
xor    %eax,%eax
call   1030 <TimerInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <IrqInterruptEnable@plt>

LLVM IR (-O0):
@__const.Init.pll_dividers = [4 x i8] c"\01\02\04\08"
define void @Init() {
%1 = alloca i8
%2 = alloca [4 x i8]
%3 = alloca i8
%4 = alloca i64
%5 = bitcast [4 x i8]* %2 to i8*
store i8 3, i8* %1
%6 = load i8, i8* %1
%7 = add i8 %6, -1
store i8 %7, i8* %1
store i8 0, i8* %3
br label %8
8: ; preds = %27, %0
%9 = load i8, i8* %3
%10 = zext i8 %9 to i64
%11 = icmp ult i64 %10, 4
br i1 %11, label %12, label %30
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i64
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = mul nsw i32 120000, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %4
%20 = load i64, i64* %4
%21 = icmp uge i64 %20, 156000
br i1 %21, label %22, label %26
22: ; preds = %12
%23 = load i64, i64* %4
%24 = icmp ule i64 %23, 320000
br i1 %24, label %25, label %26
25: ; preds = %22
br label %30
26: ; preds = %22, %12
br label %27
27: ; preds = %26
%28 = load i8, i8* %3
%29 = add i8 %28, 1
store i8 %29, i8* %3
br label %8
30: ; preds = %25, %8
%31 = load i8, i8* %3
%32 = zext i8 %31 to i32
%33 = shl i32 %32, 5
%34 = load i8, i8* %1
%35 = zext i8 %34 to i32
%36 = or i32 %33, %35
%37 = trunc i32 %36 to i8
store volatile i8 %37, i8* inttoptr (i64 3760177284 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 1, i8* inttoptr (i64 3760177280 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
br label %38
38: ; preds = %44, %30
%39 = load volatile i16, i16* inttoptr (i64 3760177288 to i16*)
%40 = zext i16 %39 to i32
%41 = and i32 %40, 1024
%42 = icmp ne i32 %41, 0
%43 = xor i1 %42, true
br i1 %43, label %44, label %45
44: ; preds = %38
br label %38
45: ; preds = %38
store volatile i8 3, i8* inttoptr (i64 3760177280 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 0, i8* inttoptr (i64 3760177152 to i8*)
store volatile i8 4, i8* inttoptr (i64 3760177156 to i8*)
store volatile i8 2, i8* inttoptr (i64 3760177152 to i8*)
store volatile i8 1, i8* inttoptr (i64 3760177408 to i8*)
%46 = call i32 (...) @LedInit()
%47 = call i32 (...) @TimerInit()
%48 = call i32 (...) @IrqInterruptEnable()
ret void
}

LLVM IR (-O2):
define void @Init() {
store volatile i8 34, i8* inttoptr (i64 3760177284 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 1, i8* inttoptr (i64 3760177280 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 3760177288 to i16*)
%3 = and i16 %2, 1024
%4 = icmp eq i16 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
store volatile i8 3, i8* inttoptr (i64 3760177280 to i8*)
store volatile i8 -86, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 85, i8* inttoptr (i64 3760177292 to i8*)
store volatile i8 0, i8* inttoptr (i64 3760177152 to i8*)
store volatile i8 4, i8* inttoptr (i64 3760177156 to i8*)
store volatile i8 2, i8* inttoptr (i64 3760177152 to i8*)
store volatile i8 1, i8* inttoptr (i64 3760177408 to i8*)
%6 = tail call i32 (...) @LedInit()
%7 = tail call i32 (...) @TimerInit()
%8 = tail call i32 (...) @IrqInterruptEnable()
ret void
}