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

```asm
<luhn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L58
L38:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L61
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L61
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L102
L61:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L45
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
L45:
  addq   $0x1,-0x10(%rbp)
L58:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L38
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  cmpl   $0x1,-0x20(%rbp)
  jg     L20
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L102
L20:
  movl   $0x0,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L101
L84:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x18(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L54
  shll   -0x14(%rbp)
  cmpl   $0x9,-0x14(%rbp)
  jle    L54
  subl   $0x9,-0x14(%rbp)
L54:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x1c(%rbp)
  subl   $0x1,-0x18(%rbp)
L101:
  cmpl   $0x0,-0x18(%rbp)
  jns    L84
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x1c(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  test   %edx,%edx
  sete   %al
  movzbl %al,%eax
L102:
  leave
  ret
```

assistant: ```c
bool luhn(const char *input) {
  int length = 0;
  char *data = malloc(strlen(input));
  for (size_t i = 0; input[i] != '\0'; ++i) {
    if (!(isdigit(input[i]) || isspace(input[i]))) {
      free(data);
      return false;
    }
    if (!isspace(input[i]))
      data[length++] = input[i];
  }
  data[length] = '\0';
  if (length <= 1) {
    free(data);
    return false;
  }
  int sum = 0;
  for (int i = length - 1; i >= 0; --i) {
    int x = data[i] - '0';
    if ((length - i) % 2 == 0) {
      x *= 2;
      if (x > 9)
        x -= 9;
    }
    sum += x;
  }
  free(data);
  return sum % 10 == 0;
}
```