#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)) = 0x00004000;
  ui32Loop = (*((volatile uint32_t *)0x400FE608));
  (*((volatile uint32_t *)0x40066400)) = 0x80;
  (*((volatile uint32_t *)0x4006651C)) = 0x80;
  while (1) {
    (*((volatile uint32_t *)0x400663FC)) |= 0x80;
    for (ui32Loop = 0; ui32Loop < 200000; ui32Loop++) {
    }
    (*((volatile uint32_t *)0x400663FC)) &= ~(0x80);
    for (ui32Loop = 0; ui32Loop < 200000; ui32Loop++) {
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x400fe608,%eax
movl   $0x4000,(%rax)
mov    $0x400fe608,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    $0x40066400,%eax
movl   $0x80,(%rax)
mov    $0x4006651c,%eax
movl   $0x80,(%rax)
mov    $0x400663fc,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x400663fc,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x30d40,%eax
jge    1172 <main+0x72>
jmp    1164 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <main+0x51>
mov    $0x400663fc,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x400663fc,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x30d40,%eax
jge    11ae <main+0xae>
jmp    11a0 <main+0xa0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118d <main+0x8d>
jmp    1136 <main+0x36>

x86 assembly (clang, -O2):
<main>:
movl   $0x4000,0x400fe608
mov    0x400fe608,%eax
mov    %eax,-0x4(%rsp)
movl   $0x80,0x40066400
movl   $0x80,0x4006651c
nopl   0x0(%rax)
orl    $0x80,0x400663fc
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d3f,%eax
jg     1160 <main+0x60>
xchg   %ax,%ax
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d40,%eax
jl     1150 <main+0x50>
andl   $0xffffff7f,0x400663fc
7f ff ff ff
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x30d3f,%eax
jg     1130 <main+0x30>
xchg   %ax,%ax
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 16384, 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 128, i32* inttoptr (i64 1074160640 to i32*)
store volatile i32 128, i32* inttoptr (i64 1074160924 to i32*)
br label %4
4: ; preds = %0, %24
%5 = load volatile i32, i32* inttoptr (i64 1074160636 to i32*)
%6 = or i32 %5, 128
store volatile i32 %6, i32* inttoptr (i64 1074160636 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 1074160636 to i32*)
%16 = and i32 %15, -129
store volatile i32 %16, i32* inttoptr (i64 1074160636 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 16384, 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 128, i32* inttoptr (i64 1074160640 to i32*)
store volatile i32 128, i32* inttoptr (i64 1074160924 to i32*)
br label %4
4: ; preds = %19, %0
%5 = load volatile i32, i32* inttoptr (i64 1074160636 to i32*)
%6 = or i32 %5, 128
store volatile i32 %6, i32* inttoptr (i64 1074160636 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 1074160636 to i32*)
%16 = and i32 %15, -129
store volatile i32 %16, i32* inttoptr (i64 1074160636 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
}