user: 请将以下的汇编代码转换成C语言代码：

```asm
<ffpsvc>:
  endbr64
  mov    (%rcx),%eax
  test   %eax,%eax
  jg     L49
  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     L20
  movb   $0x0,(%rdx)
L20:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  cmpb   $0x48,0x0(%rbp)
  je     L310
L409:
  cmp    $0x8,%rbx
  jbe    L599
  cmpb   $0x43,0x0(%rbp)
  je     L279
L366:
  cmpb   $0x48,0x0(%rbp)
  je     L309
L334:
  cmpb   $0x45,0x0(%rbp)
  je     L250
L459:
  cmpb   $0x20,0x0(%rbp)
  je     L593
L123:
  cmpb   $0x3d,0x8(%rbp)
  je     L261
L324:
  test   %r12,%r12
  jne    L584
L599:
  mov    0x0(%r13),%eax
L177:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L310:
  mov    $0x9,%edx
  lea    D12(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L409
  lea    D13(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcspn@plt>
  mov    %rax,(%rsp)
  lea    0x1(%rax),%r15
  cmp    %rax,%rbx
  jne    L591
  cmp    $0x8,%rax
  jbe    L374
  test   %r12,%r12
  jne    L326
L374:
  mov    0x0(%r13),%eax
  jmp    L177
L326:
  lea    0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    (%rsp),%eax
  sub    $0x9,%eax
  js     L374
  cltq
L404:
  cmpb   $0x20,(%r12,%rax,1)
  jne    L374
  movb   $0x0,(%r12,%rax,1)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L404
  jmp    L374
L279:
  mov    $0x8,%edx
  lea    D40(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L366
  jmp    L324
L309:
  mov    $0x8,%edx
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L334
  jmp    L324
L250:
  mov    $0x8,%edx
  lea    D67(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L459
  jmp    L324
L593:
  mov    $0x8,%edx
  lea    D75(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L123
  jmp    L324
L261:
  lea    0x8(%rbp),%rdi
  mov    $0x2,%edx
  lea    D9(%rip),%rsi
  call   <strncmp@plt>
  mov    $0xa,%r15d
  test   %eax,%eax
  jne    L324
L591:
  lea    0x0(%rbp,%r15,1),%rdi
  lea    D57(%rip),%rsi
  call   <strspn@plt>
  add    %rax,%r15
  cmp    %rbx,%r15
  je     L204
  lea    0x0(%rbp,%r15,1),%rax
  mov    %rax,(%rsp)
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L465
  cmp    $0x27,%al
  je     L233
  cmp    $0x28,%al
  jne    L47
  lea    D43(%rip),%rsi
  mov    (%rsp),%rdi
  call   <strcspn@plt>
  mov    %rax,%rbx
  mov    (%rsp),%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  je     L16
  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    L480
L584:
  lea    0x8(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  sub    $0x9,%ebx
  js     L599
  movslq %ebx,%rbx
L378:
  cmpb   $0x20,(%r12,%rbx,1)
  jne    L599
  movb   $0x0,(%r12,%rbx,1)
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jns    L378
  jmp    L599
L204:
  mov    0x0(%r13),%eax
  jmp    L177
L465:
  add    $0x1,%r15
L480:
  test   %r12,%r12
  je     L332
  lea    0x0(%rbp,%r15,1),%rdi
  lea    D57(%rip),%rsi
  call   <strspn@plt>
  add    %r15,%rax
  cmp    $0x4f,%rax
  ja     L332
  cmpb   $0x2f,0x0(%rbp,%rax,1)
  je     L122
L307:
  lea    0x0(%rbp,%rax,1),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%rcx
  mov    %eax,%edx
  sub    $0x1,%edx
  js     L332
  movslq %edx,%rdx
  add    %r12,%rdx
  cltq
  lea    -0x2(%r12,%rax,1),%rax
  lea    -0x1(%rcx),%ecx
  sub    %rcx,%rax
L473:
  cmpb   $0x20,(%rdx)
  jne    L332
  movb   $0x0,(%rdx)
  sub    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L473
L332:
  mov    0x0(%r13),%eax
  jmp    L177
L233:
  movb   $0x27,(%r14)
  lea    0x1(%r15),%rax
  cmp    %rax,%rbx
  jbe    L265
  mov    $0x1,%edx
  jmp    L287
L87:
  movslq %edx,%rcx
  movb   $0x27,(%r14,%rcx,1)
L597:
  cmp    %rax,%rbx
  je     L266
  movslq %edx,%rdx
  movb   $0x0,0x1(%r14,%rdx,1)
  lea    0x1(%rax),%r15
  jmp    L480
L228:
  movzbl 0x0(%rbp,%rax,1),%esi
  movslq %edx,%rcx
  mov    %sil,(%r14,%rcx,1)
  add    $0x1,%rax
  add    $0x1,%edx
  cmp    %rax,%rbx
  jbe    L597
L287:
  cmpb   $0x27,0x0(%rbp,%rax,1)
  jne    L228
  lea    0x1(%rax),%rcx
  cmpb   $0x27,0x1(%rbp,%rax,1)
  jne    L87
  movslq %edx,%rax
  movb   $0x27,(%r14,%rax,1)
  add    $0x1,%edx
  mov    %rcx,%rax
  jmp    L228
L265:
  mov    $0x1,%edx
  jmp    L597
L266:
  movslq %edx,%rdx
  movb   $0x0,(%r14,%rdx,1)
  lea    D27(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %rbp,%rdi
  call   <ffpmsg@plt>
  movl   $0xcd,0x0(%r13)
  mov    $0xcd,%eax
  jmp    L177
L16:
  lea    D53(%rip),%rdi
  call   <ffpmsg@plt>
  mov    %rbp,%rdi
  call   <ffpmsg@plt>
  movl   $0xcd,0x0(%r13)
  mov    $0xcd,%eax
  jmp    L177
L47:
  lea    D95(%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    L480
L122:
  lea    0x1(%rax),%rdx
  cmpb   $0x20,0x1(%rbp,%rax,1)
  je     L600
  mov    %rdx,%rax
  jmp    L307
L600:
  add    $0x2,%rax
  jmp    L307
L49:
  ret
```

tool_calls: name: read_data
arguments: data_label: D12
datatype: string
name: read_data
arguments: data_label: D13
datatype: string
name: read_data
arguments: data_label: D40
datatype: string
name: read_data
arguments: data_label: D31
datatype: string
name: read_data
arguments: data_label: D67
datatype: string
name: read_data
arguments: data_label: D75
datatype: string
name: read_data
arguments: data_label: D9
datatype: string
name: read_data
arguments: data_label: D57
datatype: string
name: read_data
arguments: data_label: D43
datatype: string
name: read_data
arguments: data_label: D27
datatype: string
name: read_data
arguments: data_label: D53
datatype: string
name: read_data
arguments: data_label: D95
datatype: string

tool: D12: HIERARCH 

tool: D13: =

tool: D40: COMMENT 

tool: D31: HISTORY 

tool: D67: END     

tool: D75:         

tool: D9: = 

tool: D57:  

tool: D43: )

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

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

tool: D95:  /

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) {
      value[jj] = '\0';
      ffpmsg("This keyword string value has no closing quote:");
      ffpmsg(card);
      return (*status = 205);
    } 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);
}
```