#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 sqrt(float);
void ttest(float data1[], unsigned long n1, float data2[], unsigned long n2,
           float *t, float *prob) {
  void avevar(float data[], unsigned long n, float *ave, float *var);
  float betai(float a, float b, float x);
  float var1, var2, svar, df, ave1, ave2;
  avevar(data1, n1, &ave1, &var1);
  avevar(data2, n2, &ave2, &var2);
  df = n1 + n2 - 2;
  svar = ((n1 - 1) * var1 + (n2 - 1) * var2) / df;
  *t = (ave1 - ave2) / sqrt(svar * (1.0 / n1 + 1.0 / n2));
  *prob = betai(0.5 * df, 0.5, df / (df + (*t) * (*t)));
}


x86 assembly (clang, -O0):
<ttest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x44(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1030 <avevar@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x48(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1030 <avevar@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
lea    -0x2(%rax,%rcx,1),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x50(%rbp)
test   %rax,%rax
movss  %xmm0,-0x4c(%rbp)
js     11c0 <ttest+0x90>
movss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x58(%rbp)
test   %rax,%rax
movss  %xmm0,-0x54(%rbp)
js     120b <ttest+0xdb>
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x60(%rbp)
test   %rax,%rax
movss  %xmm0,-0x5c(%rbp)
js     1260 <ttest+0x130>
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x64(%rbp),%xmm2
movss  -0x68(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x40(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movaps 0xd6f(%rip),%xmm4
movq   -0x10(%rbp),%xmm3
punpckldq %xmm4,%xmm3
movapd 0xd6e(%rip),%xmm2
subpd  %xmm2,%xmm3
movaps %xmm3,%xmm1
unpckhpd %xmm3,%xmm3
addsd  %xmm1,%xmm3
movsd  0xd37(%rip),%xmm1
divsd  %xmm3,%xmm1
movq   -0x20(%rbp),%xmm3
punpckldq %xmm4,%xmm3
subpd  %xmm2,%xmm3
movaps %xmm3,%xmm2
unpckhpd %xmm3,%xmm3
addsd  %xmm2,%xmm3
movsd  0xd13(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <sqrt@plt>
movss  -0x6c(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcd0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x40(%rbp),%xmm2
movss  -0x40(%rbp),%xmm3
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm4
mulss  %xmm4,%xmm1
addss  %xmm3,%xmm1
divss  %xmm1,%xmm2
movss  0xc92(%rip),%xmm1
call   1040 <betai@plt>
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttest>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
lea    0x14(%rsp),%rdx
lea    0x1c(%rsp),%rcx
call   1030 <avevar@plt>
lea    0x10(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <avevar@plt>
lea    (%r12,%r13,1),%rax
add    $0xfffffffffffffffe,%rax
test   %rax,%rax
js     1184 <ttest+0x54>
cvtsi2ss %rax,%xmm2
jmp    1199 <ttest+0x69>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm2
addss  %xmm2,%xmm2
mov    %r13,%rax
add    $0xffffffffffffffff,%rax
js     11a9 <ttest+0x79>
cvtsi2ss %rax,%xmm0
jmp    11be <ttest+0x8e>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
mov    %r12,%rax
add    $0xffffffffffffffff,%rax
js     11ce <ttest+0x9e>
cvtsi2ss %rax,%xmm1
jmp    11e3 <ttest+0xb3>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm1
mulss  0x18(%rsp),%xmm1
mulss  0x1c(%rsp),%xmm0
addss  %xmm1,%xmm0
divss  %xmm2,%xmm0
movss  0x14(%rsp),%xmm1
subss  0x10(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
movq   %r13,%xmm1
movss  %xmm2,0xc(%rsp)
movdqa 0xde0(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xde4(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm4
unpckhpd %xmm1,%xmm4
addsd  %xmm1,%xmm4
movsd  0xddc(%rip),%xmm1
movapd %xmm1,%xmm5
divsd  %xmm4,%xmm5
movq   %r12,%xmm4
punpckldq %xmm2,%xmm4
subpd  %xmm3,%xmm4
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
addsd  %xmm4,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm5,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x8(%rsp),%xmm2
divss  %xmm0,%xmm2
movss  %xmm2,(%r15)
movss  0xd8d(%rip),%xmm1
movss  0xc(%rsp),%xmm3
movaps %xmm3,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
divss  %xmm2,%xmm3
movaps %xmm3,%xmm2
call   1040 <betai@plt>
movss  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ttest(float* %0, i64 %1, float* %2, i64 %3, float* %4, float* %5) {
%7 = alloca float*
%8 = alloca i64
%9 = alloca float*
%10 = alloca i64
%11 = alloca float*
%12 = alloca float*
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float* %0, float** %7
store i64 %1, i64* %8
store float* %2, float** %9
store i64 %3, i64* %10
store float* %4, float** %11
store float* %5, float** %12
%19 = load float*, float** %7
%20 = load i64, i64* %8
%21 = load float*, float** %9
%22 = load i64, i64* %10
%23 = load i64, i64* %8
%24 = load i64, i64* %10
%25 = add i64 %23, %24
%26 = sub i64 %25, 2
%27 = uitofp i64 %26 to float
store float %27, float* %16
%28 = load i64, i64* %8
%29 = sub i64 %28, 1
%30 = uitofp i64 %29 to float
%31 = load float, float* %13
%32 = load i64, i64* %10
%33 = sub i64 %32, 1
%34 = uitofp i64 %33 to float
%35 = load float, float* %14
%36 = fmul float %34, %35
%37 = call float @llvm.fmuladd.f32(float %30, float %31, float %36)
%38 = load float, float* %16
%39 = fdiv float %37, %38
store float %39, float* %15
%40 = load float, float* %17
%41 = load float, float* %18
%42 = fsub float %40, %41
%43 = load float, float* %15
%44 = fpext float %43 to double
%45 = load i64, i64* %8
%46 = uitofp i64 %45 to double
%47 = fdiv double 1.000000e+00, %46
%48 = load i64, i64* %10
%49 = uitofp i64 %48 to double
%50 = fdiv double 1.000000e+00, %49
%51 = fadd double %47, %50
%52 = fmul double %44, %51
%53 = fptrunc double %52 to float
%54 = call i32 @sqrt(float %53)
%55 = sitofp i32 %54 to float
%56 = fdiv float %42, %55
%57 = load float*, float** %11
store float %56, float* %57
%58 = load float, float* %16
%59 = fpext float %58 to double
%60 = fmul double 5.000000e-01, %59
%61 = fptrunc double %60 to float
%62 = load float, float* %16
%63 = load float, float* %16
%64 = load float*, float** %11
%65 = load float, float* %64
%66 = load float*, float** %11
%67 = load float, float* %66
%68 = call float @llvm.fmuladd.f32(float %65, float %67, float %63)
%69 = fdiv float %62, %68
%70 = call float @betai(float %61, float 5.000000e-01, float %69)
%71 = load float*, float** %12
store float %70, float* %71
ret void
}

LLVM IR (-O2):
define void @ttest(float* %0, i64 %1, float* %2, i64 %3, float* nocapture writeonly %4, float* nocapture writeonly %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = bitcast float* %7 to i8*
%12 = bitcast float* %8 to i8*
%13 = bitcast float* %9 to i8*
%14 = bitcast float* %10 to i8*
%15 = add i64 %1, -2
%16 = add i64 %15, %3
%17 = uitofp i64 %16 to float
%18 = add i64 %1, -1
%19 = uitofp i64 %18 to float
%20 = load float, float* %7
%21 = add i64 %3, -1
%22 = uitofp i64 %21 to float
%23 = load float, float* %8
%24 = fmul float %23, %22
%25 = call float @llvm.fmuladd.f32(float %19, float %20, float %24)
%26 = fdiv float %25, %17
%27 = load float, float* %9
%28 = load float, float* %10
%29 = fsub float %27, %28
%30 = fpext float %26 to double
%31 = uitofp i64 %1 to double
%32 = fdiv double 1.000000e+00, %31
%33 = uitofp i64 %3 to double
%34 = fdiv double 1.000000e+00, %33
%35 = fadd double %32, %34
%36 = fmul double %35, %30
%37 = fptrunc double %36 to float
%38 = call i32 @sqrt(float %37)
%39 = sitofp i32 %38 to float
%40 = fdiv float %29, %39
store float %40, float* %4
%41 = fmul float %17, 5.000000e-01
%42 = call float @llvm.fmuladd.f32(float %40, float %40, float %17)
%43 = fdiv float %17, %42
%44 = call float @betai(float %41, float 5.000000e-01, float %43)
store float %44, float* %5
ret void
}