#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*/ free_vector(float *, int, int);
int gasdev(long *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ttest(float *, int, float *, int, float *, float *);
float *vector(int, int);
int main(void) {
  long idum = (-5);
  int i, j;
  float prob, t, *data1, *data2;
  data1 = vector(1, 1024);
  data2 = vector(1, 512);
  printf("%6s %8s %16s\n", "shift", "t", "probability");
  for (i = 1; i <= 1024; i++)
    data1[i] = gasdev(&idum);
  for (i = 1; i <= 512; i++)
    data2[i] = (10 / 2.0) * 0.02 + gasdev(&idum);
  for (i = 1; i <= 10 + 1; i++) {
    ttest(data1, 1024, data2, 512, &t, &prob);
    printf("%6.2f %10.2f %10.2f\n", (i - 1) * 0.02, t, prob);
    for (j = 1; j <= 1024; j++)
      data1[j] += 0.02;
  }
  free_vector(data2, 1, 512);
  free_vector(data1, 1, 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xfffffffffffffffb,-0x10(%rbp)
ff
mov    $0x1,%edi
mov    $0x400,%esi
call   1060 <vector@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
mov    $0x200,%esi
call   1060 <vector@plt>
mov    %rax,-0x30(%rbp)
lea    0xe7c(%rip),%rdi
lea    0xe83(%rip),%rsi
lea    0xe80(%rip),%rdx
lea    0xe7b(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jg     11ec <main+0x9c>
lea    -0x10(%rbp),%rdi
call   1070 <gasdev@plt>
cvtsi2ss %eax,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b7 <main+0x67>
movl   $0x1,-0x14(%rbp)
cmpl   $0x200,-0x14(%rbp)
jg     1238 <main+0xe8>
lea    -0x10(%rbp),%rdi
call   1070 <gasdev@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdf3(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f3 <main+0xa3>
movl   $0x1,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jg     12f9 <main+0x1a9>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    $0x400,%esi
mov    $0x200,%ecx
lea    -0x20(%rbp),%r8
lea    -0x1c(%rbp),%r9
call   1050 <ttest@plt>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xd86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xd99(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
cmpl   $0x400,-0x18(%rbp)
jg     12e6 <main+0x196>
mov    -0x28(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd35(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a5 <main+0x155>
jmp    12eb <main+0x19b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    123f <main+0xef>
mov    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0x200,%edx
call   1040 <free_vector@plt>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <free_vector@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0xfffffffffffffffb,0x10(%rsp)
ff ff
mov    $0x1,%edi
mov    $0x400,%esi
call   1060 <vector@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0x200,%esi
call   1060 <vector@plt>
mov    %rax,%r14
lea    0xe8e(%rip),%rdi
lea    0xe95(%rip),%rsi
lea    0xe92(%rip),%rdx
lea    0xe8d(%rip),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebp
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1070 <gasdev@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,(%rbx,%rbp,4)
add    $0x1,%rbp
cmp    $0x401,%rbp
jne    11c0 <main+0x70>
mov    $0x1,%ebp
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1070 <gasdev@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xdf9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    $0x201,%rbp
jne    11f0 <main+0xa0>
mov    $0x1,%ebp
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xe0c(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
mov    $0x200,%ecx
mov    %r15,%r8
mov    %r12,%r9
call   1050 <ttest@plt>
lea    -0x1(%rbp),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd9b(%rip),%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0xc(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %r13,%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movapd 0xd7d(%rip),%xmm4
mov    $0xd,%eax
nopl   0x0(%rax,%rax,1)
cvtps2pd -0x28(%rbx,%rax,4),%xmm0
cvtps2pd -0x30(%rbx,%rax,4),%xmm1
cvtps2pd -0x18(%rbx,%rax,4),%xmm2
cvtps2pd -0x20(%rbx,%rax,4),%xmm3
addpd  %xmm4,%xmm1
addpd  %xmm4,%xmm0
addpd  %xmm4,%xmm3
addpd  %xmm4,%xmm2
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm2,%xmm2
unpcklpd %xmm0,%xmm1
cvtpd2ps %xmm3,%xmm0
unpcklpd %xmm2,%xmm0
movupd %xmm1,-0x30(%rbx,%rax,4)
movupd %xmm0,-0x20(%rbx,%rax,4)
cvtps2pd -0x8(%rbx,%rax,4),%xmm0
cvtps2pd -0x10(%rbx,%rax,4),%xmm1
cvtps2pd 0x8(%rbx,%rax,4),%xmm2
cvtps2pd (%rbx,%rax,4),%xmm3
addpd  %xmm4,%xmm1
addpd  %xmm4,%xmm0
addpd  %xmm4,%xmm3
addpd  %xmm4,%xmm2
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
cvtpd2ps %xmm2,%xmm2
unpcklpd %xmm0,%xmm1
cvtpd2ps %xmm3,%xmm0
unpcklpd %xmm2,%xmm0
movupd %xmm1,-0x10(%rbx,%rax,4)
movupd %xmm0,(%rbx,%rax,4)
add    $0x10,%rax
cmp    $0x40d,%rax
jne    12a0 <main+0x150>
add    $0x1,%ebp
cmp    $0xc,%ebp
jne    1240 <main+0xf0>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x200,%edx
call   1040 <free_vector@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <free_vector@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%6s %8s %16s\0A\00"
@.str.1 = [6 x i8] c"shift\00"
@.str.2 = [2 x i8] c"t\00"
@.str.3 = [12 x i8] c"probability\00"
@.str.4 = [21 x i8] c"%6.2f %10.2f %10.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store i32 0, i32* %1
store i64 -5, i64* %2
%9 = call float* @vector(i32 1, i32 1024)
store float* %9, float** %7
%10 = call float* @vector(i32 1, i32 512)
store float* %10, float** %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %12
12: ; preds = %22, %0
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 1024
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = call i32 @gasdev(i64* %2)
%17 = sitofp i32 %16 to float
%18 = load float*, float** %7
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
store float %17, float* %21
br label %22
22: ; preds = %15
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %12
25: ; preds = %12
store i32 1, i32* %3
br label %26
26: ; preds = %38, %25
%27 = load i32, i32* %3
%28 = icmp sle i32 %27, 512
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = call i32 @gasdev(i64* %2)
%31 = sitofp i32 %30 to double
%32 = fadd double 1.000000e-01, %31
%33 = fptrunc double %32 to float
%34 = load float*, float** %8
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
store float %33, float* %37
br label %38
38: ; preds = %29
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %26
41: ; preds = %26
store i32 1, i32* %3
br label %42
42: ; preds = %74, %41
%43 = load i32, i32* %3
%44 = icmp sle i32 %43, 11
br i1 %44, label %45, label %77
45: ; preds = %42
%46 = load float*, float** %7
%47 = load float*, float** %8
%48 = call i32 @ttest(float* %46, i32 1024, float* %47, i32 512, float* %6, float* %5)
%49 = load i32, i32* %3
%50 = sub nsw i32 %49, 1
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 2.000000e-02
%53 = load float, float* %6
%54 = fpext float %53 to double
%55 = load float, float* %5
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %52, double %54, double %56)
store i32 1, i32* %4
br label %58
58: ; preds = %70, %45
%59 = load i32, i32* %4
%60 = icmp sle i32 %59, 1024
br i1 %60, label %61, label %73
61: ; preds = %58
%62 = load float*, float** %7
%63 = load i32, i32* %4
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds float, float* %62, i64 %64
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = fadd double %67, 2.000000e-02
%69 = fptrunc double %68 to float
store float %69, float* %65
br label %70
70: ; preds = %61
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %58
73: ; preds = %58
br label %74
74: ; preds = %73
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %42
77: ; preds = %42
%78 = load float*, float** %8
%79 = call i32 @free_vector(float* %78, i32 1, i32 512)
%80 = load float*, float** %7
%81 = call i32 @free_vector(float* %80, i32 1, i32 1024)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%6s %8s %16s\0A\00"
@.str.1 = [6 x i8] c"shift\00"
@.str.2 = [2 x i8] c"t\00"
@.str.3 = [12 x i8] c"probability\00"
@.str.4 = [21 x i8] c"%6.2f %10.2f %10.2f\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca float
%3 = alloca float
%4 = bitcast i64* %1 to i8*
store i64 -5, i64* %1
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call float* @vector(i32 1, i32 1024)
%8 = tail call float* @vector(i32 1, i32 512)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %0, %10
%11 = phi i64 [ 1, %0 ], [ %15, %10 ]
%12 = call i32 @gasdev(i64* %1)
%13 = sitofp i32 %12 to float
%14 = getelementptr inbounds float, float* %7, i64 %11
store float %13, float* %14
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, 1025
br i1 %16, label %17, label %10
17: ; preds = %10, %17
%18 = phi i64 [ %24, %17 ], [ 1, %10 ]
%19 = call i32 @gasdev(i64* %1)
%20 = sitofp i32 %19 to double
%21 = fadd double %20, 1.000000e-01
%22 = fptrunc double %21 to float
%23 = getelementptr inbounds float, float* %8, i64 %18
store float %22, float* %23
%24 = add nuw nsw i64 %18, 1
%25 = icmp eq i64 %24, 513
br i1 %25, label %26, label %17
26: ; preds = %17, %71
%27 = phi i32 [ %72, %71 ], [ 1, %17 ]
%28 = call i32 @ttest(float* %7, i32 1024, float* %8, i32 512, float* %3, float* %2)
%29 = add nsw i32 %27, -1
%30 = sitofp i32 %29 to double
%31 = fmul double %30, 2.000000e-02
%32 = load float, float* %3
%33 = fpext float %32 to double
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %31, double %33, double %35)
br label %37
37: ; preds = %37, %26
%38 = phi i64 [ 0, %26 ], [ %69, %37 ]
%39 = or i64 %38, 1
%40 = getelementptr inbounds float, float* %7, i64 %39
%41 = bitcast float* %40 to <4 x float>*
%42 = load <4 x float>, <4 x float>* %41
%43 = getelementptr inbounds float, float* %40, i64 4
%44 = bitcast float* %43 to <4 x float>*
%45 = load <4 x float>, <4 x float>* %44
%46 = fpext <4 x float> %42 to <4 x double>
%47 = fpext <4 x float> %45 to <4 x double>
%48 = fadd <4 x double> %46, <double 2.000000e-02, double 2.000000e-02, double 2.000000e-02, double 2.000000e-02>
%49 = fadd <4 x double> %47, <double 2.000000e-02, double 2.000000e-02, double 2.000000e-02, double 2.000000e-02>
%50 = fptrunc <4 x double> %48 to <4 x float>
%51 = fptrunc <4 x double> %49 to <4 x float>
%52 = bitcast float* %40 to <4 x float>*
store <4 x float> %50, <4 x float>* %52
%53 = bitcast float* %43 to <4 x float>*
store <4 x float> %51, <4 x float>* %53
%54 = or i64 %38, 9
%55 = getelementptr inbounds float, float* %7, i64 %54
%56 = bitcast float* %55 to <4 x float>*
%57 = load <4 x float>, <4 x float>* %56
%58 = getelementptr inbounds float, float* %55, i64 4
%59 = bitcast float* %58 to <4 x float>*
%60 = load <4 x float>, <4 x float>* %59
%61 = fpext <4 x float> %57 to <4 x double>
%62 = fpext <4 x float> %60 to <4 x double>
%63 = fadd <4 x double> %61, <double 2.000000e-02, double 2.000000e-02, double 2.000000e-02, double 2.000000e-02>
%64 = fadd <4 x double> %62, <double 2.000000e-02, double 2.000000e-02, double 2.000000e-02, double 2.000000e-02>
%65 = fptrunc <4 x double> %63 to <4 x float>
%66 = fptrunc <4 x double> %64 to <4 x float>
%67 = bitcast float* %55 to <4 x float>*
store <4 x float> %65, <4 x float>* %67
%68 = bitcast float* %58 to <4 x float>*
store <4 x float> %66, <4 x float>* %68
%69 = add nuw nsw i64 %38, 16
%70 = icmp eq i64 %69, 1024
br i1 %70, label %71, label %37
71: ; preds = %37
%72 = add nuw nsw i32 %27, 1
%73 = icmp eq i32 %72, 12
br i1 %73, label %74, label %26
74: ; preds = %71
%75 = call i32 @free_vector(float* %8, i32 1, i32 512)
%76 = call i32 @free_vector(float* %7, i32 1, i32 1024)
ret i32 0
}