user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mode_str_to_int>:
  endbr64
  push   %rbp
  lea    D114(%rip),%rsi
  mov    %rdi,%rbp
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L40
L62:
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L40:
  lea    D25(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x2,%eax
  test   %r8,%r8
  je     L62
  lea    D72(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x4,%eax
  test   %r8,%r8
  je     L62
  lea    D104(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L38
  lea    D20(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L38
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L61
  lea    D82(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L61
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L134
  lea    D38(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L134
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  lea    D57(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  lea    D46(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  lea    D17(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L45
  lea    D117(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  jne    L62
L45:
  mov    $0x7,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L38:
  mov    $0x5,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L61:
  mov    $0x6,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L134:
  mov    $0x3,%eax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D114
datatype: string
name: extract_symbolic_data
arguments: data_tag: D25
datatype: string
name: extract_symbolic_data
arguments: data_tag: D72
datatype: string
name: extract_symbolic_data
arguments: data_tag: D104
datatype: string
name: extract_symbolic_data
arguments: data_tag: D20
datatype: string
name: extract_symbolic_data
arguments: data_tag: D45
datatype: string
name: extract_symbolic_data
arguments: data_tag: D82
datatype: string
name: extract_symbolic_data
arguments: data_tag: D64
datatype: string
name: extract_symbolic_data
arguments: data_tag: D38
datatype: string
name: extract_symbolic_data
arguments: data_tag: D39
datatype: string
name: extract_symbolic_data
arguments: data_tag: D57
datatype: string
name: extract_symbolic_data
arguments: data_tag: D58
datatype: string
name: extract_symbolic_data
arguments: data_tag: D46
datatype: string
name: extract_symbolic_data
arguments: data_tag: D17
datatype: string
name: extract_symbolic_data
arguments: data_tag: D117
datatype: string

tool: D114: a

tool: D25: w

tool: D72: r

tool: D104: ar

tool: D20: ra

tool: D45: rw

tool: D82: wr

tool: D64: aw

tool: D38: wa

tool: D39: rwa

tool: D57: raw

tool: D58: wra

tool: D46: war

tool: D17: arw

tool: D117: awr

assistant: ```c
int mode_str_to_int(const char *mode) {
  if (strcmp(mode, "a") == 0) {
    return 1;
  }
  if (strcmp(mode, "w") == 0) {
    return 2;
  }
  if (strcmp(mode, "r") == 0) {
    return 4;
  }
  if (strcmp(mode, "ar") == 0) {
    return 4 | 1;
  }
  if (strcmp(mode, "ra") == 0) {
    return 4 | 1;
  }
  if (strcmp(mode, "rw") == 0) {
    return 4 | 2;
  }
  if (strcmp(mode, "wr") == 0) {
    return 4 | 2;
  }
  if (strcmp(mode, "aw") == 0) {
    return 1 | 2;
  }
  if (strcmp(mode, "wa") == 0) {
    return 2 | 1;
  }
  if (strcmp(mode, "rwa") == 0) {
    return 4 | 2 | 1;
  }
  if (strcmp(mode, "raw") == 0) {
    return 4 | 1 | 2;
  }
  if (strcmp(mode, "wra") == 0) {
    return 2 | 4 | 1;
  }
  if (strcmp(mode, "war") == 0) {
    return 2 | 1 | 4;
  }
  if (strcmp(mode, "arw") == 0) {
    return 1 | 4 | 2;
  }
  if (strcmp(mode, "awr") == 0) {
    return 1 | 2 | 4;
  }
  return 0;
}
```