#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 ebob(int, int);
int /*<<< orphan*/ printf(char *, ...);
int sayi_oku();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, i;
  int ebob_s;
  printf("kac sayi gireceksiniz: ");
  scanf("%d", &N);
  ebob_s = sayi_oku();
  printf("yeni ebob: %d\n", ebob_s);
  for (i = 2; i <= N; i++) {
    int sayi = sayi_oku();
    ebob_s = ebob(ebob_s, sayi);
    printf("yeni ebob: %d\n", ebob_s);
  }
  printf("sonuc: %d\n", ebob_s);
  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    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <sayi_oku@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11d2 <main+0x92>
mov    $0x0,%al
call   1040 <sayi_oku@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <ebob@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118f <main+0x4f>
mov    -0x10(%rbp),%esi
lea    0xe4e(%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   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <sayi_oku@plt>
mov    %eax,%ebx
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0xc(%rsp)
jl     11c7 <main+0x87>
mov    $0x1,%ebp
lea    0xe88(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <sayi_oku@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <ebob@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11a0 <main+0x60>
lea    0xe5c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"kac sayi gireceksiniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"yeni ebob: %d\0A\00"
@.str.3 = [11 x i8] c"sonuc: %d\0A\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 ([24 x i8], [24 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
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
store i32 2, i32* %3
br label %11
11: ; preds = %22, %0
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = call i32 (...) @sayi_oku()
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @ebob(i32 %17, i32 %18)
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %11
25: ; preds = %11
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"kac sayi gireceksiniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"yeni ebob: %d\0A\00"
@.str.3 = [11 x i8] c"sonuc: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 2
br i1 %8, label %18, label %9
9: ; preds = %0, %9
%10 = phi i32 [ %15, %9 ], [ 2, %0 ]
%11 = phi i32 [ %13, %9 ], [ %5, %0 ]
%12 = call i32 (...) @sayi_oku()
%13 = call i32 @ebob(i32 %11, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i32 %10, 1
%16 = load i32, i32* %1
%17 = icmp slt i32 %10, %16
br i1 %17, label %9, label %18
18: ; preds = %9, %0
%19 = phi i32 [ %5, %0 ], [ %13, %9 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %19)
ret i32 0
}