#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 callee(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ gdb_unbuffer_output();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int main() {
  int *p;
  int i;
  gdb_unbuffer_output();
  p = (int *)malloc(4);
  for (i = 1; i < 10; i++) {
    printf("%d ", callee(i));
    fflush(stdout);
  }
  printf(" Goodbye!\n");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <gdb_unbuffer_output@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11b9 <main+0x69>
mov    -0x14(%rbp),%edi
call   1070 <callee@plt>
mov    %eax,%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <main+0x2b>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <gdb_unbuffer_output@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    $0x1,%edi
call   1080 <callee@plt>
lea    0xe7a(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e47(%rip),%rbx
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x2,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x3,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x4,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x5,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x6,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x7,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x8,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    $0x9,%edi
call   1080 <callee@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
lea    0xd75(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@stdout = global i32 0
@.str.1 = [11 x i8] c" Goodbye!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @gdb_unbuffer_output()
%5 = call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %2
store i32 1, i32* %3
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %3
%12 = call i32 @callee(i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %7
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@stdout = global i32 0
@str = [10 x i8] c" Goodbye!\00"
define i32 @main() {
%1 = tail call i32 (...) @gdb_unbuffer_output()
%2 = tail call i64 @malloc(i32 4)
%3 = tail call i32 @callee(i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @callee(i32 2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @callee(i32 3)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
%15 = tail call i32 @callee(i32 4)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = tail call i32 @fflush(i32 %17)
%19 = tail call i32 @callee(i32 5)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stdout
%22 = tail call i32 @fflush(i32 %21)
%23 = tail call i32 @callee(i32 6)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @stdout
%26 = tail call i32 @fflush(i32 %25)
%27 = tail call i32 @callee(i32 7)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = load i32, i32* @stdout
%30 = tail call i32 @fflush(i32 %29)
%31 = tail call i32 @callee(i32 8)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* @stdout
%34 = tail call i32 @fflush(i32 %33)
%35 = tail call i32 @callee(i32 9)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @stdout
%38 = tail call i32 @fflush(i32 %37)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%40 = load i32, i32* @stdout
%41 = tail call i32 @fflush(i32 %40)
ret i32 0
}