// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x30(%rdi), %rax
cmpq 0x28(%rdi), %rax
jne 0x6a58
leaq 0x28(%rbx), %r14
movslq 0xb0(%rbx), %rax
imulq $0x55555556, %rax, %r15 # imm = 0x55555556
movq %r15, %rax
shrq $0x3f, %rax
shrq $0x20, %r15
addl %eax, %r15d
movsd 0x896b(%rip), %xmm0     # 0xf0e8
movl %r15d, %edi
callq 0x33c0
addsd 0x8963(%rip), %xmm0     # 0xf0f0
cvttsd2si %xmm0, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x67ab
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x67b8
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
imull $0xaaaaaaab, 0xb0(%rbx), %eax # imm = 0xAAAAAAAB
addl $0x2aaaaaaa, %eax       # imm = 0x2AAAAAAA
cmpl $0x55555554, %eax       # imm = 0x55555554
ja 0x688b
leal (%r15,%r15), %ebp
movsd 0x890a(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x88f5(%rip), %xmm0     # 0xf0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6823
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x6830
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
leal (%r15,%r15,2), %edi
movsd 0x88ac(%rip), %xmm0     # 0xf0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x8899(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x687e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x688b
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
movslq 0xb0(%rbx), %rax
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 $0x1, %eax
jne 0x696f
leal (%r15,%r15), %ebp
movsd 0x8828(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x8813(%rip), %xmm0     # 0xf0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6905
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x6912
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
leal (%r15,%r15,2), %edi
incl %edi
movsd 0x87c8(%rip), %xmm0     # 0xf0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x87b5(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6962
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x696f
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
movslq 0xb0(%rbx), %rax
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 0x6a58
leal 0x1(,%r15,2), %ebp
movsd 0x8740(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x872b(%rip), %xmm0     # 0xf0e8
movl %r15d, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x69ed
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x69fa
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
leal (%r15,%r15,2), %edi
addl $0x2, %edi
movsd 0x86df(%rip), %xmm0     # 0xf0e8
callq 0x33c0
movsd %xmm0, 0x10(%rsp)
movsd 0x86cc(%rip), %xmm0     # 0xf0e8
movl %ebp, %edi
callq 0x33c0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl %eax, 0xc(%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x6a4b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x6a58
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x8496
movl $0x0, 0x58(%rbx)
movq 0x30(%rbx), %rax
cmpq 0x28(%rbx), %rax
je 0x6b17
leaq 0x58(%rbx), %r14
leaq 0x40(%rbx), %r15
movl $0x1, %ebp
xorl %r13d, %r13d
movl $0x33333333, %r12d      # imm = 0x33333333
movq 0x48(%rbx), %rsi
cmpq 0x50(%rbx), %rsi
je 0x6a9c
movl 0x58(%rbx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%rbx)
jmp 0x6aa7
movq %r15, %rdi
movq %r14, %rdx
callq 0x8376
movq 0x28(%rbx), %rax
movl (%rax,%r13,4), %eax
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
subl %ecx, %eax
movl %eax, %ecx
andl %r12d, %ecx
shrl $0x2, %eax
andl %r12d, %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, %eax
movl %eax, 0x58(%rbx)
movq 0x30(%rbx), %rax
subq 0x28(%rbx), %rax
movl %ebp, %r13d
sarq $0x2, %rax
incl %ebp
cmpq %r13, %rax
ja 0x6a83
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq