user: What would the C source look like for the assembly code provided here:

```asm
<sock_bsendto>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %edx,%r15d
  mov    %rcx,%r13
  mov    %r8d,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edx
  mov    D18(%rip),%rax
  mov    (%rax),%esi
  call   <fcntl@plt>
  mov    %eax,%ecx
  mov    %eax,0xc(%rsp)
  mov    D66(%rip),%rax
  mov    (%rax),%edx
  and    %edx,%ecx
  mov    %ecx,0x8(%rsp)
  jne    L94
  lea    0x1c(%rsp),%rdi
  mov    $0xc,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    D109(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x24(%rsp)
  lea    0x20(%rsp),%rsi
  mov    %r13,%rdi
  call   <inet_aton@plt>
  mov    %ebx,%edi
  call   <htons@plt>
  mov    %eax,0x1c(%rsp)
  test   %r15d,%r15d
  je     L96
L97:
  mov    %r15d,%r13d
  lea    0x1c(%rsp),%r14
L116:
  mov    $0xc,%r9d
  mov    %r14,%r8
  mov    $0x0,%ecx
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <sendto@plt>
  test   %eax,%eax
  jns    L56
  mov    D73(%rip),%rax
  mov    (%rax),%ebx
  mov    D95(%rip),%rax
  cmp    (%rax),%ebx
  je     L116
  cmpl   $0x0,0x8(%rsp)
  jne    L114
L13:
  mov    D73(%rip),%rax
  mov    %ebx,(%rax)
  mov    $0xffffffff,%eax
L43:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L94:
  not    %edx
  and    0xc(%rsp),%edx
  mov    D67(%rip),%rax
  mov    (%rax),%esi
  mov    %r12d,%edi
  call   <fcntl@plt>
  lea    0x1c(%rsp),%rdi
  mov    $0xc,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    D109(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x24(%rsp)
  lea    0x20(%rsp),%rsi
  mov    %r13,%rdi
  call   <inet_aton@plt>
  mov    %ebx,%edi
  call   <htons@plt>
  mov    %eax,0x1c(%rsp)
  test   %r15d,%r15d
  je     L84
  movl   $0x1,0x8(%rsp)
  jmp    L97
L114:
  mov    D66(%rip),%rax
  mov    0xc(%rsp),%edx
  or     (%rax),%edx
  mov    D67(%rip),%rax
  mov    (%rax),%esi
  mov    %r12d,%edi
  call   <fcntl@plt>
  jmp    L13
L56:
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%r13d
  jne    L116
  cmpl   $0x0,0x8(%rsp)
  je     L96
L84:
  mov    D66(%rip),%rax
  mov    0xc(%rsp),%edx
  or     (%rax),%edx
  mov    D67(%rip),%rax
  mov    (%rax),%esi
  mov    %r12d,%edi
  call   <fcntl@plt>
L96:
  mov    %r15d,%eax
  jmp    L43
L18:
  call   <__stack_chk_fail@plt>
```

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);
}
```