int main(void) {
  volatile unsigned long ulLoop;
  (*((volatile unsigned long *)0x400FE108)) = 0x00000040;
  ulLoop = (*((volatile unsigned long *)0x400FE108));
  (*((volatile unsigned long *)0x40026400)) = 0x04;
  (*((volatile unsigned long *)0x4002651C)) = 0x04;
  while (1) {
    (*((volatile unsigned long *)0x400263FC)) |= 0x04;
    for (ulLoop = 0; ulLoop < 200000; ulLoop++) {
    }
    (*((volatile unsigned long *)0x400263FC)) &= ~(0x04);
    for (ulLoop = 0; ulLoop < 200000; ulLoop++) {
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x400fe108,%eax
movq   $0x40,(%rax)
mov    $0x400fe108,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    $0x40026400,%eax
movq   $0x4,(%rax)
mov    $0x4002651c,%eax
movq   $0x4,(%rax)
mov    $0x400263fc,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0x400263fc,%eax
mov    %rcx,(%rax)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x30d40,%rax
jae    117d <main+0x7d>
jmp    116c <main+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <main+0x57>
mov    $0x400263fc,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    $0x400263fc,%eax
mov    %rcx,(%rax)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    $0x30d40,%rax
jae    11bf <main+0xbf>
jmp    11ae <main+0xae>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1199 <main+0x99>
jmp    113b <main+0x3b>

x86 assembly (clang, -O2):
<main>:
movq   $0x40,0x400fe108
mov    0x400fe108,%rax
40
mov    %rax,-0x8(%rsp)
movq   $0x4,0x40026400
movq   $0x4,0x4002651c
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
orq    $0x4,0x400263fc
40 04
movq   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x30d3f,%rax
ja     1173 <main+0x73>
nop
addq   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x30d40,%rax
jb     1160 <main+0x60>
andq   $0xfffffffffffffffb,0x400263fc
40 fb
movq   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x30d3f,%rax
ja     1140 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addq   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%rax
cmp    $0x30d40,%rax
jb     11a0 <main+0xa0>
jmp    1140 <main+0x40>

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

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