int main(void) {
  long int i;
  (*((volatile unsigned long *)0x4800217C)) &= 0x0000FFFF;
  (*((volatile unsigned long *)0x4800217C)) |= 0x00040000;
  (*((volatile unsigned long *)0x49056034)) &= ~0x00200000;
  (*((volatile unsigned long *)0x4905603C)) |= 0x00200000;
  while (1) {
    for (i = 0; i < 0x100000; i++) {
    }
    (*((volatile unsigned long *)0x4905603C)) ^= 0x00200000;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4800217c,%eax
mov    (%rax),%rcx
and    $0xffff,%rcx
mov    $0x4800217c,%eax
mov    %rcx,(%rax)
mov    $0x4800217c,%eax
mov    (%rax),%rcx
or     $0x40000,%rcx
mov    $0x4800217c,%eax
mov    %rcx,(%rax)
mov    $0x49056034,%eax
mov    (%rax),%rcx
and    $0xffffffffffdfffff,%rcx
mov    $0x49056034,%eax
mov    %rcx,(%rax)
mov    $0x4905603c,%eax
mov    (%rax),%rcx
or     $0x200000,%rcx
mov    $0x4905603c,%eax
mov    %rcx,(%rax)
movq   $0x0,-0x10(%rbp)
cmpq   $0x100000,-0x10(%rbp)
jge    1193 <main+0x93>
jmp    1182 <main+0x82>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116f <main+0x6f>
mov    $0x4905603c,%eax
mov    (%rax),%rcx
xor    $0x200000,%rcx
mov    $0x4905603c,%eax
mov    %rcx,(%rax)
jmp    1167 <main+0x67>

x86 assembly (clang, -O2):
<main>:
andq   $0xffff,0x4800217c
orq    $0x40000,0x4800217c
andq   $0xffffffffffdfffff,0x49056034
49 ff ff df ff
orq    $0x200000,0x4905603c
xorq   $0x200000,0x4905603c
jmp    1130 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = load volatile i64, i64* inttoptr (i64 1207968124 to i64*)
%4 = and i64 %3, 65535
store volatile i64 %4, i64* inttoptr (i64 1207968124 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1207968124 to i64*)
%6 = or i64 %5, 262144
store volatile i64 %6, i64* inttoptr (i64 1207968124 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1225089076 to i64*)
%8 = and i64 %7, -2097153
store volatile i64 %8, i64* inttoptr (i64 1225089076 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 1225089084 to i64*)
%10 = or i64 %9, 2097152
store volatile i64 %10, i64* inttoptr (i64 1225089084 to i64*)
br label %11
11: ; preds = %0, %19
store i64 0, i64* %2
br label %12
12: ; preds = %16, %11
%13 = load i64, i64* %2
%14 = icmp slt i64 %13, 1048576
br i1 %14, label %15, label %19
15: ; preds = %12
br label %16
16: ; preds = %15
%17 = load i64, i64* %2
%18 = add nsw i64 %17, 1
store i64 %18, i64* %2
br label %12
19: ; preds = %12
%20 = load volatile i64, i64* inttoptr (i64 1225089084 to i64*)
%21 = xor i64 %20, 2097152
store volatile i64 %21, i64* inttoptr (i64 1225089084 to i64*)
br label %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = load volatile i64, i64* inttoptr (i64 1207968124 to i64*)
%2 = and i64 %1, 65535
store volatile i64 %2, i64* inttoptr (i64 1207968124 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1207968124 to i64*)
%4 = or i64 %3, 262144
store volatile i64 %4, i64* inttoptr (i64 1207968124 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1225089076 to i64*)
%6 = and i64 %5, -2097153
store volatile i64 %6, i64* inttoptr (i64 1225089076 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1225089084 to i64*)
%8 = or i64 %7, 2097152
store volatile i64 %8, i64* inttoptr (i64 1225089084 to i64*)
br label %9
9: ; preds = %9, %0
%10 = load volatile i64, i64* inttoptr (i64 1225089084 to i64*)
%11 = xor i64 %10, 2097152
store volatile i64 %11, i64* inttoptr (i64 1225089084 to i64*)
br label %9
}