user: Demonstrate the C code that generates the assembly output below:

```asm
<scale_image_box>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %esi,0x10(%rsp)
  imul   0xe0(%rsp),%esi
  mov    0xe8(%rsp),%r11d
  mov    %rdi,0x90(%rsp)
  mov    %edx,0x50(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %r8d,0x18(%rsp)
  mov    %r9d,0x6c(%rsp)
  mov    %esi,0x70(%rsp)
  movss  %xmm0,0x8(%rsp)
  test   %r11d,%r11d
  jne    L327
  test   %edx,%edx
  jle    L167
  mov    0x18(%rsp),%esi
  mov    %r9d,%eax
  shr    $0x1f,%eax
  mov    %esi,%edx
  add    %r9d,%eax
  shr    $0x1f,%edx
  sar    %eax
  add    %esi,%edx
  imul   0xe0(%rsp),%esi
  sar    %edx
  mov    %edx,0x9c(%rsp)
  movslq %esi,%r14
  mov    0x10(%rsp),%esi
  mov    %r14,%rdx
  add    0xe0(%rsp),%edx
  movslq %edx,%r13
  test   %esi,%esi
  jle    L167
  mov    0xe0(%rsp),%edx
  test   %edx,%edx
  jle    L167
  mov    %eax,0x7c(%rsp)
  mov    0xe0(%rsp),%eax
  mov    %rcx,%r9
  pxor   %xmm2,%xmm2
  movl   $0x0,0x60(%rsp)
  movslq 0xe0(%rsp),%r15
  shr    $0x4,%eax
  movdqa D12(%rip),%xmm4
  movl   $0x0,0x88(%rsp)
  sub    $0x1,%eax
  mov    0xe0(%rsp),%edi
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,%r10
  mov    0xe0(%rsp),%eax
  mov    %r10,0x28(%rsp)
  mov    0x90(%rsp),%r10
  and    $0xfffffff0,%eax
  mov    %eax,%esi
  mov    %eax,0x1c(%rsp)
  mov    %rsi,0x20(%rsp)
  lea    0x1(%rax),%esi
  mov    %esi,0x38(%rsp)
  lea    0x2(%rax),%esi
  mov    %esi,0x40(%rsp)
  lea    0x3(%rax),%esi
  mov    %esi,0x44(%rsp)
  lea    0x4(%rax),%esi
  mov    %esi,0x48(%rsp)
  lea    0x5(%rax),%esi
  mov    %esi,0x4c(%rsp)
  lea    0x6(%rax),%esi
  mov    %esi,0x54(%rsp)
  lea    0x7(%rax),%esi
  mov    %esi,0x58(%rsp)
  lea    0x8(%rax),%esi
  mov    %esi,0x5c(%rsp)
  lea    0x9(%rax),%esi
  mov    %esi,0x64(%rsp)
  lea    0xa(%rax),%esi
  mov    %esi,0x68(%rsp)
  lea    0xb(%rax),%esi
  mov    %esi,0x74(%rsp)
  lea    0xc(%rax),%esi
  mov    %esi,0x78(%rsp)
  lea    0xd(%rax),%esi
  add    $0xe,%eax
  mov    %eax,0x98(%rsp)
  mov    0xe0(%rsp),%eax
  mov    %esi,0x8c(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x14(%rsp)
  mov    %rax,0x80(%rsp)
  xchg   %ax,%ax
L133:
  mov    0x7c(%rsp),%eax
  movslq 0x88(%rsp),%rsi
  movl   $0x0,0x8(%rsp)
  cltd
  mov    %rsi,%r8
  idivl  0x50(%rsp)
  mov    $0x0,%edx
  sub    $0x1,%eax
  cmovs  %edx,%eax
  imul   0x18(%rsp),%eax
  add    %r10,%rsi
  mov    %eax,0xc(%rsp)
  mov    0x9c(%rsp),%eax
  mov    %eax,(%rsp)
  nopl   (%rax)
L243:
  mov    (%rsp),%eax
  cltd
  idivl  0x10(%rsp)
  mov    $0x0,%edx
  sub    $0x1,%eax
  cmovs  %edx,%eax
  add    0xc(%rsp),%eax
  imul   %edi,%eax
  movslq %eax,%rbx
  lea    0x1(%r9,%rbx,1),%rbp
  lea    (%rbx,%r14,1),%rcx
  lea    (%rbx,%r13,1),%rdx
  lea    (%r9,%rbx,1),%rax
  lea    (%rbx,%r15,1),%r11
  mov    %rsi,%rbx
  lea    0x1(%r9,%rcx,1),%r12
  sub    %rbp,%rbx
  cmp    $0xe,%rbx
  seta   %bpl
  cmpl   $0xe,0x14(%rsp)
  seta   %bl
  and    %ebx,%ebp
  mov    %rsi,%rbx
  sub    %r12,%rbx
  lea    0x1(%r9,%rdx,1),%r12
  cmp    $0xe,%rbx
  seta   %bl
  and    %ebp,%ebx
  mov    %rsi,%rbp
  sub    %r12,%rbp
  cmp    $0xe,%rbp
  seta   %bpl
  test   %bpl,%bl
  je     L232
  lea    0x1(%r9,%r11,1),%rbp
  mov    %rsi,%rbx
  sub    %rbp,%rbx
  cmp    $0xe,%rbx
  jbe    L232
  mov    0x28(%rsp),%rbp
  add    %r9,%r11
  add    %r9,%rcx
  add    %r9,%rdx
  xor    %ebx,%ebx
  nop
L223:
  movdqu (%rax,%rbx,1),%xmm6
  movdqu (%r11,%rbx,1),%xmm0
  movdqu (%rcx,%rbx,1),%xmm5
  movdqu (%rdx,%rbx,1),%xmm3
  movdqa %xmm6,%xmm7
  movdqa %xmm0,%xmm1
  punpckhbw %xmm2,%xmm6
  punpcklbw %xmm2,%xmm7
  punpcklbw %xmm2,%xmm1
  movdqa %xmm5,%xmm8
  paddw  %xmm7,%xmm1
  movdqa %xmm3,%xmm7
  punpcklbw %xmm2,%xmm8
  punpcklbw %xmm2,%xmm7
  punpckhbw %xmm2,%xmm0
  punpckhbw %xmm2,%xmm5
  punpckhbw %xmm2,%xmm3
  paddw  %xmm8,%xmm7
  paddw  %xmm6,%xmm0
  paddw  %xmm5,%xmm3
  paddw  %xmm7,%xmm1
  paddw  %xmm3,%xmm0
  psrlw  $0x2,%xmm1
  psrlw  $0x2,%xmm0
  pand   %xmm4,%xmm1
  pand   %xmm4,%xmm0
  packuswb %xmm0,%xmm1
  movups %xmm1,(%rsi,%rbx,1)
  add    $0x10,%rbx
  cmp    %rbp,%rbx
  jne    L223
  mov    0x1c(%rsp),%ecx
  add    0x20(%rsp),%rax
  cmp    %ecx,%edi
  je     L132
  movzbl (%rax,%r15,1),%edx
  movzbl (%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl (%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl (%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x38(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x1(%rax,%r15,1),%edx
  movzbl 0x1(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x1(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x1(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x40(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x2(%rax,%r15,1),%edx
  movzbl 0x2(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x2(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x2(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x44(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x3(%rax,%r15,1),%edx
  movzbl 0x3(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x3(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x3(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x48(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x4(%rax,%r15,1),%edx
  movzbl 0x4(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x4(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x4(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x4c(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x5(%rax,%r15,1),%edx
  movzbl 0x5(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x5(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x5(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x54(%rsp),%edx
  cmp    %edx,%edi
  jle    L132
  movzbl 0x6(%rax),%r11d
  lea    (%r8,%rdx,1),%ecx
  movzbl 0x6(%rax,%r15,1),%edx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x6(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x6(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x58(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x7(%rax,%r15,1),%edx
  movzbl 0x7(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x7(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x7(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x5c(%rsp),%edx
  cmp    %edx,%edi
  jle    L132
  movzbl 0x8(%rax),%r11d
  lea    (%r8,%rdx,1),%ecx
  movzbl 0x8(%rax,%r15,1),%edx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x8(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x8(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x64(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0x9(%rax,%r15,1),%edx
  movzbl 0x9(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0x9(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0x9(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x68(%rsp),%edx
  cmp    %edx,%edi
  jle    L132
  movzbl 0xa(%rax),%r11d
  lea    (%r8,%rdx,1),%ecx
  movzbl 0xa(%rax,%r15,1),%edx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0xa(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0xa(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x74(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0xb(%rax,%r15,1),%edx
  movzbl 0xb(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0xb(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0xb(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x78(%rsp),%ecx
  cmp    %ecx,%edi
  jle    L132
  movzbl 0xc(%rax,%r15,1),%edx
  movzbl 0xc(%rax),%r11d
  add    %r8d,%ecx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0xc(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0xc(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x8c(%rsp),%edx
  cmp    %edx,%edi
  jle    L132
  movzbl 0xd(%rax),%r11d
  lea    (%r8,%rdx,1),%ecx
  movzbl 0xd(%rax,%r15,1),%edx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0xd(%rax,%r14,1),%edx
  add    %r11d,%edx
  movzbl 0xd(%rax,%r13,1),%r11d
  add    %r11d,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  mov    0x98(%rsp),%edx
  cmp    %edx,%edi
  jle    L132
  movzbl 0xe(%rax),%r11d
  lea    (%r8,%rdx,1),%ecx
  movzbl 0xe(%rax,%r15,1),%edx
  movslq %ecx,%rcx
  add    %edx,%r11d
  movzbl 0xe(%rax,%r14,1),%edx
  movzbl 0xe(%rax,%r13,1),%eax
  add    %r11d,%edx
  add    %eax,%edx
  sar    $0x2,%edx
  mov    %dl,(%r10,%rcx,1)
  nopl   0x0(%rax)
L132:
  addl   $0x1,0x8(%rsp)
  mov    0x18(%rsp),%edx
  add    %r15,%rsi
  add    %edi,%r8d
  add    %edx,(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,0x10(%rsp)
  jne    L243
  mov    0x6c(%rsp),%ecx
  addl   $0x1,0x60(%rsp)
  add    %ecx,0x7c(%rsp)
  mov    0x60(%rsp),%eax
  mov    0x70(%rsp),%ecx
  add    %ecx,0x88(%rsp)
  cmp    %eax,0x50(%rsp)
  jne    L133
L167:
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L327:
  mov    0x50(%rsp),%r10d
  movss  D4(%rip),%xmm0
  divss  0x8(%rsp),%xmm0
  movss  %xmm0,0xc(%rsp)
  test   %r10d,%r10d
  jle    L167
  mov    0x18(%rsp),%esi
  mov    %r9d,%eax
  mov    0x10(%rsp),%r8d
  shr    $0x1f,%eax
  mov    %esi,%edx
  add    %r9d,%eax
  shr    $0x1f,%edx
  sar    %eax
  add    %esi,%edx
  imul   0xe0(%rsp),%esi
  sar    %edx
  mov    %edx,0x4c(%rsp)
  movslq %esi,%r13
  mov    %r13,%rdx
  add    0xe0(%rsp),%edx
  movslq %edx,%r14
  test   %r8d,%r8d
  jle    L167
  mov    0xe0(%rsp),%edi
  test   %edi,%edi
  jle    L167
  mov    %eax,0x48(%rsp)
  mov    0xe0(%rsp),%eax
  movl   $0x0,0x44(%rsp)
  movslq 0xe0(%rsp),%r15
  sub    $0x1,%eax
  movl   $0x0,0x40(%rsp)
  add    $0x1,%rax
  mov    %rax,0x38(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L5:
  mov    0x48(%rsp),%eax
  movl   $0x0,0x14(%rsp)
  cltd
  idivl  0x50(%rsp)
  mov    $0x0,%edx
  sub    $0x1,%eax
  cmovs  %edx,%eax
  imul   0x18(%rsp),%eax
  mov    %eax,0x28(%rsp)
  mov    0x4c(%rsp),%eax
  mov    %eax,0x1c(%rsp)
  movslq 0x44(%rsp),%rax
  add    0x90(%rsp),%rax
  mov    %rax,0x20(%rsp)
  nop
L247:
  mov    0x1c(%rsp),%eax
  mov    0x28(%rsp),%esi
  mov    0x20(%rsp),%r12
  cltd
  idivl  0x10(%rsp)
  mov    $0x0,%edx
  sub    $0x1,%eax
  cmovs  %edx,%eax
  lea    (%rax,%rsi,1),%ebx
  mov    0xe0(%rsp),%eax
  imul   %ebx,%eax
  movslq %eax,%rbx
  mov    0x38(%rsp),%rax
  add    0x30(%rsp),%rbx
  add    %rbx,%rax
  mov    %rax,(%rsp)
  xchg   %ax,%ax
L289:
  movzbl (%rbx),%edi
  movss  0x8(%rsp),%xmm0
  add    $0x1,%rbx
  add    $0x1,%r12
  call   <gamma_correct@plt>
  movzbl -0x1(%rbx,%r15,1),%edi
  movss  0x8(%rsp),%xmm0
  mov    %eax,%ebp
  call   <gamma_correct@plt>
  movzbl -0x1(%rbx,%r13,1),%edi
  movss  0x8(%rsp),%xmm0
  add    %eax,%ebp
  call   <gamma_correct@plt>
  movzbl -0x1(%rbx,%r14,1),%edi
  movss  0x8(%rsp),%xmm0
  add    %eax,%ebp
  call   <gamma_correct@plt>
  movss  0xc(%rsp),%xmm0
  lea    0x0(%rbp,%rax,1),%edi
  sar    $0x2,%edi
  call   <gamma_correct@plt>
  mov    %al,-0x1(%r12)
  cmp    (%rsp),%rbx
  jne    L289
  addl   $0x1,0x14(%rsp)
  mov    0x18(%rsp),%ecx
  add    %r15,0x20(%rsp)
  mov    0x14(%rsp),%eax
  add    %ecx,0x1c(%rsp)
  cmp    %eax,0x10(%rsp)
  jne    L247
  mov    0x6c(%rsp),%ecx
  addl   $0x1,0x40(%rsp)
  add    %ecx,0x48(%rsp)
  mov    0x40(%rsp),%eax
  mov    0x70(%rsp),%ecx
  add    %ecx,0x44(%rsp)
  cmp    %eax,0x50(%rsp)
  jne    L5
  jmp    L167
  nopl   0x0(%rax)
L232:
  mov    %edi,0xe0(%rsp)
  xor    %edx,%edx
  lea    (%rax,%r15,1),%rbp
  lea    (%rax,%r14,1),%rbx
  mov    0x80(%rsp),%rdi
  lea    (%rax,%r13,1),%r11
  nopl   (%rax)
L20:
  movzbl 0x0(%rbp,%rdx,1),%ecx
  movzbl (%rax,%rdx,1),%r12d
  add    %ecx,%r12d
  movzbl (%rbx,%rdx,1),%ecx
  add    %r12d,%ecx
  movzbl (%r11,%rdx,1),%r12d
  add    %r12d,%ecx
  sar    $0x2,%ecx
  mov    %cl,(%rsi,%rdx,1)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rdi,%rcx
  jne    L20
  mov    0xe0(%rsp),%edi
  jmp    L132
```

