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

```asm
<checkpri>:
  endbr64
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  cmp    $0x1,%esi
  je     L148
  cmp    $0x4,%esi
  je     L345
  cmp    $0x10,%esi
  je     L43
L188:
  cmp    $0x2,%r12d
  jg     L35
L231:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L148:
  lea    D89(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L31
  test   %r12d,%r12d
  je     L248
  lea    D59(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
L336:
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  cmp    $0x1,%r12d
  jne    L86
  test   %rax,%rax
  jne    L28
L86:
  cmp    $0x12,%ebx
  ja     L188
  mov    $0xfffffffffffbeff7,%rax
  bt     %rbx,%rax
  jb     L188
  nopl   0x0(%rax)
L35:
  mov    $0xffffffff,%r12d
  jmp    L231
L31:
  lea    D59(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L336
  test   %r12d,%r12d
  jne    L336
L204:
  xor    %r12d,%r12d
  cmp    $0xc,%ebx
  setne  %r12b
  neg    %r12d
  jmp    L231
  nopl   0x0(%rax,%rax,1)
L345:
  lea    D47(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L224
  test   %r12d,%r12d
  je     L23
L224:
  lea    D42(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L183
  cmp    $0x1,%r12d
  je     L126
L183:
  cmp    $0x1,%ebx
  je     L35
  cmp    $0xe,%ebx
  jne    L188
  jmp    L35
  nopl   0x0(%rax,%rax,1)
L43:
  lea    D81(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L315
  test   %r12d,%r12d
  je     L150
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
L6:
  lea    -0xc(%rbx),%edx
  cmp    $0x1,%edx
  ja     L188
  jmp    L35
  nopw   0x0(%rax,%rax,1)
L248:
  xor    %r12d,%r12d
  cmp    $0x3,%ebx
  setne  %r12b
  neg    %r12d
  jmp    L231
  nopw   0x0(%rax,%rax,1)
L315:
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L6
  test   %r12d,%r12d
  je     L204
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L23:
  xor    %r12d,%r12d
  cmp    $0x1,%ebx
  setne  %r12b
  neg    %r12d
  jmp    L231
  nopw   0x0(%rax,%rax,1)
L150:
  xor    %r12d,%r12d
  cmp    $0xd,%ebx
  setne  %r12b
  neg    %r12d
  jmp    L231
  nopw   0x0(%rax,%rax,1)
L126:
  cmp    $0xe,%ebx
  jne    L35
L121:
  mov    $0x1,%r12d
  jmp    L231
  nopl   0x0(%rax)
L28:
  cmp    $0x12,%ebx
  jne    L35
  jmp    L121
```

tool_calls: name: retrieve_data
arguments: label: D89
data_type: string
name: retrieve_data
arguments: label: D59
data_type: string
name: retrieve_data
arguments: label: D41
data_type: string
name: retrieve_data
arguments: label: D47
data_type: string
name: retrieve_data
arguments: label: D42
data_type: string
name: retrieve_data
arguments: label: D81
data_type: string
name: retrieve_data
arguments: label: D14
data_type: string

tool: D89: -GL1W

tool: D59: -GL1X

tool: D41: -GL2X

tool: D47: -RL1C

tool: D42: -RL2C

tool: D81: -JL1Z

tool: D14: -JL1X

assistant: ```c
int checkpri(const char *opt, int sys, int code, int freq) {
  int nex = 0;
  if (sys == 0x01) {
    if (strstr(opt, "-GL1W") && freq == 0)
      return code == 3 ? 0 : -1;
    if (strstr(opt, "-GL1X") && freq == 0)
      return code == 12 ? 0 : -1;
    if (strstr(opt, "-GL2X") && freq == 1)
      return code == 18 ? 1 : -1;
    if (code == 3)
      return nex < 1 ? -1 : 3;
    if (code == 18)
      return nex < 2 ? -1 : 3 + 1;
    if (code == 12)
      return nex < 3 ? -1 : 3 + 2;
  } else if (sys == 0x04) {
    if (strstr(opt, "-RL1C") && freq == 0)
      return code == 1 ? 0 : -1;
    if (strstr(opt, "-RL2C") && freq == 1)
      return code == 14 ? 1 : -1;
    if (code == 1)
      return nex < 1 ? -1 : 3;
    if (code == 14)
      return nex < 2 ? -1 : 3 + 1;
  } else if (sys == 0x10) {
    if (strstr(opt, "-JL1Z") && freq == 0)
      return code == 13 ? 0 : -1;
    if (strstr(opt, "-JL1X") && freq == 0)
      return code == 12 ? 0 : -1;
    if (code == 13)
      return nex < 1 ? -1 : 3;
    if (code == 12)
      return nex < 2 ? -1 : 3 + 1;
  }
  return freq < 3 ? freq : -1;
}
```