#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 *, int *, int *, int *, int *);
int main() {
  int a, b, c, d, num_1, num_2, num_3, num_4;
  printf("Please enter 4 numbers separated by spaces > ");
  scanf("%d%d%d%d", &num_1, &num_2, &num_3, &num_4);
  a = (num_1);
  b = (num_2);
  c = (num_3);
  d = (num_4);
  if (a < b && a < c && a < d)
    printf("%d is the smallest\n", a);
  else if (b < a && b < c && b < d)
    printf("%d is the smalles\n", b);
  else if (c < a && c < b && c < d)
    printf("%d is the smallest\n", c);
  else if (d < a && d < b && d < c)
    printf("%d is the smallest\n", d);
  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    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ab <main+0x8b>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1263 <main+0x143>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e5 <main+0xc5>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e5 <main+0xc5>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e5 <main+0xc5>
mov    -0xc(%rbp),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125e <main+0x13e>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121f <main+0xff>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121f <main+0xff>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    121f <main+0xff>
mov    -0x10(%rbp),%esi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1259 <main+0x139>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1254 <main+0x134>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1254 <main+0x134>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1254 <main+0x134>
mov    -0x14(%rbp),%esi
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1259 <main+0x139>
jmp    125e <main+0x13e>
jmp    1263 <main+0x143>
xor    %eax,%eax
add    $0x30,%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>
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%esi
cmp    %ecx,%edx
jge    1179 <main+0x59>
cmp    %eax,%edx
jge    1179 <main+0x59>
cmp    %esi,%edx
jge    1179 <main+0x59>
lea    0xec2(%rip),%rdi
mov    %edx,%esi
jmp    11ba <main+0x9a>
cmp    %edx,%ecx
jge    1190 <main+0x70>
cmp    %eax,%ecx
jge    1190 <main+0x70>
cmp    %esi,%ecx
jge    1190 <main+0x70>
lea    0xebf(%rip),%rdi
mov    %ecx,%esi
jmp    11ba <main+0x9a>
cmp    %edx,%eax
jge    11a7 <main+0x87>
cmp    %ecx,%eax
jge    11a7 <main+0x87>
cmp    %esi,%eax
jge    11a7 <main+0x87>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
jmp    11ba <main+0x9a>
cmp    %edx,%esi
jge    11c1 <main+0xa1>
cmp    %ecx,%esi
jge    11c1 <main+0xa1>
cmp    %eax,%esi
jge    11c1 <main+0xa1>
lea    0xe7d(%rip),%rdi
xor    %eax,%eax
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 = [9 x i8] c"%d%d%d%d\00"
@.str.2 = [20 x i8] c"%d is the smallest\0A\00"
@.str.3 = [19 x i8] c"%d is the smalles\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8, i32* %9)
%12 = load i32, i32* %6
store i32 %12, i32* %2
%13 = load i32, i32* %7
store i32 %13, i32* %3
%14 = load i32, i32* %8
store i32 %14, i32* %4
%15 = load i32, i32* %9
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %0
%20 = load i32, i32* %2
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i32, i32* %2
%25 = load i32, i32* %5
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %28)
br label %78
30: ; preds = %23, %19, %0
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %45
38: ; preds = %34
%39 = load i32, i32* %3
%40 = load i32, i32* %5
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = load i32, i32* %3
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %43)
br label %77
45: ; preds = %38, %34, %30
%46 = load i32, i32* %4
%47 = load i32, i32* %2
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %60
49: ; preds = %45
%50 = load i32, i32* %4
%51 = load i32, i32* %3
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %60
53: ; preds = %49
%54 = load i32, i32* %4
%55 = load i32, i32* %5
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* %4
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %58)
br label %76
60: ; preds = %53, %49, %45
%61 = load i32, i32* %5
%62 = load i32, i32* %2
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %75
64: ; preds = %60
%65 = load i32, i32* %5
%66 = load i32, i32* %3
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %75
68: ; preds = %64
%69 = load i32, i32* %5
%70 = load i32, i32* %4
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %75
72: ; preds = %68
%73 = load i32, i32* %5
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %72, %68, %64, %60
br label %76
76: ; preds = %75, %57
br label %77
77: ; preds = %76, %42
br label %78
78: ; preds = %77, %27
ret i32 0
}

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