// File: syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::rdp_decoding_rd(char**, int, int, int, int, int)
void rdp_decoding_rd(char * g_data[], int disks, int stripe_unit_size, int w,int x,int y)
    {
        int packet_size = stripe_unit_size / w;
        int ccount = 0;
        int count = 0;
        int rcount = 0;
        char *rdata, *xdata, *ydata, *row_data, *diag_data;
        int g, gx, gy,coffset,i,j,k,c;
        int row_disk, diag_disk;

        rcount=stripe_unit_size;

        rdata=g_data[0];
        xdata=g_data[x];
        ydata=g_data[y];
        gx = (x >= 3 ? x - 3 : pnumRdp - 1);
        gy = (y >= 3 ? y - 3 : pnumRdp - 1);
        row_disk = x;
        diag_disk = y;
        row_data = xdata;
        diag_data = ydata;
        g=gx;

        while(1)
        {
            if(g == pnumRdp - 1)
            {
                if(gx == (row_disk >= 3 ? row_disk - 3 : row_disk + pnumRdp - 3))
                {
                    row_disk = y;
                    diag_disk = x;
                    row_data = ydata;
                    diag_data = xdata;
                    g = gy;
                    continue;
                }
                else
                    break;
            }
            else
            {
                int  row_index;
                char*  cdata;
                int diag_count;
                int row_count;
                diag_count=stripe_unit_size;
                row_count=stripe_unit_size;
                row_index = (g - diag_disk + pnumRdp + 2) % pnumRdp;
                coffset = (row_index + diag_disk - 2 + pnumRdp) % pnumRdp * packet_size;
                cdata=g_data[1];

                for(i = row_index * packet_size, j = coffset, k = 0; i < diag_count &&k < packet_size; i++, j++, k++)
                {
                    diag_data[i] = cdata[j];
                }

                for(c = 2; c < (disks+2); c++)
                {
                    if(c == diag_disk)
                        continue;
                    ccount=stripe_unit_size;

                    cdata = g_data[c];
                    coffset = (row_index + diag_disk - c + pnumRdp)
                              % pnumRdp * packet_size;

                    for(i = row_index * packet_size, j = coffset, k = 0; i < diag_count && j < ccount &&k < packet_size; i++, j++, k++)
                    {
                        diag_data[i] ^=  cdata[j];
                    }
                }

                ccount = rcount;
                cdata = rdata;
                coffset = (row_index + diag_disk - 1 + pnumRdp)
                          % pnumRdp * packet_size;

                for(i = row_index * packet_size, j = coffset, k = 0; i < diag_count && j < ccount &&k < packet_size; i++, j++, k++)
                {
                    diag_data[i] ^=  cdata[j];
                }

                //row_parity calculate
                coffset = row_index * packet_size;
                for(c = 2; c < (disks+2); c++)
                {
                    if(c == row_disk)
                        continue;

                    ccount=stripe_unit_size;

                    cdata = g_data[c];
                    coffset = row_index * packet_size;
                    for(i = coffset, k = 0; i < ccount &&k < packet_size; i++, k++)
                    {
                        row_data[i] ^= cdata[i];
                    }

                }
                cdata = rdata;
                coffset = row_index * packet_size;
                count = row_count;

                for(i = coffset, k = 0; i < count &&  k < packet_size; i++, k++)
                {
                    row_data[i] ^= cdata[i];
                }

                //calculate the next g
                g = (row_index + row_disk - 2) % pnumRdp;

            }
        }

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x38, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x18(%rbp), %eax
cltd
idivl -0x1c(%rbp)
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq 0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
cmpl $0x3, -0x20(%rbp)
jl 0x3a50
movl -0x20(%rbp), %eax
subl $0x3, %eax
movl %eax, -0xa4(%rbp)
jmp 0x3a63
movq -0xa0(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x60(%rbp)
cmpl $0x3, 0x10(%rbp)
jl 0x3a80
movl 0x10(%rbp), %eax
subl $0x3, %eax
movl %eax, -0xa8(%rbp)
jmp 0x3a93
movq -0xa0(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl 0x10(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0xa0(%rbp), %rcx
movl -0x5c(%rbp), %eax
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x3b3e
movl -0x60(%rbp), %eax
movl %eax, -0xac(%rbp)
cmpl $0x3, -0x7c(%rbp)
jl 0x3aef
movl -0x7c(%rbp), %eax
subl $0x3, %eax
movl %eax, -0xb0(%rbp)
jmp 0x3b05
movq -0xa0(%rbp), %rcx
movl -0x7c(%rbp), %eax
addl 0x10(%rcx), %eax
subl $0x3, %eax
movl %eax, -0xb0(%rbp)
movl -0xac(%rbp), %eax
movl -0xb0(%rbp), %ecx
cmpl %ecx, %eax
jne 0x3b39
movl 0x10(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x3abe
jmp 0x3f5f
movq -0xa0(%rbp), %rcx
movl -0x18(%rbp), %eax
movl %eax, -0x94(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x5c(%rbp), %eax
subl -0x80(%rbp), %eax
addl 0x10(%rcx), %eax
addl $0x2, %eax
cltd
idivl 0x10(%rcx)
movl %edx, -0x84(%rbp)
movl -0x84(%rbp), %eax
addl -0x80(%rbp), %eax
subl $0x2, %eax
addl 0x10(%rcx), %eax
cltd
idivl 0x10(%rcx)
imull -0x24(%rbp), %edx
movl %edx, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x94(%rbp), %ecx
movb %al, -0xb1(%rbp)
jge 0x3bd2
movl -0x74(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0xb1(%rbp)
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x3bde
jmp 0x3c14
movq -0x90(%rbp), %rax
movslq -0x70(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x58(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3bb0
movl $0x2, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x3d18
movl -0x78(%rbp), %eax
cmpl -0x80(%rbp), %eax
jne 0x3c39
jmp 0x3d0a
movq -0xa0(%rbp), %rcx
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movslq -0x78(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %eax
addl -0x80(%rbp), %eax
subl -0x78(%rbp), %eax
addl 0x10(%rcx), %eax
cltd
idivl 0x10(%rcx)
imull -0x24(%rbp), %edx
movl %edx, -0x68(%rbp)
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x94(%rbp), %ecx
movb %al, -0xb2(%rbp)
jge 0x3cbf
movl -0x70(%rbp), %ecx
xorl %eax, %eax
cmpl -0x28(%rbp), %ecx
movb %al, -0xb2(%rbp)
jge 0x3cbf
movl -0x74(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0xb2(%rbp)
movb -0xb2(%rbp), %al
testb $0x1, %al
jne 0x3ccb
jmp 0x3d08
movq -0x90(%rbp), %rax
movslq -0x70(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movq -0x58(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3c8d
jmp 0x3d0a
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x3c1b
movq -0xa0(%rbp), %rcx
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %eax
addl -0x80(%rbp), %eax
subl $0x1, %eax
addl 0x10(%rcx), %eax
cltd
idivl 0x10(%rcx)
imull -0x24(%rbp), %edx
movl %edx, -0x68(%rbp)
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x94(%rbp), %ecx
movb %al, -0xb3(%rbp)
jge 0x3d96
movl -0x70(%rbp), %ecx
xorl %eax, %eax
cmpl -0x28(%rbp), %ecx
movb %al, -0xb3(%rbp)
jge 0x3d96
movl -0x74(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0xb3(%rbp)
movb -0xb3(%rbp), %al
testb $0x1, %al
jne 0x3da2
jmp 0x3ddf
movq -0x90(%rbp), %rax
movslq -0x70(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movq -0x58(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3d64
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x68(%rbp)
movl $0x2, -0x78(%rbp)
movl -0x78(%rbp), %eax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x3eb3
movl -0x78(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0x3e11
jmp 0x3ea5
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movslq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x28(%rbp), %ecx
movb %al, -0xb4(%rbp)
jge 0x3e63
movl -0x74(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0xb4(%rbp)
movb -0xb4(%rbp), %al
testb $0x1, %al
jne 0x3e6f
jmp 0x3ea3
movq -0x90(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3e44
jmp 0x3ea5
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x3df3
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x84(%rbp), %eax
imull -0x24(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x74(%rbp)
movl -0x6c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x2c(%rbp), %ecx
movb %al, -0xb5(%rbp)
jge 0x3f00
movl -0x74(%rbp), %eax
cmpl -0x24(%rbp), %eax
setl %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %al
testb $0x1, %al
jne 0x3f0c
jmp 0x3f40
movq -0x90(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %esi
movq -0x50(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movsbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3ee1
movq -0xa0(%rbp), %rcx
movl -0x84(%rbp), %eax
addl -0x7c(%rbp), %eax
subl $0x2, %eax
cltd
idivl 0x10(%rcx)
movl %edx, -0x5c(%rbp)
jmp 0x3abe
addq $0x38, %rsp
popq %rbp
retq