#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*/ add_number(int, char *);
int /*<<< orphan*/ clear(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ run_functions(int, char *);
int main() {
  char result[10];
  int i;
  for (i = 1; i < 100; i++) {
    clear(result);
    run_functions(i, result);
    add_number(i, result);
    printf("%s\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    119f <main+0x5f>
lea    -0xe(%rbp),%rdi
call   1060 <clear@plt>
mov    -0x14(%rbp),%edi
lea    -0xe(%rbp),%rsi
call   1050 <run_functions@plt>
mov    -0x14(%rbp),%edi
lea    -0xe(%rbp),%rsi
call   1040 <add_number@plt>
lea    -0xe(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%ebx
lea    0x6(%rsp),%r14
lea    0xea6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1060 <clear@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <run_functions@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <add_number@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 1, %0 ], [ %9, %3 ]
%5 = call i32 @clear(i8* %2)
%6 = call i32 @run_functions(i32 %4, i8* %2)
%7 = call i32 @add_number(i32 %4, i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}