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

```asm
<aan_ecuacion_ondas_metodo_explicito>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    0x130(%rsp),%eax
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  mov    0x128(%rsp),%ebp
  mov    %r9,0x18(%rsp)
  movslq 0x120(%rsp),%rbx
  mov    %rsi,0x28(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %rbx,%r12
  mov    %rdi,(%rsp)
  mov    %eax,0x6c(%rsp)
  movss  %xmm0,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  movslq %ebp,%rax
  imul   %rax,%rbx
  shl    $0x2,%rbx
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,%r15
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,%r14
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,0x38(%rsp)
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,0x40(%rsp)
  call   <malloc@plt>
  mov    (%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r15,%rdi
  mov    %rax,0x48(%rsp)
  call   <memcpy@plt>
  mov    0x28(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r13,%rdi
  call   <memcpy@plt>
  mov    0x20(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r14,%rdi
  call   <memcpy@plt>
  mov    (%rsp),%rsi
  mov    0x38(%rsp),%rdi
  mov    %rbx,%rdx
  call   <memcpy@plt>
  mov    0x28(%rsp),%rsi
  mov    0x40(%rsp),%rdi
  mov    %rbx,%rdx
  call   <memcpy@plt>
  mov    0x20(%rsp),%rsi
  mov    0x48(%rsp),%rdi
  mov    %rbx,%rdx
  call   <memcpy@plt>
  mov    0x6c(%rsp),%eax
  test   %eax,%eax
  jle    L7
  mov    %r12d,%eax
  movl   $0x0,(%rsp)
  pxor   %xmm1,%xmm1
  imul   %ebp,%eax
  cvtss2sd 0x30(%rsp),%xmm1
  movsd  %xmm1,0x28(%rsp)
  mov    %eax,0x20(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x50(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L25:
  movsd  0x28(%rsp),%xmm0
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  mov    %r15,%rdi
  mov    0x38(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  mov    $0x1,%eax
  call   <aan_ondas_un_canal@plt>
  mov    0x40(%rsp),%rdx
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  movsd  0x28(%rsp),%xmm0
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x1,%eax
  call   <aan_ondas_un_canal@plt>
  mov    0x48(%rsp),%rdx
  mov    %ebp,%r8d
  mov    %r12d,%ecx
  movsd  0x28(%rsp),%xmm0
  mov    0x18(%rsp),%rsi
  mov    %r14,%rdi
  mov    $0x1,%eax
  call   <aan_ondas_un_canal@plt>
  mov    0x38(%rsp),%rdi
  mov    %rbx,%rdx
  mov    %r15,%rsi
  call   <memcpy@plt>
  mov    0x40(%rsp),%rdi
  mov    %rbx,%rdx
  mov    %r13,%rsi
  call   <memcpy@plt>
  mov    0x48(%rsp),%rdi
  mov    %rbx,%rdx
  mov    %r14,%rsi
  call   <memcpy@plt>
  mov    (%rsp),%edx
  mov    0x50(%rsp),%rdi
  xor    %eax,%eax
  lea    D5(%rip),%rsi
  call   <sprintf@plt>
  mov    0x20(%rsp),%esi
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  call   <float_to_uchar@plt>
  mov    0x20(%rsp),%esi
  mov    0x10(%rsp),%rdi
  movslq %eax,%r11
  xor    %eax,%eax
  mov    %r11,0x58(%rsp)
  call   <float_to_uchar@plt>
  mov    0x20(%rsp),%esi
  mov    0x18(%rsp),%rdi
  movslq %eax,%rcx
  xor    %eax,%eax
  mov    %rcx,0x30(%rsp)
  call   <float_to_uchar@plt>
  mov    0x30(%rsp),%rdx
  mov    %ebp,%r9d
  mov    %r12d,%r8d
  movslq %eax,%r10
  mov    0x58(%rsp),%rsi
  mov    0x50(%rsp),%rdi
  xor    %eax,%eax
  mov    %r10,%rcx
  mov    %r10,0x60(%rsp)
  call   <ami_write_bmp@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r15,%rdi
  call   <memcpy@plt>
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r13,%rdi
  call   <memcpy@plt>
  mov    0x18(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r14,%rdi
  call   <memcpy@plt>
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  cmp    %eax,0x6c(%rsp)
  jne    L25
L7:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    0x48(%rsp),%rdi
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <free@plt>
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D5
type_infered: string

tool: D5: imagen_1%05d.bmp

assistant: ```c
void aan_ecuacion_ondas_metodo_explicito(float *red_input, float *green_input, float *blue_input, float *red_output, float *green_output, float *blue_output, int width, int height, float dt, int Niter) {
  int i;
  float *red = (float *)malloc(sizeof(float) * width * height);
  float *green = (float *)malloc(sizeof(float) * width * height);
  float *blue = (float *)malloc(sizeof(float) * width * height);
  float *red_anterior = (float *)malloc(sizeof(float) * width * height);
  float *green_anterior = (float *)malloc(sizeof(float) * width * height);
  float *blue_anterior = (float *)malloc(sizeof(float) * width * height);
  memcpy(red, red_input, sizeof(float) * width * height);
  memcpy(green, green_input, sizeof(float) * width * height);
  memcpy(blue, blue_input, sizeof(float) * width * height);
  memcpy(red_anterior, red_input, sizeof(float) * width * height);
  memcpy(green_anterior, green_input, sizeof(float) * width * height);
  memcpy(blue_anterior, blue_input, sizeof(float) * width * height);
  for (i = 0; i < Niter; i++) {
    unsigned char *ured, *ugreen, *ublue;
    char imagen[100];
    aan_ondas_un_canal(red, red_output, red_anterior, width, height, dt);
    aan_ondas_un_canal(green, green_output, green_anterior, width, height, dt);
    aan_ondas_un_canal(blue, blue_output, blue_anterior, width, height, dt);
    memcpy(red_anterior, red, sizeof(float) * width * height);
    memcpy(green_anterior, green, sizeof(float) * width * height);
    memcpy(blue_anterior, blue, sizeof(float) * width * height);
    sprintf(imagen, "imagen_1%05d.bmp", i);
    ured = float_to_uchar(red_output, width * height);
    ugreen = float_to_uchar(green_output, width * height);
    ublue = float_to_uchar(blue_output, width * height);
    ami_write_bmp(imagen, ured, ugreen, ublue, width, height);
    free(ured);
    free(ugreen);
    free(ublue);
    memcpy(red, red_output, sizeof(float) * width * height);
    memcpy(green, green_output, sizeof(float) * width * height);
    memcpy(blue, blue_output, sizeof(float) * width * height);
  }
  free(red);
  free(green);
  free(blue);
  free(red_anterior);
  free(green_anterior);
  free(blue_anterior);
}
```