user: Demonstrate the C code that generates the assembly output below:

```asm
<write_u32sparsetri>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x40(%rbp),%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L40
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D71(%rip),%rax
  mov    %rax,%rdi
  call   <yap_sysquit@plt>
L40:
  mov    -0x24(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D55(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x28(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D55(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x2c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D55(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x48(%rbp),%rdi
  mov    -0x38(%rbp),%rcx
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%esi
  mov    -0x24(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <countnnz32tri@plt>
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    D55(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L64
L46:
  movl   $0x0,-0x14(%rbp)
  jmp    L39
L45:
  movl   $0x0,-0x10(%rbp)
  jmp    L56
L49:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  cmp    %rax,-0x48(%rbp)
  jge    L84
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %eax,%edi
  mov    -0x10(%rbp),%esi
  mov    -0x14(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edi,%r9d
  mov    %esi,%r8d
  lea    D27(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L84:
  addl   $0x1,-0x10(%rbp)
L56:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L49
  addl   $0x1,-0x14(%rbp)
L39:
  mov    -0x14(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L45
  addl   $0x1,-0xc(%rbp)
L64:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L46
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L1
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <yap_sysquit@plt>
L1:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D28
type: string
name: parse_data
arguments: data_label: D71
type: string
name: parse_data
arguments: data_label: D55
type: string
name: parse_data
arguments: data_label: D27
type: string
name: parse_data
arguments: data_label: D35
type: string

tool: D28: w

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


tool: D55: %d


tool: D27: %d %d %d %u


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

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);
}
```