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

```asm
<Kentec320x240x16_SSD2119PixelDrawMultiple>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    %r9d,-0x2c(%rbp)
  mov    $0x11,%edi
  call   <WriteCommand@plt>
  mov    $0x6830,%edi
  call   <WriteData@plt>
  mov    $0x4e,%edi
  call   <WriteCommand@plt>
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <WriteData@plt>
  mov    $0x4f,%edi
  call   <WriteCommand@plt>
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <WriteData@plt>
  mov    $0x22,%edi
  call   <WriteCommand@plt>
  mov    -0x2c(%rbp),%eax
  and    $0xbfffffff,%eax
  cmp    $0x8,%eax
  je     L137
  cmp    $0x8,%eax
  jg     L179
  cmp    $0x1,%eax
  je     L42
  cmp    $0x4,%eax
  je     L28
  jmp    L179
L69:
  mov    0x10(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,0x10(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L148
L76:
  mov    $0x7,%eax
  sub    -0x24(%rbp),%eax
  mov    -0x4(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  cltq
  and    $0x1,%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <WriteData@plt>
  addl   $0x1,-0x24(%rbp)
  subl   $0x1,-0x28(%rbp)
L148:
  cmpl   $0x7,-0x24(%rbp)
  jg     L177
  cmpl   $0x0,-0x28(%rbp)
  jne    L76
L177:
  movl   $0x0,-0x24(%rbp)
L42:
  cmpl   $0x0,-0x28(%rbp)
  jne    L69
  jmp    L179
L28:
  mov    -0x24(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L56
  cmp    $0x1,%eax
  je     L20
  jmp    L179
L124:
  mov    0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x4,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xffffff,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  and    $0xf800,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x5,%eax
  and    $0x7e0,%eax
  or     %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x3,%eax
  and    $0x1f,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <WriteData@plt>
  subl   $0x1,-0x28(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L169
L20:
  mov    0x10(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,0x10(%rbp)
  mov    (%rax),%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xffffff,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  and    $0xf800,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x5,%eax
  and    $0x7e0,%eax
  or     %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x3,%eax
  and    $0x1f,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <WriteData@plt>
  subl   $0x1,-0x28(%rbp)
  jmp    L169
L56:
  nop
L169:
  cmpl   $0x0,-0x28(%rbp)
  jne    L124
  jmp    L179
L66:
  mov    0x10(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,0x10(%rbp)
  mov    (%rax),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xffffff,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  and    $0xf800,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x5,%eax
  and    $0x7e0,%eax
  or     %eax,%edx
  mov    -0x4(%rbp),%eax
  sar    $0x3,%eax
  and    $0x1f,%eax
  or     %edx,%eax
  mov    %eax,%edi
  call   <WriteData@plt>
L137:
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  test   %eax,%eax
  jne    L66
  nop
L179:
  nop
  leave
  ret
```

assistant: ```c
void Kentec320x240x16_SSD2119PixelDrawMultiple(void *pvDisplayData, int32_t i32X, int32_t i32Y, int32_t i32X0, int32_t i32Count, int32_t i32BPP, const uint8_t *pui8Data, const uint8_t *pui8Palette) {
  uint32_t ui32Byte;
  WriteCommand(0x11);
  WriteData(((0x6830 & 0xff00) | (0x30)));
  WriteCommand(0x4e);
  WriteData((i32X));
  WriteCommand(0x4f);
  WriteData((i32Y));
  WriteCommand(0x22);
  switch (i32BPP & ~0x40000000) {
  case 1: {
    while (i32Count) {
      ui32Byte = *pui8Data++;
      for (; (i32X0 < 8) && i32Count; i32X0++, i32Count--) {
        WriteData(((uint32_t *)pui8Palette)[(ui32Byte >> (7 - i32X0)) & 1]);
      }
      i32X0 = 0;
    }
    break;
  }
  case 4: {
    switch (i32X0 & 1) {
    case 0:
      while (i32Count) {
        ui32Byte = (*pui8Data >> 4) * 3;
        ui32Byte = (*(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff);
        WriteData(((((ui32Byte)&0x00f80000) >> 8) | (((ui32Byte)&0x0000fc00) >> 5) | (((ui32Byte)&0x000000f8) >> 3)));
        i32Count--;
        if (i32Count) {
        case 1:
          ui32Byte = (*pui8Data++ & 15) * 3;
          ui32Byte = (*(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff);
          WriteData(((((ui32Byte)&0x00f80000) >> 8) | (((ui32Byte)&0x0000fc00) >> 5) | (((ui32Byte)&0x000000f8) >> 3)));
          i32Count--;
        }
      }
    }
    break;
  }
  case 8: {
    while (i32Count--) {
      ui32Byte = *pui8Data++ * 3;
      ui32Byte = *(uint32_t *)(pui8Palette + ui32Byte) & 0x00ffffff;
      WriteData(((((ui32Byte)&0x00f80000) >> 8) | (((ui32Byte)&0x0000fc00) >> 5) | (((ui32Byte)&0x000000f8) >> 3)));
    }
    break;
  }
  }
}
```