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

```asm
<libirc_colorparser_irc2code>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L168
L260:
  mov    -0x30(%rbp),%eax
  test   %eax,%eax
  je     L11
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L213
  mov    $0x0,%eax
  jmp    L297
L213:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
L11:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L335
L28:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x1f,%eax
  ja     L95
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D70(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D70(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  cmpl   $0x0,-0x4c(%rbp)
  jne    L339
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rsi
  lea    -0x34(%rbp),%rax
  lea    D78(%rip),%r9
  lea    D27(%rip),%r8
  mov    $0x2,%ecx
  mov    %rax,%rdi
  call   <libirc_colorparser_applymask@plt>
  jmp    L29
  cmpl   $0x0,-0x4c(%rbp)
  jne    L195
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rsi
  lea    -0x34(%rbp),%rax
  lea    D60(%rip),%r9
  lea    D13(%rip),%r8
  mov    $0x4,%ecx
  mov    %rax,%rdi
  call   <libirc_colorparser_applymask@plt>
  jmp    L29
  cmpl   $0x0,-0x4c(%rbp)
  jne    L32
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rsi
  lea    -0x34(%rbp),%rax
  lea    D25(%rip),%r9
  lea    D9(%rip),%r8
  mov    $0x8,%ecx
  mov    %rax,%rdi
  call   <libirc_colorparser_applymask@plt>
  jmp    L29
  cmpl   $0x0,-0x4c(%rbp)
  jne    L279
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rcx
  lea    -0x34(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <libirc_colorparser_closetags@plt>
  jmp    L29
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L74
  movl   $0xffffffff,-0x28(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x24(%rbp)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L139
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  addq   $0x1,-0x10(%rbp)
L139:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L134
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L134
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x28(%rbp)
  addq   $0x2,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L134
  mov    -0x28(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x28(%rbp)
  addq   $0x1,-0x10(%rbp)
L134:
  cmpl   $0xf,-0x24(%rbp)
  jg     L74
  cmpl   $0xf,-0x28(%rbp)
  jg     L74
  cmpl   $0x0,-0x4c(%rbp)
  jne    L113
  cmpl   $0xffffffff,-0x28(%rbp)
  je     L294
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L294:
  mov    -0x2c(%rbp),%edi
  mov    -0x24(%rbp),%ecx
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rsi
  lea    -0x34(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <libirc_colorparser_applycolor@plt>
  jmp    L74
L95:
  cmpq   $0x0,-0x18(%rbp)
  je     L12
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x10(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L29
L12:
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  jmp    L29
L339:
  nop
  jmp    L29
L195:
  nop
  jmp    L29
L32:
  nop
  jmp    L29
L279:
  nop
  jmp    L29
L74:
  nop
  jmp    L29
L113:
  nop
L29:
  addq   $0x1,-0x10(%rbp)
L335:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L28
  lea    -0x30(%rbp),%rdx
  lea    -0x20(%rbp),%rcx
  lea    -0x34(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <libirc_colorparser_closetags@plt>
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
L168:
  cmpq   $0x0,-0x18(%rbp)
  je     L260
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L297:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L296
  call   <__stack_chk_fail@plt>
L296:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D78
data_type: string
name: unpack_data
arguments: data_label: D27
data_type: string
name: unpack_data
arguments: data_label: D60
data_type: string
name: unpack_data
arguments: data_label: D13
data_type: string
name: unpack_data
arguments: data_label: D25
data_type: string
name: unpack_data
arguments: data_label: D9
data_type: string

tool: D78: [/B]

tool: D27: [B]

tool: D60: [/U]

tool: D13: [U]

tool: D25: [/I]

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