// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x28(%rdi), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, -0x38(%rbp)
cmpq $-0x1, %rax
jl 0x2b5f
leal 0x2(%rax), %ecx
xorl %r12d, %r12d
cmpl $0x1, (%r14,%r12,4)
je 0x2b6a
incq %r12
cmpq %r12, %rcx
jne 0x2b50
xorl %r15d, %r15d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
jmp 0x2bde
movq %r12, %rcx
cmpq %rax, %rcx
jg 0x2b8c
leaq 0x1(%rcx), %rdx
cmpl $0x1, 0x4(%r14,%rcx,4)
movq %rdx, %rcx
jne 0x2b6d
movl $0x2, %r15d
movq %rdx, %r13
jmp 0x2b98
movl $0x1, %r15d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x18(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq 0x8(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1050
cmpl $-0x1, %r13d
je 0x2bd4
movq 0x18(%rbx), %rax
movslq %r13d, %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x8(%rbx), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1050
movq %r13, %r10
jmp 0x2bda
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movq %r12, -0x38(%rbp)
movl 0x28(%rbx), %r13d
cmpl %r13d, -0x38(%rbp)
movq %r10, -0x48(%rbp)
jl 0x2c21
movslq %r13d, %rax
cmpl $0x1, (%r14,%rax,4)
jne 0x2c09
movq %rbx, %rdi
callq 0x280c
movq -0x48(%rbp), %r10
movl 0x28(%rbx), %r13d
movslq %r13d, %rax
cmpl $0x1, 0x4(%r14,%rax,4)
jne 0x2c21
movq %rbx, %rdi
callq 0x2856
movq -0x48(%rbp), %r10
movl 0x28(%rbx), %r13d
cmpl $0x1, %r15d
jne 0x2c8e
cmpl %r13d, -0x38(%rbp)
jge 0x2c8e
movl 0x8(%rbx), %esi
testl %esi, %esi
jle 0x327d
movq -0x38(%rbp), %rcx
movslq %ecx, %rax
movl %ecx, %ecx
negq %rcx
xorl %edx, %edx
testl %r13d, %r13d
js 0x2c83
movq 0x18(%rbx), %rsi
movq $-0x1, %rdi
leaq (%rcx,%rdi), %r8
cmpq $-0x1, %r8
je 0x2c75
movq 0x8(%rsi,%rdi,8), %r8
movl (%r8,%rdx,4), %r8d
movq (%rsi,%rax,8), %r9
xorl %r8d, (%r9,%rdx,4)
movl 0x28(%rbx), %r13d
movslq %r13d, %r8
incq %rdi
cmpq %r8, %rdi
jl 0x2c56
movl 0x8(%rbx), %esi
incq %rdx
movslq %esi, %rdi
cmpq %rdi, %rdx
jl 0x2c46
cmpl $0x2, %r15d
jne 0x327d
cmpl %r13d, -0x38(%rbp)
jge 0x2f49
cmpl %r13d, %r10d
jl 0x2f49
leal 0x1(%r13), %eax
cmpl %eax, %r10d
jne 0x2d21
movl 0x8(%rbx), %esi
testl %esi, %esi
jle 0x2d11
movq -0x38(%rbp), %rcx
movslq %ecx, %rax
movl %ecx, %ecx
negq %rcx
xorl %edx, %edx
testl %r13d, %r13d
js 0x2d06
movq 0x18(%rbx), %rsi
movq $-0x1, %rdi
leaq (%rcx,%rdi), %r8
cmpq $-0x1, %r8
je 0x2cf8
movq 0x8(%rsi,%rdi,8), %r8
movl (%r8,%rdx,4), %r8d
movq (%rsi,%rax,8), %r9
xorl %r8d, (%r9,%rdx,4)
movl 0x28(%rbx), %r13d
movslq %r13d, %r8
incq %rdi
cmpq %r8, %rdi
jl 0x2cd9
movl 0x8(%rbx), %esi
incq %rdx
movslq %esi, %rdi
cmpq %rdi, %rdx
jl 0x2cc9
movq %rbx, %rdi
callq 0x2856
movl 0x28(%rbx), %r13d
movq -0x48(%rbp), %r10
cmpl %r13d, %r10d
jne 0x2f49
movl 0x10(%rbx), %ecx
movslq 0xc(%rbx), %r15
movl %r15d, %r14d
movl %r15d, %eax
movq %rcx, -0x30(%rbp)
imull %ecx, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
movl $0x1, %edi
callq 0x1060
movq %rax, -0x40(%rbp)
movq %r15, -0x58(%rbp)
leaq (,%r15,4), %rsi
movl $0x1, %edi
movq %rsi, -0x50(%rbp)
callq 0x1060
movq -0x48(%rbp), %rdx
movq %rax, %r15
movl 0x14(%rbx), %ecx
testl %ecx, %ecx
js 0x2df2
movq 0x18(%rbx), %rsi
leaq 0x1(%rcx), %rax
movq %rax, -0x60(%rbp)
movl %edx, %r8d
xorl %r9d, %r9d
movq -0x40(%rbp), %r10
testl %edx, %edx
jle 0x2de1
movq -0x30(%rbp), %rax
leal (%rax,%r9), %r11d
xorl %r12d, %r12d
testl %r14d, %r14d
jle 0x2dd9
movl %r11d, %eax
subl %r12d, %eax
cltd
idivl -0x30(%rbp)
movl %edx, %eax
imull %r14d, %eax
cltq
shlq $0x2, %rax
xorl %edi, %edi
cmpl %ecx, %edx
jge 0x2dd1
movq (%rsi,%r12,8), %r13
addq %rax, %r13
movl (%r13,%rdi,4), %r13d
xorl %r13d, (%r10,%rdi,4)
incq %rdi
cmpq %rdi, %r14
jne 0x2dbd
incq %r12
cmpq %r8, %r12
jne 0x2da0
incq %r9
addq -0x50(%rbp), %r10
cmpq -0x60(%rbp), %r9
movq -0x48(%rbp), %rdx
jne 0x2d91
movslq %edx, %rsi
testl %r14d, %r14d
jle 0x2e50
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rdi
addl %edi, %eax
decl %eax
cltd
idivl %edi
leal -0x1(%rdi), %eax
movl %edx, %r8d
imull -0x58(%rbp), %r8d
movq 0x18(%rbx), %rdi
movslq %r8d, %r8
movq -0x40(%rbp), %r9
leaq (%r9,%r8,4), %r9
shlq $0x2, %r8
xorl %r10d, %r10d
cmpl %eax, %edx
jne 0x2e34
movl (%r9,%r10,4), %r11d
jmp 0x2e44
movq 0x8(%rdi,%rsi,8), %r11
addq %r8, %r11
movl (%r11,%r10,4), %r11d
xorl (%r9,%r10,4), %r11d
movl %r11d, (%r15,%r10,4)
incq %r10
cmpq %r10, %r14
jne 0x2e2a
testl %ecx, %ecx
jle 0x2e9b
movq 0x18(%rbx), %rax
leaq (,%r14,4), %rdx
xorl %edi, %edi
movq -0x40(%rbp), %r8
xorl %r9d, %r9d
testl %r14d, %r14d
jle 0x2e8d
movq 0x8(%rax,%rsi,8), %r10
addq %rdi, %r10
xorl %r11d, %r11d
movl (%r10,%r11,4), %r12d
xorl (%r15,%r11,4), %r12d
xorl %r12d, (%r8,%r11,4)
incq %r11
cmpq %r11, %r14
jne 0x2e79
incq %r9
addq %rdx, %r8
addq %rdx, %rdi
cmpq %rcx, %r9
jne 0x2e69
testl %r14d, %r14d
movq -0x58(%rbp), %rsi
jle 0x2ec4
imull %ecx, %r14d
movslq %r14d, %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movl (%r15,%rcx,4), %edx
xorl %edx, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %rsi
jne 0x2eb5
movq -0x30(%rbp), %rcx
testl %ecx, %ecx
jle 0x2f28
movq -0x38(%rbp), %r12
movslq %r12d, %r13
negl %r12d
xorl %r14d, %r14d
leal (%r12,%rcx), %eax
addl %r14d, %eax
cltd
idivl %ecx
leal -0x1(%rcx), %eax
cmpl %eax, %edx
jge 0x2f20
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 %r14d, %ecx
movslq %ecx, %rcx
movq -0x40(%rbp), %rdx
leaq (%rdx,%rcx,4), %rsi
shlq $0x2, %rax
movq %rax, %rdx
callq 0x1080
movl 0x10(%rbx), %ecx
incl %r14d
cmpl %ecx, %r14d
jl 0x2ed9
movq -0x40(%rbp), %rdi
callq 0x10c0
movq %r15, %rdi
callq 0x10c0
movq %rbx, %rdi
callq 0x280c
movl 0x28(%rbx), %r13d
movq -0x48(%rbp), %r10
cmpl %r13d, -0x38(%rbp)
jge 0x327d
cmpl %r13d, %r10d
jge 0x327d
movl 0xc(%rbx), %r14d
movl 0x10(%rbx), %r12d
movl %r14d, %eax
imull %r12d, %eax
movslq %eax, %rsi
shlq $0x2, %rsi
movl $0x1, %edi
callq 0x1060
movq %rax, -0x40(%rbp)
movslq %r14d, %rsi
shlq $0x2, %rsi
movl $0x1, %edi
movq %rsi, -0x60(%rbp)
callq 0x1060
movq %rax, %r15
movl 0x14(%rbx), %eax
movslq %r13d, %rcx
movq %rax, -0x30(%rbp)
testl %eax, %eax
jle 0x2ff1
movq 0x18(%rbx), %rax
leaq (,%r14,4), %rdx
xorl %esi, %esi
xorl %edi, %edi
testl %r14d, %r14d
jle 0x2fe5
movq 0x8(%rax,%rcx,8), %r8
addq %rsi, %r8
movq (%rax,%rcx,8), %r9
addq %rsi, %r9
xorl %r10d, %r10d
movl (%r15,%r10,4), %r11d
xorl (%r9,%r10,4), %r11d
xorl (%r8,%r10,4), %r11d
movl %r11d, (%r15,%r10,4)
incq %r10
cmpq %r10, %r14
jne 0x2fcd
incq %rdi
addq %rdx, %rsi
cmpq -0x30(%rbp), %rdi
jne 0x2fb6
movq %rcx, -0x58(%rbp)
cmpl $0x0, -0x30(%rbp)
movq %r15, -0x50(%rbp)
js 0x30c9
movq 0x18(%rbx), %rsi
movq -0x30(%rbp), %rax
leaq 0x1(%rax), %rdi
movl %r13d, %r8d
xorl %r9d, %r9d
movq -0x40(%rbp), %r10
testl %r13d, %r13d
jle 0x3067
leal (%r12,%r9), %r11d
xorl %r15d, %r15d
testl %r14d, %r14d
setle %cl
movl %r11d, %eax
subl %r15d, %eax
cltd
idivl %r12d
cmpl -0x30(%rbp), %edx
setge %al
orb %cl, %al
jne 0x305f
imull %r14d, %edx
movslq %edx, %rax
shlq $0x2, %rax
addq (%rsi,%r15,8), %rax
xorl %edx, %edx
movl (%rax,%rdx,4), %ecx
xorl %ecx, (%r10,%rdx,4)
incq %rdx
cmpq %rdx, %r14
jne 0x3050
incq %r15
cmpq %r8, %r15
jne 0x3025
incq %r9
addq -0x60(%rbp), %r10
cmpq %rdi, %r9
jne 0x3019
cmpl $0x0, -0x30(%rbp)
movq -0x50(%rbp), %r15
jle 0x30c9
movq 0x18(%rbx), %rax
leaq (,%r14,4), %rdx
xorl %esi, %esi
movq -0x40(%rbp), %rdi
xorl %r8d, %r8d
testl %r14d, %r14d
jle 0x30ba
movq -0x58(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %r9
addq %rsi, %r9
xorl %r10d, %r10d
movl (%r15,%r10,4), %ecx
xorl (%r9,%r10,4), %ecx
xorl %ecx, (%rdi,%r10,4)
incq %r10
cmpq %r10, %r14
jne 0x30a6
incq %r8
addq %rdx, %rdi
addq %rdx, %rsi
cmpq -0x30(%rbp), %r8
jne 0x3092
testl %r14d, %r14d
jle 0x30f1
movq -0x30(%rbp), %rax
imull %r14d, %eax
cltq
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
xorl %ecx, %ecx
movl (%r15,%rcx,4), %edx
xorl %edx, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r14
jne 0x30e2
movq -0x38(%rbp), %rax
addl %r12d, %eax
decl %eax
cltd
idivl %r12d
movl %edx, %r13d
movl %edx, %eax
imull %r14d, %eax
cltq
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %r15, %rdi
movq -0x60(%rbp), %rdx
callq 0x1080
movq -0x48(%rbp), %rcx
subl %ecx, %r13d
addl %r12d, %r13d
movl %r13d, %eax
cltd
idivl %r12d
cmpl -0x30(%rbp), %edx
je 0x325d
movl %edx, %r12d
movslq %ecx, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movslq %eax, %r13
movl %eax, %r15d
negq %r15
movq 0x18(%rbx), %rax
movslq %r14d, %rdx
imull %r12d, %r14d
movslq %r14d, %rdi
shlq $0x2, %rdi
movq -0x30(%rbp), %rcx
addq (%rax,%rcx,8), %rdi
shlq $0x2, %rdx
movq -0x50(%rbp), %rsi
callq 0x1080
movl 0xc(%rbx), %r14d
testl %r14d, %r14d
jle 0x3233
movl 0x28(%rbx), %ecx
xorl %eax, %eax
movq -0x48(%rbp), %r10
testl %ecx, %ecx
js 0x31d2
movq 0x18(%rbx), %rdx
movq $-0x1, %rsi
leaq (%r15,%rsi), %rdi
cmpq $-0x1, %rdi
je 0x31c3
movq 0x8(%rdx,%rsi,8), %rcx
movl 0xc(%rbx), %edi
imull %r12d, %edi
addl %eax, %edi
movslq %edi, %rdi
movl (%rcx,%rdi,4), %ecx
movq (%rdx,%r13,8), %r8
xorl %ecx, (%r8,%rdi,4)
movl 0x28(%rbx), %ecx
movslq %ecx, %rdi
incq %rsi
cmpq %rdi, %rsi
jl 0x319a
movl 0xc(%rbx), %r14d
incl %eax
cmpl %r14d, %eax
jl 0x318b
movq -0x38(%rbp), %rax
addl %r12d, %eax
movl 0x10(%rbx), %ecx
addl %ecx, %eax
cltd
idivl %ecx
movl %edx, %eax
testl %r14d, %r14d
jle 0x3249
movq 0x18(%rbx), %rdi
imull %r14d, %r12d
movl %eax, %esi
imull %r14d, %esi
movslq %r12d, %rdx
movslq %esi, %r8
movl %r14d, %esi
shlq $0x2, %rdx
addq (%rdi,%r13,8), %rdx
movq -0x40(%rbp), %rdi
leaq (%rdi,%r8,4), %rdi
xorl %r8d, %r8d
movq -0x50(%rbp), %r11
movl (%rdi,%r8,4), %r9d
xorl (%rdx,%r8,4), %r9d
movl %r9d, (%r11,%r8,4)
incq %r8
cmpq %r8, %rsi
jne 0x321d
jmp 0x3249
addl -0x38(%rbp), %r12d
movl 0x10(%rbx), %ecx
addl %ecx, %r12d
movl %r12d, %eax
cltd
idivl %ecx
movl %edx, %eax
movq -0x48(%rbp), %r10
subl %r10d, %eax
addl %ecx, %eax
cltd
idivl %ecx
movl %edx, %r12d
cmpl 0x14(%rbx), %edx
jne 0x314e
movq -0x40(%rbp), %rdi
callq 0x10c0
movq -0x50(%rbp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq