// File: /workspace/github_cpp_makefile_star2_O1/ekg[P]tsvtools/tsvbootstrap.cpp
// Function: subsetavg(std::vector<std::vector<double, std::allocator<double>>*, std::allocator<std::vector<double, std::allocator<double>>*>>&)
vector<double> subsetavg(vector<vector<double>* >& subset) {

    vector<double> sums;
    vector<int> counts;

    vector<vector<double>* >::iterator s = subset.begin();
    for (int i = 0; i < (*s)->size(); ++i) {
        sums.push_back((*s)->at(i));
        counts.push_back(1);
    }
    ++s;

    for (; s != subset.end(); ++s) {
        const vector<double>& record = **s;
        for (int i = 0; i < record.size(); ++i) {
            sums.at(i) += record.at(i);
            ++counts.at(i);
        }
    }

    vector<double> results;
    for (int i = 0; i < counts.size(); ++i) {
        if (counts.at(i) != 0) {
            results.push_back(sums.at(i) / counts.at(i));
        } else {
            results.push_back(0);
        }
    }

    return results;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x30(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movapd %xmm0, (%rsp)
movq %rsi, 0x40(%rsp)
movq (%rsi), %rbp
movq (%rbp), %rax
movq (%rax), %rdx
cmpq %rdx, 0x8(%rax)
je 0x2945
xorl %r14d, %r14d
movq %rsp, %r12
leaq 0x18(%rsp), %r13
xorl %r15d, %r15d
addq %r14, %rdx
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x28ed
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x28f7
leaq 0x20(%rsp), %rdi
callq 0x3774
movl $0x1, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x291c
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x2927
movq %r12, %rdi
movq %r13, %rdx
callq 0x38b4
incq %r15
movq (%rbp), %rax
movq (%rax), %rdx
movq 0x8(%rax), %rax
subq %rdx, %rax
sarq $0x3, %rax
addq $0x8, %r14
cmpq %r15, %rax
ja 0x28cb
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
je 0x29cc
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq (%rbp), %rsi
movq (%rsi), %rdi
movq 0x8(%rsi), %r8
subq %rdi, %r8
je 0x29c3
sarq $0x3, %r8
movq (%rsp), %r10
movq 0x8(%rsp), %r9
subq %r10, %r9
sarq $0x2, %r9
cmpq $0x1, %r8
adcq $0x0, %r8
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x2ad3
movsd (%rdi,%rsi,8), %xmm0
addsd (%rcx,%rsi,8), %xmm0
movsd %xmm0, (%rcx,%rsi,8)
cmpq %rsi, %r9
je 0x2ad0
incl (%r10,%rsi,4)
incq %rsi
cmpq %rsi, %r8
jne 0x2996
addq $0x8, %rbp
cmpq %rax, %rbp
jne 0x2968
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x2a95
xorl %r14d, %r14d
leaq 0x18(%rsp), %r15
cmpl $0x0, (%rdi,%r14,4)
je 0x2a3d
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x2ae1
movsd (%rax,%r14,8), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl (%rdi,%r14,4), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2a61
movsd %xmm0, (%rsi)
jmp 0x2a57
movq $0x0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2a6e
movq $0x0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2a79
movq %rbx, %rdi
movq %r15, %rdx
callq 0x39f0
jmp 0x2a79
movq %rbx, %rdi
movq %r15, %rdx
callq 0x39f0
incq %r14
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %r14, %rax
ja 0x29f3
testq %rdi, %rdi
je 0x2aa7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2abe
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, %rdx
leaq 0x2739(%rip), %rdi      # 0x5213
xorl %eax, %eax
callq 0x2260
leaq 0x272b(%rip), %rdi      # 0x5213
movq %r14, %rsi
xorl %eax, %eax
callq 0x2260
jmp 0x2afa
jmp 0x2afa
jmp 0x2b13
jmp 0x2b13
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2b16
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x2b16
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2b2c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2b43
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x2300