user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<libirc_colorparser_irc2code>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D23(%rip),%rbx
  sub    $0x48,%rsp
  mov    %rdi,0x10(%rsp)
  xor    %edi,%edi
  mov    %esi,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x28(%rsp)
  movl   $0x0,0x2c(%rsp)
  movq   $0x0,0x30(%rsp)
  movl   $0x0,0x1c(%rsp)
  nopl   (%rax)
L208:
  test   %edi,%edi
  jne    L225
  movq   $0x0,0x8(%rsp)
  mov    0x10(%rsp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L61
L137:
  mov    0x10(%rsp),%r15
  lea    0x2c(%rsp),%r14
  lea    0x30(%rsp),%r13
  lea    0x28(%rsp),%r12
  nopl   (%rax)
L122:
  lea    0x1(%r15),%rbp
  cmp    $0x1f,%al
  ja     L18
  movzbl %al,%edx
  movslq (%rbx,%rdx,4),%rdx
  add    %rbx,%rdx
  notrack jmp *%rdx
  nopl   (%rax)
L18:
  cmpq   $0x0,0x8(%rsp)
  je     L14
  mov    0x30(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x30(%rsp)
  mov    %al,(%rdx)
  movzbl 0x1(%r15),%eax
  test   %al,%al
  je     L298
  nopl   0x0(%rax)
L252:
  mov    %rbp,%r15
  jmp    L122
  nopl   (%rax)
  mov    0x4(%rsp),%edi
  test   %edi,%edi
  jne    L118
  lea    D58(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D51(%rip),%r8
  mov    $0x4,%ecx
  call   <libirc_colorparser_applymask@plt>
  nopl   0x0(%rax)
L118:
  movzbl 0x1(%r15),%eax
  test   %al,%al
  jne    L252
  mov    %r12,%rdi
  mov    %r14,%rdx
  mov    %r13,%rsi
  call   <libirc_colorparser_closetags@plt>
  mov    0x2c(%rsp),%eax
  cmpq   $0x0,0x8(%rsp)
  lea    0x1(%rax),%edi
  mov    %edi,0x2c(%rsp)
  je     L208
L322:
  mov    0x30(%rsp),%rax
  movb   $0x0,(%rax)
L170:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L266
  mov    0x8(%rsp),%rax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
  mov    0x4(%rsp),%esi
  test   %esi,%esi
  jne    L118
  lea    D15(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D19(%rip),%r8
  mov    $0x8,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L118
  xchg   %ax,%ax
  movsbl 0x1(%r15),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L118
  movsbl 0x1(%r15),%ecx
  movsbl 0x2(%r15),%edi
  sub    $0x30,%ecx
  mov    %ecx,0x18(%rsp)
  call   <isdigit@plt>
  mov    0x18(%rsp),%ecx
  test   %eax,%eax
  je     L256
  movsbl 0x2(%r15),%eax
  add    $0x2,%r15
  lea    (%rcx,%rcx,4),%edx
  cmpb   $0x2c,0x1(%r15)
  lea    -0x30(%rax,%rdx,2),%ecx
  je     L146
L189:
  mov    0x4(%rsp),%eax
  lea    0x1(%r15),%rbp
  test   %eax,%eax
  jne    L118
  cmp    $0xf,%ecx
  jg     L118
L317:
  mov    0x1c(%rsp),%r8d
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_applycolor@plt>
L82:
  lea    0x1(%r15),%rbp
  jmp    L118
  nopl   0x0(%rax)
  mov    0x4(%rsp),%r8d
  test   %r8d,%r8d
  jne    L118
  lea    D67(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D25(%rip),%r8
  mov    $0x2,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L118
  nopl   0x0(%rax)
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jne    L118
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L118
  nop
L14:
  addl   $0x1,0x2c(%rsp)
  jmp    L118
  nopw   0x0(%rax,%rax,1)
L225:
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L170
  mov    %rax,0x30(%rsp)
  mov    0x10(%rsp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L137
  lea    0x2c(%rsp),%rdx
  lea    0x30(%rsp),%rsi
  lea    0x28(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L322
  nopl   0x0(%rax)
L256:
  mov    %rbp,%r15
  cmpb   $0x2c,0x1(%r15)
  jne    L189
L146:
  movsbl 0x2(%r15),%edi
  mov    %ecx,0x18(%rsp)
  call   <isdigit@plt>
  mov    0x18(%rsp),%ecx
  test   %eax,%eax
  je     L189
  movsbl 0x2(%r15),%edx
  movsbl 0x3(%r15),%edi
  lea    -0x30(%rdx),%ebp
  call   <isdigit@plt>
  mov    0x18(%rsp),%ecx
  test   %eax,%eax
  jne    L281
  add    $0x2,%r15
L124:
  cmp    $0xf,%ecx
  setle  %sil
  cmp    $0xf,%ebp
  setle  %al
  test   %al,%sil
  je     L82
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jne    L82
  cmp    $0xffffffff,%ebp
  cmove  0x1c(%rsp),%ebp
  mov    %ebp,0x1c(%rsp)
  jmp    L317
  nopl   (%rax)
L61:
  lea    0x2c(%rsp),%r14
  lea    0x30(%rsp),%r13
  lea    0x28(%rsp),%r12
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_closetags@plt>
  mov    0x2c(%rsp),%eax
  lea    0x1(%rax),%edi
  mov    %edi,0x2c(%rsp)
  jmp    L208
L298:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_closetags@plt>
  mov    0x30(%rsp),%rax
  movb   $0x0,(%rax)
  jmp    L170
L281:
  movsbl 0x3(%r15),%eax
  lea    0x0(%rbp,%rbp,4),%edx
  add    $0x3,%r15
  lea    -0x30(%rax,%rdx,2),%ebp
  jmp    L124
L266:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D58
type_infered: string
name: extract_symbolic_data
arguments: label: D51
type_infered: string
name: extract_symbolic_data
arguments: label: D15
type_infered: string
name: extract_symbolic_data
arguments: label: D19
type_infered: string
name: extract_symbolic_data
arguments: label: D67
type_infered: string
name: extract_symbolic_data
arguments: label: D25
type_infered: string

tool: D58: [/U]

tool: D51: [U]

tool: D15: [/I]

tool: D19: [I]

tool: D67: [/B]

tool: D25: [B]

assistant: ```c
char *libirc_colorparser_irc2code(const char *source, int strip) {
  unsigned int mask = 0, destlen = 0;
  char *destline = 0, *d = 0;
  const char *p;
  int current_color = 1, current_bg = 0;
  while (destline == 0) {
    if (destlen > 0) {
      if ((destline = malloc(destlen)) == 0)
        return 0;
      d = destline;
    }
    for (p = source; *p; p++) {
      switch (*p) {
      case 0x02:
        if (strip)
          continue;
        libirc_colorparser_applymask(&mask, &d, &destlen, (1 << 1), "[B]", "[/B]");
        break;
      case 0x1F:
        if (strip)
          continue;
        libirc_colorparser_applymask(&mask, &d, &destlen, (1 << 2), "[U]", "[/U]");
        break;
      case 0x16:
        if (strip)
          continue;
        libirc_colorparser_applymask(&mask, &d, &destlen, (1 << 3), "[I]", "[/I]");
        break;
      case 0x0F:
        if (strip)
          continue;
        libirc_colorparser_closetags(&mask, &d, &destlen);
        break;
      case 0x03:
        if (isdigit(p[1])) {
          int bgcolor = -1, color = p[1] - 0x30;
          p++;
          if (isdigit(p[1])) {
            color = color * 10 + (p[1] - 0x30);
            p++;
          }
          if (p[1] == ',' && isdigit(p[2])) {
            bgcolor = p[2] - 0x30;
            p += 2;
            if (isdigit(p[1])) {
              bgcolor = bgcolor * 10 + (p[1] - 0x30);
              p++;
            }
          }
          if (color <= 15 && bgcolor <= 15) {
            if (strip)
              continue;
            current_color = color;
            if (bgcolor != -1)
              current_bg = bgcolor;
            libirc_colorparser_applycolor(&mask, &d, &destlen, color, current_bg);
          }
        }
        break;
      default:
        if (destline)
          *d++ = *p;
        else
          destlen++;
        break;
      }
    }
    libirc_colorparser_closetags(&mask, &d, &destlen);
    destlen++;
  }
  *d = '\0';
  return destline;
}
```