user: Translate the below assembly code into C programming language:

```asm
<ircproto_parse_prefix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %edx,%r13d
  mov    %rcx,(%rsp)
  mov    %r8d,0x1c(%rsp)
  mov    %r9,0x8(%rsp)
  mov    $0x21,%esi
  call   <strchr@plt>
  mov    %rax,%rbp
  mov    $0x40,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,0x10(%rsp)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,0x18(%rsp)
  test   %r12,%r12
  je     L100
  mov    %rbp,%r14
  sub    %rbx,%r14
  test   %rbp,%rbp
  cmove  %eax,%r14d
  sub    $0x1,%r13d
  cmp    %r14d,%r13d
  mov    %r14d,%r15d
  cmovle %r13d,%r15d
  mov    %r15d,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  movslq %r15d,%r15
  movb   $0x0,(%r12,%r15,1)
  cmp    %r14d,%r13d
  jl     L56
L100:
  mov    (%rsp),%r15
  test   %r15,%r15
  je     L35
  test   %rbp,%rbp
  je     L21
  lea    0x1(%rbp),%rsi
  mov    0x10(%rsp),%r14
  sub    %rsi,%r14
  mov    0x1c(%rsp),%r13d
  sub    $0x1,%r13d
  mov    %r14d,%r12d
  cmp    %r14d,%r13d
  cmovle %r13d,%r12d
  mov    %r12d,%edx
  mov    %r15,%rdi
  call   <strncpy@plt>
  movslq %r12d,%r12
  movb   $0x0,(%r15,%r12,1)
  cmp    %r14d,%r13d
  jge    L35
  mov    (%rsp),%rsi
  lea    D23(%rip),%rdi
  call   <info@plt>
  jmp    L35
L56:
  mov    %r12,%rsi
  lea    D7(%rip),%rdi
  call   <info@plt>
  jmp    L100
L21:
  mov    (%rsp),%rax
  movb   $0x0,(%rax)
L35:
  mov    0x8(%rsp),%r14
  test   %r14,%r14
  je     L72
  mov    0x10(%rsp),%rax
  test   %rax,%rax
  je     L38
  add    $0x1,%rax
  mov    %rax,%rsi
  movslq 0x18(%rsp),%rax
  add    %rax,%rbx
  sub    %rsi,%rbx
  mov    0x60(%rsp),%eax
  lea    -0x1(%rax),%r12d
  mov    %ebx,%ebp
  cmp    %ebx,%r12d
  cmovle %r12d,%ebp
  mov    %ebp,%edx
  mov    %r14,%rdi
  call   <strncpy@plt>
  movslq %ebp,%rbp
  movb   $0x0,(%r14,%rbp,1)
  cmp    %ebx,%r12d
  jge    L72
  mov    0x8(%rsp),%rsi
  lea    D2(%rip),%rdi
  call   <info@plt>
  jmp    L72
L38:
  mov    0x8(%rsp),%rax
  movb   $0x0,(%rax)
L72:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D23
datatype: string
name: unpack_data
arguments: data_tag: D7
datatype: string
name: unpack_data
arguments: data_tag: D2
datatype: string

tool: D23: parse_prefix: %s: uname overflow

tool: D7: parse_prefix: %s: nick overflow

tool: D2: parse_prefix: %s: host overflow

assistant: ```c
void ircproto_parse_prefix(char *prefix, char *nick, int nicksz, char *user, int usersz, char *host, int hostsz) {
  char *bang, *at, *end, *uidx, *hidx;
  int nlen, ulen, hlen;
  int ncpy, ucpy, hcpy;
  bang = strchr(prefix, '!');
  at = strchr(prefix, '@');
  end = prefix + strlen(prefix);
  if (nick) {
    nlen = bang ? bang - prefix : end - prefix;
    ncpy = ((nlen) < (nicksz - 1) ? (nlen) : (nicksz - 1));
    strncpy(nick, prefix, ncpy);
    nick[ncpy] = '\0';
    if (ncpy != nlen)
      info("parse_prefix: %s: nick overflow", nick);
  }
  if (user) {
    if (bang) {
      uidx = bang + 1;
      ulen = at - uidx;
      ucpy = ((ulen) < (usersz - 1) ? (ulen) : (usersz - 1));
      strncpy(user, uidx, ucpy);
      user[ucpy] = '\0';
      if (ucpy != ulen)
        info("parse_prefix: %s: uname overflow", user);
    } else
      user[0] = '\0';
  }
  if (host) {
    if (at) {
      hidx = at + 1;
      hlen = end - hidx;
      hcpy = ((hlen) < (hostsz - 1) ? (hlen) : (hostsz - 1));
      strncpy(host, hidx, hcpy);
      host[hcpy] = '\0';
      if (hcpy != hlen)
        info("parse_prefix: %s: host overflow", host);
    } else
      host[0] = '\0';
  }
}
```