user: What would the C source look like for the assembly code provided here:

```asm
<write_u32sparsetri>:
  endbr64
  push   %r15
  push   %r14
  mov    %r9,%r14
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %esi,%ebx
  lea    D12(%rip),%rsi
  sub    $0x38,%rsp
  mov    %edi,0x24(%rsp)
  mov    %r8,%rdi
  mov    %r8,0x28(%rsp)
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L51
L122:
  lea    D14(%rip),%r13
  mov    0x24(%rsp),%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %r13,%rsi
  call   <fprintf@plt>
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %ebp,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x24(%rsp),%edi
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %ebp,%edx
  mov    %ebx,%esi
  call   <countnnz32tri@plt>
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    %eax,%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L95
  test   %ebx,%ebx
  jle    L95
  test   %ebp,%ebp
  jle    L95
  movslq %ebx,%rax
  movl   $0x0,0x20(%rsp)
  movslq %ebp,%r13
  mov    %rax,0x18(%rsp)
  mov    %r15,0x10(%rsp)
  mov    %r14,%r15
  mov    %r13,%r14
  nopw   0x0(%rax,%rax,1)
L37:
  movq   $0x0,0x8(%rsp)
  mov    %r14,%rax
  mov    %r15,%r14
  mov    %rax,%r15
  nopw   0x0(%rax,%rax,1)
L91:
  mov    0x8(%rsp),%rax
  xor    %ebx,%ebx
  mov    %eax,%r13d
  lea    0x0(,%rax,8),%rbp
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %rax,%r14
  jmp    L111
  nopl   (%rax)
L22:
  add    $0x1,%rbx
  cmp    %rbx,%r14
  je     L129
L111:
  mov    (%r12),%rax
  mov    (%rax,%rbp,1),%rax
  mov    (%rax,%rbx,8),%r9
  cmp    %r15,%r9
  jle    L22
  mov    0x20(%rsp),%edx
  mov    0x10(%rsp),%rdi
  mov    %ebx,%r8d
  mov    %r13d,%ecx
  lea    D42(%rip),%rsi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    %rbx,%r14
  jne    L111
L129:
  mov    %r14,%rax
  addq   $0x1,0x8(%rsp)
  mov    %r15,%r14
  mov    %rax,%r15
  mov    0x8(%rsp),%rax
  cmp    %rax,0x18(%rsp)
  jne    L91
  mov    %r15,%rax
  addl   $0x1,0x20(%rsp)
  mov    %r14,%r15
  add    $0x8,%r12
  mov    %rax,%r14
  mov    0x20(%rsp),%eax
  cmp    %eax,0x24(%rsp)
  jne    L37
  mov    0x10(%rsp),%r15
L95:
  mov    %r15,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L120
L55:
  add    $0x38,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <fclose@plt>
L120:
  mov    0x28(%rsp),%rsi
  lea    D4(%rip),%rdi
  call   <yap_sysquit@plt>
  jmp    L55
L51:
  mov    0x28(%rsp),%rsi
  lea    D41(%rip),%rdi
  call   <yap_sysquit@plt>
  jmp    L122
```

tool_calls: name: parse_data
arguments: tag: D12
datatype: string
name: parse_data
arguments: tag: D14
datatype: string
name: parse_data
arguments: tag: D42
datatype: string
name: parse_data
arguments: tag: D4
datatype: string
name: parse_data
arguments: tag: D41
datatype: string

tool: D12: w

tool: D14: %d


tool: D42: %d %d %d %u


tool: D4: Error on writing file '%s' 

tool: D41: Cannot open file '%s' for write


assistant: ```c
void write_u32sparsetri(int ns, int nr, int nc, uint32_t ***x, char *fname, uint32_t cutoff) {
  FILE *fp = fopen(fname, "w");
  int i, j, k;
  if (!fp)
    yap_sysquit("Cannot open file '%s' for write\n", fname);
  fprintf(fp, "%d\n", ns);
  fprintf(fp, "%d\n", nr);
  fprintf(fp, "%d\n", nc);
  fprintf(fp, "%d\n", countnnz32tri(ns, nr, nc, x, cutoff));
  for (k = 0; k < ns; k++)
    for (i = 0; i < nr; i++)
      for (j = 0; j < nc; j++)
        if (x[k][i][j] > cutoff)
          fprintf(fp, "%d %d %d %u\n", k, i, j, (unsigned)x[k][i][j]);
  if (ferror(fp))
    yap_sysquit("Error on writing file '%s' ", fname);
  fclose(fp);
}
```