// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movl 0x14(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x2180
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x30(%rbp), %rcx
movl -0xc(%rbp), %eax
movl 0x14(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x490c
movq -0x30(%rbp), %rax
movslq 0xc(%rax), %rdi
shlq $0x2, %rdi
callq 0x2180
movq %rax, %rsi
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movq %rsi, (%rcx,%rdx,8)
movq -0x20(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
movslq 0xc(%rax), %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2090
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x48b1
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
movl 0x14(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x49ec
movl $0x0, -0xc(%rbp)
movq -0x30(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x28(%rcx), %eax
jge 0x49dc
movl $0x0, -0x10(%rbp)
movq -0x30(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x49cc
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
subl -0xc(%rbp), %eax
addl 0x10(%rcx), %eax
cltd
idivl 0x10(%rcx)
movl %edx, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x49bc
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rax
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
subl -0xc(%rbp), %eax
addl 0x10(%rcx), %eax
cltd
idivl 0x10(%rcx)
movq -0x38(%rbp), %rax
movl %edx, %ecx
movq -0x30(%rbp), %rdx
imull 0xc(%rdx), %ecx
addl -0x10(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
xorl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0x49be
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4946
jmp 0x49ce
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x492f
jmp 0x49de
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4913
movl $0x0, -0xc(%rbp)
movq -0x30(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x4a67
movl $0x0, -0x10(%rbp)
movq -0x30(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x4a5a
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0xc(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x10(%rbp), %rdx
movl (%rax,%rdx,4), %edx
movq -0x20(%rbp), %rax
movslq 0x14(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
xorl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4a06
jmp 0x4a5c
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x49f3
movl $0x0, -0xc(%rbp)
movq -0x30(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x14(%rcx), %eax
jge 0x4ac4
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movl 0x28(%rax), %edx
addl $0x1, %edx
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rdi
movl -0xc(%rbp), %ecx
imull 0xc(%rax), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rdi
movq -0x20(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rsi
movslq 0xc(%rax), %rdx
shlq $0x2, %rdx
callq 0x21b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4a6e
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rcx
movl -0x24(%rbp), %eax
movl 0x14(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4af8
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2150
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4acb
movq -0x20(%rbp), %rdi
callq 0x2150
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)