#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 *, float *);
int main() {
  float a, b, c, min, max;
  printf("\n\t\t-------------		\n\t\tMAXIM I MINIM		"
         "\n\t\t-------------\n");
  printf("Introdueix tres nombres:\n1.>");
  scanf("%f", &a);
  printf("2.>");
  scanf("%f", &b);
  printf("3.>");
  scanf("%f", &c);
  max = a;
  min = b;
  if (max < min) {
    min = max;
    max = b;
  }
  if (max < c) {
    max = c;
  } else if (min > c) {
    min = c;
  }
  printf("Dels valors [%.2f,%.2f,%.2f]; %.2f es el maxim i %.2f es el minim.\n",
         a, b, c, max, min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11d2 <main+0xb2>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11f4 <main+0xd4>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1212 <main+0xf2>
movss  -0x14(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    120d <main+0xed>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1212 <main+0xf2>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x14(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
lea    0xe18(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <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   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movaps %xmm0,%xmm4
minss  %xmm1,%xmm4
movaps %xmm1,%xmm3
maxss  %xmm0,%xmm3
movss  0x4(%rsp),%xmm2
ucomiss %xmm3,%xmm2
jbe    11c3 <main+0x93>
movaps %xmm2,%xmm3
jmp    11cb <main+0x9b>
ucomiss %xmm2,%xmm4
jbe    11cb <main+0x9b>
movaps %xmm2,%xmm4
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm3,%xmm3
cvtss2sd %xmm4,%xmm4
lea    0xe42(%rip),%rdi
mov    $0x5,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"\0A\09\09-------------\09\09\0A\09\09MAXIM I MINIM\09\09\0A\09\09-------------\0A\00"
@.str.1 = [29 x i8] c"Introdueix tres nombres:\0A1.>\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [4 x i8] c"2.>\00"
@.str.4 = [4 x i8] c"3.>\00"
@.str.5 = [68 x i8] c"Dels valors [%.2f,%.2f,%.2f]; %.2f es el maxim i %.2f es el minim.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%14 = load float, float* %2
store float %14, float* %6
%15 = load float, float* %3
store float %15, float* %5
%16 = load float, float* %6
%17 = load float, float* %5
%18 = fcmp olt float %16, %17
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = load float, float* %6
store float %20, float* %5
%21 = load float, float* %3
store float %21, float* %6
br label %22
22: ; preds = %19, %0
%23 = load float, float* %6
%24 = load float, float* %4
%25 = fcmp olt float %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load float, float* %4
store float %27, float* %6
br label %35
28: ; preds = %22
%29 = load float, float* %5
%30 = load float, float* %4
%31 = fcmp ogt float %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load float, float* %4
store float %33, float* %5
br label %34
34: ; preds = %32, %28
br label %35
35: ; preds = %34, %26
%36 = load float, float* %2
%37 = fpext float %36 to double
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = load float, float* %4
%41 = fpext float %40 to double
%42 = load float, float* %6
%43 = fpext float %42 to double
%44 = load float, float* %5
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0), double %37, double %39, double %41, double %43, double %45)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"Introdueix tres nombres:\0A1.>\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [4 x i8] c"2.>\00"
@.str.4 = [4 x i8] c"3.>\00"
@.str.5 = [68 x i8] c"Dels valors [%.2f,%.2f,%.2f]; %.2f es el maxim i %.2f es el minim.\0A\00"
@str = [53 x i8] c"\0A\09\09-------------\09\09\0A\09\09MAXIM I MINIM\09\09\0A\09\09-------------\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%14 = load float, float* %1
%15 = load float, float* %2
%16 = fcmp olt float %14, %15
%17 = select i1 %16, float %14, float %15
%18 = select i1 %16, float %15, float %14
%19 = load float, float* %3
%20 = fcmp olt float %18, %19
br i1 %20, label %24, label %21
21: ; preds = %0
%22 = fcmp ogt float %17, %19
br i1 %22, label %23, label %24
23: ; preds = %21
br label %24
24: ; preds = %0, %21, %23
%25 = phi float [ %19, %23 ], [ %17, %21 ], [ %17, %0 ]
%26 = phi float [ %18, %23 ], [ %18, %21 ], [ %19, %0 ]
%27 = fpext float %14 to double
%28 = fpext float %15 to double
%29 = fpext float %19 to double
%30 = fpext float %26 to double
%31 = fpext float %25 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.5, i64 0, i64 0), double %27, double %28, double %29, double %30, double %31)
ret i32 0
}