user: 请将以下的汇编代码转换成C语言代码:

```asm
<proto_redistnum>:
  endbr64
  test   %rsi,%rsi
  je     L101
  push   %rbp
  mov    %rsi,%rbp
  cmp    $0x1,%edi
  je     L156
  cmp    $0x2,%edi
  jne    L186
  mov    $0x1,%edx
  lea    D13(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L64
L67:
  mov    $0x1,%eax
L43:
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L64:
  mov    $0x1,%edx
  lea    D71(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L52
  mov    $0x1,%edx
  lea    D36(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L105
  mov    $0x1,%edx
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x5,%eax
  test   %r8,%r8
  je     L43
  mov    $0x1,%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x7,%eax
  test   %r8,%r8
  je     L43
  mov    $0x1,%edx
  lea    D72(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L187
  mov    $0x2,%edx
  lea    D2(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L13
  mov    $0x2,%edx
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L45
L186:
  mov    $0xffffffff,%eax
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L156:
  mov    $0x1,%edx
  lea    D13(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L67
  mov    $0x1,%edx
  lea    D71(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L52
  mov    $0x1,%edx
  lea    D36(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L105
  mov    $0x1,%edx
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x4,%eax
  test   %r8,%r8
  je     L43
  mov    $0x1,%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0x6,%eax
  test   %r8,%r8
  je     L43
  mov    $0x1,%edx
  lea    D72(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L187
  mov    $0x2,%edx
  lea    D2(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L13
  mov    $0x2,%edx
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L186
L45:
  mov    $0xc,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L105:
  mov    $0x3,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L52:
  mov    $0x2,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L187:
  mov    $0x8,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L13:
  mov    $0x9,%eax
  pop    %rbp
  ret
L101:
  or     $0xffffffff,%eax
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
type: string
name: extract_symbolic_data
arguments: data_label: D71
type: string
name: extract_symbolic_data
arguments: data_label: D36
type: string
name: extract_symbolic_data
arguments: data_label: D64
type: string
name: extract_symbolic_data
arguments: data_label: D58
type: string
name: extract_symbolic_data
arguments: data_label: D72
type: string
name: extract_symbolic_data
arguments: data_label: D2
type: string
name: extract_symbolic_data
arguments: data_label: D41
type: string

tool: D13: k

tool: D71: c

tool: D36: s

tool: D64: r

tool: D58: o

tool: D72: i

tool: D2: bg

tool: D41: ba

assistant: ```c
int proto_redistnum(int afi, const char *s) {
  if (!s)
    return -1;
  if (afi == 1) {
    if (strncmp(s, "k", 1) == 0)
      return 1;
    else if (strncmp(s, "c", 1) == 0)
      return 2;
    else if (strncmp(s, "s", 1) == 0)
      return 3;
    else if (strncmp(s, "r", 1) == 0)
      return 4;
    else if (strncmp(s, "o", 1) == 0)
      return 6;
    else if (strncmp(s, "i", 1) == 0)
      return 8;
    else if (strncmp(s, "bg", 2) == 0)
      return 9;
    else if (strncmp(s, "ba", 2) == 0)
      return 12;
  }
  if (afi == 2) {
    if (strncmp(s, "k", 1) == 0)
      return 1;
    else if (strncmp(s, "c", 1) == 0)
      return 2;
    else if (strncmp(s, "s", 1) == 0)
      return 3;
    else if (strncmp(s, "r", 1) == 0)
      return 5;
    else if (strncmp(s, "o", 1) == 0)
      return 7;
    else if (strncmp(s, "i", 1) == 0)
      return 8;
    else if (strncmp(s, "bg", 2) == 0)
      return 9;
    else if (strncmp(s, "ba", 2) == 0)
      return 12;
  }
  return -1;
}
```