// File: /workspace/github_cpp_makefile_star2_O3/syzcch[P]FEC_C_version/./fec_rdp.h
// Function: rdp::rdp_decoding_d(char**, int, int, int, int)
void rdp_decoding_d(char *g_data[],  int disks, int stripe_unit_size, int w, int x)
    {
        int xcount, ccount, count, dcount;
        int packet_size = stripe_unit_size / w;
        int gr,g,gx;
        int row_disk, diag_disk;
        char *row_data, *diag_data, *rdata, *xdata;
        int coffset;
        int i,j,k,c;
        int diag_count;
        int row_count;


        dcount=stripe_unit_size;
        xcount=stripe_unit_size;
        gr = pnumRdp - 2;
        gx = (x >= 3 ? x - 3 : pnumRdp - 1);
        row_disk = pnumRdp + 1;
        diag_disk = x;
        rdata=g_data[0];
        xdata=g_data[x];
        row_data=rdata;
        diag_data=xdata;
        g = gr;
        diag_count = xcount;
        row_count = dcount;


        while(1)
        {
            if(g == pnumRdp - 1)
            {
                if(gr == (row_disk >= 3 ? row_disk - 3 : row_disk + pnumRdp -3))
                {
                    row_disk = x;
                    diag_disk = pnumRdp + 1;
                    row_data = xdata;
                    diag_data =rdata;
                    g = gx;
                    row_count = diag_count;
                    diag_count = dcount;

                    continue;
                }
                else
                    break;
            }
            else
            {
                int row_index;
                char* cdata;
                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((int)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];

                    }

                }
                if(pnumRdp + 1 != diag_disk)
                {
                    ccount=stripe_unit_size;
                    cdata = g_data[0];
                    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
                for(c = 2; c <(disks+2); c++)
                {
                    if((int)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];

                    }


                }
                if(row_disk != pnumRdp + 1)
                {

                    //diag_disk must be DISK---VDEV_RAIDZ_R
                    count = row_count;
                    cdata = diag_data;
                    coffset = row_index * packet_size;

                    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 %edx, %r11d
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %r10d
movq %rdi, -0x50(%rbp)
movl 0x10(%rdi), %edi
leal -0x2(%rdi), %edx
leal -0x3(%r9), %eax
leal -0x1(%rdi), %r8d
cmpl $0x3, %r9d
cmovgel %eax, %r8d
movl %r8d, -0x54(%rbp)
leal 0x1(%rdi), %eax
movq %rax, -0x40(%rbp)
movq (%rsi), %r15
leal 0x2(%r11), %eax
cmpl $0x4, %eax
movl $0x3, %r12d
cmovgel %eax, %r12d
movslq %r9d, %rax
movq %rsi, -0x48(%rbp)
movq (%rsi,%rax,8), %r8
movl %ecx, -0x34(%rbp)
movslq %ecx, %r14
movq %rdi, -0x70(%rbp)
movl %edi, %esi
movq %r9, -0x78(%rbp)
movl %r9d, %ebx
movq %r15, -0x68(%rbp)
movq %r8, -0x60(%rbp)
movq %r11, -0x80(%rbp)
leal -0x1(%rsi), %eax
cmpl %eax, %edx
je 0x1dbc
movq -0x40(%rbp), %rax
leal -0x2(%rax), %ecx
movl %ecx, -0x58(%rbp)
movl %ebx, %ecx
movq %rcx, -0xa0(%rbp)
movl %eax, %r13d
movq %rbx, -0x90(%rbp)
movq %r13, -0x88(%rbp)
testl %r10d, %r10d
setg %dil
subl %ebx, %edx
leal (%rdx,%rsi), %eax
addl $0x2, %eax
cltd
idivl %esi
leal (%rdx,%rbx), %ecx
movq %rdx, -0x98(%rbp)
movl %edx, %eax
imull %r10d, %eax
movl %eax, -0x30(%rbp)
cmpl -0x34(%rbp), %eax
setl %al
andb %dil, %al
movb %al, -0x29(%rbp)
cmpb $0x1, %al
jne 0x1bdf
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
leal (%rsi,%rcx), %eax
addl $-0x2, %eax
cltd
idivl %esi
imull %r10d, %edx
movslq %edx, %rax
addq %rdi, %rax
movslq -0x30(%rbp), %rdx
incq %rdx
movl $0x1, %esi
movb -0x1(%rax,%rsi), %dil
movb %dil, -0x1(%r8,%rdx)
cmpq %r14, %rdx
jge 0x1bdf
incq %rdx
leaq 0x1(%rsi), %rdi
cmpl %r10d, %esi
movq %rdi, %rsi
jl 0x1bc1
testl %r11d, %r11d
jle 0x1c7f
movslq -0x30(%rbp), %rbx
incq %rbx
movl $0x2, %r13d
cmpq -0xa0(%rbp), %r13
je 0x1c73
movl -0x34(%rbp), %r11d
cmpl %r11d, -0x30(%rbp)
setge %sil
testl %r10d, %r10d
setle %dil
movl %ecx, %eax
subl %r13d, %eax
movq -0x50(%rbp), %rdx
movl 0x10(%rdx), %r9d
addl %r9d, %eax
cltd
idivl %r9d
imull %r10d, %edx
cmpl %r11d, %edx
setge %al
orb %sil, %dil
orb %al, %dil
jne 0x1c73
movq -0x48(%rbp), %rax
movq (%rax,%r13,8), %rax
movslq %edx, %rdx
incq %rdx
movl $0x1, %edi
movq %rbx, %rsi
movb -0x1(%rax,%rdx), %r9b
xorb %r9b, -0x1(%r8,%rsi)
cmpq %r14, %rsi
jge 0x1c73
cmpq %r14, %rdx
jge 0x1c73
incq %rsi
incq %rdx
leal 0x1(%rdi), %r9d
cmpl %r10d, %edi
movl %r9d, %edi
jl 0x1c4d
incq %r13
cmpq %r12, %r13
jne 0x1bf5
movq -0x50(%rbp), %rax
movl 0x10(%rax), %esi
leal 0x1(%rsi), %eax
movq -0x90(%rbp), %rbx
cmpl %ebx, %eax
je 0x1cfe
movl -0x34(%rbp), %r11d
cmpl %r11d, -0x30(%rbp)
setge %dil
testl %r10d, %r10d
setle %r9b
leal (%rcx,%rsi), %eax
decl %eax
cltd
idivl %esi
imull %r10d, %edx
cmpl %r11d, %edx
setge %al
orb %dil, %r9b
orb %al, %r9b
jne 0x1cfe
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq %edx, %rcx
movslq -0x30(%rbp), %rdx
incq %rdx
incq %rcx
movl $0x1, %esi
movb -0x1(%rax,%rcx), %dil
xorb %dil, -0x1(%r8,%rdx)
cmpq %r14, %rdx
jge 0x1cfe
cmpq %r14, %rcx
jge 0x1cfe
incq %rdx
incq %rcx
leal 0x1(%rsi), %edi
cmpl %r10d, %esi
movl %edi, %esi
jl 0x1cda
movq -0x80(%rbp), %r11
testl %r11d, %r11d
movq -0x88(%rbp), %r13
jle 0x1d5b
movslq -0x30(%rbp), %rax
incq %rax
movl $0x2, %ecx
cmpq %r13, %rcx
je 0x1d53
cmpb $0x0, -0x29(%rbp)
je 0x1d53
movq -0x48(%rbp), %rdx
movq (%rdx,%rcx,8), %rdx
movl $0x1, %esi
movq %rax, %rdi
movb -0x1(%rdx,%rdi), %r9b
xorb %r9b, -0x1(%r15,%rdi)
cmpq %r14, %rdi
jge 0x1d53
incq %rdi
leal 0x1(%rsi), %r9d
cmpl %r10d, %esi
movl %r9d, %esi
jl 0x1d35
incq %rcx
cmpq %r12, %rcx
jne 0x1d1a
movq -0x50(%rbp), %rax
movl 0x10(%rax), %esi
leal 0x1(%rsi), %eax
cmpl %eax, -0x40(%rbp)
sete %al
movb -0x29(%rbp), %cl
xorb $0x1, %cl
orb %al, %cl
jne 0x1da4
movslq -0x30(%rbp), %rax
incq %rax
movl $0x1, %ecx
movb -0x1(%r8,%rax), %dl
xorb %dl, -0x1(%r15,%rax)
cmpq %r14, %rax
jge 0x1d9d
incq %rax
leal 0x1(%rcx), %edx
cmpl %r10d, %ecx
movl %edx, %ecx
jl 0x1d81
movq -0x50(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x98(%rbp), %rax
addl -0x58(%rbp), %eax
cltd
idivl %esi
leal -0x1(%rsi), %eax
cmpl %eax, %edx
jne 0x1b65
movq -0x40(%rbp), %rcx
cmpl $0x3, %ecx
movl %esi, %eax
movl $0x0, %edx
cmovgel %edx, %eax
leal -0x1(%rcx,%rax), %eax
leal 0x1(%rsi), %ebx
movq -0x60(%rbp), %r15
movq -0x68(%rbp), %r8
movq -0x78(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movl -0x54(%rbp), %ecx
movl %ecx, %edx
cmpl %eax, -0x70(%rbp)
je 0x1b36
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop