user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_docmd>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    (%rsi),%rdi
  mov    $0x0,%eax
  test   %rdi,%rdi
  je     L94
  mov    %rsi,%rbx
  lea    D107(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L157
  call   <_shell_help@plt>
  mov    $0x0,%eax
L94:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L157:
  lea    D67(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  je     L94
  lea    D153(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L300
  mov    0x8(%rbx),%rsi
  test   %rsi,%rsi
  je     L10
  mov    %rbp,%rdi
  call   <_close_targets@plt>
  mov    $0x0,%eax
  jmp    L94
L10:
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
L300:
  lea    D105(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L259
  mov    0x8(%rbx),%rsi
  test   %rsi,%rsi
  je     L273
  mov    %rbp,%rdi
  call   <_open_targets@plt>
  mov    $0x0,%eax
  jmp    L94
L273:
  lea    D72(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
L259:
  lea    D43(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L216
  mov    0x8(%rbx),%rsi
  mov    %rbp,%rdi
  call   <_query_targets@plt>
  mov    $0x0,%eax
  jmp    L94
L216:
  lea    D112(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L59
  call   <_show_config@plt>
  mov    $0x0,%eax
  jmp    L94
L59:
  lea    D64(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L175
  cmpq   $0x0,0x8(%rbx)
  je     L265
  lea    D65(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
L265:
  mov    $0x0,%eax
  call   <_list_targets@plt>
  mov    $0x0,%eax
  jmp    L94
L175:
  lea    D33(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L252
  mov    %rbp,%rdi
  call   <_get_idn@plt>
  mov    $0x0,%eax
  jmp    L94
L252:
  lea    D133(%rip),%rsi
  mov    (%rbx),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L212
  mov    0x8(%rbx),%rdi
  test   %rdi,%rdi
  je     L98
  cmpq   $0x0,0x10(%rbx)
  je     L160
L98:
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
L160:
  lea    D88(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L18
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <inst_set_verbose@plt>
  mov    $0x0,%eax
  jmp    L94
L18:
  mov    0x8(%rbx),%rdi
  lea    D82(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L191
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <inst_set_verbose@plt>
  mov    $0x0,%eax
  jmp    L94
L191:
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
L212:
  lea    D151(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L94
```

tool_calls: name: unpack_data
arguments: data_tag: D107
datatype: string
name: unpack_data
arguments: data_tag: D67
datatype: string
name: unpack_data
arguments: data_tag: D153
datatype: string
name: unpack_data
arguments: data_tag: D6
datatype: string
name: unpack_data
arguments: data_tag: D105
datatype: string
name: unpack_data
arguments: data_tag: D72
datatype: string
name: unpack_data
arguments: data_tag: D43
datatype: string
name: unpack_data
arguments: data_tag: D112
datatype: string
name: unpack_data
arguments: data_tag: D64
datatype: string
name: unpack_data
arguments: data_tag: D65
datatype: string
name: unpack_data
arguments: data_tag: D33
datatype: string
name: unpack_data
arguments: data_tag: D133
datatype: string
name: unpack_data
arguments: data_tag: D20
datatype: string
name: unpack_data
arguments: data_tag: D88
datatype: string
name: unpack_data
arguments: data_tag: D82
datatype: string
name: unpack_data
arguments: data_tag: D151
datatype: string

tool: D107: help

tool: D67: quit

tool: D153: on

tool: D6: Usage: on [targets]


tool: D105: off

tool: D72: Usage: off [targets]


tool: D43: query

tool: D112: show

tool: D64: list

tool: D65: Usage: list


tool: D33: id

tool: D133: verbose

tool: D20: Usage: verbose 1|0


tool: D88: 1

tool: D82: 0

tool: D151: type "help" for a list of commands


assistant: ```c
int _docmd(struct instrument *gd, char **av) {
  int rc = 0;
  if (av[0]) {
    if (strcmp(av[0], "help") == 0) {
      _shell_help();
    } else if (strcmp(av[0], "quit") == 0) {
      rc = 1;
    } else if (strcmp(av[0], "on") == 0) {
      if (av[1] == NULL)
        printf("Usage: on [targets]\n");
      else
        _close_targets(gd, av[1]);
    } else if (strcmp(av[0], "off") == 0) {
      if (av[1] == NULL)
        printf("Usage: off [targets]\n");
      else
        _open_targets(gd, av[1]);
    } else if (strcmp(av[0], "query") == 0) {
      _query_targets(gd, av[1]);
    } else if (strcmp(av[0], "show") == 0) {
      _show_config();
    } else if (strcmp(av[0], "list") == 0) {
      if (av[1] != NULL)
        printf("Usage: list\n");
      else
        _list_targets();
    } else if (strcmp(av[0], "id") == 0) {
      _get_idn(gd);
    } else if (strcmp(av[0], "verbose") == 0) {
      if (av[1] == NULL || av[2] != NULL)
        printf("Usage: verbose 1|0\n");
      else {
        if (!strcmp(av[1], "1"))
          inst_set_verbose(gd, 1);
        else if (!strcmp(av[1], "0"))
          inst_set_verbose(gd, 0);
        else
          printf("Usage: verbose 1|0\n");
      }
    } else
      printf("type \"help\" for a list of commands\n");
  }
  return rc;
}
```