#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 main(void) {
  int x, y, z;
  printf("Enter three different integers:");
  scanf("%d %d %d", &x, &y, &z);
  if (x > y) {
    if (x > z) {
      printf("\nLargest is %d", x);
      if (y > z) {
        printf("\nSmallest is %d", z);
      } else {
        printf("\nSmallest is %d", y);
      }
    } else {
      printf("\nLargest is %d", z);
      if (x > y) {
        printf("\nSmallest is %d", y);
      } else {
        printf("\nSmallest is %d", x);
      }
    }
  } else if (y > x) {
    if (y > z) {
      printf("\nLargest is %d", y);
      if (x > z) {
        printf("\nSmallest is %d", z);
      } else {
        printf("\nSmallest is %d", x);
      }
    } else {
      printf("\nLargest is %d", z);
      printf("\nSmallest is %d", x);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1204 <main+0xe4>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11b6 <main+0x96>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11a0 <main+0x80>
mov    -0x10(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b1 <main+0x91>
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
mov    -0x10(%rbp),%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11e9 <main+0xc9>
mov    -0xc(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xda>
mov    -0x8(%rbp),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
jmp    1291 <main+0x171>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    128c <main+0x16c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1265 <main+0x145>
mov    -0xc(%rbp),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    124f <main+0x12f>
mov    -0x10(%rbp),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1260 <main+0x140>
mov    -0x8(%rbp),%esi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1287 <main+0x167>
mov    -0x10(%rbp),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128c <main+0x16c>
jmp    1291 <main+0x171>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%esi
cmp    %esi,%eax
jle    1177 <main+0x57>
mov    0xc(%rsp),%esi
lea    0xec5(%rip),%rdi
cmp    %esi,%eax
jle    1199 <main+0x79>
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
jmp    1193 <main+0x73>
jge    11bb <main+0x9b>
mov    0xc(%rsp),%eax
lea    0xea5(%rip),%rdi
cmp    %eax,%esi
jle    11c2 <main+0xa2>
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%eax
jmp    11a8 <main+0x88>
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
jmp    11ad <main+0x8d>

LLVM IR (-O0):
@.str = [32 x i8] c"Enter three different integers:\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [15 x i8] c"\0ALargest is %d\00"
@.str.3 = [16 x i8] c"\0ASmallest is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %41
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %26
23: ; preds = %14
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %20
br label %40
27: ; preds = %10
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %27
%34 = load i32, i32* %3
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %39
36: ; preds = %27
%37 = load i32, i32* %2
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %26
br label %69
41: ; preds = %0
%42 = load i32, i32* %3
%43 = load i32, i32* %2
%44 = icmp sgt i32 %42, %43
br i1 %44, label %45, label %68
45: ; preds = %41
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %62
49: ; preds = %45
%50 = load i32, i32* %3
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %2
%53 = load i32, i32* %4
%54 = icmp sgt i32 %52, %53
br i1 %54, label %55, label %58
55: ; preds = %49
%56 = load i32, i32* %4
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %56)
br label %61
58: ; preds = %49
%59 = load i32, i32* %2
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %58, %55
br label %67
62: ; preds = %45
%63 = load i32, i32* %4
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %63)
%65 = load i32, i32* %2
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %62, %61
br label %68
68: ; preds = %67, %41
br label %69
69: ; preds = %68, %40
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter three different integers:\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [15 x i8] c"\0ALargest is %d\00"
@.str.3 = [16 x i8] c"\0ASmallest is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp sgt i32 %9, %13
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp sgt i32 %17, %18
%20 = select i1 %19, i32 %18, i32 %17
br label %41
21: ; preds = %12
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = icmp sgt i32 %23, %24
%26 = select i1 %25, i32 %24, i32 %23
br label %41
27: ; preds = %0
%28 = icmp sgt i32 %10, %9
br i1 %28, label %29, label %44
29: ; preds = %27
%30 = load i32, i32* %3
%31 = icmp sgt i32 %10, %30
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%34 = load i32, i32* %1
%35 = load i32, i32* %3
%36 = icmp sgt i32 %34, %35
%37 = select i1 %36, i32 %35, i32 %34
br label %41
38: ; preds = %29
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%40 = load i32, i32* %1
br label %41
41: ; preds = %32, %21, %15, %38
%42 = phi i32 [ %40, %38 ], [ %20, %15 ], [ %26, %21 ], [ %37, %32 ]
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %41, %27
ret i32 0
}