// File: /workspace/github_cpp_makefile_star2_O3/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 0x2952
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 0x28fa
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x2904
leaq 0x20(%rsp), %rdi
callq 0x378e
movl $0x1, 0x18(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x2929
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x2934
movq %r12, %rdi
movq %r13, %rdx
callq 0x38ce
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 0x28d8
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rbp
cmpq %rax, %rbp
je 0x29dd
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movq (%rbp), %rdi
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
subq %rsi, %rdi
je 0x29d4
sarq $0x3, %rdi
movq (%rsp), %r9
movq 0x8(%rsp), %r8
subq %r9, %r8
sarq $0x2, %r8
cmpq $0x1, %rdi
adcq $0x0, %rdi
xorl %r10d, %r10d
cmpq %r10, %rdx
je 0x2ae3
movsd (%rsi,%r10,8), %xmm0
addsd (%rcx,%r10,8), %xmm0
movsd %xmm0, (%rcx,%r10,8)
cmpq %r10, %r8
je 0x2ae0
incl (%r9,%r10,4)
incq %r10
cmpq %r10, %rdi
jne 0x29a4
addq $0x8, %rbp
cmpq %rax, %rbp
jne 0x2975
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x2aa5
xorl %r14d, %r14d
leaq 0x18(%rsp), %r15
movl (%rdi,%r14,4), %eax
testl %eax, %eax
je 0x2a4d
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x2af4
movsd (%rcx,%r14,8), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2a71
movsd %xmm0, (%rsi)
jmp 0x2a67
movq $0x0, 0x18(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2a7e
movq $0x0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x2a89
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3a0a
jmp 0x2a89
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3a0a
incq %r14
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %r14, %rax
ja 0x2a04
testq %rdi, %rdi
je 0x2ab7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2ace
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 %r8, %rdx
leaq 0x2729(%rip), %rdi      # 0x5213
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2260
leaq 0x2718(%rip), %rdi      # 0x5213
movq %r14, %rsi
xorl %eax, %eax
callq 0x2260
jmp 0x2b0d
jmp 0x2b0d
jmp 0x2b26
jmp 0x2b26
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2b29
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x2b29
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2b3f
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2b56
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x2300