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

```asm
<my_atoi>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  movzbl (%rdi),%edi
  cmp    $0x30,%dil
  je     L102
  cmp    $0x2d,%dil
  je     L139
  mov    $0x0,%ebp
  test   %dil,%dil
  je     L24
L209:
  movsbl %dil,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L24
  lea    0x0(%rbp,%rbp,4),%edx
  movsbl (%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%ebp
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L209
L24:
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L102:
  movzbl 0x1(%rbx),%esi
  mov    %esi,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  je     L14
  add    $0x1,%rbx
  mov    $0x0,%ebp
  lea    D21(%rip),%r12
  test   %sil,%sil
  je     L24
L89:
  movsbl %sil,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L24
  movsbl (%rbx),%eax
  lea    -0x30(%rax,%rbp,8),%ebp
  add    $0x1,%rbx
  movzbl (%rbx),%esi
  test   %sil,%sil
  jne    L89
  jmp    L24
L14:
  lea    0x2(%rbx),%r12
  movzbl 0x2(%rbx),%edi
  test   %dil,%dil
  je     L99
  mov    $0x0,%ebp
  lea    D19(%rip),%rbx
  lea    D25(%rip),%r13
  jmp    L42
L94:
  movsbl (%r12),%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L153
  shl    $0x4,%ebp
  movsbl (%r12),%eax
  lea    -0x37(%rbp,%rax,1),%ebp
L75:
  add    $0x1,%r12
  movzbl (%r12),%edi
  test   %dil,%dil
  je     L24
L42:
  movsbl %dil,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L94
  shl    $0x4,%ebp
  movsbl (%r12),%eax
  lea    -0x30(%rbp,%rax,1),%ebp
  jmp    L75
L153:
  movsbl (%r12),%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L24
  shl    $0x4,%ebp
  movsbl (%r12),%eax
  lea    -0x57(%rbp,%rax,1),%ebp
  jmp    L75
L139:
  add    $0x1,%rbx
  mov    $0x0,%ebp
L147:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L183
  lea    0x0(%rbp,%rbp,4),%edx
  movsbl (%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%ebp
  add    $0x1,%rbx
  jmp    L147
L183:
  neg    %ebp
  jmp    L24
L99:
  mov    $0x0,%ebp
  jmp    L24
```

tool_calls: name: retrieve_data
arguments: data_label: D21
type_guessed: string
name: retrieve_data
arguments: data_label: D19
type_guessed: string
name: retrieve_data
arguments: data_label: D25
type_guessed: string

tool: D21: 01234567

tool: D19: ABCDEF

tool: D25: abcdef

assistant: ```c
int my_atoi(const char *s) {
  int a = 0;
  if (*s == '0') {
    s++;
    if (*s == 'x' || *s == 'X') {
      s++;
      while (*s) {
        if (isdigit(*s))
          a = (a << 4) + *s - '0';
        else if (strchr("ABCDEF", *s))
          a = (a << 4) + *s - 'A' + 10;
        else if (strchr("abcdef", *s))
          a = (a << 4) + *s - 'a' + 10;
        else
          return a;
        s++;
      }
      return a;
    }
    while (*s) {
      if (strchr("01234567", *s))
        a = (a << 3) + *s - '0';
      else
        return a;
      s++;
    }
    return a;
  }
  if (*s == '-') {
    s++;
    for (;;) {
      if (isdigit(*s))
        a = (a * 10) + *s - '0';
      else
        return -a;
      s++;
    }
  }
  while (*s) {
    if (isdigit(*s))
      a = (a * 10) + *s - '0';
    else
      return a;
    s++;
  }
  return a;
}
```