user: Please show me the C implementation that matches the assembly code listed below:

```asm
<imc_rotate_WCS>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    D5(%rip),%r13
  push   %r12
  mov    %r13,%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movd   %xmm0,%ebx
  sub    $0x58,%rsp
  movss  %xmm1,0x1c(%rsp)
  lea    0x20(%rsp),%rdx
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <imget_fits_float_value@plt>
  cmp    $0x1,%eax
  je     L63
L108:
  xor    %r12d,%r12d
L77:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x58,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L63:
  lea    D4(%rip),%r14
  lea    0x24(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r14,%rsi
  call   <imget_fits_float_value@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  jne    L108
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  movd   %ebx,%xmm6
  mov    %r13,%rsi
  cvtss2sd 0x20(%rsp),%xmm0
  cvtss2sd 0x24(%rsp),%xmm1
  mulsd  0x8(%rsp),%xmm0
  lea    D56(%rip),%rbx
  mulsd  0x10(%rsp),%xmm1
  lea    D178(%rip),%r15
  mov    %rbx,%rdx
  mov    %rbp,%rdi
  mov    %r15,%rcx
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x20(%rsp),%xmm0
  mov    %r15,%rcx
  mov    %rbx,%rdx
  mov    %r14,%rsi
  mulsd  0x10(%rsp),%xmm0
  cvtss2sd 0x24(%rsp),%xmm1
  mov    %rbp,%rdi
  lea    D185(%rip),%rbx
  mulsd  0x8(%rsp),%xmm1
  lea    D85(%rip),%r14
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x1c(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    0x28(%rsp),%rdx
  call   <imget_fits_float_value@plt>
  lea    0x2c(%rsp),%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <imget_fits_float_value@plt>
  lea    D25(%rip),%r8
  lea    0x30(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r8,%rsi
  add    %eax,%r13d
  call   <imget_fits_float_value@plt>
  lea    D23(%rip),%r9
  lea    0x34(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r9,%rsi
  add    %eax,%r13d
  call   <imget_fits_float_value@plt>
  add    %r13d,%eax
  jne    L82
L47:
  lea    D154(%rip),%r13
  lea    0x38(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <imget_fits_float_value@plt>
  cmp    $0x1,%eax
  je     L18
L53:
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  lea    D198(%rip),%rsi
  mov    %rbp,%rdi
  call   <imaddhistf@plt>
  jmp    L77
L82:
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %r15,%rcx
  mov    %rbx,%rsi
  cvtss2sd 0x28(%rsp),%xmm0
  cvtss2sd 0x30(%rsp),%xmm1
  mulsd  0x8(%rsp),%xmm0
  lea    D193(%rip),%r13
  mulsd  0x10(%rsp),%xmm1
  mov    %r13,%rdx
  mov    %rbp,%rdi
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x2c(%rsp),%xmm0
  mov    %r15,%rcx
  mov    %r13,%rdx
  mov    %r14,%rsi
  mulsd  0x8(%rsp),%xmm0
  cvtss2sd 0x34(%rsp),%xmm1
  mov    %rbp,%rdi
  mulsd  0x10(%rsp),%xmm1
  subsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x28(%rsp),%xmm0
  cvtss2sd 0x30(%rsp),%xmm1
  mov    %r15,%rcx
  mov    %r13,%rdx
  mulsd  0x8(%rsp),%xmm1
  lea    D25(%rip),%r8
  mov    %rbp,%rdi
  mulsd  0x10(%rsp),%xmm0
  mov    %r8,%rsi
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x2c(%rsp),%xmm0
  cvtss2sd 0x34(%rsp),%xmm1
  mov    %r15,%rcx
  mov    %r13,%rdx
  mulsd  0x10(%rsp),%xmm0
  lea    D23(%rip),%r9
  mov    %rbp,%rdi
  mulsd  0x8(%rsp),%xmm1
  mov    %r9,%rsi
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  jmp    L47
L18:
  lea    D98(%rip),%r14
  lea    0x3c(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r14,%rsi
  call   <imget_fits_float_value@plt>
  cmp    $0x1,%eax
  jne    L53
  lea    0x40(%rsp),%rdx
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  call   <imget_fits_float_value@plt>
  sub    $0x1,%eax
  jne    L53
  lea    D164(%rip),%r8
  lea    0x44(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r8,%rsi
  call   <imget_fits_float_value@plt>
  sub    $0x1,%eax
  jne    L53
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  mov    %r15,%rcx
  mov    %r13,%rsi
  cvtss2sd 0x38(%rsp),%xmm0
  cvtss2sd 0x40(%rsp),%xmm1
  mulsd  0x8(%rsp),%xmm0
  lea    D193(%rip),%rbx
  mulsd  0x10(%rsp),%xmm1
  mov    %rbx,%rdx
  mov    %rbp,%rdi
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd 0x3c(%rsp),%xmm0
  mov    %r15,%rcx
  mov    %rbx,%rdx
  mov    %r14,%rsi
  mulsd  0x8(%rsp),%xmm0
  cvtss2sd 0x44(%rsp),%xmm1
  mov    %rbp,%rdi
  mulsd  0x10(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm1,%xmm1
  mov    %r15,%rcx
  movss  0x38(%rsp),%xmm0
  cvtss2sd 0x40(%rsp),%xmm1
  mulsd  0x8(%rsp),%xmm1
  mov    %rbx,%rdx
  movss  D159(%rip),%xmm2
  mov    %rbp,%rdi
  lea    D6(%rip),%rsi
  xorps  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  0x10(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  pxor   %xmm1,%xmm1
  mov    %r15,%rcx
  movss  0x3c(%rsp),%xmm0
  cvtss2sd 0x44(%rsp),%xmm1
  mov    %rbx,%rdx
  mov    %rbp,%rdi
  movss  D159(%rip),%xmm2
  lea    D164(%rip),%r8
  mulsd  0x8(%rsp),%xmm1
  xorps  %xmm2,%xmm0
  mov    %r8,%rsi
  cvtss2sd %xmm0,%xmm0
  mulsd  0x10(%rsp),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  call   <imupdate_fitsf@plt>
  jmp    L53
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D5
type: string
name: read_data
arguments: tag: D4
type: string
name: read_data
arguments: tag: D56
type: string
name: read_data
arguments: tag: D178
type: string
name: read_data
arguments: tag: D185
type: string
name: read_data
arguments: tag: D85
type: string
name: read_data
arguments: tag: D25
type: string
name: read_data
arguments: tag: D23
type: string
name: read_data
arguments: tag: D154
type: string
name: read_data
arguments: tag: D198
type: string
name: read_data
arguments: tag: D193
type: string
name: read_data
arguments: tag: D98
type: string
name: read_data
arguments: tag: D6
type: string
name: read_data
arguments: tag: D164
type: string
name: read_data
arguments: tag: D159
type: byte[4]

tool: D5: CRPIX1

tool: D4: CRPIX2

tool: D56: %20.1f / %-47.47s

tool: 

tool: D185: CD1_1

tool: D85: CD1_2

tool: D25: CD2_1

tool: D23: CD2_2

tool: D154: PC001001

tool: D198: WCS is rotated sin=%f cos=%f

tool: D193: %20.8f / %-47.47s

tool: D98: PC001002

tool: D6: PC002001

tool: D164: PC002002

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

assistant: ```c
int imc_rotate_WCS(struct icom *icom, float dx, float dy, double cos_rot, double sin_rot) {
  float crpix1, crpix2;
  float cd11, cd12, cd21, cd22;
  float pc11, pc12, pc21, pc22;
  if (imget_fits_float_value(icom, "CRPIX1", &crpix1) == 1 && imget_fits_float_value(icom, "CRPIX2", &crpix2) == 1) {
    imupdate_fitsf(icom, "CRPIX1", "%20.1f / %-47.47s", crpix1 * cos_rot - crpix2 * sin_rot + dx, "");
    imupdate_fitsf(icom, "CRPIX2", "%20.1f / %-47.47s", crpix1 * sin_rot + crpix2 * cos_rot + dy, "");
    if ((imget_fits_float_value(icom, "CD1_1", &cd11) + imget_fits_float_value(icom, "CD1_2", &cd12) + imget_fits_float_value(icom, "CD2_1", &cd21) + imget_fits_float_value(icom, "CD2_2", &cd22)) != 0) {
      imupdate_fitsf(icom, "CD1_1", "%20.8f / %-47.47s", (cd11 * cos_rot - cd21 * sin_rot), "");
      imupdate_fitsf(icom, "CD1_2", "%20.8f / %-47.47s", (cd12 * cos_rot - cd22 * sin_rot), "");
      imupdate_fitsf(icom, "CD2_1", "%20.8f / %-47.47s", (cd11 * sin_rot + cd21 * cos_rot), "");
      imupdate_fitsf(icom, "CD2_2", "%20.8f / %-47.47s", (cd12 * sin_rot + cd22 * cos_rot), "");
    }
    if (imget_fits_float_value(icom, "PC001001", &pc11) == 1 && imget_fits_float_value(icom, "PC001002", &pc12) == 1 && imget_fits_float_value(icom, "PC002001", &pc21) == 1 && imget_fits_float_value(icom, "PC002002", &pc22) == 1) {
      imupdate_fitsf(icom, "PC001001", "%20.8f / %-47.47s", (pc11 * cos_rot + pc21 * sin_rot), "");
      imupdate_fitsf(icom, "PC001002", "%20.8f / %-47.47s", (pc12 * cos_rot + pc22 * sin_rot), "");
      imupdate_fitsf(icom, "PC002001", "%20.8f / %-47.47s", (-pc11 * sin_rot + pc21 * cos_rot), "");
      imupdate_fitsf(icom, "PC002002", "%20.8f / %-47.47s", (-pc12 * sin_rot + pc22 * cos_rot), "");
    }
    imaddhistf(icom, "WCS is rotated sin=%f cos=%f", sin_rot, cos_rot);
    return 1;
  }
  return 0;
}
```