// File: /workspace/github_c_makefile_star2_O0/vrancurel[P]ec/gf.c
// Function: utest
void utest()
{
#if W == 4
  assert(gmul(3, 7) == 9);
  assert(gmul(13, 10) == 11);  
  assert(gdiv(13, 10) == 3);
  assert(gdiv(3, 7) == 10);
  /* non-MDS vandermonde matrix */
  t_mat *mat = mat_vandermonde(3, 3);
  t_vec *vec = vec_xcalloc(3);
  VEC_ITEM(vec, 0) = 3;
  VEC_ITEM(vec, 1) = 13;
  VEC_ITEM(vec, 2) = 9;
  t_vec *output = vec_xcalloc(3);
  mat_mult(output, mat, vec);
  assert(VEC_ITEM(output, 0) == 7);
  assert(VEC_ITEM(output, 1) == 2);
  assert(VEC_ITEM(output, 2) == 9);
  VEC_ITEM(vec, 0) = 3;
  VEC_ITEM(vec, 1) = 1;
  VEC_ITEM(vec, 2) = 9;
  mat_mult(output, mat, vec);
  assert(VEC_ITEM(output, 0) == 11);
  assert(VEC_ITEM(output, 1) == 9);
  assert(VEC_ITEM(output, 2) == 12);
  MAT_ITEM(mat, 0, 0) = 1;
  MAT_ITEM(mat, 0, 1) = 0;
  MAT_ITEM(mat, 0, 2) = 0;
  MAT_ITEM(mat, 1, 0) = 1;
  MAT_ITEM(mat, 1, 1) = 1;
  MAT_ITEM(mat, 1, 2) = 1;
  MAT_ITEM(mat, 2, 0) = 1;
  MAT_ITEM(mat, 2, 1) = 2;
  MAT_ITEM(mat, 2, 2) = 3;
  VEC_ITEM(vec, 0) = 3;
  VEC_ITEM(vec, 1) = 11;
  VEC_ITEM(vec, 2) = 9;
  mat_inv(mat);
  mat_mult(output, mat, vec);
  assert(VEC_ITEM(output, 1) == 1);
  assert(VEC_ITEM(output, 2) == 9);
  vec_free(output);
  vec_free(vec);
  mat_free(mat);
  mat = mat_vandermonde_correct(3, 3);
  mat_free(mat);
  mat = mat_cauchy(3, 3);
  mat_free(mat);
#elif W == 8
  assert(gmul(3, 7) == 9);
  assert(gmul(13, 10) == 114);
  assert(gdiv(13, 10) == 40);
  assert(gdiv(3, 7) == 211);
#else
  //TBD
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x3, %edi
movl $0x7, %esi
callq 0x1440
cmpl $0x9, %eax
jne 0x15be
jmp 0x15dd
leaq 0x2a43(%rip), %rdi      # 0x4008
leaq 0x2a4c(%rip), %rsi      # 0x4018
movl $0x86, %edx
leaq 0x2a45(%rip), %rcx      # 0x401d
callq 0x1080
movl $0xd, %edi
movl $0xa, %esi
callq 0x1440
cmpl $0xb, %eax
jne 0x15f3
jmp 0x1612
leaq 0x2a30(%rip), %rdi      # 0x402a
leaq 0x2a17(%rip), %rsi      # 0x4018
movl $0x87, %edx
leaq 0x2a10(%rip), %rcx      # 0x401d
callq 0x1080
movl $0xd, %edi
movl $0xa, %esi
callq 0x14b0
cmpl $0x3, %eax
jne 0x1628
jmp 0x1647
leaq 0x2a0e(%rip), %rdi      # 0x403d
leaq 0x29e2(%rip), %rsi      # 0x4018
movl $0x88, %edx
leaq 0x29db(%rip), %rcx      # 0x401d
callq 0x1080
movl $0x3, %edi
movl $0x7, %esi
callq 0x14b0
cmpl $0xa, %eax
jne 0x165d
jmp 0x167c
leaq 0x29eb(%rip), %rdi      # 0x404f
leaq 0x29ad(%rip), %rsi      # 0x4018
movl $0x89, %edx
leaq 0x29a6(%rip), %rcx      # 0x401d
callq 0x1080
movl $0x3, %esi
movl %esi, %edi
callq 0x2b40
movq %rax, -0x8(%rbp)
movl $0x3, %edi
callq 0x3950
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x3, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xd, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x9, 0x8(%rax)
movl $0x3, %edi
callq 0x3950
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x36a0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x7, (%rax)
jne 0x16f4
jmp 0x1713
leaq 0x2965(%rip), %rdi      # 0x4060
leaq 0x2916(%rip), %rsi      # 0x4018
movl $0x92, %edx
leaq 0x290f(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x2, 0x4(%rax)
jne 0x1723
jmp 0x1742
leaq 0x294f(%rip), %rdi      # 0x4079
leaq 0x28e7(%rip), %rsi      # 0x4018
movl $0x93, %edx
leaq 0x28e0(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x9, 0x8(%rax)
jne 0x1752
jmp 0x1771
leaq 0x2939(%rip), %rdi      # 0x4092
leaq 0x28b8(%rip), %rsi      # 0x4018
movl $0x94, %edx
leaq 0x28b1(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x3, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x1, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x9, 0x8(%rax)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x36a0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0xb, (%rax)
jne 0x17bd
jmp 0x17dc
leaq 0x28e7(%rip), %rdi      # 0x40ab
leaq 0x284d(%rip), %rsi      # 0x4018
movl $0x99, %edx
leaq 0x2846(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x9, 0x4(%rax)
jne 0x17ec
jmp 0x180b
leaq 0x28d2(%rip), %rdi      # 0x40c5
leaq 0x281e(%rip), %rsi      # 0x4018
movl $0x9a, %edx
leaq 0x2817(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0xc, 0x8(%rax)
jne 0x181b
jmp 0x183a
leaq 0x28bc(%rip), %rdi      # 0x40de
leaq 0x27ef(%rip), %rsi      # 0x4018
movl $0x9b, %edx
leaq 0x27e8(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
imull $0x0, 0x4(%rcx), %ecx
addl $0x0, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
imull $0x0, 0x4(%rcx), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl $0x0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
imull $0x0, 0x4(%rcx), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movl $0x0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll $0x0, %ecx
addl $0x0, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll $0x0, %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll $0x0, %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
addl $0x0, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl $0x2, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movl $0x3, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x3, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0xb, 0x4(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x9, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x3240
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x36a0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x4(%rax)
jne 0x1995
jmp 0x19b4
leaq 0x275c(%rip), %rdi      # 0x40f8
leaq 0x2675(%rip), %rsi      # 0x4018
movl $0xaa, %edx
leaq 0x266e(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x9, 0x8(%rax)
jne 0x19c4
jmp 0x19e3
leaq 0x26c7(%rip), %rdi      # 0x4092
leaq 0x2646(%rip), %rsi      # 0x4018
movl $0xab, %edx
leaq 0x263f(%rip), %rcx      # 0x401d
callq 0x1080
movq -0x18(%rbp), %rdi
callq 0x39a0
movq -0x10(%rbp), %rdi
callq 0x39a0
movq -0x8(%rbp), %rdi
callq 0x2a80
movl $0x3, %esi
movl %esi, %edi
callq 0x3060
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a80
movl $0x3, %esi
movl %esi, %edi
callq 0x2bd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a80
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)