user: 请将以下的汇编代码转换成C语言代码:

```asm
<addrsort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0x0,-0x62(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  movw   $0x0,-0x66(%rbp)
  jmp    L72
L46:
  movw   $0x0,-0x64(%rbp)
  jmp    L107
L33:
  mov    D24(%rip),%rax
  mov    0x8(%rax),%rdx
  movswq -0x64(%rbp),%rax
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    0x4(%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%ecx
  mov    D24(%rip),%rax
  mov    0x8(%rax),%rsi
  movswq -0x64(%rbp),%rax
  shl    $0x3,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  and    %ecx,%eax
  cmp    %eax,%edx
  je     L123
  movzwl -0x64(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x64(%rbp)
L107:
  movswl -0x64(%rbp),%edx
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jb     L33
  jmp    L177
L123:
  nop
L177:
  movswl -0x66(%rbp),%eax
  cltq
  movzwl -0x64(%rbp),%edx
  mov    %dx,-0x50(%rbp,%rax,2)
  cmpw   $0x0,-0x62(%rbp)
  jne    L49
  cmpw   $0x0,-0x66(%rbp)
  jle    L49
  movswl -0x66(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzwl -0x50(%rbp,%rax,2),%eax
  cmp    %ax,-0x64(%rbp)
  jge    L49
  movzwl -0x66(%rbp),%eax
  mov    %ax,-0x62(%rbp)
L49:
  movzwl -0x66(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x66(%rbp)
  addq   $0x8,-0x60(%rbp)
L72:
  movswl -0x66(%rbp),%eax
  cmp    %eax,-0x7c(%rbp)
  jg     L46
  cmpw   $0x0,-0x62(%rbp)
  je     L105
  jmp    L14
L97:
  movzwl -0x62(%rbp),%eax
  sub    $0x1,%eax
  mov    %ax,-0x64(%rbp)
  jmp    L128
L61:
  movswl -0x64(%rbp),%eax
  cltq
  movzwl -0x50(%rbp,%rax,2),%edx
  movswl -0x64(%rbp),%eax
  add    $0x1,%eax
  cltq
  movzwl -0x50(%rbp,%rax,2),%eax
  cmp    %ax,%dx
  jle    L148
  movswl -0x64(%rbp),%eax
  cltq
  movzwl -0x50(%rbp,%rax,2),%eax
  mov    %ax,-0x66(%rbp)
  movswl -0x64(%rbp),%eax
  add    $0x1,%eax
  movswl -0x64(%rbp),%ecx
  cltq
  movzwl -0x50(%rbp,%rax,2),%edx
  movslq %ecx,%rax
  mov    %dx,-0x50(%rbp,%rax,2)
  movswl -0x64(%rbp),%eax
  add    $0x1,%eax
  cltq
  movzwl -0x66(%rbp),%edx
  mov    %dx,-0x50(%rbp,%rax,2)
  movswq -0x64(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x58(%rbp)
  movswq -0x64(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movswq -0x64(%rbp),%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x78(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  movswq -0x64(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rax,(%rdx)
  movzwl -0x64(%rbp),%eax
  sub    $0x1,%eax
  mov    %ax,-0x64(%rbp)
L128:
  cmpw   $0x0,-0x64(%rbp)
  jns    L61
  jmp    L35
L148:
  nop
L35:
  movzwl -0x62(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0x62(%rbp)
L14:
  movswl -0x62(%rbp),%eax
  cmp    %eax,-0x7c(%rbp)
  jg     L97
  jmp    L64
L105:
  nop
L64:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L129
  call   <__stack_chk_fail@plt>
L129:
  leave
  ret
```

assistant: ```c
void addrsort(char **ap, int num) {
  short i, j;
  char **p;
  short aval[35];
  short needsort = 0;
  p = ap;
  for (i = 0; i < num; i++, p++) {
    for (j = 0; (unsigned)j < _res.nsort; j++)
      if (_res.sort_list[j].addr.s_addr == (((struct in_addr *)(*p))->s_addr & _res.sort_list[j].mask))
        break;
    aval[i] = j;
    if (needsort == 0 && i > 0 && j < aval[i - 1])
      needsort = i;
  }
  if (!needsort)
    return;
  while (needsort < num) {
    for (j = needsort - 1; j >= 0; j--) {
      if (aval[j] > aval[j + 1]) {
        char *hp;
        i = aval[j];
        aval[j] = aval[j + 1];
        aval[j + 1] = i;
        hp = ap[j];
        ap[j] = ap[j + 1];
        ap[j + 1] = hp;
      } else
        break;
    }
    needsort++;
  }
}
```