#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 getInteger();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int x, y, z, smallest;
  printf("Enter the value of x > ");
  x = getInteger();
  printf("Enter the value of y > ");
  y = getInteger();
  printf("Enter the value of z > ");
  z = getInteger();
  smallest = ((x < y) ? (((x < z) ? x : z)) : (((y < z) ? y : z)));
  printf("Smallest = %d\n", smallest);
  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   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getInteger@plt>
mov    %eax,-0x8(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getInteger@plt>
mov    %eax,-0xc(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getInteger@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ab <main+0x8b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119a <main+0x7a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11a0 <main+0x80>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11ce <main+0xae>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c2 <main+0xa2>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11c8 <main+0xa8>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getInteger@plt>
mov    %eax,%ebx
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getInteger@plt>
mov    %eax,%ebp
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getInteger@plt>
cmp    %eax,%ebx
cmovge %eax,%ebx
cmp    %ebp,%ebx
cmovge %ebp,%ebx
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter the value of x > \00"
@.str.1 = [24 x i8] c"Enter the value of y > \00"
@.str.2 = [24 x i8] c"Enter the value of z > \00"
@.str.3 = [15 x i8] c"Smallest = %d\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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @getInteger()
store i32 %7, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @getInteger()
store i32 %9, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @getInteger()
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %0
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* %2
br label %23
21: ; preds = %15
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
br label %35
25: ; preds = %0
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i32, i32* %3
br label %33
31: ; preds = %25
%32 = load i32, i32* %4
br label %33
33: ; preds = %31, %29
%34 = phi i32 [ %30, %29 ], [ %32, %31 ]
br label %35
35: ; preds = %33, %23
%36 = phi i32 [ %24, %23 ], [ %34, %33 ]
store i32 %36, i32* %5
%37 = load i32, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter the value of x > \00"
@.str.1 = [24 x i8] c"Enter the value of y > \00"
@.str.2 = [24 x i8] c"Enter the value of z > \00"
@.str.3 = [15 x i8] c"Smallest = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getInteger()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @getInteger()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @getInteger()
%7 = icmp slt i32 %2, %6
%8 = select i1 %7, i32 %2, i32 %6
%9 = icmp slt i32 %8, %4
%10 = select i1 %9, i32 %8, i32 %4
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %10)
ret i32 0
}