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

```asm
<libirc_colorparser_irc2code>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D16(%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)
L149:
  test   %edi,%edi
  jne    L272
  movq   $0x0,0x8(%rsp)
  mov    0x10(%rsp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L244
L85:
  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     L174
  movzbl %al,%edx
  movslq (%rbx,%rdx,4),%rdx
  add    %rbx,%rdx
  notrack jmp *%rdx
  nopl   (%rax)
L174:
  cmpq   $0x0,0x8(%rsp)
  je     L206
  mov    0x30(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x30(%rsp)
  mov    %al,(%rdx)
  movzbl 0x1(%r15),%eax
  test   %al,%al
  je     L300
  nopl   0x0(%rax)
L81:
  mov    %rbp,%r15
  jmp    L122
  nopl   (%rax)
  mov    0x4(%rsp),%edi
  test   %edi,%edi
  jne    L248
  lea    D37(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D60(%rip),%r8
  mov    $0x4,%ecx
  call   <libirc_colorparser_applymask@plt>
  nopl   0x0(%rax)
L248:
  movzbl 0x1(%r15),%eax
  test   %al,%al
  jne    L81
  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     L149
L274:
  mov    0x30(%rsp),%rax
  movb   $0x0,(%rax)
L241:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  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    L248
  lea    D54(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D47(%rip),%r8
  mov    $0x8,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L248
  xchg   %ax,%ax
  movsbl 0x1(%r15),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L248
  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     L41
  movsbl 0x2(%r15),%eax
  add    $0x2,%r15
  lea    (%rcx,%rcx,4),%edx
  cmpb   $0x2c,0x1(%r15)
  lea    -0x30(%rax,%rdx,2),%ecx
  je     L177
L316:
  mov    0x4(%rsp),%eax
  lea    0x1(%r15),%rbp
  test   %eax,%eax
  jne    L248
  cmp    $0xf,%ecx
  jg     L248
L265:
  mov    0x1c(%rsp),%r8d
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_applycolor@plt>
L341:
  lea    0x1(%r15),%rbp
  jmp    L248
  nopl   0x0(%rax)
  mov    0x4(%rsp),%r8d
  test   %r8d,%r8d
  jne    L248
  lea    D45(%rip),%r9
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    D28(%rip),%r8
  mov    $0x2,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L248
  nopl   0x0(%rax)
  mov    0x4(%rsp),%ecx
  test   %ecx,%ecx
  jne    L248
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L248
  nop
L206:
  addl   $0x1,0x2c(%rsp)
  jmp    L248
  nopw   0x0(%rax,%rax,1)
L272:
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L241
  mov    %rax,0x30(%rsp)
  mov    0x10(%rsp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L85
  lea    0x2c(%rsp),%rdx
  lea    0x30(%rsp),%rsi
  lea    0x28(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L274
  nopl   0x0(%rax)
L41:
  mov    %rbp,%r15
  cmpb   $0x2c,0x1(%r15)
  jne    L316
L177:
  movsbl 0x2(%r15),%edi
  mov    %ecx,0x18(%rsp)
  call   <isdigit@plt>
  mov    0x18(%rsp),%ecx
  test   %eax,%eax
  je     L316
  movsbl 0x2(%r15),%edx
  movsbl 0x3(%r15),%edi
  lea    -0x30(%rdx),%ebp
  call   <isdigit@plt>
  mov    0x18(%rsp),%ecx
  test   %eax,%eax
  jne    L21
  add    $0x2,%r15
L189:
  cmp    $0xf,%ecx
  setle  %sil
  cmp    $0xf,%ebp
  setle  %al
  test   %al,%sil
  je     L341
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jne    L341
  cmp    $0xffffffff,%ebp
  cmove  0x1c(%rsp),%ebp
  mov    %ebp,0x1c(%rsp)
  jmp    L265
  nopl   (%rax)
L244:
  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    L149
L300:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <libirc_colorparser_closetags@plt>
  mov    0x30(%rsp),%rax
  movb   $0x0,(%rax)
  jmp    L241
L21:
  movsbl 0x3(%r15),%eax
  lea    0x0(%rbp,%rbp,4),%edx
  add    $0x3,%r15
  lea    -0x30(%rax,%rdx,2),%ebp
  jmp    L189
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D37
type_infered: string
name: read_data
arguments: data_tag: D60
type_infered: string
name: read_data
arguments: data_tag: D54
type_infered: string
name: read_data
arguments: data_tag: D47
type_infered: string
name: read_data
arguments: data_tag: D45
type_infered: string
name: read_data
arguments: data_tag: D28
type_infered: string

tool: D37: [/U]

tool: D60: [U]

tool: D54: [/I]

tool: D47: [I]

tool: D45: [/B]

tool: D28: [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;
}
```