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

```asm
<loc_ntoa>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,(%rsp)
  cmpl   $0x0,(%rdi)
  jne    L41
  movslq 0x4(%rdi),%rbx
  movslq 0x8(%rdi),%rbp
  lea    0x10(%rdi),%r14
  movslq 0xc(%rdi),%rax
  mov    %rax,0x8(%rsp)
  mov    %r14,%rsi
  mov    $0x0,%r12d
  mov    %r12d,%edi
  call   <GETLONG@plt>
  lea    -0x80000000(%r12),%r13d
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <GETLONG@plt>
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <GETLONG@plt>
  mov    $0x989680,%ecx
  movslq %r13d,%rdx
  imul   $0x10624dd3,%rdx,%rdx
  sar    $0x26,%rdx
  mov    %r13d,%eax
  sar    $0x1f,%eax
  mov    %edx,%r15d
  sub    %eax,%r15d
  imul   $0x3e8,%r15d,%esi
  mov    %r13d,%r15d
  sub    %esi,%r15d
  sub    %eax,%edx
  movslq %edx,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x5,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  mov    %eax,%r14d
  sub    %esi,%r14d
  imul   $0x3c,%r14d,%edi
  sub    %edi,%edx
  mov    %edx,%r14d
  sub    %esi,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  mov    %edx,%r13d
  sub    %esi,%r13d
  imul   $0x3c,%r13d,%edi
  sub    %edi,%eax
  mov    %eax,%r13d
  sub    %esi,%edx
  mov    %edx,0x14(%rsp)
  movslq %ecx,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  mov    %esi,%edx
  mov    %eax,%esi
  sub    %edx,%esi
  imul   $0x64,%esi,%esi
  sub    %esi,%ecx
  mov    %ecx,0x18(%rsp)
  sub    %edx,%eax
  imul   $0xffffffff,%eax,%esi
  mov    %esi,0x1c(%rsp)
  mov    %rbx,%rdi
  call   <precsize_ntoa@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  lea    D14(%rip),%rax
  cmove  %rax,%r12
  mov    %rbp,%rdi
  call   <precsize_ntoa@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  lea    D14(%rip),%rax
  cmove  %rax,%rbp
  mov    0x8(%rsp),%rdi
  call   <precsize_ntoa@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  lea    D14(%rip),%rax
  cmove  %rax,%rbx
  sub    $0x8,%rsp
  push   %rbx
  push   %rbp
  push   %r12
  mov    0x38(%rsp),%ecx
  push   %rcx
  mov    0x44(%rsp),%esi
  push   %rsi
  push   $0x45
  push   %r15
  push   %r14
  push   %r13
  mov    0x64(%rsp),%edx
  push   %rdx
  push   $0x4e
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  lea    D1(%rip),%rsi
  mov    0x60(%rsp),%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  add    $0x60,%rsp
  lea    D14(%rip),%rax
  cmp    %rax,%r12
  je     L17
  mov    %r12,%rdi
  call   <free@plt>
L17:
  lea    D14(%rip),%rax
  cmp    %rax,%rbp
  je     L2
  mov    %rbp,%rdi
  call   <free@plt>
L2:
  lea    D14(%rip),%rax
  cmp    %rax,%rbx
  je     L9
  mov    %rbx,%rdi
  call   <free@plt>
L9:
  mov    (%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L41:
  movabs $0x3a726f727265203b,%rax
  movabs $0x6e776f6e6b6e7520,%rdx
  mov    %rax,(%rsi)
  mov    %rdx,0x8(%rsi)
  movabs $0x20525220434f4c20,%rax
  movabs $0x6e6f6973726576,%rdx
  mov    %rax,0x10(%rsi)
  mov    %rdx,0x18(%rsi)
  jmp    L9
```

tool_calls: name: parse_data
arguments: label: D14
datatype: string
name: parse_data
arguments: label: D1
datatype: string

tool: D14: ?

tool: D1: %d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm

assistant: ```c
const char *loc_ntoa(const u_char *binary, char *ascii) {
  static char *error = "?";
  const u_char *cp = binary;
  int latdeg, latmin, latsec, latsecfrac;
  int longdeg, longmin, longsec, longsecfrac;
  char northsouth, eastwest;
  int altmeters, altfrac, altsign;
  const u_int32_t referencealt = 100000 * 100;
  int32_t latval, longval, altval;
  u_int32_t templ;
  u_int8_t sizeval, hpval, vpval, versionval;
  char *sizestr, *hpstr, *vpstr;
  versionval = *cp++;
  if (versionval) {
    (void)sprintf(ascii, "; error: unknown LOC RR version");
    return (ascii);
  }
  sizeval = *cp++;
  hpval = *cp++;
  vpval = *cp++;
  GETLONG(templ, cp);
  latval = (templ - ((u_int32_t)1 << 31));
  GETLONG(templ, cp);
  longval = (templ - ((u_int32_t)1 << 31));
  GETLONG(templ, cp);
  if (templ < referencealt) {
    altval = referencealt - templ;
    altsign = -1;
  } else {
    altval = templ - referencealt;
    altsign = 1;
  }
  if (latval < 0) {
    northsouth = 'S';
    latval = -latval;
  } else
    northsouth = 'N';
  latsecfrac = latval % 1000;
  latval = latval / 1000;
  latsec = latval % 60;
  latval = latval / 60;
  latmin = latval % 60;
  latval = latval / 60;
  latdeg = latval;
  if (longval < 0) {
    eastwest = 'W';
    longval = -longval;
  } else
    eastwest = 'E';
  longsecfrac = longval % 1000;
  longval = longval / 1000;
  longsec = longval % 60;
  longval = longval / 60;
  longmin = longval % 60;
  longval = longval / 60;
  longdeg = longval;
  altfrac = altval % 100;
  altmeters = (altval / 100) * altsign;
  if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL)
    sizestr = error;
  if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL)
    hpstr = error;
  if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL)
    vpstr = error;
  sprintf(ascii, "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm", latdeg, latmin, latsec, latsecfrac, northsouth, longdeg, longmin, longsec, longsecfrac, eastwest, altmeters, altfrac, sizestr, hpstr, vpstr);
  if (sizestr != error)
    free(sizestr);
  if (hpstr != error)
    free(hpstr);
  if (vpstr != error)
    free(vpstr);
  return (ascii);
}
```