#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);
  printf("Sum is %d", x + y + z);
  printf("\nAverage is %f", (double)(x + y + z) / 3);
  printf("\nProduct is %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    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    125b <main+0x13b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    120d <main+0xed>
mov    -0x8(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11f7 <main+0xd7>
mov    -0x10(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
mov    -0xc(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <main+0x136>
mov    -0x10(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1240 <main+0x120>
mov    -0xc(%rbp),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1251 <main+0x131>
mov    -0x8(%rbp),%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1256 <main+0x136>
jmp    12e8 <main+0x1c8>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    12e3 <main+0x1c3>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    12bc <main+0x19c>
mov    -0xc(%rbp),%esi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    12a6 <main+0x186>
mov    -0x10(%rbp),%esi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b7 <main+0x197>
mov    -0x8(%rbp),%esi
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12de <main+0x1be>
mov    -0x10(%rbp),%esi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e3 <main+0x1c3>
jmp    12e8 <main+0x1c8>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
add    0x10(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%eax
add    0x10(%rsp),%eax
add    0xc(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xe81(%rip),%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
imul   0x10(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%esi
cmp    %esi,%eax
jle    11d3 <main+0xb3>
mov    0xc(%rsp),%esi
lea    0xe99(%rip),%rdi
cmp    %esi,%eax
jle    11f5 <main+0xd5>
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
jmp    11ef <main+0xcf>
jge    1217 <main+0xf7>
mov    0xc(%rsp),%eax
lea    0xe79(%rip),%rdi
cmp    %eax,%esi
jle    121e <main+0xfe>
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%eax
jmp    1204 <main+0xe4>
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%eax
cmp    %eax,%esi
cmovg  %eax,%esi
lea    0xe58(%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    1209 <main+0xe9>

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 = [10 x i8] c"Sum is %d\00"
@.str.3 = [15 x i8] c"\0AAverage is %f\00"
@.str.4 = [15 x i8] c"\0AProduct is %d\00"
@.str.5 = [15 x i8] c"\0ALargest is %d\00"
@.str.6 = [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 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 3.000000e+00
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %19)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = mul nsw i32 %23, %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %61
30: ; preds = %0
%31 = load i32, i32* %2
%32 = load i32, i32* %4
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %3
%38 = load i32, i32* %4
%39 = icmp sgt i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = load i32, i32* %4
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %41)
br label %46
43: ; preds = %34
%44 = load i32, i32* %3
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %43, %40
br label %60
47: ; preds = %30
%48 = load i32, i32* %4
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %2
%51 = load i32, i32* %3
%52 = icmp sgt i32 %50, %51
br i1 %52, label %53, label %56
53: ; preds = %47
%54 = load i32, i32* %3
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %54)
br label %59
56: ; preds = %47
%57 = load i32, i32* %2
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %56, %53
br label %60
60: ; preds = %59, %46
br label %89
61: ; preds = %0
%62 = load i32, i32* %3
%63 = load i32, i32* %2
%64 = icmp sgt i32 %62, %63
br i1 %64, label %65, label %88
65: ; preds = %61
%66 = load i32, i32* %3
%67 = load i32, i32* %4
%68 = icmp sgt i32 %66, %67
br i1 %68, label %69, label %82
69: ; preds = %65
%70 = load i32, i32* %3
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %2
%73 = load i32, i32* %4
%74 = icmp sgt i32 %72, %73
br i1 %74, label %75, label %78
75: ; preds = %69
%76 = load i32, i32* %4
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %76)
br label %81
78: ; preds = %69
%79 = load i32, i32* %2
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %78, %75
br label %87
82: ; preds = %65
%83 = load i32, i32* %4
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %2
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %82, %81
br label %88
88: ; preds = %87, %61
br label %89
89: ; preds = %88, %60
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 = [10 x i8] c"Sum is %d\00"
@.str.3 = [15 x i8] c"\0AAverage is %f\00"
@.str.4 = [15 x i8] c"\0AProduct is %d\00"
@.str.5 = [15 x i8] c"\0ALargest is %d\00"
@.str.6 = [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 = add nsw i32 %10, %9
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = add nsw i32 %16, %15
%18 = load i32, i32* %3
%19 = add nsw i32 %17, %18
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, 3.000000e+00
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = mul nsw i32 %24, %23
%26 = load i32, i32* %3
%27 = mul nsw i32 %25, %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %1
%30 = load i32, i32* %2
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %47
32: ; preds = %0
%33 = load i32, i32* %3
%34 = icmp sgt i32 %29, %33
br i1 %34, label %35, label %41
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = icmp sgt i32 %37, %38
%40 = select i1 %39, i32 %38, i32 %37
br label %61
41: ; preds = %32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %33)
%43 = load i32, i32* %1
%44 = load i32, i32* %2
%45 = icmp sgt i32 %43, %44
%46 = select i1 %45, i32 %44, i32 %43
br label %61
47: ; preds = %0
%48 = icmp sgt i32 %30, %29
br i1 %48, label %49, label %64
49: ; preds = %47
%50 = load i32, i32* %3
%51 = icmp sgt i32 %30, %50
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%54 = load i32, i32* %1
%55 = load i32, i32* %3
%56 = icmp sgt i32 %54, %55
%57 = select i1 %56, i32 %55, i32 %54
br label %61
58: ; preds = %49
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %50)
%60 = load i32, i32* %1
br label %61
61: ; preds = %52, %41, %35, %58
%62 = phi i32 [ %60, %58 ], [ %40, %35 ], [ %46, %41 ], [ %57, %52 ]
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %61, %47
ret i32 0
}