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

```asm
<GetMinMaxFields>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x30(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  movl   $0x0,(%rax)
  cmpq   $0x0,-0x28(%rbp)
  je     L76
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L76
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L176
L9:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
L176:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L9
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L29
  lea    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    -0x30(%rbp),%rdx
  mov    %eax,(%rdx)
L29:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L41
L92:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L18
  mov    -0x38(%rbp),%rax
  mov    -0x14(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L18
L143:
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
L18:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L65
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L143
L65:
  mov    -0x10(%rbp),%rax
  test   %rax,%rax
  je     L76
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L76
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L99
  mov    -0x10(%rbp),%rax
  lea    -0x10(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jle    L41
  mov    -0x38(%rbp),%rax
  mov    -0x14(%rbp),%edx
  mov    %edx,(%rax)
L41:
  mov    -0x10(%rbp),%rax
  test   %rax,%rax
  je     L76
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L92
  jmp    L76
L99:
  nop
L76:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
void GetMinMaxFields(const char *FieldSpec, int *MinField, int *MaxField) {
  const char *ptr;
  int val;
  *MinField = 0;
  *MaxField = 0;
  if ((FieldSpec ? strlen(FieldSpec) : 0)) {
    ptr = FieldSpec;
    while (isspace(*ptr))
      ptr++;
    if (isdigit(*ptr))
      *MinField = strtol(FieldSpec, (char **)&ptr, 10);
    val = *MinField;
    while (ptr && (*ptr != '0')) {
      if (val > *MaxField)
        *MaxField = val;
      while ((!isdigit(*ptr)) && (*ptr != '\0'))
        ptr++;
      if (!(ptr ? strlen(ptr) : 0))
        break;
      if (!isdigit(*ptr))
        break;
      val = strtol(ptr, (char **)&ptr, 10);
      if (val > *MaxField)
        *MaxField = val;
    }
  }
}
```