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

```asm
<change_adapter_status>:
  endbr64
  push   %r15
  lea    D31(%rip),%rsi
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <mg_get_var@plt>
  lea    D0(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <mg_get_var@plt>
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <mg_get_var@plt>
  movl   $0x0,0x14(%rsp)
  test   %r13,%r13
  je     L87
  test   %r12,%r12
  je     L81
  mov    %rax,%r14
  test   %rax,%rax
  je     L80
  lea    0x14(%rsp),%rdx
  mov    %rax,%rsi
  mov    %r15,%rdi
  call   <squirrel_get_interface_status@plt>
  lea    D56(%rip),%rsi
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <strcmp@plt>
  mov    $0xffffffff,%r8d
  test   %rax,%rax
  jne    L158
L45:
  mov    %r8d,0xc(%rsp)
  lea    D1(%rip),%rsi
  mov    %r13,%rdi
  test   %ebx,%ebx
  jne    L152
  call   <strcmp@plt>
  mov    0xc(%rsp),%r8d
  test   %rax,%rax
  je     L139
L127:
  lea    D77(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <mg_printf@plt>
L80:
  mov    %r13,%rdi
  call   <free@plt>
L87:
  test   %r12,%r12
  je     L62
  mov    %r12,%rdi
  call   <free@plt>
L62:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L102
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L81:
  test   %r13,%r13
  je     L87
  jmp    L80
  nopw   0x0(%rax,%rax,1)
L152:
  call   <strcmp@plt>
  mov    0xc(%rsp),%r8d
  test   %rax,%rax
  jne    L49
  cmp    %r8d,0x14(%rsp)
  je     L127
  mov    %r14,%rsi
  mov    %r15,%rdi
  mov    %r8d,%ecx
  mov    $0x1,%edx
  mov    %r8d,0xc(%rsp)
  call   <squirrel_set_interface_status@plt>
  mov    0xc(%rsp),%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D3(%rip),%rsi
  call   <mg_printf@plt>
  jmp    L80
  nopl   0x0(%rax,%rax,1)
L158:
  movsbl (%r12),%edi
  call   <isdigit@plt>
  xor    %r8d,%r8d
  test   %rax,%rax
  je     L45
  mov    %r12,%rdi
  call   <atoi@plt>
  mov    %eax,%r8d
  jmp    L45
  cs nopw 0x0(%rax,%rax,1)
L49:
  mov    %r14,%rsi
  mov    %r15,%rdi
  xor    %ecx,%ecx
  xor    %edx,%edx
  call   <squirrel_set_interface_status@plt>
  lea    D55(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <mg_printf@plt>
  jmp    L80
  nopl   (%rax)
L139:
  mov    %r14,%rsi
  mov    %r15,%rdi
  mov    %r8d,0xc(%rsp)
  call   <launch_thread@plt>
  mov    0xc(%rsp),%ecx
  mov    %r14,%rsi
  mov    %r15,%rdi
  mov    $0x1,%edx
  call   <squirrel_set_interface_status@plt>
  mov    0xc(%rsp),%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D26(%rip),%rsi
  call   <mg_printf@plt>
  jmp    L80
L102:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D31
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D0
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D11
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D56
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D1
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D77
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D3
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D55
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D26
type_infered: string

tool: D31: status

tool: D0: channel

tool: D11: if

tool: D56: scan

tool: D1: monitor

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


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


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


tool: D26: <b>Turned on adapter, channel %u</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);
}
```