// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movl %ecx, %r11d
movl %edx, %ebx
movslq 0x10(%rbp), %r14
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %r10d
leal -0x3(%r9), %edx
movq %rdi, -0x38(%rbp)
movl 0x10(%rdi), %eax
decl %eax
cmpl $0x3, %r9d
cmovll %eax, %edx
leal -0x3(%r14), %edi
cmpq $0x3, %r14
movq (%rsi), %rcx
movq %rcx, -0x60(%rbp)
movslq %r9d, %rcx
movq (%rsi,%rcx,8), %r15
cmovll %eax, %edi
movl %edi, -0x4c(%rbp)
movq %rbx, -0x68(%rbp)
leal 0x2(%rbx), %eax
cmpl $0x4, %eax
movl $0x3, %r13d
cmovgel %eax, %r13d
movq %rsi, -0x48(%rbp)
movq (%rsi,%r14,8), %r12
movslq %r11d, %r8
movl %edx, -0x50(%rbp)
movq %r12, -0x70(%rbp)
movq %r15, -0x78(%rbp)
movq %r9, -0x88(%rbp)
movl %r9d, %esi
movl %r11d, %r9d
movq %r14, -0x80(%rbp)
movq %r14, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edi
leal -0x1(%rdi), %eax
cmpl %eax, %edx
movq %rsi, -0x90(%rbp)
je 0x21a3
leal -0x2(%rsi), %eax
movl %eax, -0x54(%rbp)
movl -0x40(%rbp), %eax
movq %rax, -0xb0(%rbp)
movl %esi, %eax
movq %rax, -0xa8(%rbp)
testl %r10d, %r10d
setle %cl
movq -0x40(%rbp), %rsi
subl %esi, %edx
leal (%rdx,%rdi), %eax
addl $0x2, %eax
cltd
idivl %edi
addl %edx, %esi
movq %rdx, -0x98(%rbp)
imull %r10d, %edx
cmpl %r9d, %edx
setge %al
orb %cl, %al
movl %edx, -0x2c(%rbp)
movslq %edx, %r11
jne 0x1fe7
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rcx
leal (%rdi,%rsi), %eax
addl $-0x2, %eax
cltd
idivl %edi
imull %r10d, %edx
movslq %edx, %rax
addq %rcx, %rax
leaq 0x1(%r11), %rcx
movl $0x1, %edx
movb -0x1(%rax,%rdx), %dil
movb %dil, -0x1(%r12,%rcx)
cmpq %r8, %rcx
jge 0x1fe7
incq %rcx
leaq 0x1(%rdx), %rdi
cmpl %r10d, %edx
movq %rdi, %rdx
jl 0x1fc9
cmpl $0x0, -0x68(%rbp)
jle 0x2086
leaq 0x1(%r11), %rax
movq %rax, -0xa0(%rbp)
movl $0x2, %edi
cmpq -0xb0(%rbp), %rdi
je 0x207a
cmpl %r9d, -0x2c(%rbp)
setge %cl
testl %r10d, %r10d
setle %r14b
movl %esi, %eax
subl %edi, %eax
movq -0x38(%rbp), %rdx
movl 0x10(%rdx), %ebx
addl %ebx, %eax
cltd
idivl %ebx
imull %r10d, %edx
cmpl %r9d, %edx
setge %al
orb %cl, %r14b
orb %al, %r14b
jne 0x207a
movq -0x48(%rbp), %rax
movq (%rax,%rdi,8), %rax
movslq %edx, %rdx
incq %rdx
movl $0x1, %r14d
movq -0xa0(%rbp), %rcx
movb -0x1(%rax,%rdx), %bl
xorb %bl, -0x1(%r12,%rcx)
cmpq %r8, %rcx
jge 0x207a
cmpq %r8, %rdx
jge 0x207a
incq %rcx
incq %rdx
leal 0x1(%r14), %ebx
cmpl %r10d, %r14d
movl %ebx, %r14d
jl 0x2055
incq %rdi
cmpq %r13, %rdi
jne 0x2001
testl %r10d, %r10d
setle %cl
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edi
leal (%rsi,%rdi), %eax
decl %eax
cltd
idivl %edi
imull %r10d, %edx
cmpl %r9d, -0x2c(%rbp)
setge %al
cmpl %r9d, %edx
setge %sil
orb %cl, %al
orb %sil, %al
movq -0x60(%rbp), %rdi
jne 0x20ea
movslq %edx, %rax
leaq 0x1(%r11), %rdx
incq %rax
movl $0x1, %esi
movb -0x1(%rdi,%rax), %cl
xorb %cl, -0x1(%r12,%rdx)
cmpq %r8, %rdx
jge 0x20ea
cmpq %r8, %rax
jge 0x20ea
incq %rdx
incq %rax
leal 0x1(%rsi), %ecx
cmpl %r10d, %esi
movl %ecx, %esi
jl 0x20c7
cmpl $0x0, -0x68(%rbp)
jle 0x2149
testl %r10d, %r10d
setg %cl
cmpl %r9d, -0x2c(%rbp)
setl %al
andb %cl, %al
leaq 0x1(%r11), %rdx
movl $0x2, %esi
cmpq -0xa8(%rbp), %rsi
je 0x2141
testb %al, %al
je 0x2141
movq -0x48(%rbp), %rcx
movq (%rcx,%rsi,8), %rcx
movl $0x1, %edi
movq %rdx, %r14
movb -0x1(%rcx,%r14), %bl
xorb %bl, -0x1(%r15,%r14)
cmpq %r8, %r14
jge 0x2141
incq %r14
leal 0x1(%rdi), %ebx
cmpl %r10d, %edi
movl %ebx, %edi
jl 0x2125
incq %rsi
cmpq %r13, %rsi
jne 0x2108
testl %r10d, %r10d
setle %al
cmpl %r9d, -0x2c(%rbp)
setge %cl
orb %al, %cl
movq -0x60(%rbp), %rdx
jne 0x2182
incq %r11
movl $0x1, %eax
movb -0x1(%rdx,%r11), %cl
xorb %cl, -0x1(%r15,%r11)
cmpq %r8, %r11
jge 0x2182
incq %r11
leal 0x1(%rax), %ecx
cmpl %r10d, %eax
movl %ecx, %eax
jl 0x2166
movq -0x98(%rbp), %rcx
addl -0x54(%rbp), %ecx
movq -0x38(%rbp), %rax
movl 0x10(%rax), %edi
movl %ecx, %eax
cltd
idivl %edi
leal -0x1(%rdi), %eax
cmpl %eax, %edx
jne 0x1f73
movq -0x90(%rbp), %rcx
cmpl $0x3, %ecx
movl $0x0, %eax
cmovgel %eax, %edi
leal -0x3(%rcx,%rdi), %eax
movl -0x4c(%rbp), %ecx
movl %ecx, %edx
movq -0x78(%rbp), %r12
movq -0x70(%rbp), %r15
movq -0x80(%rbp), %rcx
movl %ecx, %esi
movq -0x88(%rbp), %rcx
movq %rcx, -0x40(%rbp)
cmpl %eax, -0x50(%rbp)
je 0x1f41
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq