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

```asm
<atoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x1,-0x4(%rbp)
  jmp    L160
L263:
  addq   $0x1,-0x18(%rbp)
L160:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L177
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L263
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L263
L177:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L287
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L287
  addq   $0x1,-0x18(%rbp)
L287:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L12
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L12
  addq   $0x1,-0x18(%rbp)
  movl   $0xffffffff,-0x4(%rbp)
L12:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L281
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x24,%al
  jne    L281
  addq   $0x1,-0x18(%rbp)
  jmp    L35
L4:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L238
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L238
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L283
L238:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L3
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L3
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x57,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L283
L3:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L283
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L283
  mov    -0x8(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x37,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
L283:
  addq   $0x1,-0x18(%rbp)
L35:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L222
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L225
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L4
L225:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L31
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jle    L4
L31:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L222
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jle    L4
  jmp    L222
L236:
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  addq   $0x1,-0x18(%rbp)
L281:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L144
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L144
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L236
  jmp    L144
L222:
  nop
L144:
  mov    -0x4(%rbp),%eax
  imul   -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int atoi(const char *s) {
  int result = 0;
  int sign = 1;
  while ((*s) && ((*s == ' ') || (*s == '\t'))) {
    s++;
  }
  if ((*s) && (*s == '+')) {
    s++;
  }
  if ((*s) && (*s == '-')) {
    s++;
    sign = -1;
  }
  if ((*s) && (*s == '$')) {
    s++;
    while ((*s) && (((*s >= '0') && (*s <= '9')) || ((*s >= 'a') && (*s <= 'f')) || ((*s >= 'A') && (*s <= 'F')))) {
      if ((*s >= '0') && (*s <= '9'))
        result = 16 * result + (*s - '0');
      else if ((*s >= 'a') && (*s <= 'f'))
        result = 16 * result + (*s - 'a' + 10);
      else if ((*s >= 'A') && (*s <= 'F'))
        result = 16 * result + (*s - 'A' + 10);
      s++;
    }
  } else {
    while ((*s) && (*s >= '0') && (*s <= '9')) {
      result = 10 * result + (*s - '0');
      s++;
    }
  }
  return sign * result;
}
```