// File: syzcch[P]FEC_C_version/./fec_rs.h
// Function: rscode::gf_make_dispersal_matrix(int, int)
int *gf_make_dispersal_matrix(int rows, int cols)
    {
        int *vdm, i, j, k, l, inv, tmp, colindex;

        vdm = gf_make_vandermonde(rows, cols);


        for (i = 0; i < cols && i < rows; i++)
        {
            j = find_swap_row(vdm, rows, cols, i);
            if (-1 == j)
            {
                printf("Error: make_dispersal_matrix.  Can't find swap row %d\n");
            }

            if (j != i)
            {
                for (k = 0; k < cols; k++)
                {
                    tmp = vdm[j*cols+k];
                    vdm[j*cols+k] = vdm[i*cols+k];
                    vdm[i*cols+k] = tmp;
                }
            }
            if (vdm[i*cols+i] == 0)
            {
                printf("Internal error -- this shouldn't happen\n");
            }

            if (vdm[i*cols+i] != 1)
            {
                inv = gf_single_divide(1, vdm[i*cols+i]);
                k = i;
                for (j = 0; j < rows; j++)
                {
                    vdm[k] = gf_single_multiply(inv, vdm[k]);
                    k += cols;
                }

            }
            if (vdm[i*cols+i] != 1)
            {
                printf("Internal error -- this shouldn't happen #2)\n");
            }

            for (j = 0; j < cols; j++)
            {
                colindex = vdm[i*cols+j];
                if (j != i && colindex != 0)
                {
                    k = j;
                    for (l = 0; l < rows; l++)
                    {
                        vdm[k] = vdm[k] ^ gf_single_multiply(colindex, vdm[l*cols+i]);
                        k += cols;
                    }
                }
            }
        }

        return vdm;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x3b20
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x10(%rbp), %ecx
movb %al, -0x41(%rbp)
jge 0x35e9
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
setl %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x35f5
jmp 0x3832
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0x3c00
movl %eax, -0x20(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x20(%rbp), %eax
jne 0x3622
leaq 0x1a80(%rip), %rdi      # 0x509b
movb $0x0, %al
callq 0x2040
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x369c
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x369a
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x30(%rbp), %edx
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3631
jmp 0x369c
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x36c1
leaq 0x1a18(%rip), %rdi      # 0x50d2
movb $0x0, %al
callq 0x2040
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x374c
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movl $0x1, %esi
callq 0x3840
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x374a
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
callq 0x3c60
movl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x370a
jmp 0x374c
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
cmpl $0x1, (%rax,%rcx,4)
je 0x3771
leaq 0x1991(%rip), %rdi      # 0x50fb
movb $0x0, %al
callq 0x2040
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3822
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x3812
cmpl $0x0, -0x34(%rbp)
je 0x3812
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3810
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x34(%rbp), %esi
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x10(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
callq 0x3c60
movl -0x48(%rbp), %edx
xorl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x37b6
jmp 0x3812
jmp 0x3814
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3778
jmp 0x3824
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x35d0
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)