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

```asm
<scale_image_bicubic>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x108,%rsp
  mov    %esi,0xc0(%rsp)
  imul   0x140(%rsp),%esi
  mov    0x148(%rsp),%r11d
  mov    %rdi,0xd0(%rsp)
  mov    %edx,0xc4(%rsp)
  mov    %rcx,0xc8(%rsp)
  mov    %r8d,0xf0(%rsp)
  mov    %esi,0xec(%rsp)
  movss  %xmm0,(%rsp)
  test   %r11d,%r11d
  jne    L29
  test   %edx,%edx
  jle    L283
  mov    0xf0(%rsp),%esi
  sub    $0x1,%r9d
  movl   $0x0,0xb8(%rsp)
  movl   $0x0,0xdc(%rsp)
  shl    $0x7,%r9d
  lea    0x3(%rsi),%eax
  lea    (%rsi,%rsi,1),%edi
  mov    %r9d,0xe0(%rsp)
  imul   0x140(%rsp),%eax
  movl   $0x0,0xd8(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  mov    %rbx,0x10(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  mov    %eax,%ecx
  mov    %rbx,0x18(%rsp)
  sub    0x140(%rsp),%ecx
  movslq %eax,%rbx
  mov    %rbx,0x20(%rsp)
  movslq %ecx,%rbx
  mov    %rbx,0x28(%rsp)
  mov    0x140(%rsp),%ebx
  lea    (%rbx,%rbx,1),%r8d
  mov    %r8d,%edx
  add    %ebx,%edx
  movslq %edx,%rbx
  lea    0x3(%rdi),%edx
  imul   0x140(%rsp),%edx
  mov    %rbx,0x60(%rsp)
  movslq %r8d,%rbx
  mov    %rbx,0x68(%rsp)
  mov    %esi,%ebx
  movslq %edx,%rsi
  sub    %r8d,%edx
  mov    %rsi,0x30(%rsp)
  lea    (%rax,%rax,1),%esi
  movslq %edx,%rdx
  movslq %esi,%r11
  add    %eax,%esi
  mov    %rdx,0x40(%rsp)
  lea    (%rcx,%rcx,1),%edx
  movslq %esi,%rax
  mov    %ebx,%esi
  mov    %r11,0x38(%rsp)
  movslq %edx,%r11
  mov    %rax,0x78(%rsp)
  lea    0x2(%rbx,%rdi,1),%eax
  add    %ecx,%edx
  imul   0x140(%rsp),%eax
  mov    %r11,0x48(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  cltq
  mov    %rbx,0x80(%rsp)
  mov    %rax,0x88(%rsp)
  movslq %edx,%rax
  mov    %rax,0x90(%rsp)
  lea    -0x1(%rsi),%eax
  shl    $0x7,%eax
  mov    %eax,0xb0(%rsp)
  movslq 0x140(%rsp),%rax
  mov    %rax,0x70(%rsp)
  mov    0xc4(%rsp),%eax
  cmp    $0x1,%eax
  je     L319
L138:
  lea    -0x1(%rax),%ecx
  mov    0xdc(%rsp),%eax
  mov    0xc0(%rsp),%esi
  cltd
  idiv   %ecx
  mov    %eax,%r13d
  xor    %eax,%eax
  cmp    0xb8(%rsp),%ecx
  sete   %al
  sub    %eax,%r13d
  mov    %r13d,%eax
  sar    $0x7,%r13d
  and    $0x7f,%eax
  mov    %eax,0xc(%rsp)
  lea    -0x1(%r13),%eax
  test   %esi,%esi
  jle    L82
L119:
  imul   0xf0(%rsp),%eax
  movl   $0x0,0x58(%rsp)
  movl   $0x0,0xa0(%rsp)
  mov    %eax,0xa8(%rsp)
  mov    0xd8(%rsp),%eax
  mov    %eax,0x98(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L300:
  mov    0xc0(%rsp),%eax
  cmp    $0x1,%eax
  je     L131
  lea    -0x1(%rax),%ecx
  mov    0xa0(%rsp),%eax
  cltd
  idiv   %ecx
  mov    %eax,%ebx
  xor    %eax,%eax
  cmp    0x58(%rsp),%ecx
  sete   %al
  sub    %eax,%ebx
  mov    %ebx,%r12d
  sar    $0x7,%ebx
  and    $0x7f,%r12d
  sub    $0x1,%ebx
L112:
  add    0xa8(%rsp),%ebx
  imul   0x140(%rsp),%ebx
  mov    0x140(%rsp),%ecx
  movslq %ebx,%rbx
  add    0xc8(%rsp),%rbx
  test   %ecx,%ecx
  jle    L218
  mov    0xc4(%rsp),%eax
  movslq 0x98(%rsp),%rbp
  add    0xd0(%rsp),%rbp
  sub    $0x1,%eax
  mov    %eax,0x8(%rsp)
  mov    0x140(%rsp),%eax
  sub    $0x1,%eax
  lea    0x1(%rbx,%rax,1),%rax
  mov    %rax,(%rsp)
  jmp    L188
  nopl   0x0(%rax,%rax,1)
L19:
  mov    0xc(%rsp),%r8d
  mov    %r10d,%edx
  mov    %r14d,%esi
  mov    %r15d,%edi
  call   <icerp@plt>
  mov    $0xff,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  xor    %edx,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  add    $0x1,%rbx
  add    $0x1,%rbp
  mov    %al,-0x1(%rbp)
  cmp    (%rsp),%rbx
  je     L218
L188:
  mov    0x10(%rsp),%rax
  mov    %r12d,%r8d
  movzbl (%rbx,%rax,1),%ecx
  mov    0x18(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    0x20(%rsp),%rax
  movzbl (%rbx,%rax,1),%esi
  mov    0x28(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <icerp@plt>
  mov    %eax,%r14d
  mov    %eax,%r15d
  test   %r13d,%r13d
  jle    L63
  mov    0x60(%rsp),%rax
  movzbl (%rbx),%edi
  mov    %r12d,%r8d
  movzbl (%rbx,%rax,1),%ecx
  mov    0x68(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    0x70(%rsp),%rax
  movzbl (%rbx,%rax,1),%esi
  call   <icerp@plt>
  mov    %eax,%r15d
L63:
  mov    0x30(%rsp),%rax
  mov    %r12d,%r8d
  movzbl (%rbx,%rax,1),%ecx
  mov    0x38(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    0x40(%rsp),%rax
  movzbl (%rbx,%rax,1),%esi
  mov    0x48(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <icerp@plt>
  mov    %eax,%r10d
  mov    %eax,%ecx
  cmp    0x8(%rsp),%r13d
  jge    L19
  mov    %eax,0x50(%rsp)
  mov    0x78(%rsp),%rax
  mov    %r12d,%r8d
  movzbl (%rbx,%rax,1),%ecx
  mov    0x80(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    0x88(%rsp),%rax
  movzbl (%rbx,%rax,1),%esi
  mov    0x90(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <icerp@plt>
  mov    0x50(%rsp),%r10d
  mov    %eax,%ecx
  jmp    L19
  nopw   0x0(%rax,%rax,1)
L294:
  mov    0x140(%rsp),%ecx
  addl   $0x1,0x80(%rsp)
  add    %ecx,0xd8(%rsp)
  mov    0x80(%rsp),%eax
  mov    0xe4(%rsp),%ecx
  add    %ecx,0xdc(%rsp)
  cmp    %eax,0xc0(%rsp)
  jg     L84
L121:
  mov    0xec(%rsp),%ebx
  addl   $0x1,0xe8(%rsp)
  add    %ebx,0xf4(%rsp)
  mov    0xe8(%rsp),%eax
  mov    0xfc(%rsp),%ebx
  add    %ebx,0xf8(%rsp)
  cmp    %eax,0xc4(%rsp)
  jne    L317
L283:
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  mov    0xc4(%rsp),%r10d
  movss  D9(%rip),%xmm0
  divss  (%rsp),%xmm0
  movss  %xmm0,0x70(%rsp)
  test   %r10d,%r10d
  jle    L283
  mov    0xf0(%rsp),%esi
  sub    $0x1,%r9d
  movl   $0x0,0xf8(%rsp)
  movl   $0x0,0xf4(%rsp)
  shl    $0x7,%r9d
  lea    0x3(%rsi),%eax
  lea    (%rsi,%rsi,1),%edi
  mov    %r9d,0xfc(%rsp)
  imul   0x140(%rsp),%eax
  movl   $0x0,0xe8(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  mov    %rbx,0x30(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  mov    %eax,%ecx
  mov    %rbx,0x38(%rsp)
  sub    0x140(%rsp),%ecx
  movslq %eax,%rbx
  mov    %rbx,0x40(%rsp)
  movslq %ecx,%rbx
  mov    %rbx,0x48(%rsp)
  mov    0x140(%rsp),%ebx
  lea    (%rbx,%rbx,1),%r8d
  mov    %r8d,%edx
  add    %ebx,%edx
  movslq %edx,%rbx
  lea    0x3(%rdi),%edx
  imul   0x140(%rsp),%edx
  mov    %rbx,0x88(%rsp)
  movslq %r8d,%rbx
  mov    %rbx,0x90(%rsp)
  mov    %esi,%ebx
  movslq %edx,%rsi
  sub    %r8d,%edx
  mov    %rsi,0x50(%rsp)
  lea    (%rax,%rax,1),%esi
  movslq %edx,%rdx
  movslq %esi,%r11
  add    %eax,%esi
  mov    %rdx,0x60(%rsp)
  lea    (%rcx,%rcx,1),%edx
  movslq %esi,%rax
  mov    %ebx,%esi
  mov    %r11,0x58(%rsp)
  movslq %edx,%r11
  mov    %rax,0xa0(%rsp)
  lea    0x2(%rbx,%rdi,1),%eax
  add    %ecx,%edx
  imul   0x140(%rsp),%eax
  mov    %r11,0x68(%rsp)
  movslq %eax,%rbx
  sub    0x140(%rsp),%eax
  cltq
  mov    %rbx,0xa8(%rsp)
  mov    %rax,0xb0(%rsp)
  movslq %edx,%rax
  mov    %rax,0xb8(%rsp)
  lea    -0x1(%rsi),%eax
  shl    $0x7,%eax
  mov    %eax,0xe4(%rsp)
  movslq 0x140(%rsp),%rax
  mov    %rax,0x98(%rsp)
  nopl   0x0(%rax)
L317:
  mov    0xc4(%rsp),%eax
  cmp    $0x1,%eax
  je     L247
  lea    -0x1(%rax),%ecx
  mov    0xf8(%rsp),%eax
  mov    0xc0(%rsp),%r8d
  cltd
  idiv   %ecx
  mov    %eax,%r13d
  xor    %eax,%eax
  cmp    0xe8(%rsp),%ecx
  sete   %al
  sub    %eax,%r13d
  mov    %r13d,%eax
  sar    $0x7,%r13d
  and    $0x7f,%eax
  mov    %eax,0x28(%rsp)
  lea    -0x1(%r13),%eax
  test   %r8d,%r8d
  jle    L121
L213:
  imul   0xf0(%rsp),%eax
  movl   $0x0,0xdc(%rsp)
  movl   $0x0,0x80(%rsp)
  mov    %eax,0xe0(%rsp)
  mov    0xf4(%rsp),%eax
  mov    %eax,0xd8(%rsp)
  nopl   (%rax)
L84:
  mov    0xc0(%rsp),%eax
  cmp    $0x1,%eax
  je     L104
  lea    -0x1(%rax),%ecx
  mov    0xdc(%rsp),%eax
  cltd
  idiv   %ecx
  mov    %eax,%ebx
  xor    %eax,%eax
  cmp    0x80(%rsp),%ecx
  sete   %al
  sub    %eax,%ebx
  mov    %ebx,%r12d
  sar    $0x7,%ebx
  and    $0x7f,%r12d
  sub    $0x1,%ebx
L204:
  add    0xe0(%rsp),%ebx
  imul   0x140(%rsp),%ebx
  mov    0x140(%rsp),%edi
  movslq %ebx,%rbx
  add    0xc8(%rsp),%rbx
  test   %edi,%edi
  jle    L294
  mov    0xc4(%rsp),%eax
  movslq 0xd8(%rsp),%rbp
  add    0xd0(%rsp),%rbp
  sub    $0x1,%eax
  mov    %eax,0x20(%rsp)
  mov    0x140(%rsp),%eax
  sub    $0x1,%eax
  lea    0x1(%rbx,%rax,1),%rax
  mov    %rax,0x18(%rsp)
  jmp    L9
  nopw   0x0(%rax,%rax,1)
L139:
  mov    0x28(%rsp),%r8d
  mov    %r10d,%edx
  mov    %r14d,%esi
  mov    %r15d,%edi
  call   <icerp@plt>
  mov    $0xff,%edx
  movss  0x70(%rsp),%xmm0
  cmp    %edx,%eax
  cmovle %eax,%edx
  xor    %eax,%eax
  mov    %edx,%edi
  test   %edx,%edx
  cmovs  %eax,%edi
  add    $0x1,%rbx
  add    $0x1,%rbp
  call   <gamma_correct@plt>
  mov    %al,-0x1(%rbp)
  cmp    %rbx,0x18(%rsp)
  je     L294
L9:
  mov    0x30(%rsp),%rax
  movss  (%rsp),%xmm0
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x8(%rsp)
  mov    0x38(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,%r15d
  mov    0x40(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,%r14d
  mov    0x48(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  mov    0x8(%rsp),%ecx
  mov    %r15d,%edx
  mov    %r14d,%esi
  mov    %eax,%edi
  mov    %r12d,%r8d
  call   <icerp@plt>
  mov    %eax,%r14d
  mov    %eax,%r15d
  test   %r13d,%r13d
  jle    L12
  mov    0x88(%rsp),%rax
  movss  (%rsp),%xmm0
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0xc(%rsp)
  mov    0x90(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x8(%rsp)
  mov    0x98(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movzbl (%rbx),%edi
  movss  (%rsp),%xmm0
  mov    %eax,%r15d
  call   <gamma_correct@plt>
  mov    0xc(%rsp),%ecx
  mov    0x8(%rsp),%edx
  mov    %r15d,%esi
  mov    %eax,%edi
  mov    %r12d,%r8d
  call   <icerp@plt>
  mov    %eax,%r15d
L12:
  mov    0x50(%rsp),%rax
  movss  (%rsp),%xmm0
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x10(%rsp)
  mov    0x58(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0xc(%rsp)
  mov    0x60(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x8(%rsp)
  mov    0x68(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  mov    0x10(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    %r12d,%r8d
  mov    0x8(%rsp),%esi
  mov    %eax,%edi
  call   <icerp@plt>
  mov    %eax,%r10d
  mov    %eax,%ecx
  cmp    0x20(%rsp),%r13d
  jge    L139
  mov    %eax,0x78(%rsp)
  mov    0xa0(%rsp),%rax
  movss  (%rsp),%xmm0
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x10(%rsp)
  mov    0xa8(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0xc(%rsp)
  mov    0xb0(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  movss  (%rsp),%xmm0
  mov    %eax,0x8(%rsp)
  mov    0xb8(%rsp),%rax
  movzbl (%rbx,%rax,1),%edi
  call   <gamma_correct@plt>
  mov    0x10(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    %r12d,%r8d
  mov    0x8(%rsp),%esi
  mov    %eax,%edi
  call   <icerp@plt>
  mov    0x78(%rsp),%r10d
  mov    %eax,%ecx
  jmp    L139
  cs nopw 0x0(%rax,%rax,1)
L218:
  mov    0x140(%rsp),%ecx
  addl   $0x1,0x58(%rsp)
  add    %ecx,0x98(%rsp)
  mov    0x58(%rsp),%eax
  mov    0xb0(%rsp),%ecx
  add    %ecx,0xa0(%rsp)
  cmp    %eax,0xc0(%rsp)
  jg     L300
L82:
  mov    0xec(%rsp),%ebx
  addl   $0x1,0xb8(%rsp)
  add    %ebx,0xd8(%rsp)
  mov    0xb8(%rsp),%eax
  mov    0xe0(%rsp),%ebx
  add    %ebx,0xdc(%rsp)
  cmp    %eax,0xc4(%rsp)
  je     L283
  mov    0xc4(%rsp),%eax
  cmp    $0x1,%eax
  jne    L138
L319:
  mov    0xc0(%rsp),%eax
  test   %eax,%eax
  jle    L283
  movl   $0x0,0xc(%rsp)
  xor    %r13d,%r13d
  mov    $0xffffffff,%eax
  jmp    L119
  xchg   %ax,%ax
L131:
  xor    %r12d,%r12d
  mov    $0xffffffff,%ebx
  jmp    L112
  nopl   (%rax)
L104:
  mov    $0xffffffff,%ebx
  xor    %r12d,%r12d
  jmp    L204
L247:
  mov    0xc0(%rsp),%edx
  test   %edx,%edx
  jle    L283
  movl   $0x0,0x28(%rsp)
  mov    $0xffffffff,%eax
  xor    %r13d,%r13d
  jmp    L213
```

