user: Converte this assembly snippet into its equivalent C code:

```asm
<_set_alternative>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L26
  mov    %rdx,%rbx
  mov    %rsp,%r13
  mov    (%rdx),%rdx
  lea    D62(%rip),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <asprintf@plt>
  mov    (%rsp),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  lea    0x1(%rax),%rdx
  call   <cli_send@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    (%rbx),%rdi
  lea    D9(%rip),%rsi
  call   <strcmp@plt>
  lea    D13(%rip),%rsi
  test   %rax,%rax
  jne    L9
L56:
  mov    %r13,%rdi
  call   <asprintf@plt>
  mov    (%rsp),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %r12d,%r12d
  lea    0x1(%rax),%rdx
  call   <cli_send@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
L37:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    (%rbx),%rdi
  lea    D20(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L77
  lea    D56(%rip),%rsi
  jmp    L56
  nopl   (%rax)
L77:
  mov    (%rbx),%rdi
  lea    D14(%rip),%rsi
  xor    %r12d,%r12d
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
  lea    D53(%rip),%rsi
  mov    %r13,%rdi
  call   <asprintf@plt>
  mov    (%rsp),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %r13,%rsi
  lea    0x1(%rax),%rdx
  call   <cli_send@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  jmp    L37
L26:
  lea    D3(%rip),%rsi
  mov    %rsp,%rdi
  call   <asprintf@plt>
  mov    (%rsp),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0xffffffff,%r12d
  lea    0x1(%rax),%rdx
  call   <cli_send@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  jmp    L37
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D62
datatype: string
name: read_data
arguments: label: D9
datatype: string
name: read_data
arguments: label: D13
datatype: string
name: read_data
arguments: label: D20
datatype: string
name: read_data
arguments: label: D56
datatype: string
name: read_data
arguments: label: D14
datatype: string
name: read_data
arguments: label: D53
datatype: string
name: read_data
arguments: label: D3
datatype: string

tool: D62: argv[0] = %s


tool: D9: on

tool: D13: turn on


tool: D20: off

tool: D56: turn off


tool: D14: fuzzy

tool: D53: fuzzy mode


tool: D3: > argc <= 0 is invalid


assistant: ```c
int _set_alternative(struct cli *cli, int argc, char *argv[]) {
  if (argc <= 0) {
    {
      char *__tmp;
      asprintf(&__tmp, "> "
                       "argc <= 0 is invalid"
                       "\n\r");
      cli_send(cli, __tmp, strlen(__tmp) + 1);
      free(__tmp);
    };
    return (-1);
  }
  {
    char *__tmp;
    asprintf(&__tmp,
             "argv[0] = %s"
             "\n\r",
             argv[0]);
    cli_send(cli, __tmp, strlen(__tmp) + 1);
    free(__tmp);
  };
  if (0 == strcmp(argv[0], "on")) {
    {
      char *__tmp;
      asprintf(&__tmp, "turn on"
                       "\n\r");
      cli_send(cli, __tmp, strlen(__tmp) + 1);
      free(__tmp);
    };
  } else if (0 == strcmp(argv[0], "off")) {
    {
      char *__tmp;
      asprintf(&__tmp, "turn off"
                       "\n\r");
      cli_send(cli, __tmp, strlen(__tmp) + 1);
      free(__tmp);
    };
  } else if (0 == strcmp(argv[0], "fuzzy")) {
    {
      char *__tmp;
      asprintf(&__tmp, "fuzzy mode"
                       "\n\r");
      cli_send(cli, __tmp, strlen(__tmp) + 1);
      free(__tmp);
    };
  }
  return (0);
}
```