user: What is the c source code of the assembly code below:

```asm
<getopt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    D140(%rip),%rax
  mov    %edi,0x10(%rsp)
  mov    (%rax),%edx
  mov    %rsi,0x8(%rsp)
  test   %edx,%edx
  jne    L22
  movl   $0x1,(%rax)
  mov    $0x1,%edx
  movl   $0x0,D145(%rip)
L22:
  cmp    0x10(%rsp),%edx
  jg     L237
  movslq %edx,%r14
  jmp    L12
  nop
L224:
  cmp    %r14d,D52(%rip)
  je     L204
  mov    %ebp,D52(%rip)
  mov    $0x1,%eax
  movl   $0x0,D52(%rip)
  movq   $0x0,0x18(%rsp)
  movl   $0x0,0x14(%rsp)
L40:
  movsbl (%r15,%rax,1),%r12d
  mov    D34(%rip),%rax
  mov    %r13,%rdi
  mov    %r12d,%esi
  mov    %r12d,(%rax)
  call   <strchr@plt>
  test   %rax,%rax
  je     L100
  cmpb   $0x0,(%rax)
  jne    L115
  mov    D140(%rip),%rax
  add    $0x1,%ebx
  add    $0x1,%r14
  mov    %ebx,(%rax)
  cmp    %r14d,0x10(%rsp)
  jl     L237
L12:
  mov    0x8(%rsp),%rax
  mov    %r14d,%ebx
  mov    %r14d,%ebp
  mov    (%rax,%r14,8),%r15
  test   %r15,%r15
  je     L237
  cmpb   $0x2d,(%r15)
  jne    L237
  movzbl 0x1(%r15),%eax
  test   %al,%al
  je     L237
  cmp    $0x2d,%al
  jne    L224
  cmpb   $0x0,0x2(%r15)
  jne    L224
  mov    D140(%rip),%rax
  add    $0x1,%ebx
  mov    %ebx,(%rax)
  nopl   0x0(%rax,%rax,1)
L237:
  mov    $0xffffffff,%r12d
L219:
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L204:
  movslq D52(%rip),%rax
  mov    %eax,0x14(%rsp)
  mov    %rax,0x18(%rsp)
  add    $0x1,%rax
  jmp    L40
  nopl   0x0(%rax)
L100:
  xor    %edi,%edi
  mov    $0x3f,%r12d
  call   <getopterror@plt>
  mov    D140(%rip),%rax
  addl   $0x1,(%rax)
  jmp    L219
  nopl   0x0(%rax)
L115:
  cmpb   $0x3a,0x1(%rax)
  jne    L61
  mov    0x18(%rsp),%rcx
  cmpb   $0x3a,0x2(%rax)
  lea    0x2(%r15,%rcx,1),%rcx
  je     L135
  cmpb   $0x0,(%rcx)
  jne    L135
  mov    0x8(%rsp),%rax
  mov    D112(%rip),%rdx
  add    $0x1,%ebp
  mov    0x8(%rax,%r14,8),%rax
  mov    %rax,(%rdx)
  test   %rax,%rax
  je     L54
L43:
  mov    D140(%rip),%rax
  add    $0x1,%ebp
  mov    %ebp,(%rax)
  jmp    L219
L61:
  mov    0x14(%rsp),%r14d
  add    $0x1,%r14d
  mov    %r14d,D116(%rip)
  jmp    L219
L54:
  mov    D140(%rip),%rax
  mov    $0x3a,%r12d
  mov    %ebp,(%rax)
  cmpb   $0x3a,0x0(%r13)
  je     L219
  mov    $0x1,%edi
  call   <getopterror@plt>
  jmp    L219
L135:
  mov    D112(%rip),%rax
  mov    D140(%rip),%rdx
  mov    %rcx,(%rax)
  cmpb   $0x0,(%rcx)
  mov    (%rdx),%ebp
  jne    L43
  movq   $0x0,(%rax)
  jmp    L43
```

assistant: ```c
int getopt(int argc, char *const argv[], const char *optstring) {
  static int lastidx, lastofs;
  char *tmp;
  if (optind == 0) {
    optind = 1;
    lastidx = 0;
  }
again:
  if (optind > argc || !argv[optind] || *argv[optind] != '-' || argv[optind][1] == 0)
    return -1;
  if (argv[optind][1] == '-' && argv[optind][2] == 0) {
    ++optind;
    return -1;
  }
  if (lastidx != optind) {
    lastidx = optind;
    lastofs = 0;
  }
  optopt = argv[optind][lastofs + 1];
  if ((tmp = strchr(optstring, optopt))) {
    if (*tmp == 0) {
      ++optind;
      goto again;
    }
    if (tmp[1] == ':') {
      if (tmp[2] == ':' || argv[optind][lastofs + 2]) {
        if (!*(optarg = argv[optind] + lastofs + 2))
          optarg = 0;
        goto found;
      }
      optarg = argv[optind + 1];
      if (!optarg) {
        ++optind;
        if (*optstring == ':')
          return ':';
        getopterror(1);
        return ':';
      }
      ++optind;
    } else {
      ++lastofs;
      return optopt;
    }
  found:
    ++optind;
    return optopt;
  } else {
    getopterror(0);
    ++optind;
    return '?';
  }
}
```