user: Please show me the C implementation that matches the assembly code listed below:

```asm
<dropshadow>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %edx,-0x80(%rbp)
  mov    %ecx,-0x84(%rbp)
  mov    %r8d,-0x88(%rbp)
  mov    %r9d,-0x8c(%rbp)
  movsd  %xmm0,-0x98(%rbp)
  mov    0x30(%rbp),%eax
  and    $0x1,%eax
  mov    %eax,-0x50(%rbp)
  mov    0x30(%rbp),%eax
  shr    %eax
  and    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  mov    0x30(%rbp),%eax
  shr    $0x2,%eax
  and    $0x1,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x7c(%rbp),%eax
  imul   -0x80(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,-0x40(%rbp)
  cmpl   $0x1,-0x50(%rbp)
  jne    L337
  mov    $0xffffffff,%eax
  jmp    L72
L337:
  mov    $0x0,%eax
L72:
  mov    %al,-0x64(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,%edi
  call   <allocMemory@plt>
  mov    %rax,-0x10(%rbp)
  movzbl -0x64(%rbp),%ecx
  mov    -0x44(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <clearMemory@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x78(%rbp),%rax
  add    $0x3,%rax
  mov    %rax,-0x20(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  jne    L420
  cmpl   $0x0,-0x88(%rbp)
  jne    L420
  cmpl   $0x1,-0x50(%rbp)
  jne    L275
  movl   $0x0,-0x60(%rbp)
  jmp    L327
L434:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%ecx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  not    %ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  addq   $0x4,-0x20(%rbp)
  addl   $0x1,-0x60(%rbp)
L327:
  mov    -0x60(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L434
  jmp    L76
L275:
  movl   $0x0,-0x60(%rbp)
  jmp    L416
L288:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addq   $0x4,-0x20(%rbp)
  addl   $0x1,-0x60(%rbp)
L416:
  mov    -0x60(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L288
  jmp    L76
L420:
  mov    -0x84(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x7c(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x88(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x80(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x7c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x84(%rbp)
  jle    L257
  mov    -0x84(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  jmp    L276
L257:
  mov    -0x84(%rbp),%eax
  shl    $0x2,%eax
  cltq
  neg    %rax
  add    %rax,-0x20(%rbp)
L276:
  cmpl   $0x0,-0x88(%rbp)
  jle    L173
  mov    -0x88(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  jmp    L271
L173:
  mov    -0x88(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  shl    $0x2,%eax
  cltq
  neg    %rax
  add    %rax,-0x20(%rbp)
L271:
  cmpl   $0x1,-0x50(%rbp)
  jne    L117
  movl   $0x0,-0x54(%rbp)
  jmp    L60
L229:
  movl   $0x0,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L323
L349:
  mov    -0x58(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  not    %edx
  mov    %dl,(%rax)
  addl   $0x1,-0x5c(%rbp)
  addl   $0x4,-0x58(%rbp)
L323:
  mov    -0x5c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L349
  mov    -0x7c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addl   $0x1,-0x54(%rbp)
L60:
  mov    -0x54(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L229
  jmp    L76
L117:
  movl   $0x0,-0x54(%rbp)
  jmp    L317
L101:
  movl   $0x0,-0x5c(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L300
L209:
  mov    -0x58(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x5c(%rbp)
  addl   $0x4,-0x58(%rbp)
L300:
  mov    -0x5c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L209
  mov    -0x7c(%rbp),%eax
  cltq
  add    %rax,-0x28(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
  addl   $0x1,-0x54(%rbp)
L317:
  mov    -0x54(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L101
L76:
  movzbl -0x64(%rbp),%edi
  mov    0x28(%rbp),%r9d
  mov    0x20(%rbp),%r10d
  mov    0x18(%rbp),%ecx
  mov    -0x80(%rbp),%edx
  mov    -0x7c(%rbp),%esi
  mov    -0x10(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x80(%rbp),%r8d
  push   %r8
  mov    -0x7c(%rbp),%r8d
  push   %r8
  push   $0x0
  push   $0x0
  push   %rdi
  mov    %r10d,%r8d
  mov    %rax,%rdi
  call   <blurAlpha@plt>
  add    $0x30,%rsp
  mov    -0x8c(%rbp),%eax
  shr    $0x10,%eax
  mov    %al,-0x63(%rbp)
  mov    -0x8c(%rbp),%eax
  shr    $0x8,%eax
  mov    %al,-0x62(%rbp)
  mov    -0x8c(%rbp),%eax
  mov    %al,-0x61(%rbp)
  movzbl -0x63(%rbp),%edx
  movzbl -0x62(%rbp),%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzbl -0x61(%rbp),%eax
  shl    $0x10,%eax
  or     %edx,%eax
  or     $0xff000000,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x44(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  jmp    L302
L345:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x98(%rbp),%xmm0
  comisd D2(%rip),%xmm0
  jae    L62
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L243
L62:
  movsd  D2(%rip),%xmm1
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movabs $0x8000000000000000,%rax
  xor    %rax,-0x8(%rbp)
L243:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  cmpq   $0xfe,-0x8(%rbp)
  jbe    L80
  mov    -0x18(%rbp),%rax
  lea    -0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x30(%rbp),%edx
  mov    %edx,(%rax)
  jmp    L302
L80:
  cmpq   $0x0,-0x8(%rbp)
  je     L417
  mov    -0x8(%rbp),%rax
  test   %rax,%rax
  js     L55
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L285
L55:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L285:
  movsd  D0(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  movzbl -0x63(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x2c(%rbp),%xmm0
  cvttss2si %xmm0,%edx
  movzbl -0x62(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x2c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzbl -0x61(%rbp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  -0x2c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  shl    $0x10,%eax
  or     %edx,%eax
  mov    %eax,%esi
  mov    -0x8(%rbp),%rax
  shl    $0x18,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  lea    -0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %edx,(%rax)
  jmp    L302
L417:
  mov    -0x18(%rbp),%rax
  lea    -0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movl   $0x0,(%rax)
L302:
  subq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jae    L345
  cmpl   $0x1,-0x50(%rbp)
  jne    L429
  cmpl   $0x0,-0x4c(%rbp)
  jne    L114
  cmpl   $0x0,-0x48(%rbp)
  jne    L114
  mov    -0x80(%rbp),%ecx
  mov    -0x7c(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <compositeSourceAtop@plt>
  jmp    L126
L114:
  mov    -0x80(%rbp),%ecx
  mov    -0x7c(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <compositeSourceIn@plt>
  jmp    L126
L429:
  cmpl   $0x1,-0x4c(%rbp)
  jne    L192
  mov    -0x80(%rbp),%ecx
  mov    -0x7c(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <compositeSourceOut@plt>
  jmp    L126
L192:
  cmpl   $0x1,-0x48(%rbp)
  jne    L315
  mov    -0x40(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <copyMemory@plt>
  jmp    L126
L315:
  mov    -0x80(%rbp),%ecx
  mov    -0x7c(%rbp),%edx
  mov    -0x10(%rbp),%rsi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <compositeDestinationOver@plt>
L126:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <freeMemory@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D2
datatype: byte[16]
name: read_data
arguments: data_tag: D0
datatype: f64

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x43,0x00,0x00,0x00,0x00,0x00,0xe0,0x6f,0x40]}

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