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

```asm
<libirc_colorparser_irc2code>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r15
  mov    %esi,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  movq   $0x0,0x20(%rsp)
  movl   $0x0,0x8(%rsp)
  lea    D62(%rip),%rbp
  jmp    L189
L187:
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L9
  mov    %rax,0x20(%rsp)
  movzbl (%r15),%eax
  test   %al,%al
  jne    L113
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L6
  test   %r12d,%r12d
  jne    L110
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  lea    D12(%rip),%r9
  lea    D69(%rip),%r8
  mov    $0x2,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L110
  test   %r12d,%r12d
  jne    L110
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  lea    D54(%rip),%r9
  lea    D34(%rip),%r8
  mov    $0x4,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L110
  test   %r12d,%r12d
  jne    L110
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  lea    D67(%rip),%r9
  lea    D41(%rip),%r8
  mov    $0x8,%ecx
  call   <libirc_colorparser_applymask@plt>
  jmp    L110
  test   %r12d,%r12d
  jne    L110
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L110
  movsbl 0x1(%rbx),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L190
L110:
  lea    0x1(%rbx),%rdx
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L36
L156:
  mov    %rdx,%rbx
L20:
  cmp    $0x1f,%al
  ja     L106
  movzbl %al,%edx
  movslq 0x0(%rbp,%rdx,4),%rdx
  add    %rbp,%rdx
  notrack jmp *%rdx
L190:
  movsbl 0x1(%rbx),%r14d
  sub    $0x30,%r14d
  movsbl 0x2(%rbx),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L50
  add    $0x1,%rbx
L149:
  cmpb   $0x2c,0x1(%rbx)
  je     L333
L336:
  test   %r12d,%r12d
  jne    L110
  cmp    $0xf,%r14d
  jg     L110
  jmp    L205
L50:
  lea    (%r14,%r14,4),%edx
  movsbl 0x2(%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%r14d
  add    $0x2,%rbx
  jmp    L149
L333:
  movsbl 0x2(%rbx),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L336
  movsbl 0x2(%rbx),%eax
  sub    $0x30,%eax
  mov    %eax,0xc(%rsp)
  movsbl 0x3(%rbx),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L123
  add    $0x2,%rbx
L327:
  cmp    $0xf,%r14d
  setle  %dl
  mov    0xc(%rsp),%ecx
  cmp    $0xf,%ecx
  setle  %al
  test   %al,%dl
  je     L110
  test   %r12d,%r12d
  jne    L110
  cmp    $0xffffffff,%ecx
  cmove  0x8(%rsp),%ecx
  mov    %ecx,0x8(%rsp)
L205:
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  mov    0x8(%rsp),%r8d
  mov    %r14d,%ecx
  call   <libirc_colorparser_applycolor@plt>
  jmp    L110
L123:
  mov    0xc(%rsp),%eax
  lea    (%rax,%rax,4),%edx
  movsbl 0x3(%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%eax
  mov    %eax,0xc(%rsp)
  add    $0x3,%rbx
  jmp    L327
L106:
  test   %r13,%r13
  je     L69
  mov    0x20(%rsp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,0x20(%rsp)
  mov    %al,(%rdx)
  lea    0x1(%rbx),%rdx
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  jne    L156
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
L6:
  mov    0x20(%rsp),%rax
  movb   $0x0,(%rax)
L9:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L307
  mov    %r13,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L69:
  addl   $0x1,0x1c(%rsp)
  jmp    L110
L36:
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  addl   $0x1,0x1c(%rsp)
  test   %r13,%r13
  jne    L6
L189:
  mov    0x1c(%rsp),%edi
  test   %edi,%edi
  jne    L187
  movzbl (%r15),%eax
  test   %al,%al
  je     L133
  mov    $0x0,%r13d
L113:
  mov    %r15,%rbx
  jmp    L20
L133:
  lea    0x1c(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x18(%rsp),%rdi
  call   <libirc_colorparser_closetags@plt>
  addl   $0x1,0x1c(%rsp)
  jmp    L189
L307:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D12
type_infered: string
name: retrieve_data
arguments: tag: D69
type_infered: string
name: retrieve_data
arguments: tag: D54
type_infered: string
name: retrieve_data
arguments: tag: D34
type_infered: string
name: retrieve_data
arguments: tag: D67
type_infered: string
name: retrieve_data
arguments: tag: D41
type_infered: string

tool: D12: [/B]

tool: D69: [B]

tool: D54: [/U]

tool: D34: [U]

tool: D67: [/I]

tool: D41: [I]

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