// File: UCBASiCS[P]SPRIGHT/src/experimentinput.cpp
// Function: ExperimentInput::generateNonZeroFrequencies()
void ExperimentInput::generateNonZeroFrequencies()
{
    std::set<int> tempLocations;
    nonZeroFrequencies.clear();

    while((int) tempLocations.size() < config->getSignalSparsity())
    {
        int tempLocation = ((int) floor(config->getSignalLengthOriginal()*distribution((ffast_real) drand48(), config->getDistribution())))
                % config->getSignalLengthOriginal();
        tempLocations.insert(tempLocation);
    }

    for(auto it = tempLocations.cbegin(); it != tempLocations.cend(); ++it)
    {
        nonZeroFrequencies[*it] = std::polar(signalMagnitude, getRandomPhase());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5960
movq -0xa0(%rbp), %rdi
addq $0x88, %rdi
callq 0x5d20
leaq -0x38(%rbp), %rdi
callq 0x5cd0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movl %ecx, -0xa8(%rbp)
movq 0x10(%rax), %rdi
callq 0xe9e0
movl %eax, -0xa4(%rbp)
jmp 0x14840
movl -0xa8(%rbp), %eax
movl -0xa4(%rbp), %ecx
cmpl %ecx, %eax
jge 0x14976
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xf890
movl %eax, -0xac(%rbp)
jmp 0x1486c
movl -0xac(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xc0(%rbp)
callq 0x4290
movq -0xa0(%rbp), %rax
movsd %xmm0, -0xb8(%rbp)
movq 0x10(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0xf860
jmp 0x148a1
movq -0xa0(%rbp), %rdi
movsd -0xb8(%rbp), %xmm0
leaq -0x60(%rbp), %rsi
callq 0x153b0
movaps %xmm0, %xmm1
movsd -0xc0(%rbp), %xmm0
mulsd %xmm1, %xmm0
callq 0x4510
movq -0xa0(%rbp), %rax
cvttsd2si %xmm0, %ecx
movl %ecx, -0xc8(%rbp)
movq 0x10(%rax), %rdi
callq 0xf890
movl %eax, -0xc4(%rbp)
jmp 0x148ef
movl -0xc4(%rbp), %ecx
movl -0xc8(%rbp), %eax
cltd
idivl %ecx
movl %edx, -0xd8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x59a0
movl -0xd8(%rbp), %edx
movl %edx, -0x48(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x11fe0
movb %dl, -0xd1(%rbp)
movq %rax, -0xd0(%rbp)
jmp 0x14932
movb -0xd1(%rbp), %al
movq -0xd0(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movb %al, -0x68(%rbp)
jmp 0x14816
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x14a92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x59a0
jmp 0x14a92
leaq -0x38(%rbp), %rdi
callq 0x156e0
movq %rax, -0x78(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x15740
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x15710
testb $0x1, %al
jne 0x149a6
jmp 0x14a80
movq -0xa0(%rbp), %rdi
movq %rdi, %rax
addq $0xc0, %rax
movq %rax, -0xe8(%rbp)
callq 0x154d0
movsd %xmm0, -0xe0(%rbp)
jmp 0x149cc
movq -0xe8(%rbp), %rdi
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x15880
movsd %xmm1, -0xf8(%rbp)
movsd %xmm0, -0xf0(%rbp)
jmp 0x14a01
movq -0xa0(%rbp), %rax
movsd -0xf8(%rbp), %xmm0
movsd -0xf0(%rbp), %xmm1
movsd %xmm1, -0x90(%rbp)
movsd %xmm0, -0x88(%rbp)
addq $0x88, %rax
movq %rax, -0x108(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x15770
movq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x120f0
movq %rax, -0x100(%rbp)
jmp 0x14a56
movq -0x100(%rbp), %rax
movq -0x90(%rbp), %rcx
movq %rcx, (%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x78(%rbp), %rdi
callq 0x15790
jmp 0x14983
leaq -0x38(%rbp), %rdi
callq 0x5980
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x5980
movq -0x40(%rbp), %rdi
callq 0x4540
nopw %cs:(%rax,%rax)