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

```asm
<ls_costN_nm4_f0>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L586
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movsd  (%rax),%xmm0
  jmp    L324
L586:
  pxor   %xmm0,%xmm0
L324:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L394
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L394:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L260
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  jmp    L240
L260:
  pxor   %xmm0,%xmm0
L240:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L232
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L232:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L696
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  jmp    L526
L696:
  pxor   %xmm0,%xmm0
L526:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L462
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L462:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L372
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  jmp    L476
L372:
  pxor   %xmm0,%xmm0
L476:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L221
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x18,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L221:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L502
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  jmp    L710
L502:
  pxor   %xmm0,%xmm0
L710:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L555
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x20,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L555:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L471
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x28,%rax
  movsd  (%rax),%xmm0
  jmp    L63
L471:
  pxor   %xmm0,%xmm0
L63:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L159
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x28,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L159:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L32
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x30,%rax
  movsd  (%rax),%xmm0
  jmp    L570
L32:
  pxor   %xmm0,%xmm0
L570:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L345
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x30,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L345:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L589
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x38,%rax
  movsd  (%rax),%xmm0
  jmp    L26
L589:
  pxor   %xmm0,%xmm0
L26:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L483
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x38,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L483:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L703
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm0
  jmp    L612
L703:
  pxor   %xmm0,%xmm0
L612:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L672
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x40,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L672:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L545
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x48,%rax
  movsd  (%rax),%xmm0
  jmp    L567
L545:
  pxor   %xmm0,%xmm0
L567:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L587
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x48,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L587:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L659
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x50,%rax
  movsd  (%rax),%xmm0
  jmp    L494
L659:
  pxor   %xmm0,%xmm0
L494:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L563
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x50,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L563:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L624
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x58,%rax
  movsd  (%rax),%xmm0
  jmp    L153
L624:
  pxor   %xmm0,%xmm0
L153:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L360
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x58,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L360:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L39
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x60,%rax
  movsd  (%rax),%xmm0
  jmp    L172
L39:
  pxor   %xmm0,%xmm0
L172:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L452
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x60,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L452:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L68
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x68,%rax
  movsd  (%rax),%xmm0
  jmp    L40
L68:
  pxor   %xmm0,%xmm0
L40:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L242
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x68,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L242:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L636
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x70,%rax
  movsd  (%rax),%xmm0
  jmp    L325
L636:
  pxor   %xmm0,%xmm0
L325:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L66
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x70,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L66:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L214
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x78,%rax
  movsd  (%rax),%xmm0
  jmp    L47
L214:
  pxor   %xmm0,%xmm0
L47:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L484
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x78,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L484:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L313
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  sub    $0xffffffffffffff80,%rax
  movsd  (%rax),%xmm0
  jmp    L115
L313:
  pxor   %xmm0,%xmm0
L115:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L421
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  sub    $0xffffffffffffff80,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L421:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L482
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x88,%rax
  movsd  (%rax),%xmm0
  jmp    L373
L482:
  pxor   %xmm0,%xmm0
L373:
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L397
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rax
  add    $0x88,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L397:
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L454
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L454:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L641
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L641:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L216
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L216:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L669
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x18,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L669:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x20,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L0:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L331
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x28,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L331:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L608
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x30,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L608:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L9
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x38,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L9:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L89
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x40,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L89:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L21
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x48,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L21:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L390
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x50,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L390:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L262
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x58,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L262:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L486
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x60,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L486:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L407
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x68,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L407:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L625
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x70,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L625:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L554
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x78,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L554:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L628
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  sub    $0xffffffffffffff80,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L628:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L316
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    $0x88,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L316:
  mov    $0x0,%eax
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D6
type_infered: f64

tool: D6: 1

assistant: ```c
int ls_costN_nm4_f0(const double **arg, double **res, int *iw, double *w, int mem) {
  double a0 = arg[0] ? arg[0][0] : 0;
  if (res[0] != 0)
    res[0][0] = a0;
  a0 = arg[0] ? arg[0][1] : 0;
  if (res[0] != 0)
    res[0][1] = a0;
  a0 = arg[0] ? arg[0][2] : 0;
  if (res[0] != 0)
    res[0][2] = a0;
  a0 = arg[0] ? arg[0][3] : 0;
  if (res[0] != 0)
    res[0][3] = a0;
  a0 = arg[0] ? arg[0][4] : 0;
  if (res[0] != 0)
    res[0][4] = a0;
  a0 = arg[0] ? arg[0][5] : 0;
  if (res[0] != 0)
    res[0][5] = a0;
  a0 = arg[0] ? arg[0][6] : 0;
  if (res[0] != 0)
    res[0][6] = a0;
  a0 = arg[0] ? arg[0][7] : 0;
  if (res[0] != 0)
    res[0][7] = a0;
  a0 = arg[0] ? arg[0][8] : 0;
  if (res[0] != 0)
    res[0][8] = a0;
  a0 = arg[0] ? arg[0][9] : 0;
  if (res[0] != 0)
    res[0][9] = a0;
  a0 = arg[0] ? arg[0][10] : 0;
  if (res[0] != 0)
    res[0][10] = a0;
  a0 = arg[0] ? arg[0][11] : 0;
  if (res[0] != 0)
    res[0][11] = a0;
  a0 = arg[0] ? arg[0][12] : 0;
  if (res[0] != 0)
    res[0][12] = a0;
  a0 = arg[0] ? arg[0][13] : 0;
  if (res[0] != 0)
    res[0][13] = a0;
  a0 = arg[0] ? arg[0][14] : 0;
  if (res[0] != 0)
    res[0][14] = a0;
  a0 = arg[0] ? arg[0][15] : 0;
  if (res[0] != 0)
    res[0][15] = a0;
  a0 = arg[0] ? arg[0][16] : 0;
  if (res[0] != 0)
    res[0][16] = a0;
  a0 = arg[0] ? arg[0][17] : 0;
  if (res[0] != 0)
    res[0][17] = a0;
  a0 = 1.;
  if (res[1] != 0)
    res[1][0] = a0;
  if (res[1] != 0)
    res[1][1] = a0;
  if (res[1] != 0)
    res[1][2] = a0;
  if (res[1] != 0)
    res[1][3] = a0;
  if (res[1] != 0)
    res[1][4] = a0;
  if (res[1] != 0)
    res[1][5] = a0;
  if (res[1] != 0)
    res[1][6] = a0;
  if (res[1] != 0)
    res[1][7] = a0;
  if (res[1] != 0)
    res[1][8] = a0;
  if (res[1] != 0)
    res[1][9] = a0;
  if (res[1] != 0)
    res[1][10] = a0;
  if (res[1] != 0)
    res[1][11] = a0;
  if (res[1] != 0)
    res[1][12] = a0;
  if (res[1] != 0)
    res[1][13] = a0;
  if (res[1] != 0)
    res[1][14] = a0;
  if (res[1] != 0)
    res[1][15] = a0;
  if (res[1] != 0)
    res[1][16] = a0;
  if (res[1] != 0)
    res[1][17] = a0;
  return 0;
}
```