// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %rsp
movq %rdi, %rbx
movq 0xb8(%rdi), %rax
cmpq %rax, 0xc0(%rdi)
je 0x6a56
movq %rax, 0xc0(%rbx)
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x6c08
leaq 0xb8(%rbx), %rcx
movq %rcx, 0x18(%rsp)
xorl %r13d, %r13d
movl $0x33333333, %ebp       # imm = 0x33333333
movq %rbx, 0x20(%rsp)
movl (%rax,%r13,4), %r14d
movl %r14d, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
movl %r14d, %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 %r14d, 0x14(%rsp)
movl %r14d, %eax
xorl %r15d, %r15d
movl %eax, %ecx
shrl %ecx
andl $0x55555555, %ecx       # imm = 0x55555555
movl %eax, %edx
subl %ecx, %edx
movl %edx, %ecx
andl %ebp, %ecx
shrl $0x2, %edx
andl %ebp, %edx
addl %ecx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
addl %edx, %ecx
andl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
imull $0x1010101, %ecx, %r14d # imm = 0x1010101
shrl $0x18, %r14d
cmpq %r14, %r15
jae 0x6b2c
movq %r12, %rdi
callq 0x3320
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x28(%rbx), %rax
movl (%rax,%r13,4), %eax
jmp 0x6ad8
testl %eax, %eax
je 0x6bb9
movl 0xb0(%rbx), %r12d
movq 0x8(%rsp), %r15
cmpl $0x1, %r14d
movl %r14d, %ebp
adcl $0x0, %ebp
xorl %ebx, %ebx
testl %r12d, %r12d
jle 0x6b5f
movq (%r15,%rbx,8), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3130
incq %rbx
cmpq %rbx, %rbp
jne 0x6b4c
movq 0x20(%rsp), %rbx
movslq 0xb0(%rbx), %rax
testq %rax, %rax
movl $0x33333333, %ebp       # imm = 0x33333333
movl 0x14(%rsp), %r9d
jle 0x6bb9
movq 0x8(%rsp), %rcx
leal -0x1(%rax), %edx
xorl %esi, %esi
movl $0x1, %edi
btl %edx, %r9d
jae 0x6ba6
movslq %esi, %r8
incl %esi
movq (%rcx,%r8,8), %r8
movb $0x1, -0x1(%r8,%rdi)
cmpl %r14d, %esi
jge 0x6bb9
decl %edx
leaq 0x1(%rdi), %r8
cmpq %rax, %rdi
movq %r8, %rdi
jb 0x6b91
movq 0xc0(%rbx), %rsi
cmpq 0xc8(%rbx), %rsi
je 0x6bdb
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0xc0(%rbx)
jmp 0x6bea
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x8448
incq %r13
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r13
jl 0x6a86
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop