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

```asm
<format_address>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  cmpq   $0x4,-0x40(%rbp)
  jne    L164
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <format_ipv4_address@plt>
  cmpl   $0xffffffff,-0x44(%rbp)
  je     L85
  cmpl   $0x20,-0x44(%rbp)
  jbe    L85
  movl   $0x20,-0x44(%rbp)
  jmp    L85
L164:
  cmpq   $0x10,-0x40(%rbp)
  jne    L134
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <format_ipv6_address@plt>
  cmpl   $0xffffffff,-0x44(%rbp)
  je     L85
  cmpl   $0x80,-0x44(%rbp)
  jbe    L85
  movl   $0x80,-0x44(%rbp)
  jmp    L85
L134:
  cmpq   $0x0,-0x30(%rbp)
  je     L85
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
L85:
  cmpl   $0xffffffff,-0x44(%rbp)
  je     L96
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L52
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  movb   $0x2f,(%rax)
L52:
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x3,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  add    $0x30,%eax
  mov    %al,-0x12(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L11
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x3,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  add    $0x30,%eax
  mov    %al,-0x11(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L57
  mov    -0x10(%rbp),%eax
  add    $0x30,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L57
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
L57:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L11
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x11(%rbp),%eax
  mov    %al,(%rdx)
L11:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L41
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  add    %rax,%rdx
  movzbl -0x12(%rbp),%eax
  mov    %al,(%rdx)
L41:
  mov    -0x8(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jae    L47
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L96
L47:
  cmpq   $0x0,-0x30(%rbp)
  je     L96
  mov    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L96:
  nop
  leave
  ret
```

assistant: ```c
void format_address(char *buf, size_t sizeof_buf, const void *v_addr, size_t sizeof_addr, unsigned prefix_length) {
  if (sizeof_addr == 4) {
    format_ipv4_address(buf, sizeof_buf, v_addr);
    if (prefix_length != ~0 && prefix_length > 32)
      prefix_length = 32;
  } else if (sizeof_addr == 16) {
    format_ipv6_address(buf, sizeof_buf, v_addr);
    if (prefix_length != ~0 && prefix_length > 128)
      prefix_length = 128;
  } else if (sizeof_buf > 0)
    buf[0] = '\0';
  if (prefix_length != ~0) {
    size_t d = strlen(buf);
    char c2;
    unsigned number = prefix_length;
    if (d < sizeof_buf)
      buf[d++] = '/';
    c2 = (number % 10) + '0';
    number /= 10;
    if (number) {
      char c1;
      c1 = (number % 10) + '0';
      number /= 10;
      if (number) {
        int c0;
        c0 = number + '0';
        if (d < sizeof_buf)
          buf[d++] = (char)c0;
      }
      if (d < sizeof_buf)
        buf[d++] = c1;
    }
    if (d < sizeof_buf)
      buf[d++] = c2;
    if (d < sizeof_buf)
      buf[d] = '\0';
    else if (sizeof_buf)
      buf[sizeof_buf - 1] = '\0';
  }
}
```