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

```asm
<__getopt_long>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    D1(%rip),%rbx
  mov    (%rbx),%r11d
  cmp    %edi,%r11d
  jge    L258
  movslq %r11d,%rax
  mov    %rdx,%r12
  mov    %rsi,%r10
  mov    (%rsi,%rax,8),%rdx
  lea    0x0(,%rax,8),%rbp
  test   %rdx,%rdx
  je     L258
  cmpb   $0x2d,(%rdx)
  jne    L258
  movzbl 0x1(%rdx),%r13d
  mov    %rcx,%rsi
  test   %r9d,%r9d
  je     L235
  test   %r13b,%r13b
  je     L270
  mov    (%rcx),%rax
  test   %rax,%rax
  je     L175
L37:
  lea    0x1(%rdx),%r14
  add    $0x2,%rdx
  cmp    $0x2d,%r13b
  cmove  %rdx,%r14
  xor    %r9d,%r9d
L101:
  movzbl (%rax),%ecx
  mov    %r14,%rdx
  test   %cl,%cl
  jne    L268
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L118:
  movzbl 0x1(%rax),%ecx
  add    $0x1,%rax
  add    $0x1,%rdx
  test   %cl,%cl
  je     L21
L268:
  cmp    %cl,(%rdx)
  je     L118
L82:
  mov    0x20(%rsi),%rax
  add    $0x20,%rsi
  add    $0x1,%r9d
  test   %rax,%rax
  jne    L101
L175:
  cmp    $0x2d,%r13b
  jne    L270
L230:
  add    $0x1,%r11d
  mov    $0x3f,%eax
  mov    %r11d,(%rbx)
  jmp    L276
  nopl   0x0(%rax)
L235:
  cmp    $0x2d,%r13b
  jne    L270
  cmpb   $0x0,0x2(%rdx)
  je     L270
  mov    (%rcx),%rax
  test   %rax,%rax
  jne    L37
  jmp    L230
  xchg   %ax,%ax
L270:
  pop    %rbx
  mov    %r12,%rdx
  pop    %rbp
  mov    %r10,%rsi
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1050 <getopt@plt>
  nopl   0x0(%rax,%rax,1)
L21:
  movzbl (%rdx),%eax
  test   %al,%al
  je     L178
  cmp    $0x3d,%al
  jne    L82
L178:
  mov    0x8(%rsi),%rcx
  cmp    $0x3d,%al
  jne    L243
  test   %rcx,%rcx
  je     L82
  mov    D4(%rip),%rax
  add    $0x1,%rdx
  mov    %rdx,(%rax)
L33:
  add    $0x1,%r11d
  mov    %r11d,(%rbx)
  test   %r8,%r8
  je     L157
  mov    %r9d,(%r8)
L157:
  mov    0x10(%rsi),%rdx
  mov    0x18(%rsi),%eax
  test   %rdx,%rdx
  je     L276
  mov    %eax,(%rdx)
  xor    %eax,%eax
L276:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L258:
  mov    $0xffffffff,%eax
  jmp    L276
L243:
  mov    D29(%rip),%rax
  cmp    %rcx,(%rax)
  je     L116
  mov    D4(%rip),%rax
  movq   $0x0,(%rax)
  jmp    L33
L116:
  mov    0x8(%r10,%rbp,1),%rax
  mov    D4(%rip),%rdx
  add    $0x1,%r11d
  mov    %r11d,(%rbx)
  mov    %rax,(%rdx)
  test   %rax,%rax
  jne    L33
  mov    $0x3a,%eax
  jmp    L276
```

assistant: ```c
int __getopt_long(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *idx, int longonly) {
  if (optind >= argc || !argv[optind] || argv[optind][0] != '-')
    return -1;
  if ((longonly && argv[optind][1]) || (argv[optind][1] == '-' && argv[optind][2])) {
    int i;
    for (i = 0; longopts[i].name; i++) {
      const char *name = longopts[i].name;
      char *opt = argv[optind] + 1;
      if (*opt == '-')
        opt++;
      for (; *name && *name == *opt; name++, opt++)
        ;
      if (*name || (*opt && *opt != '='))
        continue;
      if (*opt == '=') {
        if (!longopts[i].has_arg)
          continue;
        optarg = opt + 1;
      } else {
        if (longopts[i].has_arg == required_argument) {
          if (!(optarg = argv[++optind]))
            return ':';
        } else
          optarg = NULL;
      }
      optind++;
      if (idx)
        *idx = i;
      if (longopts[i].flag) {
        *longopts[i].flag = longopts[i].val;
        return 0;
      }
      return longopts[i].val;
    }
    if (argv[optind][1] == '-') {
      optind++;
      return '?';
    }
  }
  return getopt(argc, argv, optstring);
}
```