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

```asm
<lcsq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,-0x80(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,-0x7c(%rbp)
  movl   $0x400,-0x78(%rbp)
  mov    -0x78(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x58(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L49:
  cmp    %rdx,%rsp
  je     L70
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L70:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L86
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L86:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x80(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x80(%rbp),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x88(%rbp)
  jmp    L155
L0:
  mov    -0x88(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rdx,(%rax)
  addl   $0x1,-0x88(%rbp)
L155:
  mov    -0x88(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jl     L0
  movl   $0x0,-0x88(%rbp)
  mov    -0x98(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  jmp    L177
L174:
  movl   $0x0,-0x84(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  jmp    L117
L149:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L156
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x88(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  jmp    L167
L156:
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x88(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,-0x74(%rbp)
  mov    -0x88(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x74(%rbp),%eax
  mov    %eax,(%rdx)
L167:
  addl   $0x1,-0x84(%rbp)
  addq   $0x1,-0x60(%rbp)
L117:
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L149
  addl   $0x1,-0x88(%rbp)
  addq   $0x1,-0x68(%rbp)
L177:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L174
  mov    -0x78(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x70(%rbp)
  subq   $0x1,-0x70(%rbp)
  mov    -0x70(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x80(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x88(%rbp)
  mov    -0x7c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x84(%rbp)
  jmp    L188
L31:
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x88(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L132
  subl   $0x1,-0x88(%rbp)
  jmp    L188
L132:
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x88(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x84(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L146
  subl   $0x1,-0x84(%rbp)
  jmp    L188
L146:
  mov    -0x88(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  subq   $0x1,-0x70(%rbp)
  movzbl (%rax),%edx
  mov    -0x70(%rbp),%rax
  mov    %dl,(%rax)
  subl   $0x1,-0x88(%rbp)
  subl   $0x1,-0x84(%rbp)
L188:
  cmpl   $0x0,-0x88(%rbp)
  jle    L21
  cmpl   $0x0,-0x84(%rbp)
  jg     L31
L21:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rbx,%rsp
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L121
  call   <__stack_chk_fail@plt>
L121:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
char *lcsq(const char *a, const char *b) {
  int lena = strlen(a) + 1;
  int lenb = strlen(b) + 1;
  int bufrlen = 1024;
  char bufr[bufrlen], *result;
  int i, j;
  const char *x, *y;
  int *la = calloc(lena * lenb, sizeof(int));
  int **lengths = malloc(lena * sizeof(int *));
  for (i = 0; i < lena; i++)
    lengths[i] = la + i * lenb;
  for (i = 0, x = a; *x; i++, x++) {
    for (j = 0, y = b; *y; j++, y++) {
      if (*x == *y) {
        lengths[i + 1][j + 1] = lengths[i][j] + 1;
      } else {
        int ml = (((lengths[i + 1][j]) > (lengths[i][j + 1])) ? (lengths[i + 1][j]) : (lengths[i][j + 1]));
        lengths[i + 1][j + 1] = ml;
      }
    }
  }
  result = bufr + bufrlen;
  *--result = '\0';
  i = lena - 1;
  j = lenb - 1;
  while ((i > 0) && (j > 0)) {
    if (lengths[i][j] == lengths[i - 1][j])
      i -= 1;
    else if (lengths[i][j] == lengths[i][j - 1])
      j -= 1;
    else {
      *--result = a[i - 1];
      i -= 1;
      j -= 1;
    }
  }
  free(la);
  free(lengths);
  return strdup(result);
}
```