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

```asm
<librfc2874_formatcheck>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x4,-0x4(%rbp)
  ja     L278
  mov    -0x20(%rbp),%rax
  lea    D32(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L278:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L184
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D69(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L184:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  je     L188
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D69(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L188:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  je     L139
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D69(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L139:
  addl   $0x1,-0x10(%rbp)
  jmp    L82
L75:
  addl   $0x1,-0xc(%rbp)
  cmpl   $0x20,-0xc(%rbp)
  jbe    L138
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D66(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L138:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  ja     L247
L82:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L75
  jmp    L281
L247:
  nop
L281:
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jb     L167
  mov    -0x20(%rbp),%rax
  lea    D85(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L167:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L120
  mov    $0x0,%eax
  jmp    L147
L120:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L72
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D69(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L72:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jb     L172
  mov    -0x20(%rbp),%rax
  lea    D87(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L65:
  addl   $0x1,-0x8(%rbp)
  cmpl   $0x3,-0x8(%rbp)
  jbe    L165
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D88(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L165:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  ja     L236
L172:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L65
  jmp    L233
L236:
  nop
L233:
  mov    -0x10(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jb     L30
  mov    -0x20(%rbp),%rax
  lea    D53(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L147
L30:
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L178
  mov    $0x0,%eax
  jmp    L147
L178:
  mov    -0x10(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %edx,%ecx
  lea    D69(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
L147:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D32
type: string
name: retrieve_data
arguments: tag: D69
type: string
name: retrieve_data
arguments: tag: D66
type: string
name: retrieve_data
arguments: tag: D85
type: string
name: retrieve_data
arguments: tag: D87
type: string
name: retrieve_data
arguments: tag: D88
type: string
name: retrieve_data
arguments: tag: D53
type: string

tool: D32: Error in given bitstring label, has less than 5 chars!

tool: D69: Char '%c' not expected on position %u

tool: D66: More than 32 nibbles on position %u

tool: D85: Unexpected end of string (missing '/' or ']')

tool: D87: Unexpected end of string (missing prefix length)

tool: D88: More than 3 digits on position %u

tool: D53: Unexpected end of string (missing ']')

assistant: ```c
int librfc2874_formatcheck(const char *string, char *infostring) {
  unsigned int length, index = 0;
  unsigned int nibblecounter = 0, digitcounter = 0;
  infostring[0] = '\0';
  length = (unsigned int)strlen(string);
  if (length < 5) {
    snprintf(infostring, 1024 - 1, "Error in given bitstring label, has less than 5 chars!");
    return (1);
  };
  if (string[index] != '\\') {
    snprintf(infostring, 1024 - 1, "Char '%c' not expected on position %u", string[index], index + 1);
    return (1);
  };
  index++;
  if (string[index] != '[') {
    snprintf(infostring, 1024 - 1, "Char '%c' not expected on position %u", string[index], index + 1);
    return (1);
  };
  index++;
  if ((char)tolower(string[index]) != 'x') {
    snprintf(infostring, 1024 - 1, "Char '%c' not expected on position %u", string[index], index + 1);
    return (1);
  };
  index++;
  while (isxdigit((int)string[index])) {
    nibblecounter++;
    if (nibblecounter > 32) {
      snprintf(infostring, 1024 - 1, "More than 32 nibbles on position %u", index + 1);
      return (1);
    };
    index++;
    if (index > length) {
      break;
    };
  };
  if (index >= length) {
    snprintf(infostring, 1024 - 1, "Unexpected end of string (missing '/' or ']')");
    return (1);
  };
  if (string[index] == ']') {
    return (0);
  };
  if (string[index] != '/') {
    snprintf(infostring, 1024 - 1, "Char '%c' not expected on position %u", string[index], index + 1);
    return (1);
  };
  index++;
  if (index >= length) {
    snprintf(infostring, 1024 - 1, "Unexpected end of string (missing prefix length)");
    return (1);
  };
  while (isdigit((int)string[index])) {
    digitcounter++;
    if (digitcounter > 3) {
      snprintf(infostring, 1024 - 1, "More than 3 digits on position %u", index + 1);
      return (1);
    };
    index++;
    if (index > length) {
      break;
    };
  };
  if (index >= length) {
    snprintf(infostring, 1024 - 1, "Unexpected end of string (missing ']')");
    return (1);
  };
  if (string[index] == ']') {
    return (0);
  };
  snprintf(infostring, 1024 - 1, "Char '%c' not expected on position %u", string[index], index + 1);
  return (1);
}
```