#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*/ func();
int /*<<< orphan*/ puts(char *);
int main(void) {
  int i;
  puts(" ax sx fx");
  puts("------------");
  for (i = 0; i < 10; i++)
    func();
  puts("-------------");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116d <main+0x4d>
mov    $0x0,%al
call   1040 <func@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x2e>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
call   1040 <func@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c" ax sx fx\00"
@.str.1 = [13 x i8] c"------------\00"
@.str.2 = [14 x i8] c"-------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @func()
%4 = tail call i32 (...) @func()
%5 = tail call i32 (...) @func()
%6 = tail call i32 (...) @func()
%7 = tail call i32 (...) @func()
%8 = tail call i32 (...) @func()
%9 = tail call i32 (...) @func()
%10 = tail call i32 (...) @func()
%11 = tail call i32 (...) @func()
%12 = tail call i32 (...) @func()
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}