#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 PortC_Init(void) {
  DisableInterrupts();
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000004;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x00000004) == 0) {
  }
  (*((volatile uint32_t *)0x40006528)) &= ~0xF0;
  (*((volatile uint32_t *)0x4000652C)) &= ~0xFFFF0000;
  (*((volatile uint32_t *)0x40006400)) |= 0xF0;
  (*((volatile uint32_t *)0x40006420)) &= ~0xF0;
  (*((volatile uint32_t *)0x4000651C)) |= 0xF0;
  EnableInterrupts();
}


x86 assembly (clang, -O0):
<PortC_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DisableInterrupts@plt>
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    1154 <PortC_Init+0x34>
jmp    113c <PortC_Init+0x1c>
mov    $0x40006528,%eax
mov    (%rax),%ecx
and    $0xffffff0f,%ecx
mov    $0x40006528,%eax
mov    %ecx,(%rax)
mov    $0x4000652c,%eax
mov    (%rax),%ecx
and    $0xffff,%ecx
mov    $0x4000652c,%eax
mov    %ecx,(%rax)
mov    $0x40006400,%eax
mov    (%rax),%ecx
or     $0xf0,%ecx
mov    $0x40006400,%eax
mov    %ecx,(%rax)
mov    $0x40006420,%eax
mov    (%rax),%ecx
and    $0xffffff0f,%ecx
mov    $0x40006420,%eax
mov    %ecx,(%rax)
mov    $0x4000651c,%eax
mov    (%rax),%ecx
or     $0xf0,%ecx
mov    $0x4000651c,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <EnableInterrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PortC_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DisableInterrupts@plt>
orl    $0x4,0x400fe608
04
testl  $0x4,0x400fea08
je     1130 <PortC_Init+0x10>
andl   $0xffffff0f,0x40006528
0f ff ff ff
andl   $0xffff,0x4000652c
orl    $0xf0,0x40006400
andl   $0xffffff0f,0x40006420
0f ff ff ff
orl    $0xf0,0x4000651c
xor    %eax,%eax
pop    %rcx
jmp    1040 <EnableInterrupts@plt>

LLVM IR (-O0):
define void @PortC_Init() {
%1 = call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 4
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, 4
%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 1073767720 to i32*)
%11 = and i32 %10, -241
store volatile i32 %11, i32* inttoptr (i64 1073767720 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073767724 to i32*)
%13 = and i32 %12, 65535
store volatile i32 %13, i32* inttoptr (i64 1073767724 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073767424 to i32*)
%15 = or i32 %14, 240
store volatile i32 %15, i32* inttoptr (i64 1073767424 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073767456 to i32*)
%17 = and i32 %16, -241
store volatile i32 %17, i32* inttoptr (i64 1073767456 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073767708 to i32*)
%19 = or i32 %18, 240
store volatile i32 %19, i32* inttoptr (i64 1073767708 to i32*)
%20 = call i32 (...) @EnableInterrupts()
ret void
}

LLVM IR (-O2):
define void @PortC_Init() {
%1 = tail call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 4
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, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073767720 to i32*)
%10 = and i32 %9, -241
store volatile i32 %10, i32* inttoptr (i64 1073767720 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073767724 to i32*)
%12 = and i32 %11, 65535
store volatile i32 %12, i32* inttoptr (i64 1073767724 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073767424 to i32*)
%14 = or i32 %13, 240
store volatile i32 %14, i32* inttoptr (i64 1073767424 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073767456 to i32*)
%16 = and i32 %15, -241
store volatile i32 %16, i32* inttoptr (i64 1073767456 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073767708 to i32*)
%18 = or i32 %17, 240
store volatile i32 %18, i32* inttoptr (i64 1073767708 to i32*)
%19 = tail call i32 (...) @EnableInterrupts()
ret void
}