user: Demonstrate the C code that generates the assembly output below:

```asm
<mode_str_to_int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D80(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L98
  mov    $0x1,%eax
  jmp    L55
L98:
  mov    -0x8(%rbp),%rax
  lea    D125(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L102
  mov    $0x2,%eax
  jmp    L55
L102:
  mov    -0x8(%rbp),%rax
  lea    D42(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L114
  mov    $0x4,%eax
  jmp    L55
L114:
  mov    -0x8(%rbp),%rax
  lea    D24(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L97
  mov    $0x5,%eax
  jmp    L55
L97:
  mov    -0x8(%rbp),%rax
  lea    D140(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L80
  mov    $0x5,%eax
  jmp    L55
L80:
  mov    -0x8(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L227
  mov    $0x6,%eax
  jmp    L55
L227:
  mov    -0x8(%rbp),%rax
  lea    D60(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L220
  mov    $0x6,%eax
  jmp    L55
L220:
  mov    -0x8(%rbp),%rax
  lea    D146(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L208
  mov    $0x3,%eax
  jmp    L55
L208:
  mov    -0x8(%rbp),%rax
  lea    D52(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L177
  mov    $0x3,%eax
  jmp    L55
L177:
  mov    -0x8(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L193
  mov    $0x7,%eax
  jmp    L55
L193:
  mov    -0x8(%rbp),%rax
  lea    D69(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L162
  mov    $0x7,%eax
  jmp    L55
L162:
  mov    -0x8(%rbp),%rax
  lea    D108(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L233
  mov    $0x7,%eax
  jmp    L55
L233:
  mov    -0x8(%rbp),%rax
  lea    D82(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L289
  mov    $0x7,%eax
  jmp    L55
L289:
  mov    -0x8(%rbp),%rax
  lea    D51(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L137
  mov    $0x7,%eax
  jmp    L55
L137:
  mov    -0x8(%rbp),%rax
  lea    D137(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L7
  mov    $0x7,%eax
  jmp    L55
L7:
  mov    $0x0,%eax
L55:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D80
data_type: string
name: unpack_data
arguments: label: D125
data_type: string
name: unpack_data
arguments: label: D42
data_type: string
name: unpack_data
arguments: label: D24
data_type: string
name: unpack_data
arguments: label: D140
data_type: string
name: unpack_data
arguments: label: D44
data_type: string
name: unpack_data
arguments: label: D60
data_type: string
name: unpack_data
arguments: label: D146
data_type: string
name: unpack_data
arguments: label: D52
data_type: string
name: unpack_data
arguments: label: D9
data_type: string
name: unpack_data
arguments: label: D69
data_type: string
name: unpack_data
arguments: label: D108
data_type: string
name: unpack_data
arguments: label: D82
data_type: string
name: unpack_data
arguments: label: D51
data_type: string
name: unpack_data
arguments: label: D137
data_type: string

tool: D80: a

tool: D125: w

tool: D42: r

tool: D24: ar

tool: D140: ra

tool: D44: rw

tool: D60: wr

tool: D146: aw

tool: D52: wa

tool: D9: rwa

tool: D69: raw

tool: D108: wra

tool: D82: war

tool: D51: arw

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