user: 请从给定的汇编指令推导出C源代码:

```asm
<set_operation_mode>:
  endbr64
  lea    D80(%rip),%rax
  test   %edx,%edx
  lea    D22(%rip),%rcx
  push   %r14
  mov    %rax,%r8
  push   %r13
  lea    D12(%rip),%r13
  cmove  %rcx,%r8
  test   %esi,%esi
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  cmovne %rax,%rcx
  mov    %edx,%ebp
  test   %edi,%edi
  push   %rbx
  lea    D78(%rip),%rax
  lea    D68(%rip),%rdx
  mov    %esi,%ebx
  cmovne %rax,%rdx
  mov    %r13,%rsi
  lea    D52(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0x1,%ebp
  ja     L107
  lea    D71(%rip),%r14
  cmp    $0x1,%ebx
  ja     L45
  xor    %eax,%eax
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <wait_for_bridge_setup@plt>
  cmp    %ebx,%ebp
  jne    L27
L3:
  test   %ebp,%ebp
  je     L84
L63:
  cmp    $0x1,%ebp
  jne    L83
  mov    $0x1,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <set_opmode_sta@plt>
L92:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L27:
  test   %ebp,%ebp
  jne    L63
  mov    %r12d,%edi
  xor    %esi,%esi
  xor    %eax,%eax
  call   <set_opmode_ap@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L45:
  mov    $0x132,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  mov    %r13,%rdx
  call   <printf@plt>
  xor    %eax,%eax
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <wait_for_bridge_setup@plt>
  cmp    %ebx,%ebp
  je     L3
  jmp    L27
  nopl   0x0(%rax)
L107:
  lea    D71(%rip),%r14
  xor    %eax,%eax
  mov    %r13,%rdx
  mov    $0x131,%esi
  mov    %r14,%rdi
  call   <printf@plt>
  cmp    $0x1,%ebx
  ja     L45
  mov    %ebp,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  call   <wait_for_bridge_setup@plt>
L83:
  lea    D56(%rip),%rdi
  call   <puts@plt>
  pop    %rbx
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L84:
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  call   <nvram_safe_get@plt>
  mov    %eax,%edi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jle    L92
  nopl   0x0(%rax)
L64:
  mov    %ebp,%esi
  mov    %r12d,%edi
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <set_ap_security@plt>
  cmp    %ebp,%ebx
  jne    L64
  jmp    L92
```

tool_calls: name: retrieve_data
arguments: data_tag: D80
type_guessed: string
name: retrieve_data
arguments: data_tag: D22
type_guessed: string
name: retrieve_data
arguments: data_tag: D12
type_guessed: string
name: retrieve_data
arguments: data_tag: D78
type_guessed: string
name: retrieve_data
arguments: data_tag: D68
type_guessed: string
name: retrieve_data
arguments: data_tag: D52
type_guessed: string
name: retrieve_data
arguments: data_tag: D71
type_guessed: string
name: retrieve_data
arguments: data_tag: D56
type_guessed: string
name: retrieve_data
arguments: data_tag: D75
type_guessed: string

tool: D80: WLAN_MODE_STA

tool: D22: WLAN_MODE_AP

tool: D12: set_operation_mode

tool: D78: RADIO_5G

tool: D68: RADIO_2G

tool: D52: %s(%s, %s, %s)


tool: D71: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/liutianpingyanxiaoyu/cpe/refs/heads/master/package/liteon-apps/wlan-middleware/src/mid_func.c:%u:%s: Error:Such wlan mode is not supported currently


tool: D56: Error:Such wlan mode is not supported current, please check it

tool: D75: wlv_rule_max

assistant: ```c
int set_operation_mode(int radio, int mode_prev, int mode_curr) {
  int ssid_num = 0;
  int i;
  printf("%s(%s, %s, %s)\r\n", __FUNCTION__, radio == 0 ? "RADIO_2G" : "RADIO_5G", mode_prev == 0 ? "WLAN_MODE_AP" : "WLAN_MODE_STA", mode_curr == 0 ? "WLAN_MODE_AP" : "WLAN_MODE_STA");
  do {
    if (!((0 == mode_curr) || (1 == mode_curr)))
      printf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/liutianpingyanxiaoyu/cpe/refs/heads/master/package/liteon-apps/wlan-middleware/src/mid_func.c"
             ":%u:%s: "
             "Error:Such wlan mode is not supported currently"
             "\n",
             305, __FUNCTION__);
  } while (0);
  do {
    if (!((0 == mode_prev) || (1 == mode_prev)))
      printf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/liutianpingyanxiaoyu/cpe/refs/heads/master/package/liteon-apps/wlan-middleware/src/mid_func.c"
             ":%u:%s: "
             "Error:Such wlan mode is not supported currently"
             "\n",
             306, __FUNCTION__);
  } while (0);
  wait_for_bridge_setup(radio, mode_curr);
  if ((mode_prev == mode_curr) && (mode_curr == 0)) {
    ssid_num = atoi(nvram_safe_get("wlv_rule_max"));
    for (i = 0; i < ssid_num; i++) {
      set_ap_security(radio, i);
    }
    return 0;
  }
  switch (mode_curr) {
  case 0:
    set_opmode_ap(radio, mode_curr);
    break;
  case 1:
    set_opmode_sta(radio, mode_curr);
    break;
  default:
    printf("Error:Such wlan mode is not supported current, please check it\n");
    return -1;
  }
  return 0;
}
```