// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0xb8, %rdi
callq 0xfb80
movl $0x0, -0x14(%rbp)
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
callq 0xeb10
movl %eax, %ecx
movl -0x3c(%rbp), %eax
cmpl %ecx, %eax
jge 0xe931
movq -0x38(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xea20
movq -0x38(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0x14(%rbp), %esi
callq 0xea90
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x43e0
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x38(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %esi
callq 0xea90
movl %eax, %ecx
movl -0x40(%rbp), %eax
cmpl %ecx, %eax
jge 0xe7ef
movq -0x38(%rbp), %rdi
callq 0xe940
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x43e0
movq %rax, %rdx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe7a5
movl $0x0, -0x28(%rbp)
movq -0x38(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x14(%rbp), %esi
callq 0xea90
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jge 0xe85c
movl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, -0x48(%rbp)
callq 0xe940
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jge 0xe84f
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xe818
jmp 0xe851
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe7f6
movl $0x0, -0x10(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, -0x54(%rbp)
callq 0xe940
movq -0x38(%rbp), %rdi
movl %eax, %ecx
movl -0x54(%rbp), %eax
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x14(%rbp), %esi
callq 0xea90
movl -0x50(%rbp), %ecx
movl %eax, %edx
movl -0x4c(%rbp), %eax
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xe90f
movq -0x38(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x58(%rbp)
callq 0xe940
movl %eax, %ecx
movl -0x58(%rbp), %eax
subl -0x30(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0xe8ff
movq -0x20(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x10(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xe901
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xe86a
movq -0x38(%rbp), %rdi
addq $0xb8, %rdi
leaq -0x20(%rbp), %rsi
callq 0xfba0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe757
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)