#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 UART_Init(void) {
  (*((volatile uint32_t *)0x400FE618)) |= 0x01;
  (*((volatile uint32_t *)0x400FE608)) |= 0x01;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x01) == 0) {
  };
  (*((volatile uint32_t *)0x4000C030)) &= ~0x00000001;
  (*((volatile uint32_t *)0x4000C024)) = 27;
  (*((volatile uint32_t *)0x4000C028)) = 8;
  (*((volatile uint32_t *)0x4000C02C)) = (0x00000060 | 0x00000010);
  (*((volatile uint32_t *)0x4000C030)) |= 0x00000001;
  (*((volatile uint32_t *)0x40004420)) |= 0x03;
  (*((volatile uint32_t *)0x4000451C)) |= 0x03;
  (*((volatile uint32_t *)0x4000452C)) =
      ((*((volatile uint32_t *)0x4000452C)) & 0xFFFFFF00) + 0x00000011;
  (*((volatile uint32_t *)0x40004528)) &= ~0x03;
}


x86 assembly (clang, -O0):
<UART_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe618,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400fe618,%eax
mov    %ecx,(%rax)
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    113e <UART_Init+0x3e>
jmp    1126 <UART_Init+0x26>
mov    $0x4000c030,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x4000c030,%eax
mov    %ecx,(%rax)
mov    $0x4000c024,%eax
movl   $0x1b,(%rax)
mov    $0x4000c028,%eax
movl   $0x8,(%rax)
mov    $0x4000c02c,%eax
movl   $0x70,(%rax)
mov    $0x4000c030,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4000c030,%eax
mov    %ecx,(%rax)
mov    $0x40004420,%eax
mov    (%rax),%ecx
or     $0x3,%ecx
mov    $0x40004420,%eax
mov    %ecx,(%rax)
mov    $0x4000451c,%eax
mov    (%rax),%ecx
or     $0x3,%ecx
mov    $0x4000451c,%eax
mov    %ecx,(%rax)
mov    $0x4000452c,%eax
mov    (%rax),%ecx
and    $0xffffff00,%ecx
add    $0x11,%ecx
mov    $0x4000452c,%eax
mov    %ecx,(%rax)
mov    $0x40004528,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    $0x40004528,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_Init>:
orl    $0x1,0x400fe618
01
orl    $0x1,0x400fe608
01
testl  $0x1,0x400fea08
je     1110 <UART_Init+0x10>
andl   $0xfffffffe,0x4000c030
fe
movl   $0x1b,0x4000c024
movl   $0x8,0x4000c028
movl   $0x70,0x4000c02c
orl    $0x1,0x4000c030
01
orl    $0x3,0x40004420
03
orl    $0x3,0x4000451c
03
mov    $0xffffff00,%eax
and    0x4000452c,%eax
or     $0x11,%eax
mov    %eax,0x4000452c
andl   $0xfffffffc,0x40004528
fc
ret

LLVM IR (-O0):
define void @UART_Init() {
%1 = load volatile i32, i32* inttoptr (i64 1074783768 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074783768 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%4 = or i32 %3, 1
store volatile i32 %4, i32* inttoptr (i64 1074783752 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* inttoptr (i64 1073791024 to i32*)
%12 = and i32 %11, -2
store volatile i32 %12, i32* inttoptr (i64 1073791024 to i32*)
store volatile i32 27, i32* inttoptr (i64 1073791012 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073791016 to i32*)
store volatile i32 112, i32* inttoptr (i64 1073791020 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073791024 to i32*)
%14 = or i32 %13, 1
store volatile i32 %14, i32* inttoptr (i64 1073791024 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%16 = or i32 %15, 3
store volatile i32 %16, i32* inttoptr (i64 1073759264 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%18 = or i32 %17, 3
store volatile i32 %18, i32* inttoptr (i64 1073759516 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%20 = and i32 %19, -256
%21 = add i32 %20, 17
store volatile i32 %21, i32* inttoptr (i64 1073759532 to i32*)
%22 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%23 = and i32 %22, -4
store volatile i32 %23, i32* inttoptr (i64 1073759528 to i32*)
ret void
}

LLVM IR (-O2):
define void @UART_Init() {
%1 = load volatile i32, i32* inttoptr (i64 1074783768 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074783768 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%4 = or i32 %3, 1
store volatile i32 %4, i32* inttoptr (i64 1074783752 to i32*)
br label %5
5: ; preds = %5, %0
%6 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = load volatile i32, i32* inttoptr (i64 1073791024 to i32*)
%11 = and i32 %10, -2
store volatile i32 %11, i32* inttoptr (i64 1073791024 to i32*)
store volatile i32 27, i32* inttoptr (i64 1073791012 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073791016 to i32*)
store volatile i32 112, i32* inttoptr (i64 1073791020 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073791024 to i32*)
%13 = or i32 %12, 1
store volatile i32 %13, i32* inttoptr (i64 1073791024 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%15 = or i32 %14, 3
store volatile i32 %15, i32* inttoptr (i64 1073759264 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%17 = or i32 %16, 3
store volatile i32 %17, i32* inttoptr (i64 1073759516 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%19 = and i32 %18, -256
%20 = or i32 %19, 17
store volatile i32 %20, i32* inttoptr (i64 1073759532 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%22 = and i32 %21, -4
store volatile i32 %22, i32* inttoptr (i64 1073759528 to i32*)
ret void
}