user: What would the C source look like for the assembly code provided here?

```asm
<unpackgrid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x3736353433323130,%rax
  movabs $0x4645444342413938,%rdx
  mov    %rax,-0x30(%rbp)
  mov    %rdx,-0x28(%rbp)
  movabs $0x4e4d4c4b4a494847,%rax
  movabs $0x565554535251504f,%rdx
  mov    %rax,-0x20(%rbp)
  mov    %rdx,-0x18(%rbp)
  movl   $0x5a595857,-0x10(%rbp)
  movb   $0x20,-0xc(%rbp)
  sarl   $0x7,-0x54(%rbp)
  cmpl   $0x7e8f,-0x54(%rbp)
  jg     L19
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0xb4,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  lea    -0x5a(%rdx),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffffb60b60b7,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  sub    $0x59,%eax
  add    %eax,%eax
  mov    %eax,-0x48(%rbp)
  cmpl   $0xffffff4c,-0x48(%rbp)
  jge    L9
  addl   $0x168,-0x48(%rbp)
L9:
  cmpl   $0xb4,-0x48(%rbp)
  jle    L2
  addl   $0x168,-0x48(%rbp)
L2:
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x48(%rbp),%xmm2
  movsd  D10(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D46(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D44(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x4,%edx
  sub    %edx,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  add    $0xa,%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%edx
  mov    -0x60(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x60(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  mov    -0x44(%rbp),%eax
  add    $0x5a,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D46(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D52(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x7,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x4,%edx
  sub    %edx,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  lea    0xa(%rax),%ecx
  mov    -0x60(%rbp),%rax
  lea    0x1(%rax),%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  mov    -0x60(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x38(%rbp),%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  jmp    L1
L19:
  mov    -0x60(%rbp),%rax
  lea    D49(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L1:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L40
  call   <__stack_chk_fail@plt>
L40:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D10
datatype: f64
name: read_data
arguments: data_label: D46
datatype: f64
name: read_data
arguments: data_label: D44
datatype: f64
name: read_data
arguments: data_label: D52
datatype: f64
name: read_data
arguments: data_label: D49
datatype: string

tool: D10: 180

tool: D46: 60

tool: D44: 5

tool: D52: 2.5

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