user: Converte this assembly snippet into its equivalent C code:

```asm
<myAtoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  movl   $0x1,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L2
L65:
  cmpl   $0x0,-0x10(%rbp)
  jne    L46
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x30,%eax
  je     L43
  cmp    $0x30,%eax
  jg     L46
  cmp    $0x2d,%eax
  je     L70
  cmp    $0x2d,%eax
  jg     L46
  cmp    $0x20,%eax
  je     L43
  cmp    $0x2b,%eax
  je     L89
  jmp    L46
L70:
  movl   $0xffffffff,-0x18(%rbp)
  jmp    L52
L46:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L159
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L159
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0x18(%rbp)
  jne    L138
  mov    D37(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x14(%rbp)
  jg     L79
  mov    -0x14(%rbp),%eax
  imul   $0xfffffff6,%eax,%edx
  mov    D37(%rip),%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L138
L79:
  mov    D37(%rip),%rax
  mov    (%rax),%eax
  jmp    L109
L138:
  cmpl   $0xffffffff,-0x18(%rbp)
  jne    L154
  mov    -0x14(%rbp),%eax
  neg    %eax
  mov    %eax,%ecx
  mov    D44(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  cmp    %eax,%ecx
  jl     L82
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    D44(%rip),%rax
  mov    (%rax),%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  neg    %eax
  cmp    %eax,%edx
  jl     L154
L82:
  mov    D44(%rip),%rax
  mov    (%rax),%eax
  jmp    L109
L154:
  mov    -0x14(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L52
L89:
  nop
L52:
  addl   $0x1,-0x10(%rbp)
  jmp    L86
L43:
  nop
L86:
  addq   $0x1,-0x8(%rbp)
L2:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L65
L159:
  mov    -0x14(%rbp),%eax
  imul   -0x18(%rbp),%eax
L109:
  pop    %rbp
  ret
```

assistant: ```c
int myAtoi(char *str) {
  int sign = 1, integer = 0;
  int i = 0;
  char *c = str;
  int tmp = 0;
  while (*c != '\0') {
    if (i == 0) {
      switch (*c) {
      case ' ':
      case '0':
        goto NEXT_CHAR;
      case '-':
        sign = -1;
        goto CONTINUE;
      case '+':
        goto CONTINUE;
      }
    }
    if (*c >= '0' && *c <= '9') {
      tmp = *c - '0';
      if (sign == 1) {
        if (integer > INT_MAX / 10 || INT_MAX - integer * 10 <= tmp) {
          return INT_MAX;
        }
      }
      if (sign == -1) {
        if (-integer < INT_MIN / 10 || INT_MIN + integer * 10 >= -tmp) {
          return INT_MIN;
        }
      }
      integer = integer * 10 + (*c - '0');
    } else {
      break;
    }
  CONTINUE:
    i++;
  NEXT_CHAR:
    c++;
  }
  return integer * sign;
}
```