user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<imStretch>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %r9,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %edi,%ebx
  lea    0x0(,%rcx,4),%edi
  sub    $0x8,%rsp
  call   <malloc@plt>
  pxor   %xmm5,%xmm5
  lea    -0x1(%r15),%r10d
  pxor   %xmm0,%xmm0
  mov    %rax,%r8
  cvtsi2sd %r10d,%xmm0
  lea    -0x1(%rbx),%eax
  cvtsi2sd %eax,%xmm5
  divsd  %xmm0,%xmm5
  test   %r15d,%r15d
  jle    L5
  cmp    $0x2,%r10d
  jbe    L14
  mov    %r15d,%edx
  movapd %xmm5,%xmm4
  movdqa D36(%rip),%xmm2
  movdqa D9(%rip),%xmm6
  shr    $0x2,%edx
  movapd D11(%rip),%xmm3
  unpcklpd %xmm4,%xmm4
  mov    %r8,%rax
  shl    $0x4,%rdx
  add    %r8,%rdx
  nopl   0x0(%rax)
L57:
  movdqa %xmm2,%xmm0
  add    $0x10,%rax
  paddd  %xmm6,%xmm2
  cvtdq2pd %xmm0,%xmm1
  mulpd  %xmm4,%xmm1
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  mulpd  %xmm4,%xmm0
  addpd  %xmm3,%xmm1
  addpd  %xmm3,%xmm0
  cvttpd2dq %xmm1,%xmm1
  cvttpd2dq %xmm0,%xmm0
  punpcklqdq %xmm0,%xmm1
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L57
  mov    %r15d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r15b
  je     L42
L70:
  pxor   %xmm0,%xmm0
  movsd  D11(%rip),%xmm1
  movslq %eax,%rcx
  cvtsi2sd %eax,%xmm0
  lea    0x0(,%rcx,4),%rdx
  mulsd  %xmm5,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%esi
  mov    %esi,(%r8,%rcx,4)
  lea    0x1(%rax),%ecx
  cmp    %ecx,%r15d
  jle    L42
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  cvtsi2sd %ecx,%xmm0
  mulsd  %xmm5,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%ecx
  mov    %ecx,0x4(%r8,%rdx,1)
  cmp    %eax,%r15d
  jle    L42
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm5,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,0x8(%r8,%rdx,1)
L42:
  pxor   %xmm2,%xmm2
  lea    -0x1(%r13),%eax
  pxor   %xmm0,%xmm0
  sub    $0x1,%r14d
  cvtsi2sd %r14d,%xmm2
  cvtsi2sd %eax,%xmm0
  divsd  %xmm0,%xmm2
  test   %r13d,%r13d
  jle    L5
  mov    %r15d,%edi
  movsd  D11(%rip),%xmm1
  mov    %rbp,%rsi
  xor    %r11d,%r11d
  lea    (%r12,%rdi,1),%r9
  cs nopw 0x0(%rax,%rax,1)
L84:
  mov    %r9,%rax
  mov    %r8,%rdx
  sub    %r10,%rax
  sub    $0x1,%rax
  nopl   (%rax)
L49:
  movslq (%rdx),%rcx
  add    $0x1,%rax
  add    $0x4,%rdx
  movzbl (%rsi,%rcx,1),%ecx
  mov    %cl,-0x1(%rax)
  cmp    %r9,%rax
  jne    L49
  pxor   %xmm0,%xmm0
  add    %rdi,%r9
  cvtsi2sd %r11d,%xmm0
  add    $0x1,%r11d
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%esi
  imul   %ebx,%esi
  movslq %esi,%rsi
  add    %rbp,%rsi
  cmp    %r11d,%r13d
  jne    L84
L5:
  add    $0x8,%rsp
  mov    %r8,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <free@plt>
L14:
  xor    %eax,%eax
  jmp    L70
```

tool_calls: name: unpack_data
arguments: data_tag: D36
type_guessed: byte[16]
name: unpack_data
arguments: data_tag: D9
type_guessed: byte[16]
name: unpack_data
arguments: data_tag: D11
type_guessed: f64[2]

tool: {"D36": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00]}

tool: {"D9": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D11": [0.5,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);
}
```