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

```asm
<at_plus_a>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x158,%rsp
  mov    %edi,0x30(%rsp)
  mov    0x190(%rsp),%r12
  mov    %rdx,0x10(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %r9,0x20(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x148(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  shl    $0x2,%edi
  mov    %rax,0x28(%rsp)
  call   <superlu_malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L120
L218:
  mov    0x30(%rsp),%eax
  lea    0x4(,%rax,4),%eax
  mov    %eax,%edi
  mov    %eax,0x34(%rsp)
  call   <superlu_malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L12
L138:
  lea    0x0(,%r13,4),%edi
  call   <superlu_malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L222
  mov    0x30(%rsp),%r15d
  test   %r15d,%r15d
  jle    L117
L438:
  mov    %r15d,%r8d
  xor    %esi,%esi
  mov    %rbp,%rdi
  shl    $0x2,%r8
  mov    %r8,%rdx
  mov    %r8,0x38(%rsp)
  call   <memset@plt>
  mov    0x10(%rsp),%rsi
  lea    -0x1(%r15),%eax
  mov    0x38(%rsp),%r8
  lea    0x4(%rsi),%r14
  lea    0x8(%rsi,%rax,4),%rsi
  mov    %r14,%rcx
  nopl   0x0(%rax,%rax,1)
L404:
  movslq -0x4(%rcx),%rax
  cmp    %eax,(%rcx)
  jle    L203
L140:
  movslq (%rbx,%rax,4),%rdx
  add    $0x1,%rax
  addl   $0x1,0x0(%rbp,%rdx,4)
  cmp    %eax,(%rcx)
  jg     L140
L203:
  add    $0x4,%rcx
  cmp    %rcx,%rsi
  jne    L404
  mov    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  movl   $0x0,(%rsi)
  mov    %rsi,%rax
  lea    (%rsi,%r8,1),%r9
  sub    %rsi,%rdi
  nopw   0x0(%rax,%rax,1)
L184:
  mov    %rax,%rsi
  lea    (%rdi,%rax,1),%rcx
  add    $0x4,%rax
  mov    (%rcx),%edx
  add    (%rsi),%edx
  mov    %edx,(%rax)
  mov    (%rsi),%edx
  mov    %edx,(%rcx)
  cmp    %rax,%r9
  jne    L184
  mov    0x30(%rsp),%edi
  mov    %r14,%rsi
  xor    %r15d,%r15d
  nopl   0x0(%rax)
L161:
  movslq -0x4(%rsi),%rax
  cmp    (%rsi),%eax
  jge    L50
  nopl   0x0(%rax,%rax,1)
L37:
  movslq (%rbx,%rax,4),%rdx
  add    $0x1,%rax
  lea    0x0(%rbp,%rdx,4),%rdx
  movslq (%rdx),%rcx
  mov    %r15d,0x0(%r13,%rcx,4)
  addl   $0x1,(%rdx)
  cmp    %eax,(%rsi)
  jg     L37
L50:
  lea    0x1(%r15),%eax
  add    $0x4,%rsi
  cmp    %eax,%edi
  je     L78
  mov    %eax,%r15d
  jmp    L161
  nopl   (%rax)
L78:
  mov    $0xff,%esi
  mov    %rbp,%rdi
  mov    %r8,%rdx
  call   <memset@plt>
  mov    0x10(%rsp),%rcx
  xor    %esi,%esi
  xor    %eax,%eax
  mov    0x8(%rsp),%rdi
  mov    $0xfffffffffffffffc,%r10
  mov    %r12,0x38(%rsp)
  sub    %rcx,%r10
  lea    (%r10,%rbp,1),%r11
  add    %rdi,%r10
  sub    %rcx,%rdi
  mov    %rdi,%r12
  nopw   0x0(%rax,%rax,1)
L7:
  mov    %eax,(%r11,%r14,1)
  movslq -0x4(%r14),%rdx
  mov    (%r14),%edi
  cmp    %edi,%edx
  jge    L366
  nop
L220:
  movslq (%rbx,%rdx,4),%rcx
  lea    0x0(%rbp,%rcx,4),%rcx
  cmp    %eax,(%rcx)
  je     L380
  mov    %eax,(%rcx)
  mov    (%r14),%edi
  add    $0x1,%rdx
  add    $0x1,%esi
  cmp    %edx,%edi
  jg     L220
L366:
  lea    (%r12,%r14,1),%r9
  mov    (%r10,%r14,1),%edx
  mov    (%r9),%r8d
  cmp    %r8d,%edx
  jge    L418
  movslq %edx,%rcx
  lea    0x0(%r13,%rcx,4),%rcx
  nopl   (%rax)
L166:
  movslq (%rcx),%rdi
  lea    0x0(%rbp,%rdi,4),%rdi
  cmp    %eax,(%rdi)
  je     L443
  mov    %eax,(%rdi)
  mov    (%r9),%r8d
  add    $0x1,%edx
  add    $0x1,%esi
  add    $0x4,%rcx
  cmp    %r8d,%edx
  jl     L166
L418:
  lea    0x1(%rax),%edx
  add    $0x4,%r14
  cmp    %eax,%r15d
  je     L258
L181:
  mov    %edx,%eax
  jmp    L7
  nopl   0x0(%rax,%rax,1)
L380:
  add    $0x1,%rdx
  cmp    %edx,%edi
  jg     L220
  jmp    L366
  nopw   0x0(%rax,%rax,1)
L443:
  add    $0x1,%edx
  add    $0x4,%rcx
  cmp    %r8d,%edx
  jl     L166
  lea    0x1(%rax),%edx
  add    $0x4,%r14
  cmp    %eax,%r15d
  jne    L181
L258:
  mov    0x38(%rsp),%r12
L305:
  mov    0x18(%rsp),%rax
  mov    0x34(%rsp),%edi
  mov    %esi,(%rax)
  call   <superlu_malloc@plt>
  mov    0x20(%rsp),%rsi
  mov    %rax,(%rsi)
  test   %rax,%rax
  je     L22
L314:
  mov    0x18(%rsp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L148
L403:
  mov    0x20(%rsp),%rax
  mov    (%rax),%r15
  mov    0x30(%rsp),%eax
  mov    %r15,0x18(%rsp)
  test   %eax,%eax
  jle    L287
  mov    0x28(%rsp),%rax
  mov    $0xff,%esi
  mov    %rbp,%rdi
  mov    %rbp,%r14
  lea    0x0(,%rax,4),%rdx
  call   <memset@plt>
  mov    0x8(%rsp),%rsi
  xor    %eax,%eax
  xor    %ecx,%ecx
  mov    0x10(%rsp),%r11
  mov    %rsi,%r10
  sub    %rsi,%r15
  sub    %rsi,%r14
  add    $0x4,%r11
  xchg   %ax,%ax
L273:
  mov    %eax,(%r15,%r10,1)
  mov    %ecx,(%r14,%r10,1)
  movslq -0x4(%r11),%rsi
  mov    (%r11),%r8d
  cmp    %r8d,%esi
  jge    L244
L323:
  movslq (%rbx,%rsi,4),%rdx
  mov    %rdx,%rdi
  lea    0x0(%rbp,%rdx,4),%rdx
  cmp    %ecx,(%rdx)
  je     L447
L64:
  mov    (%r12),%r8
  mov    %ecx,(%rdx)
  lea    0x1(%rax),%edx
  cltq
  add    $0x1,%rsi
  mov    %edi,(%r8,%rax,4)
  mov    (%r11),%r8d
  cmp    %esi,%r8d
  jle    L465
  mov    %edx,%eax
  movslq (%rbx,%rsi,4),%rdx
  mov    %rdx,%rdi
  lea    0x0(%rbp,%rdx,4),%rdx
  cmp    %ecx,(%rdx)
  jne    L64
L447:
  add    $0x1,%rsi
  cmp    %esi,%r8d
  jg     L323
L244:
  mov    %eax,%edx
L465:
  mov    (%r10),%esi
  mov    0x4(%r10),%r9d
  add    $0x4,%r10
  cmp    %r9d,%esi
  jge    L372
  movslq %esi,%rax
  lea    0x0(%r13,%rax,4),%rdi
L180:
  movslq (%rdi),%rax
  mov    %rax,%r8
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %ecx,(%rax)
  je     L247
L62:
  mov    (%r12),%r9
  mov    %ecx,(%rax)
  lea    0x1(%rdx),%eax
  movslq %edx,%rdx
  add    $0x1,%esi
  add    $0x4,%rdi
  mov    %r8d,(%r9,%rdx,4)
  mov    (%r10),%r9d
  cmp    %r9d,%esi
  jge    L76
  mov    %eax,%edx
  movslq (%rdi),%rax
  mov    %rax,%r8
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %ecx,(%rax)
  jne    L62
L247:
  add    $0x1,%esi
  add    $0x4,%rdi
  cmp    %r9d,%esi
  jl     L180
L372:
  mov    %edx,%eax
L76:
  add    $0x1,%ecx
  add    $0x4,%r11
  cmp    %ecx,0x30(%rsp)
  jne    L273
L398:
  mov    0x18(%rsp),%rbx
  mov    0x28(%rsp),%rsi
  mov    %rbp,%rdi
  mov    %eax,(%rbx,%rsi,4)
  call   <superlu_free@plt>
  mov    0x8(%rsp),%rdi
  call   <superlu_free@plt>
  mov    0x148(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L188
  add    $0x158,%rsp
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10e0 <superlu_free@plt>
L120:
  lea    0x40(%rsp),%r14
  lea    D126(%rip),%r8
  mov    $0xdb,%ecx
  mov    %r14,%rdi
  lea    D20(%rip),%rdx
  lea    D4(%rip),%rsi
  call   <sprintf@plt>
  mov    %r14,%rdi
  call   <superlu_abort_and_exit@plt>
  jmp    L218
L148:
  lea    0x0(,%rax,4),%edi
  call   <superlu_malloc@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  jne    L403
  lea    0x40(%rsp),%r14
  lea    D126(%rip),%r8
  mov    $0x121,%ecx
  mov    %r14,%rdi
  lea    D15(%rip),%rdx
  lea    D4(%rip),%rsi
  call   <sprintf@plt>
  mov    %r14,%rdi
  call   <superlu_abort_and_exit@plt>
  jmp    L403
L222:
  lea    0x40(%rsp),%r14
  lea    D126(%rip),%r8
  mov    $0xdf,%ecx
  lea    D69(%rip),%rdx
  lea    D4(%rip),%rsi
  mov    %r14,%rdi
  call   <sprintf@plt>
  mov    %r14,%rdi
  call   <superlu_abort_and_exit@plt>
  mov    0x30(%rsp),%r15d
  test   %r15d,%r15d
  jg     L438
L117:
  mov    0x8(%rsp),%rax
  xor    %esi,%esi
  movl   $0x0,(%rax)
  jmp    L305
L12:
  lea    0x40(%rsp),%r14
  lea    D126(%rip),%r8
  mov    $0xdd,%ecx
  mov    %r14,%rdi
  lea    D83(%rip),%rdx
  lea    D4(%rip),%rsi
  call   <sprintf@plt>
  mov    %r14,%rdi
  call   <superlu_abort_and_exit@plt>
  jmp    L138
L22:
  lea    0x40(%rsp),%r14
  lea    D126(%rip),%r8
  mov    $0x11e,%ecx
  mov    %r14,%rdi
  lea    D42(%rip),%rdx
  lea    D4(%rip),%rsi
  call   <sprintf@plt>
  mov    %r14,%rdi
  call   <superlu_abort_and_exit@plt>
  jmp    L314
L287:
  xor    %eax,%eax
  jmp    L398
L188:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D126
data_type: string
name: disassemble_data
arguments: data_label: D20
data_type: string
name: disassemble_data
arguments: data_label: D4
data_type: string
name: disassemble_data
arguments: data_label: D15
data_type: string
name: disassemble_data
arguments: data_label: D69
data_type: string
name: disassemble_data
arguments: data_label: D83
data_type: string
name: disassemble_data
arguments: data_label: D42
data_type: string

tool: D126: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c

tool: D20: SUPERLU_MALLOC fails for marker[]

tool: D4: %s at line %d in file %s


tool: D15: SUPERLU_MALLOC fails for b_rowind[]

tool: D69: SUPERLU_MALLOC fails t_rowind[]

tool: D83: SUPERLU_MALLOC fails for t_colptr[]

tool: D42: SUPERLU_MALLOC fails for b_colptr[]

assistant: ```c
void at_plus_a(const int n, const int nz, int *colptr, int *rowind, int *bnz, int **b_colptr, int **b_rowind) {
  register int i, j, k, col, num_nz;
  int *t_colptr, *t_rowind;
  int *marker;
  if (!(marker = (int *)superlu_malloc(n * sizeof(int)))) {
    char msg[256];
    sprintf(msg, "%s at line %d in file %s\n", "SUPERLU_MALLOC fails for marker[]", 219, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c");
    superlu_abort_and_exit(msg);
  };
  if (!(t_colptr = (int *)superlu_malloc((n + 1) * sizeof(int)))) {
    char msg[256];
    sprintf(msg, "%s at line %d in file %s\n", "SUPERLU_MALLOC fails for t_colptr[]", 221, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c");
    superlu_abort_and_exit(msg);
  };
  if (!(t_rowind = (int *)superlu_malloc(nz * sizeof(int)))) {
    char msg[256];
    sprintf(msg, "%s at line %d in file %s\n", "SUPERLU_MALLOC fails t_rowind[]", 223, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c");
    superlu_abort_and_exit(msg);
  };
  for (i = 0; i < n; ++i)
    marker[i] = 0;
  for (j = 0; j < n; ++j) {
    for (i = colptr[j]; i < colptr[j + 1]; ++i)
      ++marker[rowind[i]];
  }
  t_colptr[0] = 0;
  for (i = 0; i < n; ++i) {
    t_colptr[i + 1] = t_colptr[i] + marker[i];
    marker[i] = t_colptr[i];
  }
  for (j = 0; j < n; ++j)
    for (i = colptr[j]; i < colptr[j + 1]; ++i) {
      col = rowind[i];
      t_rowind[marker[col]] = j;
      ++marker[col];
    }
  for (i = 0; i < n; ++i)
    marker[i] = -1;
  num_nz = 0;
  for (j = 0; j < n; ++j) {
    marker[j] = j;
    for (i = colptr[j]; i < colptr[j + 1]; ++i) {
      k = rowind[i];
      if (marker[k] != j) {
        marker[k] = j;
        ++num_nz;
      }
    }
    for (i = t_colptr[j]; i < t_colptr[j + 1]; ++i) {
      k = t_rowind[i];
      if (marker[k] != j) {
        marker[k] = j;
        ++num_nz;
      }
    }
  }
  *bnz = num_nz;
  if (!(*b_colptr = (int *)superlu_malloc((n + 1) * sizeof(int)))) {
    char msg[256];
    sprintf(msg, "%s at line %d in file %s\n", "SUPERLU_MALLOC fails for b_colptr[]", 286, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c");
    superlu_abort_and_exit(msg);
  };
  if (*bnz) {
    if (!(*b_rowind = (int *)superlu_malloc(*bnz * sizeof(int)))) {
      char msg[256];
      sprintf(msg, "%s at line %d in file %s\n", "SUPERLU_MALLOC fails for b_rowind[]", 289, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dilawar/sesc/refs/heads/master/src/libsesctherm/SuperLU_MT/SRC/get_perm_c.c");
      superlu_abort_and_exit(msg);
    };
  }
  for (i = 0; i < n; ++i)
    marker[i] = -1;
  num_nz = 0;
  for (j = 0; j < n; ++j) {
    (*b_colptr)[j] = num_nz;
    marker[j] = j;
    for (i = colptr[j]; i < colptr[j + 1]; ++i) {
      k = rowind[i];
      if (marker[k] != j) {
        marker[k] = j;
        (*b_rowind)[num_nz++] = k;
      }
    }
    for (i = t_colptr[j]; i < t_colptr[j + 1]; ++i) {
      k = t_rowind[i];
      if (marker[k] != j) {
        marker[k] = j;
        (*b_rowind)[num_nz++] = k;
      }
    }
  }
  (*b_colptr)[n] = num_nz;
  superlu_free(marker);
  superlu_free(t_colptr);
  superlu_free(t_rowind);
}
```