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

```asm
<round2int>:
  endbr64
  test   %edx,%edx
  jle    L37
  mov    $0x1,%eax
  pxor   %xmm6,%xmm6
  shl    %cl,%eax
  lea    0x8(%rdi),%rcx
  cvtsi2sd %eax,%xmm6
  mov    %rsi,%rax
  sub    %rcx,%rax
  cmp    $0x10,%rax
  jbe    L121
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L121
  mov    %edx,%ecx
  movapd %xmm6,%xmm2
  movapd D68(%rip),%xmm5
  xor    %eax,%eax
  shr    $0x2,%ecx
  movapd D52(%rip),%xmm4
  unpcklpd %xmm2,%xmm2
  pxor   %xmm3,%xmm3
  shl    $0x5,%rcx
  nopw   0x0(%rax,%rax,1)
L154:
  movupd (%rdi,%rax,1),%xmm7
  movapd %xmm3,%xmm0
  movapd %xmm5,%xmm1
  cmpltpd %xmm7,%xmm0
  movupd 0x10(%rdi,%rax,1),%xmm7
  andpd  %xmm0,%xmm1
  andnpd %xmm4,%xmm0
  orpd   %xmm0,%xmm1
  movapd %xmm3,%xmm0
  cmpltpd %xmm7,%xmm0
  movapd %xmm5,%xmm7
  andpd  %xmm0,%xmm7
  andnpd %xmm4,%xmm0
  orpd   %xmm0,%xmm7
  movupd (%rdi,%rax,1),%xmm0
  mulpd  %xmm2,%xmm0
  addpd  %xmm1,%xmm0
  movupd 0x10(%rdi,%rax,1),%xmm1
  mulpd  %xmm2,%xmm1
  cvttpd2dq %xmm0,%xmm0
  addpd  %xmm7,%xmm1
  cvttpd2dq %xmm1,%xmm1
  punpcklqdq %xmm1,%xmm0
  cvtdq2pd %xmm0,%xmm1
  divpd  %xmm2,%xmm1
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  divpd  %xmm2,%xmm0
  movups %xmm1,(%rsi,%rax,1)
  movups %xmm0,0x10(%rsi,%rax,1)
  add    $0x20,%rax
  cmp    %rcx,%rax
  jne    L154
  mov    %edx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%dl
  je     L37
  mov    %eax,%r8d
  pxor   %xmm1,%xmm1
  movsd  D68(%rip),%xmm2
  movsd  (%rdi,%r8,8),%xmm0
  lea    0x0(,%r8,8),%rcx
  comisd %xmm1,%xmm0
  jbe    L149
L80:
  mulsd  %xmm6,%xmm0
  addsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%r9d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r9d,%xmm0
  divsd  %xmm6,%xmm0
  movsd  %xmm0,(%rsi,%r8,8)
  lea    0x1(%rax),%r8d
  cmp    %r8d,%edx
  jle    L37
  movsd  0x8(%rdi,%rcx,1),%xmm0
  movsd  D68(%rip),%xmm2
  comisd %xmm1,%xmm0
  jbe    L11
L7:
  mulsd  %xmm6,%xmm0
  add    $0x2,%eax
  addsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%r8d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r8d,%xmm0
  divsd  %xmm6,%xmm0
  movsd  %xmm0,0x8(%rsi,%rcx,1)
  cmp    %eax,%edx
  jle    L37
  movsd  0x10(%rdi,%rcx,1),%xmm0
  movsd  D68(%rip),%xmm2
  comisd %xmm1,%xmm0
  jbe    L125
L120:
  mulsd  %xmm6,%xmm0
  addsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  divsd  %xmm6,%xmm0
  movsd  %xmm0,0x10(%rsi,%rcx,1)
  ret
  nop
L123:
  subsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  divsd  %xmm6,%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L33
L37:
  ret
  nopl   0x0(%rax,%rax,1)
L121:
  movsd  D68(%rip),%xmm2
  mov    %edx,%edx
  xor    %eax,%eax
  pxor   %xmm1,%xmm1
L33:
  movsd  (%rdi,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  mulsd  %xmm6,%xmm0
  jbe    L123
  addsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%ecx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  divsd  %xmm6,%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L33
  ret
  nopw   0x0(%rax,%rax,1)
L149:
  movsd  D52(%rip),%xmm2
  jmp    L80
  nopl   (%rax)
L11:
  movsd  D52(%rip),%xmm2
  jmp    L7
  nopl   (%rax)
L125:
  movsd  D52(%rip),%xmm2
  jmp    L120
```

tool_calls: name: unpack_data
arguments: data_label: D68
data_type: f64[2]
name: unpack_data
arguments: data_label: D52
data_type: f32[4]

tool: {"D68": [0.5,0.5]}

tool: {"D52": [0.0,-1.75,0.0,-1.75]}

assistant: ```c
void round2int(a, b, n, cprec) double *a, *b;
int n, cprec;
{
  int i, k;
  for (i = 0; i < n; i++) {
    k = a[i] > 0.0 ? 1 : -1;
    b[i] = (int)(a[i] * (1 << cprec) + k * 0.5);
    b[i] /= (double)(1 << cprec);
  }
}
```