#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 */

/* Variables and functions */
int /*<<< orphan*/ enable_button_interrupt();
void _cc3_system_setup(void) {
  (*(volatile unsigned long *)((0xE01FC084))) = (4 - 1) | (1 << 6) | (0 << 5);
  (*(volatile unsigned long *)((0xE01FC080))) = (1 << 0);
  (*(volatile unsigned long *)((0xE01FC08C))) = 0xAA;
  (*(volatile unsigned long *)((0xE01FC08C))) = 0x55;
  while (!((*(volatile unsigned long *)((0xE01FC088))) & (1 << 10)))
    ;
  (*(volatile unsigned long *)((0xE01FC080))) = (1 << 0) | (1 << 1);
  (*(volatile unsigned long *)((0xE01FC08C))) = 0xAA;
  (*(volatile unsigned long *)((0xE01FC08C))) = 0x55;
  (*(volatile unsigned long *)((0xE01FC000))) = 0;
  (*(volatile unsigned long *)((0xE01FC004))) = 3;
  (*(volatile unsigned long *)((0xE01FC000))) = 2;
  (*(volatile unsigned long *)((0xE01FC100))) = 1;
  (*(volatile unsigned long *)((0xE01FC040))) = (1 << 0);
  enable_button_interrupt();
  (*(volatile unsigned long *)((0xE0004004))) = 0;
  (*(volatile unsigned long *)((0xE0004014))) = 0;
  (*(volatile unsigned long *)((0xE0004008))) = 0;
  (*(volatile unsigned long *)((0xE0004010))) = 0;
  (*(volatile unsigned long *)((0xE000400C))) = (int)((14745000 * 4) / 1000);
  (*(volatile unsigned long *)((0xE0004004))) = 1;
}


x86 assembly (clang, -O0):
<_cc3_system_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe01fc084,%eax
movq   $0x43,(%rax)
mov    $0xe01fc080,%eax
movq   $0x1,(%rax)
mov    $0xe01fc08c,%eax
movq   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movq   $0x55,(%rax)
mov    $0xe01fc088,%eax
mov    (%rax),%rax
and    $0x400,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1168 <_cc3_system_setup+0x58>
jmp    116d <_cc3_system_setup+0x5d>
jmp    1144 <_cc3_system_setup+0x34>
mov    $0xe01fc080,%eax
movq   $0x3,(%rax)
mov    $0xe01fc08c,%eax
movq   $0xaa,(%rax)
mov    $0xe01fc08c,%eax
movq   $0x55,(%rax)
mov    $0xe01fc000,%eax
movq   $0x0,(%rax)
mov    $0xe01fc004,%eax
movq   $0x3,(%rax)
mov    $0xe01fc000,%eax
movq   $0x2,(%rax)
mov    $0xe01fc100,%eax
movq   $0x1,(%rax)
mov    $0xe01fc040,%eax
movq   $0x1,(%rax)
mov    $0x0,%al
call   1030 <enable_button_interrupt@plt>
mov    $0xe0004004,%eax
movq   $0x0,(%rax)
mov    $0xe0004014,%eax
movq   $0x0,(%rax)
mov    $0xe0004008,%eax
movq   $0x0,(%rax)
mov    $0xe0004010,%eax
movq   $0x0,(%rax)
mov    $0xe000400c,%eax
movq   $0xe664,(%rax)
mov    $0xe0004004,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_system_setup>:
push   %rbx
mov    $0xe01fc08c,%ebx
movq   $0x43,-0x8(%rbx)
movq   $0x1,-0xc(%rbx)
movq   $0xaa,(%rbx)
movq   $0x55,(%rbx)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
testq  $0x400,-0x4(%rbx)
je     1140 <_cc3_system_setup+0x30>
movq   $0x3,-0xc(%rbx)
movq   $0xaa,(%rbx)
movq   $0x55,(%rbx)
movq   $0x0,-0x8c(%rbx)
movq   $0x3,-0x88(%rbx)
movq   $0x2,-0x8c(%rbx)
movq   $0x1,0x74(%rbx)
movq   $0x1,-0x4c(%rbx)
xor    %eax,%eax
call   1030 <enable_button_interrupt@plt>
movq   $0x0,-0x1f8088(%rbx)
movq   $0x0,-0x1f8078(%rbx)
movq   $0x0,-0x1f8084(%rbx)
movq   $0x0,-0x1f807c(%rbx)
movq   $0xe664,-0x1f8080(%rbx)
movq   $0x1,-0x1f8088(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @_cc3_system_setup() {
store volatile i64 67, i64* inttoptr (i64 3760177284 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177280 to i64*)
store volatile i64 170, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 85, i64* inttoptr (i64 3760177292 to i64*)
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 3760177288 to i64*)
%3 = and i64 %2, 1024
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
store volatile i64 3, i64* inttoptr (i64 3760177280 to i64*)
store volatile i64 170, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 85, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 0, i64* inttoptr (i64 3760177152 to i64*)
store volatile i64 3, i64* inttoptr (i64 3760177156 to i64*)
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177408 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177216 to i64*)
%8 = call i32 (...) @enable_button_interrupt()
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112788 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112776 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112784 to i64*)
store volatile i64 58980, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
ret void
}

LLVM IR (-O2):
define void @_cc3_system_setup() {
store volatile i64 67, i64* inttoptr (i64 3760177284 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177280 to i64*)
store volatile i64 170, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 85, i64* inttoptr (i64 3760177292 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3760177288 to i64*)
%3 = and i64 %2, 1024
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
store volatile i64 3, i64* inttoptr (i64 3760177280 to i64*)
store volatile i64 170, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 85, i64* inttoptr (i64 3760177292 to i64*)
store volatile i64 0, i64* inttoptr (i64 3760177152 to i64*)
store volatile i64 3, i64* inttoptr (i64 3760177156 to i64*)
store volatile i64 2, i64* inttoptr (i64 3760177152 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177408 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177216 to i64*)
%6 = tail call i32 (...) @enable_button_interrupt()
store volatile i64 0, i64* inttoptr (i64 3758112772 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112788 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112776 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758112784 to i64*)
store volatile i64 58980, i64* inttoptr (i64 3758112780 to i64*)
store volatile i64 1, i64* inttoptr (i64 3758112772 to i64*)
ret void
}