#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, int, double);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ sum_ave(int, int, int *, double *);
int main() {
  int a;
  int b;
  int sum;
  double ave;
  scanf("%d %d", &a, &b);
  sum_ave(a, b, &sum, &ave);
  printf("Sum(%d,%d) = %d\n", a, b, sum);
  printf("Ave(%d,%d) = %lf\n", a, b, ave);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <sum_ave@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
cvtsi2sdl -0x10(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <sum_ave@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
cvtsi2sdl 0xc(%rsp),%xmm0
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
movsd  0x10(%rsp),%xmm0
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [17 x i8] c"Sum(%d,%d) = %d\0A\00"
@.str.2 = [18 x i8] c"Ave(%d,%d) = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @sum_ave(i32 %7, i32 %8, i32* %4, double* %5)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, double %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load double, double* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16, double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [17 x i8] c"Sum(%d,%d) = %d\0A\00"
@.str.2 = [18 x i8] c"Ave(%d,%d) = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 @sum_ave(i32 %10, i32 %11, i32* %3, double* %4)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14, double %16)
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load double, double* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %19, double %20)
ret i32 0
}