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

```asm
<ffpsvc>:
  endbr64
  mov    (%rcx),%eax
  test   %eax,%eax
  jg     L377
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x18,%rsp
  movb   $0x0,(%rsi)
  test   %rdx,%rdx
  je     L272
  movb   $0x0,(%rdx)
L272:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmpb   $0x48,0x0(%r13)
  mov    %rax,%rbx
  je     L242
L359:
  cmp    $0x8,%rbx
  jbe    L80
  movzbl 0x0(%r13),%eax
  cmp    $0x43,%al
  je     L0
L548:
  cmp    $0x48,%al
  je     L93
L20:
  cmp    $0x45,%al
  je     L216
L246:
  cmp    $0x20,%al
  je     L540
L544:
  cmpb   $0x3d,0x8(%r13)
  je     L534
L229:
  test   %rbp,%rbp
  jne    L393
L80:
  mov    (%r15),%eax
L421:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L377:
  ret
  nopl   0x0(%rax)
L393:
  lea    0x8(%r13),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  sub    $0x9,%ebx
  js     L80
  movslq %ebx,%rax
  jmp    L96
  cs nopw 0x0(%rax,%rax,1)
L357:
  movb   $0x0,0x0(%rbp,%rax,1)
  sub    $0x1,%rax
  test   %eax,%eax
  js     L80
L96:
  cmpb   $0x20,0x0(%rbp,%rax,1)
  je     L357
  jmp    L80
  cs nopw 0x0(%rax,%rax,1)
L534:
  lea    0x8(%r13),%rdi
  mov    $0x2,%edx
  lea    D15(%rip),%rsi
  mov    $0xa,%r14d
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L229
L395:
  lea    D138(%rip),%r8
  lea    0x0(%r13,%r14,1),%rdi
  mov    %r8,%rsi
  call   <strspn@plt>
  lea    D138(%rip),%r8
  add    %rax,%r14
  cmp    %rbx,%r14
  je     L80
  lea    0x0(%r13,%r14,1),%r9
  movzbl (%r9),%eax
  cmp    $0x2f,%al
  je     L367
  cmp    $0x27,%al
  je     L65
  cmp    $0x28,%al
  jne    L250
  mov    %r9,%rdi
  lea    D148(%rip),%rsi
  mov    %r9,0x8(%rsp)
  call   <strcspn@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  mov    0x8(%rsp),%r9
  cmp    %rbx,%rax
  je     L16
  lea    0x1(%rbx),%rdx
  mov    %r9,%rsi
  mov    %r12,%rdi
  mov    %rdx,0x8(%rsp)
  call   <strncpy@plt>
  mov    0x8(%rsp),%rdx
  movb   $0x0,0x1(%r12,%rbx,1)
  lea    D138(%rip),%r8
  add    %rdx,%r14
L184:
  test   %rbp,%rbp
  je     L80
  lea    0x0(%r13,%r14,1),%rdi
  mov    %r8,%rsi
  call   <strspn@plt>
  add    %rax,%r14
  cmp    $0x4f,%r14
  ja     L80
  lea    0x0(%r13,%r14,1),%rsi
  cmpb   $0x2f,(%rsi)
  je     L25
L53:
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%ecx
  sub    $0x1,%ecx
  js     L80
  cltq
  movslq %ecx,%rdx
  mov    %ecx,%ecx
  lea    -0x2(%rbp,%rax,1),%rax
  add    %rbp,%rdx
  sub    %rcx,%rax
  jmp    L533
  nopl   0x0(%rax,%rax,1)
L485:
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  cmp    %rdx,%rax
  je     L80
L533:
  cmpb   $0x20,(%rdx)
  je     L485
  jmp    L80
  nopw   0x0(%rax,%rax,1)
L242:
  mov    $0x9,%edx
  lea    D122(%rip),%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L359
  lea    D35(%rip),%rsi
  mov    %r13,%rdi
  call   <strcspn@plt>
  lea    0x1(%rax),%r14
  cmp    %rax,%rbx
  jne    L395
  cmp    $0x8,%rbx
  jbe    L80
  test   %rbp,%rbp
  je     L80
  lea    0x8(%r13),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %ebx,%eax
  sub    $0x9,%eax
  js     L80
  cltq
  jmp    L542
  xchg   %ax,%ax
L336:
  movb   $0x0,0x0(%rbp,%rax,1)
  sub    $0x1,%rax
  test   %eax,%eax
  js     L80
L542:
  cmpb   $0x20,0x0(%rbp,%rax,1)
  je     L336
  jmp    L80
  nopl   (%rax)
L499:
  cmp    %r14,%rbx
  je     L379
  cltq
  movb   $0x0,0x1(%r12,%rax,1)
L367:
  add    $0x1,%r14
  jmp    L184
  nopw   0x0(%rax,%rax,1)
L0:
  mov    $0x8,%edx
  lea    D6(%rip),%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L229
  movzbl 0x0(%r13),%eax
  jmp    L548
  cs nopw 0x0(%rax,%rax,1)
L93:
  mov    $0x8,%edx
  lea    D13(%rip),%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L229
  movzbl 0x0(%r13),%eax
  jmp    L20
  cs nopw 0x0(%rax,%rax,1)
L216:
  mov    $0x8,%edx
  lea    D135(%rip),%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L229
  movzbl 0x0(%r13),%eax
  jmp    L246
  cs nopw 0x0(%rax,%rax,1)
L540:
  mov    $0x8,%edx
  lea    D146(%rip),%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L544
  jmp    L229
  nopl   0x0(%rax)
L65:
  add    $0x1,%r14
  movb   $0x27,(%r12)
  mov    $0x1,%eax
  cmp    %r14,%rbx
  ja     L175
  jmp    L499
L209:
  movslq %eax,%rcx
  add    $0x1,%r14
  add    $0x1,%eax
  mov    %dl,(%r12,%rcx,1)
  cmp    %r14,%rbx
  jbe    L499
L175:
  movzbl 0x0(%r13,%r14,1),%edx
  cmp    $0x27,%dl
  jne    L209
  lea    0x1(%r14),%rcx
  movslq %eax,%rdx
  lea    0x0(%r13,%rcx,1),%rsi
  add    %r12,%rdx
  cmpb   $0x27,(%rsi)
  movb   $0x27,(%rdx)
  jne    L499
  movzbl (%rsi),%edx
  add    $0x1,%eax
  mov    %rcx,%r14
  jmp    L209
  nopl   0x0(%rax,%rax,1)
L250:
  mov    %r9,%rdi
  lea    D99(%rip),%rsi
  mov    %r9,0x8(%rsp)
  call   <strcspn@plt>
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  mov    %rax,%rbx
  mov    %rax,%rdx
  call   <strncpy@plt>
  add    %rbx,%r14
  movb   $0x0,(%r12,%rbx,1)
  lea    D138(%rip),%r8
  jmp    L184
L25:
  lea    0x1(%r13,%r14,1),%rsi
  cmpb   $0x20,(%rsi)
  jne    L53
  lea    0x2(%r13,%r14,1),%rsi
  jmp    L53
L379:
  mov    $0x45,%edx
  lea    D137(%rip),%rdi
  cmp    %edx,%eax
  cmovg  %edx,%eax
  cltq
  movb   $0x27,(%r12,%rax,1)
  movb   $0x0,0x1(%r12,%rax,1)
  call   <ffpmsg@plt>
  mov    %r13,%rdi
  call   <ffpmsg@plt>
  lea    D138(%rip),%r8
  jmp    L184
L16:
  lea    D141(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %r13,%rdi
  call   <ffpmsg@plt>
  movl   $0xcd,(%r15)
  mov    $0xcd,%eax
  jmp    L421
```

tool_calls: name: disassemble_data
arguments: data_tag: D15
type_guessed: string
name: disassemble_data
arguments: data_tag: D138
type_guessed: string
name: disassemble_data
arguments: data_tag: D148
type_guessed: string
name: disassemble_data
arguments: data_tag: D122
type_guessed: string
name: disassemble_data
arguments: data_tag: D35
type_guessed: string
name: disassemble_data
arguments: data_tag: D6
type_guessed: string
name: disassemble_data
arguments: data_tag: D13
type_guessed: string
name: disassemble_data
arguments: data_tag: D135
type_guessed: string
name: disassemble_data
arguments: data_tag: D146
type_guessed: string
name: disassemble_data
arguments: data_tag: D99
type_guessed: string
name: disassemble_data
arguments: data_tag: D137
type_guessed: string
name: disassemble_data
arguments: data_tag: D141
type_guessed: string

tool: D15: = 

tool: D138:  

tool: D148: )

tool: D122: HIERARCH 

tool: D35: =

tool: D6: COMMENT 

tool: D13: HISTORY 

tool: D135: END     

tool: D146:         

tool: D99:  /

tool: D137: This keyword string value has no closing quote:

tool: D141: This complex keyword value has no closing ')':

assistant: ```c
int ffpsvc(char *card, char *value, char *comm, int *status) {
  int jj;
  size_t ii, cardlen, nblank, valpos;
  if (*status > 0)
    return (*status);
  value[0] = '\0';
  if (comm)
    comm[0] = '\0';
  cardlen = strlen(card);
  if (((card)[0] < ("HIERARCH ")[0] ? -1 : (card)[0] > ("HIERARCH ")[0] ? 1 : strncmp((card), ("HIERARCH "), (9))) == 0) {
    valpos = strcspn(card, "=");
    if (valpos == cardlen) {
      if (comm != NULL) {
        if (cardlen > 8) {
          strcpy(comm, &card[8]);
          jj = cardlen - 8;
          for (jj--; jj >= 0; jj--) {
            if (comm[jj] == ' ')
              comm[jj] = '\0';
            else
              break;
          }
        }
      }
      return (*status);
    }
    valpos++;
  } else if (cardlen < 9 || ((card)[0] < ("COMMENT ")[0] ? -1 : (card)[0] > ("COMMENT ")[0] ? 1 : strncmp((card), ("COMMENT "), (8))) == 0 || ((card)[0] < ("HISTORY ")[0] ? -1 : (card)[0] > ("HISTORY ")[0] ? 1 : strncmp((card), ("HISTORY "), (8))) == 0 || ((card)[0] < ("END     ")[0] ? -1 : (card)[0] > ("END     ")[0] ? 1 : strncmp((card), ("END     "), (8))) == 0 || ((card)[0] < ("        ")[0] ? -1 : (card)[0] > ("        ")[0] ? 1 : strncmp((card), ("        "), (8))) == 0 || ((&card[8])[0] < ("= ")[0] ? -1 : (&card[8])[0] > ("= ")[0] ? 1 : strncmp((&card[8]), ("= "), (2))) != 0) {
    if (comm != NULL) {
      if (cardlen > 8) {
        strcpy(comm, &card[8]);
        jj = cardlen - 8;
        for (jj--; jj >= 0; jj--) {
          if (comm[jj] == ' ')
            comm[jj] = '\0';
          else
            break;
        }
      }
    }
    return (*status);
  } else {
    valpos = 10;
  }
  nblank = strspn(&card[valpos], " ");
  if (nblank + valpos == cardlen) {
    return (*status);
  }
  ii = valpos + nblank;
  if (card[ii] == '/') {
    ii++;
  } else if (card[ii] == '\'') {
    value[0] = card[ii];
    for (jj = 1, ii++; ii < cardlen; ii++, jj++) {
      if (card[ii] == '\'') {
        if (card[ii + 1] == '\'') {
          value[jj] = card[ii];
          ii++;
          jj++;
        } else {
          value[jj] = card[ii];
          break;
        }
      }
      value[jj] = card[ii];
    }
    if (ii == cardlen) {
      jj = ((jj) < (69) ? (jj) : (69));
      value[jj] = '\'';
      value[jj + 1] = '\0';
      ffpmsg("This keyword string value has no closing quote:");
      ffpmsg(card);
    } else {
      value[jj + 1] = '\0';
      ii++;
    }
  } else if (card[ii] == '(') {
    nblank = strcspn(&card[ii], ")");
    if (nblank == strlen(&card[ii])) {
      ffpmsg("This complex keyword value has no closing ')':");
      ffpmsg(card);
      return (*status = 205);
    }
    nblank++;
    strncpy(value, &card[ii], nblank);
    value[nblank] = '\0';
    ii = ii + nblank;
  } else {
    nblank = strcspn(&card[ii], " /");
    strncpy(value, &card[ii], nblank);
    value[nblank] = '\0';
    ii = ii + nblank;
  }
  if (comm) {
    nblank = strspn(&card[ii], " ");
    ii = ii + nblank;
    if (ii < 80) {
      if (card[ii] == '/') {
        ii++;
        if (card[ii] == ' ')
          ii++;
      }
      strcat(comm, &card[ii]);
      jj = strlen(comm);
      for (jj--; jj >= 0; jj--) {
        if (comm[jj] == ' ')
          comm[jj] = '\0';
        else
          break;
      }
    }
  }
  return (*status);
}
```