user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ffmkky>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    (%r8),%eax
  movl   $0xffffffff,0x1c(%rsp)
  test   %eax,%eax
  jg     L385
  movb   $0x0,(%rcx)
  cmpb   $0x20,(%rdi)
  mov    %rdi,%r13
  mov    %rsi,%r14
  movb   $0x0,0x20(%rsp)
  mov    %rcx,%rbp
  mov    %r8,%r12
  jne    L248
  lea    0x1(%rdi),%rax
  nopl   0x0(%rax,%rax,1)
L593:
  mov    %rax,%rsi
  add    $0x1,%rax
  cmpb   $0x20,-0x1(%rax)
  je     L593
L537:
  lea    0x20(%rsp),%r15
  mov    $0x47,%edx
  mov    %r15,%rdi
  call   <strncat@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r15,%rdi
  mov    %rax,(%rsp)
  call   <strlen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L515
  lea    0x1c(%rsp),%rsi
  mov    %r13,%rdi
  call   <fftkey@plt>
  test   %rax,%rax
  jle    L186
L106:
  mov    $0x3d,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L513
  movzbl 0x20(%rsp),%eax
  cmp    $0x48,%al
  je     L92
L23:
  cmp    $0x68,%al
  je     L110
L342:
  lea    D40(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L151:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    (%rsp),%rax
  lea    0xc(%rbx,%rax,1),%rax
  cmp    $0x50,%rax
  jbe    L498
  lea    D74(%rip),%rsi
  mov    %rbp,%rdi
  add    $0xb,%rbx
  call   <strcat@plt>
L548:
  cmpq   $0x0,(%rsp)
  je     L145
  cmpb   $0x27,(%r14)
  je     L158
L313:
  mov    (%rsp),%rax
  add    %rbx,%rax
  cmp    $0x50,%rax
  ja     L42
  mov    $0x1e,%edx
  mov    $0x50,%r8d
  sub    %ebx,%r8d
  cmp    %rdx,%rax
  cmovae %rax,%rdx
  mov    %r8d,%r15d
  mov    %rdx,%r13
  cmp    $0x1d,%rax
  jbe    L263
  mov    %r8d,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncat@plt>
  cmpq   $0x0,0x8(%rsp)
  je     L601
L251:
  cmp    $0x4c,%r13
  jbe    L8
  nopl   0x0(%rax,%rax,1)
L601:
  mov    (%r12),%eax
L385:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L119
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L515:
  lea    -0x1(%r15,%rax,1),%rbx
  cmpb   $0x20,(%rbx)
  jne    L194
  nopw   0x0(%rax,%rax,1)
L269:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
  cmpb   $0x20,(%rbx)
  je     L269
L194:
  sub    %r15,%rbx
  add    $0x1,%rbx
  cmp    $0x8,%rbx
  ja     L106
  lea    0x1c(%rsp),%rsi
  mov    %r13,%rdi
  call   <fftkey@plt>
  test   %rax,%rax
  jg     L106
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  cmp    $0x8,%rbx
  jne    L478
  nopl   0x0(%rax,%rax,1)
L164:
  mov    $0x203d,%ecx
  cmpq   $0x0,(%rsp)
  movb   $0x0,0xa(%rbp)
  mov    %cx,0x8(%rbp)
  je     L304
  cmpb   $0x27,(%r14)
  mov    $0xa,%ebx
  jne    L313
  mov    $0x46,%edx
  mov    $0xa,%ebx
  jmp    L321
  nop
L145:
  cmp    $0xa,%rbx
  jne    L601
L304:
  cmpq   $0x0,0x8(%rsp)
  movb   $0x20,0x8(%rbp)
  je     L601
  mov    0x8(%rsp),%rsi
  mov    $0x46,%edx
  mov    %rbp,%rdi
  call   <strncat@plt>
  jmp    L601
  nopl   0x0(%rax)
L498:
  lea    D17(%rip),%rsi
  mov    %rbp,%rdi
  add    $0xc,%rbx
  call   <strcat@plt>
  jmp    L548
L158:
  cmp    $0x4d,%rbx
  ja     L42
  mov    $0x50,%edx
  sub    %ebx,%edx
L321:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncat@plt>
  add    (%rsp),%rbx
  mov    $0x50,%edx
  cmp    %rdx,%rbx
  cmovbe %rbx,%rdx
  mov    %rdx,%r13
  cmp    $0x4f,%rbx
  ja     L225
  mov    0x8(%rsp),%rax
  test   %rax,%rax
  je     L601
  cmpb   $0x0,(%rax)
  je     L251
  cmp    $0x1d,%rbx
  ja     L251
  movabs $0x2020202020202020,%rcx
  mov    $0x1e,%eax
  sub    %rdx,%rax
  lea    0x1(%rdx),%rdx
  cmp    $0x1e,%rdx
  mov    $0x1,%edx
  cmova  %rdx,%rax
  lea    0x0(%rbp,%r13,1),%rdx
  cmp    $0x8,%rax
  jae    L454
  test   $0x4,%al
  jne    L613
  test   %rax,%rax
  je     L302
  movb   $0x20,(%rdx)
  test   $0x2,%al
  jne    L169
L302:
  movb   $0x0,0x1e(%rbp)
  mov    $0x1e,%r13d
  xchg   %ax,%ax
L8:
  mov    0x8(%rsp),%rax
  cmpb   $0x0,(%rax)
  je     L601
  mov    %rbp,%rdi
  lea    D33(%rip),%rsi
  call   <strcat@plt>
  mov    0x8(%rsp),%rsi
  mov    $0x4d,%edx
  mov    %rbp,%rdi
  sub    %r13d,%edx
  call   <strncat@plt>
  jmp    L601
  nopw   0x0(%rax,%rax,1)
L186:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
L478:
  movabs $0x2020202020202020,%rcx
  mov    $0x8,%eax
  sub    %rbx,%rax
  add    %rbp,%rbx
  cmp    $0x8,%eax
  jae    L301
  test   $0x4,%al
  jne    L80
  test   %eax,%eax
  je     L164
  movb   $0x20,(%rbx)
  test   $0x2,%al
  je     L164
  mov    %eax,%eax
  mov    $0x2020,%edx
  mov    %dx,-0x2(%rbx,%rax,1)
  jmp    L164
  nopl   (%rax)
L248:
  mov    %rdi,%rsi
  jmp    L537
L513:
  lea    D46(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %r15,%rdi
  call   <ffpmsg@plt>
  movl   $0xcf,(%r12)
  mov    $0xcf,%eax
  jmp    L385
  cs nopw 0x0(%rax,%rax,1)
L110:
  mov    $0x9,%edx
  lea    D45(%rip),%rsi
  mov    %r15,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L342
L114:
  sub    $0x9,%rbx
  jmp    L151
L225:
  cmpq   $0x0,0x8(%rsp)
  movb   $0x27,0x4f(%rbp)
  jne    L251
  jmp    L601
L301:
  lea    0x8(%rbx),%rsi
  mov    %eax,%edx
  mov    %rcx,(%rbx)
  and    $0xfffffffffffffff8,%rsi
  mov    %rcx,-0x8(%rbx,%rdx,1)
  sub    %rsi,%rbx
  add    %ebx,%eax
  and    $0xfffffff8,%eax
  cmp    $0x8,%eax
  jb     L164
  and    $0xfffffff8,%eax
  xor    %edx,%edx
L416:
  mov    %edx,%edi
  add    $0x8,%edx
  mov    %rcx,(%rsi,%rdi,1)
  cmp    %eax,%edx
  jb     L416
  jmp    L164
L263:
  mov    $0x1e,%edx
  sub    (%rsp),%edx
  lea    D77(%rip),%rsi
  mov    %rbp,%rdi
  sub    %ebx,%edx
  call   <strncat@plt>
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncat@plt>
  cmpq   $0x0,0x8(%rsp)
  jne    L8
  jmp    L601
L92:
  mov    $0x9,%edx
  lea    D40(%rip),%rsi
  mov    %r15,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L114
  movzbl 0x20(%rsp),%eax
  jmp    L23
L42:
  lea    D37(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %r13,%rdi
  call   <ffpmsg@plt>
  mov    %r14,%rdi
  call   <ffpmsg@plt>
  movl   $0xcf,(%r12)
  mov    $0xcf,%eax
  jmp    L385
L454:
  lea    0x8(%rdx),%rsi
  mov    %rcx,(%rdx)
  and    $0xfffffffffffffff8,%rsi
  mov    %rcx,-0x8(%rdx,%rax,1)
  sub    %rsi,%rdx
  add    %rdx,%rax
  and    $0xfffffffffffffff8,%rax
  cmp    $0x8,%rax
  jb     L302
  and    $0xfffffffffffffff8,%rax
  xor    %edx,%edx
L480:
  mov    %rcx,(%rsi,%rdx,1)
  add    $0x8,%rdx
  cmp    %rax,%rdx
  jb     L480
  jmp    L302
L80:
  mov    %eax,%eax
  movl   $0x20202020,(%rbx)
  movl   $0x20202020,-0x4(%rbx,%rax,1)
  jmp    L164
L613:
  movl   $0x20202020,(%rdx)
  movl   $0x20202020,-0x4(%rdx,%rax,1)
  jmp    L302
L119:
  call   <__stack_chk_fail@plt>
L169:
  movw   $0x2020,-0x2(%rdx,%rax,1)
  jmp    L302
```

tool_calls: name: parse_data
arguments: tag: D40
datatype: string
name: parse_data
arguments: tag: D74
datatype: string
name: parse_data
arguments: tag: D17
datatype: string
name: parse_data
arguments: tag: D33
datatype: string
name: parse_data
arguments: tag: D46
datatype: string
name: parse_data
arguments: tag: D45
datatype: string
name: parse_data
arguments: tag: D77
datatype: string
name: parse_data
arguments: tag: D37
datatype: string

tool: D40: HIERARCH 

tool: D74: = 

tool: D17:  = 

tool: D33:  / 

tool: D46: Illegal keyword name; contains an equals sign (=)

tool: D45: hierarch 

tool: D77:                     

tool: D37: The following keyword + value is too long to fit on a card:

assistant: ```c
int ffmkky(const char *keyname, char *value, const char *comm, char *card, int *status) {
  size_t namelen, len, ii;
  char tmpname[72], *cptr;
  int tstatus = -1, nblank = 0;
  if (*status > 0)
    return (*status);
  *tmpname = '\0';
  *card = '\0';
  while (*(keyname + nblank) == ' ')
    nblank++;
  strncat(tmpname, keyname + nblank, 72 - 1);
  len = strlen(value);
  namelen = strlen(tmpname);
  if (namelen) {
    cptr = tmpname + namelen - 1;
    while (*cptr == ' ') {
      *cptr = '\0';
      cptr--;
    }
    namelen = cptr - tmpname + 1;
  }
  if (namelen <= 8 && (fftkey(keyname, &tstatus) <= 0)) {
    strcat(card, tmpname);
    for (ii = namelen; ii < 8; ii++)
      card[ii] = ' ';
    card[8] = '=';
    card[9] = ' ';
    card[10] = '\0';
    namelen = 10;
  } else {
    if (strchr(tmpname, '=')) {
      ffpmsg("Illegal keyword name; contains an equals sign (=)");
      ffpmsg(tmpname);
      return (*status = 207);
    }
    if (((tmpname)[0] < ("HIERARCH ")[0] ? -1 : (tmpname)[0] > ("HIERARCH ")[0] ? 1 : strncmp((tmpname), ("HIERARCH "), (9))) && ((tmpname)[0] < ("hierarch ")[0] ? -1 : (tmpname)[0] > ("hierarch ")[0] ? 1 : strncmp((tmpname), ("hierarch "), (9))))
      strcat(card, "HIERARCH ");
    else
      namelen -= 9;
    strcat(card, tmpname);
    if (namelen + 12 + len > 80) {
      strcat(card, "= ");
      namelen += 11;
    } else {
      strcat(card, " = ");
      namelen += 12;
    }
  }
  if (len > 0) {
    if (value[0] == '\'') {
      if (namelen > 77) {
        ffpmsg("The following keyword + value is too long to fit on a card:");
        ffpmsg(keyname);
        ffpmsg(value);
        return (*status = 207);
      }
      strncat(card, value, 80 - namelen);
      len = ((80) < (namelen + len) ? (80) : (namelen + len));
      if (len == 80) {
        card[79] = '\'';
      }
      if (comm) {
        if (comm[0] != 0) {
          if (len < 30) {
            for (ii = len; ii < 30; ii++)
              card[ii] = ' ';
            card[30] = '\0';
            len = 30;
          }
        }
      }
    } else {
      if (namelen + len > 80) {
        ffpmsg("The following keyword + value is too long to fit on a card:");
        ffpmsg(keyname);
        ffpmsg(value);
        return (*status = 207);
      } else if (namelen + len < 30) {
        strncat(card, "                    ", 30 - (namelen + len));
      }
      strncat(card, value, 80 - namelen);
      len = ((80) < (namelen + len) ? (80) : (namelen + len));
      len = ((30) > (len) ? (30) : (len));
    }
    if (comm) {
      if ((len < 77) && (strlen(comm) > 0)) {
        strcat(card, " / ");
        strncat(card, comm, 77 - len);
      }
    }
  } else {
    if (namelen == 10) {
      card[8] = ' ';
      if (comm) {
        strncat(card, comm, 80 - namelen);
      }
    }
  }
  return (*status);
}
```