user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<round_w_d>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  movsd  (%rdi),%xmm0
  movapd %xmm0,%xmm3
  movsd  D38(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D70(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L14
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movapd %xmm1,%xmm3
  cmpnlesd %xmm0,%xmm3
  movsd  D83(%rip),%xmm4
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm1
  andnpd %xmm0,%xmm2
  movapd %xmm1,%xmm3
  orpd   %xmm2,%xmm3
L14:
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  ucomisd D151(%rip),%xmm1
  jp     L92
  jne    L92
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L65
  call   <trunc@plt>
  test   $0x1,%al
  je     L76
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm3
  movsd  D38(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D70(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L71
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  cmpnlesd %xmm1,%xmm3
  movsd  D83(%rip),%xmm4
  andpd  %xmm4,%xmm3
  addsd  %xmm1,%xmm3
  andnpd %xmm0,%xmm2
  orpd   %xmm2,%xmm3
L71:
  cvttsd2si %xmm3,%eax
  jmp    L3
L65:
  call   <trunc@plt>
  test   $0x1,%al
  je     L16
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm3
  movsd  D38(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D70(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L97
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movapd %xmm1,%xmm3
  cmpnlesd %xmm0,%xmm3
  movsd  D83(%rip),%xmm4
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm1
  andnpd %xmm0,%xmm2
  movapd %xmm1,%xmm3
  orpd   %xmm2,%xmm3
L97:
  cvttsd2si %xmm3,%eax
  jmp    L3
L16:
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm3
  movsd  D38(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D70(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L17
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  cmpnlesd %xmm1,%xmm3
  movsd  D83(%rip),%xmm4
  andpd  %xmm4,%xmm3
  addsd  %xmm1,%xmm3
  andnpd %xmm0,%xmm2
  orpd   %xmm2,%xmm3
L17:
  cvttsd2si %xmm3,%eax
  jmp    L3
L76:
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm3
  movsd  D38(%rip),%xmm2
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  movsd  D70(%rip),%xmm4
  ucomisd %xmm1,%xmm4
  jbe    L128
  cvttsd2si %xmm0,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movapd %xmm1,%xmm3
  cmpnlesd %xmm0,%xmm3
  movsd  D83(%rip),%xmm4
  andpd  %xmm4,%xmm3
  subsd  %xmm3,%xmm1
  andnpd %xmm0,%xmm2
  movapd %xmm1,%xmm3
  orpd   %xmm2,%xmm3
L128:
  cvttsd2si %xmm3,%eax
  jmp    L3
L92:
  call   <round@plt>
L3:
  mov    %eax,0x0(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D38
datatype: byte[8]
name: unpack_data
arguments: tag: D70
datatype: byte[8]
name: unpack_data
arguments: tag: D83
datatype: byte[8]
name: unpack_data
arguments: tag: D151
datatype: f64

tool: {"D38": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D70": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

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

tool: D151: 0.5

assistant: ```c
void round_w_d(const double *source, int32_t *dest) {
  double remainder = *source - floor(*source);
  if (remainder == 0.5) {
    if (*source < 0) {
      *dest = (int32_t)trunc(*source) % 2 != 0 ? floor(*source) : ceil(*source);
    } else {
      *dest = (int32_t)trunc(*source) % 2 != 0 ? ceil(*source) : floor(*source);
    }
  } else {
    *dest = (int32_t)round(*source);
  }
}
```