user: Demonstrate the C code that generates the assembly output below:

```asm
<sock_bsendto>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x38(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8d,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    D32(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  mov    %eax,-0x20(%rbp)
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  and    -0x20(%rbp),%eax
  test   %eax,%eax
  je     L26
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  not    %eax
  and    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    D105(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  movl   $0x1,-0x28(%rbp)
L26:
  lea    -0x14(%rbp),%rax
  mov    $0xc,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    D42(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x14(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <inet_aton@plt>
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edi
  call   <htons@plt>
  mov    %eax,-0x14(%rbp)
  jmp    L16
L86:
  nop
L70:
  lea    -0x14(%rbp),%rcx
  mov    -0x24(%rbp),%edx
  mov    -0x40(%rbp),%rsi
  mov    -0x34(%rbp),%eax
  mov    $0xc,%r9d
  mov    %rcx,%r8
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <sendto@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L40
  mov    D74(%rip),%rax
  mov    (%rax),%edx
  mov    D27(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L85
  jmp    L70
L85:
  mov    D74(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L46
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  or     -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    D105(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
L46:
  mov    D74(%rip),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L50
L40:
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x24(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  add    %rax,-0x40(%rbp)
L16:
  cmpl   $0x0,-0x24(%rbp)
  jne    L86
  cmpl   $0x0,-0x28(%rbp)
  je     L98
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  or     -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    D105(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
L98:
  mov    -0x38(%rbp),%eax
  sub    -0x24(%rbp),%eax
L50:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L53
  call   <__stack_chk_fail@plt>
L53:
  leave
  ret
```

assistant: ```c
int sock_bsendto(int s, void *buf, int len, char *hostname, int port) {
  int flag = 0;
  int oldfl, ret, comp = len;
  int olderrno;
  struct sockaddr_in sa;
  oldfl = fcntl(s, F_GETFL, 0);
  if (oldfl & O_NONBLOCK) {
    fcntl(s, F_SETFL, oldfl & (~O_NONBLOCK));
    flag = 1;
  }
  memset((char *)&sa, 0, sizeof(struct sockaddr_in));
  sa.sin_family = AF_INET;
  inet_aton(hostname, &sa.sin_addr);
  sa.sin_port = htons(port);
  while (comp) {
  bsendto_restart:
    if ((ret = sendto(s, (char *)buf, comp, 0, (struct sockaddr *)&sa, sizeof(struct sockaddr_in))) < 0) {
      if (errno == EINTR)
        goto bsendto_restart;
      olderrno = errno;
      if (flag)
        fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
      errno = olderrno;
      return -1;
    }
    comp -= ret;
    buf += ret;
  }
  if (flag)
    fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
  return (len - comp);
}
```