user: Translate the below assembly code into C programming language:

```asm
<at_recv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L180
L145:
  cmpl   $0x0,-0x24(%rbp)
  jne    L100
  jmp    L180
L100:
  mov    -0x20(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L144
  subl   $0x1,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L144
  jmp    L180
L144:
  mov    -0x20(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L72
  subl   $0x1,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jne    L72
  jmp    L180
L72:
  mov    -0x20(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x24(%rbp)
  cltq
  add    %rcx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  lea    D26(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L81
  mov    -0x20(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L123
  mov    -0x20(%rbp),%rax
  mov    $0xa,%edx
  lea    D22(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L123
  mov    -0x20(%rbp),%rax
  mov    $0xa,%edx
  lea    D33(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L137
L123:
  movq   $0xffffffffffffffff,-0x10(%rbp)
  jmp    L6
L137:
  cmpq   $0x0,-0x40(%rbp)
  je     L171
  cmpq   $0x0,-0x10(%rbp)
  je     L60
  mov    -0x40(%rbp),%rax
  sub    $0x1,%rax
  movb   $0x20,(%rax)
L60:
  mov    -0x20(%rbp),%rcx
  mov    -0x24(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x24(%rbp),%eax
  cltq
  add    %rax,-0x40(%rbp)
L171:
  addq   $0x1,-0x10(%rbp)
L180:
  mov    -0x38(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <getline@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0xffffffff,-0x24(%rbp)
  jne    L145
  jmp    L6
L81:
  nop
L6:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L178
  call   <__stack_chk_fail@plt>
L178:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D26
type_infered: string
name: read_data
arguments: tag: D6
type_infered: string
name: read_data
arguments: tag: D22
type_infered: string
name: read_data
arguments: tag: D33
type_infered: string

tool: D26: OK

tool: D6: ERROR

tool: D22: +CME ERROR:

tool: D33: +CMS ERROR:

assistant: ```c
ssize_t at_recv(FILE *fp, char *dest) {
  char *line = NULL;
  size_t len = 0;
  size_t ret = 0;
  ssize_t read;
  while ((read = getline(&line, &len, fp)) != -1) {
    if (!read)
      continue;
    if ((line[read - 1] == '\n') && (--read == 0))
      continue;
    if ((line[read - 1] == '\r') && (--read == 0))
      continue;
    line[read++] = '\0';
    if (!strcmp(line, "OK"))
      break;
    if ((!strcmp(line, "ERROR")) || (!strncmp(line, "+CME ERROR:", 10)) || (!strncmp(line, "+CMS ERROR:", 10))) {
      ret = -1;
      break;
    }
    if (dest) {
      if (ret)
        dest[-1] = ' ';
      memcpy(dest, line, read);
      dest += read;
    }
    ret++;
  }
  free(line);
  return ret;
}
```