#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 main(void) {
  volatile uint32_t ui32Loop;
  (*((volatile uint32_t *)0x400FE608)) = 0x00001000;
  ui32Loop = (*((volatile uint32_t *)0x400FE608));
  (*((volatile uint32_t *)0x40064400)) = 0x01;
  (*((volatile uint32_t *)0x4006451C)) = 0x01;
  while (1) {
    (*((volatile uint32_t *)0x400643FC)) |= 0x01;
    for (ui32Loop = 0; ui32Loop < 200000; ui32Loop++) {
    }
    (*((volatile uint32_t *)0x400643FC)) &= ~(0x01);
    for (ui32Loop = 0; ui32Loop < 200000; ui32Loop++) {
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x400fe608,%eax
movl   $0x1000,(%rax)
mov    $0x400fe608,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x40064400,%eax
movl   $0x1,(%rax)
mov    $0x4006451c,%eax
movl   $0x1,(%rax)
mov    $0x400643fc,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400643fc,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x30d40,%eax
jge    116f <main+0x6f>
jmp    1161 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x4e>
mov    $0x400643fc,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x400643fc,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x30d40,%eax
jge    11a8 <main+0xa8>
jmp    119a <main+0x9a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1187 <main+0x87>
jmp    1136 <main+0x36>

x86 assembly (clang, -O2):
<main>:
movl   $0x1000,0x400fe608
mov    0x400fe608,%eax
mov    %eax,-0x4(%rsp)
movl   $0x1,0x40064400
movl   $0x1,0x4006451c
nopl   0x0(%rax)
orl    $0x1,0x400643fc
01
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d3f,%eax
jg     1160 <main+0x60>
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d40,%eax
jl     1150 <main+0x50>
andl   $0xfffffffe,0x400643fc
fe
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d3f,%eax
jg     1130 <main+0x30>
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d40,%eax
jl     1180 <main+0x80>
jmp    1130 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 4096, i32* inttoptr (i64 1074783752 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
store volatile i32 %3, i32* %2
store volatile i32 1, i32* inttoptr (i64 1074152448 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074152732 to i32*)
br label %4
4: ; preds = %0, %24
%5 = load volatile i32, i32* inttoptr (i64 1074152444 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 1074152444 to i32*)
store volatile i32 0, i32* %2
br label %7
7: ; preds = %11, %4
%8 = load volatile i32, i32* %2
%9 = icmp slt i32 %8, 200000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load volatile i32, i32* %2
%13 = add nsw i32 %12, 1
store volatile i32 %13, i32* %2
br label %7
14: ; preds = %7
%15 = load volatile i32, i32* inttoptr (i64 1074152444 to i32*)
%16 = and i32 %15, -2
store volatile i32 %16, i32* inttoptr (i64 1074152444 to i32*)
store volatile i32 0, i32* %2
br label %17
17: ; preds = %21, %14
%18 = load volatile i32, i32* %2
%19 = icmp slt i32 %18, 200000
br i1 %19, label %20, label %24
20: ; preds = %17
br label %21
21: ; preds = %20
%22 = load volatile i32, i32* %2
%23 = add nsw i32 %22, 1
store volatile i32 %23, i32* %2
br label %17
24: ; preds = %17
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 4096, i32* inttoptr (i64 1074783752 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
store volatile i32 %3, i32* %1
store volatile i32 1, i32* inttoptr (i64 1074152448 to i32*)
store volatile i32 1, i32* inttoptr (i64 1074152732 to i32*)
br label %4
4: ; preds = %19, %0
%5 = load volatile i32, i32* inttoptr (i64 1074152444 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 1074152444 to i32*)
store volatile i32 0, i32* %1
%7 = load volatile i32, i32* %1
%8 = icmp slt i32 %7, 200000
br i1 %8, label %9, label %14
9: ; preds = %4, %9
%10 = load volatile i32, i32* %1
%11 = add nsw i32 %10, 1
store volatile i32 %11, i32* %1
%12 = load volatile i32, i32* %1
%13 = icmp slt i32 %12, 200000
br i1 %13, label %9, label %14
14: ; preds = %9, %4
%15 = load volatile i32, i32* inttoptr (i64 1074152444 to i32*)
%16 = and i32 %15, -2
store volatile i32 %16, i32* inttoptr (i64 1074152444 to i32*)
store volatile i32 0, i32* %1
%17 = load volatile i32, i32* %1
%18 = icmp slt i32 %17, 200000
br i1 %18, label %20, label %19
19: ; preds = %20, %14
br label %4
20: ; preds = %14, %20
%21 = load volatile i32, i32* %1
%22 = add nsw i32 %21, 1
store volatile i32 %22, i32* %1
%23 = load volatile i32, i32* %1
%24 = icmp slt i32 %23, 200000
br i1 %24, label %20, label %19
}