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

```asm
<arotate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x50(%rsp)
  mov    %rsi,%r12
  mov    %r8d,%r13d
  mov    %r9,%r15
  mov    0xb0(%rsp),%rbp
  cvtsd2ss %xmm0,%xmm0
  mov    %dx,0x5c(%rsp)
  mov    %cx,0x5e(%rsp)
  lea    0x68(%rsp),%rdi
  lea    0x60(%rsp),%rsi
  cvtss2sd %xmm0,%xmm0
  divsd  D10(%rip),%xmm0
  call   <sincos@plt>
  movsd  0x60(%rsp),%xmm6
  movsd  %xmm6,(%rsp)
  movsd  0x68(%rsp),%xmm6
  movsd  %xmm6,0x8(%rsp)
  mov    $0xa,%edi
  call   <putchar@plt>
  test   %r15,%r15
  jle    L99
  mov    $0x0,%r14d
  jmp    L60
L43:
  mov    %r14d,%esi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L149
L88:
  mov    (%r12),%rax
  movw   $0x96,(%rax,%rbx,2)
L118:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L12
L129:
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  (%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  subsd  0x10(%rsp),%xmm0
  subsd  0x20(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  addsd  0x30(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm1
  addsd  0x38(%rsp),%xmm1
  subsd  0x40(%rsp),%xmm1
  subsd  0x48(%rsp),%xmm1
  addsd  0x28(%rsp),%xmm1
  test   %r13d,%r13d
  jne    L89
  cvttsd2si %xmm0,%eax
  test   %eax,%eax
  js     L88
  cvttsd2si %xmm1,%edx
  test   %edx,%edx
  js     L88
  movslq %eax,%rcx
  cmp    %rbp,%rcx
  jge    L88
  movslq %edx,%rcx
  cmp    %r15,%rcx
  jge    L88
  movslq %edx,%rdx
  cltq
  mov    0x50(%rsp),%rsi
  mov    (%rsi,%rdx,8),%rdx
  movzwl (%rdx,%rax,2),%edx
  mov    (%r12),%rax
  mov    %dx,(%rax,%rbx,2)
  jmp    L118
L89:
  mov    %rbp,%rdx
  mov    %r15,%rsi
  mov    0x50(%rsp),%rdi
  mov    $0x2,%eax
  call   <bilinear_interpolate@plt>
  mov    (%r12),%rdx
  mov    %ax,(%rdx,%rbx,2)
  jmp    L118
L12:
  add    $0x1,%r14
  add    $0x8,%r12
  cmp    %r15,%r14
  je     L99
L60:
  mov    %r14d,%ebx
  movslq %r14d,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %r14d,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  cmp    %r14d,%eax
  je     L43
L149:
  test   %rbp,%rbp
  jle    L12
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm6
  mulsd  %xmm0,%xmm6
  movsd  %xmm6,0x10(%rsp)
  movswl 0x5c(%rsp),%eax
  pxor   %xmm5,%xmm5
  cvtsi2sd %eax,%xmm5
  movsd  %xmm5,0x18(%rsp)
  movapd %xmm5,%xmm6
  movsd  (%rsp),%xmm3
  mulsd  %xmm3,%xmm6
  movsd  %xmm6,0x20(%rsp)
  movswl 0x5e(%rsp),%eax
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x28(%rsp)
  movapd %xmm7,%xmm6
  mulsd  %xmm2,%xmm6
  movsd  %xmm6,0x30(%rsp)
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x38(%rsp)
  mulsd  %xmm2,%xmm5
  movsd  %xmm5,0x40(%rsp)
  mulsd  %xmm3,%xmm7
  movsd  %xmm7,0x48(%rsp)
  mov    $0x0,%ebx
  jmp    L129
L99:
  mov    $0x1,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: label: D10
type_guessed: f64
name: read_data
arguments: label: D4
type_guessed: string

tool: D10: 57.29577951

tool: D4: %d 

assistant: ```c
int arotate(the_image, out_image, angle, m, n, bilinear, rows, cols)
float angle;
int bilinear;
long cols, rows;
short **the_image, **out_image, m, n;
{
  double cosa, sina, radian_angle, tmpx, tmpy;
  int i, j, new_i, new_j;
  radian_angle = angle / 57.29577951;
  cosa = cos(radian_angle);
  sina = sin(radian_angle);
  printf("\n");
  for (i = 0; i < rows; i++) {
    if ((i % 10) == 0)
      printf("%d ", i);
    for (j = 0; j < cols; j++) {
      tmpx = (double)(j)*cosa - (double)(i)*sina - (double)(m)*cosa + (double)(m) + (double)(n)*sina;
      tmpy = (double)(i)*cosa + (double)(j)*sina - (double)(m)*sina - (double)(n)*cosa + (double)(n);
      new_j = tmpx;
      new_i = tmpy;
      if (bilinear == 0) {
        if (new_j < 0 || new_j >= cols || new_i < 0 || new_i >= rows)
          out_image[i][j] = 150;
        else
          out_image[i][j] = the_image[new_i][new_j];
      } else {
        out_image[i][j] = bilinear_interpolate(the_image, tmpx, tmpy, rows, cols);
      }
    }
  }
  return (1);
}
```