#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 getNumber(int);
int nbNumbers();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int m = getNumber(0);
  int i;
  for (i = 1; i < nbNumbers(); i++) {
    int n = getNumber(i);
    if (n > m) {
      m = n;
    }
  }
  printf("%d\n", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <getNumber@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <nbNumbers@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    119a <main+0x6a>
mov    -0xc(%rbp),%edi
call   1040 <getNumber@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1187 <main+0x57>
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <main+0x20>
mov    -0x8(%rbp),%esi
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <getNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <nbNumbers@plt>
cmp    $0x2,%eax
jl     116a <main+0x3a>
mov    $0x1,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1040 <getNumber@plt>
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <nbNumbers@plt>
cmp    %eax,%ebp
jl     1150 <main+0x20>
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @getNumber(i32 0)
%2 = tail call i32 (...) @nbNumbers()
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %13
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = phi i32 [ %10, %4 ], [ 1, %0 ]
%7 = tail call i32 @getNumber(i32 %6)
%8 = icmp sgt i32 %7, %5
%9 = select i1 %8, i32 %7, i32 %5
%10 = add nuw nsw i32 %6, 1
%11 = tail call i32 (...) @nbNumbers()
%12 = icmp slt i32 %10, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %0
%14 = phi i32 [ %1, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}