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

```asm
<tm_world_recur_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,%r12
  mov    %rdx,0x8(%rsp)
  mov    %rcx,0x40(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x38(%rsp)
  mov    0xc0(%rsp),%rbx
  mov    0xc8(%rsp),%r14
  mov    0xd0(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    0xd8(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    0xe0(%rsp),%rax
  mov    %rax,0x28(%rsp)
  mov    0xe8(%rsp),%r13
  mov    0xf0(%rsp),%rax
  mov    %rax,0x30(%rsp)
  mov    0xf8(%rsp),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  mov    (%rsi),%eax
  mov    %eax,0x5c(%rsp)
  movslq %eax,%rdx
  mov    (%r14,%rdx,4),%ebp
  cmp    (%rcx),%eax
  jle    L461
  lea    0x0(,%rdx,4),%rcx
  lea    (%r9,%rcx,1),%rdi
  mov    (%rdi),%eax
  test   %eax,%eax
  je     L461
  mov    (%rbx,%rdx,4),%ecx
  cmp    $0x1,%ecx
  je     L295
  cmp    $0x2,%ecx
  je     L406
  mov    D29(%rip),%rbx
L465:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L460
  movq   %rbx,%xmm0
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L295:
  mov    0x10(%rsp),%rcx
  cvttsd2si (%rcx,%rdx,8),%esi
  mov    0x18(%rsp),%rcx
  cvttsd2si (%rcx,%rdx,8),%r8d
  mov    (%r12),%ecx
  sub    $0x1,%ecx
  imul   %r8d,%ecx
  lea    (%rsi,%rcx,1),%ebp
  mov    %ebp,0x60(%rsp)
  cmpl   $0x0,(%r15,%rdx,4)
  jne    L175
  mov    0x8(%rsp),%rdx
  mov    (%rdx),%edx
  cmp    $0x2,%edx
  je     L175
  lea    (%r8,%rcx,1),%r9d
  lea    (%r9,%rsi,1),%r12d
  cmp    $0x1,%edx
  je     L116
L252:
  mov    %ebp,0x64(%rsp)
  mov    %r12d,0x68(%rsp)
  cltq
  mov    (%r14,%rax,4),%eax
  mov    %eax,0x4c(%rsp)
  mov    $0x0,%eax
  call   <tm_its_subspan_modulo_int_@plt>
  movslq 0x5c(%rsp),%rdx
  mov    0x38(%rsp),%rsi
  lea    (%rsi,%rdx,4),%rsi
  movslq (%rsi),%rdx
  mov    0x0(%r13,%rdx,4),%edx
  test   %edx,%edx
  je     L203
  test   %eax,%eax
  je     L203
  lea    0x1(%rbp),%eax
  cmp    $0x1,%eax
  jbe    L213
  mov    0x4c(%rsp),%eax
  add    $0x1,%eax
  cmp    %r12d,%eax
  je     L169
L77:
  movl   $0x2,0x70(%rsp)
  lea    0x70(%rsp),%rbp
  lea    0x64(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    %rbp,%rdx
  call   <tm_world_recur_>
  movq   %xmm0,%r12
  add    $0x40,%rsp
  movslq 0x5c(%rsp),%rax
  mov    0x38(%rsp),%r9
  lea    (%r9,%rax,4),%rsi
  lea    0x68(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    %rbp,%rdx
  call   <tm_world_recur_>
  movq   %r12,%xmm6
  addsd  %xmm0,%xmm6
  movapd %xmm6,%xmm0
  mulsd  D42(%rip),%xmm0
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L175:
  lea    0x60(%rsp),%rax
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    0x48(%rsp),%rdx
  mov    %rdi,%rsi
  mov    %rax,%rdi
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L116:
  sub    %r8d,%ecx
  mov    %ebp,%r12d
  lea    (%rcx,%rsi,1),%ebp
  jmp    L252
L213:
  movl   $0x1,0x70(%rsp)
  movl   $0x1,0x64(%rsp)
  lea    0x70(%rsp),%rdx
  lea    0x64(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L169:
  movl   $0x3,0x70(%rsp)
  mov    0x4c(%rsp),%eax
  mov    %eax,0x68(%rsp)
  lea    0x70(%rsp),%rdx
  lea    0x68(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L203:
  test   %edx,%edx
  jne    L77
  test   %ebp,%ebp
  jle    L422
  cmp    %r12d,0x4c(%rsp)
  jge    L77
L422:
  mov    0x8(%rsp),%rax
  cmpl   $0x1,(%rax)
  je     L402
  mov    0x4c(%rsp),%eax
  mov    %eax,0x60(%rsp)
  lea    0x60(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    0x48(%rsp),%rdx
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L402:
  movl   $0x1,0x60(%rsp)
  lea    0x60(%rsp),%rdi
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    0x48(%rsp),%rdx
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L406:
  push   %r15
  push   0x38(%rsp)
  push   %r13
  push   0x40(%rsp)
  push   0x38(%rsp)
  push   0x38(%rsp)
  push   %r14
  push   %rbx
  mov    0x78(%rsp),%r9
  mov    0x60(%rsp),%r8
  mov    0x80(%rsp),%rcx
  mov    0x48(%rsp),%rdx
  mov    %r12,%rdi
  call   <tm_world_recur_>
  movq   %xmm0,%rbx
  add    $0x40,%rsp
  jmp    L465
L461:
  lea    0x5c(%rsp),%rdi
  mov    $0x0,%eax
  call   <tm_its_subspan_modulo_int_@plt>
  cmp    $0x1,%eax
  sbb    $0xffffffff,%ebp
  movslq 0x5c(%rsp),%rax
  cmpl   $0x0,0x0(%r13,%rax,4)
  je     L254
  mov    (%r12),%eax
  sub    $0x1,%eax
  cltd
  idiv   %ebp
  lea    0x1(%rdx),%ebx
  lea    (%rbx,%rbp,1),%eax
  test   %ebx,%ebx
  cmovle %eax,%ebx
L369:
  lea    0x5c(%rsp),%rdi
  mov    $0x0,%eax
  call   <tm_its_subspan_modulo_int_@plt>
  cmp    %ebp,%ebx
  jne    L28
  test   %eax,%eax
  jne    L432
L28:
  movslq 0x5c(%rsp),%rax
  cmpl   $0x0,(%r15,%rax,4)
  je     L291
  mov    0x18(%rsp),%rsi
  movsd  (%rsi,%rax,8),%xmm0
  sub    $0x1,%ebx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  mulsd  %xmm0,%xmm1
  mov    0x10(%rsp),%rsi
  addsd  (%rsi,%rax,8),%xmm1
  movq   %xmm1,%rbx
  mov    0x8(%rsp),%rsi
  mov    (%rsi),%edx
  cmp    $0x1,%edx
  je     L473
  cmp    $0x2,%edx
  je     L262
  mulsd  D42(%rip),%xmm0
  movapd %xmm1,%xmm4
  addsd  %xmm0,%xmm4
  movq   %xmm4,%rbx
L262:
  cmpl   $0x0,0x0(%r13,%rax,4)
  je     L465
  mov    (%r12),%eax
  test   %eax,%eax
  jle    L54
  sub    $0x1,%eax
  cltd
  idiv   %ebp
  mov    %eax,%ebp
L114:
  lea    0x5c(%rsp),%rdi
  mov    $0x0,%eax
  call   <tm_modulo_axlen_@plt>
  imul   %ebp,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %rbx,%xmm2
  addsd  %xmm0,%xmm2
  movq   %xmm2,%rbx
  jmp    L465
L254:
  mov    (%r12),%ebx
  test   %ebx,%ebx
  mov    $0x1,%eax
  cmovle %eax,%ebx
  cmp    %ebp,%ebx
  cmovg  %ebp,%ebx
  jmp    L369
L432:
  lea    0x70(%rsp),%rdx
  lea    0x68(%rsp),%rsi
  lea    0x5c(%rsp),%rdi
  mov    $0x0,%eax
  call   <tm_ww_axlims_@plt>
  mov    0x8(%rsp),%rax
  mov    (%rax),%eax
  movsd  0x70(%rsp),%xmm0
  cmp    $0x1,%eax
  je     L3
  cmp    $0x2,%eax
  je     L75
  movslq 0x5c(%rsp),%rax
  mov    0x30(%rsp),%rsi
  movsd  (%rsi,%rax,8),%xmm0
  addsd  0x68(%rsp),%xmm0
L3:
  mov    (%r12),%eax
  test   %eax,%eax
  jle    L200
  sub    $0x1,%eax
  cltd
  idiv   %ebp
L282:
  movslq 0x5c(%rsp),%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mov    0x30(%rsp),%rax
  mulsd  (%rax,%rdx,8),%xmm1
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rbx
  jmp    L465
L75:
  movslq 0x5c(%rsp),%rax
  mov    0x30(%rsp),%rsi
  movsd  (%rsi,%rax,8),%xmm0
  addsd  0x68(%rsp),%xmm0
  addsd  0x70(%rsp),%xmm0
  mulsd  D42(%rip),%xmm0
  jmp    L3
L200:
  cltd
  idiv   %ebp
  sub    $0x1,%eax
  jmp    L282
L473:
  mulsd  D42(%rip),%xmm0
  movapd %xmm1,%xmm5
  subsd  %xmm0,%xmm5
  movq   %xmm5,%rbx
  jmp    L262
L54:
  cltd
  idiv   %ebp
  lea    -0x1(%rax),%ebp
  jmp    L114
L291:
  mov    0x28(%rsp),%rcx
  mov    (%rcx,%rax,4),%edx
  lea    -0x2(%rbx,%rdx,1),%edx
  mov    0x8(%rsp),%rsi
  mov    (%rsi),%ecx
  cmp    $0x1,%ecx
  je     L238
  cmp    $0x2,%ecx
  je     L61
  add    (%r14,%rax,4),%edx
  movslq %edx,%rdx
  mov    0x20(%rsp),%rcx
  mov    0x8(%rcx,%rdx,8),%rbx
L67:
  cmpl   $0x0,0x0(%r13,%rax,4)
  je     L465
  mov    (%r12),%eax
  test   %eax,%eax
  jle    L195
  sub    $0x1,%eax
  cltd
  idiv   %ebp
  mov    %eax,%ebp
L488:
  lea    0x5c(%rsp),%rdi
  mov    $0x0,%eax
  call   <tm_modulo_axlen_@plt>
  imul   %ebp,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movq   %rbx,%xmm3
  addsd  %xmm0,%xmm3
  movq   %xmm3,%rbx
  jmp    L465
L238:
  add    (%r14,%rax,4),%edx
  movslq %edx,%rdx
  mov    0x20(%rsp),%rsi
  mov    (%rsi,%rdx,8),%rbx
  jmp    L67
L61:
  movslq %edx,%rdx
  mov    0x20(%rsp),%rcx
  mov    (%rcx,%rdx,8),%rbx
  jmp    L67
L195:
  cltd
  idiv   %ebp
  lea    -0x1(%rax),%ebp
  jmp    L488
L460:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D29
datatype: byte[8]
name: read_data
arguments: data_tag: D42
datatype: f64

tool: {"D29": [0x00,0x00,0x00,0x00,0x00,0x38,0x8f,0xc0]}

tool: D42: 0.5

assistant: ```c
double tm_world_recur_(int *isudirript, int *iaxis, int *where_in_box, int *max_lines, double line_mem[], int line_parent[], int line_class[], int line_dim[], double line_start[], double line_delta[], int line_sudir1[], int line_modulo[], double line_modulo_len[], int line_regular[]) {
  double tempwld, tm_world;
  int isub, rmod;
  int axis = *iaxis;
  int line_len = line_dim[axis];
  int is_subspan;
  int recursive = axis > *max_lines;
  if (recursive) {
    recursive = line_parent[axis] != 0;
    if (recursive) {
      int new_ss, lo_ss, hi_ss, parent_len;
      int new_where;
      switch (line_class[axis]) {
      case 1:
        new_ss = (int)line_start[axis] + (*isudirript - 1) * (int)line_delta[axis];
        if (line_regular[axis] || *where_in_box == 2) {
          tm_world = tm_world_recur_(&new_ss, &(line_parent[axis]), where_in_box, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular);
        } else {
          if (*where_in_box == 1) {
            lo_ss = (int)line_start[axis] + (*isudirript - 2) * (int)line_delta[axis];
            hi_ss = new_ss;
          } else {
            lo_ss = new_ss;
            hi_ss = (int)line_start[axis] + (*isudirript - 0) * (int)line_delta[axis];
          }
          parent_len = line_dim[line_parent[axis]];
          is_subspan = (tm_its_subspan_modulo_int_(&line_parent[axis]));
          if (line_modulo[line_parent[axis]] && is_subspan) {
            if (lo_ss == 0 || lo_ss == -1) {
              new_where = 1;
              lo_ss = 1;
              tm_world = (tm_world_recur_(&lo_ss, &(line_parent[axis]), &new_where, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular));
              return (tm_world);
            }
            if (hi_ss == parent_len + 1) {
              new_where = 3;
              hi_ss = parent_len;
              tm_world = (tm_world_recur_(&hi_ss, &(line_parent[axis]), &new_where, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular));
              return (tm_world);
            }
          }
          if (line_modulo[line_parent[axis]] || (lo_ss >= 1 && hi_ss <= parent_len)) {
            new_where = 2;
            tm_world = 0.5 * (tm_world_recur_(&lo_ss, &(line_parent[axis]), &new_where, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular) + tm_world_recur_(&hi_ss, &(line_parent[axis]), &new_where, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular));
          } else if (*where_in_box == 1) {
            new_ss = 1;
            tm_world = tm_world_recur_(&new_ss, &(line_parent[axis]), where_in_box, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular);
          } else {
            new_ss = parent_len;
            tm_world = tm_world_recur_(&new_ss, &(line_parent[axis]), where_in_box, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular);
          }
        }
        break;
      case 2:
        tm_world = tm_world_recur_(isudirript, iaxis, where_in_box, max_lines, line_mem, line_parent, line_class, line_dim, line_start, line_delta, line_sudir1, line_modulo, line_modulo_len, line_regular);
        break;
      default:
        tm_world = -999.;
      }
      return (tm_world);
    }
  }
  if (tm_its_subspan_modulo_int_(&axis))
    line_len++;
  if (line_modulo[axis]) {
    isub = ((*isudirript - 1) % line_len) + 1;
    if (isub <= 0)
      isub += line_len;
  } else
    isub = (((line_len) < ((((1) < (*isudirript)) ? (*isudirript) : (1)))) ? (line_len) : ((((1) < (*isudirript)) ? (*isudirript) : (1))));
  if (tm_its_subspan_modulo_int_(&axis) && isub == line_len) {
    double lo, hi;
    tm_ww_axlims_(&axis, &lo, &hi);
    if (*where_in_box == 1)
      tempwld = hi;
    else if (*where_in_box == 2)
      tempwld = (hi + (lo + line_modulo_len[axis])) / 2.;
    else
      tempwld = lo + line_modulo_len[axis];
    if (*isudirript <= 0)
      rmod = *isudirript / line_len - 1;
    else
      rmod = (*isudirript - 1) / line_len;
    tm_world = tempwld + rmod * line_modulo_len[axis];
  } else if (line_regular[axis]) {
    double midpoint = line_start[axis] + (isub - 1) * line_delta[axis];
    double box_size = line_delta[axis];
    if (*where_in_box == 1)
      tempwld = midpoint - (box_size / 2.);
    else if (*where_in_box == 2)
      tempwld = midpoint;
    else
      tempwld = midpoint + (box_size / 2.);
    if (line_modulo[axis]) {
      if (*isudirript <= 0)
        rmod = (*isudirript / line_len - 1);
      else
        rmod = ((*isudirript - 1) / line_len);
      tm_world = tempwld + rmod * tm_modulo_axlen_(&axis);
    } else
      tm_world = tempwld;
  } else {
    isub += line_sudir1[axis] - 1;
    isub--;
    if (*where_in_box == 1)
      tempwld = line_mem[isub + line_dim[axis]];
    else if (*where_in_box == 2)
      tempwld = line_mem[isub];
    else
      tempwld = line_mem[isub + line_dim[axis] + 1];
    if (line_modulo[axis]) {
      if (*isudirript <= 0)
        rmod = *isudirript / line_len - 1;
      else
        rmod = (*isudirript - 1) / line_len;
      tm_world = tempwld + rmod * tm_modulo_axlen_(&axis);
    } else
      tm_world = tempwld;
  }
  return (tm_world);
}
```