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

```asm
<GrOffScreen1BPPLineDrawH>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  add    $0x7,%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    %ecx,%eax
  cltq
  add    $0x5,%rax
  shl    $0x2,%rax
  add    %rax,-0x8(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  je     L53
  movl   $0xffffffff,-0x28(%rbp)
L53:
  mov    -0x1c(%rbp),%eax
  and    $0x7,%eax
  test   %eax,%eax
  je     L108
  mov    -0x1c(%rbp),%eax
  and    $0x7,%eax
  mov    %eax,%edx
  mov    $0x8,%eax
  sub    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jle    L37
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
L37:
  mov    -0x10(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  lea    -0x1(%rax),%edx
  mov    -0x1c(%rbp),%eax
  and    $0x7,%eax
  mov    %eax,%ecx
  mov    $0x8,%eax
  sub    %ecx,%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  not    %eax
  and    %eax,%edx
  mov    -0x28(%rbp),%eax
  and    -0x10(%rbp),%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x4,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x7,%eax
  and    $0xfffffff8,%eax
  mov    %eax,-0x1c(%rbp)
L108:
  mov    -0x8(%rbp),%rax
  and    $0x1,%eax
  test   %eax,%eax
  je     L83
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0x6,%eax
  jle    L83
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%edx
  movzbl %dl,%edx
  mov    %edx,(%rax)
  addl   $0x8,-0x1c(%rbp)
L83:
  mov    -0x8(%rbp),%rax
  and    $0x2,%eax
  test   %eax,%eax
  je     L18
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0xe,%eax
  jle    L18
  mov    -0x28(%rbp),%eax
  movzwl %ax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x8,-0x8(%rbp)
  addl   $0x10,-0x1c(%rbp)
  jmp    L18
L84:
  mov    -0x8(%rbp),%rax
  mov    -0x28(%rbp),%edx
  mov    %edx,(%rax)
  addq   $0x10,-0x8(%rbp)
  addl   $0x20,-0x1c(%rbp)
L18:
  mov    -0x1c(%rbp),%eax
  add    $0x1e,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L84
  mov    -0x1c(%rbp),%eax
  add    $0xe,%eax
  cmp    %eax,-0x20(%rbp)
  jle    L32
  mov    -0x28(%rbp),%eax
  movzwl %ax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x8,-0x8(%rbp)
  addl   $0x10,-0x1c(%rbp)
L32:
  mov    -0x1c(%rbp),%eax
  add    $0x6,%eax
  cmp    %eax,-0x20(%rbp)
  jle    L115
  mov    -0x8(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0x28(%rbp),%edx
  movzbl %dl,%edx
  mov    %edx,(%rax)
  addl   $0x8,-0x1c(%rbp)
L115:
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jg     L48
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    $0xff,%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  and    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  not    %eax
  and    -0x28(%rbp),%eax
  or     %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
L48:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void GrOffScreen1BPPLineDrawH(void *pvDisplayData, int32_t i32X1, int32_t i32X2, int32_t i32Y, uint32_t ui32Value) {
  int32_t i32BytesPerRow, i32Mask;
  uint8_t *pui8Data;
  ;
  pui8Data = (uint8_t *)pvDisplayData;
  i32BytesPerRow = (*(uint16_t *)(pui8Data + 1) + 7) / 8;
  pui8Data += (i32BytesPerRow * i32Y) + (i32X1 / 8) + 5;
  if (ui32Value) {
    ui32Value = 0xffffffff;
  }
  if (i32X1 & 7) {
    i32Mask = 8 - (i32X1 & 7);
    if (i32Mask > (i32X2 - i32X1 + 1)) {
      i32Mask = i32X2 - i32X1 + 1;
    }
    i32Mask = ((1 << i32Mask) - 1) << (8 - (i32X1 & 7) - i32Mask);
    *pui8Data = (*pui8Data & ~i32Mask) | (ui32Value & i32Mask);
    pui8Data++;
    i32X1 = (i32X1 + 7) & ~7;
  }
  if (((uint32_t)pui8Data & 1) && ((i32X2 - i32X1) > 6)) {
    *pui8Data++ = ui32Value & 0xff;
    i32X1 += 8;
  }
  if (((uint32_t)pui8Data & 2) && ((i32X2 - i32X1) > 14)) {
    *(uint16_t *)pui8Data = ui32Value & 0xffff;
    pui8Data += 2;
    i32X1 += 16;
  }
  while ((i32X1 + 31) <= i32X2) {
    *(uint32_t *)pui8Data = ui32Value;
    pui8Data += 4;
    i32X1 += 32;
  }
  if ((i32X1 + 15) <= i32X2) {
    *(uint16_t *)pui8Data = ui32Value & 0xffff;
    pui8Data += 2;
    i32X1 += 16;
  }
  if ((i32X1 + 7) <= i32X2) {
    *pui8Data++ = ui32Value & 0xff;
    i32X1 += 8;
  }
  if (i32X1 <= i32X2) {
    i32Mask = 0xff >> (i32X2 - i32X1 + 1);
    *pui8Data = (*pui8Data & i32Mask) | (ui32Value & ~i32Mask);
  }
}
```