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

```asm
<input_get_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x30(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <input_get@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L150
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <error_log@plt>
  mov    $0xffffffff,%eax
  jmp    L84
L150:
  cmpl   $0x0,-0x1c(%rbp)
  jle    L111
  mov    -0x10(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L111
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L111
  mov    -0x10(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L111
  subl   $0x1,-0x1c(%rbp)
L111:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L22
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <error_log@plt>
  mov    $0xffffffff,%eax
  jmp    L84
L22:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x28(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L59
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <error_log@plt>
  mov    $0xffffffff,%eax
  jmp    L84
L59:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L82
L65:
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L77
  mov    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%eax
  cltq
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L93
L77:
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <error_log@plt>
  mov    $0xffffffff,%eax
  jmp    L84
L93:
  addl   $0x1,-0x18(%rbp)
L82:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L65
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x14(%rbp),%eax
L84:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L98
  call   <__stack_chk_fail@plt>
L98:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D37
datatype: string
name: extract_symbolic_data
arguments: label: D35
datatype: string
name: extract_symbolic_data
arguments: label: D20
datatype: string
name: extract_symbolic_data
arguments: label: D0
datatype: string

tool: D37: Could not get input.

tool: D35: No input provided.

tool: D20: Memory allocation error.

tool: D0: Input contains non-ascii characters.

assistant: ```c
int input_get_str(char **dest, char *prompt) {
  int r, i, input_len;
  unsigned char *input;
  r = input_get(&input, prompt);
  if (r < 0) {
    error_log("Could not get input.");
    return -1;
  }
  if (r > 0) {
    if (input[r - 1] == '\n') {
      --r;
      if (r > 0 && input[r - 1] == '\r') {
        --r;
      }
    }
  }
  if (r == 0) {
    error_log("No input provided.");
    return -1;
  }
  input_len = r;
  *dest = malloc(input_len + 1);
  if (*dest == NULL) {
    error_log("Memory allocation error.");
    return -1;
  }
  memset(*dest, 0, input_len + 1);
  for (i = 0; i < input_len; ++i) {
    if (isascii(input[i])) {
      (*dest)[i] = input[i];
    } else {
      error_log("Input contains non-ascii characters.");
      return -1;
    }
  }
  free(input);
  return input_len;
}
```