user: Translate the below assembly code into C programming language:

```asm
<scale_image_bilinear>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %esi,0x30(%rsp)
  imul   0xc0(%rsp),%esi
  mov    0xc8(%rsp),%r11d
  mov    %rdi,0x40(%rsp)
  mov    %edx,0x64(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    %r8d,0x78(%rsp)
  mov    %esi,0x6c(%rsp)
  movss  %xmm0,(%rsp)
  test   %r11d,%r11d
  jne    L6
  test   %edx,%edx
  jle    L89
  mov    0x78(%rsp),%ecx
  sub    $0x1,%r9d
  movl   $0x0,0x54(%rsp)
  shl    $0x8,%r9d
  movl   $0x0,0x58(%rsp)
  lea    0x1(%rcx),%eax
  mov    %r9d,0x68(%rsp)
  imul   0xc0(%rsp),%eax
  movl   $0x0,0x60(%rsp)
  movslq %eax,%rbx
  sub    0xc0(%rsp),%eax
  cltq
  mov    %rbx,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  lea    -0x1(%rcx),%eax
  shl    $0x8,%eax
  mov    %eax,0x50(%rsp)
  mov    0xc0(%rsp),%eax
  sub    $0x1,%eax
  add    $0x1,%rax
  mov    %rax,0x48(%rsp)
  nopl   (%rax)
L215:
  mov    0x64(%rsp),%eax
  cmp    $0x1,%eax
  je     L92
  lea    -0x1(%rax),%ecx
  mov    0x58(%rsp),%eax
  mov    0x30(%rsp),%esi
  cltd
  idiv   %ecx
  xor    %edx,%edx
  cmp    0x54(%rsp),%ecx
  sete   %dl
  sub    %edx,%eax
  movzbl %al,%r13d
  sar    $0x8,%eax
  imul   0x78(%rsp),%eax
  mov    %eax,0x34(%rsp)
  test   %esi,%esi
  jle    L213
L166:
  mov    0x60(%rsp),%eax
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x2c(%rsp)
  mov    %eax,0x20(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L35:
  mov    0x30(%rsp),%eax
  cmp    $0x1,%eax
  je     L208
  lea    -0x1(%rax),%esi
  mov    0x2c(%rsp),%eax
  cltd
  idiv   %esi
  mov    %eax,%ecx
  xor    %eax,%eax
  cmp    0x18(%rsp),%esi
  sete   %al
  sub    %eax,%ecx
  movzbl %cl,%ebx
  sar    $0x8,%ecx
  add    0x34(%rsp),%ecx
L103:
  imul   0xc0(%rsp),%ecx
  mov    0x38(%rsp),%rax
  movslq %ecx,%rcx
  lea    (%rax,%rcx,1),%rbp
  mov    0xc0(%rsp),%ecx
  test   %ecx,%ecx
  jle    L193
  mov    0x40(%rsp),%rax
  movslq 0x20(%rsp),%r9
  movslq 0xc0(%rsp),%r12
  lea    (%rax,%r9,1),%r14
  mov    0x48(%rsp),%rax
  add    %rbp,%rax
  mov    %rax,(%rsp)
  mov    %r12,%rax
  mov    %rbp,%r12
  mov    %r14,%rbp
  mov    %rax,%r14
  nop
L162:
  movzbl (%r12,%r14,1),%esi
  movzbl (%r12),%edi
  mov    %ebx,%edx
  call   <blerp@plt>
  mov    %ebx,%edx
  mov    %eax,%r15d
  mov    0x8(%rsp),%rax
  movzbl (%r12,%rax,1),%esi
  mov    0x10(%rsp),%rax
  movzbl (%r12,%rax,1),%edi
  call   <blerp@plt>
  mov    %r13d,%edx
  mov    %r15d,%edi
  mov    %eax,%esi
  call   <blerp@plt>
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  xor    %edx,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  add    $0x1,%r12
  add    $0x1,%rbp
  mov    %al,-0x1(%rbp)
  cmp    (%rsp),%r12
  jne    L162
L193:
  mov    0xc0(%rsp),%ebx
  addl   $0x1,0x18(%rsp)
  add    %ebx,0x20(%rsp)
  mov    0x18(%rsp),%eax
  mov    0x50(%rsp),%ebx
  add    %ebx,0x2c(%rsp)
  cmp    %eax,0x30(%rsp)
  jg     L35
L213:
  mov    0x6c(%rsp),%ebx
  addl   $0x1,0x54(%rsp)
  add    %ebx,0x60(%rsp)
  mov    0x54(%rsp),%eax
  mov    0x68(%rsp),%ebx
  add    %ebx,0x58(%rsp)
  cmp    %eax,0x64(%rsp)
  jne    L215
L89:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  mov    0x64(%rsp),%r10d
  movss  D7(%rip),%xmm0
  divss  (%rsp),%xmm0
  movss  %xmm0,0x2c(%rsp)
  test   %r10d,%r10d
  jle    L89
  mov    0x78(%rsp),%ecx
  sub    $0x1,%r9d
  movl   $0x0,0x74(%rsp)
  shl    $0x8,%r9d
  movl   $0x0,0x70(%rsp)
  lea    0x1(%rcx),%eax
  mov    %r9d,0x7c(%rsp)
  imul   0xc0(%rsp),%eax
  movl   $0x0,0x68(%rsp)
  movslq %eax,%rdx
  sub    0xc0(%rsp),%eax
  cltq
  mov    %rdx,0x18(%rsp)
  mov    %rax,0x20(%rsp)
  lea    -0x1(%rcx),%eax
  shl    $0x8,%eax
  mov    %eax,0x60(%rsp)
  mov    0xc0(%rsp),%eax
  sub    $0x1,%eax
  add    $0x1,%rax
  mov    %rax,0x58(%rsp)
  mov    0x64(%rsp),%eax
  cmp    $0x1,%eax
  je     L133
L141:
  lea    -0x1(%rax),%ecx
  mov    0x74(%rsp),%eax
  mov    0x30(%rsp),%r8d
  cltd
  idiv   %ecx
  xor    %edx,%edx
  cmp    0x68(%rsp),%ecx
  sete   %dl
  sub    %edx,%eax
  movzbl %al,%r14d
  sar    $0x8,%eax
  imul   0x78(%rsp),%eax
  mov    %eax,0x54(%rsp)
  test   %r8d,%r8d
  jle    L145
L179:
  mov    0x70(%rsp),%eax
  movl   $0x0,0x48(%rsp)
  movl   $0x0,0x34(%rsp)
  mov    %eax,0x50(%rsp)
  nopl   (%rax)
L196:
  mov    0x30(%rsp),%eax
  cmp    $0x1,%eax
  je     L60
  lea    -0x1(%rax),%ecx
  mov    0x48(%rsp),%eax
  cltd
  idiv   %ecx
  mov    %eax,%ebx
  xor    %eax,%eax
  cmp    0x34(%rsp),%ecx
  sete   %al
  sub    %eax,%ebx
  movzbl %bl,%ebp
  sar    $0x8,%ebx
  add    0x54(%rsp),%ebx
L178:
  imul   0xc0(%rsp),%ebx
  mov    0xc0(%rsp),%edi
  movslq %ebx,%rbx
  add    0x38(%rsp),%rbx
  test   %edi,%edi
  jle    L68
  movslq 0xc0(%rsp),%rax
  movslq 0x50(%rsp),%rcx
  mov    %rax,0x10(%rsp)
  mov    0x40(%rsp),%rax
  lea    (%rax,%rcx,1),%r12
  mov    0x58(%rsp),%rax
  mov    %r12,%r13
  add    %rbx,%rax
  mov    %rax,0x8(%rsp)
L49:
  mov    0x10(%rsp),%rax
  movss  (%rsp),%xmm0
  add    $0x1,%rbx
  add    $0x1,%r13
  movzbl -0x1(%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  movzbl -0x1(%rbx),%edi
  mov    %eax,%r12d
  call   <gamma_correct@plt>
  mov    %r12d,%esi
  mov    %ebp,%edx
  mov    %eax,%edi
  call   <blerp@plt>
  movss  (%rsp),%xmm0
  mov    %eax,%r15d
  mov    0x18(%rsp),%rax
  movzbl -0x1(%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,%r12d
  mov    0x20(%rsp),%rax
  movzbl -0x1(%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %eax,%edi
  call   <blerp@plt>
  mov    %r14d,%edx
  mov    %r15d,%edi
  mov    %eax,%esi
  call   <blerp@plt>
  movss  0x2c(%rsp),%xmm0
  mov    %eax,%edi
  call   <gamma_correct@plt>
  mov    %al,-0x1(%r13)
  cmp    0x8(%rsp),%rbx
  jne    L49
L68:
  mov    0xc0(%rsp),%ebx
  addl   $0x1,0x34(%rsp)
  add    %ebx,0x50(%rsp)
  mov    0x34(%rsp),%eax
  mov    0x60(%rsp),%ebx
  add    %ebx,0x48(%rsp)
  cmp    %eax,0x30(%rsp)
  jg     L196
L145:
  mov    0x6c(%rsp),%ebx
  addl   $0x1,0x68(%rsp)
  add    %ebx,0x70(%rsp)
  mov    0x68(%rsp),%eax
  mov    0x7c(%rsp),%ebx
  add    %ebx,0x74(%rsp)
  cmp    %eax,0x64(%rsp)
  je     L89
  mov    0x64(%rsp),%eax
  cmp    $0x1,%eax
  jne    L141
L133:
  mov    0x30(%rsp),%edx
  test   %edx,%edx
  jle    L89
  movl   $0x0,0x54(%rsp)
  xor    %r14d,%r14d
  jmp    L179
  xchg   %ax,%ax
L60:
  mov    0x54(%rsp),%ebx
  xor    %ebp,%ebp
  jmp    L178
  nopl   0x0(%rax,%rax,1)
L208:
  mov    0x34(%rsp),%ecx
  xor    %ebx,%ebx
  jmp    L103
L92:
  mov    0x30(%rsp),%eax
  test   %eax,%eax
  jle    L89
  movl   $0x0,0x34(%rsp)
  xor    %r13d,%r13d
  jmp    L166
```

tool_calls: name: disassemble_data
arguments: label: D7
data_type: f32

tool: D7: 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;
        }
      }
    }
  }
}
```