#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 a;
  int b;
  int c;
  int sum;
  int avg;
  int prod;
  int small;
  int large;
  printf("Please, enter three integers: ");
  scanf("%d%d%d", &a, &b, &c);
  sum = a + b + c;
  printf("Sum is %d\n", sum);
  avg = sum / 3;
  printf("Average is %d\n", avg);
  prod = a * b * c;
  printf("Product is %d\n", prod);
  small = a;
  if (b < small)
    small = b;
  if (c < small)
    small = c;
  printf("Smallest is %d\n", small);
  large = a;
  if (b > large)
    large = b;
  if (c > large)
    large = c;
  printf("Largest is %d\n", large);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11c8 <main+0xa8>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11da <main+0xba>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1203 <main+0xe3>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1215 <main+0xf5>
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x8(%rsp),%ebx
add    0xc(%rsp),%ebx
add    0x4(%rsp),%ebx
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq %ebx,%rax
imul   $0x55555556,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%esi
imul   0xc(%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%eax
cmp    %esi,%eax
cmovl  %eax,%esi
mov    0x4(%rsp),%eax
cmp    %esi,%eax
cmovl  %eax,%esi
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%eax
cmp    %esi,%eax
cmovg  %eax,%esi
mov    0x4(%rsp),%eax
cmp    %esi,%eax
cmovg  %eax,%esi
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Please, enter three integers: \00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [11 x i8] c"Sum is %d\0A\00"
@.str.3 = [15 x i8] c"Average is %d\0A\00"
@.str.4 = [15 x i8] c"Product is %d\0A\00"
@.str.5 = [16 x i8] c"Smallest is %d\0A\00"
@.str.6 = [15 x i8] c"Largest is %d\0A\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 ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 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 = sdiv i32 %13, 3
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = mul nsw i32 %18, %17
%20 = load i32, i32* %3
%21 = mul nsw i32 %19, %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, %23
%26 = select i1 %25, i32 %24, i32 %23
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, %26
%29 = select i1 %28, i32 %27, i32 %26
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, %31
%34 = select i1 %33, i32 %32, i32 %31
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, %34
%37 = select i1 %36, i32 %35, i32 %34
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %37)
ret i32 0
}