#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 SW12_Init() {
  DisableInterrupts();
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000020;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x00000020) == 0) {
  }
  (*((volatile uint32_t *)0x40025520)) = 0x4C4F434B;
  (*((volatile uint32_t *)0x40025524)) |= (0x10 | 0x01);
  (*((volatile uint32_t *)0x40025400)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x40025420)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x4002551C)) |= (0x10 | 0x01);
  (*((volatile uint32_t *)0x4002552C)) &= ~0x000F000F;
  (*((volatile uint32_t *)0x40025528)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x40025510)) |= (0x10 | 0x01);
  (*((volatile uint32_t *)0x40025404)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x40025408)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x4002540C)) &= ~(0x10 | 0x01);
  (*((volatile uint32_t *)0x4002541C)) = (0x10 | 0x01);
  (*((volatile uint32_t *)0x40025410)) |= (0x10 | 0x01);
  (*((volatile uint32_t *)0xE000E41C)) &= 0xFF00FFFF;
  (*((volatile uint32_t *)0xE000E41C)) |= 0x00;
  (*((volatile uint32_t *)0xE000E100)) = 0x40000000;
  EnableInterrupts();
}


x86 assembly (clang, -O0):
<SW12_Init>:
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 <SW12_Init+0x34>
jmp    113c <SW12_Init+0x1c>
mov    $0x40025520,%eax
movl   $0x4c4f434b,(%rax)
mov    $0x40025524,%eax
mov    (%rax),%ecx
or     $0x11,%ecx
mov    $0x40025524,%eax
mov    %ecx,(%rax)
mov    $0x40025400,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x40025400,%eax
mov    %ecx,(%rax)
mov    $0x40025420,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x40025420,%eax
mov    %ecx,(%rax)
mov    $0x4002551c,%eax
mov    (%rax),%ecx
or     $0x11,%ecx
mov    $0x4002551c,%eax
mov    %ecx,(%rax)
mov    $0x4002552c,%eax
mov    (%rax),%ecx
and    $0xfff0fff0,%ecx
mov    $0x4002552c,%eax
mov    %ecx,(%rax)
mov    $0x40025528,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x40025528,%eax
mov    %ecx,(%rax)
mov    $0x40025510,%eax
mov    (%rax),%ecx
or     $0x11,%ecx
mov    $0x40025510,%eax
mov    %ecx,(%rax)
mov    $0x40025404,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x40025404,%eax
mov    %ecx,(%rax)
mov    $0x40025408,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x40025408,%eax
mov    %ecx,(%rax)
mov    $0x4002540c,%eax
mov    (%rax),%ecx
and    $0xffffffee,%ecx
mov    $0x4002540c,%eax
mov    %ecx,(%rax)
mov    $0x4002541c,%eax
movl   $0x11,(%rax)
mov    $0x40025410,%eax
mov    (%rax),%ecx
or     $0x11,%ecx
mov    $0x40025410,%eax
mov    %ecx,(%rax)
mov    $0xe000e41c,%eax
mov    (%rax),%ecx
and    $0xff00ffff,%ecx
mov    $0xe000e41c,%eax
mov    %ecx,(%rax)
mov    $0xe000e41c,%eax
mov    (%rax),%ecx
or     $0x0,%ecx
mov    $0xe000e41c,%eax
mov    %ecx,(%rax)
mov    $0xe000e100,%eax
movl   $0x40000000,(%rax)
mov    $0x0,%al
call   1040 <EnableInterrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SW12_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DisableInterrupts@plt>
orl    $0x20,0x400fe608
20
testl  $0x20,0x400fea08
je     1130 <SW12_Init+0x10>
movl   $0x4c4f434b,0x40025520
4b 43 4f 4c
orl    $0x11,0x40025524
11
andl   $0xffffffee,0x40025400
ee
andl   $0xffffffee,0x40025420
ee
orl    $0x11,0x4002551c
11
andl   $0xfff0fff0,0x4002552c
f0 ff f0 ff
andl   $0xffffffee,0x40025528
ee
orl    $0x11,0x40025510
11
andl   $0xffffffee,0x40025404
ee
andl   $0xffffffee,0x40025408
ee
andl   $0xffffffee,0x4002540c
ee
movl   $0x11,0x4002541c
orl    $0x11,0x40025410
11
mov    $0xe000e41c,%eax
andl   $0xff00ffff,(%rax)
mov    (%rax),%ecx
mov    %ecx,(%rax)
movl   $0x40000000,-0x31c(%rax)
xor    %eax,%eax
pop    %rcx
jmp    1040 <EnableInterrupts@plt>

