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

```asm
<main>:
  endbr64
  push   %r15
  lea    D2(%rip),%rdi
  push   %r14
  push   %r13
  lea    D65(%rip),%r13
  push   %r12
  lea    D52(%rip),%r12
  push   %rbp
  lea    D30(%rip),%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x20(%rsp)
  lea    0x20(%rsp),%rbx
  movl   $0x0,0x24(%rsp)
  call   <system@plt>
  mov    $0xbb,%edx
  mov    $0xc9,%esi
  xor    %eax,%eax
  lea    D27(%rip),%rdi
  call   <printf@plt>
  mov    $0xb9,%edx
  mov    $0xcc,%esi
  xor    %eax,%eax
  lea    D82(%rip),%rdi
  call   <printf@plt>
  mov    $0xbc,%edx
  mov    $0xc8,%esi
  xor    %eax,%eax
  lea    D133(%rip),%rdi
  call   <printf@plt>
  lea    D87(%rip),%rdi
  call   <system@plt>
L54:
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0x20(%rsp),%esi
  test   %esi,%esi
  jle    L121
L21:
  lea    D148(%rip),%rbx
  lea    0x24(%rsp),%rbp
  lea    D52(%rip),%r12
L22:
  mov    %rbx,%rdi
  call   <puts@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L44
L128:
  imul   0x20(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  mov    $0xa,%edi
  mov    %rax,%r15
  call   <putchar@plt>
  mov    0x20(%rsp),%edx
  test   %edx,%edx
  jle    L104
  movq   $0x0,0x10(%rsp)
  mov    0x24(%rsp),%eax
  movl   $0x0,0x8(%rsp)
  mov    %r15,0x18(%rsp)
  nopl   0x0(%rax)
L76:
  mov    0x10(%rsp),%rcx
  mov    %ecx,0xc(%rsp)
  lea    0x1(%rcx),%r14d
  test   %eax,%eax
  jle    L106
  movslq 0x8(%rsp),%rax
  add    0x10(%rsp),%rax
  xor    %r12d,%r12d
  lea    (%r15,%rax,4),%rbp
  nopw   0x0(%rax,%rax,1)
L132:
  mov    %r12d,%ebx
  add    $0x1,%r12d
  mov    %r14d,%esi
  xor    %eax,%eax
  mov    %r12d,%edx
  lea    D69(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x4,%rbp
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  mov    %r15,%rdx
  lea    D115(%rip),%rdi
  lea    (%rax,%rbx,1),%esi
  xor    %eax,%eax
  add    0xc(%rsp),%esi
  call   <printf@plt>
  mov    0x24(%rsp),%eax
  cmp    %eax,%r12d
  jl     L132
L106:
  mov    0x8(%rsp),%ecx
  addq   $0x1,0x10(%rsp)
  mov    0x20(%rsp),%edx
  lea    -0x1(%rcx,%rax,1),%ecx
  mov    %ecx,0x8(%rsp)
  mov    0x10(%rsp),%rcx
  cmp    %ecx,%edx
  jg     L76
  mov    0x18(%rsp),%r12
  test   %edx,%edx
  jle    L104
  xor    %ebp,%ebp
  xor    %r14d,%r14d
  lea    D122(%rip),%r13
  nopl   0x0(%rax,%rax,1)
L77:
  mov    0x24(%rsp),%eax
  xor    %ebx,%ebx
  test   %eax,%eax
  jle    L11
  nopw   0x0(%rax,%rax,1)
L115:
  mov    (%r12),%esi
  mov    %r13,%rdi
  cmp    $0x1,%esi
  adc    $0x0,%ebp
  xor    %eax,%eax
  add    $0x4,%r12
  add    $0x1,%ebx
  call   <printf@plt>
  cmp    %ebx,0x24(%rsp)
  jg     L115
L11:
  mov    $0xa,%edi
  add    $0x1,%r14d
  call   <putchar@plt>
  cmp    %r14d,0x20(%rsp)
  jg     L77
L156:
  lea    D103(%rip),%rdi
  xor    %eax,%eax
  mov    %ebp,%esi
  call   <printf@plt>
  lea    D87(%rip),%rdi
  call   <system@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L44:
  mov    %r12,%rdi
  call   <puts@plt>
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L22
  jmp    L128
  nopl   0x0(%rax)
L121:
  mov    %r12,%rdi
  call   <puts@plt>
  mov    0x20(%rsp),%ecx
  test   %ecx,%ecx
  jle    L54
  jmp    L21
L104:
  xor    %ebp,%ebp
  jmp    L156
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D2
type_guessed: string
name: extract_symbolic_data
arguments: tag: D65
type_guessed: string
name: extract_symbolic_data
arguments: tag: D52
type_guessed: string
name: extract_symbolic_data
arguments: tag: D30
type_guessed: string
name: extract_symbolic_data
arguments: tag: D27
type_guessed: string
name: extract_symbolic_data
arguments: tag: D82
type_guessed: string
name: extract_symbolic_data
arguments: tag: D133
type_guessed: string
name: extract_symbolic_data
arguments: tag: D87
type_guessed: string
name: extract_symbolic_data
arguments: tag: D148
type_guessed: string
name: extract_symbolic_data
arguments: tag: D69
type_guessed: string
name: extract_symbolic_data
arguments: tag: D115
type_guessed: string
name: extract_symbolic_data
arguments: tag: D122
type_guessed: string
name: extract_symbolic_data
arguments: tag: D103
type_guessed: string

tool: D2: cls

tool: D65: %d

tool: D52: Inserte un valor entero positivo...

tool: D30: 
Cuantos renglones tiene su matriz?

tool: D27: %c==========================================%c


tool: D82: %c===========     BIENVENIDO     ===========%c


tool: D133: %c==========================================%c



tool: D87: pause

tool: D148: 
Cuantas columnas tiene su matriz?

tool: D69: Ingrese el valor de M[%d][%d]:  

tool: D115: %d-----%p


tool: D122:  %d 

tool: D103: 

	Se ingresaron %d ceros



assistant: ```c
int main() {
  int *M;
  int m = 0, n = 0;
  int i, j;
  int total = 0;
  int columnas = 0;
  system("cls");
  printf("%c==========================================%c\n", 201, 187);
  printf("%c===========     BIENVENIDO     ===========%c\n", 204, 185);
  printf("%c==========================================%c\n\n", 200, 188);
  system("pause");
  do {
    printf("\nCuantos renglones tiene su matriz?\n");
    scanf("%d", &m);
    if (m <= 0)
      printf("Inserte un valor entero positivo...\n");
  } while (m <= 0);
  do {
    printf("\nCuantas columnas tiene su matriz?\n");
    scanf("%d", &n);
    if (n <= 0)
      printf("Inserte un valor entero positivo...\n");
  } while (n <= 0);
  M = (int *)malloc((m * n) * sizeof(int));
  printf("\n");
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      printf("Ingrese el valor de M[%d][%d]:  ", i + 1, j + 1);
      scanf("%d", M + i + j + columnas);
      printf("%d-----%p\n", i + j + columnas, M);
    }
    columnas = columnas + (n - 1);
  }
  columnas = 0;
  for (i = 0; i < m; i++) {
    for (j = 0; j < n; j++) {
      if (*M == 0)
        total = total + 1;
      printf(" %d ", *M);
      M++;
    }
    printf("\n");
  }
  printf("\n\n\tSe ingresaron %d ceros\n\n", total);
  system("pause");
  return 0;
}
```