#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 abs(int);
int /*<<< orphan*/ printf(char *, ...);
int sayi_tersi_bul(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sayi_sayisi, sayi;
  int sayi_tersi;
  int i, enbuyugi;
  printf("kac sayi gireceksiniz: ");
  scanf("%d", &sayi_sayisi);
  printf("sayi girin:");
  scanf("%d", &sayi);
  sayi_tersi = sayi_tersi_bul(sayi);
  enbuyugi = abs(sayi - sayi_tersi);
  for (i = 2; i <= sayi_sayisi; i++) {
    printf("sayi girin:");
    scanf("%d", &sayi);
    sayi_tersi = sayi_tersi_bul(sayi);
    if (enbuyugi < abs(sayi - sayi_tersi)) {
      enbuyugi = abs(sayi - sayi_tersi);
    }
  }
  printf("enbuyugi %d\n", enbuyugi);
  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   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1050 <sayi_tersi_bul@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     121f <main+0xdf>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1050 <sayi_tersi_bul@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    120c <main+0xcc>
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x18(%rbp)
jmp    1211 <main+0xd1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x6b>
mov    -0x18(%rbp),%esi
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
call   1040 <sayi_tersi_bul@plt>
mov    0x8(%rsp),%ecx
sub    %eax,%ecx
mov    %ecx,%ebx
neg    %ebx
cmovs  %ecx,%ebx
cmpl   $0x2,0xc(%rsp)
jl     11e9 <main+0xb9>
mov    $0x1,%ebp
lea    0xe79(%rip),%r14
lea    0xe6f(%rip),%r15
lea    0x8(%rsp),%r12
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
call   1040 <sayi_tersi_bul@plt>
mov    0x8(%rsp),%ecx
sub    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
cmp    %eax,%ebx
cmovl  %eax,%ebx
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11b0 <main+0x80>
lea    0xe37(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
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 = [12 x i8] c"sayi girin:\00"
@.str.3 = [13 x i8] c"enbuyugi %d\0A\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 ([24 x i8], [24 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* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = call i32 @sayi_tersi_bul(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = call i32 @abs(i32 %15)
store i32 %16, i32* %6
store i32 2, i32* %5
br label %17
17: ; preds = %38, %0
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %41
21: ; preds = %17
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %3
%25 = call i32 @sayi_tersi_bul(i32 %24)
store i32 %25, i32* %4
%26 = load i32, i32* %6
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = sub nsw i32 %27, %28
%30 = call i32 @abs(i32 %29)
%31 = icmp slt i32 %26, %30
br i1 %31, label %32, label %37
32: ; preds = %21
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = sub nsw i32 %33, %34
%36 = call i32 @abs(i32 %35)
store i32 %36, i32* %6
br label %37
37: ; preds = %32, %21
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %17
41: ; preds = %17
%42 = load i32, i32* %6
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %42)
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 = [12 x i8] c"sayi girin:\00"
@.str.3 = [13 x i8] c"enbuyugi %d\0A\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 ([24 x i8], [24 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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @sayi_tersi_bul(i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, %10
%13 = call i32 @llvm.abs.i32(i32 %12, i1 true)
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 2
br i1 %15, label %31, label %16
16: ; preds = %0, %16
%17 = phi i32 [ %27, %16 ], [ %13, %0 ]
%18 = phi i32 [ %28, %16 ], [ 2, %0 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = call i32 @sayi_tersi_bul(i32 %21)
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, %22
%25 = call i32 @llvm.abs.i32(i32 %24, i1 true)
%26 = icmp slt i32 %17, %25
%27 = select i1 %26, i32 %25, i32 %17
%28 = add nuw nsw i32 %18, 1
%29 = load i32, i32* %1
%30 = icmp slt i32 %18, %29
br i1 %30, label %16, label %31
31: ; preds = %16, %0
%32 = phi i32 [ %13, %0 ], [ %27, %16 ]
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret i32 0
}