tool_calls: name: disassemble_data
arguments: data_tag: D9
datatype: f32

tool: D9: 1

assistant: ```c
void scale_image_bicubic(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;
  int a, b, c, d;
  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) << 7) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0x7f;
        iy >>= 7;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 7) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0x7f;
          ix >>= 7;
        } else
          ix = wx = 0;
        s = src + ((iy - 1) * sw + (ix - 1)) * bpp;
        for (n = 0; n < bpp; ++n) {
          b = icerp(gamma_correct(s[(sw + 0) * bpp], gamma), gamma_correct(s[(sw + 1) * bpp], gamma), gamma_correct(s[(sw + 2) * bpp], gamma), gamma_correct(s[(sw + 3) * bpp], gamma), wx);
          if (iy > 0) {
            a = icerp(gamma_correct(s[0], gamma), gamma_correct(s[bpp], gamma), gamma_correct(s[2 * bpp], gamma), gamma_correct(s[3 * bpp], gamma), wx);
          } else
            a = b;
          c = icerp(gamma_correct(s[(2 * sw + 0) * bpp], gamma), gamma_correct(s[(2 * sw + 1) * bpp], gamma), gamma_correct(s[(2 * sw + 2) * bpp], gamma), gamma_correct(s[(2 * sw + 3) * bpp], gamma), wx);
          if (iy < dh - 1) {
            d = icerp(gamma_correct(s[(3 * sw + 0) * bpp], gamma), gamma_correct(s[(3 * sw + 1) * bpp], gamma), gamma_correct(s[(3 * sw + 2) * bpp], gamma), gamma_correct(s[(3 * sw + 3) * bpp], gamma), wx);
          } else
            d = c;
          v = icerp(a, b, c, d, wy);
          if (v < 0)
            v = 0;
          if (v > 255)
            v = 255;
          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) << 7) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0x7f;
        iy >>= 7;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 7) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0x7f;
          ix >>= 7;
        } else
          ix = wx = 0;
        s = src + ((iy - 1) * sw + (ix - 1)) * bpp;
        for (n = 0; n < bpp; ++n) {
          b = icerp(s[(sw + 0) * bpp], s[(sw + 1) * bpp], s[(sw + 2) * bpp], s[(sw + 3) * bpp], wx);
          if (iy > 0) {
            a = icerp(s[0], s[bpp], s[2 * bpp], s[3 * bpp], wx);
          } else
            a = b;
          c = icerp(s[(2 * sw + 0) * bpp], s[(2 * sw + 1) * bpp], s[(2 * sw + 2) * bpp], s[(2 * sw + 3) * bpp], wx);
          if (iy < dh - 1) {
            d = icerp(s[(3 * sw + 0) * bpp], s[(3 * sw + 1) * bpp], s[(3 * sw + 2) * bpp], s[(3 * sw + 3) * bpp], wx);
          } else
            d = c;
          v = icerp(a, b, c, d, wy);
          if (v < 0)
            v = 0;
          if (v > 255)
            v = 255;
          dst[(y * dstride) + (x * bpp) + n] = v;
          ++s;
        }
      }
    }
  }
}
```