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

```asm
<unpackgrid>:
  endbr64
  sub    $0x38,%rsp
  mov    %edi,%eax
  mov    %rsi,%rdi
  mov    %fs:0x28,%rdx
  mov    %rdx,0x28(%rsp)
  xor    %edx,%edx
  movabs $0x3736353433323130,%rdx
  movabs $0x4645444342413938,%rcx
  mov    %rdx,(%rsp)
  mov    %rcx,0x8(%rsp)
  movabs $0x4e4d4c4b4a494847,%rdx
  movabs $0x565554535251504f,%rcx
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  movl   $0x5a595857,0x20(%rsp)
  movb   $0x20,0x24(%rsp)
  mov    %eax,%ecx
  sar    $0x7,%ecx
  cmp    $0x3f47ff,%eax
  jg     L9
  movslq %ecx,%rax
  imul   $0xffffffffb60b60b7,%rax,%rax
  shr    $0x20,%rax
  add    %ecx,%eax
  sar    $0x7,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  mov    %eax,%edx
  sub    %esi,%edx
  imul   $0xb4,%edx,%r8d
  mov    %ecx,%edx
  sub    %r8d,%edx
  sub    %esi,%eax
  lea    -0xb2(%rax,%rax,1),%eax
  lea    0x168(%rax),%ecx
  cmp    $0xffffff4c,%eax
  cmovl  %ecx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D36(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  D13(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  divsd  D19(%rip),%xmm0
  cvttsd2si %xmm0,%ecx
  movslq %ecx,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %ecx,%eax
  sar    $0x7,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  lea    0xa(%rax),%esi
  movslq %esi,%rsi
  movzbl (%rsp,%rsi,1),%esi
  mov    %sil,(%rdi)
  mov    %eax,%esi
  shl    $0x4,%esi
  sub    %esi,%eax
  shl    $0x4,%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  imul   $0x2aaaaaab,%rcx,%rcx
  sar    $0x22,%rcx
  sar    $0x1f,%eax
  sub    %eax,%ecx
  movslq %ecx,%rax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x2(%rdi)
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  mulsd  %xmm1,%xmm0
  divsd  D43(%rip),%xmm0
  cvttsd2si %xmm0,%edx
  movslq %edx,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x7,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    0xa(%rax),%ecx
  movslq %ecx,%rcx
  movzbl (%rsp,%rcx,1),%ecx
  mov    %cl,0x1(%rdi)
  mov    %eax,%ecx
  shl    $0x4,%ecx
  sub    %ecx,%eax
  shl    $0x4,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x22,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  movslq %edx,%rax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x3(%rdi)
L13:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x38,%rsp
  ret
L9:
  lea    D28(%rip),%rsi
  call   <strcpy@plt>
  jmp    L13
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D36
data_type: f64
name: unpack_data
arguments: data_label: D13
data_type: f64
name: unpack_data
arguments: data_label: D19
data_type: f64
name: unpack_data
arguments: data_label: D43
data_type: f64
name: unpack_data
arguments: data_label: D28
data_type: string

tool: D36: 180

tool: D13: 60

tool: D19: 5

tool: D43: 2.5

tool: D28: XXXX

assistant: ```c
void unpackgrid(int ngrid, char *grid) {
  char c[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '};
  int dlat, dlong;
  ngrid = ngrid >> 7;
  if (ngrid < 32400) {
    dlat = (ngrid % 180) - 90;
    dlong = (ngrid / 180) * 2 - 180 + 2;
    if (dlong < -180)
      dlong = dlong + 360;
    if (dlong > 180)
      dlong = dlong + 360;
    int nlong = 60.0 * (180.0 - dlong) / 5.0;
    int n1 = nlong / 240;
    int n2 = (nlong - 240 * n1) / 24;
    grid[0] = c[10 + n1];
    grid[2] = c[n2];
    int nlat = 60.0 * (dlat + 90) / 2.5;
    n1 = nlat / 240;
    n2 = (nlat - 240 * n1) / 24;
    grid[1] = c[10 + n1];
    grid[3] = c[n2];
  } else {
    strcpy(grid, "XXXX");
  }
}
```