#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 /*<<< orphan*/ sort(int, int, int, int, int, int, int, int, int, int);
int main() {
  int num1, num2, num3, num4, num5, num6;
  int num7, num8, num9, num10;
  float average;
  printf("Please input 10 numbers:\n");
  scanf("%d", &num1);
  scanf("%d", &num2);
  scanf("%d", &num3);
  scanf("%d", &num4);
  scanf("%d", &num5);
  scanf("%d", &num6);
  scanf("%d", &num7);
  scanf("%d", &num8);
  scanf("%d", &num9);
  scanf("%d", &num10);
  average =
      (num1 + num2 + num3 + num4 + num5 + num6 + num7 + num8 + num9 + num10) /
      10.0;
  printf("Average: %f\n", average);
  sort(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xec4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea4(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe94(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe84(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe74(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe64(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe54(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe44(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%ebx
mov    -0x28(%rbp),%r11d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1040 <sort@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rbx
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x28(%rsp),%eax
add    0x2c(%rsp),%eax
add    0x24(%rsp),%eax
add    0x20(%rsp),%eax
add    0x1c(%rsp),%eax
add    0x18(%rsp),%eax
add    0x14(%rsp),%eax
add    0x10(%rsp),%eax
add    0xc(%rsp),%eax
add    0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xdf2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdee(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2c(%rsp),%edi
mov    0x28(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x20(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
mov    0x14(%rsp),%r10d
mov    0x10(%rsp),%r11d
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebx
push   %rbx
push   %rax
push   %r11
push   %r10
call   1050 <sort@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Please input 10 numbers:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Average: %f\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
%10 = alloca i32
%11 = alloca float
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %3
%27 = add nsw i32 %25, %26
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %5
%31 = add nsw i32 %29, %30
%32 = load i32, i32* %6
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %7
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %8
%37 = add nsw i32 %35, %36
%38 = load i32, i32* %9
%39 = add nsw i32 %37, %38
%40 = load i32, i32* %10
%41 = add nsw i32 %39, %40
%42 = sitofp i32 %41 to double
%43 = fdiv double %42, 1.000000e+01
%44 = fptrunc double %43 to float
store float %44, float* %11
%45 = load float, float* %11
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %46)
%48 = load i32, i32* %1
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = load i32, i32* %6
%54 = load i32, i32* %7
%55 = load i32, i32* %8
%56 = load i32, i32* %9
%57 = load i32, i32* %10
%58 = call i32 @sort(i32 %48, i32 %49, i32 %50, i32 %51, i32 %52, i32 %53, i32 %54, i32 %55, i32 %56, i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Average: %f\0A\00"
@str = [25 x i8] c"Please input 10 numbers:\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
%10 = alloca i32
%11 = bitcast i32* %1 to i8*
%12 = bitcast i32* %2 to i8*
%13 = bitcast i32* %3 to i8*
%14 = bitcast i32* %4 to i8*
%15 = bitcast i32* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = bitcast i32* %9 to i8*
%20 = bitcast i32* %10 to i8*
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = add nsw i32 %33, %32
%35 = load i32, i32* %3
%36 = add nsw i32 %34, %35
%37 = load i32, i32* %4
%38 = add nsw i32 %36, %37
%39 = load i32, i32* %5
%40 = add nsw i32 %38, %39
%41 = load i32, i32* %6
%42 = add nsw i32 %40, %41
%43 = load i32, i32* %7
%44 = add nsw i32 %42, %43
%45 = load i32, i32* %8
%46 = add nsw i32 %44, %45
%47 = load i32, i32* %9
%48 = add nsw i32 %46, %47
%49 = load i32, i32* %10
%50 = add nsw i32 %48, %49
%51 = sitofp i32 %50 to double
%52 = fdiv double %51, 1.000000e+01
%53 = fptrunc double %52 to float
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %54)
%56 = load i32, i32* %1
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = load i32, i32* %4
%60 = load i32, i32* %5
%61 = load i32, i32* %6
%62 = load i32, i32* %7
%63 = load i32, i32* %8
%64 = load i32, i32* %9
%65 = load i32, i32* %10
%66 = call i32 @sort(i32 %56, i32 %57, i32 %58, i32 %59, i32 %60, i32 %61, i32 %62, i32 %63, i32 %64, i32 %65)
ret i32 0
}