// File: /workspace/github_cpp_makefile_star2_O2/syzcch[P]FEC_C_version/./fec_star.h
// Function: star::Evenodd_decoding(int*)
void Evenodd_decoding( int *restarts)
    {
        int i,j,stripe,k;
        int rs_disk1 = -1;
        int rs_disk2 = -1;
        int rs_nbr = 0;

        for(i = 0; i < data_disk_nbr + 2; i++)
        {
            if( restarts[i] == 1)
            {
                rs_disk1 = i;
                rs_nbr ++;
                break;
            }
        }
        if(rs_disk1 != -1)
        {
            for( i = rs_disk1 + 1; i < data_disk_nbr + 2; i++)
            {
                if(restarts[i] == 1)
                {
                    rs_disk2 = i;
                    rs_nbr ++;
                    break;
                }
            }
        }
        if(rs_disk1 != -1)memset(check_data[rs_disk1], 0,check_data_size * sizeof(int));
        if(rs_disk2 != -1)memset(check_data[rs_disk2], 0,check_data_size * sizeof(int));

        if(rs_disk1 >= data_disk_nbr)
        {
            if(restarts[data_disk_nbr] == 1)/*row checksum*/
            {
                STAR_encoding_row();
            }
            if(restarts[data_disk_nbr + 1] == 1)/*slope 1*/
            {
                STAR_encoding_diag1();
            }
        }

        if(rs_disk1 < data_disk_nbr && rs_nbr == 1)
        {
            for( i = 0; i < check_data_size; i++)
            {
                for( j = 0; j <= data_disk_nbr; j++)
                {
                    if( j !=  rs_disk1)
                    {
                        check_data[rs_disk1][i] ^= check_data[j][i];
                    }
                }
            }
        }

        //*one data error + one checksum error*/
        if(rs_nbr == 2 && rs_disk1 < data_disk_nbr && rs_disk2 >= data_disk_nbr)
        {
            if( rs_disk2 == data_disk_nbr + 1)/*slope -1*/
            {
                for(i = 0; i < check_data_size; i++)
                    for(j = 0; j <= data_disk_nbr; j++)
                        if( j != rs_disk1)
                            check_data[rs_disk1][i] ^= check_data[j][i];
                STAR_encoding_diag1();
            }

            if( rs_disk2 == data_disk_nbr)
            {
                /*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));

                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];
                        }
                    }
                }

                stripe = (rs_disk1 + p - 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 + 1][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 + 1][ i * block_size + j]);
                    }
                }
                for( j = 0; j < block_size; j++)
                    tmp[ block_nbr * block_size + j] ^= tmp_for_s[j];

                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));

                    }
                }

                free(tmp);
                free(tmp_for_s);
                STAR_encoding_row();
            }
        }

        if(rs_nbr == 2 && rs_disk1 < data_disk_nbr && rs_disk2 < data_disk_nbr)/*2 data error */
        {

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

            /*computing s firstly*/
            int *tmp_for_s;
            tmp_for_s = (int *)malloc(sizeof(int) * block_size);
            memset(tmp_for_s, 0, block_size *sizeof(int));
            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 + 1][i * block_size + j];
                }
            }


            for(stripe = 0; stripe < block_nbr+1; stripe++)
            {
                for(i = 0; i < data_disk_nbr; i++)
                {
                    k = (stripe - i + p) % p;
                    if( k < block_nbr)
                        for(j = 0; j<block_size; j++)
                        {
                            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++)
                {
                    tmp[ i * block_size + j] ^= (check_data[data_disk_nbr + 1][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];

            /*store s~ in tmp*/
            stripe = (rs_disk1 + p - 1) % p;
            memmove( tmp_for_s, tmp + stripe * block_size, block_size * sizeof(int));

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

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

                stripe = (k + rs_disk1 + p) % p;

                for( j = 0; j < block_size; j++)
                {
                    tmp_for_s[j] = check_data[rs_disk1][k * block_size + j] ^ tmp[stripe * block_size + j];
                }

            }

            free(tmp);
            free(tmp_for_s);
        }

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x28(%rdi), %rax
cmpl $-0x1, %eax
pushq $-0x2
popq %rcx
cmovgel %eax, %ecx
addl $0x2, %ecx
xorl %r15d, %r15d
pushq $-0x1
popq %rdx
xorl %r12d, %r12d
cmpq %r12, %rcx
je 0x28f9
cmpl $0x1, (%r14,%r12,4)
je 0x2901
incq %r12
jmp 0x28e8
movq %rdx, %r12
movl %r12d, %r8d
jmp 0x2967
pushq $0x1
popq %r15
pushq $-0x1
popq %r13
movq %r12, %rcx
cmpq %rax, %rcx
jg 0x2927
leaq 0x1(%rcx), %rdx
cmpl $0x1, 0x4(%r14,%rcx,4)
movq %rdx, %rcx
jne 0x290c
pushq $0x2
popq %r15
movl %edx, %r13d
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq 0x8(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1060
cmpl $-0x1, %r13d
je 0x2963
movq 0x18(%rbx), %rax
movslq %r13d, %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x8(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1060
movl %r13d, %r8d
jmp 0x2967
pushq $-0x1
popq %r8
movl 0x28(%rbx), %r9d
cmpl %r9d, %r12d
movl %r8d, -0x2c(%rbp)
jl 0x29a9
movslq %r9d, %rax
cmpl $0x1, (%r14,%rax,4)
jne 0x2991
movq %rbx, %rdi
callq 0x25de
movl -0x2c(%rbp), %r8d
movl 0x28(%rbx), %r9d
movslq %r9d, %rax
cmpl $0x1, 0x4(%r14,%rax,4)
jne 0x29a9
movq %rbx, %rdi
callq 0x2618
movl -0x2c(%rbp), %r8d
movl 0x28(%rbx), %r9d
movslq %r12d, %r13
movl %r12d, %r14d
cmpl $0x1, %r15d
jne 0x29f4
cmpl %r9d, %r12d
jge 0x29f4
xorl %eax, %eax
movslq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jge 0x29f4
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movslq %r9d, %rsi
cmpq %rsi, %rdx
jg 0x29ef
cmpq %rdx, %r14
je 0x29ea
movq (%rcx,%rdx,8), %rsi
movl (%rsi,%rax,4), %esi
movq (%rcx,%r13,8), %rdi
xorl %esi, (%rdi,%rax,4)
movl 0x28(%rbx), %r9d
incq %rdx
jmp 0x29cb
incq %rax
jmp 0x29bc
cmpl $0x2, %r15d
jne 0x2d6d
movslq %r8d, %rax
movq %rax, -0x70(%rbp)
cmpl %r9d, %r12d
jge 0x2c9f
cmpl %r9d, %r8d
jl 0x2c9f
leal 0x1(%r9), %eax
cmpl %eax, %r8d
jne 0x2a6a
xorl %eax, %eax
movslq 0x8(%rbx), %rcx
cmpq %rcx, %rax
jge 0x2a5a
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movslq %r9d, %rsi
cmpq %rsi, %rdx
jg 0x2a55
cmpq %rdx, %r14
je 0x2a50
movq (%rcx,%rdx,8), %rsi
movl (%rsi,%rax,4), %esi
movq (%rcx,%r13,8), %rdi
xorl %esi, (%rdi,%rax,4)
movl 0x28(%rbx), %r9d
incq %rdx
jmp 0x2a31
incq %rax
jmp 0x2a22
movq %rbx, %rdi
callq 0x2618
movl -0x2c(%rbp), %r8d
movl 0x28(%rbx), %r9d
cmpl %r9d, %r8d
jne 0x2c9f
movq %r12, -0x60(%rbp)
movl 0x10(%rbx), %r15d
movslq 0xc(%rbx), %r12
movl %r12d, %eax
imull %r15d, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
pushq $0x1
popq %rdi
callq 0x1070
movq %rax, -0x40(%rbp)
leaq (,%r12,4), %rsi
pushq $0x1
popq %rdi
movq %rsi, -0x50(%rbp)
callq 0x1070
movq %rax, -0x38(%rbp)
movslq 0x14(%rbx), %rdi
movq 0x18(%rbx), %r8
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %esi
cmovgl %r12d, %esi
movl -0x2c(%rbp), %edx
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
movq %rcx, -0x48(%rbp)
movq -0x40(%rbp), %r11
cmpq %rdi, %rax
jg 0x2b3a
movq %rax, -0x68(%rbp)
addl %r15d, %eax
movl %eax, -0x58(%rbp)
xorl %r10d, %r10d
cmpq -0x48(%rbp), %r10
je 0x2b2d
movl -0x58(%rbp), %ecx
subl %r10d, %ecx
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x2b28
movl %ecx, %eax
cltd
idivl %r15d
cmpl %edi, %edx
jge 0x2b23
imull %r12d, %edx
movslq %edx, %rax
shlq $0x2, %rax
addq (%r8,%r10,8), %rax
movl (%rax,%r9,4), %eax
xorl %eax, (%r11,%r9,4)
incq %r9
jmp 0x2afd
incq %r10
jmp 0x2aee
movq -0x68(%rbp), %rax
incq %rax
addq -0x50(%rbp), %r11
jmp 0x2adc
movq -0x60(%rbp), %rax
addl %r15d, %eax
decl %eax
cltd
idivl %r15d
leal -0x1(%r15), %eax
movl %edx, %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
movq -0x40(%rbp), %r9
leaq (%r9,%rcx,4), %r9
shlq $0x2, %rcx
movq %rcx, -0x48(%rbp)
xorl %r10d, %r10d
movq -0x38(%rbp), %rcx
cmpq %r10, %rsi
je 0x2b98
cmpl %eax, %edx
jne 0x2b7a
movl (%r9,%r10,4), %r11d
jmp 0x2b8f
movq -0x70(%rbp), %r11
movq 0x8(%r8,%r11,8), %r11
addq -0x48(%rbp), %r11
movl (%r11,%r10,4), %r11d
xorl (%r9,%r10,4), %r11d
movl %r11d, (%rcx,%r10,4)
incq %r10
jmp 0x2b6b
xorl %r9d, %r9d
testl %edi, %edi
movl $0x0, %eax
cmovgl %edi, %eax
movq %rax, -0x58(%rbp)
xorl %edx, %edx
movq -0x40(%rbp), %rax
movq %r9, -0x48(%rbp)
movq -0x38(%rbp), %r10
movq %rsi, %r11
cmpq -0x58(%rbp), %rdx
jne 0x2bde
jmp 0x2bf1
movq -0x70(%rbp), %rcx
movq 0x8(%r8,%rcx,8), %rcx
movl (%rcx,%r9), %ecx
xorl (%r10), %ecx
xorl %ecx, (%rax,%r9)
addq $0x4, %r10
addq $0x4, %r9
subq $0x1, %r11
jae 0x2bc2
incq %rdx
movq -0x48(%rbp), %r9
addq -0x50(%rbp), %r9
jmp 0x2baf
imull %edi, %r12d
movslq %r12d, %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movq -0x60(%rbp), %rdi
cmpq %rcx, %rsi
je 0x2c1a
movq -0x38(%rbp), %rdx
movl (%rdx,%rcx,4), %edx
xorl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x2c06
negl %edi
xorl %r12d, %r12d
cmpl %r15d, %r12d
jge 0x2c79
leal (%rdi,%r15), %eax
addl %r12d, %eax
cltd
idivl %r15d
leal -0x1(%r15), %eax
cmpl %eax, %edx
jge 0x2c74
movq %rdi, %r15
movq 0x18(%rbx), %rcx
movslq 0xc(%rbx), %rax
imull %eax, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
addq (%rcx,%r13,8), %rdi
movl %eax, %ecx
imull %r12d, %ecx
movslq %ecx, %rcx
movq -0x40(%rbp), %rdx
leaq (%rdx,%rcx,4), %rsi
shlq $0x2, %rax
movq %rax, %rdx
callq 0x1090
movq %r15, %rdi
movl 0x10(%rbx), %r15d
incl %r12d
jmp 0x2c1f
movq -0x40(%rbp), %rdi
callq 0x10d0
movq -0x38(%rbp), %rdi
callq 0x10d0
movq %rbx, %rdi
callq 0x25de
movl 0x28(%rbx), %r9d
movl -0x2c(%rbp), %r8d
movq -0x60(%rbp), %r12
cmpl %r9d, %r12d
jge 0x2d6d
cmpl %r9d, %r8d
jge 0x2d6d
movq %r12, -0x60(%rbp)
movl 0xc(%rbx), %r15d
movl 0x10(%rbx), %ecx
movl %r15d, %eax
movq %rcx, -0x48(%rbp)
imull %ecx, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
pushq $0x1
popq %rdi
movq %r9, -0x78(%rbp)
callq 0x1070
movq %rax, -0x68(%rbp)
movl %r15d, -0x40(%rbp)
movslq %r15d, %r12
leaq (,%r12,4), %rsi
pushq $0x1
popq %rdi
movq %rsi, -0x50(%rbp)
callq 0x1070
movq %rax, -0x38(%rbp)
movl 0x14(%rbx), %edx
movslq %edx, %rsi
movq 0x18(%rbx), %r15
movslq -0x78(%rbp), %rcx
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
movq %rsi, -0x88(%rbp)
testl %esi, %esi
movl $0x0, %esi
movl %edx, -0x58(%rbp)
cmovgl %edx, %esi
movq %rsi, -0x80(%rbp)
xorl %edx, %edx
movq %rax, %rdi
movq -0x38(%rbp), %r8
movq %r12, %r9
cmpq -0x80(%rbp), %rdx
je 0x2d7c
subq $0x1, %r9
jb 0x2d64
movl (%r8), %r10d
movq (%r15,%rcx,8), %r11
movq 0x8(%r15,%rcx,8), %rsi
xorl (%r11,%rdi), %r10d
xorl (%rsi,%rdi), %r10d
movl %r10d, (%r8)
addq $0x4, %r8
addq $0x4, %rdi
jmp 0x2d3d
incq %rdx
addq -0x50(%rbp), %rax
jmp 0x2d2d
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl -0x78(%rbp), %r8d
xorl %r9d, %r9d
movq -0x68(%rbp), %r11
movq %r11, %r10
cmpq -0x88(%rbp), %r9
jg 0x2de7
movq -0x48(%rbp), %rax
leal (%rax,%r9), %r11d
xorl %edi, %edi
cmpq %r8, %rdi
je 0x2dda
movl %r11d, %eax
subl %edi, %eax
cltd
idivl -0x48(%rbp)
cmpl -0x58(%rbp), %edx
jge 0x2dd5
imull -0x40(%rbp), %edx
movslq %edx, %rax
shlq $0x2, %rax
xorl %edx, %edx
cmpq %rdx, %r12
je 0x2dd5
movq (%r15,%rdi,8), %rsi
addq %rax, %rsi
movl (%rsi,%rdx,4), %esi
xorl %esi, (%r10,%rdx,4)
incq %rdx
jmp 0x2dbd
incq %rdi
jmp 0x2d9d
incq %r9
addq -0x50(%rbp), %r10
movq -0x68(%rbp), %r11
jmp 0x2d8a
xorl %eax, %eax
xorl %edx, %edx
movq %rax, %rdi
movq -0x38(%rbp), %r8
movq %r12, %r9
cmpq -0x80(%rbp), %rdx
je 0x2e24
subq $0x1, %r9
jb 0x2e1b
movq 0x8(%r15,%rcx,8), %rsi
movl (%r8), %r10d
xorl (%rsi,%rdi), %r10d
xorl %r10d, (%r11,%rdi)
addq $0x4, %r8
addq $0x4, %rdi
jmp 0x2dfb
incq %rdx
addq -0x50(%rbp), %rax
jmp 0x2deb
movl -0x58(%rbp), %eax
movl -0x40(%rbp), %esi
imull %esi, %eax
cltq
leaq (%r11,%rax,4), %rax
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x2e49
movq -0x38(%rbp), %rdx
movl (%rdx,%rcx,4), %edx
xorl %edx, (%rax,%rcx,4)
incq %rcx
jmp 0x2e35
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
movl %edx, %r12d
movl %edx, %eax
imull %esi, %eax
cltq
leaq (%r11,%rax,4), %rsi
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rdx
callq 0x1090
movl %r12d, %eax
movl -0x58(%rbp), %esi
movl -0x2c(%rbp), %r9d
subl %r9d, %eax
movq -0x48(%rbp), %rcx
addl %ecx, %eax
cltd
idivl %ecx
cmpl %esi, %edx
je 0x2f6b
movl %edx, %r12d
movl -0x40(%rbp), %eax
movslq %eax, %rdx
imull %r12d, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
movq -0x70(%rbp), %rax
addq (%r15,%rax,8), %rdi
shlq $0x2, %rdx
movq -0x38(%rbp), %rsi
callq 0x1090
xorl %eax, %eax
movq -0x68(%rbp), %r9
movl 0xc(%rbx), %ecx
cmpl %ecx, %eax
jge 0x2eff
movq 0x18(%rbx), %rcx
xorl %edx, %edx
movslq 0x28(%rbx), %rsi
cmpq %rsi, %rdx
jg 0x2efb
cmpq %rdx, %r14
je 0x2ef6
movq (%rcx,%rdx,8), %rsi
movl 0xc(%rbx), %edi
imull %r12d, %edi
addl %eax, %edi
movslq %edi, %rdi
movl (%rsi,%rdi,4), %esi
movq (%rcx,%r13,8), %r8
xorl %esi, (%r8,%rdi,4)
incq %rdx
jmp 0x2ecd
incl %eax
jmp 0x2ec0
movq -0x60(%rbp), %rax
addl %r12d, %eax
movl 0x10(%rbx), %esi
addl %esi, %eax
cltd
movq %rsi, -0x48(%rbp)
idivl %esi
movl %edx, %eax
movq 0x18(%rbx), %r15
imull %ecx, %r12d
imull %ecx, %edx
movslq %edx, %rdx
testl %ecx, %ecx
movl $0x0, %r11d
movl %ecx, -0x40(%rbp)
cmovgl %ecx, %r11d
movslq %r12d, %rcx
leaq (%r9,%rdx,4), %rdx
shlq $0x2, %rcx
xorl %esi, %esi
movl -0x2c(%rbp), %r9d
movq -0x38(%rbp), %r10
cmpq %rsi, %r11
je 0x2f63
movq (%r15,%r13,8), %rdi
addq %rcx, %rdi
movl (%rdx,%rsi,4), %r8d
xorl (%rdi,%rsi,4), %r8d
movl %r8d, (%r10,%rsi,4)
incq %rsi
jmp 0x2f46
movl 0x14(%rbx), %esi
jmp 0x2e7d
movq -0x68(%rbp), %rdi
callq 0x10d0
movq -0x38(%rbp), %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
nop