user: Converte this assembly snippet into its equivalent C code:

```asm
<fk2mtg>:
  endbr64
  push   %r15
  cvtss2sd %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  mulsd  D29(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm1
  cvttss2si %xmm1,%r12d
  movss  %xmm1,0x4(%rsp)
  mov    %r12d,%edi
  call   <sin@plt>
  mov    %r12d,%edi
  movss  %xmm0,0xc(%rsp)
  call   <cos@plt>
  movss  0x4(%rsp),%xmm1
  movss  %xmm0,0x8(%rsp)
  addss  %xmm1,%xmm1
  cvttss2si %xmm1,%r12d
  mov    %r12d,%edi
  call   <sin@plt>
  mov    %r12d,%edi
  movss  %xmm0,0x4(%rsp)
  call   <cos@plt>
  test   %ebx,%ebx
  jle    L7
  mov    0x48(%r15),%rdi
  mov    (%r15),%r8
  movaps %xmm0,%xmm2
  movslq %ebx,%rdx
  mov    0x30(%r15),%r14
  mov    0x0(%rbp),%rcx
  xor    %eax,%eax
  movsd  D47(%rip),%xmm4
  movsd  D2(%rip),%xmm7
  movss  D40(%rip),%xmm3
  movss  0xc(%rsp),%xmm6
  movss  0x8(%rsp),%xmm5
  movss  0x4(%rsp),%xmm8
  nopl   0x0(%rax)
L133:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd (%rdi,%rax,4),%xmm0
  cvtss2sd (%r8,%rax,4),%xmm1
  divsd  %xmm4,%xmm0
  divsd  %xmm7,%xmm1
  subsd  %xmm1,%xmm0
  movss  (%r14,%rax,4),%xmm1
  mulss  %xmm2,%xmm1
  mulss  %xmm3,%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L133
  mov    0x50(%r15),%rcx
  mov    0x8(%r15),%rsi
  xor    %eax,%eax
  mov    0x38(%r15),%r9
  mov    0x8(%rbp),%r10
  nopl   0x0(%rax)
L43:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd (%rcx,%rax,4),%xmm0
  cvtss2sd (%rsi,%rax,4),%xmm1
  divsd  %xmm4,%xmm0
  divsd  %xmm7,%xmm1
  subsd  %xmm1,%xmm0
  movss  (%r9,%rax,4),%xmm1
  mulss  %xmm2,%xmm1
  mulss  %xmm3,%xmm1
  cvtss2sd %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r10,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L43
  mov    0x40(%r15),%r10
  mov    0x10(%rbp),%r13
  xor    %eax,%eax
  movss  D28(%rip),%xmm1
  nopl   0x0(%rax)
L88:
  movss  (%r10,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm8,%xmm0
  mulss  %xmm3,%xmm0
  movss  %xmm0,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L88
  mov    0x18(%rbp),%r11
  xor    %eax,%eax
L89:
  movss  (%r14,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm8,%xmm0
  movss  %xmm0,(%r11,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L89
  mov    0x20(%rbp),%r11
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L149:
  movss  (%r9,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm8,%xmm0
  movss  %xmm0,(%r11,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L149
  mov    0x28(%rbp),%r11
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L114:
  movss  (%r10,%rax,4),%xmm0
  mulss  %xmm2,%xmm0
  movss  %xmm0,(%r11,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L114
  mov    0x18(%r15),%r12
  mov    0x30(%rbp),%r10
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L122:
  movss  (%r12,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm5,%xmm0
  movss  %xmm0,(%r10,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L122
  mov    0x20(%r15),%r11
  mov    0x38(%rbp),%r10
  xor    %eax,%eax
  xchg   %ax,%ax
L160:
  movss  (%r11,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm5,%xmm0
  movss  %xmm0,(%r10,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L160
  mov    0x28(%r15),%r10
  mov    0x40(%rbp),%r15
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L45:
  movss  (%r10,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm6,%xmm0
  movss  %xmm0,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L45
  mov    0x48(%rbp),%r15
  xor    %eax,%eax
  nopl   0x0(%rax)
L169:
  pxor   %xmm0,%xmm0
  pxor   %xmm8,%xmm8
  cvtss2sd (%rdi,%rax,4),%xmm0
  cvtss2sd (%r8,%rax,4),%xmm8
  divsd  %xmm4,%xmm0
  divsd  %xmm7,%xmm8
  subsd  %xmm8,%xmm0
  movss  (%r14,%rax,4),%xmm8
  mulss  %xmm2,%xmm8
  mulss  %xmm3,%xmm8
  cvtss2sd %xmm8,%xmm8
  addsd  %xmm8,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L169
  mov    0x50(%rbp),%r14
  xor    %eax,%eax
  nopl   0x0(%rax)
L118:
  pxor   %xmm0,%xmm0
  pxor   %xmm8,%xmm8
  cvtss2sd (%rcx,%rax,4),%xmm0
  cvtss2sd (%rsi,%rax,4),%xmm8
  divsd  %xmm4,%xmm0
  divsd  %xmm7,%xmm8
  subsd  %xmm8,%xmm0
  movss  (%r9,%rax,4),%xmm8
  mulss  %xmm2,%xmm8
  mulss  %xmm3,%xmm8
  cvtss2sd %xmm8,%xmm8
  addsd  %xmm8,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%r14,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L118
  mov    0x58(%rbp),%r9
  xor    %eax,%eax
  nopl   0x0(%rax)
L78:
  movss  0x0(%r13,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L78
  mov    0x60(%rbp),%r9
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L15:
  movss  (%r12,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm6,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L15
  mov    0x68(%rbp),%r9
  xor    %eax,%eax
  nopl   0x0(%rax)
L5:
  movss  (%r11,%rax,4),%xmm0
  xorps  %xmm1,%xmm0
  mulss  %xmm6,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L5
  mov    0x70(%rbp),%r9
  xor    %eax,%eax
  nopl   0x0(%rax)
L87:
  movss  (%r10,%rax,4),%xmm0
  mulss  %xmm5,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L87
  mov    0x78(%rbp),%r9
  movss  D55(%rip),%xmm1
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L0:
  movss  (%rdi,%rax,4),%xmm0
  addss  (%r8,%rax,4),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L0
  mov    0x80(%rbp),%rdi
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L12:
  movss  (%rcx,%rax,4),%xmm0
  addss  (%rsi,%rax,4),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L12
  shl    $0x2,%rdx
  mov    $0x4,%eax
  test   %ebx,%ebx
  mov    0x88(%rbp),%rdi
  cmovle %rax,%rdx
  add    $0x18,%rsp
  xor    %esi,%esi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <memset@plt>
  cs nopw 0x0(%rax,%rax,1)
L7:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_tag: D29
type_infered: byte[8]
name: read_data
arguments: data_tag: D47
type_infered: f64
name: read_data
arguments: data_tag: D2
type_infered: f64
name: read_data
arguments: data_tag: D40
type_infered: byte[4]
name: read_data
arguments: data_tag: D28
type_infered: byte[4]
name: read_data
arguments: data_tag: D55
type_infered: byte[4]

tool: {"D29": [0x11,0xdd,0x52,0xa2,0x46,0xdf,0x91,0x3f]}

tool: D47: 3

tool: D2: 6

tool: {"D40": [0x00,0x00,0x00,0x3f]}

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

tool: {"D55": [0x00,0x00,0x40,0x40]}

assistant: ```c
void fk2mtg(float az, int npt, float *fk[12], float *mt[18]) {
  int i;
  float sa, ca, sa2, ca2;
  az = az * 1.745329252e-2;
  sa = sin(az);
  ca = cos(az);
  sa2 = sin(2 * az);
  ca2 = cos(2 * az);
  for (i = 0; i < npt; i++)
    mt[0][i] = fk[9][i] / 3. - fk[0][i] / 6. - fk[6][i] * ca2 / 2;
  for (i = 0; i < npt; i++)
    mt[1][i] = fk[10][i] / 3. - fk[1][i] / 6. - fk[7][i] * ca2 / 2;
  for (i = 0; i < npt; i++)
    mt[2][i] = -fk[8][i] * sa2 / 2;
  for (i = 0; i < npt; i++)
    mt[3][i] = -fk[6][i] * sa2;
  for (i = 0; i < npt; i++)
    mt[4][i] = -fk[7][i] * sa2;
  for (i = 0; i < npt; i++)
    mt[5][i] = fk[8][i] * ca2;
  for (i = 0; i < npt; i++)
    mt[6][i] = -fk[3][i] * ca;
  for (i = 0; i < npt; i++)
    mt[7][i] = -fk[4][i] * ca;
  for (i = 0; i < npt; i++)
    mt[8][i] = -fk[5][i] * sa;
  for (i = 0; i < npt; i++)
    mt[9][i] = fk[9][i] / 3. - fk[0][i] / 6. + fk[6][i] * ca2 / 2;
  for (i = 0; i < npt; i++)
    mt[10][i] = fk[10][i] / 3. - fk[1][i] / 6. + fk[7][i] * ca2 / 2;
  for (i = 0; i < npt; i++)
    mt[11][i] = -mt[2][i];
  for (i = 0; i < npt; i++)
    mt[12][i] = -fk[3][i] * sa;
  for (i = 0; i < npt; i++)
    mt[13][i] = -fk[4][i] * sa;
  for (i = 0; i < npt; i++)
    mt[14][i] = fk[5][i] * ca;
  for (i = 0; i < npt; i++)
    mt[15][i] = (fk[9][i] + fk[0][i]) / 3.;
  for (i = 0; i < npt; i++)
    mt[16][i] = (fk[10][i] + fk[1][i]) / 3.;
  for (i = 0; i < npt; i++)
    mt[17][i] = 0.;
  return;
}
```