user: What is the c source code of the assembly code below?

```asm
<FSQLF_read_int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x48(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  movb   $0x1,-0x22(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L107
L61:
  mov    -0x38(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x21(%rbp)
  cmpb   $0x0,-0x22(%rbp)
  je     L83
  movsbl -0x21(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L83
  mov    $0x1,%eax
  jmp    L148
L83:
  mov    $0x0,%eax
L148:
  mov    %al,-0x22(%rbp)
  cmpb   $0x0,-0x22(%rbp)
  je     L125
  cmpb   $0x20,-0x21(%rbp)
  jne    L117
  addq   $0x1,-0x18(%rbp)
  jmp    L47
L117:
  mov    $0x0,%eax
  jmp    L37
L125:
  movsbl -0x21(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L74
  movsbl -0x21(%rbp),%eax
  sub    $0x30,%eax
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x9,-0x1c(%rbp)
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x1c(%rbp),%eax
  not    %eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    D19(%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,-0x20(%rbp)
  jg     L142
  mov    -0x20(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L137
L142:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
L137:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  sub    -0x1c(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jge    L168
  mov    -0x1c(%rbp),%eax
  add    %eax,-0x20(%rbp)
  jmp    L160
L168:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
L160:
  addq   $0x1,-0x18(%rbp)
  addq   $0x1,-0x10(%rbp)
L47:
  addq   $0x1,-0x8(%rbp)
L107:
  mov    -0x8(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jb     L61
  jmp    L166
L74:
  nop
L166:
  cmpq   $0x0,-0x10(%rbp)
  je     L49
  mov    -0x48(%rbp),%rax
  mov    -0x20(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  jmp    L37
L49:
  mov    $0x0,%eax
L37:
  leave
  ret
```

assistant: ```c
size_t FSQLF_read_int(const char *text, size_t lim, int *result) {
  assert(text != NULL);
  assert(result != NULL);
  size_t chars_read = 0;
  size_t digits_read = 0;
  int tmp_res = 0;
  char no_digit_yet = 1;
  for (size_t i = 0; i < lim; ++i) {
    char c = text[i];
    no_digit_yet = no_digit_yet && !isdigit(c);
    if (no_digit_yet) {
      if (c == ' ') {
        ++chars_read;
        continue;
      } else {
        return 0;
      }
    } else {
      if (isdigit(c)) {
        int digit = c - '0';
        assert(digit < 10);
        assert(digit >= 0);
        if (tmp_res <= INT_MAX / 10) {
          tmp_res *= 10;
        } else {
          tmp_res = INT_MAX;
        }
        if (tmp_res < INT_MAX - digit) {
          tmp_res += digit;
        } else {
          tmp_res = INT_MAX;
        }
        ++chars_read;
        ++digits_read;
      } else {
        break;
      }
    }
  }
  if (digits_read > 0) {
    *result = tmp_res;
    return chars_read;
  } else {
    return 0;
  }
}
```