#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 n1, n2, n3, n4, large;
  printf("Please enter 4 numbers seperated by spaces > ");
  scanf("%d%d%d%d", &n1, &n2, &n3, &n4);
  if (n1 < n2 && n1 < n3 && n1 < n4)
    printf("%d is the smallest ", n1);
  else
    large = n1;
  if ((large = n1) && n2 < n3 && n2 < n4)
    printf("%d is the smallest", n2);
  else
    large = n2;
  if ((large = n2) && n3 < n4)
    printf("%d is the smallest", n3);
  else
    printf("%d is the smallest", n4);
  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
jge    1193 <main+0x73>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1193 <main+0x73>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1193 <main+0x73>
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <main+0x79>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     11d6 <main+0xb6>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d6 <main+0xb6>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11d6 <main+0xb6>
mov    -0xc(%rbp),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     120d <main+0xed>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    120d <main+0xed>
mov    -0x10(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121e <main+0xfe>
mov    -0x14(%rbp),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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),%esi
cmp    0x10(%rsp),%esi
jge    117a <main+0x5a>
cmp    0xc(%rsp),%esi
jge    117a <main+0x5a>
cmp    0x8(%rsp),%esi
jge    117a <main+0x5a>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
test   %esi,%esi
je     119c <main+0x7c>
mov    0x10(%rsp),%esi
cmp    0xc(%rsp),%esi
jge    119c <main+0x7c>
cmp    0x8(%rsp),%esi
jge    119c <main+0x7c>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x10(%rsp)
je     11b1 <main+0x91>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%eax
cmp    %eax,%esi
jge    11b5 <main+0x95>
jmp    11b7 <main+0x97>
mov    0x8(%rsp),%eax
mov    %eax,%esi
lea    0xe8d(%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 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 \00"
@.str.3 = [19 x i8] c"%d is the smallest\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%8 = 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)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %0
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %2
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %25
23: ; preds = %16, %12, %0
%24 = load i32, i32* %2
store i32 %24, i32* %6
br label %25
25: ; preds = %23, %20
%26 = load i32, i32* %2
store i32 %26, i32* %6
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = load i32, i32* %3
%34 = load i32, i32* %5
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load i32, i32* %3
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %41
39: ; preds = %32, %28, %25
%40 = load i32, i32* %3
store i32 %40, i32* %6
br label %41
41: ; preds = %39, %36
%42 = load i32, i32* %3
store i32 %42, i32* %6
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %51
44: ; preds = %41
%45 = load i32, i32* %4
%46 = load i32, i32* %5
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = load i32, i32* %4
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %49)
br label %54
51: ; preds = %44, %41
%52 = load i32, i32* %5
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %48
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 \00"
@.str.3 = [19 x i8] c"%d is the smallest\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 slt i32 %11, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %11, %14
%16 = select i1 %13, i1 %15, i1 false
%17 = load i32, i32* %4
%18 = icmp slt i32 %11, %17
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %20, label %23
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)
%22 = load i32, i32* %1
br label %23
23: ; preds = %0, %20
%24 = phi i32 [ %11, %0 ], [ %22, %20 ]
%25 = icmp eq i32 %24, 0
br i1 %25, label %35, label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp slt i32 %27, %28
%30 = load i32, i32* %4
%31 = icmp slt i32 %27, %30
%32 = select i1 %29, i1 %31, i1 false
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %27)
br label %35
35: ; preds = %23, %26, %33
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = load i32, i32* %4
br label %44
40: ; preds = %35
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = icmp slt i32 %41, %42
br i1 %43, label %46, label %44
44: ; preds = %38, %40
%45 = phi i32 [ %39, %38 ], [ %42, %40 ]
br label %46
46: ; preds = %40, %44
%47 = phi i32 [ %45, %44 ], [ %41, %40 ]
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %47)
ret i32 0
}