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

```asm
<netbios_copy_name_raw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9d,-0x34(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  movl   $0x0,-0x8(%rbp)
  jmp    L47
L101:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  jmp    L58
L15:
  subl   $0x1,-0x4(%rbp)
L58:
  cmpl   $0xf,-0x8(%rbp)
  jne    L40
  cmpl   $0x0,-0x4(%rbp)
  je     L40
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L15
L40:
  mov    -0x4(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x9(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isprint@plt>
  test   %eax,%eax
  je     L55
  cmpl   $0xf,-0x8(%rbp)
  jne    L111
L55:
  mov    -0x4(%rbp),%eax
  lea    0x3(%rax),%edx
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,%edx
  jbe    L38
  mov    -0x18(%rbp),%rax
  lea    D22(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <FRAMERR@plt>
  jmp    L0
L38:
  mov    -0x4(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  lea    D20(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  lea    D20(%rip),%rcx
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rdx)
  mov    -0x4(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x3e,(%rax)
  mov    -0x4(%rbp),%eax
  add    $0x4,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%edx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x3c,(%rax)
  addl   $0x4,-0x4(%rbp)
  jmp    L100
L111:
  addl   $0x1,-0x4(%rbp)
L100:
  addl   $0x1,-0x8(%rbp)
L47:
  cmpl   $0xf,-0x8(%rbp)
  ja     L0
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jb     L101
L0:
  mov    -0x28(%rbp),%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D22
data_type: string
name: unpack_data
arguments: data_label: D20
data_type: string

tool: D22: netbios: name too long


tool: D20: 0123456789ABCDEF

assistant: ```c
unsigned netbios_copy_name_raw(struct NetFrame *frame, const unsigned char *px, unsigned length, unsigned offset, char *name, unsigned sizeof_name) {
  unsigned j = 0;
  unsigned k = 0;
  name[0] = '\0';
  for (j = 0; j < 16 && offset < length; j++) {
    char c = px[offset++];
    while (j == 15 && (k > 0 && name[k - 1] == ' '))
      k--;
    name[k] = c;
    name[k + 1] = '\0';
    if (!isprint(name[k]) || j == 15) {
      if (k + 3 > sizeof_name - 1) {
        FRAMERR(frame, "netbios: name too long\n");
        break;
      }
      name[k + 1] = "0123456789ABCDEF"[(name[k] >> 4) & 0xF];
      name[k + 2] = "0123456789ABCDEF"[(name[k] >> 0) & 0xF];
      name[k + 3] = '>';
      name[k + 4] = '\0';
      name[k] = '<';
      k += 4;
    } else
      k++;
  }
  return offset;
}
```