user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<change_adapter_status>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x48(%rbp),%rax
  lea    D77(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <mg_get_var@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  lea    D66(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <mg_get_var@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x48(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <mg_get_var@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x34(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L137
  cmpq   $0x0,-0x18(%rbp)
  je     L137
  cmpq   $0x0,-0x10(%rbp)
  je     L137
  lea    -0x34(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <squirrel_get_interface_status@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%rax
  lea    D24(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L98
  movl   $0xffffffff,-0x30(%rbp)
  jmp    L7
L98:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L61
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x30(%rbp)
  jmp    L7
L61:
  movl   $0x0,-0x30(%rbp)
L7:
  cmpl   $0x0,-0x2c(%rbp)
  je     L126
  mov    -0x20(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L126
  mov    -0x10(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <squirrel_set_interface_status@plt>
  mov    -0x48(%rbp),%rax
  lea    D26(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mg_printf@plt>
  jmp    L137
L126:
  cmpl   $0x0,-0x2c(%rbp)
  jne    L157
  mov    -0x20(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L157
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <launch_thread@plt>
  mov    -0x30(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <squirrel_set_interface_status@plt>
  mov    -0x30(%rbp),%edx
  mov    -0x48(%rbp),%rax
  lea    D4(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mg_printf@plt>
  jmp    L137
L157:
  cmpl   $0x0,-0x2c(%rbp)
  je     L161
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  je     L161
  mov    -0x30(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <squirrel_set_interface_status@plt>
  mov    -0x30(%rbp),%edx
  mov    -0x48(%rbp),%rax
  lea    D95(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mg_printf@plt>
  jmp    L137
L161:
  mov    -0x48(%rbp),%rax
  lea    D82(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mg_printf@plt>
L137:
  cmpq   $0x0,-0x20(%rbp)
  je     L174
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L174:
  cmpq   $0x0,-0x18(%rbp)
  je     L182
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L182:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L136
  call   <__stack_chk_fail@plt>
L136:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D77
type_guessed: string
name: extract_symbolic_data
arguments: label: D66
type_guessed: string
name: extract_symbolic_data
arguments: label: D46
type_guessed: string
name: extract_symbolic_data
arguments: label: D24
type_guessed: string
name: extract_symbolic_data
arguments: label: D72
type_guessed: string
name: extract_symbolic_data
arguments: label: D26
type_guessed: string
name: extract_symbolic_data
arguments: label: D4
type_guessed: string
name: extract_symbolic_data
arguments: label: D95
type_guessed: string
name: extract_symbolic_data
arguments: label: D82
type_guessed: string

tool: D77: status

tool: D66: channel

tool: D46: if

tool: D24: scan

tool: D72: monitor

tool: D26: <b>Turned off adapter</b>


tool: D4: <b>Turned on adapter, channel %u</b>


tool: D95: <b>Changed channel to %u</b>


tool: D82: <b>Nothing changed</b>


assistant: ```c
void change_adapter_status(struct mg_connection *c, const struct mg_request_info *ri, void *user_data) {
  struct Squirrel *squirrel = (struct Squirrel *)user_data;
  char *status = mg_get_var(c, "status");
  char *channel = mg_get_var(c, "channel");
  char *adapter_name = mg_get_var(c, "if");
  unsigned interface_channel = 0;
  if (status && channel && adapter_name) {
    unsigned is_running = squirrel_get_interface_status(squirrel, adapter_name, &interface_channel);
    unsigned new_channel;
    if (strcmp(channel, "scan") == 0)
      new_channel = (unsigned)-1;
    else if (isdigit(channel[0]))
      new_channel = atoi(channel);
    else
      new_channel = 0;
    if (is_running && strcmp(status, "monitor") != 0) {
      squirrel_set_interface_status(squirrel, adapter_name, 0, 0);
      mg_printf(c, "<b>Turned off adapter</b>\n");
    } else if (!is_running && strcmp(status, "monitor") == 0) {
      launch_thread(squirrel, adapter_name);
      squirrel_set_interface_status(squirrel, adapter_name, 1, new_channel);
      mg_printf(c, "<b>Turned on adapter, channel %u</b>\n", new_channel);
    } else if (is_running && interface_channel != new_channel) {
      squirrel_set_interface_status(squirrel, adapter_name, 1, new_channel);
      mg_printf(c, "<b>Changed channel to %u</b>\n", new_channel);
    } else
      mg_printf(c, "<b>Nothing changed</b>\n");
  }
  if (status)
    free(status);
  if (channel)
    free(channel);
}
```