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

```asm
<mode_str_to_int>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    D75(%rip),%rsi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L131
L106:
  pop    %rbx
  ret
L131:
  lea    D84(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L106
  lea    D110(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x4,%eax
  test   %rdx,%rdx
  je     L106
  lea    D40(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x5,%eax
  test   %rdx,%rdx
  je     L106
  lea    D30(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x5,%eax
  test   %rdx,%rdx
  je     L106
  lea    D46(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x6,%eax
  test   %rdx,%rdx
  je     L106
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x6,%eax
  test   %rdx,%rdx
  je     L106
  lea    D19(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x3,%eax
  test   %rdx,%rdx
  je     L106
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x3,%eax
  test   %rdx,%rdx
  je     L106
  lea    D49(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x7,%eax
  test   %rdx,%rdx
  je     L106
  lea    D43(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x7,%eax
  test   %rdx,%rdx
  je     L106
  lea    D104(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x7,%eax
  test   %rdx,%rdx
  je     L106
  lea    D87(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x7,%eax
  test   %rdx,%rdx
  je     L106
  lea    D77(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x7,%eax
  test   %rdx,%rdx
  je     L106
  lea    D106(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0x7,%eax
  jmp    L106
```

tool_calls: name: read_data
arguments: label: D75
type_infered: string
name: read_data
arguments: label: D84
type_infered: string
name: read_data
arguments: label: D110
type_infered: string
name: read_data
arguments: label: D40
type_infered: string
name: read_data
arguments: label: D30
type_infered: string
name: read_data
arguments: label: D46
type_infered: string
name: read_data
arguments: label: D4
type_infered: string
name: read_data
arguments: label: D19
type_infered: string
name: read_data
arguments: label: D56
type_infered: string
name: read_data
arguments: label: D49
type_infered: string
name: read_data
arguments: label: D43
type_infered: string
name: read_data
arguments: label: D104
type_infered: string
name: read_data
arguments: label: D87
type_infered: string
name: read_data
arguments: label: D77
type_infered: string
name: read_data
arguments: label: D106
type_infered: string

tool: D75: a

tool: D84: w

tool: D110: r

tool: D40: ar

tool: D30: ra

tool: D46: rw

tool: D4: wr

tool: D19: aw

tool: D56: wa

tool: D49: rwa

tool: D43: raw

tool: D104: wra

tool: D87: war

tool: D77: arw

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