// File: millanek[P]evo/./process_vcf_stats_utils.h
// Function: double jackknive_std_err<std::vector<double, std::allocator<double>>>(std::vector<double, std::allocator<double>>&)
double jackknive_std_err(T& vector) {
    std::vector<double> jackkniveAverages;
    std::vector<double> JregionDs; JregionDs.resize(vector.size()-1);
    for (std::vector<double>::size_type i = 0; i != vector.size(); i++) {
        // std::cerr << "copying " << i << std::endl;
        copy_except(i, vector, JregionDs);
        jackkniveAverages.push_back(vector_average(JregionDs));
        JregionDs.clear(); JregionDs.resize(vector.size()-1);
    }
    double jackkniveOverallMean = vector_average(jackkniveAverages);
    double sum = 0;
    for (int i = 0; i < jackkniveAverages.size(); i++) {
        sum += pow((jackkniveAverages[i] - jackkniveOverallMean), 2.0);
    }
    double var = ((double)(jackkniveAverages.size()-1)/(double)jackkniveAverages.size()) * sum;
    double Dstd_err = sqrt(var);
    return Dstd_err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x48410
leaq -0x38(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x48410
movq -0x8(%rbp), %rdi
callq 0x3ebf0
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x52ef0
jmp 0x522d5
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ebf0
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
je 0x523c8
movl -0x50(%rbp), %edi
movq -0x8(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x52f80
jmp 0x52316
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x53120
jmp 0x52325
leaq -0x70(%rbp), %rdi
callq 0x53060
movsd %xmm0, -0xc8(%rbp)
jmp 0x52338
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x48450
jmp 0x52354
leaq -0x70(%rbp), %rdi
callq 0x3ecb0
leaq -0x38(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x53210
movq -0x8(%rbp), %rdi
callq 0x3ebf0
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x52ef0
jmp 0x5238a
jmp 0x5238c
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x522dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x5258e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3ecb0
jmp 0x5258e
leaq -0x90(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x53120
jmp 0x523da
leaq -0x90(%rbp), %rdi
callq 0x53060
movsd %xmm0, -0xd8(%rbp)
jmp 0x523f0
leaq -0x90(%rbp), %rdi
callq 0x3ecb0
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
movl $0x0, -0x9c(%rbp)
movslq -0x9c(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3ebf0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0x524a8
movslq -0x9c(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x3ec30
movsd (%rax), %xmm0
subsd -0x78(%rbp), %xmm0
movsd 0xe1263(%rip), %xmm1    # 0x1336c8
callq 0xab30
addsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x5241e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3ecb0
jmp 0x5258e
leaq -0x20(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x3ebf0
movq -0x118(%rbp), %rdi
decq %rax
movq %rax, %xmm0
movaps 0xdbc92(%rip), %xmm1    # 0x12e160
movaps %xmm1, -0x110(%rbp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xdbc8f(%rip), %xmm1    # 0x12e170
movaps %xmm1, -0x100(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
callq 0x3ebf0
movaps -0x110(%rbp), %xmm3
movaps -0x100(%rbp), %xmm2
movsd -0xf0(%rbp), %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
mulsd -0x98(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0xa8(%rbp), %xmm0
callq 0xa480
movsd %xmm0, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3ecb0
leaq -0x20(%rbp), %rdi
callq 0x3ecb0
movsd -0xe8(%rbp), %xmm0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3ecb0
leaq -0x20(%rbp), %rdi
callq 0x3ecb0
movq -0x40(%rbp), %rdi
callq 0xab50
nopl (%rax)