user: Please show me the C implementation that matches the assembly code listed below:

```asm
<check_simple_cast>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%rbp
  lea    D5(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L73
L70:
  mov    $0x8,%eax
L117:
  mov    %eax,(%r12)
  cmpb   $0x73,0x1(%rbx)
  sete   %al
  movzbl %al,%eax
  mov    %eax,0x0(%rbp)
  mov    $0x0,%eax
L1:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L73:
  lea    D42(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L70
  lea    D77(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L46
L101:
  mov    $0x10,%eax
  jmp    L117
L46:
  lea    D55(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L101
  lea    D54(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L71
L75:
  mov    $0x20,%eax
  jmp    L117
L71:
  lea    D1(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L75
  lea    D4(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L15
L4:
  mov    $0x40,%eax
  jmp    L117
L15:
  lea    D39(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L4
  mov    $0xffffffff,%eax
  jmp    L1
```

tool_calls: name: read_data
arguments: data_label: D5
type: string
name: read_data
arguments: data_label: D42
type: string
name: read_data
arguments: data_label: D77
type: string
name: read_data
arguments: data_label: D55
type: string
name: read_data
arguments: data_label: D54
type: string
name: read_data
arguments: data_label: D1
type: string
name: read_data
arguments: data_label: D4
type: string
name: read_data
arguments: data_label: D39
type: string

tool: D5: (s8)

tool: D42: (u8)

tool: D77: (s16)

tool: D55: (u16)

tool: D54: (s32)

tool: D1: (u32)

tool: D4: (s64)

tool: D39: (u64)

assistant: ```c
int check_simple_cast(const char *cast, int *bits, int *is_signed) {
  if (!strncmp(cast, "(s8)", strlen("(s8)")) || !strncmp(cast, "(u8)", strlen("(u8)")))
    *bits = 8;
  else if (!strncmp(cast, "(s16)", strlen("(s16)")) || !strncmp(cast, "(u16)", strlen("(u16)")))
    *bits = 16;
  else if (!strncmp(cast, "(s32)", strlen("(s32)")) || !strncmp(cast, "(u32)", strlen("(u32)")))
    *bits = 32;
  else if (!strncmp(cast, "(s64)", strlen("(s64)")) || !strncmp(cast, "(u64)", strlen("(u64)")))
    *bits = 64;
  else
    return -1;
  *is_signed = cast[1] == 's' ? 1 : 0;
  return 0;
}
```