#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 max(int, int);
int /*<<< orphan*/ printf(char *, ...);
int sayi_oku();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  int i, en_buyuk, sayi;
  printf("kac sayi gireceksiniz?");
  scanf("%d", &N);
  en_buyuk = sayi_oku();
  for (i = 2; i <= N; i++) {
    sayi = sayi_oku();
    en_buyuk = max(sayi, en_buyuk);
  }
  printf("en buyuk sayi: %d", en_buyuk);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <sayi_oku@plt>
mov    %eax,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b0 <main+0x70>
mov    $0x0,%al
call   1050 <sayi_oku@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117e <main+0x3e>
mov    -0x10(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <sayi_oku@plt>
mov    %eax,%ebx
cmpl   $0x2,0x4(%rsp)
jl     119b <main+0x5b>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <sayi_oku@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <max@plt>
mov    %eax,%ebx
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1180 <main+0x40>
lea    0xe75(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"kac sayi gireceksiniz?\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"en buyuk sayi: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (...) @sayi_oku()
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 2
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %13, %8 ], [ 2, %0 ]
%10 = phi i32 [ %12, %8 ], [ %5, %0 ]
%11 = call i32 (...) @sayi_oku()
%12 = call i32 @max(i32 %11, i32 %10)
%13 = add nuw nsw i32 %9, 1
%14 = load i32, i32* %1
%15 = icmp slt i32 %9, %14
br i1 %15, label %8, label %16
16: ; preds = %8, %0
%17 = phi i32 [ %5, %0 ], [ %12, %8 ]
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 0
}