// File: /workspace/github_cpp_makefile_star2_O1/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, %r12d
movl %ecx, %eax
cltd
idivl %r8d
movl %eax, %r10d
movq %rdi, -0x38(%rbp)
movl 0x10(%rdi), %edi
leal -0x3(%r9), %eax
leal -0x1(%rdi), %edx
cmpl $0x3, %r9d
cmovgel %eax, %edx
movl %edx, -0x54(%rbp)
leal -0x2(%rdi), %edx
movq %rdi, -0x70(%rbp)
leal 0x1(%rdi), %eax
movq %rax, -0x40(%rbp)
movq (%rsi), %r8
leal 0x2(%r12), %eax
cmpl $0x4, %eax
movl $0x3, %r13d
cmovgel %eax, %r13d
movslq %r9d, %rax
movq %rsi, -0x50(%rbp)
movq (%rsi,%rax,8), %r15
movl %ecx, -0x30(%rbp)
movslq %ecx, %r14
movq %r9, -0x78(%rbp)
movq %r9, -0x48(%rbp)
movq %r8, -0x68(%rbp)
movq %r15, -0x60(%rbp)
movq %r12, -0x80(%rbp)
movq -0x38(%rbp), %rax
movl 0x10(%rax), %ecx
leal -0x1(%rcx), %eax
cmpl %eax, %edx
je 0x1dc3
movq -0x40(%rbp), %rax
leal -0x2(%rax), %esi
movl %esi, -0x58(%rbp)
movl -0x48(%rbp), %r9d
movl %eax, %eax
movq %rax, -0x98(%rbp)
testl %r10d, %r10d
setle %sil
movq -0x48(%rbp), %rdi
subl %edi, %edx
leal (%rdx,%rcx), %eax
addl $0x2, %eax
cltd
idivl %ecx
leal (%rdx,%rdi), %r11d
movq %rdx, -0x88(%rbp)
movl %edx, %eax
imull %r10d, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x30(%rbp), %eax
setge %al
orb %sil, %al
jne 0x1bdd
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
leal (%rcx,%r11), %eax
addl $-0x2, %eax
cltd
idivl %ecx
imull %r10d, %edx
movslq %edx, %rax
addq %rsi, %rax
movslq -0x2c(%rbp), %rcx
incq %rcx
movl $0x1, %edx
movb -0x1(%rax,%rdx), %sil
movb %sil, -0x1(%r15,%rcx)
cmpq %r14, %rcx
jge 0x1bdd
incq %rcx
leaq 0x1(%rdx), %rsi
cmpl %r10d, %edx
movq %rsi, %rdx
jl 0x1bbf
testl %r12d, %r12d
jle 0x1c84
movslq -0x2c(%rbp), %rax
incq %rax
movq %rax, -0x90(%rbp)
movl $0x2, %r12d
cmpq %r9, %r12
je 0x1c78
movq %r9, %rdi
movl -0x30(%rbp), %r9d
cmpl %r9d, -0x2c(%rbp)
setge %cl
testl %r10d, %r10d
setle %sil
movl %r11d, %eax
subl %r12d, %eax
movq -0x38(%rbp), %rdx
movl 0x10(%rdx), %ebx
addl %ebx, %eax
cltd
idivl %ebx
imull %r10d, %edx
cmpl %r9d, %edx
movq %rdi, %r9
setge %al
orb %cl, %sil
orb %al, %sil
jne 0x1c78
movq -0x50(%rbp), %rax
movq (%rax,%r12,8), %rax
movslq %edx, %rdx
incq %rdx
movl $0x1, %esi
movq -0x90(%rbp), %rcx
movb -0x1(%rax,%rdx), %bl
xorb %bl, -0x1(%r15,%rcx)
cmpq %r14, %rcx
jge 0x1c78
cmpq %r14, %rdx
jge 0x1c78
incq %rcx
incq %rdx
leal 0x1(%rsi), %ebx
cmpl %r10d, %esi
movl %ebx, %esi
jl 0x1c55
incq %r12
cmpq %r13, %r12
jne 0x1bfa
movq -0x38(%rbp), %rax
movl 0x10(%rax), %ecx
leal 0x1(%rcx), %eax
cmpl -0x48(%rbp), %eax
je 0x1cf9
testl %r10d, %r10d
setle %sil
leal (%r11,%rcx), %eax
decl %eax
cltd
idivl %ecx
imull %r10d, %edx
movl -0x30(%rbp), %ecx
cmpl %ecx, -0x2c(%rbp)
setge %al
cmpl %ecx, %edx
setge %cl
orb %sil, %al
orb %cl, %al
jne 0x1cf9
movq -0x50(%rbp), %rax
movq (%rax), %rax
movslq %edx, %rcx
movslq -0x2c(%rbp), %rdx
incq %rdx
incq %rcx
movl $0x1, %esi
movb -0x1(%rax,%rcx), %dil
xorb %dil, -0x1(%r15,%rdx)
cmpq %r14, %rdx
jge 0x1cf9
cmpq %r14, %rcx
jge 0x1cf9
incq %rdx
incq %rcx
leal 0x1(%rsi), %edi
cmpl %r10d, %esi
movl %edi, %esi
jl 0x1cd5
movq -0x80(%rbp), %r12
testl %r12d, %r12d
jle 0x1d5f
testl %r10d, %r10d
setg %cl
movl -0x2c(%rbp), %edx
cmpl -0x30(%rbp), %edx
setl %al
andb %cl, %al
movslq %edx, %rcx
incq %rcx
movl $0x2, %edx
cmpq -0x98(%rbp), %rdx
je 0x1d57
testb %al, %al
je 0x1d57
movq -0x50(%rbp), %rsi
movq (%rsi,%rdx,8), %rsi
movl $0x1, %edi
movq %rcx, %r11
movb -0x1(%rsi,%r11), %bl
xorb %bl, -0x1(%r8,%r11)
cmpq %r14, %r11
jge 0x1d57
incq %r11
leal 0x1(%rdi), %ebx
cmpl %r10d, %edi
movl %ebx, %edi
jl 0x1d3b
incq %rdx
cmpq %r13, %rdx
jne 0x1d1e
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
incl %eax
cmpl %eax, -0x40(%rbp)
je 0x1da2
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x1da2
testl %r10d, %r10d
jle 0x1da2
movslq -0x2c(%rbp), %rax
incq %rax
movl $0x1, %ecx
movb -0x1(%r15,%rax), %dl
xorb %dl, -0x1(%r8,%rax)
cmpq %r14, %rax
jge 0x1da2
incq %rax
leal 0x1(%rcx), %edx
cmpl %r10d, %ecx
movl %edx, %ecx
jl 0x1d86
movq -0x88(%rbp), %rdx
addl -0x58(%rbp), %edx
movq -0x38(%rbp), %rax
movl 0x10(%rax), %ecx
movl %edx, %eax
cltd
idivl %ecx
leal -0x1(%rcx), %eax
cmpl %eax, %edx
jne 0x1b62
movq -0x40(%rbp), %rdx
cmpl $0x3, %edx
movl %ecx, %eax
movl $0x0, %esi
cmovgel %esi, %eax
addl %edx, %eax
decl %eax
incl %ecx
movq %rcx, -0x48(%rbp)
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %r15
movq -0x78(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movl -0x54(%rbp), %ecx
movl %ecx, %edx
cmpl %eax, -0x70(%rbp)
je 0x1b39
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop