user: 请从给定的汇编指令推导出C源代码:

```asm
<ffpsvc>:
  endbr64
  mov    (%rcx),%eax
  test   %eax,%eax
  jg     L126
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %rdx,%r12
  mov    %rcx,%r13
  movb   $0x0,(%rsi)
  test   %rdx,%rdx
  je     L512
  movb   $0x0,(%rdx)
L512:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  cmpb   $0x48,0x0(%rbp)
  je     L307
L546:
  cmp    $0x8,%rbx
  jbe    L69
  cmpb   $0x43,0x0(%rbp)
  je     L305
L187:
  cmpb   $0x48,0x0(%rbp)
  je     L31
L34:
  cmpb   $0x45,0x0(%rbp)
  je     L37
L311:
  cmpb   $0x20,0x0(%rbp)
  je     L149
L347:
  cmpb   $0x3d,0x8(%rbp)
  je     L342
L555:
  test   %r12,%r12
  jne    L279
L69:
  mov    0x0(%r13),%eax
L100:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L307:
  mov    $0x9,%edx
  lea    D115(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L546
  lea    D61(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcspn@plt>
  mov    %rax,(%rsp)
  lea    0x1(%rax),%r15
  cmp    %rax,%rbx
  jne    L295
  cmp    $0x8,%rax
  jbe    L350
  test   %r12,%r12
  jne    L68
L350:
  mov    0x0(%r13),%eax
  jmp    L100
L68:
  lea    0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    (%rsp),%eax
  sub    $0x9,%eax
  js     L350
  cltq
L571:
  cmpb   $0x20,(%r12,%rax,1)
  jne    L350
  movb   $0x0,(%r12,%rax,1)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L571
  jmp    L350
L305:
  mov    $0x8,%edx
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L187
  jmp    L555
L31:
  mov    $0x8,%edx
  lea    D103(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L34
  jmp    L555
L37:
  mov    $0x8,%edx
  lea    D124(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L311
  jmp    L555
L149:
  mov    $0x8,%edx
  lea    D43(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L347
  jmp    L555
L342:
  lea    0x8(%rbp),%rdi
  mov    $0x2,%edx
  lea    D22(%rip),%rsi
  call   <strncmp@plt>
  mov    $0xa,%r15d
  test   %eax,%eax
  jne    L555
L295:
  lea    0x0(%rbp,%r15,1),%rdi
  lea    D66(%rip),%rsi
  call   <strspn@plt>
  add    %rax,%r15
  cmp    %rbx,%r15
  je     L8
  lea    0x0(%rbp,%r15,1),%rax
  mov    %rax,(%rsp)
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L482
  cmp    $0x27,%al
  je     L479
  cmp    $0x28,%al
  jne    L399
  lea    D97(%rip),%rsi
  mov    (%rsp),%rdi
  call   <strcspn@plt>
  mov    %rax,%rbx
  mov    (%rsp),%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  je     L193
  lea    0x1(%rbx),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdx
  mov    (%rsp),%rsi
  mov    %r14,%rdi
  call   <strncpy@plt>
  movb   $0x0,0x1(%r14,%rbx,1)
  add    0x8(%rsp),%r15
  jmp    L63
L279:
  lea    0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  sub    $0x9,%ebx
  js     L69
  movslq %ebx,%rbx
L341:
  cmpb   $0x20,(%r12,%rbx,1)
  jne    L69
  movb   $0x0,(%r12,%rbx,1)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jns    L341
  jmp    L69
L8:
  mov    0x0(%r13),%eax
  jmp    L100
L482:
  add    $0x1,%r15
L63:
  test   %r12,%r12
  je     L501
  lea    0x0(%rbp,%r15,1),%rdi
  lea    D66(%rip),%rsi
  call   <strspn@plt>
  lea    (%r15,%rax,1),%rbx
  cmp    $0x4f,%rbx
  ja     L501
  cmpb   $0x2f,0x0(%rbp,%rbx,1)
  je     L477
L160:
  lea    0x0(%rbp,%rbx,1),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%rcx
  mov    %eax,%edx
  sub    $0x1,%edx
  js     L501
  movslq %edx,%rdx
  add    %r12,%rdx
  cltq
  lea    -0x2(%r12,%rax,1),%rax
  lea    -0x1(%rcx),%ecx
  sub    %rcx,%rax
L507:
  cmpb   $0x20,(%rdx)
  jne    L501
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L507
L501:
  mov    0x0(%r13),%eax
  jmp    L100
L479:
  movb   $0x27,(%r14)
  add    $0x1,%r15
  cmp    %r15,%rbx
  jbe    L587
  mov    $0x1,%eax
  jmp    L502
L139:
  movslq %eax,%rdx
  movb   $0x27,(%r14,%rdx,1)
L22:
  cmp    %r15,%rbx
  je     L99
  cltq
  movb   $0x0,0x1(%r14,%rax,1)
  add    $0x1,%r15
  jmp    L63
L239:
  movzbl 0x0(%rbp,%r15,1),%ecx
  movslq %eax,%rdx
  mov    %cl,(%r14,%rdx,1)
  add    $0x1,%r15
  add    $0x1,%eax
  cmp    %r15,%rbx
  jbe    L22
L502:
  cmpb   $0x27,0x0(%rbp,%r15,1)
  jne    L239
  lea    0x1(%r15),%rdx
  cmpb   $0x27,0x1(%rbp,%r15,1)
  jne    L139
  movslq %eax,%rcx
  movb   $0x27,(%r14,%rcx,1)
  add    $0x1,%eax
  mov    %rdx,%r15
  jmp    L239
L587:
  mov    $0x1,%eax
  jmp    L22
L99:
  mov    $0x45,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  cltq
  movb   $0x27,(%r14,%rax,1)
  movb   $0x0,0x1(%r14,%rax,1)
  lea    D25(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %rbp,%rdi
  call   <ffpmsg@plt>
  jmp    L63
L193:
  lea    D29(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %rbp,%rdi
  call   <ffpmsg@plt>
  movl   $0xcd,0x0(%r13)
  mov    $0xcd,%eax
  jmp    L100
L399:
  lea    D55(%rip),%rsi
  mov    (%rsp),%rdi
  call   <strcspn@plt>
  mov    %rax,%rbx
  mov    %rax,%rdx
  mov    (%rsp),%rsi
  mov    %r14,%rdi
  call   <strncpy@plt>
  movb   $0x0,(%r14,%rbx,1)
  add    %rbx,%r15
  jmp    L63
L477:
  lea    0x1(%rbx),%rax
  cmpb   $0x20,0x1(%rbp,%rbx,1)
  je     L248
  mov    %rax,%rbx
  jmp    L160
L248:
  add    $0x2,%rbx
  jmp    L160
L126:
  ret
```

tool_calls: name: parse_data
arguments: label: D115
type: string
name: parse_data
arguments: label: D61
type: string
name: parse_data
arguments: label: D1
type: string
name: parse_data
arguments: label: D103
type: string
name: parse_data
arguments: label: D124
type: string
name: parse_data
arguments: label: D43
type: string
name: parse_data
arguments: label: D22
type: string
name: parse_data
arguments: label: D66
type: string
name: parse_data
arguments: label: D97
type: string
name: parse_data
arguments: label: D25
type: string
name: parse_data
arguments: label: D29
type: string
name: parse_data
arguments: label: D55
type: string

tool: D115: HIERARCH 

tool: D61: =

tool: D1: COMMENT 

tool: D103: HISTORY 

tool: D124: END     

tool: D43:         

tool: D22: = 

tool: D66:  

tool: D97: )

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

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

tool: D55:  /

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);
}
```