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

```asm
<GrOffScreen8BPPPixelDrawMultiple>:
  endbr64
  push   %r15
  mov    %edx,%r10d
  mov    %rdi,%r15
  mov    %ecx,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %r8d,%ebp
  push   %rbx
  sub    $0x8,%rsp
  movzwl 0x1(%rdi),%edx
  mov    0x40(%rsp),%r13
  mov    0x48(%rsp),%r12
  imul   %r10d,%edx
  add    %esi,%edx
  movslq %edx,%rdx
  lea    0x306(%rdi,%rdx,1),%rbx
  cmp    $0x4,%r9d
  je     L85
  cmp    $0x8,%r9d
  je     L118
  cmp    $0x1,%r9d
  je     L109
L107:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L85:
  test   $0x1,%al
  jne    L22
L117:
  test   %ebp,%ebp
  je     L107
  movzbl 0x0(%r13),%eax
  mov    %r15,%rdi
  shr    $0x4,%al
  lea    (%rax,%rax,2),%rax
  and    $0x3f,%eax
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  call   <GrOffScreen8BPPColorTranslate@plt>
  mov    %al,(%rbx)
  sub    $0x1,%ebp
  je     L107
  add    $0x1,%rbx
L22:
  movzbl 0x0(%r13),%eax
  mov    %r15,%rdi
  lea    0x1(%r13),%r14
  sub    $0x1,%ebp
  add    $0x1,%rbx
  mov    %r14,%r13
  and    $0xf,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  call   <GrOffScreen8BPPColorTranslate@plt>
  mov    %al,-0x1(%rbx)
  jmp    L117
  xchg   %ax,%ax
L109:
  test   %r8d,%r8d
  je     L107
  mov    $0x7,%edi
  xchg   %ax,%ax
L29:
  add    $0x1,%r13
  movzbl -0x1(%r13),%esi
  cmp    $0x7,%eax
  jle    L141
  jmp    L125
L58:
  test   %ebp,%ebp
  je     L107
L141:
  mov    %edi,%ecx
  mov    %esi,%edx
  add    $0x1,%rbx
  sub    $0x1,%ebp
  sub    %eax,%ecx
  add    $0x1,%eax
  shr    %cl,%edx
  and    $0x1,%edx
  mov    (%r12,%rdx,4),%edx
  mov    %dl,-0x1(%rbx)
  cmp    $0x7,%eax
  jle    L58
  test   %ebp,%ebp
  je     L107
L125:
  xor    %eax,%eax
  jmp    L29
  nopl   (%rax)
L118:
  mov    %r8d,%r14d
  add    %r13,%r14
  test   %r8d,%r8d
  je     L107
  nopw   0x0(%rax,%rax,1)
L129:
  movzbl 0x0(%r13),%eax
  mov    %r15,%rdi
  add    $0x1,%r13
  add    $0x1,%rbx
  lea    (%rax,%rax,2),%eax
  cltq
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  call   <GrOffScreen8BPPColorTranslate@plt>
  mov    %al,-0x1(%rbx)
  cmp    %r14,%r13
  jne    L129
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void GrOffScreen8BPPPixelDrawMultiple(void *pvDisplayData, int lX, int lY, int lX0, int lCount, int lBPP, const unsigned char *pucData, const unsigned char *pucPalette) {
  unsigned char *pucPtr;
  unsigned int ulByte;
  ;
  ;
  ;
  pucPtr = (unsigned char *)pvDisplayData;
  pucPtr += (*(unsigned short *)(pucPtr + 1) * lY) + lX + 6 + (256 * 3);
  switch (lBPP) {
  case 1: {
    while (lCount) {
      ulByte = *pucData++;
      for (; (lX0 < 8) && lCount; lX0++, lCount--) {
        *pucPtr++ = (((unsigned int *)pucPalette)[(ulByte >> (7 - lX0)) & 1]);
      }
      lX0 = 0;
    }
    break;
  }
  case 4: {
    switch (lX0 & 1) {
    case 0:
      while (lCount) {
        ulByte = (*pucData >> 4) * 3;
        ulByte = (*(unsigned int *)(pucPalette + ulByte) & 0x00ffffff);
        *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
        lCount--;
        if (lCount) {
        case 1:
          ulByte = (*pucData++ & 15) * 3;
          ulByte = (*(unsigned int *)(pucPalette + ulByte) & 0x00ffffff);
          *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
          lCount--;
        }
      }
    }
    break;
  }
  case 8: {
    while (lCount--) {
      ulByte = *pucData++ * 3;
      ulByte = *(unsigned int *)(pucPalette + ulByte) & 0x00ffffff;
      *pucPtr++ = GrOffScreen8BPPColorTranslate(pvDisplayData, ulByte);
    }
    break;
  }
  }
}
```