user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<Kentec320x240x16_SSD2119PixelDrawMultiple>:
  endbr64
  push   %r15
  mov    $0x11,%edi
  mov    %r8d,%r15d
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x18,%rsp
  mov    0x50(%rsp),%r14
  mov    0x58(%rsp),%rbp
  mov    %r9d,0xc(%rsp)
  call   <WriteCommand@plt>
  mov    $0x6830,%edi
  call   <WriteData@plt>
  mov    $0x4e,%edi
  call   <WriteCommand@plt>
  mov    %r12d,%edi
  call   <WriteData@plt>
  mov    $0x4f,%edi
  call   <WriteCommand@plt>
  mov    %r13d,%edi
  call   <WriteData@plt>
  mov    $0x22,%edi
  call   <WriteCommand@plt>
  mov    0xc(%rsp),%r9d
  and    $0xbfffffff,%r9d
  cmp    $0x4,%r9d
  je     L69
  cmp    $0x8,%r9d
  je     L49
  cmp    $0x1,%r9d
  je     L138
L50:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L69:
  and    $0x1,%ebx
  jne    L55
L70:
  test   %r15d,%r15d
  je     L50
  mov    (%r14),%eax
  sar    $0x4,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  and    $0xffffff,%eax
  mov    %eax,%edi
  mov    %eax,%edx
  sar    $0x3,%eax
  sar    $0x8,%edi
  sar    $0x5,%edx
  and    $0x1f,%eax
  and    $0xf800,%edi
  and    $0x7e0,%edx
  or     %edx,%edi
  or     %eax,%edi
  call   <WriteData@plt>
  sub    $0x1,%r15d
  je     L50
L55:
  mov    (%r14),%eax
  lea    0x4(%r14),%rbx
  sub    $0x1,%r15d
  mov    %rbx,%r14
  and    $0xf,%eax
  lea    (%rax,%rax,2),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  and    $0xffffff,%eax
  mov    %eax,%edi
  mov    %eax,%edx
  sar    $0x3,%eax
  sar    $0x8,%edi
  sar    $0x5,%edx
  and    $0x1f,%eax
  and    $0x7e0,%edx
  and    $0xf800,%edi
  or     %edx,%edi
  or     %eax,%edi
  call   <WriteData@plt>
  jmp    L70
  nopw   0x0(%rax,%rax,1)
L138:
  test   %r15d,%r15d
  je     L50
  mov    $0x7,%r13d
  nop
L43:
  add    $0x4,%r14
  mov    -0x4(%r14),%r12d
  cmp    $0x7,%ebx
  jle    L83
  jmp    L112
  nop
L96:
  test   %r15d,%r15d
  je     L50
L83:
  mov    %r13d,%ecx
  mov    %r12d,%eax
  sub    $0x1,%r15d
  sub    %ebx,%ecx
  add    $0x1,%ebx
  sar    %cl,%eax
  and    $0x1,%eax
  mov    0x0(%rbp,%rax,4),%edi
  call   <WriteData@plt>
  cmp    $0x7,%ebx
  jle    L96
  test   %r15d,%r15d
  je     L50
L112:
  xor    %ebx,%ebx
  jmp    L43
  nopl   0x0(%rax,%rax,1)
L49:
  mov    %r15d,%eax
  lea    (%r14,%rax,4),%rbx
  test   %r15d,%r15d
  je     L50
L99:
  mov    (%r14),%eax
  add    $0x4,%r14
  lea    (%rax,%rax,2),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  and    $0xffffff,%eax
  mov    %eax,%edi
  mov    %eax,%edx
  sar    $0x3,%eax
  sar    $0x8,%edi
  sar    $0x5,%edx
  and    $0x1f,%eax
  and    $0xf800,%edi
  and    $0x7e0,%edx
  or     %edx,%edi
  or     %eax,%edi
  call   <WriteData@plt>
  cmp    %rbx,%r14
  jne    L99
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  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;
  }
  }
}
```