#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i, print_flag = 1;
  if (argc > 1 && strcmp(argv[1], "-p") == 0)
    print_flag = 0;
  for (i = 0;; i++) {
    if (i % 100000000 == 0) {
      if (print_flag) {
        printf("i=%d\n", i);
        fflush(stdout);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    117c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117c <main+0x4c>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5f5e100,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c3 <main+0x93>
cmpl   $0x0,-0x18(%rbp)
je     11be <main+0x8e>
mov    -0x14(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    11c3 <main+0x93>
jmp    11c8 <main+0x98>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <main+0x53>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r15b
cmp    $0x2,%edi
jl     1157 <main+0x27>
mov    0x8(%rsi),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
setne  %r15b
xor    %ebx,%ebx
xor    $0x1,%r15b
lea    0xe9f(%rip),%r14
mov    0x2e75(%rip),%r12
xor    %ebp,%ebp
jmp    1176 <main+0x46>
nop
add    $0x1,%ebp
add    $0xffffffff,%ebx
mov    %ebp,%eax
imul   $0x55e63b89,%rax,%rax
shr    $0x39,%rax
imul   $0x5f5e100,%eax,%eax
add    %ebx,%eax
setne  %al
or     %r15b,%al
jne    1170 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [3 x i8] c"-p\00"
@.str.1 = [6 x i8] c"i=%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 0, i32* %7
br label %17
17: ; preds = %16, %10, %2
store i32 0, i32* %6
br label %18
18: ; preds = %32, %17
%19 = load i32, i32* %6
%20 = srem i32 %19, 100000000
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = load i32, i32* %7
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stdout
%29 = call i32 @fflush(i32 %28)
br label %30
30: ; preds = %25, %22
br label %31
31: ; preds = %30, %18
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"-p\00"
@.str.1 = [6 x i8] c"i=%d\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %4, %2
%10 = phi i1 [ true, %2 ], [ %8, %4 ]
br label %11
11: ; preds = %20, %9
%12 = phi i32 [ 0, %9 ], [ %21, %20 ]
%13 = urem i32 %12, 100000000
%14 = icmp eq i32 %13, 0
%15 = and i1 %10, %14
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fflush(i32 %18)
br label %20
20: ; preds = %11, %16
%21 = add nuw nsw i32 %12, 1
br label %11
}