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

```asm
<aml_fio_get_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L44
L178:
  cmpl   $0xa,-0x4(%rbp)
  je     L136
  cmpl   $0x23,-0x4(%rbp)
  jne    L18
  jmp    L175
L152:
  cmpl   $0xa,-0x4(%rbp)
  je     L142
L175:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0x4(%rbp)
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L152
  jmp    L157
L142:
  nop
L157:
  cmpl   $0x0,-0x8(%rbp)
  je     L44
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jge    L156
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0xa,(%rax)
L156:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L56
L136:
  cmpl   $0x0,-0x8(%rbp)
  je     L44
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jge    L36
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0xa,(%rax)
L36:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L56
L18:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jge    L149
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L44
L149:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L56
L44:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0x4(%rbp)
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L178
  cmpl   $0x0,-0x8(%rbp)
  je     L42
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jge    L115
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0xa,(%rax)
L115:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L56
L42:
  mov    $0x0,%eax
L56:
  leave
  ret
```

assistant: ```c
int aml_fio_get_line(FILE *f, char *lineBuffer, int maxLength) {
  int c;
  int pos = 0;
  while ((c = fgetc(f)) != EOF) {
    switch (c) {
    case '#':
      while ((c = fgetc(f)) != EOF) {
        if (c == '\n')
          break;
      }
      if (pos) {
        if (pos < maxLength - 1)
          lineBuffer[pos++] = '\n';
        lineBuffer[pos] = '\0';
        return 1;
      }
      break;
    case '\n':
      if (pos) {
        if (pos < maxLength - 1)
          lineBuffer[pos++] = '\n';
        lineBuffer[pos] = '\0';
        return 1;
      } else {
      }
      break;
    default:
      if (pos < maxLength - 1)
        lineBuffer[pos++] = c;
      else {
        lineBuffer[pos] = '\0';
        return 1;
      }
      break;
    }
  }
  if (pos) {
    if (pos < maxLength - 1)
      lineBuffer[pos++] = '\n';
    lineBuffer[pos] = '\0';
    return 1;
  }
  return 0;
}
```