// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
movq %rax, 0x10(%rsp)
movq 0x30(%rdi), %rax
cmpq 0x28(%rdi), %rax
jne 0x695a
movslq 0xb0(%rbx), %rax
imulq $0x55555556, %rax, %r15 # imm = 0x55555556
movq %r15, %rax
shrq $0x3f, %rax
shrq $0x20, %r15
addl %eax, %r15d
movsd 0x7a7e(%rip), %xmm0     # 0xe0e8
movl %r15d, %edi
callq 0x33c0
addsd 0x7a76(%rip), %xmm0     # 0xe0f0
cvttsd2si %xmm0, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6698
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x66a7
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
movl 0xb0(%rbx), %eax
imull $0xaaaaaaab, %eax, %ecx # imm = 0xAAAAAAAB
addl $0x2aaaaaaa, %ecx       # imm = 0x2AAAAAAA
cmpl $0x55555554, %ecx       # imm = 0x55555554
ja 0x6788
leal (%r15,%r15), %ebp
movsd 0x7a17(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x7a02(%rip), %xmm0     # 0xe0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6716
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x6725
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
leal (%r15,%r15,2), %edi
movsd 0x79b7(%rip), %xmm0     # 0xe0e8
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x79a4(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6773
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x6782
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
movl 0xb0(%rbx), %eax
movslq %eax, %rcx
imulq $0x55555556, %rcx, %rdx # imm = 0x55555556
movq %rdx, %rsi
shrq $0x3f, %rsi
shrq $0x20, %rdx
addl %esi, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %ecx
cmpl $0x1, %ecx
jne 0x6872
leal (%r15,%r15), %ebp
movsd 0x792f(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x791a(%rip), %xmm0     # 0xe0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x67fe
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x680d
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
leal (%r15,%r15,2), %edi
incl %edi
movsd 0x78cd(%rip), %xmm0     # 0xe0e8
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x78ba(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x685d
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x686c
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
movl 0xb0(%rbx), %eax
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0x2, %eax
jne 0x695a
leal 0x1(,%r15,2), %ebp
movsd 0x7842(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x782d(%rip), %xmm0     # 0xe0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x68eb
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x68fa
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
leal (%r15,%r15,2), %edi
addl $0x2, %edi
movsd 0x77df(%rip), %xmm0     # 0xe0e8
callq 0x33c0
movsd %xmm0, 0x8(%rsp)
movsd 0x77cc(%rip), %xmm0     # 0xe0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0x4(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x694b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x695a
leaq 0x4(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x836c
movl $0x0, 0x58(%rbx)
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x6a1f
leaq 0x58(%rbx), %r15
leaq 0x40(%rbx), %r12
xorl %ecx, %ecx
movl $0x1, %ebp
movl $0x33333333, %r13d      # imm = 0x33333333
xorl %r14d, %r14d
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x699d
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rbx)
jmp 0x69b0
movq %r12, %rdi
movq %r15, %rdx
callq 0x824c
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r14,4), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl %eax, %ecx
andl %r13d, %ecx
shrl $0x2, %eax
andl %r13d, %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
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x3210
xorps %xmm1, %xmm1
cvtsi2sdl 0x58(%rbx), %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
movl %ecx, 0x58(%rbx)
movl %ebp, %r14d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %r14, %rdx
ja 0x6987
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq