// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, %r10d
movl %ecx, %r13d
movl %edx, %r8d
movq %rsi, %r11
movl %ecx, %eax
cltd
idivl %r10d
movl %eax, %ecx
leal -0x3(%r9), %ebx
movq %rdi, -0x30(%rbp)
movl 0x10(%rdi), %edi
leal -0x1(%rdi), %eax
cmpl $0x3, %r9d
cmovll %eax, %ebx
movslq 0x10(%rbp), %r14
leal -0x3(%r14), %esi
cmpq $0x3, %r14
movq (%r11), %r15
movslq %r9d, %rdx
movq (%r11,%rdx,8), %r12
cmovll %eax, %esi
movl %esi, -0x34(%rbp)
movq %r11, %rsi
movq (%r11,%r14,8), %rax
addl $0x2, %r8d
movslq %r13d, %r10
movslq %r8d, %r13
movl %ebx, -0x38(%rbp)
movl %ebx, %edx
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq %r12, -0x60(%rbp)
movq %r12, -0x48(%rbp)
movq %r9, -0x70(%rbp)
movq %r14, -0x68(%rbp)
movl %r14d, %eax
movq %r15, -0x78(%rbp)
movl %eax, %r15d
movl %r9d, %r14d
addl $-0x2, %r9d
movl %r9d, -0x3c(%rbp)
leal -0x1(%rdi), %eax
cmpl %eax, %edx
je 0x1fd7
subl %r15d, %edx
leal (%rdx,%rdi), %eax
addl $0x2, %eax
cltd
idivl %edi
movl %edx, %r8d
leal (%r8,%r15), %ebx
leal (%rdi,%rbx), %eax
addl $-0x2, %eax
cltd
idivl %edi
imull %ecx, %edx
movq %r8, -0x80(%rbp)
movl %r8d, %eax
imull %ecx, %eax
movslq %eax, %r11
movslq %edx, %rax
addq 0x8(%rsi), %rax
movq -0x50(%rbp), %rdx
leaq (%rdx,%r11), %r9
xorl %edx, %edx
leaq (%r11,%rdx), %r8
cmpq %r10, %r8
jge 0x1ebf
cmpl %ecx, %edx
jge 0x1ebf
movb (%rax,%rdx), %r8b
movb %r8b, (%r9,%rdx)
incq %rdx
jmp 0x1ea5
movabsq $0x2, %r8
cmpq %r13, %r8
jge 0x1f17
cmpq %r15, %r8
jne 0x1ed8
incq %r8
jmp 0x1ec9
movq (%rsi,%r8,8), %r12
movl %ebx, %eax
subl %r8d, %eax
movq -0x30(%rbp), %rdx
movl 0x10(%rdx), %edi
addl %edi, %eax
cltd
idivl %edi
imull %ecx, %edx
movslq %edx, %rax
xorl %edx, %edx
leaq (%r11,%rdx), %rdi
cmpq %r10, %rdi
jge 0x1ed3
cmpq %r10, %rax
jge 0x1ed3
cmpl %ecx, %edx
jge 0x1ed3
movb (%r12,%rax), %dil
xorb %dil, (%r9,%rdx)
incq %rax
incq %rdx
jmp 0x1ef5
movq -0x30(%rbp), %rax
movl 0x10(%rax), %edi
leal (%rbx,%rdi), %eax
decl %eax
cltd
idivl %edi
imull %ecx, %edx
movslq %edx, %rax
xorl %edx, %edx
movq -0x78(%rbp), %rbx
leaq (%r11,%rdx), %rdi
cmpq %r10, %rdi
jge 0x1f54
cmpq %r10, %rax
jge 0x1f54
cmpl %ecx, %edx
jge 0x1f54
movb (%rbx,%rax), %dil
xorb %dil, (%r9,%rdx)
incq %rax
incq %rdx
jmp 0x1f32
movq -0x48(%rbp), %rax
addq %r11, %rax
movabsq $0x2, %rdx
cmpq %r13, %rdx
jge 0x1f99
cmpq %r14, %rdx
jne 0x1f74
incq %rdx
jmp 0x1f65
movq (%rsi,%rdx,8), %r8
addq %r11, %r8
xorl %r9d, %r9d
leaq (%r11,%r9), %rdi
cmpq %r10, %rdi
jge 0x1f6f
cmpl %ecx, %r9d
jge 0x1f6f
movb (%r8,%r9), %dil
xorb %dil, (%rax,%r9)
incq %r9
jmp 0x1f7e
leaq (%rbx,%r11), %rdx
xorl %r8d, %r8d
movl -0x3c(%rbp), %r9d
leaq (%r11,%r8), %rdi
cmpq %r10, %rdi
jge 0x1fbf
cmpl %ecx, %r8d
jge 0x1fbf
movb (%rdx,%r8), %dil
xorb %dil, (%rax,%r8)
incq %r8
jmp 0x1fa4
movq -0x80(%rbp), %rdx
addl %r9d, %edx
movq -0x30(%rbp), %rax
movl 0x10(%rax), %edi
movl %edx, %eax
cltd
idivl %edi
jmp 0x1e5d
cmpl $0x3, %r14d
movl %edi, %eax
movl $0x0, %edx
cmovgel %edx, %eax
leal -0x3(%r14,%rax), %r8d
movl -0x34(%rbp), %eax
movl %eax, %edx
movq -0x60(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rax
movl %eax, %r9d
movq -0x70(%rbp), %rax
cmpl %r8d, -0x38(%rbp)
je 0x1e4f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq