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

```asm
<unir_cuatro_imagenes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x54(%rbp)
  mov    %r9d,-0x58(%rbp)
  mov    -0x54(%rbp),%eax
  add    %eax,%eax
  cltq
  mov    %eax,%edx
  mov    -0x58(%rbp),%eax
  add    %eax,%eax
  cltq
  imul   %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x54(%rbp),%eax
  imul   -0x58(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L18
L1:
  movl   $0x0,-0x24(%rbp)
  jmp    L100
L27:
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L100:
  mov    -0x24(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L27
  addl   $0x1,-0x28(%rbp)
L18:
  mov    -0x28(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L1
  movl   $0x0,-0x28(%rbp)
  jmp    L43
L40:
  movl   $0x0,-0x24(%rbp)
  jmp    L139
L74:
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L139:
  mov    -0x24(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L74
  addl   $0x1,-0x28(%rbp)
L43:
  mov    -0x28(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L40
  movl   $0x0,-0x28(%rbp)
  jmp    L137
L82:
  movl   $0x0,-0x24(%rbp)
  jmp    L134
L123:
  mov    -0x58(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  add    %edx,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L134:
  mov    -0x24(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L123
  addl   $0x1,-0x28(%rbp)
L137:
  mov    -0x28(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L82
  movl   $0x0,-0x28(%rbp)
  jmp    L63
L115:
  movl   $0x0,-0x24(%rbp)
  jmp    L29
L46:
  mov    -0x58(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  add    %edx,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x54(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x54(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x24(%rbp)
L29:
  mov    -0x24(%rbp),%eax
  cmp    -0x58(%rbp),%eax
  jl     L46
  addl   $0x1,-0x28(%rbp)
L63:
  mov    -0x28(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L115
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
float *unir_cuatro_imagenes(float *a, float *b, float *c, float *d, int width, int height) {
  int i, j;
  float *output = (float *)malloc(sizeof(float) * (width * 2) * (height * 2));
  float *tmp = output + (width * 2) * height;
  for (i = 0; i < width; i++) {
    for (j = 0; j < height; j++) {
      int index = (width * 2) * j + i;
      output[index] = c[width * j + i];
    }
  }
  for (i = 0; i < width; i++) {
    for (j = 0; j < height; j++) {
      int index = (width * 2) * j + i + width;
      output[index] = d[width * j + i];
    }
  }
  for (i = 0; i < width; i++) {
    for (j = 0; j < height; j++) {
      int index = (height * width * 2) + (width * 2) * j + i;
      output[index] = a[width * j + i];
    }
  }
  for (i = 0; i < width; i++) {
    for (j = 0; j < height; j++) {
      int index = (height * width * 2) + (width * 2) * j + i + width;
      output[index] = b[width * j + i];
    }
  }
  return output;
}
```