// File: /workspace/github_cpp_makefile_star2_O2/UCBASiCS[P]SPRIGHT/src/config.cpp
// Function: Config::setBinOffsetsAndBinsSum()
void Config::setBinOffsetsAndBinsSum()
{
    if (bins.size() == 0) {
        bins.clear();
        int floorThird = (int) (signalLogLength/3);
        bins.push_back(pow(2,floorThird)-1);
        if (signalLogLength % 3 == 0) {
            bins.push_back(pow(2,2*floorThird)-pow(2,floorThird));
            bins.push_back(pow(2,3*floorThird)-pow(2,2*floorThird));
        }
        if (signalLogLength % 3 == 1) {
            bins.push_back(pow(2,2*floorThird)-pow(2,floorThird));
            bins.push_back(pow(2,3*floorThird+1)-pow(2,2*floorThird));
        }
        if (signalLogLength % 3 == 2) {
            bins.push_back(pow(2,2*floorThird+1)-pow(2,floorThird));
            bins.push_back(pow(2,3*floorThird+2)-pow(2,2*floorThird+1));    
        }
    }


    binsSum = 0;
    for (unsigned int stage=0; stage<bins.size(); stage++)
    {
        binOffsets.push_back(binsSum);
        binsSum += pow(2,numOnes(bins[stage]));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq 0x30(%rdi), %rax
cmpq 0x28(%rdi), %rax
jne 0x64e1
movl 0xb0(%rbx), %eax
pushq $0x3
popq %r13
cltd
idivl %r13d
movl %eax, %r15d
movsd 0x5e20(%rip), %xmm0     # 0xc0e8
movl %eax, %edi
callq 0x33c0
addsd 0x5e19(%rip), %xmm0     # 0xc0f0
cvttsd2si %xmm0, %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x72f2
movl 0xb0(%rbx), %ecx
movl %ecx, %eax
cltd
idivl %r13d
testl %edx, %edx
jne 0x6394
leal (%r15,%r15), %ebp
movsd 0x5dde(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5dc9(%rip), %xmm0     # 0xc0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
leaq 0xc(%rsp), %r12
movl %eax, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x72f2
leal (%r15,%r15,2), %edi
movsd 0x5d93(%rip), %xmm0     # 0xc0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5d80(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, (%r12)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x72f2
movl 0xb0(%rbx), %ecx
movl %ecx, %eax
cltd
idivl %r13d
cmpl $0x1, %edx
jne 0x643b
leal (%r15,%r15), %ebp
movsd 0x5d39(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5d24(%rip), %xmm0     # 0xc0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
leaq 0xc(%rsp), %r12
movl %eax, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x72f2
leal (%r15,%r15,2), %edi
incl %edi
movsd 0x5cec(%rip), %xmm0     # 0xc0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5cd9(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, (%r12)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x72f2
movl 0xb0(%rbx), %ecx
movl %ecx, %eax
cltd
idivl %r13d
cmpl $0x2, %edx
jne 0x64e1
leal 0x1(,%r15,2), %ebp
movsd 0x5c8e(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5c79(%rip), %xmm0     # 0xc0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
leaq 0xc(%rsp), %r12
movl %eax, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x72f2
leal (%r15,%r15,2), %edi
addl $0x2, %edi
movsd 0x5c40(%rip), %xmm0     # 0xc0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x5c2d(%rip), %xmm0     # 0xc0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, (%r12)
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x72f2
andl $0x0, 0x58(%rbx)
leaq 0x58(%rbx), %r15
leaq 0x40(%rbx), %r12
xorl %eax, %eax
movl $0x33333333, %ebp       # imm = 0x33333333
movl %eax, %r13d
movq 0x30(%rbx), %rax
subq 0x28(%rbx), %rax
sarq $0x2, %rax
cmpq %r13, %rax
jbe 0x6566
movq %r12, %rdi
movq %r15, %rsi
callq 0x70b2
movq (%r14), %rax
movl (%rax,%r13,4), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl %eax, %ecx
andl %ebp, %ecx
shrl $0x2, %eax
andl %ebp, %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
addl %eax, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %eax  # imm = 0x1010101
shrl $0x18, %eax
cvtsi2sd %eax, %xmm0
callq 0x3210
cvtsi2sdl (%r15), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, (%r15)
leal 0x1(%r13), %eax
jmp 0x64f4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop