user: What would the C source look like for the assembly code provided here:

```asm
<htoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  movb   $0x0,-0x29(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  sete   %al
  movzbl %al,%eax
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L120
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L53
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L120
L53:
  addq   $0x2,-0x28(%rbp)
L120:
  movq   $0x0,-0x20(%rbp)
  jmp    L12
L152:
  addq   $0x1,-0x20(%rbp)
L12:
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L152
  movq   $0x0,-0x18(%rbp)
  jmp    L60
L50:
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L16
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L16
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x30(%rax),%ebx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x10,%edi
  call   <pow@plt>
  imul   %ebx,%eax
  mov    %eax,%edx
  movzbl -0x29(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x29(%rbp)
  jmp    L118
L16:
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L117
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jg     L117
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x57(%rax),%ebx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x10,%edi
  call   <pow@plt>
  imul   %ebx,%eax
  mov    %eax,%edx
  movzbl -0x29(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x29(%rbp)
  jmp    L118
L117:
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L95
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  jg     L95
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x37(%rax),%ebx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x10,%edi
  call   <pow@plt>
  imul   %ebx,%eax
  mov    %eax,%edx
  movzbl -0x29(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x29(%rbp)
  jmp    L118
L95:
  mov    $0x0,%eax
  jmp    L177
L118:
  subq   $0x1,-0x20(%rbp)
  addq   $0x1,-0x18(%rbp)
L60:
  mov    -0x20(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  ja     L50
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L185
  movzbl -0x29(%rbp),%eax
  neg    %eax
  jmp    L177
L185:
  movzbl -0x29(%rbp),%eax
L177:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int32_t htoi(char *string) {
  int32_t value = 0;
  uint32_t start_position = string[0] == '-' ? 1 : 0;
  if (string[start_position] == '0' && (string[start_position + 1] == 'x' || string[start_position + 1] == 'X')) {
    start_position += 2;
  }
  uint32_t i = 0;
  for (; string[i] != '\0'; i++)
    ;
  for (uint32_t j = 0; i > start_position; i--, j++) {
    if (string[i - 1] >= '0' && string[i - 1] <= '9') {
      value += (string[i - 1] - '0') * (int)pow(16, j);
    } else if (string[i - 1] >= 'a' && string[i - 1] <= 'f') {
      value += ((string[i - 1] - 'a') + 10) * (int)pow(16, j);
    } else if (string[i - 1] >= 'A' && string[i - 1] <= 'F') {
      value += ((string[i - 1] - 'A') + 10) * (int)pow(16, j);
    } else {
      return 0;
    }
  }
  return string[0] == '-' ? -(value) : value;
}
```