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

```asm
<check_arg>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  cmp    $0x1,%edi
  jle    L159
  mov    %edi,%r12d
  cmp    $0x2,%edi
  je     L10
  mov    $0x2,%ebx
  mov    $0x2,%r14d
  lea    D51(%rip),%r15
  xchg   %ax,%ax
L61:
  mov    0x8(%rsp),%rax
  lea    0x0(,%r14,8),%r13
  mov    %r15,%rsi
  lea    (%rax,%r13,1),%rbp
  mov    0x0(%rbp),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L107
  lea    0x1(%rbx),%eax
  cmp    %r12d,%eax
  jl     L113
L107:
  mov    0x0(%rbp),%rdi
  lea    D75(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L204
  lea    0x1(%rbx),%eax
  cmp    %r12d,%eax
  jl     L113
L204:
  mov    0x0(%rbp),%rdi
  lea    D83(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L73
  lea    0x1(%rbx),%eax
  cmp    %r12d,%eax
  jl     L113
  mov    0x0(%rbp),%rdi
  lea    D91(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L141
L18:
  mov    0x0(%rbp),%rdi
  lea    D11(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L10
  mov    0x0(%rbp),%rdi
  lea    D55(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L10
L80:
  mov    0x0(%rbp),%rdi
  lea    D89(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L166
  nopl   0x0(%rax)
L25:
  add    $0x1,%ebx
  cmp    %r12d,%ebx
  jge    L10
L165:
  movslq %ebx,%r14
  jmp    L61
L73:
  mov    0x0(%rbp),%rdi
  lea    D91(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L141
  lea    0x1(%rbx),%eax
  cmp    %r12d,%eax
  jge    L18
  mov    0x8(%rsp),%rax
  mov    0x8(%rax,%r13,1),%rdi
  call   <check_arg_type@plt>
  test   %rax,%rax
  jne    L113
L166:
  xor    %eax,%eax
  call   <check_arg_error@plt>
  cmp    %ebx,%r12d
  jg     L61
L10:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L113:
  add    $0x2,%ebx
  cmp    %r12d,%ebx
  jl     L165
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L141:
  mov    0x0(%rbp),%rdi
  lea    D11(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L25
  mov    0x0(%rbp),%rdi
  lea    D55(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L25
  jmp    L80
  nopw   0x0(%rax,%rax,1)
L159:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <check_arg_error@plt>
```

tool_calls: name: read_data
arguments: data_tag: D51
type_guessed: string
name: read_data
arguments: data_tag: D75
type_guessed: string
name: read_data
arguments: data_tag: D83
type_guessed: string
name: read_data
arguments: data_tag: D91
type_guessed: string
name: read_data
arguments: data_tag: D11
type_guessed: string
name: read_data
arguments: data_tag: D55
type_guessed: string
name: read_data
arguments: data_tag: D89
type_guessed: string

tool: D51: -name

tool: D75: -path

tool: D83: -user

tool: D91: -type

tool: D11: -nouser

tool: D55: -print

tool: D89: -ls

assistant: ```c
void check_arg(const int argc, const char *argv[]) {
  const char *const *parms = argv;
  int parm_pos = 2;
  if (argc < 2) {
    check_arg_error();
  }
  while (parm_pos < argc) {
    if ((strcmp(parms[parm_pos], "-name") == 0) && (parm_pos + 1 < argc)) {
      if (parm_pos + 2 < argc) {
        parm_pos += 2;
      } else {
        break;
      }
    } else if ((strcmp(parms[parm_pos], "-path") == 0) && (parm_pos + 1 < argc)) {
      if (parm_pos + 2 < argc) {
        parm_pos += 2;
      } else {
        break;
      }
    } else if ((strcmp(parms[parm_pos], "-user") == 0) && (parm_pos + 1 < argc)) {
      if (parm_pos + 2 < argc) {
        parm_pos += 2;
      } else {
        break;
      }
    } else if ((strcmp(parms[parm_pos], "-type") == 0) && (parm_pos + 1 < argc)) {
      if (check_arg_type(argv[parm_pos + 1])) {
        if (parm_pos + 2 < argc) {
          parm_pos += 2;
        } else {
          break;
        }
      } else {
        check_arg_error();
      }
    } else if ((strcmp(parms[parm_pos], "-nouser") == 0)) {
      if (parm_pos + 1 < argc) {
        parm_pos++;
      } else {
        break;
      }
    } else if ((strcmp(parms[parm_pos], "-print") == 0)) {
      if (parm_pos + 1 < argc) {
        parm_pos++;
      } else {
        break;
      }
    } else if ((strcmp(parms[parm_pos], "-ls") == 0)) {
      if (parm_pos + 1 < argc) {
        parm_pos++;
      } else {
        break;
      }
    } else
      check_arg_error();
  }
}
```