user: 请从给定的汇编指令推导出C源代码：

```asm
<sphx2s>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movslq %r8d,%rbx
  sub    $0xc8,%rsp
  mov    0x108(%rsp),%rax
  mov    %edx,0x6c(%rsp)
  mov    %ecx,(%rsp)
  mov    0x100(%rsp),%r14
  mov    %rax,0x58(%rsp)
  mov    0x110(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  mov    %esi,0x24(%rsp)
  mov    %edx,%esi
  test   %edx,%edx
  jg     L537
  mov    %r12d,0x6c(%rsp)
  mov    $0x1,%esi
  movl   $0x1,0x24(%rsp)
L537:
  pxor   %xmm4,%xmm4
  ucomisd 0x20(%rbp),%xmm4
  jp     L556
  je     L352
L556:
  mov    %r12d,%eax
  imul   %ebx,%eax
  test   %r12d,%r12d
  jle    L585
  movslq (%rsp),%r10
  cltq
  movslq %ebx,%r9
  mov    0x58(%rsp),%r8
  lea    0x0(,%rax,8),%rcx
  shl    $0x3,%r9
  xor    %edi,%edi
  shl    $0x3,%r10
  nopl   (%rax)
L433:
  movsd  0x0(%r13),%xmm0
  subsd  0x10(%rbp),%xmm0
  mov    %r8,%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L419:
  add    $0x1,%eax
  movsd  %xmm0,(%rdx)
  add    %rcx,%rdx
  cmp    %eax,%esi
  jne    L419
  add    $0x1,%edi
  add    %r10,%r13
  add    %r9,%r8
  cmp    %edi,%r12d
  jne    L433
L585:
  mov    0x6c(%rsp),%edx
  test   %edx,%edx
  jle    L142
  movslq (%rsp),%rax
  lea    0x0(,%rbx,8),%r15
  mov    %r14,0x38(%rsp)
  movl   $0x0,0x68(%rsp)
  shl    $0x3,%rax
  mov    %rax,0x70(%rsp)
  mov    0x24(%rsp),%eax
  sub    $0x1,%eax
  add    $0x1,%rax
  imul   %r15,%rax
  mov    %rax,0x88(%rsp)
  lea    0xa0(%rsp),%rax
  mov    %rax,0x78(%rsp)
  lea    0xb0(%rsp),%rax
  mov    %rax,0x80(%rsp)
  xchg   %ax,%ax
L312:
  mov    0x38(%rsp),%rax
  mov    0x78(%rsp),%rsi
  mov    0x80(%rsp),%rdi
  movsd  (%rax),%xmm0
  call   <sincosd@plt>
  movsd  0x18(%rbp),%xmm2
  movsd  0x20(%rbp),%xmm1
  movsd  0xa0(%rsp),%xmm0
  mov    0x24(%rsp),%eax
  movapd %xmm2,%xmm4
  mulsd  %xmm0,%xmm4
  mulsd  %xmm1,%xmm0
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm0,0x48(%rsp)
  movsd  0xb0(%rsp),%xmm0
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm1
  movsd  %xmm2,0x50(%rsp)
  movsd  %xmm1,0x28(%rsp)
  test   %eax,%eax
  jle    L208
  movsd  D182(%rip),%xmm4
  lea    0xa8(%rsp),%rax
  mov    0x58(%rsp),%rbx
  xor    %r13d,%r13d
  mov    %rax,0x30(%rsp)
  mov    0x60(%rsp),%r12
  lea    0x98(%rsp),%r14
  movsd  %xmm4,0x10(%rsp)
  jmp    L336
  nopl   0x0(%rax)
L582:
  subsd  %xmm5,%xmm0
  movsd  %xmm0,(%rbx)
L568:
  mov    D116(%rip),%rax
  movapd %xmm4,%xmm0
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  movq   %rax,%xmm1
  call   <fmod@plt>
  pxor   %xmm7,%xmm7
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm1
  movsd  0x98(%rsp),%xmm0
  ucomisd %xmm7,%xmm1
  jp     L275
  jne    L275
  mov    0x38(%rsp),%rax
  mulsd  0x8(%rbp),%xmm0
  addsd  (%rax),%xmm0
  comisd D239(%rip),%xmm0
  jbe    L126
  movsd  D116(%rip),%xmm6
  subsd  %xmm0,%xmm6
  movapd %xmm6,%xmm0
L126:
  movsd  D26(%rip),%xmm1
  movsd  %xmm0,(%r12)
  comisd %xmm0,%xmm1
  jbe    L60
  movsd  D151(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12)
L60:
  add    $0x1,%r13d
  add    %r15,%rbx
  add    %r15,%r12
  cmp    %r13d,0x24(%rsp)
  je     L338
L336:
  movsd  (%rbx),%xmm4
  mov    0x30(%rsp),%rdi
  mov    %r14,%rsi
  movapd %xmm4,%xmm0
  movsd  %xmm4,(%rsp)
  call   <sincosd@plt>
  movsd  0x18(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm3
  movsd  0x98(%rsp),%xmm0
  movsd  D125(%rip),%xmm6
  movsd  (%rsp),%xmm4
  mulsd  %xmm0,%xmm1
  subsd  %xmm1,%xmm3
  movapd %xmm3,%xmm1
  andpd  D2(%rip),%xmm1
  comisd %xmm1,%xmm6
  ja     L545
L172:
  pxor   %xmm7,%xmm7
  mov    $0x1,%edx
  movsd  0xa0(%rsp),%xmm2
  xorpd  D144(%rip),%xmm2
  mulsd  0xa8(%rsp),%xmm2
  ucomisd %xmm7,%xmm3
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L195
  ucomisd %xmm7,%xmm2
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L195
  movsd  D239(%rip),%xmm7
  comisd 0x8(%rbp),%xmm7
  jbe    L473
  movsd  D116(%rip),%xmm0
  addsd  %xmm4,%xmm0
L324:
  addsd  0x0(%rbp),%xmm0
  pxor   %xmm6,%xmm6
  movsd  %xmm0,(%rbx)
  movsd  0x0(%rbp),%xmm1
  comisd %xmm6,%xmm1
  jb     L85
  comisd %xmm0,%xmm6
  jbe    L435
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,(%rbx)
L435:
  movsd  0x10(%rsp),%xmm5
  comisd %xmm5,%xmm0
  ja     L582
  movsd  D105(%rip),%xmm5
  comisd %xmm0,%xmm5
  jbe    L568
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,(%rbx)
  jmp    L568
  nopl   0x0(%rax)
L275:
  mulsd  0x48(%rsp),%xmm0
  addsd  0x50(%rsp),%xmm0
  movapd %xmm0,%xmm1
  andpd  D2(%rip),%xmm1
  comisd D199(%rip),%xmm1
  jbe    L252
  mulsd  %xmm2,%xmm2
  pxor   %xmm4,%xmm4
  mulsd  %xmm3,%xmm3
  comisd %xmm0,%xmm4
  addsd  %xmm3,%xmm2
  movapd %xmm2,%xmm0
  ja     L96
  call   <sqrt@plt>
  mov    %eax,%edi
  call   <acosd@plt>
  andpd  D2(%rip),%xmm0
L291:
  movsd  %xmm0,(%r12)
  jmp    L60
  nopl   0x0(%rax,%rax,1)
L85:
  pxor   %xmm7,%xmm7
  comisd %xmm7,%xmm0
  jbe    L435
  subsd  0x10(%rsp),%xmm0
  movsd  %xmm0,(%rbx)
  jmp    L435
  nopl   (%rax)
L473:
  movapd %xmm4,%xmm0
  xorpd  D144(%rip),%xmm0
  jmp    L324
  nopl   0x0(%rax)
L195:
  movapd %xmm3,%xmm1
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%rsp)
  movsd  %xmm4,0x40(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <atan2d@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm3
  movsd  0x40(%rsp),%xmm4
  jmp    L324
  nopl   0x0(%rax)
L545:
  movsd  D10(%rip),%xmm3
  mov    0x38(%rsp),%rax
  movsd  %xmm4,0x8(%rsp)
  subsd  %xmm0,%xmm3
  mulsd  0x18(%rsp),%xmm3
  movsd  (%rax),%xmm0
  addsd  0x8(%rbp),%xmm0
  movsd  %xmm3,(%rsp)
  call   <cosd@plt>
  movsd  (%rsp),%xmm3
  movsd  0x8(%rsp),%xmm4
  subsd  %xmm0,%xmm3
  jmp    L172
  nopl   0x0(%rax)
L252:
  call   <asind@plt>
  jmp    L291
  nopw   0x0(%rax,%rax,1)
L96:
  call   <sqrt@plt>
  mov    %eax,%edi
  call   <acosd@plt>
  andpd  D2(%rip),%xmm0
  xorpd  D144(%rip),%xmm0
  jmp    L291
  nopl   0x0(%rax)
L338:
  mov    0x88(%rsp),%rcx
  add    %rcx,0x58(%rsp)
  add    %rcx,0x60(%rsp)
L208:
  addl   $0x1,0x68(%rsp)
  mov    0x70(%rsp),%rdi
  mov    0x68(%rsp),%eax
  add    %rdi,0x38(%rsp)
  cmp    %eax,0x6c(%rsp)
  jne    L312
L142:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L476
  add    $0xc8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L352:
  ucomisd 0x8(%rbp),%xmm4
  movsd  0x0(%rbp),%xmm0
  movsd  0x10(%rbp),%xmm2
  movsd  D182(%rip),%xmm1
  jp     L346
  jne    L346
  addsd  D116(%rip),%xmm0
  movsd  %xmm1,0x8(%rsp)
  subsd  %xmm2,%xmm0
  call   <fmod@plt>
  mov    0x6c(%rsp),%esi
  movsd  0x8(%rsp),%xmm1
  test   %esi,%esi
  jle    L142
  mov    0x24(%rsp),%r9d
  movslq %ebx,%rcx
  movslq (%rsp),%rsi
  xor    %r8d,%r8d
  shl    $0x3,%rcx
  mov    %r12d,0x8(%rsp)
  mov    0x58(%rsp),%r10
  xor    %edi,%edi
  lea    -0x1(%r9),%eax
  movsd  D105(%rip),%xmm3
  mov    0x60(%rsp),%rbx
  shl    $0x3,%rsi
  add    $0x1,%rax
  imul   %rcx,%rax
  mov    %rax,%r11
  nopl   0x0(%rax)
L212:
  mov    %edi,%eax
  cltd
  idivl  0x8(%rsp)
  imul   (%rsp),%edx
  movslq %edx,%rdx
  lea    0x0(%r13,%rdx,8),%rdx
  test   %r9d,%r9d
  jle    L594
  mov    %r10,%rax
  mov    %rbx,%r15
  xor    %r12d,%r12d
  jmp    L101
  nopw   0x0(%rax,%rax,1)
L263:
  subsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
L576:
  add    $0x1,%r12d
  add    %rcx,%rax
  add    %rcx,%r15
  add    %rsi,%rdx
  cmp    %r12d,%r9d
  je     L128
L101:
  movsd  (%rdx),%xmm2
  pxor   %xmm6,%xmm6
  addsd  %xmm0,%xmm2
  movsd  %xmm2,(%rax)
  movsd  (%r14),%xmm2
  movsd  %xmm2,(%r15)
  movsd  0x0(%rbp),%xmm2
  comisd %xmm6,%xmm2
  movsd  (%rax),%xmm2
  jb     L452
  comisd %xmm2,%xmm6
  jbe    L110
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
L110:
  comisd %xmm1,%xmm2
  ja     L263
  comisd %xmm2,%xmm3
  jbe    L576
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  jmp    L576
L346:
  addsd  %xmm2,%xmm0
  movsd  %xmm1,0x10(%rsp)
  call   <fmod@plt>
  mov    0x6c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L142
  mov    0x24(%rsp),%r9d
  movslq %ebx,%rcx
  movslq (%rsp),%rsi
  xor    %r8d,%r8d
  shl    $0x3,%rcx
  mov    %r12d,0x8(%rsp)
  mov    0x58(%rsp),%r10
  xor    %edi,%edi
  lea    -0x1(%r9),%eax
  mov    0x60(%rsp),%rbx
  shl    $0x3,%rsi
  movq   D144(%rip),%xmm3
  add    $0x1,%rax
  movsd  D105(%rip),%xmm4
  movsd  0x10(%rsp),%xmm1
  imul   %rcx,%rax
  mov    %rax,%r11
  nopw   0x0(%rax,%rax,1)
L120:
  mov    %edi,%eax
  cltd
  idivl  0x8(%rsp)
  imul   (%rsp),%edx
  movslq %edx,%rdx
  lea    0x0(%r13,%rdx,8),%rdx
  test   %r9d,%r9d
  jle    L432
  mov    %r10,%rax
  mov    %rbx,%r15
  xor    %r12d,%r12d
  jmp    L25
  nopw   0x0(%rax,%rax,1)
L325:
  subsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
L540:
  add    $0x1,%r12d
  add    %rcx,%rax
  add    %rcx,%r15
  add    %rsi,%rdx
  cmp    %r12d,%r9d
  je     L205
L25:
  movapd %xmm0,%xmm2
  subsd  (%rdx),%xmm2
  pxor   %xmm5,%xmm5
  movsd  %xmm2,(%rax)
  movsd  (%r14),%xmm2
  xorpd  %xmm3,%xmm2
  movsd  %xmm2,(%r15)
  movsd  0x0(%rbp),%xmm2
  comisd %xmm5,%xmm2
  movsd  (%rax),%xmm2
  jb     L5
  comisd %xmm2,%xmm5
  jbe    L439
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
L439:
  comisd %xmm1,%xmm2
  ja     L325
  comisd %xmm2,%xmm4
  jbe    L540
  addsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  jmp    L540
  nop
L452:
  pxor   %xmm7,%xmm7
  comisd %xmm7,%xmm2
  jbe    L110
  subsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  jmp    L110
  nopl   0x0(%rax,%rax,1)
L5:
  pxor   %xmm5,%xmm5
  comisd %xmm5,%xmm2
  jbe    L439
  subsd  %xmm1,%xmm2
  movsd  %xmm2,(%rax)
  jmp    L439
  nopl   0x0(%rax)
L205:
  add    %r11,%r10
  add    %r11,%rbx
  add    %r9d,%edi
L432:
  add    $0x1,%r8d
  add    %rsi,%r14
  cmp    %r8d,0x6c(%rsp)
  jne    L120
  jmp    L142
  nopl   0x0(%rax,%rax,1)
L128:
  add    %r11,%r10
  add    %r11,%rbx
  add    %r9d,%edi
L594:
  add    $0x1,%r8d
  add    %rsi,%r14
  cmp    %r8d,0x6c(%rsp)
  jne    L212
  jmp    L142
L476:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D182
datatype: f64
name: retrieve_data
arguments: tag: D116
datatype: f64
name: retrieve_data
arguments: tag: D239
datatype: f64[2]
name: retrieve_data
arguments: tag: D26
datatype: f32[2]
name: retrieve_data
arguments: tag: D151
datatype: f32[2]
name: retrieve_data
arguments: tag: D125
datatype: byte[8]
name: retrieve_data
arguments: tag: D2
datatype: qword[2]
name: retrieve_data
arguments: tag: D144
datatype: f32[4]
name: retrieve_data
arguments: tag: D105
datatype: f32[2]
name: retrieve_data
arguments: tag: D199
datatype: f64[2]
name: retrieve_data
arguments: tag: D10
datatype: f64

tool: D182: 360

tool: D116: 180

tool: {"D239": [90.0,-90.0]}

tool: {"D26": [0.0,-3.3515625]}

tool: {"D151": [0.0,-3.6015625]}

tool: {"D125": [0xf1,0x68,0xe3,0x88,0xb5,0xf8,0xe4,0x3e]}

tool: {"D2": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D144": [0.0,-0.0,0.0,0.0]}

tool: {"D105": [0.0,-3.8515625]}

tool: {"D199": [0.99,0.0]}

tool: D10: 1

assistant: ```c
int sphx2s(const double eul[5], int nphi, int ntheta, int spt, int sll, const double phi[], const double theta[], double lng[], double lat[]) {
  int jphi, mphi, mtheta, rowlen, rowoff;
  double cosphi, costhe, costhe3, costhe4, dlng, dphi, sinphi, sinthe, sinthe3, sinthe4, x, y, z;
  register int iphi, itheta;
  register const double *phip, *thetap;
  register double *latp, *lngp;
  if (ntheta > 0) {
    mphi = nphi;
    mtheta = ntheta;
  } else {
    mphi = 1;
    mtheta = 1;
    ntheta = nphi;
  }
  if (eul[4] == 0.0) {
    if (eul[1] == 0.0) {
      dlng = fmod(eul[0] + 180.0 - eul[2], 360.0);
      jphi = 0;
      thetap = theta;
      lngp = lng;
      latp = lat;
      for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) {
        phip = phi + (jphi % nphi) * spt;
        for (iphi = 0; iphi < mphi; iphi++, phip += spt, jphi++) {
          *lngp = *phip + dlng;
          *latp = *thetap;
          if (eul[0] >= 0.0) {
            if (*lngp < 0.0)
              *lngp += 360.0;
          } else {
            if (*lngp > 0.0)
              *lngp -= 360.0;
          }
          if (*lngp > 360.0) {
            *lngp -= 360.0;
          } else if (*lngp < -360.0) {
            *lngp += 360.0;
          }
          lngp += sll;
          latp += sll;
        }
      }
    } else {
      dlng = fmod(eul[0] + eul[2], 360.0);
      jphi = 0;
      thetap = theta;
      lngp = lng;
      latp = lat;
      for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) {
        phip = phi + (jphi % nphi) * spt;
        for (iphi = 0; iphi < mphi; iphi++, phip += spt, jphi++) {
          *lngp = dlng - *phip;
          *latp = -(*thetap);
          if (eul[0] >= 0.0) {
            if (*lngp < 0.0)
              *lngp += 360.0;
          } else {
            if (*lngp > 0.0)
              *lngp -= 360.0;
          }
          if (*lngp > 360.0) {
            *lngp -= 360.0;
          } else if (*lngp < -360.0) {
            *lngp += 360.0;
          }
          lngp += sll;
          latp += sll;
        }
      }
    }
    return 0;
  }
  phip = phi;
  rowoff = 0;
  rowlen = nphi * sll;
  for (iphi = 0; iphi < nphi; iphi++, rowoff += sll, phip += spt) {
    dphi = *phip - eul[2];
    lngp = lng + rowoff;
    for (itheta = 0; itheta < mtheta; itheta++) {
      *lngp = dphi;
      lngp += rowlen;
    }
  }
  thetap = theta;
  lngp = lng;
  latp = lat;
  for (itheta = 0; itheta < ntheta; itheta++, thetap += spt) {
    sincosd(*thetap, &sinthe, &costhe);
    costhe3 = costhe * eul[3];
    costhe4 = costhe * eul[4];
    sinthe3 = sinthe * eul[3];
    sinthe4 = sinthe * eul[4];
    for (iphi = 0; iphi < mphi; iphi++, lngp += sll, latp += sll) {
      dphi = *lngp;
      sincosd(dphi, &sinphi, &cosphi);
      x = sinthe4 - costhe3 * cosphi;
      if (fabs(x) < 1.0e-5) {
        x = -cosd(*thetap + eul[1]) + costhe3 * (1.0 - cosphi);
      }
      y = -costhe * sinphi;
      if (x != 0.0 || y != 0.0) {
        dlng = atan2d(y, x);
      } else {
        if (eul[1] < 90.0) {
          dlng = dphi + 180.0;
        } else {
          dlng = -dphi;
        }
      }
      *lngp = eul[0] + dlng;
      if (eul[0] >= 0.0) {
        if (*lngp < 0.0)
          *lngp += 360.0;
      } else {
        if (*lngp > 0.0)
          *lngp -= 360.0;
      }
      if (*lngp > 360.0) {
        *lngp -= 360.0;
      } else if (*lngp < -360.0) {
        *lngp += 360.0;
      }
      if (fmod(dphi, 180.0) == 0.0) {
        *latp = *thetap + cosphi * eul[1];
        if (*latp > 90.0)
          *latp = 180.0 - *latp;
        if (*latp < -90.0)
          *latp = -180.0 - *latp;
      } else {
        z = sinthe3 + costhe4 * cosphi;
        if (fabs(z) > 0.99) {
          *latp = ((z) < 0.0 ? -fabs(acosd(sqrt(x * x + y * y))) : fabs(acosd(sqrt(x * x + y * y))));
        } else {
          *latp = asind(z);
        }
      }
    }
  }
  return 0;
}
```