user: Translate the below assembly code into C programming language:

```asm
<change_basis_tricli>:
  endbr64
  push   %r14
  mulsd  %xmm0,%xmm0
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x148,%rsp
  movupd (%rsi),%xmm4
  movupd 0x10(%rsi),%xmm5
  movupd 0x20(%rsi),%xmm6
  movupd 0x30(%rsi),%xmm7
  mov    %rsp,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  movsd  0x40(%rsi),%xmm1
  movaps %xmm4,(%rsp)
  movaps %xmm5,0x10(%rsp)
  movaps %xmm6,0x20(%rsp)
  movaps %xmm7,0x30(%rsp)
  movsd  %xmm1,0x40(%rsp)
  call   <niggli_reduce@plt>
  test   %eax,%eax
  je     L25
  movapd (%rsp),%xmm4
  movapd 0x10(%rsp),%xmm5
  lea    0x50(%rsp),%r14
  movapd 0x20(%rsp),%xmm6
  movapd 0x30(%rsp),%xmm7
  mov    %r14,%rdi
  movsd  0x40(%rsp),%xmm0
  movaps %xmm4,0x50(%rsp)
  movaps %xmm5,0x60(%rsp)
  movaps %xmm6,0x70(%rsp)
  movaps %xmm7,0x80(%rsp)
  movsd  %xmm0,0x90(%rsp)
  call   <mat_get_determinant_d3@plt>
  test   %rax,%rax
  js     L24
L37:
  lea    0xa0(%rsp),%r13
  mov    %r12,%rsi
  xor    %edx,%edx
  mov    %r13,%rdi
  lea    0xf0(%rsp),%r12
  call   <mat_inverse_matrix_d3@plt>
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <mat_multiply_matrix_d3@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <mat_cast_matrix_3d_to_3i@plt>
  mov    $0x1,%eax
L25:
  mov    0x138(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x148,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L24:
  movapd D11(%rip),%xmm0
  movapd 0x60(%rsp),%xmm2
  movapd 0x70(%rsp),%xmm1
  movapd 0x50(%rsp),%xmm3
  xorpd  %xmm0,%xmm2
  xorpd  %xmm0,%xmm1
  xorpd  %xmm0,%xmm3
  movaps %xmm2,0x60(%rsp)
  xorpd  0x80(%rsp),%xmm0
  movaps %xmm3,0x50(%rsp)
  movaps %xmm0,0x80(%rsp)
  movsd  0x90(%rsp),%xmm0
  xorpd  D18(%rip),%xmm0
  movaps %xmm1,0x70(%rsp)
  movsd  %xmm0,0x90(%rsp)
  jmp    L37
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D11
type_infered: byte[16]
name: disassemble_data
arguments: data_tag: D18
type_infered: byte[16]

tool: {"D11": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: {"D18": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
int change_basis_tricli(int tmat_int[3][3], double conv_lattice[3][3], double primitive_lattice[3][3], const double symprec) {
  int i, j;
  double niggli_cell[9];
  double smallest_lattice[3][3], inv_lattice[3][3], tmat[3][3];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      niggli_cell[i * 3 + j] = conv_lattice[i][j];
    }
  }
  if (!niggli_reduce(niggli_cell, symprec * symprec)) {
    return 0;
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      smallest_lattice[i][j] = niggli_cell[i * 3 + j];
    }
  }
  if (mat_get_determinant_d3(smallest_lattice) < 0) {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        smallest_lattice[i][j] = -smallest_lattice[i][j];
      }
    }
  }
  mat_inverse_matrix_d3(inv_lattice, primitive_lattice, 0);
  mat_multiply_matrix_d3(tmat, inv_lattice, smallest_lattice);
  mat_cast_matrix_3d_to_3i(tmat_int, tmat);
  return 1;
}
```