#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 *, double *, double *);
int main() {
  double a, b, c, d, e, f, g;
  printf("Podaj trzy liczby: ");
  scanf("%lf %lf %lf", &a, &b, &c);
  d = a + b + c;
  printf("Suma wynosi: %.2lf\n", d);
  e = a * b * c;
  printf("Iloczyn wynosi: %.2lf\n", e);
  if ((a > b) && (a > c)) {
    printf("Najwieksza liczba to: %.2lf\n", a);
  }
  if ((b > a) && (b > c)) {
    printf("Najwieksza liczba to: %.2lf\n", b);
  }
  if ((c > a) && (c > b)) {
    printf("Najwieksza liczba to: %.2lf\n", c);
  }
  if ((a < b) && (a < c)) {
    printf("Najmniejsza liczba to: %.2lf\n", a);
  }
  if ((b < a) && (b < c)) {
    printf("Najmniejsza liczba to: %.2lf\n", b);
  }
  if ((c < a) && (c < b)) {
    printf("Najmniejsza liczba to: %.2lf\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xeab(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11d6 <main+0xb6>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11d6 <main+0xb6>
movsd  -0x10(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1209 <main+0xe9>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1209 <main+0xe9>
movsd  -0x18(%rbp),%xmm0
lea    0xe49(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    123c <main+0x11c>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    123c <main+0x11c>
movsd  -0x20(%rbp),%xmm0
lea    0xe16(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1277 <main+0x157>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1277 <main+0x157>
movsd  -0x10(%rbp),%xmm0
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12b2 <main+0x192>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12b2 <main+0x192>
movsd  -0x18(%rbp),%xmm0
lea    0xdbd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ed <main+0x1cd>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12ed <main+0x1cd>
movsd  -0x20(%rbp),%xmm0
lea    0xd82(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
ucomisd %xmm0,%xmm2
movsd  (%rsp),%xmm1
jbe    11c9 <main+0xa9>
ucomisd %xmm1,%xmm2
jbe    11c9 <main+0xa9>
lea    0xe9e(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
ucomisd %xmm2,%xmm0
jbe    11f4 <main+0xd4>
ucomisd %xmm1,%xmm0
jbe    11f4 <main+0xd4>
lea    0xe6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
ucomisd %xmm2,%xmm1
jbe    1223 <main+0x103>
ucomisd %xmm0,%xmm1
jbe    1223 <main+0x103>
lea    0xe44(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm2,%xmm0
jbe    1252 <main+0x132>
ucomisd %xmm2,%xmm1
jbe    1252 <main+0x132>
lea    0xe32(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm2
jbe    127d <main+0x15d>
ucomisd %xmm0,%xmm1
jbe    127d <main+0x15d>
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm2
jbe    129b <main+0x17b>
ucomisd %xmm1,%xmm0
jbe    129b <main+0x17b>
lea    0xdd8(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Podaj trzy liczby: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [20 x i8] c"Suma wynosi: %.2lf\0A\00"
@.str.3 = [23 x i8] c"Iloczyn wynosi: %.2lf\0A\00"
@.str.4 = [29 x i8] c"Najwieksza liczba to: %.2lf\0A\00"
@.str.5 = [30 x i8] c"Najmniejsza liczba to: %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fadd double %11, %12
%14 = load double, double* %4
%15 = fadd double %13, %14
store double %15, double* %5
%16 = load double, double* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = load double, double* %2
%19 = load double, double* %3
%20 = fmul double %18, %19
%21 = load double, double* %4
%22 = fmul double %20, %21
store double %22, double* %6
%23 = load double, double* %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %23)
%25 = load double, double* %2
%26 = load double, double* %3
%27 = fcmp ogt double %25, %26
br i1 %27, label %28, label %35
28: ; preds = %0
%29 = load double, double* %2
%30 = load double, double* %4
%31 = fcmp ogt double %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load double, double* %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %33)
br label %35
35: ; preds = %32, %28, %0
%36 = load double, double* %3
%37 = load double, double* %2
%38 = fcmp ogt double %36, %37
br i1 %38, label %39, label %46
39: ; preds = %35
%40 = load double, double* %3
%41 = load double, double* %4
%42 = fcmp ogt double %40, %41
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = load double, double* %3
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %44)
br label %46
46: ; preds = %43, %39, %35
%47 = load double, double* %4
%48 = load double, double* %2
%49 = fcmp ogt double %47, %48
br i1 %49, label %50, label %57
50: ; preds = %46
%51 = load double, double* %4
%52 = load double, double* %3
%53 = fcmp ogt double %51, %52
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = load double, double* %4
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %55)
br label %57
57: ; preds = %54, %50, %46
%58 = load double, double* %2
%59 = load double, double* %3
%60 = fcmp olt double %58, %59
br i1 %60, label %61, label %68
61: ; preds = %57
%62 = load double, double* %2
%63 = load double, double* %4
%64 = fcmp olt double %62, %63
br i1 %64, label %65, label %68
65: ; preds = %61
%66 = load double, double* %2
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %66)
br label %68
68: ; preds = %65, %61, %57
%69 = load double, double* %3
%70 = load double, double* %2
%71 = fcmp olt double %69, %70
br i1 %71, label %72, label %79
72: ; preds = %68
%73 = load double, double* %3
%74 = load double, double* %4
%75 = fcmp olt double %73, %74
br i1 %75, label %76, label %79
76: ; preds = %72
%77 = load double, double* %3
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %77)
br label %79
79: ; preds = %76, %72, %68
%80 = load double, double* %4
%81 = load double, double* %2
%82 = fcmp olt double %80, %81
br i1 %82, label %83, label %90
83: ; preds = %79
%84 = load double, double* %4
%85 = load double, double* %3
%86 = fcmp olt double %84, %85
br i1 %86, label %87, label %90
87: ; preds = %83
%88 = load double, double* %4
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %88)
br label %90
90: ; preds = %87, %83, %79
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Podaj trzy liczby: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [20 x i8] c"Suma wynosi: %.2lf\0A\00"
@.str.3 = [23 x i8] c"Iloczyn wynosi: %.2lf\0A\00"
@.str.4 = [29 x i8] c"Najwieksza liczba to: %.2lf\0A\00"
@.str.5 = [30 x i8] c"Najmniejsza liczba to: %.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fadd double %9, %10
%12 = load double, double* %3
%13 = fadd double %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %13)
%15 = load double, double* %1
%16 = load double, double* %2
%17 = fmul double %15, %16
%18 = load double, double* %3
%19 = fmul double %17, %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %19)
%21 = load double, double* %1
%22 = load double, double* %2
%23 = fcmp ogt double %21, %22
%24 = load double, double* %3
%25 = fcmp ogt double %21, %24
%26 = select i1 %23, i1 %25, i1 false
br i1 %26, label %27, label %32
27: ; preds = %0
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %21)
%29 = load double, double* %2
%30 = load double, double* %1
%31 = load double, double* %3
br label %32
32: ; preds = %27, %0
%33 = phi double [ %31, %27 ], [ %24, %0 ]
%34 = phi double [ %30, %27 ], [ %21, %0 ]
%35 = phi double [ %29, %27 ], [ %22, %0 ]
%36 = fcmp ogt double %35, %34
%37 = fcmp ogt double %35, %33
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %44
39: ; preds = %32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %35)
%41 = load double, double* %3
%42 = load double, double* %1
%43 = load double, double* %2
br label %44
44: ; preds = %39, %32
%45 = phi double [ %43, %39 ], [ %35, %32 ]
%46 = phi double [ %42, %39 ], [ %34, %32 ]
%47 = phi double [ %41, %39 ], [ %33, %32 ]
%48 = fcmp ogt double %47, %46
%49 = fcmp ogt double %47, %45
%50 = select i1 %48, i1 %49, i1 false
br i1 %50, label %51, label %56
51: ; preds = %44
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %47)
%53 = load double, double* %1
%54 = load double, double* %2
%55 = load double, double* %3
br label %56
56: ; preds = %51, %44
%57 = phi double [ %55, %51 ], [ %47, %44 ]
%58 = phi double [ %54, %51 ], [ %45, %44 ]
%59 = phi double [ %53, %51 ], [ %46, %44 ]
%60 = fcmp olt double %59, %58
%61 = fcmp olt double %59, %57
%62 = select i1 %60, i1 %61, i1 false
br i1 %62, label %63, label %68
63: ; preds = %56
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %59)
%65 = load double, double* %2
%66 = load double, double* %1
%67 = load double, double* %3
br label %68
68: ; preds = %63, %56
%69 = phi double [ %67, %63 ], [ %57, %56 ]
%70 = phi double [ %66, %63 ], [ %59, %56 ]
%71 = phi double [ %65, %63 ], [ %58, %56 ]
%72 = fcmp olt double %71, %70
%73 = fcmp olt double %71, %69
%74 = select i1 %72, i1 %73, i1 false
br i1 %74, label %75, label %80
75: ; preds = %68
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %71)
%77 = load double, double* %3
%78 = load double, double* %1
%79 = load double, double* %2
br label %80
80: ; preds = %75, %68
%81 = phi double [ %79, %75 ], [ %71, %68 ]
%82 = phi double [ %78, %75 ], [ %70, %68 ]
%83 = phi double [ %77, %75 ], [ %69, %68 ]
%84 = fcmp olt double %83, %82
%85 = fcmp olt double %83, %81
%86 = select i1 %84, i1 %85, i1 false
br i1 %86, label %87, label %89
87: ; preds = %80
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %83)
br label %89
89: ; preds = %87, %80
ret i32 0
}