#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 *, float *, float *, float *);
int main(void) {
  float a, b, c, d;
  printf("Please enter 4 numbers separated by spaces > ");
  scanf("%f %f %f %f", &a, &b, &c, &d);
  if ((a < b) && (a < c) && (a < d))
    printf("%.0f is the smallest\n", a);
  else if ((b < a) && (b < c) && (b < d))
    printf("%.0f is the smallest\n", b);
  else if ((c < a) && (c < b) && (c < d))
    printf("%.0f is the smallest\n", c);
  else
    printf("%.0f is the smallest\n", d);
  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    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ae <main+0x8e>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ae <main+0x8e>
movss  -0x8(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ae <main+0x8e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1279 <main+0x159>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1203 <main+0xe3>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1203 <main+0xe3>
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1203 <main+0xe3>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1274 <main+0x154>
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1258 <main+0x138>
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1258 <main+0x138>
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1258 <main+0x138>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdee(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    126f <main+0x14f>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1274 <main+0x154>
jmp    1279 <main+0x159>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm3
ucomiss %xmm0,%xmm3
movss  0xc(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
jbe    1179 <main+0x59>
ucomiss %xmm0,%xmm1
jbe    1179 <main+0x59>
ucomiss %xmm0,%xmm2
ja     11b6 <main+0x96>
ucomiss %xmm3,%xmm0
jbe    118d <main+0x6d>
ucomiss %xmm3,%xmm1
jbe    118d <main+0x6d>
ucomiss %xmm3,%xmm2
jbe    118d <main+0x6d>
movaps %xmm3,%xmm0
jmp    11b6 <main+0x96>
movaps %xmm1,%xmm4
minss  %xmm2,%xmm4
movaps %xmm1,%xmm5
cmpltss %xmm3,%xmm5
andps  %xmm5,%xmm4
andnps %xmm2,%xmm5
orps   %xmm4,%xmm5
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm5
andnps %xmm2,%xmm1
orps   %xmm5,%xmm1
movaps %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe79(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Please enter 4 numbers separated by spaces > \00"
@.str.1 = [12 x i8] c"%f %f %f %f\00"
@.str.2 = [22 x i8] c"%.0f is the smallest\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 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), float* %2, float* %3, float* %4, float* %5)
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %23
11: ; preds = %0
%12 = load float, float* %2
%13 = load float, float* %4
%14 = fcmp olt float %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load float, float* %2
%17 = load float, float* %5
%18 = fcmp olt float %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %21)
br label %61
23: ; preds = %15, %11, %0
%24 = load float, float* %3
%25 = load float, float* %2
%26 = fcmp olt float %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load float, float* %3
%29 = load float, float* %4
%30 = fcmp olt float %28, %29
br i1 %30, label %31, label %39
31: ; preds = %27
%32 = load float, float* %3
%33 = load float, float* %5
%34 = fcmp olt float %32, %33
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %37)
br label %60
39: ; preds = %31, %27, %23
%40 = load float, float* %4
%41 = load float, float* %2
%42 = fcmp olt float %40, %41
br i1 %42, label %43, label %55
43: ; preds = %39
%44 = load float, float* %4
%45 = load float, float* %3
%46 = fcmp olt float %44, %45
br i1 %46, label %47, label %55
47: ; preds = %43
%48 = load float, float* %4
%49 = load float, float* %5
%50 = fcmp olt float %48, %49
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load float, float* %4
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %53)
br label %59
55: ; preds = %47, %43, %39
%56 = load float, float* %5
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %57)
br label %59
59: ; preds = %55, %51
br label %60
60: ; preds = %59, %35
br label %61
61: ; preds = %60, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Please enter 4 numbers separated by spaces > \00"
@.str.1 = [12 x i8] c"%f %f %f %f\00"
@.str.2 = [22 x i8] c"%.0f is the smallest\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 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), float* %1, float* %2, float* %3, float* %4)
%11 = load float, float* %1
%12 = load float, float* %2
%13 = fcmp olt float %11, %12
%14 = load float, float* %3
%15 = fcmp olt float %11, %14
%16 = select i1 %13, i1 %15, i1 false
%17 = load float, float* %4
%18 = fcmp olt float %11, %17
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %33, label %20
20: ; preds = %0
%21 = fcmp olt float %12, %11
%22 = fcmp olt float %12, %14
%23 = select i1 %21, i1 %22, i1 false
%24 = fcmp olt float %12, %17
%25 = select i1 %23, i1 %24, i1 false
br i1 %25, label %33, label %26
26: ; preds = %20
%27 = fcmp olt float %14, %11
%28 = fcmp olt float %14, %12
%29 = select i1 %27, i1 %28, i1 false
%30 = fcmp olt float %14, %17
%31 = select i1 %29, i1 %30, i1 false
%32 = select i1 %31, float %14, float %17
br label %33
33: ; preds = %26, %20, %0
%34 = phi float [ %11, %0 ], [ %12, %20 ], [ %32, %26 ]
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %35)
ret i32 0
}