#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 atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ for_each_row(long *, long *, long *, double *, double *,
                                double *, double *, double *, double *,
                                double *, double *, double *, double *,
                                double *, int *, int *, char, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ output_statistics(long, long, double, double, double, double,
                                     double, double, double, double, double,
                                     double, int, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  double sum = 0.0;
  double weighted_sum = 0.0;
  double average = 0.0;
  double standard_deviation = 0.0;
  double coefficient_of_variation = 0.0;
  double standard_error_of_mean = 0.0;
  double minimum = 0.0;
  double median = 0.0;
  double maximum = 0.0;
  double range = 0.0;
  long weighted_input_count = 0;
  long weighted_count = 0;
  long count = 0;
  int number_in_array = 0;
  int exceeded_max_numbers = 0;
  double percent_missing = 0.0;
  char delimiter;
  int value_piece = 0;
  int weight_piece = -1;
  if (strcmp(argv[0], "descriptive_statistics") == 0) {
    delimiter = '|';
    value_piece = 0;
    weight_piece = -1;
  } else if (argc < 2) {
    fprintf(stderr, "Usage: %s delimiter [value_piece] [weight_piece]\n",
            argv[0]);
    exit(1);
  } else {
    delimiter = *argv[1];
    if (argc >= 3)
      value_piece = atoi(argv[2]);
    if (argc == 4)
      weight_piece = atoi(argv[3]);
  }
  for_each_row(&count, &weighted_input_count, &weighted_count, &sum,
               &weighted_sum, &average, &standard_deviation,
               &coefficient_of_variation, &standard_error_of_mean, &minimum,
               &median, &maximum, &range, &percent_missing, &number_in_array,
               &exceeded_max_numbers, delimiter, value_piece, weight_piece);
  output_statistics(count, weighted_input_count, sum, average,
                    standard_deviation, coefficient_of_variation,
                    standard_error_of_mean, minimum, median, maximum, range,
                    percent_missing, number_in_array, exceeded_max_numbers);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movq   $0x0,-0x90(%rbp)
movq   $0x0,-0x98(%rbp)
movq   $0x0,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movl   $0x0,-0xb8(%rbp)
movl   $0xffffffff,-0xbc(%rbp)
ff ff ff
mov    -0x38(%rbp),%rax
mov    (%rax),%rdi
lea    0xdc9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1266 <main+0x106>
movb   $0x7c,-0xb1(%rbp)
movl   $0x0,-0xb8(%rbp)
movl   $0xffffffff,-0xbc(%rbp)
ff ff ff
jmp    12ea <main+0x18a>
cmpl   $0x2,-0x30(%rbp)
jge    1296 <main+0x136>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rax
mov    (%rax),%rdx
lea    0xd90(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0xb1(%rbp)
cmpl   $0x3,-0x30(%rbp)
jl     12c3 <main+0x163>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xb8(%rbp)
cmpl   $0x4,-0x30(%rbp)
jne    12e0 <main+0x180>
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xbc(%rbp)
jmp    12e5 <main+0x185>
jmp    12ea <main+0x18a>
mov    -0xb1(%rbp),%r11b
mov    -0xb8(%rbp),%r10d
mov    -0xbc(%rbp),%eax
mov    %eax,-0xc0(%rbp)
lea    -0xa0(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x98(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x48(%rbp),%r8
lea    -0x50(%rbp),%r9
lea    -0x58(%rbp),%rax
lea    -0x60(%rbp),%rbx
mov    %rbx,-0xe0(%rbp)
lea    -0x68(%rbp),%rbx
mov    %rbx,-0xd8(%rbp)
lea    -0x70(%rbp),%rbx
mov    %rbx,-0xd0(%rbp)
lea    -0x78(%rbp),%rbx
mov    %rbx,-0xc8(%rbp)
lea    -0x80(%rbp),%r13
lea    -0x88(%rbp),%r12
lea    -0xb0(%rbp),%r15
lea    -0xa4(%rbp),%r14
lea    -0xa8(%rbp),%rbx
mov    %rax,(%rsp)
mov    -0xe0(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0xd8(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0xd0(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0xc8(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0xc0(%rbp),%eax
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %rbx,0x48(%rsp)
movsbl %r11b,%r11d
mov    %r11d,0x50(%rsp)
mov    %r10d,0x58(%rsp)
mov    %eax,0x60(%rsp)
call   1080 <for_each_row@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x90(%rbp),%rsi
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm4
movsd  -0x70(%rbp),%xmm5
movsd  -0x78(%rbp),%xmm6
movsd  -0x80(%rbp),%xmm7
movsd  -0x88(%rbp),%xmm9
ff ff
movsd  -0xb0(%rbp),%xmm8
ff ff
mov    -0xa4(%rbp),%edx
mov    -0xa8(%rbp),%ecx
movsd  %xmm9,(%rsp)
movsd  %xmm8,0x8(%rsp)
call   1030 <output_statistics@plt>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x60(%rsp)
movq   $0x0,0x70(%rsp)
movq   $0x0,0x58(%rsp)
movq   $0x0,0x50(%rsp)
movq   $0x0,0x48(%rsp)
movq   $0x0,0x40(%rsp)
movq   $0x0,0x38(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x68(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    (%rsi),%rdi
lea    0xdf6(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0xffffffff,%r14d
xor    %r15d,%r15d
test   %rax,%rax
je     1251 <main+0xf1>
cmp    $0x1,%ebp
jle    134e <main+0x1ee>
mov    0x8(%rbx),%rax
mov    (%rax),%r12b
cmp    $0x2,%ebp
je     1254 <main+0xf4>
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
cmp    $0x4,%ebp
jne    1254 <main+0xf4>
mov    0x18(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
jmp    1254 <main+0xf4>
mov    $0x7c,%r12b
sub    $0x8,%rsp
movsbl %r12b,%eax
lea    0x8(%rsp),%r10
lea    0xc(%rsp),%r11
lea    0x10(%rsp),%rbx
lea    0x28(%rsp),%r12
lea    0x30(%rsp),%r13
lea    0x38(%rsp),%rbp
lea    0x18(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x70(%rsp),%rdx
lea    0x68(%rsp),%rcx
lea    0x78(%rsp),%r8
lea    0x60(%rsp),%r9
push   %r14
push   %r15
push   %rax
push   %r10
push   %r11
push   %rbx
push   %r12
push   %r13
push   %rbp
lea    0x88(%rsp),%rax
push   %rax
lea    0x98(%rsp),%rax
push   %rax
lea    0xa8(%rsp),%rax
push   %rax
lea    0xb8(%rsp),%rax
push   %rax
call   1080 <for_each_row@plt>
add    $0x70,%rsp
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
movsd  0x60(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
movsd  0x50(%rsp),%xmm2
movsd  0x48(%rsp),%xmm3
movsd  0x40(%rsp),%xmm4
movsd  0x38(%rsp),%xmm5
movsd  0x30(%rsp),%xmm6
movsd  0x28(%rsp),%xmm7
movsd  0x20(%rsp),%xmm8
movsd  0x8(%rsp),%xmm9
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
sub    $0x10,%rsp
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,(%rsp)
call   1030 <output_statistics@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xcb6(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"descriptive_statistics\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"Usage: %s delimiter [value_piece] [weight_piece]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca i8
%23 = alloca i32
%24 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
store double 0.000000e+00, double* %15
store i64 0, i64* %16
store i64 0, i64* %17
store i64 0, i64* %18
store i32 0, i32* %19
store i32 0, i32* %20
store double 0.000000e+00, double* %21
store i32 0, i32* %23
store i32 -1, i32* %24
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %2
store i8 124, i8* %22
store i32 0, i32* %23
store i32 -1, i32* %24
br label %63
31: ; preds = %2
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 2
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i32, i32* @stderr
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %31
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = load i8, i8* %44
store i8 %45, i8* %22
%46 = load i32, i32* %4
%47 = icmp sge i32 %46, 3
br i1 %47, label %48, label %53
48: ; preds = %41
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 2
%51 = load i8*, i8** %50
%52 = call i32 @atoi(i8* %51)
store i32 %52, i32* %23
br label %53
53: ; preds = %48, %41
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 4
br i1 %55, label %56, label %61
56: ; preds = %53
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 3
%59 = load i8*, i8** %58
%60 = call i32 @atoi(i8* %59)
store i32 %60, i32* %24
br label %61
61: ; preds = %56, %53
br label %62
62: ; preds = %61
br label %63
63: ; preds = %62, %30
%64 = load i8, i8* %22
%65 = load i32, i32* %23
%66 = load i32, i32* %24
%67 = call i32 @for_each_row(i64* %18, i64* %16, i64* %17, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %21, i32* %19, i32* %20, i8 signext %64, i32 %65, i32 %66)
%68 = load i64, i64* %18
%69 = load i64, i64* %16
%70 = load double, double* %6
%71 = load double, double* %8
%72 = load double, double* %9
%73 = load double, double* %10
%74 = load double, double* %11
%75 = load double, double* %12
%76 = load double, double* %13
%77 = load double, double* %14
%78 = load double, double* %15
%79 = load double, double* %21
%80 = load i32, i32* %19
%81 = load i32, i32* %20
%82 = call i32 @output_statistics(i64 %68, i64 %69, double %70, double %71, double %72, double %73, double %74, double %75, double %76, double %77, double %78, double %79, i32 %80, i32 %81)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"descriptive_statistics\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"Usage: %s delimiter [value_piece] [weight_piece]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%20 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%21 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%22 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%23 = bitcast double* %7 to i8*
store double 0.000000e+00, double* %7
%24 = bitcast double* %8 to i8*
store double 0.000000e+00, double* %8
%25 = bitcast double* %9 to i8*
store double 0.000000e+00, double* %9
%26 = bitcast double* %10 to i8*
store double 0.000000e+00, double* %10
%27 = bitcast double* %11 to i8*
store double 0.000000e+00, double* %11
%28 = bitcast double* %12 to i8*
store double 0.000000e+00, double* %12
%29 = bitcast i64* %13 to i8*
store i64 0, i64* %13
%30 = bitcast i64* %14 to i8*
store i64 0, i64* %14
%31 = bitcast i64* %15 to i8*
store i64 0, i64* %15
%32 = bitcast i32* %16 to i8*
store i32 0, i32* %16
%33 = bitcast i32* %17 to i8*
store i32 0, i32* %17
%34 = bitcast double* %18 to i8*
store double 0.000000e+00, double* %18
%35 = load i8*, i8** %1
%36 = tail call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %59, label %38
38: ; preds = %2
%39 = icmp slt i32 %0, 2
br i1 %39, label %40, label %45
40: ; preds = %38
%41 = load i32, i32* @stderr
%42 = load i8*, i8** %1
%43 = tail call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %42)
%44 = tail call i32 @exit(i32 1)
unreachable
45: ; preds = %38
%46 = getelementptr inbounds i8*, i8** %1, i64 1
%47 = load i8*, i8** %46
%48 = load i8, i8* %47
%49 = icmp eq i32 %0, 2
br i1 %49, label %59, label %50
50: ; preds = %45
%51 = getelementptr inbounds i8*, i8** %1, i64 2
%52 = load i8*, i8** %51
%53 = tail call i32 @atoi(i8* %52)
%54 = icmp eq i32 %0, 4
br i1 %54, label %55, label %59
55: ; preds = %50
%56 = getelementptr inbounds i8*, i8** %1, i64 3
%57 = load i8*, i8** %56
%58 = tail call i32 @atoi(i8* %57)
br label %59
59: ; preds = %45, %2, %55, %50
%60 = phi i8 [ %48, %55 ], [ %48, %50 ], [ 124, %2 ], [ %48, %45 ]
%61 = phi i32 [ %53, %55 ], [ %53, %50 ], [ 0, %2 ], [ 0, %45 ]
%62 = phi i32 [ %58, %55 ], [ -1, %50 ], [ -1, %2 ], [ -1, %45 ]
%63 = call i32 @for_each_row(i64* %15, i64* %13, i64* %14, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %18, i32* %16, i32* %17, i8 signext %60, i32 %61, i32 %62)
%64 = load i64, i64* %15
%65 = load i64, i64* %13
%66 = load double, double* %3
%67 = load double, double* %5
%68 = load double, double* %6
%69 = load double, double* %7
%70 = load double, double* %8
%71 = load double, double* %9
%72 = load double, double* %10
%73 = load double, double* %11
%74 = load double, double* %12
%75 = load double, double* %18
%76 = load i32, i32* %16
%77 = load i32, i32* %17
%78 = call i32 @output_statistics(i64 %64, i64 %65, double %66, double %67, double %68, double %69, double %70, double %71, double %72, double %73, double %74, double %75, i32 %76, i32 %77)
ret i32 0
}