user: Translate the below assembly code into C programming language:

```asm
<gridGenRotBounds>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  movslq %esi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x68,%rsp
  mov    %rcx,0x50(%rsp)
  mov    %r9,0x58(%rsp)
  call   <gridInqXpole@plt>
  mov    %ebp,%edi
  movsd  %xmm0,0x18(%rsp)
  call   <gridInqYpole@plt>
  mov    %ebp,%edi
  movsd  %xmm0,(%rsp)
  call   <gridInqAngle@plt>
  movslq %ebx,%rax
  movq   $0x0,0x40(%rsp)
  mov    %rax,0x48(%rsp)
  movq   $0x0,0x38(%rsp)
  test   %rax,%rax
  jle    L10
  movsd  (%rsp),%xmm2
  movapd %xmm0,%xmm4
L32:
  mov    0x38(%rsp),%rax
  movsd  0x0(%r13),%xmm0
  shl    $0x4,%rax
  comisd 0x8(%r13),%xmm0
  movsd  0x8(%r13,%rax,1),%xmm7
  movsd  0x0(%r13,%rax,1),%xmm6
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm6,0x8(%rsp)
  jbe    L5
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm6,0x10(%rsp)
L5:
  test   %r12,%r12
  jle    L25
  mov    0x40(%rsp),%rbx
  mov    0x58(%rsp),%rax
  xor    %r14d,%r14d
  mov    0x50(%rsp),%r15
  shl    $0x5,%rbx
  lea    (%rax,%rbx,1),%rbp
  add    0xa0(%rsp),%rbx
  nopl   0x0(%rax,%rax,1)
L42:
  movsd  (%r15),%xmm5
  movsd  0x8(%r15),%xmm6
  add    $0x1,%r14
  movsd  %xmm4,0x20(%rsp)
  movsd  0x18(%rsp),%xmm3
  add    $0x10,%r15
  add    $0x20,%rbp
  add    $0x20,%rbx
  movsd  0x8(%rsp),%xmm0
  movapd %xmm5,%xmm1
  movsd  %xmm6,(%rsp)
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  call   <lamrot_to_lam@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  %xmm0,-0x20(%rbp)
  movsd  0x28(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  call   <lamrot_to_lam@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  movsd  %xmm0,-0x18(%rbp)
  movsd  0x28(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  call   <lamrot_to_lam@plt>
  movsd  0x30(%rsp),%xmm5
  movsd  0x20(%rsp),%xmm4
  movsd  %xmm0,-0x10(%rbp)
  movsd  0x18(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm0
  movapd %xmm5,%xmm1
  call   <lamrot_to_lam@plt>
  movsd  0x30(%rsp),%xmm5
  movsd  0x20(%rsp),%xmm4
  movsd  %xmm0,-0x8(%rbp)
  movsd  0x28(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm0
  movapd %xmm5,%xmm1
  movapd %xmm4,%xmm3
  call   <phirot_to_phi@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm2
  movsd  %xmm0,-0x20(%rbx)
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  movapd %xmm4,%xmm3
  call   <phirot_to_phi@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm2
  movsd  %xmm0,-0x18(%rbx)
  movsd  (%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  movapd %xmm4,%xmm3
  call   <phirot_to_phi@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x30(%rsp),%xmm5
  movsd  %xmm0,-0x10(%rbx)
  movsd  0x28(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm0
  movapd %xmm4,%xmm3
  movapd %xmm5,%xmm1
  movsd  %xmm2,(%rsp)
  call   <phirot_to_phi@plt>
  movsd  (%rsp),%xmm2
  movsd  0x20(%rsp),%xmm4
  movsd  %xmm0,-0x8(%rbx)
  cmp    %r12,%r14
  jne    L42
L25:
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  add    %r12,0x40(%rsp)
  cmp    0x48(%rsp),%rax
  jne    L32
L10:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void gridGenRotBounds(int gridID, int nx, int ny, double *xbounds, double *ybounds, double *xbounds2D, double *ybounds2D) {
  long i, j, index;
  double minlon, maxlon;
  double minlat, maxlat;
  double xpole, ypole, angle;
  xpole = gridInqXpole(gridID);
  ypole = gridInqYpole(gridID);
  angle = gridInqAngle(gridID);
  for (j = 0; j < ny; j++) {
    if (ybounds[0] > ybounds[1]) {
      maxlat = ybounds[2 * j];
      minlat = ybounds[2 * j + 1];
    } else {
      maxlat = ybounds[2 * j + 1];
      minlat = ybounds[2 * j];
    }
    for (i = 0; i < nx; i++) {
      minlon = xbounds[2 * i];
      maxlon = xbounds[2 * i + 1];
      index = j * 4 * nx + 4 * i;
      xbounds2D[index + 0] = lamrot_to_lam(minlat, minlon, ypole, xpole, angle);
      xbounds2D[index + 1] = lamrot_to_lam(minlat, maxlon, ypole, xpole, angle);
      xbounds2D[index + 2] = lamrot_to_lam(maxlat, maxlon, ypole, xpole, angle);
      xbounds2D[index + 3] = lamrot_to_lam(maxlat, minlon, ypole, xpole, angle);
      ybounds2D[index + 0] = phirot_to_phi(minlat, minlon, ypole, angle);
      ybounds2D[index + 1] = phirot_to_phi(minlat, maxlon, ypole, angle);
      ybounds2D[index + 2] = phirot_to_phi(maxlat, maxlon, ypole, angle);
      ybounds2D[index + 3] = phirot_to_phi(maxlat, minlon, ypole, angle);
    }
  }
}
```