#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 *, double *);
int main() {
  printf("Sayilari giriniz. Cikmak icin -1 giriniz.\n");
  double max, n, min;
  scanf("%lf", &n);
  if (n == -1) {
    return 0;
  }
  min = n;
  max = n;
  while (n != -1) {
    scanf("%lf", &n);
    if (n > max && n != -1) {
      max = n;
    }
    if (n < min && n != -1) {
      min = n;
    }
    if (n == -1) {
      break;
    }
  }
  printf("Max sayi: %.0lf\n", max);
  printf("Min sayi: %.0lf\n", min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1176 <main+0x56>
jp     1176 <main+0x56>
movl   $0x0,-0x4(%rbp)
jmp    128c <main+0x16c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ac <main+0x8c>
jp     11ac <main+0x8c>
jmp    125f <main+0x13f>
lea    0xe80(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11f8 <main+0xd8>
movsd  -0x18(%rbp),%xmm0
movsd  0xe27(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ee <main+0xce>
jp     11ee <main+0xce>
jmp    11f8 <main+0xd8>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1238 <main+0x118>
movsd  -0x18(%rbp),%xmm0
movsd  0xde7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    122e <main+0x10e>
jp     122e <main+0x10e>
jmp    1238 <main+0x118>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdbb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    125a <main+0x13a>
jp     125a <main+0x13a>
jmp    125f <main+0x13f>
jmp    118a <main+0x6a>
movsd  -0x10(%rbp),%xmm0
lea    0xdcc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xdca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe9e(%rip),%xmm1
jne    116a <main+0x3a>
jnp    1220 <main+0xf0>
lea    0xe97(%rip),%r14
lea    0x8(%rsp),%rbx
movapd %xmm1,%xmm5
jmp    11b0 <main+0x80>
nopl   0x0(%rax)
movapd 0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
cmpltsd %xmm5,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm0,%xmm1
orpd   %xmm3,%xmm1
cmpltsd %xmm4,%xmm5
andpd  %xmm5,%xmm2
andnpd %xmm4,%xmm5
orpd   %xmm2,%xmm5
jne    11b0 <main+0x80>
jnp    11ff <main+0xcf>
movapd %xmm5,0x10(%rsp)
movapd %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm5
ucomisd 0xe2b(%rip),%xmm5
movapd %xmm5,%xmm3
jne    11e7 <main+0xb7>
movapd %xmm5,%xmm3
jp     11e7 <main+0xb7>
movapd 0x20(%rsp),%xmm3
movapd %xmm5,%xmm2
movapd 0x10(%rsp),%xmm4
jne    1180 <main+0x50>
movapd %xmm5,%xmm2
jp     1180 <main+0x50>
movapd %xmm4,%xmm2
jmp    1180 <main+0x50>
lea    0xe06(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Sayilari giriniz. Cikmak icin -1 giriniz.\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"Max sayi: %.0lf\0A\00"
@.str.3 = [17 x i8] c"Min sayi: %.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%7 = load double, double* %3
%8 = fcmp oeq double %7, -1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %45
10: ; preds = %0
%11 = load double, double* %3
store double %11, double* %4
%12 = load double, double* %3
store double %12, double* %2
br label %13
13: ; preds = %39, %10
%14 = load double, double* %3
%15 = fcmp une double %14, -1.000000e+00
br i1 %15, label %16, label %40
16: ; preds = %13
%17 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%18 = load double, double* %3
%19 = load double, double* %2
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %26
21: ; preds = %16
%22 = load double, double* %3
%23 = fcmp une double %22, -1.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load double, double* %3
store double %25, double* %2
br label %26
26: ; preds = %24, %21, %16
%27 = load double, double* %3
%28 = load double, double* %4
%29 = fcmp olt double %27, %28
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = load double, double* %3
%32 = fcmp une double %31, -1.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = load double, double* %3
store double %34, double* %4
br label %35
35: ; preds = %33, %30, %26
%36 = load double, double* %3
%37 = fcmp oeq double %36, -1.000000e+00
br i1 %37, label %38, label %39
38: ; preds = %35
br label %40
39: ; preds = %35
br label %13
40: ; preds = %38, %13
%41 = load double, double* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %41)
%43 = load double, double* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %43)
store i32 0, i32* %1
br label %45
45: ; preds = %40, %9
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [17 x i8] c"Max sayi: %.0lf\0A\00"
@.str.3 = [17 x i8] c"Min sayi: %.0lf\0A\00"
@str = [42 x i8] c"Sayilari giriniz. Cikmak icin -1 giriniz.\00"
define i32 @main() {
%1 = alloca double
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%3 = bitcast double* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fcmp oeq double %5, -1.000000e+00
br i1 %6, label %22, label %7
7: ; preds = %0, %7
%8 = phi double [ %15, %7 ], [ %5, %0 ]
%9 = phi double [ %18, %7 ], [ %5, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%11 = load double, double* %1
%12 = fcmp ogt double %11, %8
%13 = fcmp une double %11, -1.000000e+00
%14 = and i1 %12, %13
%15 = select i1 %14, double %11, double %8
%16 = fcmp olt double %11, %9
%17 = and i1 %16, %13
%18 = select i1 %17, double %11, double %9
br i1 %13, label %7, label %19
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %8)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %9)
br label %22
22: ; preds = %0, %19
ret i32 0
}