#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 *);
main() {
  int a, b, c;
  printf("Input three different integers: ");
  scanf("%d %d %d", &a, &b, &c);
  printf("\nSum is %d", a + b + c);
  printf("\nAverage is %d", (a + b + c) / 3);
  printf("\nProduct is %d", a * b * c);
  if (a < b && a < c)
    printf("\nSmallest is %d", a);
  else if (b < a && b < c)
    printf("\nSmallest is %d", b);
  else
    printf("\nSmallest is %d", c);
  if (a > b && a > c)
    printf("\nLargest is %d", a);
  else if (b > a && b > c)
    printf("\nLargest is %d", b);
  else
    printf("\nLargest is %d", c);
}


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    0xedd(%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    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%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
jge    11d4 <main+0xb4>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d4 <main+0xb4>
mov    -0x8(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1202 <main+0xe2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1202 <main+0xe2>
mov    -0xc(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
mov    -0x10(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <main+0xf8>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1246 <main+0x126>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1246 <main+0x126>
mov    -0x8(%rbp),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128a <main+0x16a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1274 <main+0x154>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1274 <main+0x154>
mov    -0xc(%rbp),%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1285 <main+0x165>
mov    -0x10(%rbp),%esi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    128a <main+0x16a>
mov    -0x4(%rbp),%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    0xee8(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
add    0x14(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
cltq
imul   $0x55555556,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
imul   0x14(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovl  %eax,%edx
mov    0x14(%rsp),%edi
cmp    %edi,%eax
cmovge %ecx,%edx
cmp    %ecx,%edi
mov    %edx,%esi
cmovl  %edi,%esi
cmp    %eax,%edi
cmovge %edx,%esi
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovg  %eax,%edx
mov    0x14(%rsp),%edi
cmp    %edi,%eax
cmovle %ecx,%edx
cmp    %ecx,%edi
mov    %edx,%esi
cmovg  %edi,%esi
cmp    %eax,%edi
cmovle %edx,%esi
lea    0xe53(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Input three different integers: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [11 x i8] c"\0ASum is %d\00"
@.str.3 = [15 x i8] c"\0AAverage is %d\00"
@.str.4 = [15 x i8] c"\0AProduct is %d\00"
@.str.5 = [16 x i8] c"\0ASmallest is %d\00"
@.str.6 = [15 x i8] c"\0ALargest 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 ([33 x i8], [33 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 ([11 x i8], [11 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 = sdiv i32 %17, 3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = mul nsw i32 %20, %21
%23 = load i32, i32* %4
%24 = mul nsw i32 %22, %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %36
29: ; preds = %0
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load i32, i32* %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %34)
br label %51
36: ; preds = %29, %0
%37 = load i32, i32* %3
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %47
40: ; preds = %36
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %45)
br label %50
47: ; preds = %40, %36
%48 = load i32, i32* %4
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %47, %44
br label %51
51: ; preds = %50, %33
%52 = load i32, i32* %2
%53 = load i32, i32* %3
%54 = icmp sgt i32 %52, %53
br i1 %54, label %55, label %62
55: ; preds = %51
%56 = load i32, i32* %2
%57 = load i32, i32* %4
%58 = icmp sgt i32 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i32, i32* %2
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %60)
br label %77
62: ; preds = %55, %51
%63 = load i32, i32* %3
%64 = load i32, i32* %2
%65 = icmp sgt i32 %63, %64
br i1 %65, label %66, label %73
66: ; preds = %62
%67 = load i32, i32* %3
%68 = load i32, i32* %4
%69 = icmp sgt i32 %67, %68
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = load i32, i32* %3
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %71)
br label %76
73: ; preds = %66, %62
%74 = load i32, i32* %4
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %73, %70
br label %77
77: ; preds = %76, %59
%78 = load i32, i32* %1
ret i32 %78
}

LLVM IR (-O2):
@.str = [33 x i8] c"Input three different integers: \00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [11 x i8] c"\0ASum is %d\00"
@.str.3 = [15 x i8] c"\0AAverage is %d\00"
@.str.4 = [15 x i8] c"\0AProduct is %d\00"
@.str.5 = [16 x i8] c"\0ASmallest is %d\00"
@.str.6 = [15 x i8] c"\0ALargest 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 ([33 x i8], [33 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 ([11 x i8], [11 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 = sdiv i32 %19, 3
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = mul nsw i32 %23, %22
%25 = load i32, i32* %3
%26 = mul nsw i32 %24, %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = icmp slt i32 %28, %29
%31 = load i32, i32* %3
%32 = icmp slt i32 %28, %31
%33 = select i1 %30, i1 %32, i1 false
%34 = icmp slt i32 %29, %28
%35 = icmp slt i32 %29, %31
%36 = select i1 %34, i1 %35, i1 false
%37 = select i1 %36, i32 %29, i32 %31
%38 = select i1 %33, i32 %28, i32 %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %1
%41 = load i32, i32* %2
%42 = icmp sgt i32 %40, %41
%43 = load i32, i32* %3
%44 = icmp sgt i32 %40, %43
%45 = select i1 %42, i1 %44, i1 false
%46 = icmp sgt i32 %41, %40
%47 = icmp sgt i32 %41, %43
%48 = select i1 %46, i1 %47, i1 false
%49 = select i1 %48, i32 %41, i32 %43
%50 = select i1 %45, i32 %40, i32 %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %50)
ret i32 0
}