#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 */
double average(int, int, int, int, ...);
int /*<<< orphan*/ print(char *, char *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("Average of 2, 3, 4, 5 = %f\n", average(4, 2, 3, 4, 5));
  printf("Average of 5, 10, 15 = %f\n", average(3, 5, 10, 15));
  print("I\'m %s, %d years old.\n", "zing", 25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%ecx
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x5,%r8d
mov    %ecx,%edi
mov    $0x0,%al
call   1050 <average@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0xf,%ecx
mov    $0x0,%al
call   1050 <average@plt>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    0xeb0(%rip),%rsi
mov    $0x19,%edx
call   1040 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
xor    %eax,%eax
call   1050 <average@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x5,%esi
mov    $0xa,%edx
mov    $0xf,%ecx
xor    %eax,%eax
call   1050 <average@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0x19,%edx
call   1040 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Average of 2, 3, 4, 5 = %f\0A\00"
@.str.1 = [27 x i8] c"Average of 5, 10, 15 = %f\0A\00"
@.str.2 = [23 x i8] c"I'm %s, %d years old.\0A\00"
@.str.3 = [5 x i8] c"zing\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double (i32, i32, i32, i32, ...) @average(i32 4, i32 2, i32 3, i32 4, i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double (i32, i32, i32, i32, ...) @average(i32 3, i32 5, i32 10, i32 15)
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call i32 @print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 25)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Average of 2, 3, 4, 5 = %f\0A\00"
@.str.1 = [27 x i8] c"Average of 5, 10, 15 = %f\0A\00"
@.str.2 = [23 x i8] c"I'm %s, %d years old.\0A\00"
@.str.3 = [5 x i8] c"zing\00"
define i32 @main() {
%1 = tail call double (i32, i32, i32, i32, ...) @average(i32 4, i32 2, i32 3, i32 4, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double (i32, i32, i32, i32, ...) @average(i32 3, i32 5, i32 10, i32 15)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call i32 @print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 25)
ret i32 0
}