#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 */
int /*<<< orphan*/ DisableInterrupts();
int /*<<< orphan*/ EnableInterrupts();
void PortA_Init(void) {
  DisableInterrupts();
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000001;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x00000001) == 0) {
  }
  (*((volatile uint32_t *)0x40004528)) &= ~0xFC;
  (*((volatile uint32_t *)0x4000452C)) &= ~0xFFFFFF00;
  (*((volatile uint32_t *)0x40004400)) |= 0xFC;
  (*((volatile uint32_t *)0x40004420)) &= ~0xFC;
  (*((volatile uint32_t *)0x4000451C)) |= 0xFC;
  EnableInterrupts();
}


x86 assembly (clang, -O0):
<PortA_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DisableInterrupts@plt>
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    1154 <PortA_Init+0x34>
jmp    113c <PortA_Init+0x1c>
mov    $0x40004528,%eax
mov    (%rax),%ecx
and    $0xffffff03,%ecx
mov    $0x40004528,%eax
mov    %ecx,(%rax)
mov    $0x4000452c,%eax
mov    (%rax),%ecx
and    $0xff,%ecx
mov    $0x4000452c,%eax
mov    %ecx,(%rax)
mov    $0x40004400,%eax
mov    (%rax),%ecx
or     $0xfc,%ecx
mov    $0x40004400,%eax
mov    %ecx,(%rax)
mov    $0x40004420,%eax
mov    (%rax),%ecx
and    $0xffffff03,%ecx
mov    $0x40004420,%eax
mov    %ecx,(%rax)
mov    $0x4000451c,%eax
mov    (%rax),%ecx
or     $0xfc,%ecx
mov    $0x4000451c,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <EnableInterrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PortA_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DisableInterrupts@plt>
orl    $0x1,0x400fe608
01
testl  $0x1,0x400fea08
je     1130 <PortA_Init+0x10>
andl   $0xffffff03,0x40004528
03 ff ff ff
andl   $0xff,0x4000452c
orl    $0xfc,0x40004400
andl   $0xffffff03,0x40004420
03 ff ff ff
orl    $0xfc,0x4000451c
xor    %eax,%eax
pop    %rcx
jmp    1040 <EnableInterrupts@plt>

LLVM IR (-O0):
define void @PortA_Init() {
%1 = call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 1074783752 to i32*)
br label %4
4: ; preds = %8, %0
%5 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%11 = and i32 %10, -253
store volatile i32 %11, i32* inttoptr (i64 1073759528 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%13 = and i32 %12, 255
store volatile i32 %13, i32* inttoptr (i64 1073759532 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%15 = or i32 %14, 252
store volatile i32 %15, i32* inttoptr (i64 1073759232 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%17 = and i32 %16, -253
store volatile i32 %17, i32* inttoptr (i64 1073759264 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%19 = or i32 %18, 252
store volatile i32 %19, i32* inttoptr (i64 1073759516 to i32*)
%20 = call i32 (...) @EnableInterrupts()
ret void
}

LLVM IR (-O2):
define void @PortA_Init() {
%1 = tail call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 1074783752 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%10 = and i32 %9, -253
store volatile i32 %10, i32* inttoptr (i64 1073759528 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%12 = and i32 %11, 255
store volatile i32 %12, i32* inttoptr (i64 1073759532 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%14 = or i32 %13, 252
store volatile i32 %14, i32* inttoptr (i64 1073759232 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%16 = and i32 %15, -253
store volatile i32 %16, i32* inttoptr (i64 1073759264 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%18 = or i32 %17, 252
store volatile i32 %18, i32* inttoptr (i64 1073759516 to i32*)
%19 = tail call i32 (...) @EnableInterrupts()
ret void
}