#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(void) {
  int a, b, c, d;
  printf("Please enter 4 numbers seperated by spaces > ");
  scanf("%d%d%d%d", &a, &b, &c, &d);
  if (a > b)
    if (b > c)
      if (c > d)
        printf("%d is the smallest\n", d);
      else
        printf("%d is the smallest\n", c);
    else if (b > d)
      printf("%d is the smallest\n", d);
    else
      printf("%d is the smallesst\n", b);
  else if (a > c)
    if (c > d)
      printf("%d is the smallest\n", d);
    else
      printf("%d is the smallest\n", c);
  else if (a > d)
    printf("%d is the smallest\n", d);
  else
    printf("%d is the smallest\n", a);
  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>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11e6 <main+0xc6>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11a9 <main+0x89>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1193 <main+0x73>
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a4 <main+0x84>
mov    -0x10(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11cb <main+0xab>
mov    -0x14(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
mov    -0xc(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
jmp    1267 <main+0x147>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    122a <main+0x10a>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1214 <main+0xf4>
mov    -0x14(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1225 <main+0x105>
mov    -0x10(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1262 <main+0x142>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    124c <main+0x12c>
mov    -0x14(%rbp),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125d <main+0x13d>
mov    -0x8(%rbp),%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1262 <main+0x142>
jmp    1267 <main+0x147>
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>
mov    0x14(%rsp),%ecx
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%esi
cmp    %edx,%ecx
jle    1179 <main+0x59>
mov    0x8(%rsp),%eax
cmp    %esi,%edx
jg     1181 <main+0x61>
cmp    %eax,%edx
jg     1192 <main+0x72>
lea    0xed6(%rip),%rdi
mov    %edx,%esi
jmp    11a6 <main+0x86>
mov    0x8(%rsp),%eax
cmp    %esi,%ecx
jle    118e <main+0x6e>
cmp    %eax,%esi
jg     1192 <main+0x72>
lea    0xeab(%rip),%rdi
jmp    11a6 <main+0x86>
cmp    %eax,%ecx
jle    119d <main+0x7d>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
jmp    11a6 <main+0x86>
lea    0xe93(%rip),%rdi
mov    %ecx,%esi
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 seperated 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 = [21 x i8] c"%d is the smallesst\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
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 ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %38
11: ; preds = %0
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %25
22: ; preds = %15
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %22, %19
br label %37
26: ; preds = %11
%27 = load i32, i32* %3
%28 = load i32, i32* %5
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %5
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %36
33: ; preds = %26
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36, %25
br label %65
38: ; preds = %0
%39 = load i32, i32* %2
%40 = load i32, i32* %4
%41 = icmp sgt i32 %39, %40
br i1 %41, label %42, label %53
42: ; preds = %38
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = icmp sgt i32 %43, %44
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %5
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %47)
br label %52
49: ; preds = %42
%50 = load i32, i32* %4
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %49, %46
br label %64
53: ; preds = %38
%54 = load i32, i32* %2
%55 = load i32, i32* %5
%56 = icmp sgt i32 %54, %55
br i1 %56, label %57, label %60
57: ; preds = %53
%58 = load i32, i32* %5
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %58)
br label %63
60: ; preds = %53
%61 = load i32, i32* %2
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %60, %57
br label %64
64: ; preds = %63, %52
br label %65
65: ; preds = %64, %37
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"Please enter 4 numbers seperated 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 = [21 x i8] c"%d is the smallesst\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 = icmp sgt i32 %11, %12
%14 = load i32, i32* %3
br i1 %13, label %15, label %30
15: ; preds = %0
%16 = icmp sgt i32 %12, %14
%17 = load i32, i32* %4
br i1 %16, label %18, label %24
18: ; preds = %15
%19 = icmp sgt i32 %14, %17
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %45
22: ; preds = %18
%23 = 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 %45
24: ; preds = %15
%25 = icmp sgt i32 %12, %17
br i1 %25, label %26, label %28
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %45
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %45
30: ; preds = %0
%31 = icmp sgt i32 %11, %14
%32 = load i32, i32* %4
br i1 %31, label %33, label %39
33: ; preds = %30
%34 = icmp sgt i32 %14, %32
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %45
37: ; preds = %33
%38 = 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 %45
39: ; preds = %30
%40 = icmp sgt i32 %11, %32
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %45
43: ; preds = %39
%44 = 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 %45
45: ; preds = %37, %35, %43, %41, %22, %20, %28, %26
ret i32 0
}