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

```asm
<main>:
  endbr64
  push   %r12
  lea    D109(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x30,%rsp
  movapd D7(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    D145(%rip),%rax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  movapd D65(%rip),%xmm0
  mov    %rax,0x20(%rsp)
  movaps %xmm0,0x10(%rsp)
L11:
  pxor   %xmm0,%xmm0
  cvttsd2si 0x0(%rbp,%rbx,8),%rsi
  mov    %r12,%rdi
  cvtsi2sd %rbx,%xmm0
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    $0x5,%rbx
  jne    L11
  movsd  D98(%rip),%xmm0
  mov    $0x5,%esi
  mov    %rbp,%rdi
  lea    D19(%rip),%r12
  call   <CSPL_Array_bisect@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    D98(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D60(%rip),%xmm0
  mov    $0x5,%esi
  mov    %rbp,%rdi
  call   <CSPL_Array_bisect@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    D60(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D65(%rip),%xmm0
  mov    $0x5,%esi
  mov    %rbp,%rdi
  call   <CSPL_Array_bisect@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    D65(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D77(%rip),%xmm0
  mov    $0x5,%esi
  mov    %rbp,%rdi
  call   <CSPL_Array_bisect@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    D77(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  movsd  D36(%rip),%xmm0
  mov    $0x5,%esi
  mov    %rbp,%rdi
  call   <CSPL_Array_bisect@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  mov    D36(%rip),%rax
  movq   %rax,%xmm0
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D109
type_guessed: string
name: disassemble_data
arguments: label: D7
type_guessed: byte[16]
name: disassemble_data
arguments: label: D145
type_guessed: byte[8]
name: disassemble_data
arguments: label: D65
type_guessed: f64[2]
name: disassemble_data
arguments: label: D98
type_guessed: byte[8]
name: disassemble_data
arguments: label: D19
type_guessed: string
name: disassemble_data
arguments: label: D60
type_guessed: f64
name: disassemble_data
arguments: label: D77
type_guessed: f64
name: disassemble_data
arguments: label: D36
type_guessed: f64

tool: D109: dat1[%ld]=%lf


tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40]}

tool: {"D145": [0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x40]}

tool: {"D65": [5.0,7.0]}

tool: {"D98": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D19: CSPL_Array_bisect(%lf, dat1, 5)=%ld


tool: D60: 1.5

tool: D77: 5.5

tool: D36: 8.5

assistant: ```c
int main(void) {
  double dat1[5] = {1, 2, 5, 7, 8};
  long ans, i;
  double val;
  for (i = 0; i < 5; i++)
    printf("dat1[%ld]=%lf\n", i, dat1[i]);
  val = -1;
  ans = CSPL_Array_bisect(val, dat1, 5);
  printf("CSPL_Array_bisect(%lf, dat1, 5)=%ld\n", val, ans);
  val = 1.5;
  ans = CSPL_Array_bisect(val, dat1, 5);
  printf("CSPL_Array_bisect(%lf, dat1, 5)=%ld\n", val, ans);
  val = 5.0;
  ans = CSPL_Array_bisect(val, dat1, 5);
  printf("CSPL_Array_bisect(%lf, dat1, 5)=%ld\n", val, ans);
  val = 5.5;
  ans = CSPL_Array_bisect(val, dat1, 5);
  printf("CSPL_Array_bisect(%lf, dat1, 5)=%ld\n", val, ans);
  val = 8.5;
  ans = CSPL_Array_bisect(val, dat1, 5);
  printf("CSPL_Array_bisect(%lf, dat1, 5)=%ld\n", val, ans);
  return (0);
}
```