tool_calls: name: parse_data
arguments: data_tag: D12
data_type: byte[16]
name: parse_data
arguments: data_tag: D4
data_type: byte[4]

tool: {"D12": [0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00]}

tool: {"D4": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void scale_image_box(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, v;
  int dstride = dw * bpp;
  unsigned char *s;
  float invgamma;
  if (gc) {
    invgamma = 1.0f / gamma;
    for (y = 0; y < dh; ++y) {
      iy = ((y * sh + sh / 2) / dh) - 1;
      if (iy < 0)
        iy = 0;
      for (x = 0; x < dw; ++x) {
        ix = ((x * sw + sw / 2) / dw) - 1;
        if (ix < 0)
          ix = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v = (gamma_correct(s[0], gamma) + gamma_correct(s[bpp], gamma) + gamma_correct(s[sw * bpp], gamma) + gamma_correct(s[(sw + 1) * bpp], gamma)) >> 2;
          dst[(y * dstride) + (x * bpp) + n] = gamma_correct(v, invgamma);
          ++s;
        }
      }
    }
  } else {
    for (y = 0; y < dh; ++y) {
      iy = ((y * sh + sh / 2) / dh) - 1;
      if (iy < 0)
        iy = 0;
      for (x = 0; x < dw; ++x) {
        ix = ((x * sw + sw / 2) / dw) - 1;
        if (ix < 0)
          ix = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v = (s[0] + s[bpp] + s[sw * bpp] + s[(sw + 1) * bpp]) >> 2;
          dst[(y * dstride) + (x * bpp) + n] = v;
          ++s;
        }
      }
    }
  }
}
```