user: 请从给定的汇编指令推导出C源代码:

```asm
<GrOffScreen4BPPPixelDrawMultiple>:
  endbr64
  push   %r15
  mov    %rdx,%r10
  mov    %rcx,%rdx
  mov    %rsi,%rcx
  push   %r14
  shr    $0x3f,%rcx
  mov    %rdi,%r15
  push   %r13
  add    %rsi,%rcx
  push   %r12
  sar    %rcx
  mov    %r8,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  not    %rbx
  shl    $0x2,%rbx
  sub    $0x18,%rsp
  movzwl 0x1(%rdi),%eax
  and    $0x4,%ebx
  mov    0x50(%rsp),%r14
  mov    0x58(%rsp),%r13
  add    $0x1,%eax
  sar    %eax
  cltq
  imul   %r10,%rax
  lea    0x36(%rax,%rcx,1),%rbp
  add    %rdi,%rbp
  cmp    $0x4,%r9
  je     L85
  cmp    $0x8,%r9
  je     L57
  cmp    $0x1,%r9
  je     L92
L123:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L85:
  and    $0x1,%edx
  jne    L22
L153:
  test   %r12,%r12
  je     L123
  movzbl (%r14),%eax
  mov    %r15,%rdi
  shr    $0x4,%al
  lea    (%rax,%rax,2),%rax
  and    $0x3f,%eax
  mov    0x0(%r13,%rax,1),%rsi
  and    $0xffffff,%esi
  call   <GrOffScreen4BPPColorTranslate@plt>
  mov    %ebx,%ecx
  mov    $0xf,%edx
  shl    %cl,%edx
  shl    %cl,%rax
  not    %edx
  and    0x0(%rbp),%dl
  or     %eax,%edx
  xor    %eax,%eax
  cmp    $0x4,%rbx
  setne  %al
  mov    %dl,0x0(%rbp)
  add    %rax,%rbp
  sub    $0x1,%r12
  je     L123
  xor    $0x4,%rbx
L22:
  lea    0x1(%r14),%rax
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  movzbl (%r14),%eax
  and    $0xf,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    0x0(%r13,%rax,1),%rsi
  and    $0xffffff,%esi
  call   <GrOffScreen4BPPColorTranslate@plt>
  mov    %ebx,%ecx
  mov    0x8(%rsp),%r14
  mov    %rax,%r8
  mov    $0xf,%eax
  shl    %cl,%eax
  shl    %cl,%r8
  mov    %eax,%edx
  xor    %eax,%eax
  not    %edx
  and    0x0(%rbp),%dl
  or     %r8d,%edx
  cmp    $0x4,%rbx
  setne  %al
  mov    %dl,0x0(%rbp)
  sub    $0x1,%r12
  xor    $0x4,%rbx
  add    %rax,%rbp
  jmp    L153
  nopl   0x0(%rax)
L92:
  test   %r8,%r8
  je     L123
  mov    $0x7,%r9d
  mov    $0xf,%r8d
  nopl   (%rax)
L145:
  add    $0x1,%r14
  movzbl -0x1(%r14),%edi
  cmp    $0x7,%rdx
  jle    L39
  jmp    L71
  nopl   0x0(%rax)
L14:
  test   %r12,%r12
  je     L123
L39:
  mov    %r9d,%ecx
  mov    %rdi,%rax
  sub    %edx,%ecx
  shr    %cl,%rax
  mov    %ebx,%ecx
  and    $0x1,%eax
  mov    0x0(%r13,%rax,8),%rsi
  mov    %r8d,%eax
  shl    %cl,%eax
  shl    %cl,%rsi
  not    %eax
  and    0x0(%rbp),%al
  or     %esi,%eax
  mov    %al,0x0(%rbp)
  mov    %rbx,%rax
  xor    $0x4,%rbx
  cmp    $0x4,%rax
  setne  %al
  add    $0x1,%rdx
  sub    $0x1,%r12
  movzbl %al,%eax
  add    %rax,%rbp
  cmp    $0x7,%rdx
  jle    L14
  test   %r12,%r12
  je     L123
L71:
  xor    %edx,%edx
  jmp    L145
  nopw   0x0(%rax,%rax,1)
L57:
  mov    %r14,%r8
  test   %r12,%r12
  je     L123
  nopl   0x0(%rax)
L20:
  movzbl (%r8),%eax
  mov    %r15,%rdi
  add    $0x1,%r8
  mov    %r8,0x8(%rsp)
  lea    (%rax,%rax,2),%eax
  cltq
  mov    0x0(%r13,%rax,1),%rsi
  and    $0xffffff,%esi
  call   <GrOffScreen4BPPColorTranslate@plt>
  mov    %ebx,%ecx
  mov    $0xf,%edx
  mov    0x8(%rsp),%r8
  shl    %cl,%edx
  shl    %cl,%rax
  not    %edx
  and    0x0(%rbp),%dl
  or     %eax,%edx
  mov    %rbx,%rax
  xor    $0x4,%rbx
  cmp    $0x4,%rax
  mov    %dl,0x0(%rbp)
  setne  %al
  movzbl %al,%eax
  add    %rax,%rbp
  mov    %r14,%rax
  sub    %r8,%rax
  add    %r12,%rax
  jne    L20
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void GrOffScreen4BPPPixelDrawMultiple(void *pvDisplayData, long lX, long lY, long lX0, long lCount, long lBPP, const unsigned char *pucData, const unsigned char *pucPalette) {
  unsigned char *pucPtr;
  unsigned long ulByte;
  long lBytesPerRow;
  ;
  ;
  ;
  pucPtr = (unsigned char *)pvDisplayData;
  lBytesPerRow = (*(unsigned short *)(pucPtr + 1) + 1) / 2;
  pucPtr += (lBytesPerRow * lY) + (lX / 2) + 6 + (16 * 3);
  lX = (1 - (lX & 1)) * 4;
  switch (lBPP) {
  case 1: {
    while (lCount) {
      ulByte = *pucData++;
      for (; (lX0 < 8) && lCount; lX0++, lCount--) {
        *pucPtr = ((*pucPtr & ~(0xf << lX)) | (((unsigned long *)pucPalette)[(ulByte >> (7 - lX0)) & 1] << lX));
        if (lX ^= 4) {
          pucPtr++;
        }
      }
      lX0 = 0;
    }
    break;
  }
  case 4: {
    switch (lX0 & 1) {
    case 0:
      while (lCount) {
        ulByte = (*pucData >> 4) * 3;
        ulByte = (*(unsigned long *)(pucPalette + ulByte) & 0x00ffffff);
        ulByte = GrOffScreen4BPPColorTranslate(pvDisplayData, ulByte);
        *pucPtr = (*pucPtr & ~(0xf << lX)) | (ulByte << lX);
        if (lX ^= 4) {
          pucPtr++;
        }
        lCount--;
        if (lCount) {
        case 1:
          ulByte = (*pucData++ & 15) * 3;
          ulByte = (*(unsigned long *)(pucPalette + ulByte) & 0x00ffffff);
          ulByte = GrOffScreen4BPPColorTranslate(pvDisplayData, ulByte);
          *pucPtr = ((*pucPtr & ~(0xf << lX)) | (ulByte << lX));
          if (lX ^= 4) {
            pucPtr++;
          }
          lCount--;
        }
      }
    }
    break;
  }
  case 8: {
    while (lCount--) {
      ulByte = *pucData++ * 3;
      ulByte = *(unsigned long *)(pucPalette + ulByte) & 0x00ffffff;
      ulByte = GrOffScreen4BPPColorTranslate(pvDisplayData, ulByte);
      *pucPtr = (*pucPtr & ~(0xf << lX)) | (ulByte << lX);
      if (lX ^= 4) {
        pucPtr++;
      }
    }
    break;
  }
  }
}
```