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

```asm
<ffbnfm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %rdx,-0x108(%rbp)
  mov    %rcx,-0x110(%rbp)
  mov    %r8,-0x118(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L305
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  jmp    L627
L305:
  cmpq   $0x0,-0x100(%rbp)
  je     L601
  mov    -0x100(%rbp),%rax
  movl   $0x0,(%rax)
L601:
  cmpq   $0x0,-0x108(%rbp)
  je     L223
  mov    -0x108(%rbp),%rax
  movq   $0x0,(%rax)
L223:
  cmpq   $0x0,-0x110(%rbp)
  je     L473
  mov    -0x110(%rbp),%rax
  movq   $0x0,(%rax)
L473:
  mov    -0xf8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0xb8(%rbp)
  movq   $0x0,-0xc8(%rbp)
  jmp    L178
L192:
  mov    -0xf8(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L470
  addq   $0x1,-0xc8(%rbp)
L178:
  mov    -0xc8(%rbp),%rax
  cmp    -0xb8(%rbp),%rax
  jb     L192
  jmp    L6
L470:
  nop
L6:
  mov    -0xc8(%rbp),%rax
  cmp    -0xb8(%rbp),%rax
  jne    L535
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <ffpmsg@plt>
  mov    -0x118(%rbp),%rax
  movl   $0x105,(%rax)
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  jmp    L627
L535:
  mov    -0xb8(%rbp),%rax
  sub    -0xc8(%rbp),%rax
  cmp    $0x46,%rax
  jbe    L617
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <ffpmsg@plt>
  mov    -0x118(%rbp),%rax
  movl   $0x105,(%rax)
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  jmp    L627
L617:
  mov    -0xf8(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rax,%rdx
  lea    -0xb0(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0xb0(%rbp),%rax
  mov    %rax,%rdi
  call   <ffupch@plt>
  lea    -0xb0(%rbp),%rax
  mov    %rax,-0xc0(%rbp)
  movq   $0x0,-0xc8(%rbp)
  jmp    L571
L335:
  addq   $0x1,-0xc8(%rbp)
L571:
  mov    -0xc0(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L335
  cmpq   $0x0,-0xc8(%rbp)
  jne    L150
  movq   $0x1,-0xd0(%rbp)
  jmp    L501
L150:
  lea    -0xd0(%rbp),%rdx
  mov    -0xc0(%rbp),%rax
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L501
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <ffpmsg@plt>
  mov    -0x118(%rbp),%rax
  movl   $0x105,(%rax)
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  jmp    L627
L501:
  mov    -0xc8(%rbp),%rax
  add    %rax,-0xc0(%rbp)
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x50,%al
  je     L112
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x51,%al
  jne    L338
L112:
  movl   $0x1,-0xe0(%rbp)
  addq   $0x1,-0xc0(%rbp)
  jmp    L594
L338:
  movl   $0x0,-0xe0(%rbp)
L594:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x55,%al
  jne    L190
  movl   $0x14,-0xe4(%rbp)
  movq   $0x2,-0xd8(%rbp)
  jmp    L597
L190:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x49,%al
  jne    L629
  movl   $0x15,-0xe4(%rbp)
  movq   $0x2,-0xd8(%rbp)
  jmp    L597
L629:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x56,%al
  jne    L298
  movl   $0x28,-0xe4(%rbp)
  movq   $0x4,-0xd8(%rbp)
  jmp    L597
L298:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x57,%al
  jne    L30
  movl   $0x50,-0xe4(%rbp)
  movq   $0x8,-0xd8(%rbp)
  jmp    L597
L30:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4a,%al
  jne    L40
  movl   $0x29,-0xe4(%rbp)
  movq   $0x4,-0xd8(%rbp)
  jmp    L597
L40:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4b,%al
  jne    L114
  movl   $0x51,-0xe4(%rbp)
  movq   $0x8,-0xd8(%rbp)
  jmp    L597
L114:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  jne    L466
  movl   $0x2a,-0xe4(%rbp)
  movq   $0x4,-0xd8(%rbp)
  jmp    L597
L466:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x44,%al
  jne    L269
  movl   $0x52,-0xe4(%rbp)
  movq   $0x8,-0xd8(%rbp)
  jmp    L597
L269:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x41,%al
  jne    L455
  movl   $0x10,-0xe4(%rbp)
  movl   $0x0,-0xdc(%rbp)
  mov    -0xc0(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L549
  mov    -0xc0(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x28,%al
  jne    L414
  addq   $0x1,-0xc0(%rbp)
L414:
  mov    -0xc0(%rbp),%rax
  lea    0x1(%rax),%rcx
  lea    -0xd8(%rbp),%rax
  mov    %rax,%rdx
  lea    D7(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <sscanf@plt>
  mov    %eax,-0xdc(%rbp)
L549:
  cmpl   $0x1,-0xdc(%rbp)
  jne    L2
  cmpl   $0x0,-0xe0(%rbp)
  jne    L597
  mov    -0xd8(%rbp),%rdx
  mov    -0xd0(%rbp),%rax
  cmp    %rax,%rdx
  jle    L597
L2:
  mov    -0xd0(%rbp),%rax
  mov    %rax,-0xd8(%rbp)
  jmp    L597
L455:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4c,%al
  jne    L53
  movl   $0xe,-0xe4(%rbp)
  movq   $0x1,-0xd8(%rbp)
  jmp    L597
L53:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L141
  movl   $0x1,-0xe4(%rbp)
  movq   $0x1,-0xd8(%rbp)
  jmp    L597
L141:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x42,%al
  jne    L616
  movl   $0xb,-0xe4(%rbp)
  movq   $0x1,-0xd8(%rbp)
  jmp    L597
L616:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x53,%al
  jne    L541
  movl   $0xc,-0xe4(%rbp)
  movq   $0x1,-0xd8(%rbp)
  jmp    L597
L541:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x43,%al
  jne    L479
  movl   $0x53,-0xe4(%rbp)
  movq   $0x8,-0xd8(%rbp)
  jmp    L597
L479:
  mov    -0xc0(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x4d,%al
  jne    L450
  movl   $0xa3,-0xe4(%rbp)
  movq   $0x10,-0xd8(%rbp)
  jmp    L597
L450:
  mov    -0xf8(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rdx,%rcx
  lea    D45(%rip),%rdx
  mov    $0x51,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <ffpmsg@plt>
  mov    -0x118(%rbp),%rax
  movl   $0x106,(%rax)
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
  jmp    L627
L597:
  cmpl   $0x0,-0xe0(%rbp)
  je     L554
  negl   -0xe4(%rbp)
L554:
  cmpq   $0x0,-0x100(%rbp)
  je     L306
  mov    -0x100(%rbp),%rax
  mov    -0xe4(%rbp),%edx
  mov    %edx,(%rax)
L306:
  cmpq   $0x0,-0x108(%rbp)
  je     L507
  mov    -0xd0(%rbp),%rdx
  mov    -0x108(%rbp),%rax
  mov    %rdx,(%rax)
L507:
  cmpq   $0x0,-0x110(%rbp)
  je     L14
  mov    -0xd8(%rbp),%rdx
  mov    -0x110(%rbp),%rax
  mov    %rdx,(%rax)
L14:
  mov    -0x118(%rbp),%rax
  mov    (%rax),%eax
L627:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L609
  call   <__stack_chk_fail@plt>
L609:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D55
type_guessed: string
name: unpack_data
arguments: data_tag: D30
type_guessed: string
name: unpack_data
arguments: data_tag: D7
type_guessed: string
name: unpack_data
arguments: data_tag: D23
type_guessed: string
name: unpack_data
arguments: data_tag: D45
type_guessed: string

tool: D55: Error: binary table TFORM code is blank (ffbnfm).

tool: D30: Error: binary table TFORM code is too long (ffbnfm).

tool: D7: %ld

tool: D23: Error: Bad repeat format in TFORM (ffbnfm).

tool: D45: Illegal binary table TFORMn datatype: '%s' 

assistant: ```c
int ffbnfm(char *tform, int *dtcode, long *trepeat, long *twidth, int *status) {
  size_t ii, nchar;
  int datacode, variable, iread;
  long width, repeat;
  char *form, temp[71], message[81];
  if (*status > 0)
    return (*status);
  if (dtcode)
    *dtcode = 0;
  if (trepeat)
    *trepeat = 0;
  if (twidth)
    *twidth = 0;
  nchar = strlen(tform);
  for (ii = 0; ii < nchar; ii++) {
    if (tform[ii] != ' ')
      break;
  }
  if (ii == nchar) {
    ffpmsg("Error: binary table TFORM code is blank (ffbnfm).");
    return (*status = 261);
  }
  if (nchar - ii > 71 - 1) {
    ffpmsg("Error: binary table TFORM code is too long (ffbnfm).");
    return (*status = 261);
  }
  strcpy(temp, &tform[ii]);
  ffupch(temp);
  form = temp;
  ii = 0;
  while (isdigit((int)form[ii]))
    ii++;
  if (ii == 0)
    repeat = 1;
  else {
    if (sscanf(form, "%ld", &repeat) != 1) {
      ffpmsg("Error: Bad repeat format in TFORM (ffbnfm).");
      return (*status = 261);
    }
  }
  form = form + ii;
  if (form[0] == 'P' || form[0] == 'Q') {
    variable = 1;
    form++;
  } else
    variable = 0;
  if (form[0] == 'U') {
    datacode = 20;
    width = 2;
  } else if (form[0] == 'I') {
    datacode = 21;
    width = 2;
  } else if (form[0] == 'V') {
    datacode = 40;
    width = 4;
  } else if (form[0] == 'W') {
    datacode = 80;
    width = 8;
  } else if (form[0] == 'J') {
    datacode = 41;
    width = 4;
  } else if (form[0] == 'K') {
    datacode = 81;
    width = 8;
  } else if (form[0] == 'E') {
    datacode = 42;
    width = 4;
  } else if (form[0] == 'D') {
    datacode = 82;
    width = 8;
  } else if (form[0] == 'A') {
    datacode = 16;
    iread = 0;
    if (form[1] != 0) {
      if (form[1] == '(')
        form++;
      iread = sscanf(&form[1], "%ld", &width);
    }
    if (iread != 1 || (!variable && (width > repeat)))
      width = repeat;
  } else if (form[0] == 'L') {
    datacode = 14;
    width = 1;
  } else if (form[0] == 'X') {
    datacode = 1;
    width = 1;
  } else if (form[0] == 'B') {
    datacode = 11;
    width = 1;
  } else if (form[0] == 'S') {
    datacode = 12;
    width = 1;
  } else if (form[0] == 'C') {
    datacode = 83;
    width = 8;
  } else if (form[0] == 'M') {
    datacode = 163;
    width = 16;
  } else {
    snprintf(message, 81, "Illegal binary table TFORMn datatype: \'%s\' ", tform);
    ffpmsg(message);
    return (*status = 262);
  }
  if (variable)
    datacode = datacode * (-1);
  if (dtcode)
    *dtcode = datacode;
  if (trepeat)
    *trepeat = repeat;
  if (twidth)
    *twidth = width;
  return (*status);
}
```