user: Please show me the C implementation that matches the assembly code listed below:

```asm
<create_codebook_text_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %edx,-0x54(%rbp)
  mov    %ecx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  lea    D34(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jne    L98
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L98:
  movl   $0x0,-0x3c(%rbp)
  jmp    L1
L78:
  mov    -0x3c(%rbp),%eax
  cltq
  movl   $0x0,-0x30(%rbp,%rax,4)
  addl   $0x1,-0x3c(%rbp)
L1:
  mov    -0x3c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L78
  mov    -0x54(%rbp),%edx
  mov    -0x58(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <pow@plt>
  mov    %eax,%ecx
  mov    -0x54(%rbp),%edx
  mov    -0x38(%rbp),%rax
  lea    D6(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
L88:
  movl   $0x0,-0x3c(%rbp)
  jmp    L9
L17:
  mov    -0x58(%rbp),%eax
  imul   -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    -0x38(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x3c(%rbp)
L9:
  mov    -0x3c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L17
  mov    -0x38(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L51
L89:
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x58(%rbp)
  jne    L16
  mov    -0x3c(%rbp),%eax
  cltq
  movl   $0x0,-0x30(%rbp,%rax,4)
  mov    -0x3c(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
L16:
  addl   $0x1,-0x3c(%rbp)
L51:
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x3c(%rbp)
  jl     L89
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x58(%rbp)
  jne    L88
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D34
type_infered: string
name: parse_data
arguments: tag: D35
type_infered: string
name: parse_data
arguments: tag: D6
type_infered: string
name: parse_data
arguments: tag: D1
type_infered: string

tool: D34: wt

tool: D35: Can't open codebook text file %s


tool: D6: %d %d


tool: D1: %4.0f 

assistant: ```c
void create_codebook_text_file(char filename[], float lsp[], int rows, int cols) {
  FILE *f;
  int i, digits[10];
  f = fopen(filename, "wt");
  if (f == NULL) {
    printf("Can't open codebook text file %s\n", filename);
    exit(0);
  }
  for (i = 0; i < rows; i++)
    digits[i] = 0;
  fprintf(f, "%d %d\n", rows, (int)pow(cols, rows));
  do {
    for (i = 0; i < rows; i++)
      fprintf(f, "%4.0f ", lsp[cols * i + digits[i]]);
    fprintf(f, "\n");
    digits[0]++;
    for (i = 0; i < rows - 1; i++)
      if (digits[i] == cols) {
        digits[i] = 0;
        digits[i + 1]++;
      }
  } while (digits[rows - 1] != cols);
  fclose(f);
}
```