#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*/ _puts(char *, int);
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ printf(char *, int);
void main(int varc, char *charv[]) {
  int k;
  for (k = 0; k < 16; k++) {
    printf("%d ", k);
    _puts("_puts(\"Hello\", k);", k);
  }
  die("Good Bye");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    117c <main+0x4c>
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <_puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x16>
lea    0xe94(%rip),%rdi
call   1050 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x4,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x6,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0x9,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xb,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xd,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xe,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <_puts@plt>
mov    %r14,%rdi
mov    $0xf,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <_puts@plt>
lea    0xd34(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <die@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [19 x i8] c"_puts(\22Hello\22, k);\00"
@.str.2 = [9 x i8] c"Good Bye\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 3)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 4)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 5)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%16 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 6)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%18 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 7)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%20 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 8)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%22 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 9)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%24 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 10)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 11)
%26 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 11)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%28 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 12)
%29 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 13)
%30 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 13)
%31 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 14)
%32 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 14)
%33 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 15)
%34 = tail call i32 @_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 15)
%35 = tail call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}