#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 */
float fun(int *, int *, int *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int, int, float);
int main() {
  int a[10] = {56, 76, 45, 75, 32, 98, 34, 67, 84, 88}, max, min;
  float aver = 0;
  aver = fun(a, &max, &min);
  printf("max = %d\nmin = %d\naver = %f", max, min, aver);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1030 <fun@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
movss  -0x3c(%rbp),%xmm0
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <fun@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 56, i32 76, i32 45, i32 75, i32 32, i32 98, i32 34, i32 67, i32 84, i32 88]
@.str = [28 x i8] c"max = %d\0Amin = %d\0Aaver = %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = bitcast [10 x i32]* %2 to i8*
store float 0.000000e+00, float* %5
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call float @fun(i32* %7, i32* %3, i32* %4)
store float %8, float* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load float, float* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, float %11)
%13 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 56, i32 76, i32 45, i32 75, i32 32, i32 98, i32 34, i32 67, i32 84, i32 88]
@.str = [28 x i8] c"max = %d\0Amin = %d\0Aaver = %f\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call float @fun(i32* %7, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, float %8)
%12 = call i32 (...) @getchar()
ret i32 0
}