user: 请将以下的汇编代码转换成C语言代码：

```asm
<scale_image_bilinear>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %edx,-0x60(%rbp)
  mov    %rcx,-0x68(%rbp)
  mov    %r8d,-0x6c(%rbp)
  mov    %r9d,-0x70(%rbp)
  movss  %xmm0,-0x74(%rbp)
  mov    -0x5c(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,0x18(%rbp)
  je     L9
  movss  D9(%rip),%xmm0
  divss  -0x74(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L180
L135:
  cmpl   $0x1,-0x60(%rbp)
  jle    L103
  mov    -0x70(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x44(%rbp),%eax
  shl    $0x8,%eax
  mov    -0x60(%rbp),%edx
  lea    -0x1(%rdx),%ebx
  cltd
  idiv   %ebx
  mov    %eax,-0x38(%rbp)
  mov    -0x60(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jne    L163
  subl   $0x1,-0x38(%rbp)
L163:
  mov    -0x38(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x30(%rbp)
  sarl   $0x8,-0x38(%rbp)
  jmp    L185
L103:
  movl   $0x0,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x38(%rbp)
L185:
  movl   $0x0,-0x48(%rbp)
  jmp    L119
L132:
  cmpl   $0x1,-0x5c(%rbp)
  jle    L151
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x48(%rbp),%eax
  shl    $0x8,%eax
  mov    -0x5c(%rbp),%edx
  lea    -0x1(%rdx),%ebx
  cltd
  idiv   %ebx
  mov    %eax,-0x3c(%rbp)
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jne    L242
  subl   $0x1,-0x3c(%rbp)
L242:
  mov    -0x3c(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  sarl   $0x8,-0x3c(%rbp)
  jmp    L265
L151:
  movl   $0x0,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L265:
  mov    -0x38(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L20
L67:
  mov    0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x74(%rbp),%edx
  movd   %edx,%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %eax,%ebx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x74(%rbp),%edx
  movd   %edx,%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %eax,%ecx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    %ebx,%esi
  mov    %ecx,%edi
  call   <blerp@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x74(%rbp),%edx
  movd   %edx,%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %eax,%ebx
  mov    -0x6c(%rbp),%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x74(%rbp),%edx
  movd   %edx,%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %eax,%ecx
  mov    -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    %ebx,%esi
  mov    %ecx,%edi
  call   <blerp@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <blerp@plt>
  mov    %eax,-0x2c(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  movd   %edx,%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x48(%rbp),%eax
  imul   0x10(%rbp),%eax
  add    %eax,%ecx
  mov    -0x40(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x58(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x18(%rbp)
  addl   $0x1,-0x40(%rbp)
L20:
  mov    -0x40(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L67
  addl   $0x1,-0x48(%rbp)
L119:
  mov    -0x48(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L132
  addl   $0x1,-0x44(%rbp)
L180:
  mov    -0x44(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L135
  jmp    L216
L9:
  movl   $0x0,-0x44(%rbp)
  jmp    L203
L79:
  cmpl   $0x1,-0x60(%rbp)
  jle    L81
  mov    -0x70(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x44(%rbp),%eax
  shl    $0x8,%eax
  mov    -0x60(%rbp),%edx
  lea    -0x1(%rdx),%esi
  cltd
  idiv   %esi
  mov    %eax,-0x38(%rbp)
  mov    -0x60(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jne    L49
  subl   $0x1,-0x38(%rbp)
L49:
  mov    -0x38(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x30(%rbp)
  sarl   $0x8,-0x38(%rbp)
  jmp    L51
L81:
  movl   $0x0,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x38(%rbp)
L51:
  movl   $0x0,-0x48(%rbp)
  jmp    L189
L86:
  cmpl   $0x1,-0x5c(%rbp)
  jle    L37
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x48(%rbp),%eax
  shl    $0x8,%eax
  mov    -0x5c(%rbp),%edx
  lea    -0x1(%rdx),%ebx
  cltd
  idiv   %ebx
  mov    %eax,-0x3c(%rbp)
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jne    L156
  subl   $0x1,-0x3c(%rbp)
L156:
  mov    -0x3c(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x34(%rbp)
  sarl   $0x8,-0x3c(%rbp)
  jmp    L54
L37:
  movl   $0x0,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L54:
  mov    -0x38(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L157
L94:
  mov    0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <blerp@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%ecx
  mov    -0x6c(%rbp),%eax
  imul   0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x34(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <blerp@plt>
  mov    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <blerp@plt>
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jns    L38
  movl   $0x0,-0x2c(%rbp)
L38:
  cmpl   $0xff,-0x2c(%rbp)
  jle    L241
  movl   $0xff,-0x2c(%rbp)
L241:
  mov    -0x44(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  imul   0x10(%rbp),%eax
  add    %eax,%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x18(%rbp)
  addl   $0x1,-0x40(%rbp)
L157:
  mov    -0x40(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L94
  addl   $0x1,-0x48(%rbp)
L189:
  mov    -0x48(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L86
  addl   $0x1,-0x44(%rbp)
L203:
  mov    -0x44(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  jl     L79
L216:
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D9
type: f32

tool: D9: 1

assistant: ```c
void scale_image_bilinear(unsigned char *dst, int dw, int dh, unsigned char *src, int sw, int sh, int bpp, int gc, float gamma) {
  int x, y, n, ix, iy, wx, wy, v, v0, v1;
  int dstride = dw * bpp;
  unsigned char *s;
  float invgamma;
  if (gc) {
    invgamma = 1.0 / gamma;
    for (y = 0; y < dh; ++y) {
      if (dh > 1) {
        iy = (((sh - 1) * y) << 8) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0xff;
        iy >>= 8;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 8) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0xff;
          ix >>= 8;
        } else
          ix = wx = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v0 = blerp(gamma_correct(s[0], gamma), gamma_correct(s[bpp], gamma), wx);
          v1 = blerp(gamma_correct(s[sw * bpp], gamma), gamma_correct(s[(sw + 1) * bpp], gamma), wx);
          v = blerp(v0, v1, wy);
          dst[(y * dstride) + (x * bpp) + n] = gamma_correct(v, invgamma);
          ++s;
        }
      }
    }
  } else {
    for (y = 0; y < dh; ++y) {
      if (dh > 1) {
        iy = (((sh - 1) * y) << 8) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0xff;
        iy >>= 8;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 8) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0xff;
          ix >>= 8;
        } else
          ix = wx = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v0 = blerp(s[0], s[bpp], wx);
          v1 = blerp(s[sw * bpp], s[(sw + 1) * bpp], wx);
          v = blerp(v0, v1, wy);
          if (v < 0)
            v = 0;
          if (v > 255)
            v = 255;
          dst[(y * dstride) + (x * bpp) + n] = v;
          ++s;
        }
      }
    }
  }
}
```