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

```asm
<mode_str_to_int>:
  endbr64
  push   %rbp
  lea    D69(%rip),%rsi
  mov    %rdi,%rbp
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L61
L11:
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L61:
  lea    D128(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x2,%eax
  test   %r8,%r8
  je     L11
  lea    D47(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x4,%eax
  test   %r8,%r8
  je     L11
  lea    D104(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L79
  lea    D72(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L79
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L93
  lea    D40(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L93
  lea    D110(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L40
  lea    D137(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L40
  lea    D61(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  lea    D83(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  lea    D51(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L41
  lea    D22(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  jne    L11
L41:
  mov    $0x7,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L79:
  mov    $0x5,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L93:
  mov    $0x6,%eax
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L40:
  mov    $0x3,%eax
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: label: D69
type: string
name: read_data
arguments: label: D128
type: string
name: read_data
arguments: label: D47
type: string
name: read_data
arguments: label: D104
type: string
name: read_data
arguments: label: D72
type: string
name: read_data
arguments: label: D45
type: string
name: read_data
arguments: label: D40
type: string
name: read_data
arguments: label: D110
type: string
name: read_data
arguments: label: D137
type: string
name: read_data
arguments: label: D61
type: string
name: read_data
arguments: label: D5
type: string
name: read_data
arguments: label: D107
type: string
name: read_data
arguments: label: D83
type: string
name: read_data
arguments: label: D51
type: string
name: read_data
arguments: label: D22
type: string

tool: D69: a

tool: D128: w

tool: D47: r

tool: D104: ar

tool: D72: ra

tool: D45: rw

tool: D40: wr

tool: D110: aw

tool: D137: wa

tool: D61: rwa

tool: D5: raw

tool: D107: wra

tool: D83: war

tool: D51: arw

tool: D22: 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;
}
```