#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, n, sayi, buyuk, ebob;
  printf("Kac sayi girilecek: ");
  scanf("%d", &n);
  buyuk = 0;
  for (i = 1; i <= n; i++) {
    printf("%d. sayi giriniz: ", i);
    scanf("%d", &sayi);
    if (buyuk < sayi) {
      if (buyuk % i == 0 && sayi % i == 0) {
        ebob = i;
      }
      buyuk = sayi;
    }
  }
  printf("ebob = %d", ebob);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d3 <main+0xb3>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c0 <main+0xa0>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11ba <main+0x9a>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11ba <main+0x9a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11c5 <main+0xa5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x3b>
mov    -0x18(%rbp),%esi
lea    0xe4b(%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   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%r15
lea    0x4(%rsp),%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
lea    0xec1(%rip),%r12
mov    %rsp,%r13
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    116a <main+0x4a>
nopl   (%rax)
mov    %ebx,%ecx
mov    %ecx,%ebx
cmp    0x4(%rsp),%ebp
jge    11a1 <main+0x81>
add    $0x1,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%ecx
cmp    %ecx,%ebx
jge    1160 <main+0x40>
mov    %ebx,%eax
cltd
idiv   %ebp
test   %edx,%edx
jne    1162 <main+0x42>
mov    %ecx,%eax
cltd
idiv   %ebp
test   %edx,%edx
cmove  %ebp,%r14d
jmp    1162 <main+0x42>
lea    0xe80(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Kac sayi girilecek: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d. sayi giriniz: \00"
@.str.3 = [10 x i8] c"ebob = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
store i32 0, i32* %5
store i32 1, i32* %2
br label %9
9: ; preds = %35, %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %38
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %34
20: ; preds = %13
%21 = load i32, i32* %5
%22 = load i32, i32* %2
%23 = srem i32 %21, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %20
%26 = load i32, i32* %4
%27 = load i32, i32* %2
%28 = srem i32 %26, %27
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = load i32, i32* %2
store i32 %31, i32* %6
br label %32
32: ; preds = %30, %25, %20
%33 = load i32, i32* %4
store i32 %33, i32* %5
br label %34
34: ; preds = %32, %13
br label %35
35: ; preds = %34
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %9
38: ; preds = %9
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Kac sayi girilecek: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d. sayi giriniz: \00"
@.str.3 = [10 x i8] c"ebob = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br label %9
9: ; preds = %0, %24
%10 = phi i32 [ %26, %24 ], [ undef, %0 ]
%11 = phi i32 [ %25, %24 ], [ 0, %0 ]
%12 = phi i32 [ %27, %24 ], [ 1, %0 ]
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp slt i32 %11, %15
br i1 %16, label %17, label %24
17: ; preds = %9
%18 = srem i32 %11, %12
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = srem i32 %15, %12
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i32 %12, i32 %10
br label %24
24: ; preds = %17, %20, %9
%25 = phi i32 [ %11, %9 ], [ %15, %20 ], [ %15, %17 ]
%26 = phi i32 [ %10, %9 ], [ %23, %20 ], [ %10, %17 ]
%27 = add nuw nsw i32 %12, 1
%28 = load i32, i32* %1
%29 = icmp slt i32 %12, %28
br i1 %29, label %9, label %30
30: ; preds = %24
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %26)
ret i32 0
}