// File: /workspace/github_cpp_makefile_star2_O2/UCBASiCS[P]SPRIGHT/src/config.cpp
// Function: Config::setSubsamplingMatrices()
void Config::setSubsamplingMatrices()
{
    subsamplingMatrices.clear();
    int samplingPattern;
    int r;
    for (int stage = 0; stage < getBinsNb(); stage++) {
        samplingPattern = getSamplingPattern(stage);

        bool** subsamplingMatrix = (bool**) malloc(getBinNumIndices(stage) * sizeof(bool*));

        for (int iter=0; iter<getBinNumIndices(stage); iter++)
        {
            subsamplingMatrix[iter] = (bool*) malloc(getSignalBitLength() * sizeof(bool));
        }
        for (int r = 0; r < getBinNumIndices(stage); r++)
            for (int c = 0; c < getSignalBitLength(); c++)
                subsamplingMatrix[r][c] = 0;

        r = 0;
        for (int c = 0; c < getSignalBitLength() & r < getBinNumIndices(stage); c++) {
            if ((samplingPattern & (1 << (getSignalBitLength() - c - 1))) != 0) {

                subsamplingMatrix[r++][c] = 1;
            }
        }
        subsamplingMatrices.push_back(subsamplingMatrix);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0xb8(%rdi), %rax
cmpq %rax, 0xc0(%rdi)
je 0x659e
movq %rax, 0xc0(%rbx)
leaq 0xb8(%rbx), %rax
movq %rax, 0x10(%rsp)
movl $0x33333333, %ebp       # imm = 0x33333333
xorl %r13d, %r13d
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r13
jge 0x66f1
movl (%rax,%r13,4), %r15d
movl %r15d, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
movl %r15d, %ecx
subl %eax, %ecx
movl %ecx, %eax
andl %ebp, %eax
shrl $0x2, %ecx
andl %ebp, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
addl %ecx, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %edi  # imm = 0x1010101
shrl $0x15, %edi
andl $-0x8, %edi
callq 0x3320
movq %rax, 0x8(%rsp)
movslq 0xb0(%rbx), %r12
movl %r15d, %eax
xorl %r14d, %r14d
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
cmpq %rax, %r14
jae 0x666a
movq %r12, %rdi
callq 0x3320
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
movq 0x28(%rbx), %rax
movl (%rax,%r13,4), %eax
jmp 0x661a
movl 0xb0(%rbx), %ecx
testl %ecx, %ecx
movl $0x0, %edx
cmovlel %edx, %ecx
xorl %edx, %edx
cmpq %rax, %rdx
je 0x66a0
movq 0x8(%rsp), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x669b
movq (%rsi,%rdx,8), %r8
movb $0x0, (%r8,%rdi)
incq %rdi
jmp 0x6688
incq %rdx
jmp 0x667c
movslq 0xb0(%rbx), %rcx
movq 0x8(%rsp), %rdx
leal -0x1(%rcx), %esi
xorl %edi, %edi
xorl %r8d, %r8d
cmpl %eax, %r8d
jge 0x66da
cmpq %rcx, %rdi
jge 0x66da
btl %esi, %r15d
jae 0x66d3
movslq %r8d, %r9
incl %r8d
movq (%rdx,%r9,8), %r9
movb $0x1, (%r9,%rdi)
incq %rdi
decl %esi
jmp 0x66b4
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x70f2
incq %r13
jmp 0x65b2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq