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

```asm
<dropshadow>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %r9d,%r12d
  mov    %ecx,%r9d
  lea    0x3(%r13),%r15
  push   %rbp
  or     %r8d,%r9d
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x48,%rsp
  mov    0x88(%rsp),%eax
  mov    %edx,0x10(%rsp)
  imul   %esi,%edx
  mov    %eax,0x20(%rsp)
  mov    0x90(%rsp),%eax
  mov    %edx,0x8(%rsp)
  mov    %eax,0x24(%rsp)
  mov    0x98(%rsp),%eax
  mov    %eax,0x28(%rsp)
  mov    0xa0(%rsp),%eax
  mov    %eax,%edi
  shr    %edi
  mov    %edi,0x1c(%rsp)
  mov    %eax,%edi
  shr    $0x2,%edi
  and    $0x1,%eax
  mov    %edi,0x2c(%rsp)
  lea    0x0(,%rdx,4),%edi
  mov    %edi,0x18(%rsp)
  mov    %eax,0x14(%rsp)
  je     L234
  mov    0x18(%rsp),%edi
  mov    %r8d,0x34(%rsp)
  mov    %r9d,0x30(%rsp)
  movsd  %xmm0,0x38(%rsp)
  call   <allocMemory@plt>
  mov    0x8(%rsp),%edx
  mov    $0xff,%esi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <clearMemory@plt>
  mov    0x30(%rsp),%r9d
  mov    0x34(%rsp),%r8d
  movsd  0x38(%rsp),%xmm0
  test   %r9d,%r9d
  jne    L297
  movslq 0x8(%rsp),%rbx
  xor    %eax,%eax
  test   %ebx,%ebx
  jle    L385
  nopl   0x0(%rax)
L19:
  movzbl 0x3(%r13,%rax,4),%edx
  not    %edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rbx,%rax
  jne    L19
L385:
  mov    $0xff,%r9d
L273:
  movsd  %xmm0,0x8(%rsp)
  sub    $0x8,%rsp
  mov    %r14d,%esi
  mov    %rbp,%rdi
  mov    0x18(%rsp),%eax
  push   %rax
  mov    %eax,%edx
  push   %r14
  push   $0x0
  push   $0x0
  push   %r9
  mov    0x58(%rsp),%r9d
  mov    0x54(%rsp),%r8d
  mov    0x50(%rsp),%ecx
  call   <blurAlpha@plt>
  mov    %r12d,%eax
  mov    %r12d,%r8d
  movzbl %r12b,%r10d
  movzbl %ah,%eax
  shr    $0x10,%r8d
  lea    -0x1(%rbp,%rbx,1),%rsi
  add    $0x30,%rsp
  mov    %eax,%r9d
  mov    %r12d,%eax
  movzbl %r8b,%r8d
  and    $0xff00,%r12d
  shl    $0x10,%eax
  lea    -0x4(%rbp,%rbx,4),%r11
  movsd  0x8(%rsp),%xmm0
  and    $0xff0000,%eax
  or     %r8d,%eax
  or     %eax,%r12d
  or     $0xff000000,%r12d
  cmp    %rbp,%rsi
  jb     L58
  lea    -0x1(%rbp),%rdi
  movsd  D5(%rip),%xmm2
  movsd  D8(%rip),%xmm4
  xor    %eax,%eax
  movabs $0x8000000000000000,%rbx
  sub    %rsi,%rdi
  jmp    L136
  nopl   0x0(%rax)
L191:
  cvttsd2si %xmm1,%rdx
L221:
  mov    %r12d,%ecx
  cmp    $0xfe,%rdx
  ja     L355
  xor    %ecx,%ecx
  test   %rdx,%rdx
  je     L355
  pxor   %xmm1,%xmm1
  pxor   %xmm3,%xmm3
  cvtsi2sd %rdx,%xmm1
  shl    $0x18,%edx
  cvtsi2ss %r9d,%xmm3
  divsd  %xmm4,%xmm1
  cvtsd2ss %xmm1,%xmm1
  mulss  %xmm1,%xmm3
  cvttss2si %xmm3,%r15d
  pxor   %xmm3,%xmm3
  cvtsi2ss %r10d,%xmm3
  shl    $0x8,%r15d
  mulss  %xmm1,%xmm3
  cvttss2si %xmm3,%ecx
  pxor   %xmm3,%xmm3
  cvtsi2ss %r8d,%xmm3
  shl    $0x10,%ecx
  mulss  %xmm3,%xmm1
  or     %r15d,%ecx
  cvttss2si %xmm1,%r15d
  or     %r15d,%ecx
  or     %edx,%ecx
L355:
  mov    %ecx,(%r11,%rax,4)
  sub    $0x1,%rax
  cmp    %rdi,%rax
  je     L58
L136:
  movzbl (%rsi,%rax,1),%edx
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  mulsd  %xmm0,%xmm1
  comisd %xmm2,%xmm1
  jb     L191
  subsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%rdx
  xor    %rbx,%rdx
  jmp    L221
  nopl   0x0(%rax)
L234:
  mov    0x18(%rsp),%edi
  mov    %r8d,0x34(%rsp)
  mov    %r9d,0x30(%rsp)
  movsd  %xmm0,0x38(%rsp)
  call   <allocMemory@plt>
  mov    0x8(%rsp),%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <clearMemory@plt>
  mov    0x30(%rsp),%r9d
  mov    0x34(%rsp),%r8d
  movsd  0x38(%rsp),%xmm0
  test   %r9d,%r9d
  je     L168
  xor    %r9d,%r9d
L182:
  mov    %ebx,%eax
  mov    %r14d,%r11d
  mov    0x10(%rsp),%r10d
  neg    %eax
  cmovs  %ebx,%eax
  sub    %eax,%r11d
  mov    %r8d,%eax
  neg    %eax
  cmovs  %r8d,%eax
  sub    %eax,%r10d
  lea    0x0(,%r14,4),%eax
  test   %ebx,%ebx
  jle    L374
  movslq %ebx,%rcx
  add    %rbp,%rcx
L166:
  mov    %r14d,%edx
  imul   %r8d,%edx
  test   %r8d,%r8d
  jle    L217
  movslq %edx,%rdx
  add    %rdx,%rcx
L354:
  mov    0x14(%rsp),%edx
  test   %edx,%edx
  jne    L386
  test   %r10d,%r10d
  jle    L84
  movslq %r14d,%r8
  movslq %eax,%rdi
  xor    %esi,%esi
  movslq %r11d,%rdx
  nopl   0x0(%rax)
L207:
  xor    %eax,%eax
  test   %r11d,%r11d
  jle    L71
  nop
L60:
  movzbl (%r15,%rax,4),%ebx
  mov    %bl,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L60
L71:
  add    $0x1,%esi
  add    %r8,%rcx
  add    %rdi,%r15
  cmp    %esi,%r10d
  jne    L207
L84:
  movslq 0x8(%rsp),%rbx
  jmp    L273
  nopl   0x0(%rax)
L168:
  movslq 0x8(%rsp),%rbx
  xor    %eax,%eax
  test   %ebx,%ebx
  jle    L273
  nop
L304:
  movzbl 0x3(%r13,%rax,4),%edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L304
  jmp    L273
  nopl   0x0(%rax,%rax,1)
L297:
  mov    $0xff,%r9d
  jmp    L182
  nopl   0x0(%rax,%rax,1)
L58:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  je     L5
  mov    0x1c(%rsp),%eax
  or     0x2c(%rsp),%eax
  mov    %r14d,%edx
  mov    %rbp,%rsi
  mov    0x10(%rsp),%ecx
  mov    %r13,%rdi
  test   $0x1,%al
  jne    L114
  call   <compositeSourceAtop@plt>
L246:
  add    $0x48,%rsp
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <freeMemory@plt>
L5:
  testb  $0x1,0x1c(%rsp)
  jne    L305
  testb  $0x1,0x2c(%rsp)
  je     L150
  mov    0x18(%rsp),%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <copyMemory@plt>
  jmp    L246
  nopw   0x0(%rax,%rax,1)
L386:
  test   %r10d,%r10d
  jle    L84
  movslq %r14d,%rbx
  movslq %eax,%r8
  xor    %edi,%edi
  movslq %r11d,%rsi
  nopl   0x0(%rax)
L77:
  xor    %eax,%eax
  test   %r11d,%r11d
  jle    L342
  nop
L142:
  movzbl (%r15,%rax,4),%edx
  not    %edx
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L142
L342:
  add    $0x1,%edi
  add    %rbx,%rcx
  add    %r8,%r15
  cmp    %edi,%r10d
  jne    L77
  movslq 0x8(%rsp),%rbx
  jmp    L273
  nopl   0x0(%rax,%rax,1)
L114:
  call   <compositeSourceIn@plt>
  jmp    L246
  nopw   0x0(%rax,%rax,1)
L217:
  shl    $0x2,%edx
  movslq %edx,%rdx
  sub    %rdx,%r15
  jmp    L354
  xchg   %ax,%ax
L374:
  lea    0x0(,%rbx,4),%edx
  mov    %rbp,%rcx
  movslq %edx,%rdx
  sub    %rdx,%r15
  jmp    L166
L150:
  mov    0x10(%rsp),%ecx
  mov    %r14d,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <compositeDestinationOver@plt>
  jmp    L246
L305:
  mov    0x10(%rsp),%ecx
  mov    %r14d,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <compositeSourceOut@plt>
  jmp    L246
```

tool_calls: name: unpack_data
arguments: label: D5
type: byte[8]
name: unpack_data
arguments: label: D8
type: f64

tool: {"D5": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x43]}

tool: D8: 255

assistant: ```c
void dropshadow(unsigned char *img, int width, int height, int dx, int dy, unsigned int color, int alpha, int bx, int by, double strength, int quality, unsigned int flags) {
  int inner = flags & 1;
  int knockout = (flags >> 1) & 1;
  int hideObject = (flags >> 2) & 1;
  int size = width * height;
  int size4 = size << 2;
  int i;
  unsigned char defaultalpha = (inner == 1) ? 0xff : 0;
  unsigned char *tmp = allocMemory(size4);
  clearMemory(tmp, defaultalpha, size);
  unsigned char *ptmp = tmp;
  unsigned char *pimg = img + 3;
  if (dx == 0 && dy == 0) {
    if (inner == 1) {
      for (i = 0; i < size; ++i) {
        *ptmp++ = 255 - *pimg;
        pimg += 4;
      }
    } else {
      for (i = 0; i < size; ++i) {
        *ptmp++ = *pimg;
        pimg += 4;
      }
    }
  } else {
    int w = width - ((dx) < 0 ? -(dx) : (dx));
    int h = height - ((dy) < 0 ? -(dy) : (dy));
    int width4 = width << 2;
    int x, x4, y;
    if (dx > 0) {
      ptmp += dx;
    } else {
      pimg -= dx * 4;
    }
    if (dy > 0) {
      ptmp += dy * width;
    } else {
      pimg -= dy * width * 4;
    }
    if (inner == 1) {
      for (y = 0; y < h; ++y) {
        for (x = 0, x4 = 0; x < w; ++x, x4 += 4) {
          *(ptmp + x) = 255 - *(pimg + x4);
        }
        ptmp += width;
        pimg += width4;
      }
    } else {
      for (y = 0; y < h; ++y) {
        for (x = 0, x4 = 0; x < w; ++x, x4 += 4) {
          *(ptmp + x) = *(pimg + x4);
        }
        ptmp += width;
        pimg += width4;
      }
    }
  }
  blurAlpha(tmp, width, height, bx, by, quality, defaultalpha, 0, 0, width, height);
  unsigned char r = (color >> 16) & 0xff;
  unsigned char g = (color >> 8) & 0xff;
  unsigned char b = color & 0xff;
  unsigned int bgr = r | g << 8 | b << 16 | 0xff000000;
  float af;
  unsigned long ac;
  unsigned int *ptmp32 = (unsigned int *)tmp + size - 1;
  ptmp = tmp + size;
  while (--ptmp >= tmp) {
    ac = *ptmp * strength;
    if (ac >= 255) {
      *ptmp32-- = bgr;
    } else if (ac > 0) {
      af = ac / 255.0;
      *ptmp32-- = (int)(r * af) | (int)(g * af) << 8 | (int)(b * af) << 16 | ac << 24;
    } else {
      *ptmp32-- = 0;
    }
  }
  if (inner == 1) {
    if (knockout == 0 && hideObject == 0) {
      compositeSourceAtop(img, tmp, width, height);
    } else {
      compositeSourceIn(img, tmp, width, height);
    }
  } else {
    if (knockout == 1) {
      compositeSourceOut(img, tmp, width, height);
    } else if (hideObject == 1) {
      copyMemory(img, tmp, size4);
    } else {
      compositeDestinationOver(img, tmp, width, height);
    }
  }
  freeMemory(tmp);
}
```