user: Translate the below assembly code into C programming language:

```asm
<port_list>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %esi,%eax
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %edi,%edx
  mov    %dx,-0x14(%rbp)
  mov    %ax,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jle    L2
  mov    $0x10,%eax
  sub    -0x2c(%rbp),%eax
  mov    $0xffff,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  jmp    L85
L2:
  mov    $0x0,%eax
L85:
  mov    %ax,-0x6(%rbp)
  movzwl -0x14(%rbp),%eax
  and    -0x6(%rbp),%ax
  cmp    %ax,-0x14(%rbp)
  jne    L75
  movzwl -0x6(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  movzwl -0x18(%rbp),%eax
  or     %edx,%eax
  cmp    %ax,-0x18(%rbp)
  jne    L75
  movzwl -0x14(%rbp),%eax
  xor    -0x18(%rbp),%ax
  and    -0x6(%rbp),%ax
  test   %ax,%ax
  je     L54
  subl   $0x1,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jle    L45
  mov    $0x10,%eax
  sub    -0x2c(%rbp),%eax
  mov    $0xffff,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  jmp    L92
L45:
  mov    $0x0,%eax
L92:
  mov    %ax,-0x6(%rbp)
L54:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x14(%rbp),%eax
  mov    %ax,(%rdx)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x6(%rbp),%eax
  mov    %ax,0x2(%rdx)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  jmp    L73
L75:
  movzwl -0x14(%rbp),%eax
  xor    -0x18(%rbp),%ax
  and    -0x6(%rbp),%ax
  test   %ax,%ax
  jne    L27
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edi
  movzwl -0x18(%rbp),%esi
  movzwl -0x14(%rbp),%eax
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <port_list>
  jmp    L88
L27:
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edi
  movzwl -0x6(%rbp),%eax
  not    %eax
  mov    %eax,%edx
  movzwl -0x14(%rbp),%eax
  or     %edx,%eax
  movzwl %ax,%esi
  movzwl -0x14(%rbp),%eax
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <port_list>
  mov    -0x2c(%rbp),%eax
  lea    0x1(%rax),%edi
  movzwl -0x18(%rbp),%esi
  movzwl -0x18(%rbp),%eax
  and    -0x6(%rbp),%ax
  movzwl %ax,%eax
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    %edi,%r8d
  mov    %eax,%edi
  call   <port_list>
L88:
  mov    -0x4(%rbp),%eax
L73:
  leave
  ret
```

assistant: ```c
int port_list(unsigned short key0, unsigned short key1, unsigned short dPt_list[][2], int *i, int length) {
  int ret = 0;
  unsigned short tmp_mask;
  tmp_mask = (unsigned short)(length > 0 ? (0xffff << (16 - length)) : 0);
  if ((key0 & tmp_mask) == key0 && (unsigned short)(key1 | ~(tmp_mask)) == key1) {
    if ((key0 & tmp_mask) != (key1 & tmp_mask)) {
      length--;
      tmp_mask = (unsigned short)(length > 0 ? (0xffff << (16 - length)) : 0);
    }
    dPt_list[*i][0] = key0;
    dPt_list[*i][1] = tmp_mask;
    *i = *i + 1;
    return 0;
  }
  if ((key0 & tmp_mask) == (key1 & tmp_mask)) {
    port_list(key0, key1, dPt_list, i, length + 1);
  } else {
    port_list(key0, (unsigned short)(key0 | ~(tmp_mask)), dPt_list, i, length + 1);
    port_list((unsigned short)(key1 & (tmp_mask)), key1, dPt_list, i, length + 1);
  }
  return ret;
}
```