// File: /workspace/github_cpp_makefile_star2_O3/syzcch[P]FEC_C_version/./fec_star.h
// Function: star::STAR_encoding_diag1()
void STAR_encoding_diag1()
    {
        int i,j,stripe,k;
        int **tmp;

        tmp =  (int**)malloc((block_nbr+1) * sizeof(int*));
        for( i = 0; i < block_nbr + 1; i++)
        {
            tmp[i] = (int*)malloc(sizeof(int) * block_size);
            memset(tmp[i], 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][j] ^= check_data[i][(stripe - i + p)%p * block_size + j];

                    }
                }

            }

        }
        /*after store diagonal line checksum in tmp[block_nbr]*/
        /*we need using diagonal line checksum and s to do xor compute */
        for( i = 0; i<block_nbr; i++)
        {
            for( j = 0; j<block_size; j++)
            {
                tmp[i][j] = tmp[i][j] ^ tmp[block_nbr][j];

            }
        }

        for( i = 0; i < block_nbr; i++)
        {
            memmove(check_data[data_disk_nbr + 1] + (i * block_size), tmp[i], block_size * sizeof(int));
        }

        for(int i = 0; i < block_nbr+1; i++)
        {
            free(tmp[i]);

        }
        free(tmp);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %r15d
leal 0x1(%r15), %r12d
movslq %r12d, %rdi
shlq $0x3, %rdi
callq 0x10e0
movq %rax, %r14
testl %r15d, %r15d
js 0x29cc
movq %r15, -0x30(%rbp)
movslq 0xc(%rbx), %r15
shlq $0x2, %r15
movl %r12d, %r13d
xorl %r12d, %r12d
movl $0x1, %edi
movq %r15, %rsi
callq 0x1060
movq %rax, (%r14,%r12,8)
incq %r12
cmpq %r12, %r13
jne 0x2899
movq -0x30(%rbp), %rdi
testl %edi, %edi
js 0x29cc
movl 0x28(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
jle 0x2925
movl 0xc(%rbx), %edi
xorl %esi, %esi
testl %edi, %edi
jle 0x2917
movl %ecx, %r8d
subl %esi, %r8d
movq 0x18(%rbx), %r9
xorl %r10d, %r10d
movl 0x10(%rbx), %r11d
leal (%r11,%r8), %eax
cltd
idivl %r11d
cmpl 0x14(%rbx), %edx
jge 0x2909
movq (%r9,%rsi,8), %rax
imull %edi, %edx
addl %r10d, %edx
movslq %edx, %rdx
movl (%rax,%rdx,4), %eax
movq (%r14,%rcx,8), %rdx
xorl %eax, (%rdx,%r10,4)
movl 0xc(%rbx), %edi
incq %r10
movslq %edi, %rax
cmpq %rax, %r10
jl 0x28dd
movl 0x28(%rbx), %eax
incq %rsi
movslq %eax, %rdx
cmpq %rdx, %rsi
jl 0x28cc
movl 0x14(%rbx), %edi
leaq 0x1(%rcx), %rdx
movslq %edi, %rsi
cmpq %rsi, %rcx
movq %rdx, %rcx
jl 0x28c3
testl %edi, %edi
jle 0x29ab
movl 0xc(%rbx), %ecx
xorl %eax, %eax
testl %ecx, %ecx
jle 0x2964
movq (%r14,%rax,8), %rdx
xorl %esi, %esi
movslq 0x14(%rbx), %rcx
movq (%r14,%rcx,8), %rcx
movl (%rcx,%rsi,4), %ecx
xorl %ecx, (%rdx,%rsi,4)
incq %rsi
movslq 0xc(%rbx), %rcx
cmpq %rcx, %rsi
jl 0x2947
movl 0x14(%rbx), %edi
incq %rax
movslq %edi, %rdx
cmpq %rdx, %rax
jl 0x293d
testl %edi, %edi
jle 0x29ab
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movslq 0x28(%rbx), %rcx
movslq 0xc(%rbx), %rdx
movslq %r15d, %rdi
imulq %rdx, %rdi
shlq $0x2, %rdi
addq 0x8(%rax,%rcx,8), %rdi
movq (%r14,%r15,8), %rsi
shlq $0x2, %rdx
callq 0x1120
incq %r15
movslq 0x14(%rbx), %rdi
cmpq %rdi, %r15
jl 0x2976
testl %edi, %edi
js 0x29cc
movq $-0x1, %r15
movq 0x8(%r14,%r15,8), %rdi
callq 0x10c0
movslq 0x14(%rbx), %rax
incq %r15
cmpq %rax, %r15
jl 0x29b6
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0