#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 floor(int);
double *get_quartiles(double *data_array, int size) {
  static double ret_ar[3];
  double median;
  double first_quartile;
  double third_quartile;
  if (size % 2 == 1) {
    int imid = floor(size / 2);
    median = data_array[imid];
    if (imid % 2 == 1) {
      int i1q = floor(imid / 2);
      int i3q = imid + 1 + i1q;
      first_quartile = data_array[i1q];
      third_quartile = data_array[i3q];
    } else {
      int i1qb = imid / 2 - 1;
      int i1qa = i1qb + 1;
      int i3qb = i1qb + 1 + imid;
      int i3qa = i3qb + 1;
      first_quartile = ((data_array[i1qb] + data_array[i1qa]) / 2);
      third_quartile = ((data_array[i3qb] + data_array[i3qa]) / 2);
    }
  } else {
    int imida = size / 2;
    int imidb = imida - 1;
    median = ((data_array[imidb] + data_array[imida]) / 2);
    if (imida % 2 == 0) {
      int i1qb = imida / 2 - 1;
      int i1qa = i1qb + 1;
      int i3qb = i1qb + imida;
      int i3qa = i3qb + 1;
      first_quartile = ((data_array[i1qb] + data_array[i1qa]) / 2);
      third_quartile = ((data_array[i3qb] + data_array[i3qa]) / 2);
    } else {
      int i1q = imidb / 2;
      int i3q = i1q + imida;
      first_quartile = data_array[i1q];
      third_quartile = data_array[i3q];
    }
  }
  ret_ar[0] = first_quartile;
  ret_ar[1] = median;
  ret_ar[2] = third_quartile;
  return (ret_ar);
}


x86 assembly (clang, -O0):
<get_quartiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1242 <get_quartiles+0x132>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11b8 <get_quartiles+0xa8>
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    123d <get_quartiles+0x12d>
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xdf7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xdcc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    135f <get_quartiles+0x24f>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x48(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xd85(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    131f <get_quartiles+0x20f>
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xd1a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xcef(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    135a <get_quartiles+0x24a>
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x60(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    135f <get_quartiles+0x24f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,0x2cd4(%rip)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,0x2ccf(%rip)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,0x2cca(%rip)
lea    0x2cb3(%rip),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_quartiles>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
mov    %eax,%edi
sar    %edi
and    $0xfffffffe,%eax
mov    %esi,%ecx
sub    %eax,%ecx
cmp    $0x1,%ecx
jne    1172 <get_quartiles+0x62>
call   1030 <floor@plt>
mov    %eax,%r14d
cltq
movsd  (%rbx,%rax,8),%xmm2
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
mov    %ecx,%edi
sar    %edi
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
jne    11bb <get_quartiles+0xab>
movsd  %xmm2,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm2
lea    (%r14,%rax,1),%ecx
add    $0x1,%ecx
cltq
movslq %ecx,%rcx
jmp    11fc <get_quartiles+0xec>
movslq %edi,%rax
movsd  -0x8(%rbx,%rax,8),%xmm2
addsd  (%rbx,%rax,8),%xmm2
mulsd  0xe78(%rip),%xmm2
test   $0x1,%dil
jne    11e8 <get_quartiles+0xd8>
lea    0x3(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x2,%eax
lea    (%rax,%rdi,1),%ecx
add    $0xffffffff,%ecx
add    %eax,%edi
cltq
movslq %ecx,%rcx
movsd  (%rbx,%rcx,8),%xmm1
movhpd -0x8(%rbx,%rax,8),%xmm1
movslq %edi,%rcx
movsd  (%rbx,%rcx,8),%xmm0
jmp    11d5 <get_quartiles+0xc5>
add    %edi,%r14d
movslq %edi,%rax
movslq %r14d,%rcx
movsd  (%rbx,%rcx,8),%xmm1
movsd  0x8(%rbx,%rcx,8),%xmm0
movhpd -0x8(%rbx,%rax,8),%xmm1
movhpd (%rbx,%rax,8),%xmm0
addpd  %xmm1,%xmm0
mulpd  0xe2a(%rip),%xmm0
jmp    1206 <get_quartiles+0xf6>
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
add    %ecx,%edi
movslq %ecx,%rax
movslq %edi,%rcx
movsd  (%rbx,%rcx,8),%xmm0
movhpd (%rbx,%rax,8),%xmm0
movhpd %xmm0,0x2e32(%rip)
lea    0x2e2b(%rip),%rax
movsd  %xmm2,0x2e2b(%rip)
movlpd %xmm0,0x2e2b(%rip)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_quartiles.ret_ar = internal global [3 x double] zeroinitializer
define double* @get_quartiles(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%23 = load i32, i32* %4
%24 = srem i32 %23, 2
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %93
26: ; preds = %2
%27 = load i32, i32* %4
%28 = sdiv i32 %27, 2
%29 = call i32 @floor(i32 %28)
store i32 %29, i32* %8
%30 = load double*, double** %3
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
store double %34, double* %5
%35 = load i32, i32* %8
%36 = srem i32 %35, 2
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %56
38: ; preds = %26
%39 = load i32, i32* %8
%40 = sdiv i32 %39, 2
%41 = call i32 @floor(i32 %40)
store i32 %41, i32* %9
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
%44 = load i32, i32* %9
%45 = add nsw i32 %43, %44
store i32 %45, i32* %10
%46 = load double*, double** %3
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
%50 = load double, double* %49
store double %50, double* %6
%51 = load double*, double** %3
%52 = load i32, i32* %10
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
%55 = load double, double* %54
store double %55, double* %7
br label %92
56: ; preds = %26
%57 = load i32, i32* %8
%58 = sdiv i32 %57, 2
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %11
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %12
%62 = load i32, i32* %11
%63 = add nsw i32 %62, 1
%64 = load i32, i32* %8
%65 = add nsw i32 %63, %64
store i32 %65, i32* %13
%66 = load i32, i32* %13
%67 = add nsw i32 %66, 1
store i32 %67, i32* %14
%68 = load double*, double** %3
%69 = load i32, i32* %11
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %68, i64 %70
%72 = load double, double* %71
%73 = load double*, double** %3
%74 = load i32, i32* %12
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
%77 = load double, double* %76
%78 = fadd double %72, %77
%79 = fdiv double %78, 2.000000e+00
store double %79, double* %6
%80 = load double*, double** %3
%81 = load i32, i32* %13
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = load double*, double** %3
%86 = load i32, i32* %14
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
%89 = load double, double* %88
%90 = fadd double %84, %89
%91 = fdiv double %90, 2.000000e+00
store double %91, double* %7
br label %92
92: ; preds = %56, %38
br label %165
93: ; preds = %2
%94 = load i32, i32* %4
%95 = sdiv i32 %94, 2
store i32 %95, i32* %15
%96 = load i32, i32* %15
%97 = sub nsw i32 %96, 1
store i32 %97, i32* %16
%98 = load double*, double** %3
%99 = load i32, i32* %16
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
%102 = load double, double* %101
%103 = load double*, double** %3
%104 = load i32, i32* %15
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
%107 = load double, double* %106
%108 = fadd double %102, %107
%109 = fdiv double %108, 2.000000e+00
store double %109, double* %5
%110 = load i32, i32* %15
%111 = srem i32 %110, 2
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %148
113: ; preds = %93
%114 = load i32, i32* %15
%115 = sdiv i32 %114, 2
%116 = sub nsw i32 %115, 1
store i32 %116, i32* %17
%117 = load i32, i32* %17
%118 = add nsw i32 %117, 1
store i32 %118, i32* %18
%119 = load i32, i32* %17
%120 = load i32, i32* %15
%121 = add nsw i32 %119, %120
store i32 %121, i32* %19
%122 = load i32, i32* %19
%123 = add nsw i32 %122, 1
store i32 %123, i32* %20
%124 = load double*, double** %3
%125 = load i32, i32* %17
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %124, i64 %126
%128 = load double, double* %127
%129 = load double*, double** %3
%130 = load i32, i32* %18
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
%133 = load double, double* %132
%134 = fadd double %128, %133
%135 = fdiv double %134, 2.000000e+00
store double %135, double* %6
%136 = load double*, double** %3
%137 = load i32, i32* %19
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %3
%142 = load i32, i32* %20
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = fadd double %140, %145
%147 = fdiv double %146, 2.000000e+00
store double %147, double* %7
br label %164
148: ; preds = %93
%149 = load i32, i32* %16
%150 = sdiv i32 %149, 2
store i32 %150, i32* %21
%151 = load i32, i32* %21
%152 = load i32, i32* %15
%153 = add nsw i32 %151, %152
store i32 %153, i32* %22
%154 = load double*, double** %3
%155 = load i32, i32* %21
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %154, i64 %156
%158 = load double, double* %157
store double %158, double* %6
%159 = load double*, double** %3
%160 = load i32, i32* %22
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
%163 = load double, double* %162
store double %163, double* %7
br label %164
164: ; preds = %148, %113
br label %165
165: ; preds = %164, %92
%166 = load double, double* %6
store double %166, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 0)
%167 = load double, double* %5
store double %167, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 1)
%168 = load double, double* %7
store double %168, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 2)
ret double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 0)
}

LLVM IR (-O2):
@get_quartiles.ret_ar = internal global [3 x double] zeroinitializer
define double* @get_quartiles(double* nocapture %0, i32 %1) {
%3 = srem i32 %1, 2
%4 = icmp eq i32 %3, 1
%5 = sdiv i32 %1, 2
br i1 %4, label %6, label %48
6: ; preds = %2
%7 = tail call i32 @floor(i32 %5)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = srem i32 %7, 2
%12 = icmp eq i32 %11, 1
%13 = sdiv i32 %7, 2
br i1 %12, label %14, label %26
14: ; preds = %6
%15 = tail call i32 @floor(i32 %13)
%16 = add nsw i32 %7, 1
%17 = add nsw i32 %16, %15
%18 = sext i32 %15 to i64
%19 = getelementptr inbounds double, double* %0, i64 %18
%20 = load double, double* %19
%21 = sext i32 %17 to i64
%22 = getelementptr inbounds double, double* %0, i64 %21
%23 = load double, double* %22
%24 = insertelement <2 x double> poison, double %23, i64 0
%25 = insertelement <2 x double> %24, double %20, i64 1
br label %94
26: ; preds = %6
%27 = add nsw i32 %13, -1
%28 = add nsw i32 %13, %7
%29 = add nsw i32 %28, 1
%30 = sext i32 %27 to i64
%31 = getelementptr inbounds double, double* %0, i64 %30
%32 = load double, double* %31
%33 = sext i32 %13 to i64
%34 = getelementptr inbounds double, double* %0, i64 %33
%35 = load double, double* %34
%36 = sext i32 %28 to i64
%37 = getelementptr inbounds double, double* %0, i64 %36
%38 = load double, double* %37
%39 = sext i32 %29 to i64
%40 = getelementptr inbounds double, double* %0, i64 %39
%41 = load double, double* %40
%42 = insertelement <2 x double> poison, double %38, i64 0
%43 = insertelement <2 x double> %42, double %32, i64 1
%44 = insertelement <2 x double> poison, double %41, i64 0
%45 = insertelement <2 x double> %44, double %35, i64 1
%46 = fadd <2 x double> %43, %45
%47 = fmul <2 x double> %46, <double 5.000000e-01, double 5.000000e-01>
br label %94
48: ; preds = %2
%49 = add nsw i32 %5, -1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %0, i64 %50
%52 = load double, double* %51
%53 = sext i32 %5 to i64
%54 = getelementptr inbounds double, double* %0, i64 %53
%55 = load double, double* %54
%56 = fadd double %52, %55
%57 = fmul double %56, 5.000000e-01
%58 = and i32 %5, 1
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %83
60: ; preds = %48
%61 = sdiv i32 %1, 4
%62 = add nsw i32 %61, -1
%63 = add nsw i32 %62, %5
%64 = add nsw i32 %61, %5
%65 = sext i32 %62 to i64
%66 = getelementptr inbounds double, double* %0, i64 %65
%67 = load double, double* %66
%68 = sext i32 %61 to i64
%69 = getelementptr inbounds double, double* %0, i64 %68
%70 = load double, double* %69
%71 = sext i32 %63 to i64
%72 = getelementptr inbounds double, double* %0, i64 %71
%73 = load double, double* %72
%74 = sext i32 %64 to i64
%75 = getelementptr inbounds double, double* %0, i64 %74
%76 = load double, double* %75
%77 = insertelement <2 x double> poison, double %73, i64 0
%78 = insertelement <2 x double> %77, double %67, i64 1
%79 = insertelement <2 x double> poison, double %76, i64 0
%80 = insertelement <2 x double> %79, double %70, i64 1
%81 = fadd <2 x double> %78, %80
%82 = fmul <2 x double> %81, <double 5.000000e-01, double 5.000000e-01>
br label %94
83: ; preds = %48
%84 = sdiv i32 %49, 2
%85 = add nsw i32 %84, %5
%86 = sext i32 %84 to i64
%87 = getelementptr inbounds double, double* %0, i64 %86
%88 = load double, double* %87
%89 = sext i32 %85 to i64
%90 = getelementptr inbounds double, double* %0, i64 %89
%91 = load double, double* %90
%92 = insertelement <2 x double> poison, double %91, i64 0
%93 = insertelement <2 x double> %92, double %88, i64 1
br label %94
94: ; preds = %60, %83, %14, %26
%95 = phi double [ %10, %14 ], [ %10, %26 ], [ %57, %60 ], [ %57, %83 ]
%96 = phi <2 x double> [ %25, %14 ], [ %47, %26 ], [ %82, %60 ], [ %93, %83 ]
%97 = extractelement <2 x double> %96, i64 1
store double %97, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 0)
store double %95, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 1)
%98 = extractelement <2 x double> %96, i64 0
store double %98, double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 2)
ret double* getelementptr inbounds ([3 x double], [3 x double]* @get_quartiles.ret_ar, i64 0, i64 0)
}