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

```asm
<GrOffScreen4BPPLineDrawH>:
  endbr64
  mov    %rdi,%r9
  mov    %edx,%edi
  mov    %ecx,%r10d
  mov    %r8d,%edx
  mov    0x4(%r9),%eax
  lea    0x1(%rax),%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  imul   %r10d,%eax
  mov    %esi,%ecx
  shr    $0x1f,%ecx
  add    %esi,%ecx
  sar    %ecx
  add    %ecx,%eax
  cltq
  lea    0xd8(%r9,%rax,4),%rax
  mov    %r8d,%ecx
  shl    $0x4,%ecx
  shl    $0x1c,%r8d
  mov    %edx,%r9d
  shl    $0x18,%r9d
  or     %r9d,%r8d
  or     %edx,%r8d
  mov    %edx,%r9d
  shl    $0x14,%r9d
  or     %r9d,%r8d
  mov    %edx,%r9d
  shl    $0x10,%r9d
  or     %r9d,%r8d
  mov    %edx,%r9d
  shl    $0xc,%r9d
  or     %r9d,%r8d
  shl    $0x8,%edx
  or     %edx,%r8d
  or     %r8d,%ecx
  test   $0x1,%sil
  je     L60
  mov    (%rax),%edx
  and    $0xf0,%edx
  mov    %ecx,%r8d
  and    $0xf,%r8d
  or     %r8d,%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  add    $0x1,%esi
L60:
  test   $0x1,%al
  je     L11
  cmp    %esi,%edi
  jle    L11
  movzbl %cl,%edx
  mov    %edx,(%rax)
  add    $0x2,%esi
  lea    0x4(%rax),%rax
L11:
  test   $0x2,%al
  je     L2
  mov    %edi,%edx
  sub    %esi,%edx
  cmp    $0x2,%edx
  jle    L2
  movzwl %cx,%edx
  mov    %edx,(%rax)
  add    $0x8,%rax
  add    $0x4,%esi
L2:
  lea    0x6(%rsi),%edx
  cmp    %edx,%edi
  jle    L97
  lea    -0x7(%rdi),%r8d
  sub    %esi,%r8d
  shr    $0x3,%r8d
  lea    0x1(%r8),%edx
  mov    %edx,%edx
  shl    $0x4,%rdx
  add    %rax,%rdx
L83:
  mov    %ecx,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L83
  lea    0x8(%rsi,%r8,8),%esi
L19:
  lea    0x2(%rsi),%eax
  cmp    %edi,%eax
  jge    L68
  movzwl %cx,%eax
  mov    %eax,(%rdx)
  add    $0x8,%rdx
  add    $0x4,%esi
L68:
  cmp    %edi,%esi
  jge    L54
  movzbl %cl,%eax
  mov    %eax,(%rdx)
  add    $0x2,%esi
  lea    0x4(%rdx),%rdx
L54:
  cmp    %edi,%esi
  je     L30
L5:
  ret
L97:
  mov    %rax,%rdx
  jmp    L19
L30:
  mov    (%rdx),%eax
  and    $0xf,%eax
  and    $0xf0,%ecx
  or     %ecx,%eax
  mov    %eax,(%rdx)
  jmp    L5
```

assistant: ```c
void GrOffScreen4BPPLineDrawH(void *pvDisplayData, int32_t i32X1, int32_t i32X2, int32_t i32Y, uint32_t ui32Value) {
  uint8_t *pui8Data;
  int32_t i32BytesPerRow;
  ;
  pui8Data = (uint8_t *)pvDisplayData;
  i32BytesPerRow = (*(uint16_t *)(pui8Data + 1) + 1) / 2;
  pui8Data += (i32BytesPerRow * i32Y) + (i32X1 / 2) + 6 + (16 * 3);
  ui32Value = ((ui32Value << 28) | (ui32Value << 24) | (ui32Value << 20) | (ui32Value << 16) | (ui32Value << 12) | (ui32Value << 8) | (ui32Value << 4) | ui32Value);
  if (i32X1 & 1) {
    *pui8Data = (*pui8Data & 0xf0) | (ui32Value & 0x0f);
    pui8Data++;
    i32X1++;
  }
  if (((uint32_t)pui8Data & 1) && ((i32X2 - i32X1) > 0)) {
    *pui8Data++ = ui32Value & 0xff;
    i32X1 += 2;
  }
  if (((uint32_t)pui8Data & 2) && ((i32X2 - i32X1) > 2)) {
    *(uint16_t *)pui8Data = ui32Value & 0xffff;
    pui8Data += 2;
    i32X1 += 4;
  }
  while ((i32X1 + 7) <= i32X2) {
    *(uint32_t *)pui8Data = ui32Value;
    pui8Data += 4;
    i32X1 += 8;
  }
  if ((i32X1 + 3) <= i32X2) {
    *(uint16_t *)pui8Data = ui32Value & 0xffff;
    pui8Data += 2;
    i32X1 += 4;
  }
  if ((i32X1 + 1) <= i32X2) {
    *pui8Data++ = ui32Value & 0xff;
    i32X1 += 2;
  }
  if (i32X1 == i32X2) {
    *pui8Data = (*pui8Data & 0x0f) | (ui32Value & 0xf0);
  }
}
```