#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 n1, n2, n3, min, max, suma, iloczyn;
  printf("Wprowadz trzy liczby: ");
  scanf("%lf%lf%lf", &n1, &n2, &n3);
  min = n1;
  max = n1;
  if (n2 < n1) {
    min = n2;
  } else {
    max = n2;
  }
  if (n3 < min) {
    min = n3;
  }
  if (n3 > max) {
    max = n3;
  }
  suma = n1 + n2 + n3;
  iloczyn = n1 * n2 * n3;
  printf("Suma wynosi: %.4f\n", suma);
  printf("Iloczyn wynosi: %.4f\n", iloczyn);
  printf("Najmniejsza liczba to: %.4f\n", min);
  printf("Największa liczba to: %.4f\n", max);
}


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    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118c <main+0x6c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1196 <main+0x76>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b4 <main+0x94>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11ce <main+0xae>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xe1f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xe1f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xe22(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe2c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x30(%rsp),%rsi
lea    0x28(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x30(%rsp),%xmm5
movsd  0x28(%rsp),%xmm1
movapd %xmm5,%xmm2
maxsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
minsd  %xmm5,%xmm3
movsd  0x20(%rsp),%xmm4
movapd %xmm5,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm5
movapd %xmm4,%xmm1
addsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm5
movsd  %xmm5,0x8(%rsp)
minsd  %xmm3,%xmm4
movsd  %xmm4,0x10(%rsp)
maxsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rsp)
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Wprowadz trzy liczby: \00"
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [19 x i8] c"Suma wynosi: %.4f\0A\00"
@.str.3 = [22 x i8] c"Iloczyn wynosi: %.4f\0A\00"
@.str.4 = [29 x i8] c"Najmniejsza liczba to: %.4f\0A\00"
@.str.5 = [29 x i8] c"Najwi\C4\99ksza liczba to: %.4f\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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%11 = load double, double* %2
store double %11, double* %5
%12 = load double, double* %2
store double %12, double* %6
%13 = load double, double* %3
%14 = load double, double* %2
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = load double, double* %3
store double %17, double* %5
br label %20
18: ; preds = %0
%19 = load double, double* %3
store double %19, double* %6
br label %20
20: ; preds = %18, %16
%21 = load double, double* %4
%22 = load double, double* %5
%23 = fcmp olt double %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load double, double* %4
store double %25, double* %5
br label %26
26: ; preds = %24, %20
%27 = load double, double* %4
%28 = load double, double* %6
%29 = fcmp ogt double %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load double, double* %4
store double %31, double* %6
br label %32
32: ; preds = %30, %26
%33 = load double, double* %2
%34 = load double, double* %3
%35 = fadd double %33, %34
%36 = load double, double* %4
%37 = fadd double %35, %36
store double %37, double* %7
%38 = load double, double* %2
%39 = load double, double* %3
%40 = fmul double %38, %39
%41 = load double, double* %4
%42 = fmul double %40, %41
store double %42, double* %8
%43 = load double, double* %7
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %43)
%45 = load double, double* %8
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %45)
%47 = load double, double* %5
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %47)
%49 = load double, double* %6
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %49)
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str = [23 x i8] c"Wprowadz trzy liczby: \00"
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [19 x i8] c"Suma wynosi: %.4f\0A\00"
@.str.3 = [22 x i8] c"Iloczyn wynosi: %.4f\0A\00"
@.str.4 = [29 x i8] c"Najmniejsza liczba to: %.4f\0A\00"
@.str.5 = [29 x i8] c"Najwi\C4\99ksza liczba to: %.4f\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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 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 = fcmp olt double %10, %9
%12 = select i1 %11, double %9, double %10
%13 = select i1 %11, double %10, double %9
%14 = load double, double* %3
%15 = fcmp olt double %14, %13
%16 = select i1 %15, double %14, double %13
%17 = fcmp ogt double %14, %12
%18 = select i1 %17, double %14, double %12
%19 = fadd double %9, %10
%20 = fadd double %19, %14
%21 = fmul double %9, %10
%22 = fmul double %21, %14
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %20)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), double %22)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %16)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %18)
ret i32 0
}