#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 *, double *);
int main() {
  double num1, num2, num3, num4;
  printf("Please enter 4 numbers separated by spaces > ");
  scanf("%lf%lf%lf%lf", &num1, &num2, &num3, &num4);
  if (num1 < num2 && num1 < num3 && num1 < num4)
    printf("%.0lf is the smallest\n", num1);
  if (num2 < num1 && num2 < num3 && num2 < num4)
    printf("%.0lf is the smallest\n", num2);
  if (num3 < num1 && num3 < num2 && num3 < num4)
    printf("%.0lf is the smallest\n", num3);
  if (num4 < num1 && num4 < num2 && num4 < num3)
    printf("%.0lf is the smallest\n", num4);
  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    0xeea(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a8 <main+0x88>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a8 <main+0x88>
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a8 <main+0x88>
movsd  -0x10(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f7 <main+0xd7>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f7 <main+0xd7>
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f7 <main+0xd7>
movsd  -0x18(%rbp),%xmm0
lea    0xe4b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1246 <main+0x126>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1246 <main+0x126>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1246 <main+0x126>
movsd  -0x20(%rbp),%xmm0
lea    0xdfc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1295 <main+0x175>
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1295 <main+0x175>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1295 <main+0x175>
movsd  -0x28(%rbp),%xmm0
lea    0xdad(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
ucomisd %xmm3,%xmm2
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
jbe    11a6 <main+0x86>
ucomisd %xmm3,%xmm1
jbe    11a6 <main+0x86>
ucomisd %xmm3,%xmm0
jbe    11a6 <main+0x86>
lea    0xeb8(%rip),%rdi
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
ucomisd %xmm2,%xmm3
jbe    11e2 <main+0xc2>
ucomisd %xmm2,%xmm1
jbe    11e2 <main+0xc2>
ucomisd %xmm2,%xmm0
jbe    11e2 <main+0xc2>
lea    0xe7c(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x20(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm3
jbe    121e <main+0xfe>
ucomisd %xmm1,%xmm2
jbe    121e <main+0xfe>
ucomisd %xmm1,%xmm0
jbe    121e <main+0xfe>
lea    0xe40(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm3
jbe    123e <main+0x11e>
ucomisd %xmm0,%xmm2
jbe    123e <main+0x11e>
ucomisd %xmm0,%xmm1
jbe    123e <main+0x11e>
lea    0xe04(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

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