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

```asm
<EXPQA>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x148,%rsp
  mov    %rdi,0x20(%rsp)
  mov    %rsi,%rbx
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x28(%rsp)
  mov    %r8d,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x138(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rcx)
  mov    (%rsi),%eax
  lea    0x1(,%rax,4),%edi
  movslq %edi,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  test   %rax,%rax
  je     L94
  mov    %rax,%r15
  mov    (%rbx),%esi
  mov    $0x0,%eax
  movl   $0x0,0xc(%rsp)
  lea    0x1(%r13),%edx
  movslq %edx,%r14
  test   %esi,%esi
  jg     L45
L40:
  cltq
  movq   $0x0,(%r15,%rax,8)
  mov    %r15,%rdx
  mov    0x20(%rsp),%rax
  mov    (%rax),%edi
  mov    $0x0,%eax
  call   <ex_put_qa@plt>
  cmp    $0xffffffff,%eax
  je     L115
L147:
  mov    0x10(%rsp),%r13
  cmpl   $0x0,0x0(%r13)
  jle    L131
  lea    0x20(%r15),%rbp
  mov    $0x0,%r12d
  jmp    L120
L94:
  mov    0x28(%rsp),%rax
  movl   $0x3e8,(%rax)
  jmp    L88
L112:
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  movl   $0x3e8,(%rax)
  lea    0x30(%rsp),%rbx
  mov    0x20(%rsp),%rax
  mov    (%rax),%ecx
  mov    0xc(%rsp),%edx
  lea    D19(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    $0x3e8,%edx
  mov    %rbx,%rsi
  lea    D6(%rip),%rdi
  mov    $0x0,%eax
  call   <ex_err@plt>
  jmp    L88
L140:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    (%rdx),%esi
  cmp    %ecx,%esi
  jle    L40
L45:
  lea    0x1(%rax),%ebx
  movslq %ebx,%rbx
  movslq %r13d,%rdx
  mov    %rdx,(%rsp)
  mov    %r13d,%ebp
  imul   %eax,%ebp
  movslq %ebp,%rbp
  add    0x18(%rsp),%rbp
  movslq %eax,%r12
  add    $0x5,%r12
L58:
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,-0x8(%r15,%rbx,8)
  test   %rax,%rax
  je     L112
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    $0x0,%eax
  call   <ex_fstrncpy@plt>
  mov    %ebx,%eax
  add    $0x1,%rbx
  add    (%rsp),%rbp
  cmp    %r12,%rbx
  jne    L58
  jmp    L140
L115:
  mov    0x28(%rsp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L147
L138:
  add    $0x1,%r12d
  add    $0x20,%rbp
  cmp    %r12d,0x0(%r13)
  jle    L131
L120:
  lea    -0x20(%rbp),%rbx
L108:
  mov    (%rbx),%rdi
  call   <free@plt>
  add    $0x8,%rbx
  cmp    %rbx,%rbp
  jne    L108
  jmp    L138
L131:
  mov    %r15,%rdi
  call   <free@plt>
L88:
  mov    0x138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  add    $0x148,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L51:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D19
type_infered: string
name: unpack_data
arguments: label: D6
type_infered: string

tool: D19: Error: failed to allocate space for qa record %d for file id %d

tool: D6: expqa

assistant: ```c
void EXPQA(int *idexo, int *num_qa_records, char *qa_record, int *ierr, int qa_recordlen) {
  char errmsg[256];
  char **sptr;
  int i, ii, iii, slen, alen;
  *ierr = 0;
  slen = 32L;
  if (qa_recordlen != 32L) {
    slen = qa_recordlen;
  }
  alen = 4;
  if (!(sptr = malloc(((*num_qa_records) * alen + 1) * sizeof(char *)))) {
    *ierr = 1000;
    return;
  }
  iii = 0;
  for (i = 0; i < *num_qa_records; i++) {
    for (ii = 0; ii < alen; ii++) {
      *(sptr + iii) = malloc((slen + 1) * sizeof(char));
      if (*(sptr + iii) == 0) {
        free(sptr);
        *ierr = 1000;
        sprintf(errmsg, "Error: failed to allocate space for qa record %d for file id %d", i, *idexo);
        ex_err("expqa", errmsg, 1000);
        return;
      }
      ex_fstrncpy(*(sptr + iii), qa_record + iii * qa_recordlen, slen);
      iii++;
    }
  }
  *(sptr + iii) = 0;
  if (ex_put_qa(*idexo, *num_qa_records, (void *)sptr) == -1)
    *ierr = -1;
  iii = 0;
  for (i = 0; i < *num_qa_records; i++) {
    for (ii = 0; ii < alen; ii++) {
      free(*(sptr + iii));
      iii++;
    }
  }
  free(sptr);
}
```