user: What is the c source code of the assembly code below:

```asm
<librfc2874_formatcheck>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  movb   $0x0,(%rsi)
  call   <strlen@plt>
  cmp    $0x4,%eax
  jbe    L178
  mov    %rax,%rbp
  mov    %eax,%r13d
  movzbl (%rbx),%ecx
  cmp    $0x5c,%cl
  jne    L173
  movzbl 0x1(%rbx),%ecx
  cmp    $0x5b,%cl
  je     L94
  movsbl %cl,%ecx
  mov    $0x2,%r8d
  lea    D100(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
L86:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L178:
  lea    D71(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L173:
  movsbl %cl,%ecx
  mov    $0x1,%r8d
  lea    D100(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L94:
  movsbl 0x2(%rbx),%edi
  call   <tolower@plt>
  mov    $0x3,%r14d
  cmp    $0x78,%al
  jne    L127
L230:
  mov    %r14d,%r15d
  movsbl (%rbx,%r14,1),%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L179
  cmp    $0x23,%r14
  je     L81
  add    $0x1,%r14
  cmp    %r14d,%r13d
  jae    L230
L183:
  lea    D66(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L127:
  movsbl 0x2(%rbx),%ecx
  mov    $0x3,%r8d
  lea    D100(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L81:
  lea    0x1(%r15),%ecx
  lea    D109(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L179:
  cmp    %r14d,%ebp
  jbe    L183
  mov    %r14d,%r14d
  movzbl (%rbx,%r14,1),%edx
  mov    $0x0,%eax
  cmp    $0x5d,%dl
  je     L86
  cmp    $0x2f,%dl
  jne    L184
  lea    0x1(%r15),%r14d
  cmp    %r14d,%ebp
  jbe    L135
  lea    0x4(%r15),%eax
  mov    %eax,0xc(%rsp)
L25:
  mov    %r14d,%r15d
  add    %rbx,%r15
  movsbl (%r15),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L4
  cmp    0xc(%rsp),%r14d
  je     L38
  add    $0x1,%r14d
  cmp    %r14d,%r13d
  jae    L25
L122:
  lea    D21(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L184:
  movsbl %dl,%ecx
  lea    0x1(%r15),%r8d
  lea    D100(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L135:
  lea    D41(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L38:
  lea    0x1(%r14),%ecx
  lea    D42(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
L4:
  cmp    %ebp,%r14d
  jae    L122
  movzbl (%r15),%edx
  mov    $0x0,%eax
  cmp    $0x5d,%dl
  je     L86
  movsbl %dl,%ecx
  lea    0x1(%r14),%r8d
  lea    D100(%rip),%rdx
  mov    $0x3ff,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    $0x1,%eax
  jmp    L86
```

tool_calls: name: parse_data
arguments: label: D100
datatype: string
name: parse_data
arguments: label: D71
datatype: string
name: parse_data
arguments: label: D66
datatype: string
name: parse_data
arguments: label: D109
datatype: string
name: parse_data
arguments: label: D21
datatype: string
name: parse_data
arguments: label: D41
datatype: string
name: parse_data
arguments: label: D42
datatype: string

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

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

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

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

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

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

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

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