// File: /workspace/github_cpp_makefile_star2_O1/syzcch[P]FEC_C_version/./fec_star.h
// Function: star::Evenodd_decoding_1(int, int)
void Evenodd_decoding_1(int rs_disk1, int rs_disk2)
    {

        /*2 situations:1,one data error + row data error
                          2,two data error*/
        int i,j,stripe,k;
        int *tmp;
        tmp = (int*)malloc(sizeof(int) * (p * block_size));
        memset(tmp, 0, p*block_size*sizeof(int));

        int *tmp_for_s;
        tmp_for_s = (int *)malloc(sizeof(int) * block_size);
        memset(tmp_for_s, 0, block_size *sizeof(int));

        /*one data error + row data error*/
        if(rs_disk1 < data_disk_nbr && rs_disk2 == data_disk_nbr)
        {
            for(stripe = 0; stripe < block_nbr+1; stripe++)
            {
                for(i = 0; i < data_disk_nbr; i++)
                {
                    for(j = 0; j<block_size; j++)
                    {
                        k = (stripe + i + p) % p;
                        if( k < block_nbr)
                            tmp[stripe * block_size + j] ^= check_data[i][ k * block_size + j];
                    }
                }
            }

            /*find out s*/
            stripe = ( p - rs_disk1 - 1) % p;

            for( i = 0; i < block_size; i++)
            {
                if(stripe ==  p - 1)
                    tmp_for_s[i] = tmp[stripe * block_size + i];
                else
                    tmp_for_s[i] = tmp[stripe * block_size + i] ^ check_data[data_disk_nbr + 2][stripe * block_size + i];
            }

            for( i = 0; i < block_nbr; i++)
            {
                for( j = 0; j < block_size; j++)
                {
                    tmp[i * block_size + j] ^= (tmp_for_s[j] ^ check_data[data_disk_nbr + 2][ i * block_size + j]);
                }
            }
            for( i = 0; i < block_size; i++)
                tmp[block_nbr * block_size + i]^=tmp_for_s[i];
            /*now all restored data is store in tmp.*/

            for( i = 0; i < p; i++)
            {
                j = (i + p + rs_disk1) % p;
                if( j < p - 1)
                {
                    memmove( check_data[rs_disk1] + j * block_size, tmp + i * block_size, block_size * sizeof(int));/*********************/
                    /*********************/
                }
            }
            STAR_encoding_row();
        }

        if(rs_disk1 < data_disk_nbr && rs_disk2 < data_disk_nbr)
        {
            for( i = 0; i < block_nbr; i++)
            {
                for( j = 0; j < block_size; j++)
                {
                    tmp_for_s[j] ^= check_data[data_disk_nbr][i * block_size + j];
                    tmp_for_s[j] ^= check_data[data_disk_nbr + 2][i * block_size + j];
                }
            }

            /*  for( i = 0; i < block_nbr; i++)
                {
                    for( j = 0; j < block_size; j++)
                    {
                        check_data[p + 1][i * block_size + j] ^= tmp_for_s[j];
                    }
                }
            */

            for(stripe = 0; stripe < block_nbr+1; stripe++)
            {
                for(i = 0; i < data_disk_nbr; i++)
                {
                    for(j = 0; j < block_size; j++)
                    {
                        k = (stripe + i + p) % p;
                        if( k < block_nbr)
                            tmp[stripe * block_size + j] ^= check_data[i][ k * block_size + j];
                    }
                }
            }
            for( i = 0; i< block_nbr ; i++)
            {
                for( j = 0; j< block_size; j++)
                {
                    if( i < block_nbr)
                        tmp[ i * block_size + j] ^= (check_data[data_disk_nbr + 2][i * block_size + j] ^ tmp_for_s[j]);
                    //else tmp[ i * block_size + j] ^= tmp_for_s[j];
                }
            }
            for( j = 0; j< block_size; j++)
                tmp[ block_nbr * block_size + j] ^= tmp_for_s[j];
            /*s store in tmp*/

            stripe = ( p - rs_disk1 - 1) % p;
            /*apply tmp_for_s to store temporary data*/
            memmove( tmp_for_s, tmp + stripe * block_size, block_size* sizeof(int));

            while(1)
            {
                k = (stripe + rs_disk2 + p) % p;/*rs_disk2*/
                if( k == block_nbr)
                    break;
                memmove( check_data[rs_disk2] + k * block_size, tmp_for_s, block_size * sizeof(int));

                for( i = 0; i < block_size; i++)
                {
                    for( j = 0 ; j <= data_disk_nbr ; j++)
                        if( j != rs_disk1)
                            check_data[rs_disk1][k * block_size + i] ^= check_data[j][k * block_size + i];
                }

                stripe = (k - rs_disk1 + p) % p;
                for( i = 0; i < block_size; i++)
                {
                    tmp_for_s[i] = check_data[rs_disk1][k * block_size + i] ^ tmp[stripe * block_size + i];
                }
            }
        }
        free(tmp);
        free(tmp_for_s);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x48(%rbp)
movl %esi, %r14d
movq %rdi, %r15
movl 0x10(%rdi), %ecx
movslq 0xc(%rdi), %r12
movl %r12d, %eax
movq %rcx, -0x40(%rbp)
imull %ecx, %eax
movslq %eax, %rbx
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x10d0
movq %rax, -0x30(%rbp)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1050
leaq (,%r12,4), %rbx
movq %rbx, %rdi
callq 0x10d0
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, -0x60(%rbp)
movq %rbx, %rdx
callq 0x1050
movl 0x28(%r15), %edi
movq %r14, -0x38(%rbp)
cmpl %r14d, %edi
setle %al
cmpl -0x48(%rbp), %edi
setne %cl
orb %al, %cl
jne 0x3447
movl %r12d, %ecx
movl 0x14(%r15), %esi
testl %esi, %esi
movq %r12, %r10
js 0x3312
movq 0x18(%r15), %r8
leaq 0x1(%rsi), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x30(%rbp), %r11
testl %edi, %edi
jle 0x32fd
movq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdx
leal (%rax,%rdx), %ebx
xorl %r9d, %r9d
testl %r10d, %r10d
jle 0x32f2
leal (%rbx,%r9), %eax
cltd
idivl -0x40(%rbp)
movl %edx, %eax
imull %ecx, %eax
cltq
shlq $0x2, %rax
xorl %r14d, %r14d
cmpl %esi, %edx
jge 0x32ea
movq (%r8,%r9,8), %r10
addq %rax, %r10
movl (%r10,%r14,4), %r10d
xorl %r10d, (%r11,%r14,4)
incq %r14
cmpq %r14, %rcx
jne 0x32d7
incq %r9
cmpq %rdi, %r9
movq %r12, %r10
jne 0x32bc
movq -0x50(%rbp), %rdx
incq %rdx
addq -0x60(%rbp), %r11
movq %rdx, -0x50(%rbp)
cmpq -0x58(%rbp), %rdx
jne 0x32aa
movslq %edi, %rdi
testl %ecx, %ecx
jle 0x336e
movq -0x38(%rbp), %rax
notl %eax
movq -0x40(%rbp), %rbx
addl %ebx, %eax
cltd
idivl %ebx
decl %ebx
movq 0x18(%r15), %rax
movl %edx, %r8d
imull %r10d, %r8d
movslq %r8d, %r8
movq -0x30(%rbp), %r9
leaq (%r9,%r8,4), %r9
shlq $0x2, %r8
xorl %r10d, %r10d
cmpl %ebx, %edx
jne 0x3351
movl (%r9,%r10,4), %r11d
jmp 0x3361
movq 0x10(%rax,%rdi,8), %r11
addq %r8, %r11
movl (%r11,%r10,4), %r11d
xorl (%r9,%r10,4), %r11d
movl %r11d, (%r13,%r10,4)
incq %r10
cmpq %r10, %rcx
jne 0x3347
testl %esi, %esi
jle 0x33b9
movq 0x18(%r15), %rax
leaq (,%rcx,4), %rdx
xorl %r8d, %r8d
movq -0x30(%rbp), %r9
xorl %r10d, %r10d
testl %ecx, %ecx
jle 0x33ab
movq 0x10(%rax,%rdi,8), %r11
addq %r8, %r11
xorl %ebx, %ebx
movl (%r11,%rbx,4), %r14d
xorl (%r13,%rbx,4), %r14d
xorl %r14d, (%r9,%rbx,4)
incq %rbx
cmpq %rbx, %rcx
jne 0x3396
incq %r10
addq %rdx, %r9
addq %rdx, %r8
cmpq %rsi, %r10
jne 0x3388
testl %r12d, %r12d
jle 0x33df
movl %ecx, %eax
imull %esi, %eax
cltq
movq -0x30(%rbp), %rdx
leaq (%rdx,%rax,4), %rax
xorl %edx, %edx
movl (%r13,%rdx,4), %esi
xorl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x33cf
movl 0x10(%r15), %ecx
testl %ecx, %ecx
jle 0x343f
movslq -0x38(%rbp), %rbx
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
addl %ecx, %eax
addl %r14d, %eax
cltd
idivl %ecx
decl %ecx
cmpl %ecx, %edx
jge 0x3433
movq 0x18(%r15), %rcx
movslq 0xc(%r15), %rax
imull %eax, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
addq (%rcx,%rbx,8), %rdi
movl %eax, %ecx
imull %r14d, %ecx
movslq %ecx, %rcx
movq -0x30(%rbp), %rdx
leaq (%rdx,%rcx,4), %rsi
shlq $0x2, %rax
movq %rax, %rdx
callq 0x1070
incl %r14d
movl 0x10(%r15), %ecx
cmpl %ecx, %r14d
jl 0x33ee
movq %r15, %rdi
callq 0x27b2
movslq 0x28(%r15), %rcx
cmpl -0x38(%rbp), %ecx
setle %al
cmpl -0x48(%rbp), %ecx
setle %dl
orb %al, %dl
jne 0x3704
movl 0x14(%r15), %esi
testl %esi, %esi
jle 0x34bc
movl 0xc(%r15), %eax
movq 0x18(%r15), %rdx
leaq (,%rax,4), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
testl %eax, %eax
jle 0x34b1
movq 0x10(%rdx,%rcx,8), %r10
addq %r8, %r10
movq (%rdx,%rcx,8), %r11
addq %r8, %r11
xorl %ebx, %ebx
movl (%r13,%rbx,4), %r14d
xorl (%r11,%rbx,4), %r14d
movl %r14d, (%r13,%rbx,4)
xorl (%r10,%rbx,4), %r14d
movl %r14d, (%r13,%rbx,4)
incq %rbx
cmpq %rbx, %rax
jne 0x3492
incq %r9
addq %rdi, %r8
cmpq %rsi, %r9
jne 0x347d
testl %esi, %esi
js 0x3539
movl 0xc(%r15), %edi
movl 0x10(%r15), %r8d
movq 0x18(%r15), %r9
movslq %edi, %rax
leaq 0x1(%rsi), %rdx
movq %rdx, -0x50(%rbp)
shlq $0x2, %rax
movq %rax, -0x40(%rbp)
xorl %ebx, %ebx
movq -0x30(%rbp), %r14
testl %ecx, %ecx
jle 0x352c
xorl %r12d, %r12d
testl %edi, %edi
jle 0x3524
leal (%r12,%rbx), %eax
addl %r8d, %eax
cltd
idivl %r8d
movl %edx, %eax
imull %edi, %eax
cltq
shlq $0x2, %rax
xorl %r11d, %r11d
cmpl %esi, %edx
jge 0x351c
movq (%r9,%r12,8), %r10
addq %rax, %r10
movl (%r10,%r11,4), %r10d
xorl %r10d, (%r14,%r11,4)
incq %r11
cmpq %r11, %rdi
jne 0x3509
incq %r12
cmpq %rcx, %r12
jne 0x34ec
incq %rbx
addq -0x40(%rbp), %r14
cmpq -0x50(%rbp), %rbx
jne 0x34e5
testl %esi, %esi
setg %dl
jle 0x3596
movl 0xc(%r15), %eax
movq 0x18(%r15), %rdi
leaq (,%rax,4), %r8
xorl %r9d, %r9d
movq -0x30(%rbp), %r10
xorl %r11d, %r11d
testl %eax, %eax
jle 0x3582
xorl %ebx, %ebx
testb $0x1, %dl
je 0x357a
movq 0x10(%rdi,%rcx,8), %r14
addq %r9, %r14
movl (%r13,%rbx,4), %r12d
xorl (%r14,%rbx,4), %r12d
xorl %r12d, (%r10,%rbx,4)
incq %rbx
cmpq %rbx, %rax
jne 0x3560
incq %r11
cmpq %rsi, %r11
setb %dl
addq %r8, %r10
addq %r8, %r9
cmpq %rsi, %r11
jne 0x355a
movslq 0xc(%r15), %rcx
testq %rcx, %rcx
jle 0x35bf
imull %ecx, %esi
movslq %esi, %rax
movq -0x30(%rbp), %rdx
leaq (%rdx,%rax,4), %rax
xorl %edx, %edx
movl (%r13,%rdx,4), %esi
xorl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x35af
movl 0x10(%r15), %esi
movq -0x38(%rbp), %rax
notl %eax
addl %esi, %eax
cltd
idivl %esi
movl %edx, %ebx
movl %edx, %eax
imull %ecx, %eax
cltq
movq -0x30(%rbp), %rdx
leaq (%rdx,%rax,4), %rsi
shlq $0x2, %rcx
movq %r13, %rdi
movq %rcx, %rdx
callq 0x1070
movl 0x10(%r15), %ecx
movq -0x48(%rbp), %rax
addl %ecx, %eax
addl %ebx, %eax
cltd
idivl %ecx
cmpl 0x14(%r15), %edx
je 0x3704
movl %edx, %ebx
movslq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movslq %eax, %r12
movl %eax, %r14d
negq %r14
movq 0x18(%r15), %rax
movslq 0xc(%r15), %rdx
movslq %ebx, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
movq -0x40(%rbp), %rcx
addq (%rax,%rcx,8), %rdi
shlq $0x2, %rdx
movq %r13, %rsi
callq 0x1070
movl 0xc(%r15), %ecx
testl %ecx, %ecx
jle 0x369d
xorl %eax, %eax
cmpl $0x0, 0x28(%r15)
js 0x3693
movq 0x18(%r15), %rcx
movq $-0x1, %rdx
leaq (%r14,%rdx), %rsi
cmpq $-0x1, %rsi
je 0x3687
movq 0x8(%rcx,%rdx,8), %rsi
movl 0xc(%r15), %edi
imull %ebx, %edi
addl %eax, %edi
movslq %edi, %rdi
movl (%rsi,%rdi,4), %esi
movq (%rcx,%r12,8), %r8
xorl %esi, (%r8,%rdi,4)
movslq 0x28(%r15), %rsi
incq %rdx
cmpq %rsi, %rdx
jl 0x3661
incl %eax
movl 0xc(%r15), %ecx
cmpl %ecx, %eax
jl 0x364f
movl %ebx, %eax
subl -0x38(%rbp), %eax
movl 0x10(%r15), %esi
addl %esi, %eax
cltd
idivl %esi
movl %edx, %eax
testl %ecx, %ecx
jle 0x36ec
movq 0x18(%r15), %rsi
imull %ecx, %ebx
movl %eax, %edi
imull %ecx, %edi
movslq %ebx, %rdx
movslq %edi, %rdi
movl %ecx, %ecx
shlq $0x2, %rdx
addq (%rsi,%r12,8), %rdx
movq -0x30(%rbp), %rsi
leaq (%rsi,%rdi,4), %rsi
xorl %edi, %edi
movl (%rsi,%rdi,4), %r8d
xorl (%rdx,%rdi,4), %r8d
movl %r8d, (%r13,%rdi,4)
incq %rdi
cmpq %rdi, %rcx
jne 0x36d7
addl -0x48(%rbp), %eax
movl 0x10(%r15), %ecx
addl %ecx, %eax
cltd
idivl %ecx
movl %edx, %ebx
cmpl 0x14(%r15), %edx
jne 0x361e
movq -0x30(%rbp), %rdi
callq 0x10b0
movq %r13, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10b0