#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);
    return 1;
  } else if (b <= a && b <= c && b <= d) {
    printf("%d is the smalles\n", b);
    return c;
  } else if (c <= a && c <= b && c <= d) {
    printf("%d is the smallest\n", c);
    return 3;
  } else if (d <= a && d <= b && d <= c) {
    printf("%d is the smallest\n", d);
    return 43;
  }
  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
jg     11b2 <main+0x92>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11b2 <main+0x92>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11b2 <main+0x92>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    128a <main+0x16a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11f2 <main+0xd2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f2 <main+0xd2>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11f2 <main+0xd2>
mov    -0xc(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    128a <main+0x16a>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1233 <main+0x113>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1233 <main+0x113>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1233 <main+0x113>
mov    -0x10(%rbp),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x4(%rbp)
jmp    128a <main+0x16a>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1274 <main+0x154>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1274 <main+0x154>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1274 <main+0x154>
mov    -0x14(%rbp),%esi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2b,-0x4(%rbp)
jmp    128a <main+0x16a>
jmp    1279 <main+0x159>
jmp    127e <main+0x15e>
jmp    1283 <main+0x163>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ebx
mov    (%rsp),%esi
cmp    %edx,%ecx
jg     1183 <main+0x63>
cmp    %ebx,%ecx
jg     1183 <main+0x63>
cmp    %esi,%ecx
jg     1183 <main+0x63>
lea    0xec4(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
jmp    11e7 <main+0xc7>
cmp    %ecx,%edx
jg     11a3 <main+0x83>
cmp    %ebx,%edx
jg     11a3 <main+0x83>
cmp    %esi,%edx
jg     11a3 <main+0x83>
lea    0xeb5(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
jmp    11e7 <main+0xc7>
cmp    %ecx,%ebx
jg     11c6 <main+0xa6>
cmp    %edx,%ebx
jg     11c6 <main+0xa6>
cmp    %esi,%ebx
jg     11c6 <main+0xa6>
lea    0xe81(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%eax
jmp    11e7 <main+0xc7>
xor    %eax,%eax
cmp    %ecx,%esi
jg     11e7 <main+0xc7>
cmp    %edx,%esi
jg     11e7 <main+0xc7>
cmp    %ebx,%esi
jg     11e7 <main+0xc7>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2b,%eax
add    $0x10,%rsp
pop    %rbx
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 sle 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 sle 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 sle 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)
store i32 1, i32* %1
br label %80
30: ; preds = %23, %19, %0
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp sle i32 %31, %32
br i1 %33, label %34, label %46
34: ; preds = %30
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %46
38: ; preds = %34
%39 = load i32, i32* %3
%40 = load i32, i32* %5
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %46
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)
%45 = load i32, i32* %4
store i32 %45, i32* %1
br label %80
46: ; preds = %38, %34, %30
%47 = load i32, i32* %4
%48 = load i32, i32* %2
%49 = icmp sle i32 %47, %48
br i1 %49, label %50, label %61
50: ; preds = %46
%51 = load i32, i32* %4
%52 = load i32, i32* %3
%53 = icmp sle i32 %51, %52
br i1 %53, label %54, label %61
54: ; preds = %50
%55 = load i32, i32* %4
%56 = load i32, i32* %5
%57 = icmp sle i32 %55, %56
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = load i32, i32* %4
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %59)
store i32 3, i32* %1
br label %80
61: ; preds = %54, %50, %46
%62 = load i32, i32* %5
%63 = load i32, i32* %2
%64 = icmp sle i32 %62, %63
br i1 %64, label %65, label %76
65: ; preds = %61
%66 = load i32, i32* %5
%67 = load i32, i32* %3
%68 = icmp sle i32 %66, %67
br i1 %68, label %69, label %76
69: ; preds = %65
%70 = load i32, i32* %5
%71 = load i32, i32* %4
%72 = icmp sle i32 %70, %71
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i32, i32* %5
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %74)
store i32 43, i32* %1
br label %80
76: ; preds = %69, %65, %61
br label %77
77: ; preds = %76
br label %78
78: ; preds = %77
br label %79
79: ; preds = %78
store i32 0, i32* %1
br label %80
80: ; preds = %79, %73, %58, %42, %27
%81 = load i32, i32* %1
ret i32 %81
}

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 sgt i32 %11, %12
%16 = icmp sgt i32 %11, %13
%17 = select i1 %15, i1 true, i1 %16
%18 = icmp sgt i32 %11, %14
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %22, label %20
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 sgt i32 %12, %11
%24 = icmp sgt i32 %12, %13
%25 = select i1 %23, i1 true, i1 %24
%26 = icmp sgt i32 %12, %14
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %30, label %28
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 sgt i32 %13, %11
%32 = icmp sgt i32 %13, %12
%33 = select i1 %31, i1 true, i1 %32
%34 = icmp sgt i32 %13, %14
%35 = select i1 %33, i1 true, i1 %34
br i1 %35, label %38, label %36
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 sgt i32 %14, %11
%40 = icmp sgt i32 %14, %12
%41 = select i1 %39, i1 true, i1 %40
%42 = icmp sgt i32 %14, %13
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %46, label %44
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 = %38, %44, %36, %28, %20
%47 = phi i32 [ 1, %20 ], [ %13, %28 ], [ 3, %36 ], [ 43, %44 ], [ 0, %38 ]
ret i32 %47
}