user: 请从给定的汇编指令推导出C源代码：

```asm
<rs_parse_cmdline>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %r9,0x8(%rsp)
  mov    (%rcx),%r14d
  mov    $0x0,%r15d
  cmp    %edi,%r14d
  jge    L32
  mov    %edi,%ebp
  mov    %rsi,%r13
  mov    %rcx,%rbx
  mov    %r8,%r12
  movslq %r14d,%rax
  mov    (%rsi,%rax,8),%r15
  cmpb   $0x2d,(%r15)
  jne    L177
  movzbl 0x1(%r15),%eax
  test   %al,%al
  je     L177
  cmp    $0x2d,%al
  je     L7
  movslq (%r8),%rax
  movzbl (%r15,%rax,1),%r14d
  cmp    $0x3a,%r14b
  je     L167
  movsbl %r14b,%r15d
  mov    %r15d,%esi
  mov    %rdx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L167
  cmpb   $0x3a,0x1(%rax)
  jne    L35
  mov    (%rbx),%eax
  movslq %eax,%rcx
  movslq (%r12),%rdx
  mov    0x0(%r13,%rcx,8),%rcx
  lea    0x1(%rcx,%rdx,1),%rdx
  cmpb   $0x0,(%rdx)
  jne    L119
  add    $0x2,%eax
  mov    %eax,(%rbx)
  movl   $0x1,(%r12)
  mov    (%rbx),%eax
  cmp    %ebp,%eax
  jg     L34
  cltq
  mov    -0x8(%r13,%rax,8),%rax
  mov    0x8(%rsp),%rbx
  mov    %rax,(%rbx)
  jmp    L32
L177:
  mov    0x8(%rsp),%rax
  mov    %r15,(%rax)
  addl   $0x1,(%rbx)
  movl   $0x1,(%r12)
  mov    $0x23,%r15d
L32:
  mov    %r15d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  lea    D10(%rip),%rsi
  mov    %r15,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L93
  lea    D45(%rip),%rsi
  mov    %r15,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L175
  add    $0x1,%r14d
  mov    %r14d,(%rbx)
  movl   $0x1,(%r12)
  mov    $0x40,%r15d
  jmp    L32
L93:
  add    $0x1,%r14d
  mov    %r14d,(%rbx)
  movl   $0x1,(%r12)
  mov    $0x21,%r15d
  jmp    L32
L175:
  mov    %r15,%rcx
  lea    D30(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <rs_error@plt>
  mov    $0x3f,%r15d
  jmp    L32
L167:
  movsbl %r14b,%ecx
  lea    D4(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <rs_error@plt>
  mov    $0x3f,%r15d
  jmp    L32
L119:
  mov    0x8(%rsp),%rax
  mov    %rdx,(%rax)
  addl   $0x1,(%rbx)
  movl   $0x1,(%r12)
  jmp    L32
L34:
  mov    %r15d,%ecx
  lea    D16(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <rs_error@plt>
  mov    $0x3f,%r15d
  jmp    L32
L35:
  mov    (%rbx),%edx
  mov    (%r12),%eax
  movslq %edx,%rsi
  movslq %eax,%rcx
  mov    0x0(%r13,%rsi,8),%rsi
  add    $0x1,%eax
  cmpb   $0x0,0x1(%rsi,%rcx,1)
  jne    L130
  add    $0x1,%edx
  mov    %edx,(%rbx)
  mov    $0x1,%eax
L130:
  mov    %eax,(%r12)
  mov    0x8(%rsp),%rax
  movq   $0x0,(%rax)
  jmp    L32
```

tool_calls: name: parse_data
arguments: label: D10
type_infered: string
name: parse_data
arguments: label: D45
type_infered: string
name: parse_data
arguments: label: D30
type_infered: string
name: parse_data
arguments: label: D4
type_infered: string
name: parse_data
arguments: label: D16
type_infered: string

tool: D10: --help

tool: D45: --version

tool: D30: unrecognized option %s (try --help)

tool: D4: unrecognized option -%c (try --help)

tool: D16: -%c: requires an argument

assistant: ```c
int rs_parse_cmdline(int argc, char **argv, const char *optstring, int *i, int *j, const char **arg) {
  char c;
  char *p;
  if (*i >= argc)
    return 0;
  if (argv[*i][0] != '-' || argv[*i][1] == 0) {
    *arg = argv[*i];
    (*i)++;
    *j = 1;
    return '#';
  }
  if (argv[*i][1] == '-') {
    if (!strcasecmp(argv[*i], "--help")) {
      (*i)++;
      *j = 1;
      return '!';
    } else if (!strcasecmp(argv[*i], "--version")) {
      (*i)++;
      *j = 1;
      return '@';
    } else {
      rs_error(NULL, NULL, "unrecognized option %s (try --help)", argv[*i]);
      return '?';
    }
  }
  c = argv[*i][*j];
  if (c == ':' || !(p = strchr(optstring, c))) {
    rs_error(NULL, NULL, "unrecognized option -%c (try --help)", c);
    return '?';
  }
  if (p[1] == ':') {
    if (argv[*i][*j + 1]) {
      *arg = &argv[*i][*j + 1];
      (*i)++;
      *j = 1;
      return c;
    } else {
      (*i) += 2;
      *j = 1;
      if (*i > argc) {
        rs_error(NULL, NULL, "-%c: requires an argument", c);
        return '?';
      }
      *arg = argv[*i - 1];
      return c;
    }
  } else {
    if (argv[*i][*j + 1]) {
      (*j)++;
    } else {
      (*i)++;
      *j = 1;
    }
    *arg = NULL;
    return c;
  }
}
```