#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 separated 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 smallest\n", b);
  else if (a > c)
    if (d > c)
      printf("%d is the smallest\n", c);
    else
      printf("%d is the smallest\n", d);
  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    0xe62(%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    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1214 <main+0xf4>
mov    -0x10(%rbp),%esi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1225 <main+0x105>
mov    -0x14(%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),%eax
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%esi
cmp    %ecx,%eax
jle    1171 <main+0x51>
mov    0x8(%rsp),%eax
cmp    %esi,%ecx
jle    1180 <main+0x60>
cmp    %eax,%esi
cmovg  %eax,%esi
jmp    1190 <main+0x70>
mov    0x8(%rsp),%ecx
cmp    %esi,%eax
jle    1189 <main+0x69>
cmp    %esi,%ecx
cmovle %ecx,%esi
jmp    1190 <main+0x70>
cmp    %eax,%ecx
cmovg  %eax,%ecx
mov    %ecx,%esi
jmp    1190 <main+0x70>
cmp    %ecx,%eax
cmovg  %ecx,%eax
mov    %eax,%esi
lea    0xea0(%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"
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 ([20 x i8], [20 x i8]* @.str.2, 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* %5
%44 = load i32, i32* %4
%45 = icmp sgt i32 %43, %44
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %4
%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* %5
%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 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"
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 %24
15: ; preds = %0
%16 = icmp sgt i32 %12, %14
%17 = load i32, i32* %4
br i1 %16, label %18, label %21
18: ; preds = %15
%19 = icmp sgt i32 %14, %17
%20 = select i1 %19, i32 %17, i32 %14
br label %33
21: ; preds = %15
%22 = icmp sgt i32 %12, %17
%23 = select i1 %22, i32 %17, i32 %12
br label %33
24: ; preds = %0
%25 = icmp sgt i32 %11, %14
%26 = load i32, i32* %4
br i1 %25, label %27, label %30
27: ; preds = %24
%28 = icmp sgt i32 %26, %14
%29 = select i1 %28, i32 %14, i32 %26
br label %33
30: ; preds = %24
%31 = icmp sgt i32 %11, %26
%32 = select i1 %31, i32 %26, i32 %11
br label %33
33: ; preds = %30, %27, %21, %18
%34 = phi i32 [ %20, %18 ], [ %23, %21 ], [ %29, %27 ], [ %32, %30 ]
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %34)
ret i32 0
}