// File: UCBASiCS[P]SPRIGHT/src/customizedinput.cpp
// Function: CustomizedInput::findNeededSamples(std::vector<int, std::allocator<int>>)
void CustomizedInput::findNeededSamples(std::vector<int> delays)
{

    int signalBitLength = config->getSignalBitLength();
    for (int c = 0; c < config->getBinsNb(); c++)
    {
        int binIndices = config->getSamplingPattern(c);

        int b = config->getBinNumIndices(c);
        int B = pow(2,b); // number of bins in stage

        for (int delayIndex = 0; delayIndex < config->getDelaysNb(); delayIndex++)
        {
            int currDelay = delays[delayIndex];

            std::vector<ffast_complex> binTimeDomain = std::vector<ffast_complex>(B);
            for (int bin_iter = 0; bin_iter < B; bin_iter++)
            {
                int mlInt = mapToInt(bin_iter, b, binIndices, signalBitLength);
                int signalIndex = currDelay ^ mlInt;

                neededSamples.insert(signalIndex);
            }
        }     
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rsi, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rax), %rdi
callq 0xe940
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x80(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, -0x8c(%rbp)
movq 0x10(%rax), %rdi
callq 0xeb10
movl %eax, %ecx
movl -0x8c(%rbp), %eax
cmpl %ecx, %eax
jge 0x11f2f
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %esi
callq 0xea20
movl %eax, %ecx
movq -0x80(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %esi
callq 0xea90
movl %eax, -0x20(%rbp)
cvtsi2sdl -0x20(%rbp), %xmm1
movsd 0xe2e0(%rip), %xmm0     # 0x200b0
callq 0x4530
cvttsd2si %xmm0, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x80(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, -0x90(%rbp)
movq 0x10(%rax), %rdi
callq 0xeb30
movl %eax, %ecx
movl -0x90(%rbp), %eax
cmpl %ecx, %eax
jge 0x11f1f
movq -0x88(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x5d60
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movslq -0x24(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x12120
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x12140
jmp 0x11e52
leaq -0x49(%rbp), %rdi
callq 0x121b0
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x11f08
movl -0x60(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x14(%rbp), %ecx
callq 0xa1b0
movl %eax, -0xa4(%rbp)
jmp 0x11e87
movq -0x80(%rbp), %rdi
movl -0xa4(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x2c(%rbp), %eax
movl -0x64(%rbp), %ecx
xorl %ecx, %eax
movl %eax, -0x68(%rbp)
addq $0x50, %rdi
leaq -0x68(%rbp), %rsi
callq 0x11fe0
movb %dl, -0xb1(%rbp)
movq %rax, -0xb0(%rbp)
jmp 0x11ebb
movb -0xb1(%rbp), %al
movq -0xb0(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movb %al, -0x70(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x11e62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x121b0
jmp 0x11f38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x121d0
jmp 0x11f38
leaq -0x48(%rbp), %rdi
callq 0x121d0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x11de3
jmp 0x11f21
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x11d75
addq $0xc0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x4540
nopw %cs:(%rax,%rax)