// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movl %edx, -0x44(%rbp)
movl %esi, %r14d
movq %rdi, %r15
movslq 0x10(%rdi), %r12
movslq 0xc(%rdi), %r13
movq %r13, %rsi
imulq %r12, %rsi
shlq $0x2, %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdi
callq 0x1070
movq %rax, -0x30(%rbp)
leaq (,%r13,4), %rsi
movq %rbx, %rdi
movq %rsi, -0x40(%rbp)
callq 0x1070
movl -0x44(%rbp), %ebx
movq %rax, -0x38(%rbp)
movl 0x28(%r15), %r10d
cmpl %r14d, %r10d
setle %al
cmpl %ebx, %r10d
setne %cl
orb %al, %cl
movl %r14d, %eax
notl %eax
movq %rax, -0x68(%rbp)
movslq %ebx, %rax
movq %rax, -0x60(%rbp)
movq %r14, -0x58(%rbp)
movslq %r14d, %rax
movq %rax, -0x70(%rbp)
jne 0x31c9
movslq 0x14(%r15), %rdi
movq 0x18(%r15), %r8
xorl %eax, %eax
testl %r13d, %r13d
movl $0x0, %esi
cmovgl %r13d, %esi
testl %ebx, %ebx
movl $0x0, %r10d
cmovgl %ebx, %r10d
movq -0x30(%rbp), %r11
cmpq %rdi, %rax
jg 0x3094
movq %rax, -0x50(%rbp)
leal (%r12,%rax), %r14d
xorl %ebx, %ebx
cmpq %r10, %rbx
je 0x3087
leal (%r14,%rbx), %ecx
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x3082
movl %ecx, %eax
cltd
idivl %r12d
cmpl %edi, %edx
jge 0x307d
imull %r13d, %edx
movslq %edx, %rax
shlq $0x2, %rax
addq (%r8,%rbx,8), %rax
movl (%rax,%r9,4), %eax
xorl %eax, (%r11,%r9,4)
incq %r9
jmp 0x3057
incq %rbx
jmp 0x304b
movq -0x50(%rbp), %rax
incq %rax
addq -0x40(%rbp), %r11
jmp 0x303c
movq -0x68(%rbp), %rax
addl %r12d, %eax
cltd
idivl %r12d
leal -0x1(%r12), %eax
movl %edx, %ecx
imull %r13d, %ecx
movslq %ecx, %rcx
movq -0x30(%rbp), %r9
leaq (%r9,%rcx,4), %r9
shlq $0x2, %rcx
xorl %r10d, %r10d
movq -0x38(%rbp), %rbx
cmpq %r10, %rsi
je 0x30ec
cmpl %eax, %edx
jne 0x30cf
movl (%r9,%r10,4), %r11d
jmp 0x30e3
movq -0x60(%rbp), %r11
movq 0x10(%r8,%r11,8), %r11
addq %rcx, %r11
movl (%r11,%r10,4), %r11d
xorl (%r9,%r10,4), %r11d
movl %r11d, (%rbx,%r10,4)
incq %r10
jmp 0x30c0
xorl %eax, %eax
testl %edi, %edi
movl $0x0, %ecx
cmovgl %edi, %ecx
xorl %edx, %edx
movq -0x30(%rbp), %r14
movq %rax, %r9
movq -0x38(%rbp), %r10
movq %rsi, %r11
cmpq %rcx, %rdx
je 0x313a
subq $0x1, %r11
jb 0x3131
movq -0x60(%rbp), %rbx
movq 0x10(%r8,%rbx,8), %rbx
movl (%rbx,%r9), %ebx
xorl (%r10), %ebx
xorl %ebx, (%r14,%r9)
addq $0x4, %r10
addq $0x4, %r9
jmp 0x310d
incq %rdx
addq -0x40(%rbp), %rax
jmp 0x30fe
imull %r13d, %edi
movslq %edi, %rax
movq -0x30(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movq -0x38(%rbp), %rdi
cmpq %rcx, %rsi
je 0x315f
movl (%rdi,%rcx,4), %edx
xorl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x314f
xorl %ebx, %ebx
cmpl %r12d, %ebx
jge 0x31ba
movq -0x58(%rbp), %rax
addl %r12d, %eax
addl %ebx, %eax
cltd
idivl %r12d
leal -0x1(%r12), %eax
cmpl %eax, %edx
jge 0x31b6
movq 0x18(%r15), %rcx
movslq 0xc(%r15), %rax
imull %eax, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
movq -0x70(%rbp), %rdx
addq (%rcx,%rdx,8), %rdi
movl %eax, %ecx
imull %ebx, %ecx
movslq %ecx, %rcx
movq -0x30(%rbp), %rdx
leaq (%rdx,%rcx,4), %rsi
shlq $0x2, %rax
movq %rax, %rdx
callq 0x1090
movl 0x10(%r15), %r12d
incl %ebx
jmp 0x3161
movq %r15, %rdi
callq 0x25de
movl 0x28(%r15), %r10d
movl -0x44(%rbp), %ebx
cmpl -0x58(%rbp), %r10d
setle %al
cmpl %ebx, %r10d
setle %cl
orb %al, %cl
jne 0x3468
movl 0xc(%r15), %ecx
movl 0x14(%r15), %r13d
movslq %r13d, %rdx
movq 0x18(%r15), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %edi
cmovgl %ecx, %edi
movslq %r10d, %r8
movl %ecx, -0x50(%rbp)
movslq %ecx, %rcx
movq %rdx, -0x80(%rbp)
testl %edx, %edx
movl $0x0, %edx
cmovgl %r13d, %edx
movq %rdx, -0x78(%rbp)
shlq $0x2, %rcx
xorl %edx, %edx
movq %rax, %rsi
movq -0x38(%rbp), %r11
movq %rdi, %r9
cmpq -0x78(%rbp), %rdx
je 0x3262
subq $0x1, %r9
jb 0x325a
movl (%r11), %ebx
movq -0x40(%rbp), %r12
movq (%r12,%r8,8), %r14
movq 0x10(%r12,%r8,8), %r12
xorl (%r14,%rsi), %ebx
xorl (%r12,%rsi), %ebx
movl %ebx, (%r11)
addq $0x4, %r11
addq $0x4, %rsi
jmp 0x322f
incq %rdx
addq %rcx, %rax
jmp 0x321f
movl 0x10(%r15), %r14d
xorl %ebx, %ebx
testl %r10d, %r10d
cmovlel %ebx, %r10d
movq -0x30(%rbp), %r12
cmpq -0x80(%rbp), %rbx
jg 0x32c8
xorl %r11d, %r11d
cmpq %r10, %r11
je 0x32c0
leal (%r11,%rbx), %esi
addl %r14d, %esi
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x32bb
movl %esi, %eax
cltd
idivl %r14d
cmpl %r13d, %edx
jge 0x32b6
imull -0x50(%rbp), %edx
movslq %edx, %rax
shlq $0x2, %rax
movq -0x40(%rbp), %rdx
addq (%rdx,%r11,8), %rax
movl (%rax,%r9,4), %eax
xorl %eax, (%r12,%r9,4)
incq %r9
jmp 0x328b
incq %r11
jmp 0x327c
incq %rbx
addq %rcx, %r12
jmp 0x3273
xorl %eax, %eax
xorl %edx, %edx
movq %rax, %rsi
movq -0x38(%rbp), %r9
movq %rdi, %r10
cmpq -0x78(%rbp), %rdx
je 0x330c
subq $0x1, %r10
jb 0x3304
movq -0x40(%rbp), %r11
movq 0x10(%r11,%r8,8), %r11
movl (%r9), %ebx
xorl (%r11,%rsi), %ebx
movq -0x30(%rbp), %r11
xorl %ebx, (%r11,%rsi)
addq $0x4, %r9
addq $0x4, %rsi
jmp 0x32dc
incq %rdx
addq %rcx, %rax
jmp 0x32cc
movl -0x50(%rbp), %r8d
movl %r8d, %eax
imull %r13d, %eax
cltq
movq -0x30(%rbp), %rdx
leaq (%rdx,%rax,4), %rax
xorl %edx, %edx
cmpq %rdx, %rdi
je 0x3337
movq -0x38(%rbp), %rsi
movl (%rsi,%rdx,4), %esi
xorl %esi, (%rax,%rdx,4)
incq %rdx
jmp 0x3323
movq -0x68(%rbp), %rax
addl %r14d, %eax
cltd
idivl %r14d
movl %edx, %ebx
movl %edx, %eax
imull %r8d, %eax
cltq
movq -0x30(%rbp), %rdx
leaq (%rdx,%rax,4), %rsi
movq -0x38(%rbp), %rdi
movq %rcx, %rdx
callq 0x1090
movl %ebx, %r11d
movl -0x58(%rbp), %r12d
movl -0x44(%rbp), %r9d
addl %r9d, %r11d
addl %r14d, %r11d
movl %r11d, %eax
cltd
idivl %r14d
cmpl %r13d, %edx
je 0x3468
movl %edx, %ebx
movl -0x50(%rbp), %eax
movslq %eax, %rdx
imull %ebx, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
movq -0x60(%rbp), %rax
movq -0x40(%rbp), %rcx
addq (%rcx,%rax,8), %rdi
shlq $0x2, %rdx
movq -0x38(%rbp), %r13
movq %r13, %rsi
callq 0x1090
xorl %eax, %eax
movq -0x70(%rbp), %r10
movl 0xc(%r15), %ecx
cmpl %ecx, %eax
jge 0x33f5
movq 0x18(%r15), %rcx
xorl %edx, %edx
movslq 0x28(%r15), %rsi
cmpq %rsi, %rdx
jg 0x33f1
cmpq %rdx, %r12
je 0x33ec
movq (%rcx,%rdx,8), %rsi
movl 0xc(%r15), %edi
imull %ebx, %edi
addl %eax, %edi
movslq %edi, %rdi
movl (%rsi,%rdi,4), %esi
movq (%rcx,%r10,8), %r8
xorl %esi, (%r8,%rdi,4)
incq %rdx
jmp 0x33c3
incl %eax
jmp 0x33b5
movl %ebx, %eax
subl -0x58(%rbp), %eax
movl 0x10(%r15), %r14d
addl %r14d, %eax
cltd
idivl %r14d
movl %edx, %r11d
movq 0x18(%r15), %rax
movq %rax, -0x40(%rbp)
imull %ecx, %ebx
movl %edx, %eax
imull %ecx, %eax
movslq %eax, %rdx
testl %ecx, %ecx
movl $0x0, %eax
movl %ecx, -0x50(%rbp)
cmovgl %ecx, %eax
movslq %ebx, %rcx
movq -0x30(%rbp), %rsi
leaq (%rsi,%rdx,4), %rdx
shlq $0x2, %rcx
xorl %esi, %esi
movl -0x44(%rbp), %r9d
cmpq %rsi, %rax
je 0x345f
movq -0x40(%rbp), %rdi
movq (%rdi,%r10,8), %rdi
addq %rcx, %rdi
movl (%rdx,%rsi,4), %r8d
xorl (%rdi,%rsi,4), %r8d
movl %r8d, (%r13,%rsi,4)
incq %rsi
jmp 0x343d
movl 0x14(%r15), %r13d
jmp 0x336b
movq -0x30(%rbp), %rdi
callq 0x10d0
movq -0x38(%rbp), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0