#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 */
scalar_t__ getInt(int *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int data, i;
  for (i = 0; i < 10; ++i)
    if (getInt(&data))
      printf("data = %d\n", data);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116e <main+0x4e>
lea    -0x4(%rbp),%rdi
call   1040 <getInt@plt>
cmp    $0x0,%rax
je     115b <main+0x3b>
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    0x4(%rsp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     115f <main+0x3f>
mov    0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     117e <main+0x5e>
mov    0x4(%rsp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     119d <main+0x7d>
mov    0x4(%rsp),%esi
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     11bc <main+0x9c>
mov    0x4(%rsp),%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     11db <main+0xbb>
mov    0x4(%rsp),%esi
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     11fa <main+0xda>
mov    0x4(%rsp),%esi
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     1219 <main+0xf9>
mov    0x4(%rsp),%esi
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     1238 <main+0x118>
mov    0x4(%rsp),%esi
lea    0xdcd(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <getInt@plt>
test   %rax,%rax
je     1257 <main+0x137>
mov    0x4(%rsp),%esi
lea    0xdae(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"data = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = call i64 @getInt(i32* %1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"data = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @getInt(i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %0, %5
%9 = call i64 @getInt(i32* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %8
%15 = call i64 @getInt(i32* %1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %1
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %14
%21 = call i64 @getInt(i32* %1)
%22 = icmp eq i64 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %1
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %20
%27 = call i64 @getInt(i32* %1)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* %1
%31 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %26
%33 = call i64 @getInt(i32* %1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load i32, i32* %1
%37 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %35, %32
%39 = call i64 @getInt(i32* %1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %1
%43 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %41, %38
%45 = call i64 @getInt(i32* %1)
%46 = icmp eq i64 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32, i32* %1
%49 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %47, %44
%51 = call i64 @getInt(i32* %1)
%52 = icmp eq i64 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %50
%54 = load i32, i32* %1
%55 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %53, %50
%57 = call i64 @getInt(i32* %1)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = load i32, i32* %1
%61 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %59, %56
ret void
}