#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 aveOdd(unsigned int *, int);
int boxArea(int, int, int);
int howMany(char, char *);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ reverse(double *, double *);
int /*<<< orphan*/ stats(double *, double *, double *, int, int, int);
int main() {
  double a, b, c;
  unsigned d[] = {1, 22, 3, 44, 5, 1};
  double e[] = {1.1, 2.2, 3.3};
  char *s = "Jack and Jill.";
  printf("%lf\n", boxArea(3, 3, 3));
  stats(&a, &b, &c, 7, 2, 3);
  printf("%lf %lf %lf\n", a, b, c);
  printf("%lf\n", aveOdd(d, 6));
  reverse(e, e + 3);
  printf("%lf %lf %lf\n", e[0], e[1], e[2]);
  printf("%u\n", howMany('J', s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe80(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    $0x3,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1080 <boxArea@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x7,%ecx
mov    $0x2,%r8d
mov    $0x3,%r9d
call   1040 <stats@plt>
cvttsd2si -0x10(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe35(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
call   1050 <aveOdd@plt>
mov    %eax,%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0x18,%rsi
call   1030 <reverse@plt>
cvttsd2si -0x60(%rbp),%esi
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xde9(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    -0x68(%rbp),%rsi
mov    $0x4a,%edi
call   1070 <howMany@plt>
mov    %eax,%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0xea2(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xeaa(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x3,%edx
call   1080 <boxArea@plt>
lea    0xe9e(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x28(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
mov    $0x7,%ecx
mov    $0x2,%r8d
mov    $0x3,%r9d
call   1040 <stats@plt>
cvttsd2si 0x28(%rsp),%esi
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
lea    0xe4c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%al
call   1060 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x6,%esi
call   1050 <aveOdd@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rsp,%rdi
call   1030 <reverse@plt>
cvttsd2si (%rsp),%esi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1060 <printf@plt>
lea    0xde9(%rip),%rsi
mov    $0x4a,%edi
call   1070 <howMany@plt>
lea    0xdf4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.d = [6 x i32] [i32 1, i32 22, i32 3, i32 44, i32 5, i32 1]
@__const.main.e = [3 x double] [double 1.100000e+00, double 2.200000e+00, double 3.300000e+00]
@.str = [15 x i8] c"Jack and Jill.\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
@.str.2 = [13 x i8] c"%lf %lf %lf\0A\00"
@.str.3 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca [6 x i32]
%6 = alloca [3 x double]
%7 = alloca i8*
store i32 0, i32* %1
%8 = bitcast [6 x i32]* %5 to i8*
%9 = bitcast [3 x double]* %6 to i8*
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %7
%10 = call i32 @boxArea(i32 3, i32 3, i32 3)
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @stats(double* %2, double* %3, double* %4, i32 7, i32 2, i32 3)
%13 = load double, double* %2
%14 = fptosi double %13 to i32
%15 = load double, double* %3
%16 = load double, double* %4
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %14, double %15, double %16)
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%19 = call i32 @aveOdd(i32* %18, i32 6)
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%22 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%23 = getelementptr inbounds double, double* %22, i64 3
%24 = call i32 @reverse(double* %21, double* %23)
%25 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%26 = load double, double* %25
%27 = fptosi double %26 to i32
%28 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%29 = load double, double* %28
%30 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%31 = load double, double* %30
%32 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %27, double %29, double %31)
%33 = load i8*, i8** %7
%34 = call i32 @howMany(i8 signext 74, i8* %33)
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %34)
ret i32 0
}

LLVM IR (-O2):
@__const.main.d = [6 x i32] [i32 1, i32 22, i32 3, i32 44, i32 5, i32 1]
@__const.main.e = [3 x double] [double 1.100000e+00, double 2.200000e+00, double 3.300000e+00]
@.str = [15 x i8] c"Jack and Jill.\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
@.str.2 = [13 x i8] c"%lf %lf %lf\0A\00"
@.str.3 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca [6 x i32]
%5 = alloca [3 x double]
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast [6 x i32]* %4 to i8*
%10 = bitcast [3 x double]* %5 to i8*
%11 = tail call i32 @boxArea(i32 3, i32 3, i32 3)
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @stats(double* %1, double* %2, double* %3, i32 7, i32 2, i32 3)
%14 = load double, double* %1
%15 = fptosi double %14 to i32
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %15, double %16, double %17)
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%20 = call i32 @aveOdd(i32* %19, i32 6)
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%23 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 3
%24 = call i32 @reverse(double* %22, double* %23)
%25 = load double, double* %22
%26 = fptosi double %25 to i32
%27 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%28 = load double, double* %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%30 = load double, double* %29
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %26, double %28, double %30)
%32 = call i32 @howMany(i8 signext 74, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%33 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret i32 0
}