// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x10, %rsp
movl %r9d, %r11d
movl %edx, %r9d
movslq 0x10(%rbp), %rbx
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %r10d
leal -0x3(%r11), %edx
movq %rdi, -0x48(%rbp)
movl 0x10(%rdi), %eax
movq %rax, -0x58(%rbp)
decl %eax
cmpl $0x3, %r11d
cmovll %eax, %edx
leal -0x3(%rbx), %edi
cmpq $0x3, %rbx
cmovll %eax, %edi
movl %edi, -0x5c(%rbp)
leal 0x2(%r9), %eax
cmpl $0x4, %eax
movl $0x3, %r12d
cmovgel %eax, %r12d
movq (%rsi), %r14
movslq %r11d, %rax
movq (%rsi,%rax,8), %r13
movq %rsi, -0x40(%rbp)
movq (%rsi,%rbx,8), %r8
movl %ecx, -0x30(%rbp)
movslq %ecx, %r15
movl %edx, -0x60(%rbp)
movq %r8, -0x70(%rbp)
movq %r13, -0x78(%rbp)
movq %r11, -0x88(%rbp)
movq %rbx, -0x80(%rbp)
movq %rbx, -0x38(%rbp)
movq -0x58(%rbp), %rbx
movq %r9, -0xa0(%rbp)
movq %r14, -0x98(%rbp)
leal -0x1(%rbx), %eax
cmpl %eax, %edx
movq %r11, -0x90(%rbp)
je 0x2197
leal -0x2(%r11), %eax
movl %eax, -0x64(%rbp)
movl -0x38(%rbp), %eax
movq %rax, -0x58(%rbp)
movl %r11d, %eax
movq %rax, -0xb8(%rbp)
testl %r10d, %r10d
setg %dil
movq -0x38(%rbp), %rcx
subl %ecx, %edx
leal (%rdx,%rbx), %eax
addl $0x2, %eax
cltd
idivl %ebx
leal (%rdx,%rcx), %eax
movq %rax, -0x50(%rbp)
movq %rdx, -0xa8(%rbp)
movl %edx, %esi
imull %r10d, %esi
cmpl -0x30(%rbp), %esi
setl %al
andb %dil, %al
movslq %esi, %r11
movb %al, -0x29(%rbp)
cmpb $0x1, %al
jne 0x1fed
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x50(%rbp), %rax
addl %ebx, %eax
addl $-0x2, %eax
cltd
idivl %ebx
imull %r10d, %edx
movslq %edx, %rax
addq %rdi, %rax
leaq 0x1(%r11), %rdx
movl $0x1, %edi
movb -0x1(%rax,%rdi), %bl
movb %bl, -0x1(%r8,%rdx)
cmpq %r15, %rdx
jge 0x1fed
incq %rdx
leaq 0x1(%rdi), %rbx
cmpl %r10d, %edi
movq %rbx, %rdi
jl 0x1fd0
testl %r9d, %r9d
jle 0x2086
leaq 0x1(%r11), %rax
movq %rax, -0xb0(%rbp)
movl $0x2, %edi
cmpq -0x58(%rbp), %rdi
je 0x207e
movl -0x30(%rbp), %r9d
cmpl %r9d, %esi
setge %bl
testl %r10d, %r10d
setle %r14b
movq -0x50(%rbp), %rax
subl %edi, %eax
movq -0x48(%rbp), %rcx
movl 0x10(%rcx), %ecx
addl %ecx, %eax
cltd
idivl %ecx
imull %r10d, %edx
cmpl %r9d, %edx
setge %al
orb %bl, %r14b
orb %al, %r14b
jne 0x207e
movq -0x40(%rbp), %rax
movq (%rax,%rdi,8), %rax
movslq %edx, %rdx
incq %rdx
movl $0x1, %ebx
movq -0xb0(%rbp), %r14
movb -0x1(%rax,%rdx), %cl
xorb %cl, -0x1(%r8,%r14)
cmpq %r15, %r14
jge 0x207e
cmpq %r15, %rdx
jge 0x207e
incq %r14
incq %rdx
leal 0x1(%rbx), %ecx
cmpl %r10d, %ebx
movl %ecx, %ebx
jl 0x205b
incq %rdi
cmpq %r12, %rdi
jne 0x2006
movl -0x30(%rbp), %r9d
cmpl %r9d, %esi
setge %cl
testl %r10d, %r10d
setle %sil
movq -0x48(%rbp), %rax
movl 0x10(%rax), %edi
movq -0x50(%rbp), %rax
addl %edi, %eax
decl %eax
cltd
idivl %edi
imull %r10d, %edx
cmpl %r9d, %edx
setge %al
orb %cl, %sil
orb %al, %sil
movq -0x98(%rbp), %r14
jne 0x20f5
movslq %edx, %rax
leaq 0x1(%r11), %rcx
incq %rax
movl $0x1, %edx
movb -0x1(%r14,%rax), %sil
xorb %sil, -0x1(%r8,%rcx)
cmpq %r15, %rcx
jge 0x20f5
cmpq %r15, %rax
jge 0x20f5
incq %rcx
incq %rax
leal 0x1(%rdx), %esi
cmpl %r10d, %edx
movl %esi, %edx
jl 0x20d1
movq -0xa0(%rbp), %r9
testl %r9d, %r9d
jle 0x214c
leaq 0x1(%r11), %rax
movl $0x2, %ecx
cmpq -0xb8(%rbp), %rcx
je 0x2144
cmpb $0x0, -0x29(%rbp)
je 0x2144
movq -0x40(%rbp), %rdx
movq (%rdx,%rcx,8), %rdx
movl $0x1, %esi
movq %rax, %rdi
movb -0x1(%rdx,%rdi), %bl
xorb %bl, -0x1(%r13,%rdi)
cmpq %r15, %rdi
jge 0x2144
incq %rdi
leal 0x1(%rsi), %ebx
cmpl %r10d, %esi
movl %ebx, %esi
jl 0x2129
incq %rcx
cmpq %r12, %rcx
jne 0x210a
cmpb $0x0, -0x29(%rbp)
je 0x2176
incq %r11
movl $0x1, %eax
movb -0x1(%r14,%r11), %cl
xorb %cl, -0x1(%r13,%r11)
cmpq %r15, %r11
jge 0x2176
incq %r11
leal 0x1(%rax), %ecx
cmpl %r10d, %eax
movl %ecx, %eax
jl 0x215a
movq -0xa8(%rbp), %rcx
addl -0x64(%rbp), %ecx
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ebx
movl %ecx, %eax
cltd
idivl %ebx
leal -0x1(%rbx), %eax
cmpl %eax, %edx
jne 0x1f6c
movq -0x90(%rbp), %rdx
cmpl $0x3, %edx
movl %ebx, %eax
movl $0x0, %ecx
cmovgel %ecx, %eax
leal -0x3(%rdx,%rax), %eax
movl -0x5c(%rbp), %ecx
movl %ecx, %edx
movq -0x78(%rbp), %r8
movq -0x70(%rbp), %r13
movq -0x80(%rbp), %rcx
movl %ecx, %r11d
movq -0x88(%rbp), %rcx
movq %rcx, -0x38(%rbp)
cmpl %eax, -0x60(%rbp)
je 0x1f42
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq