user: What is the c source code of the assembly code below:

```asm
<unpackgrid>:
  endbr64
  sub    $0x38,%rsp
  movdqa D64(%rip),%xmm0
  mov    %edi,%edx
  mov    %rsi,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %edx,%esi
  movl   $0x5a595857,0x20(%rsp)
  movaps %xmm0,(%rsp)
  movdqa D65(%rip),%xmm0
  sar    $0x7,%esi
  movb   $0x20,0x24(%rsp)
  movaps %xmm0,0x10(%rsp)
  cmp    $0x3f47ff,%edx
  jg     L8
  movslq %esi,%rax
  sar    $0x1f,%edx
  pxor   %xmm1,%xmm1
  movsd  D61(%rip),%xmm0
  imul   $0xffffffffb60b60b7,%rax,%rax
  shr    $0x20,%rax
  add    %esi,%eax
  sar    $0x7,%eax
  mov    %eax,%ecx
  sub    %edx,%eax
  sub    %edx,%ecx
  lea    -0xb2(%rax,%rax,1),%eax
  imul   $0xb4,%ecx,%r8d
  mov    %esi,%ecx
  lea    0x168(%rax),%edx
  sub    %r8d,%ecx
  cmp    $0xffffff4c,%eax
  cmovl  %edx,%eax
  cvtsi2sd %eax,%xmm1
  subsd  %xmm1,%xmm0
  movsd  D38(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  divsd  D34(%rip),%xmm0
  cvttsd2si %xmm0,%edx
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  movslq %edx,%rax
  mov    %edx,%esi
  imul   $0xffffffff88888889,%rax,%rax
  mulsd  %xmm1,%xmm0
  sar    $0x1f,%esi
  divsd  D2(%rip),%xmm0
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x7,%eax
  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    %edx,%eax
  movslq %eax,%rdx
  sar    $0x1f,%eax
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x22,%rdx
  sub    %eax,%edx
  movslq %edx,%rax
  cvttsd2si %xmm0,%edx
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x2(%rdi)
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0xffffffff88888889,%rax,%rax
  sar    $0x1f,%ecx
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x7,%eax
  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
  sar    $0x1f,%eax
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x22,%rdx
  sub    %eax,%edx
  movslq %edx,%rax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x3(%rdi)
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  add    $0x38,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L8:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  lea    D16(%rip),%rsi
  add    $0x38,%rsp
  jmp    1060 <strcpy@plt>
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D64
type_guessed: byte[16]
name: disassemble_data
arguments: data_tag: D65
type_guessed: byte[16]
name: disassemble_data
arguments: data_tag: D61
type_guessed: f64
name: disassemble_data
arguments: data_tag: D38
type_guessed: f64
name: disassemble_data
arguments: data_tag: D34
type_guessed: f64
name: disassemble_data
arguments: data_tag: D2
type_guessed: f64
name: disassemble_data
arguments: data_tag: D16
type_guessed: string

tool: {"D64": [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46]}

tool: {"D65": [0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56]}

tool: D61: 180

tool: D38: 60

tool: D34: 5

tool: D2: 2.5

tool: D16: 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");
  }
}
```