user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<scale_internal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %esi,-0x88(%rbp)
  mov    %edx,-0x8c(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8d,-0x90(%rbp)
  mov    %r9d,-0x9c(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xa8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x90(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0x88(%rbp)
  jne    L147
  mov    -0x9c(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0x8c(%rbp)
  jne    L147
  mov    -0xa8(%rbp),%rdi
  mov    -0x98(%rbp),%rcx
  mov    -0x8c(%rbp),%edx
  mov    -0x88(%rbp),%esi
  mov    -0x84(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <halveImage@plt>
  jmp    L68
L147:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x8c(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x9c(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x88(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x90(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x3c(%rbp)
  movss  -0x3c(%rbp),%xmm0
  movss  D15(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x38(%rbp)
  movss  -0x40(%rbp),%xmm0
  movss  D15(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x34(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L167
L163:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x40(%rbp),%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x54(%rbp),%xmm2
  movsd  D46(%rip),%xmm0
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x6c(%rbp)
  mov    -0x8c(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jle    L15
  movss  -0x6c(%rbp),%xmm0
  addss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x64(%rbp)
  movss  -0x6c(%rbp),%xmm0
  subss  -0x34(%rbp),%xmm0
  movss  %xmm0,-0x68(%rbp)
  jmp    L119
L15:
  movss  -0x6c(%rbp),%xmm1
  movss  D16(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x64(%rbp)
  movss  -0x6c(%rbp),%xmm0
  movss  D16(%rip),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x68(%rbp)
L119:
  movl   $0x0,-0x50(%rbp)
  jmp    L160
L135:
  pxor   %xmm1,%xmm1
  cvtss2sd -0x3c(%rbp),%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x50(%rbp),%xmm2
  movsd  D46(%rip),%xmm0
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x78(%rbp)
  mov    -0x88(%rbp),%eax
  cmp    -0x90(%rbp),%eax
  jle    L186
  movss  -0x78(%rbp),%xmm0
  addss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x70(%rbp)
  movss  -0x78(%rbp),%xmm0
  subss  -0x38(%rbp),%xmm0
  movss  %xmm0,-0x74(%rbp)
  jmp    L14
L186:
  movss  -0x78(%rbp),%xmm1
  movss  D16(%rip),%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x70(%rbp)
  movss  -0x78(%rbp),%xmm0
  movss  D16(%rip),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x74(%rbp)
L14:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x14(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x18(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x1c(%rbp),%xmm0
  movss  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  movss  -0x68(%rbp),%xmm0
  movss  %xmm0,-0x6c(%rbp)
  mov    -0x6c(%rbp),%eax
  movd   %eax,%xmm0
  call   <floor@plt>
  mov    %eax,-0x48(%rbp)
  jmp    L215
L225:
  mov    -0x48(%rbp),%edx
  mov    -0x8c(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x8c(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  comiss -0x64(%rbp),%xmm0
  jbe    L1
  movss  -0x64(%rbp),%xmm0
  subss  -0x6c(%rbp),%xmm0
  movss  %xmm0,-0x5c(%rbp)
  jmp    L152
L1:
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  subss  -0x6c(%rbp),%xmm0
  movss  %xmm0,-0x5c(%rbp)
L152:
  movss  -0x74(%rbp),%xmm0
  movss  %xmm0,-0x78(%rbp)
  mov    -0x78(%rbp),%eax
  movd   %eax,%xmm0
  call   <floor@plt>
  mov    %eax,-0x44(%rbp)
  jmp    L17
L212:
  mov    -0x44(%rbp),%edx
  mov    -0x88(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x88(%rbp)
  mov    %edx,-0x28(%rbp)
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  comiss -0x70(%rbp),%xmm0
  jbe    L154
  movss  -0x70(%rbp),%xmm0
  subss  -0x78(%rbp),%xmm0
  movss  %xmm0,-0x60(%rbp)
  jmp    L79
L154:
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  subss  -0x78(%rbp),%xmm0
  movss  %xmm0,-0x60(%rbp)
L79:
  movss  -0x60(%rbp),%xmm0
  mulss  -0x5c(%rbp),%xmm0
  movss  %xmm0,-0x24(%rbp)
  movss  -0x58(%rbp),%xmm0
  addss  -0x24(%rbp),%xmm0
  movss  %xmm0,-0x58(%rbp)
  mov    -0x2c(%rbp),%eax
  imul   -0x88(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  add    %eax,%edx
  mov    -0x84(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L192
L157:
  mov    -0x4c(%rbp),%eax
  cltq
  movss  -0x20(%rbp,%rax,4),%xmm1
  mov    -0x30(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  -0x24(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x4c(%rbp),%eax
  cltq
  movss  %xmm0,-0x20(%rbp,%rax,4)
  addl   $0x1,-0x4c(%rbp)
L192:
  mov    -0x4c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L157
  addl   $0x1,-0x44(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x44(%rbp),%xmm0
  movss  %xmm0,-0x78(%rbp)
L17:
  movss  -0x70(%rbp),%xmm0
  comiss -0x78(%rbp),%xmm0
  ja     L212
  addl   $0x1,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x48(%rbp),%xmm0
  movss  %xmm0,-0x6c(%rbp)
L215:
  movss  -0x64(%rbp),%xmm0
  comiss -0x6c(%rbp),%xmm0
  ja     L225
  mov    -0x54(%rbp),%eax
  imul   -0x90(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %eax,%edx
  mov    -0x84(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x30(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L218
L48:
  mov    -0x4c(%rbp),%eax
  cltq
  movss  -0x20(%rbp,%rax,4),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D46(%rip),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd -0x58(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%edx
  mov    -0x4c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L218:
  mov    -0x4c(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L48
  addl   $0x1,-0x50(%rbp)
L160:
  mov    -0x50(%rbp),%eax
  cmp    -0x90(%rbp),%eax
  jl     L135
  addl   $0x1,-0x54(%rbp)
L167:
  mov    -0x54(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L163
L68:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D15
type_infered: byte[4]
name: disassemble_data
arguments: data_label: D46
type_infered: f64
name: disassemble_data
arguments: data_label: D16
type_infered: byte[4]

tool: {"D15": [0x00,0x00,0x00,0x40]}

tool: D46: 0.5

tool: {"D16": [0x00,0x00,0x00,0x3f]}

assistant: ```c
void scale_internal(GLint components, GLint widthin, GLint heightin, const GLushort *datain, GLint widthout, GLint heightout, GLushort *dataout) {
  float x, lowx, highx, convx, halfconvx;
  float y, lowy, highy, convy, halfconvy;
  float xpercent, ypercent;
  float percent;
  float totals[4];
  float area;
  int i, j, k, yint, xint, xindex, yindex;
  int temp;
  if (widthin == widthout * 2 && heightin == heightout * 2) {
    halveImage(components, widthin, heightin, datain, dataout);
    return;
  }
  convy = (float)heightin / heightout;
  convx = (float)widthin / widthout;
  halfconvx = convx / 2;
  halfconvy = convy / 2;
  for (i = 0; i < heightout; i++) {
    y = convy * (i + 0.5);
    if (heightin > heightout) {
      highy = y + halfconvy;
      lowy = y - halfconvy;
    } else {
      highy = y + 0.5;
      lowy = y - 0.5;
    }
    for (j = 0; j < widthout; j++) {
      x = convx * (j + 0.5);
      if (widthin > widthout) {
        highx = x + halfconvx;
        lowx = x - halfconvx;
      } else {
        highx = x + 0.5;
        lowx = x - 0.5;
      }
      totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
      area = 0.0;
      y = lowy;
      yint = floor(y);
      while (y < highy) {
        yindex = (yint + heightin) % heightin;
        if (highy < yint + 1) {
          ypercent = highy - y;
        } else {
          ypercent = yint + 1 - y;
        }
        x = lowx;
        xint = floor(x);
        while (x < highx) {
          xindex = (xint + widthin) % widthin;
          if (highx < xint + 1) {
            xpercent = highx - x;
          } else {
            xpercent = xint + 1 - x;
          }
          percent = xpercent * ypercent;
          area += percent;
          temp = (xindex + (yindex * widthin)) * components;
          for (k = 0; k < components; k++) {
            totals[k] += datain[temp + k] * percent;
          }
          xint++;
          x = xint;
        }
        yint++;
        y = yint;
      }
      temp = (j + (i * widthout)) * components;
      for (k = 0; k < components; k++) {
        dataout[temp + k] = (totals[k] + 0.5) / area;
      }
    }
  }
}
```