#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 uint32_t;

/* Variables and functions */
void pll_init() {
  uint32_t val;
  val = (*(volatile uint32_t *)((0x40048000 + 0x238)));
  val &= ~((1 << 7));
  (*(volatile uint32_t *)((0x40048000 + 0x238)) = (val));
  val = (0);
  (*(volatile uint32_t *)((0x40048000 + 0x040)) = (val & 0x3));
  val = (1);
  (*(volatile uint32_t *)((0x40048000 + 0x044)) = (val & 0x1));
  val = 1 << (5) | 1 << (0);
  (*(volatile uint32_t *)((0x40048000 + 0x008)) = (val & 0x7f));
  while (!((*(volatile uint32_t *)((0x40048000 + 0x00c))) & (1 << 0)))
    ;
}


x86 assembly (clang, -O0):
<pll_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048238,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40048238,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
mov    $0x40048040,%eax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
mov    $0x40048044,%eax
mov    %ecx,(%rax)
movl   $0x21,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7f,%ecx
mov    $0x40048008,%eax
mov    %ecx,(%rax)
mov    $0x4004800c,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117e <pll_init+0x7e>
jmp    1183 <pll_init+0x83>
jmp    115f <pll_init+0x5f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pll_init>:
andl   $0xffffff7f,0x40048238
7f ff ff ff
movl   $0x0,0x40048040
movl   $0x1,0x40048044
movl   $0x21,0x40048008
nopl   0x0(%rax)
testl  $0x1,0x4004800c
je     1130 <pll_init+0x30>
ret

LLVM IR (-O0):
define void @pll_init() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074037304 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -129
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1074037304 to i32*)
store i32 0, i32* %1
%6 = load i32, i32* %1
%7 = and i32 %6, 3
store volatile i32 %7, i32* inttoptr (i64 1074036800 to i32*)
store i32 1, i32* %1
%8 = load i32, i32* %1
%9 = and i32 %8, 1
store volatile i32 %9, i32* inttoptr (i64 1074036804 to i32*)
store i32 33, i32* %1
%10 = load i32, i32* %1
%11 = and i32 %10, 127
store volatile i32 %11, i32* inttoptr (i64 1074036744 to i32*)
br label %12
12: ; preds = %17, %0
%13 = load volatile i32, i32* inttoptr (i64 1074036748 to i32*)
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %18
17: ; preds = %12
br label %12
18: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @pll_init() {
%1 = load volatile i32, i32* inttoptr (i64 1074037304 to i32*)
%2 = and i32 %1, -129
store volatile i32 %2, i32* inttoptr (i64 1074037304 to i32*)
store volatile i32 0, i32* inttoptr (i64 1074036800 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074036804 to i32*)
store volatile i32 33, i32* inttoptr (i64 1074036744 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1074036748 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}