#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*/ glutPostRedisplay();
void on_idle(void) {
  volatile int i, j;
  for (i = 0; i < 1000000; ++i)
    for (j = 0; j < 10; ++j)
      ;
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<on_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0xf4240,%eax
jge    1166 <on_idle+0x56>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0xa,%eax
jge    1153 <on_idle+0x43>
jmp    1145 <on_idle+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <on_idle+0x24>
jmp    1158 <on_idle+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <on_idle+0xf>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_idle>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xf423f,%eax
jle    1140 <on_idle+0x30>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
nopw   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xf4240,%eax
jge    1123 <on_idle+0x13>
movl   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%eax
cmp    $0x9,%eax
jg     1130 <on_idle+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x8(%rsp)
mov    -0x8(%rsp),%eax
cmp    $0xa,%eax
jl     1160 <on_idle+0x50>
jmp    1130 <on_idle+0x20>

LLVM IR (-O0):
define void @on_idle() {
%1 = alloca i32
%2 = alloca i32
store volatile i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = load volatile i32, i32* %1
%5 = icmp slt i32 %4, 1000000
br i1 %5, label %6, label %18
6: ; preds = %3
store volatile i32 0, i32* %2
br label %7
7: ; preds = %11, %6
%8 = load volatile i32, i32* %2
%9 = icmp slt i32 %8, 10
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
br label %15
15: ; preds = %14
%16 = load volatile i32, i32* %1
%17 = add nsw i32 %16, 1
store volatile i32 %17, i32* %1
br label %3
18: ; preds = %3
%19 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @on_idle() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %1
%5 = load volatile i32, i32* %1
%6 = icmp slt i32 %5, 1000000
br i1 %6, label %7, label %20
7: ; preds = %0, %15
store volatile i32 0, i32* %2
%8 = load volatile i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %7, %10
%11 = load volatile i32, i32* %2
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %2
%13 = load volatile i32, i32* %2
%14 = icmp slt i32 %13, 10
br i1 %14, label %10, label %15
15: ; preds = %10, %7
%16 = load volatile i32, i32* %1
%17 = add nsw i32 %16, 1
store volatile i32 %17, i32* %1
%18 = load volatile i32, i32* %1
%19 = icmp slt i32 %18, 1000000
br i1 %19, label %7, label %20
20: ; preds = %15, %0
%21 = tail call i32 (...) @glutPostRedisplay()
ret void
}