#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*/ inc(unsigned int *);
int nonmain(void) {
  unsigned int ra;
  ra = 1 << 18;
  *((unsigned int *)0x20200004) = ra;
  while (1) {
    *((unsigned int *)0x2020001C) = 1 << 16;
    for (ra = 0; ra < 0x100000;)
      inc(&ra);
    *((unsigned int *)0x20200028) = 1 << 16;
    for (ra = 0; ra < 0x100000;)
      inc(&ra);
  }
  return 0;
}


x86 assembly (clang, -O0):
<nonmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x40000,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x20200004,%eax
mov    %ecx,(%rax)
mov    $0x2020001c,%eax
movl   $0x10000,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x100000,-0x4(%rbp)
jae    1156 <nonmain+0x46>
lea    -0x4(%rbp),%rdi
call   1030 <inc@plt>
jmp    113b <nonmain+0x2b>
mov    $0x20200028,%eax
movl   $0x10000,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x100000,-0x4(%rbp)
jae    1183 <nonmain+0x73>
lea    -0x4(%rbp),%rdi
call   1030 <inc@plt>
jmp    1168 <nonmain+0x58>
jmp    1129 <nonmain+0x19>

x86 assembly (clang, -O2):
<nonmain>:
push   %rbx
sub    $0x10,%rsp
movl   $0x40000,0x20200004
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x10000,0x2020001c
movl   $0x0,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <inc@plt>
cmpl   $0x100000,0xc(%rsp)
jb     1150 <nonmain+0x40>
movl   $0x10000,0x20200028
movl   $0x0,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <inc@plt>
cmpl   $0x100000,0xc(%rsp)
jb     1180 <nonmain+0x70>
jmp    1130 <nonmain+0x20>

LLVM IR (-O0):
define i32 @nonmain() {
%1 = alloca i32
store i32 262144, i32* %1
%2 = load i32, i32* %1
store i32 %2, i32* inttoptr (i64 538968068 to i32*)
br label %3
3: ; preds = %0, %15
store i32 65536, i32* inttoptr (i64 538968092 to i32*)
store i32 0, i32* %1
br label %4
4: ; preds = %7, %3
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 1048576
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 @inc(i32* %1)
br label %4
9: ; preds = %4
store i32 65536, i32* inttoptr (i64 538968104 to i32*)
store i32 0, i32* %1
br label %10
10: ; preds = %13, %9
%11 = load i32, i32* %1
%12 = icmp ult i32 %11, 1048576
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @inc(i32* %1)
br label %10
15: ; preds = %10
br label %3
}

LLVM IR (-O2):
define i32 @nonmain() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 262144, i32* inttoptr (i64 538968068 to i32*)
br label %3
3: ; preds = %9, %0
store i32 65536, i32* inttoptr (i64 538968092 to i32*)
store i32 0, i32* %1
br label %4
4: ; preds = %3, %4
%5 = call i32 @inc(i32* %1)
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 1048576
br i1 %7, label %4, label %8
8: ; preds = %4
store i32 65536, i32* inttoptr (i64 538968104 to i32*)
store i32 0, i32* %1
br label %9
9: ; preds = %8, %9
%10 = call i32 @inc(i32* %1)
%11 = load i32, i32* %1
%12 = icmp ult i32 %11, 1048576
br i1 %12, label %9, label %3
}