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

```asm
<GrOffScreen8BPPPixelDrawMultiple>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r14
  mov    %edx,%edi
  mov    %ecx,%eax
  mov    %r8d,%ebx
  mov    0x40(%rsp),%r13
  mov    0x48(%rsp),%r12
  movzwl 0x1(%r14),%edx
  imul   %edi,%edx
  add    %esi,%edx
  movslq %edx,%rdx
  lea    0x306(%r14,%rdx,1),%rbp
  cmp    $0x4,%r9d
  je     L164
  cmp    $0x8,%r9d
  je     L118
  cmp    $0x1,%r9d
  je     L112
L114:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L118:
  mov    %r8d,%r15d
  add    %r13,%r15
  test   %r8d,%r8d
  je     L114
L87:
  add    $0x1,%r13
  movzbl -0x1(%r13),%eax
  lea    (%rax,%rax,2),%eax
  mov    %eax,%eax
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  mov    %r14,%rdi
  call   <GrOffScreen8BPPColorTranslate@plt>
  add    $0x1,%rbp
  mov    %al,-0x1(%rbp)
  cmp    %r13,%r15
  jne    L87
  jmp    L114
L112:
  test   %r8d,%r8d
  je     L114
  mov    $0x7,%edi
  jmp    L127
L15:
  mov    $0x0,%eax
  test   %ebx,%ebx
  je     L114
L127:
  add    $0x1,%r13
  movzbl -0x1(%r13),%esi
  cmp    $0x7,%eax
  jg     L15
  test   %ebx,%ebx
  je     L15
L1:
  add    $0x1,%rbp
  mov    %edi,%ecx
  sub    %eax,%ecx
  mov    %esi,%edx
  shr    %cl,%edx
  and    $0x1,%edx
  mov    (%r12,%rdx,4),%edx
  mov    %dl,-0x1(%rbp)
  add    $0x1,%eax
  sub    $0x1,%ebx
  cmp    $0x7,%eax
  jg     L15
  test   %ebx,%ebx
  jne    L1
  jmp    L15
L164:
  test   $0x1,%al
  je     L152
L96:
  lea    0x1(%r13),%r15
  movzbl 0x0(%r13),%eax
  and    $0xf,%eax
  lea    (%rax,%rax,2),%eax
  mov    %eax,%eax
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  mov    %r14,%rdi
  call   <GrOffScreen8BPPColorTranslate@plt>
  mov    %al,0x0(%rbp)
  sub    $0x1,%ebx
  lea    0x1(%rbp),%rbp
  mov    %r15,%r13
L152:
  test   %ebx,%ebx
  je     L114
  movzbl 0x0(%r13),%eax
  shr    $0x4,%al
  lea    (%rax,%rax,2),%rax
  and    $0x3f,%eax
  mov    (%r12,%rax,1),%esi
  and    $0xffffff,%esi
  mov    %r14,%rdi
  call   <GrOffScreen8BPPColorTranslate@plt>
  add    $0x1,%rbp
  mov    %al,-0x1(%rbp)
  sub    $0x1,%ebx
  je     L152
  jmp    L96
```

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;
  }
  }
}
```