#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*/ delay(int);
int main(void) {
  (*(unsigned int volatile *)0x40048038) |= ((1 << 10) | (1 << 12));
  (*(unsigned int volatile *)0x4004A048) &= 0xFFFFF8FF;
  (*(unsigned int volatile *)0x4004A048) |= 0x00000100;
  (*(unsigned int volatile *)0x4004A04C) &= 0xFFFFF8FF;
  (*(unsigned int volatile *)0x4004A04C) |= 0x00000100;
  (*(unsigned int volatile *)0x4004C004) &= 0xFFFFF8FF;
  (*(unsigned int volatile *)0x4004C004) |= 0x00000100;
  (*(unsigned int volatile *)0x400FF054) |= (1 << 18);
  (*(unsigned int volatile *)0x400FF054) |= (1 << 19);
  (*(unsigned int volatile *)0x400FF0D4) |= (1 << 1);
  (*(unsigned int volatile *)0x400FF044) = (1 << 18);
  (*(unsigned int volatile *)0x400FF044) = (1 << 19);
  (*(unsigned int volatile *)0x400FF0C4) = (1 << 1);
  for (;;) {
    delay(500000);
    (*(unsigned int volatile *)0x400FF04C) = (1 << 18) | (1 << 19);
    (*(unsigned int volatile *)0x400FF0CC) = (1 << 1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40048038,%eax
mov    (%rax),%ecx
or     $0x1400,%ecx
mov    $0x40048038,%eax
mov    %ecx,(%rax)
mov    $0x4004a048,%eax
mov    (%rax),%ecx
and    $0xfffff8ff,%ecx
mov    $0x4004a048,%eax
mov    %ecx,(%rax)
mov    $0x4004a048,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0x4004a048,%eax
mov    %ecx,(%rax)
mov    $0x4004a04c,%eax
mov    (%rax),%ecx
and    $0xfffff8ff,%ecx
mov    $0x4004a04c,%eax
mov    %ecx,(%rax)
mov    $0x4004a04c,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0x4004a04c,%eax
mov    %ecx,(%rax)
mov    $0x4004c004,%eax
mov    (%rax),%ecx
and    $0xfffff8ff,%ecx
mov    $0x4004c004,%eax
mov    %ecx,(%rax)
mov    $0x4004c004,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0x4004c004,%eax
mov    %ecx,(%rax)
mov    $0x400ff054,%eax
mov    (%rax),%ecx
or     $0x40000,%ecx
mov    $0x400ff054,%eax
mov    %ecx,(%rax)
mov    $0x400ff054,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0x400ff054,%eax
mov    %ecx,(%rax)
mov    $0x400ff0d4,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x400ff0d4,%eax
mov    %ecx,(%rax)
mov    $0x400ff044,%eax
movl   $0x40000,(%rax)
mov    $0x400ff044,%eax
movl   $0x80000,(%rax)
mov    $0x400ff0c4,%eax
movl   $0x2,(%rax)
mov    $0x7a120,%edi
call   1030 <delay@plt>
mov    $0x400ff04c,%eax
movl   $0xc0000,(%rax)
mov    $0x400ff0cc,%eax
movl   $0x2,(%rax)
jmp    1205 <main+0xf5>

x86 assembly (clang, -O2):
<main>:
push   %rax
orl    $0x1400,0x40048038
andl   $0xfffff8ff,0x4004a048
ff f8 ff ff
orl    $0x100,0x4004a048
andl   $0xfffff8ff,0x4004a04c
ff f8 ff ff
orl    $0x100,0x4004a04c
andl   $0xfffff8ff,0x4004c004
ff f8 ff ff
orl    $0x100,0x4004c004
orl    $0x40000,0x400ff054
orl    $0x80000,0x400ff054
orl    $0x2,0x400ff0d4
02
movl   $0x40000,0x400ff044
movl   $0x80000,0x400ff044
movl   $0x2,0x400ff0c4
nopl   (%rax)
mov    $0x7a120,%edi
call   1030 <delay@plt>
movl   $0xc0000,0x400ff04c
movl   $0x2,0x400ff0cc
jmp    11a0 <main+0x90>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load volatile i32, i32* inttoptr (i64 1074036792 to i32*)
%3 = or i32 %2, 5120
store volatile i32 %3, i32* inttoptr (i64 1074036792 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1074045000 to i32*)
%5 = and i32 %4, -1793
store volatile i32 %5, i32* inttoptr (i64 1074045000 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1074045000 to i32*)
%7 = or i32 %6, 256
store volatile i32 %7, i32* inttoptr (i64 1074045000 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1074045004 to i32*)
%9 = and i32 %8, -1793
store volatile i32 %9, i32* inttoptr (i64 1074045004 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1074045004 to i32*)
%11 = or i32 %10, 256
store volatile i32 %11, i32* inttoptr (i64 1074045004 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1074053124 to i32*)
%13 = and i32 %12, -1793
store volatile i32 %13, i32* inttoptr (i64 1074053124 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1074053124 to i32*)
%15 = or i32 %14, 256
store volatile i32 %15, i32* inttoptr (i64 1074053124 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1074786388 to i32*)
%17 = or i32 %16, 262144
store volatile i32 %17, i32* inttoptr (i64 1074786388 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1074786388 to i32*)
%19 = or i32 %18, 524288
store volatile i32 %19, i32* inttoptr (i64 1074786388 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 1074786516 to i32*)
%21 = or i32 %20, 2
store volatile i32 %21, i32* inttoptr (i64 1074786516 to i32*)
store volatile i32 262144, i32* inttoptr (i64 1074786372 to i32*)
store volatile i32 524288, i32* inttoptr (i64 1074786372 to i32*)
store volatile i32 2, i32* inttoptr (i64 1074786500 to i32*)
br label %22
22: ; preds = %22, %0
%23 = call i32 @delay(i32 500000)
store volatile i32 786432, i32* inttoptr (i64 1074786380 to i32*)
store volatile i32 2, i32* inttoptr (i64 1074786508 to i32*)
br label %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = load volatile i32, i32* inttoptr (i64 1074036792 to i32*)
%2 = or i32 %1, 5120
store volatile i32 %2, i32* inttoptr (i64 1074036792 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074045000 to i32*)
%4 = and i32 %3, -1793
store volatile i32 %4, i32* inttoptr (i64 1074045000 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1074045000 to i32*)
%6 = or i32 %5, 256
store volatile i32 %6, i32* inttoptr (i64 1074045000 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1074045004 to i32*)
%8 = and i32 %7, -1793
store volatile i32 %8, i32* inttoptr (i64 1074045004 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1074045004 to i32*)
%10 = or i32 %9, 256
store volatile i32 %10, i32* inttoptr (i64 1074045004 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1074053124 to i32*)
%12 = and i32 %11, -1793
store volatile i32 %12, i32* inttoptr (i64 1074053124 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1074053124 to i32*)
%14 = or i32 %13, 256
store volatile i32 %14, i32* inttoptr (i64 1074053124 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1074786388 to i32*)
%16 = or i32 %15, 262144
store volatile i32 %16, i32* inttoptr (i64 1074786388 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1074786388 to i32*)
%18 = or i32 %17, 524288
store volatile i32 %18, i32* inttoptr (i64 1074786388 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1074786516 to i32*)
%20 = or i32 %19, 2
store volatile i32 %20, i32* inttoptr (i64 1074786516 to i32*)
store volatile i32 262144, i32* inttoptr (i64 1074786372 to i32*)
store volatile i32 524288, i32* inttoptr (i64 1074786372 to i32*)
store volatile i32 2, i32* inttoptr (i64 1074786500 to i32*)
br label %21
21: ; preds = %21, %0
%22 = tail call i32 @delay(i32 500000)
store volatile i32 786432, i32* inttoptr (i64 1074786380 to i32*)
store volatile i32 2, i32* inttoptr (i64 1074786508 to i32*)
br label %21
}