#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, x;
  printf("Wprowadź trzy liczby: \n");
  scanf("%lf %lf %lf", &a, &b, &c);
  x = a + b + c;
  printf("Suma wynosi: %.2lf\n", x);
  x = a * b * c;
  printf("Iloczyn wynosi: %.2lf\n", x);
  if (a < b && a < c) {
    printf("Najmniejsza liczba to: %.2lf\n", a);
  } else if (b < a && b < c) {
    printf("Najmniejsza liczba to: %.2lf\n", b);
  } else if (c < a && c < b) {
    printf("Najmniejsza liczba to: %.2lf\n", c);
  }
  if (a > b && a > c) {
    printf("Największa liczba to: %.2lf\n", a);
  } else if (b > a && b > c) {
    printf("Największa liczba to: %.2lf\n", b);
  } else if (c > a && c > b) {
    printf("Największa liczba to: %.2lf\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%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    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e3 <main+0xc3>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e3 <main+0xc3>
movsd  -0x10(%rbp),%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1268 <main+0x148>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1223 <main+0x103>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1223 <main+0x103>
movsd  -0x18(%rbp),%xmm0
lea    0xe39(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1263 <main+0x143>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    125e <main+0x13e>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    125e <main+0x13e>
movsd  -0x20(%rbp),%xmm0
lea    0xdf9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1263 <main+0x143>
jmp    1268 <main+0x148>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12a0 <main+0x180>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    12a0 <main+0x180>
movsd  -0x10(%rbp),%xmm0
lea    0xdda(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1315 <main+0x1f5>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    12d8 <main+0x1b8>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    12d8 <main+0x1b8>
movsd  -0x18(%rbp),%xmm0
lea    0xda2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1310 <main+0x1f0>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    130b <main+0x1eb>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    130b <main+0x1eb>
movsd  -0x20(%rbp),%xmm0
lea    0xd6a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1310 <main+0x1f0>
jmp    1315 <main+0x1f5>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
ucomisd %xmm2,%xmm1
movsd  (%rsp),%xmm0
jbe    11ba <main+0x8a>
ucomisd %xmm2,%xmm0
jbe    11ba <main+0x8a>
movapd %xmm2,%xmm0
jmp    11d8 <main+0xa8>
ucomisd %xmm1,%xmm2
jbe    11cc <main+0x9c>
ucomisd %xmm1,%xmm0
jbe    11cc <main+0x9c>
movapd %xmm1,%xmm0
jmp    11d8 <main+0xa8>
ucomisd %xmm0,%xmm2
jbe    11e6 <main+0xb6>
ucomisd %xmm0,%xmm1
jbe    11e6 <main+0xb6>
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm2
movsd  (%rsp),%xmm0
jbe    1209 <main+0xd9>
ucomisd %xmm0,%xmm2
jbe    1209 <main+0xd9>
movapd %xmm2,%xmm0
jmp    1227 <main+0xf7>
ucomisd %xmm2,%xmm1
jbe    121b <main+0xeb>
ucomisd %xmm0,%xmm1
jbe    121b <main+0xeb>
movapd %xmm1,%xmm0
jmp    1227 <main+0xf7>
ucomisd %xmm2,%xmm0
jbe    1235 <main+0x105>
ucomisd %xmm1,%xmm0
jbe    1235 <main+0x105>
lea    0xe27(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.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 = [30 x i8] c"Najmniejsza liczba to: %.2lf\0A\00"
@.str.5 = [30 x i8] c"Najwi\C4\99ksza liczba to: %.2lf\0A\00"
@str = [24 x i8] c"Wprowad\C5\BA trzy liczby: \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 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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 olt double %21, %22
%24 = load double, double* %3
%25 = fcmp olt double %21, %24
%26 = select i1 %23, i1 %25, i1 false
br i1 %26, label %35, label %27
27: ; preds = %0
%28 = fcmp olt double %22, %21
%29 = fcmp olt double %22, %24
%30 = select i1 %28, i1 %29, i1 false
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = fcmp olt double %24, %21
%33 = fcmp olt double %24, %22
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %35, label %38
35: ; preds = %31, %27, %0
%36 = phi double [ %21, %0 ], [ %22, %27 ], [ %24, %31 ]
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), double %36)
br label %38
38: ; preds = %35, %31
%39 = load double, double* %1
%40 = load double, double* %2
%41 = fcmp ogt double %39, %40
%42 = load double, double* %3
%43 = fcmp ogt double %39, %42
%44 = select i1 %41, i1 %43, i1 false
br i1 %44, label %53, label %45
45: ; preds = %38
%46 = fcmp ogt double %40, %39
%47 = fcmp ogt double %40, %42
%48 = select i1 %46, i1 %47, i1 false
br i1 %48, label %53, label %49
49: ; preds = %45
%50 = fcmp ogt double %42, %39
%51 = fcmp ogt double %42, %40
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %53, label %56
53: ; preds = %49, %45, %38
%54 = phi double [ %39, %38 ], [ %40, %45 ], [ %42, %49 ]
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), double %54)
br label %56
56: ; preds = %53, %49
ret i32 0
}