LLVM IR (-O0):
define void @SW12_Init() {
%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
store volatile i32 1280262987, i32* inttoptr (i64 1073894688 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073894692 to i32*)
%11 = or i32 %10, 17
store volatile i32 %11, i32* inttoptr (i64 1073894692 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073894400 to i32*)
%13 = and i32 %12, -18
store volatile i32 %13, i32* inttoptr (i64 1073894400 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%15 = and i32 %14, -18
store volatile i32 %15, i32* inttoptr (i64 1073894432 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%17 = or i32 %16, 17
store volatile i32 %17, i32* inttoptr (i64 1073894684 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%19 = and i32 %18, -983056
store volatile i32 %19, i32* inttoptr (i64 1073894700 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%21 = and i32 %20, -18
store volatile i32 %21, i32* inttoptr (i64 1073894696 to i32*)
%22 = load volatile i32, i32* inttoptr (i64 1073894672 to i32*)
%23 = or i32 %22, 17
store volatile i32 %23, i32* inttoptr (i64 1073894672 to i32*)
%24 = load volatile i32, i32* inttoptr (i64 1073894404 to i32*)
%25 = and i32 %24, -18
store volatile i32 %25, i32* inttoptr (i64 1073894404 to i32*)
%26 = load volatile i32, i32* inttoptr (i64 1073894408 to i32*)
%27 = and i32 %26, -18
store volatile i32 %27, i32* inttoptr (i64 1073894408 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 1073894412 to i32*)
%29 = and i32 %28, -18
store volatile i32 %29, i32* inttoptr (i64 1073894412 to i32*)
store volatile i32 17, i32* inttoptr (i64 1073894428 to i32*)
%30 = load volatile i32, i32* inttoptr (i64 1073894416 to i32*)
%31 = or i32 %30, 17
store volatile i32 %31, i32* inttoptr (i64 1073894416 to i32*)
%32 = load volatile i32, i32* inttoptr (i64 3758154780 to i32*)
%33 = and i32 %32, -16711681
store volatile i32 %33, i32* inttoptr (i64 3758154780 to i32*)
%34 = load volatile i32, i32* inttoptr (i64 3758154780 to i32*)
%35 = or i32 %34, 0
store volatile i32 %35, i32* inttoptr (i64 3758154780 to i32*)
store volatile i32 1073741824, i32* inttoptr (i64 3758153984 to i32*)
%36 = call i32 (...) @EnableInterrupts()
ret void
}

LLVM IR (-O2):
define void @SW12_Init() {
%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
store volatile i32 1280262987, i32* inttoptr (i64 1073894688 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1073894692 to i32*)
%10 = or i32 %9, 17
store volatile i32 %10, i32* inttoptr (i64 1073894692 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073894400 to i32*)
%12 = and i32 %11, -18
store volatile i32 %12, i32* inttoptr (i64 1073894400 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%14 = and i32 %13, -18
store volatile i32 %14, i32* inttoptr (i64 1073894432 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%16 = or i32 %15, 17
store volatile i32 %16, i32* inttoptr (i64 1073894684 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%18 = and i32 %17, -983056
store volatile i32 %18, i32* inttoptr (i64 1073894700 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%20 = and i32 %19, -18
store volatile i32 %20, i32* inttoptr (i64 1073894696 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1073894672 to i32*)
%22 = or i32 %21, 17
store volatile i32 %22, i32* inttoptr (i64 1073894672 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 1073894404 to i32*)
%24 = and i32 %23, -18
store volatile i32 %24, i32* inttoptr (i64 1073894404 to i32*)
%25 = load volatile i32, i32* inttoptr (i64 1073894408 to i32*)
%26 = and i32 %25, -18
store volatile i32 %26, i32* inttoptr (i64 1073894408 to i32*)
%27 = load volatile i32, i32* inttoptr (i64 1073894412 to i32*)
%28 = and i32 %27, -18
store volatile i32 %28, i32* inttoptr (i64 1073894412 to i32*)
store volatile i32 17, i32* inttoptr (i64 1073894428 to i32*)
%29 = load volatile i32, i32* inttoptr (i64 1073894416 to i32*)
%30 = or i32 %29, 17
store volatile i32 %30, i32* inttoptr (i64 1073894416 to i32*)
%31 = load volatile i32, i32* inttoptr (i64 3758154780 to i32*)
%32 = and i32 %31, -16711681
store volatile i32 %32, i32* inttoptr (i64 3758154780 to i32*)
%33 = load volatile i32, i32* inttoptr (i64 3758154780 to i32*)
store volatile i32 %33, i32* inttoptr (i64 3758154780 to i32*)
store volatile i32 1073741824, i32* inttoptr (i64 3758153984 to i32*)
%34 = tail call i32 (...) @EnableInterrupts()
ret void
}