user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<fitest_image_rotate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rsi,0x88(%rsp)
  mov    %rdx,0x68(%rsp)
  mov    %rcx,0x70(%rsp)
  mov    %r8,0x80(%rsp)
  test   %rdx,%rdx
  je     L189
  mov    %rdi,%r15
  mov    %rdx,%rbx
  mov    %r9,%r12
  test   %rcx,%rcx
  je     L189
  test   %r8,%r8
  je     L189
  test   %r9,%r9
  je     L189
  lea    0xa8(%rsp),%rdi
  lea    0xa0(%rsp),%rsi
  call   <sincos@plt>
  movsd  0xa0(%rsp),%xmm1
  movsd  %xmm1,0x30(%rsp)
  movsd  0xa8(%rsp),%xmm1
  movsd  %xmm1,0x18(%rsp)
  mov    %rbx,%rax
  sub    $0x1,%rax
  js     L19
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L81:
  mulsd  D10(%rip),%xmm0
  movsd  %xmm0,0x28(%rsp)
  mov    0x70(%rsp),%rax
  sub    $0x1,%rax
  js     L58
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L184:
  mulsd  D10(%rip),%xmm0
  movsd  %xmm0,0x48(%rsp)
  mov    0x80(%rsp),%rax
  sub    $0x1,%rax
  js     L245
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L188:
  mulsd  D10(%rip),%xmm0
  xorpd  D9(%rip),%xmm0
  movsd  %xmm0,0x50(%rsp)
  mov    %r12,%rax
  sub    $0x1,%rax
  mov    %rax,0x90(%rsp)
  js     L155
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
L276:
  mulsd  D10(%rip),%xmm0
  xorpd  D9(%rip),%xmm0
  movsd  %xmm0,0x98(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  jmp    L182
L19:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L81
L58:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L184
L245:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L188
L155:
  mov    0x90(%rsp),%rdi
  mov    %rdi,%rax
  shr    %rax
  and    $0x1,%edi
  or     %rdi,%rax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  jmp    L276
L233:
  mov    %r14,%rdx
  shr    %rdx
  and    $0x1,%r14d
  or     %r14,%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdx,%xmm1
  addsd  %xmm1,%xmm1
  jmp    L240
L88:
  mov    %rbp,%rdx
  shr    %rdx
  and    $0x1,%ebp
  or     %rbp,%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdx,%xmm1
  addsd  %xmm1,%xmm1
  jmp    L1
L217:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdx,%xmm1
  addsd  %xmm1,%xmm1
  jmp    L138
L209:
  mov    %r13,%rax
  shr    %rax
  and    $0x1,%r13d
  or     %r13,%rax
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
  addsd  %xmm2,%xmm2
L204:
  movsd  0x10(%rsp),%xmm0
  subsd  %xmm2,%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm0
L23:
  mov    0x78(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,8)
L187:
  movsd  D34(%rip),%xmm7
  addsd  0x8(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jbe    L298
L270:
  movsd  0x18(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm5
  mulsd  %xmm5,%xmm0
  addsd  0x20(%rsp),%xmm0
  addsd  0x28(%rsp),%xmm0
  movapd %xmm0,%xmm6
  pxor   %xmm2,%xmm2
  comisd %xmm2,%xmm0
  jb     L187
  movsd  0x30(%rsp),%xmm0
  mulsd  %xmm5,%xmm0
  subsd  0x38(%rsp),%xmm0
  addsd  0x48(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  comisd %xmm2,%xmm0
  jb     L187
  movsd  %xmm6,0x40(%rsp)
  movapd %xmm6,%xmm0
  call   <floor@plt>
  mov    %rax,%r14
  movsd  0x40(%rsp),%xmm0
  call   <ceil@plt>
  mov    %rax,%rbp
  movsd  0x10(%rsp),%xmm0
  call   <floor@plt>
  mov    %rax,%r13
  movsd  0x10(%rsp),%xmm0
  call   <ceil@plt>
  cmp    %rbp,0x68(%rsp)
  jbe    L187
  mov    0x70(%rsp),%rsi
  cmp    %rax,%rsi
  jbe    L187
  mov    %rsi,%rdx
  imul   %r14,%rdx
  lea    (%rdx,%r13,1),%rcx
  movsd  (%r15,%rcx,8),%xmm0
  add    %rax,%rdx
  movsd  (%r15,%rdx,8),%xmm3
  imul   %rbp,%rsi
  mov    %rsi,%rdx
  lea    (%rsi,%r13,1),%rcx
  movsd  (%r15,%rcx,8),%xmm4
  add    %rax,%rdx
  movsd  (%r15,%rdx,8),%xmm5
  cmp    %rbp,%r14
  je     L136
  test   %r14,%r14
  js     L233
  pxor   %xmm1,%xmm1
  cvtsi2sd %r14,%xmm1
L240:
  movsd  0x40(%rsp),%xmm2
  subsd  %xmm1,%xmm2
  test   %rbp,%rbp
  js     L88
  pxor   %xmm1,%xmm1
  cvtsi2sd %rbp,%xmm1
L1:
  subsd  0x40(%rsp),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm1
  mulsd  %xmm5,%xmm2
  movapd %xmm1,%xmm3
  addsd  %xmm2,%xmm3
L136:
  cmp    %rax,%r13
  je     L23
  test   %rax,%rax
  js     L217
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
L138:
  subsd  0x10(%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  test   %r13,%r13
  js     L209
  pxor   %xmm2,%xmm2
  cvtsi2sd %r13,%xmm2
  jmp    L204
L298:
  test   %r12,%r12
  mov    $0x0,%eax
  cmovne 0x90(%rsp),%rax
  mov    0x60(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  mov    %rax,0x60(%rsp)
  movsd  0x50(%rsp),%xmm2
  addsd  D34(%rip),%xmm2
  movsd  %xmm2,0x50(%rsp)
  addq   $0x1,0x58(%rsp)
  mov    0x58(%rsp),%rax
  cmp    %rax,0x80(%rsp)
  jbe    L189
L182:
  movsd  0x30(%rsp),%xmm2
  movsd  0x50(%rsp),%xmm7
  mulsd  %xmm7,%xmm2
  movsd  %xmm2,0x20(%rsp)
  movsd  0x18(%rsp),%xmm2
  mulsd  %xmm7,%xmm2
  movsd  %xmm2,0x38(%rsp)
  mov    0x88(%rsp),%rax
  mov    0x60(%rsp),%rcx
  lea    (%rax,%rcx,8),%rax
  mov    %rax,0x78(%rsp)
  movsd  0x98(%rsp),%xmm1
  movsd  %xmm1,0x8(%rsp)
  mov    $0x0,%ebx
  jmp    L270
L189:
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D10
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D9
type: byte[16]
name: extract_symbolic_data
arguments: data_label: D34
type: f64

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D34: 1

assistant: ```c
void fitest_image_rotate(double *src, double *dst, unsigned long size_x_src, unsigned long size_y_src, unsigned long size_x_dst, unsigned long size_y_dst, double ori) {
  double *m_src = (double *)src;
  double *m_dst = (double *)dst;
  if ((size_x_src > 0) && (size_y_src > 0) && (size_x_dst > 0) && (size_y_dst > 0)) {
    const double cos_ori = cos(ori);
    const double sin_ori = sin(ori);
    const double origin_x_src = (double)((size_x_src - 1)) / 2;
    const double origin_y_src = (double)((size_y_src - 1)) / 2;
    double u = -((double)((size_x_dst - 1)) / 2);
    unsigned long n = 0;
    for (unsigned long dst_x = 0; dst_x < size_x_dst; dst_x++) {
      double v = -((double)((size_y_dst - 1)) / 2);
      for (unsigned long dst_y = 0; dst_y < size_y_dst; dst_y++) {
        double x = u * cos_ori + v * sin_ori + origin_x_src;
        double y = v * cos_ori - u * sin_ori + origin_y_src;
        if ((x >= 0) && (y >= 0)) {
          unsigned long x0 = (unsigned long)(floor(x));
          unsigned long x1 = (unsigned long)(ceil(x));
          unsigned long y0 = (unsigned long)(floor(y));
          unsigned long y1 = (unsigned long)(ceil(y));
          if ((0 <= x0) && (x1 < size_x_src) && (0 <= y0) && (y1 < size_y_src)) {
            double dist_x0 = x - x0;
            double dist_x1 = x1 - x;
            double dist_y0 = y - y0;
            double dist_y1 = y1 - y;
            const double m00 = m_src[x0 * size_y_src + y0];
            const double m01 = m_src[x0 * size_y_src + y1];
            const double m10 = m_src[x1 * size_y_src + y0];
            const double m11 = m_src[x1 * size_y_src + y1];
            const double t0 = (x0 != x1) ? (dist_x1 * m00 + dist_x0 * m10) : m00;
            const double t1 = (x0 != x1) ? (dist_x1 * m01 + dist_x0 * m11) : m01;
            m_dst[n] = (y0 != y1) ? (dist_y1 * t0 + dist_y0 * t1) : t0;
          }
        }
        n++;
        v++;
      }
      u++;
    }
  }
}
```