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

```asm
<imStretch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %rdx,-0x40(%rbp)
  mov    %ecx,-0x44(%rbp)
  mov    %r8d,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L54
L16:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x24(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  movsd  D12(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  cvttsd2si %xmm0,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
L54:
  mov    -0x24(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L16
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L28
L8:
  movl   $0x0,-0x24(%rbp)
  jmp    L41
L5:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x50(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x50(%rbp)
  movzbl (%rcx),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x24(%rbp)
L41:
  mov    -0x24(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L5
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x8(%rbp),%xmm1
  movsd  D12(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    -0x34(%rbp),%edx
  imul   %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  addl   $0x1,-0x20(%rbp)
L28:
  mov    -0x20(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jl     L8
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D12
type_guessed: f64

tool: D12: 0.5

assistant: ```c
void imStretch(int src_width, int src_height, unsigned char *src_map, int dst_width, int dst_height, unsigned char *dst_map) {
  int x, y, offset;
  double factor;
  unsigned char *line_map;
  int *XTab = (int *)malloc(dst_width * sizeof(int));
  factor = (double)(src_width - 1) / (double)(dst_width - 1);
  for (x = 0; x < dst_width; x++)
    XTab[x] = (int)(factor * x + 0.5);
  factor = (double)(src_height - 1) / (double)(dst_height - 1);
  line_map = src_map;
  for (y = 0; y < dst_height; y++) {
    for (x = 0; x < dst_width; x++) {
      offset = XTab[x];
      *(dst_map++) = line_map[offset];
    }
    offset = ((int)(factor * y + 0.5)) * src_width;
    line_map = src_map + offset;
  }
  free(XTab);
}
```