user: 下面的汇编指令对应的C源代码是什么:

```asm
<bindresvport>:
  endbr64
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L134
  mov    D77(%rip),%rax
  mov    %rsi,%rbp
  mov    (%rax),%rax
  cmp    %rax,(%rsi)
  jne    L95
L1:
  movzwl D129(%rip),%edi
  test   %di,%di
  je     L3
  mov    D8(%rip),%rax
  mov    (%rax),%r12d
L78:
  movswl D107(%rip),%eax
  lea    -0x1(%r12),%r13d
  sub    %eax,%r12d
  test   %r12d,%r12d
  jle    L17
  nopl   0x0(%rax)
L87:
  xor    %ebx,%ebx
  jmp    L49
  nopl   0x0(%rax)
L130:
  mov    D69(%rip),%rdx
  mov    D153(%rip),%rcx
  mov    (%rdx),%rsi
  cmp    %rsi,(%rcx)
  jne    L89
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jle    L143
  movzwl D129(%rip),%edi
L49:
  lea    0x1(%rdi),%eax
  movswl %di,%edi
  mov    %ax,D79(%rip)
  call   <htons@plt>
  mov    %eax,0x8(%rbp)
  movswl D79(%rip),%eax
  cmp    %r13d,%eax
  jle    L117
  movzwl D107(%rip),%eax
  mov    %ax,D79(%rip)
L117:
  mov    $0x10,%edx
  mov    %rbp,%rsi
  mov    %r14d,%edi
  call   <__bind@plt>
  test   %eax,%eax
  js     L130
L89:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L138
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L17:
  mov    $0xffffffff,%eax
  xor    %ebx,%ebx
L143:
  cmp    %ebx,%r12d
  jne    L89
  cmpw   $0x200,D107(%rip)
  je     L89
  mov    $0x200,%eax
  mov    $0x257,%r13d
  mov    $0x58,%r12d
  mov    %ax,D79(%rip)
  movswl D79(%rip),%eax
  mov    %eax,%edi
  imul   $0xba3,%eax,%eax
  mov    %edi,%edx
  sar    $0xf,%dx
  sar    $0x12,%eax
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  lea    (%rax,%rdx,2),%eax
  shl    $0x3,%eax
  sub    %eax,%edi
  add    $0x200,%di
  jmp    L87
L3:
  xor    %eax,%eax
  call   <__getpid@plt>
  mov    D8(%rip),%rdx
  mov    (%rdx),%r12d
  cltd
  lea    -0x258(%r12),%ecx
  idiv   %ecx
  lea    0x258(%rdx),%edi
  mov    %di,D79(%rip)
  jmp    L78
L134:
  mov    %rsp,%rbp
  mov    $0x10,%esi
  mov    %rbp,%rdi
  call   <__bzero@plt>
  mov    D77(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,(%rsp)
  jmp    L1
L95:
  mov    D79(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  mov    $0xffffffff,%eax
  jmp    L89
L138:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int bindresvport(int sd, struct sockaddr_in *sin) {
  static short port;
  struct sockaddr_in myaddr;
  int i;
  static short startport = 600;
  if (sin == (struct sockaddr_in *)0) {
    sin = &myaddr;
    __bzero(sin, sizeof(*sin));
    sin->sin_family = AF_INET;
  } else if (sin->sin_family != AF_INET) {
    __set_errno(EAFNOSUPPORT);
    return -1;
  }
  if (port == 0) {
    port = (__getpid() % ((IPPORT_RESERVED - 1) - 600 + 1)) + 600;
  }
  int res = -1;
  int nports = (IPPORT_RESERVED - 1) - startport + 1;
  int endport = (IPPORT_RESERVED - 1);
again:
  for (i = 0; i < nports; ++i) {
    sin->sin_port = htons(port++);
    if (port > endport)
      port = startport;
    res = __bind(sd, sin, sizeof(struct sockaddr_in));
    if (res >= 0 || errno != EADDRINUSE)
      break;
  }
  if (i == nports && startport != 512) {
    startport = 512;
    endport = 600 - 1;
    nports = 600 - 512;
    port = 512 + port % (600 - 512);
    goto again;
  }
  return res;
}
```