#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 LEDsInit(void) {
  DisableInterrupts();
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000020;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x00000020) == 0) {
  }
  (*((volatile uint32_t *)0x40025400)) |= 0x0E;
  (*((volatile uint32_t *)0x40025420)) &= ~0x0E;
  (*((volatile uint32_t *)0x4002551C)) |= 0x0E;
  (*((volatile uint32_t *)0x4002552C)) &= ~0x0000FFF0;
  (*((volatile uint32_t *)0x40025528)) &= ~0x0E;
  EnableInterrupts();
}


x86 assembly (clang, -O0):
<LEDsInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DisableInterrupts@plt>
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1154 <LEDsInit+0x34>
jmp    113c <LEDsInit+0x1c>
mov    $0x40025400,%eax
mov    (%rax),%ecx
or     $0xe,%ecx
mov    $0x40025400,%eax
mov    %ecx,(%rax)
mov    $0x40025420,%eax
mov    (%rax),%ecx
and    $0xfffffff1,%ecx
mov    $0x40025420,%eax
mov    %ecx,(%rax)
mov    $0x4002551c,%eax
mov    (%rax),%ecx
or     $0xe,%ecx
mov    $0x4002551c,%eax
mov    %ecx,(%rax)
mov    $0x4002552c,%eax
mov    (%rax),%ecx
and    $0xffff000f,%ecx
mov    $0x4002552c,%eax
mov    %ecx,(%rax)
mov    $0x40025528,%eax
mov    (%rax),%ecx
and    $0xfffffff1,%ecx
mov    $0x40025528,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1040 <EnableInterrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEDsInit>:
push   %rax
xor    %eax,%eax
call   1030 <DisableInterrupts@plt>
orl    $0x20,0x400fe608
20
testl  $0x20,0x400fea08
je     1130 <LEDsInit+0x10>
orl    $0xe,0x40025400
0e
andl   $0xfffffff1,0x40025420
f1
orl    $0xe,0x4002551c
0e
andl   $0xffff000f,0x4002552c
andl   $0xfffffff1,0x40025528
f1
xor    %eax,%eax
pop    %rcx
jmp    1040 <EnableInterrupts@plt>

LLVM IR (-O0):
define void @LEDsInit() {
%1 = call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 32
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, 32
%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 1073894400 to i32*)
%11 = or i32 %10, 14
store volatile i32 %11, i32* inttoptr (i64 1073894400 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%13 = and i32 %12, -15
store volatile i32 %13, i32* inttoptr (i64 1073894432 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%15 = or i32 %14, 14
store volatile i32 %15, i32* inttoptr (i64 1073894684 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%17 = and i32 %16, -65521
store volatile i32 %17, i32* inttoptr (i64 1073894700 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%19 = and i32 %18, -15
store volatile i32 %19, i32* inttoptr (i64 1073894696 to i32*)
%20 = call i32 (...) @EnableInterrupts()
ret void
}

LLVM IR (-O2):
define void @LEDsInit() {
%1 = tail call i32 (...) @DisableInterrupts()
%2 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%3 = or i32 %2, 32
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, 32
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073894400 to i32*)
%10 = or i32 %9, 14
store volatile i32 %10, i32* inttoptr (i64 1073894400 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%12 = and i32 %11, -15
store volatile i32 %12, i32* inttoptr (i64 1073894432 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%14 = or i32 %13, 14
store volatile i32 %14, i32* inttoptr (i64 1073894684 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%16 = and i32 %15, -65521
store volatile i32 %16, i32* inttoptr (i64 1073894700 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%18 = and i32 %17, -15
store volatile i32 %18, i32* inttoptr (i64 1073894696 to i32*)
%19 = tail call i32 (...) @EnableInterrupts()
ret void
}