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

```asm
<GrOffScreen1BPPLineDrawH>:
  endbr64
  mov    %rdi,%r10
  mov    %edx,%edi
  lea    0x7(%rsi),%r9d
  mov    0x4(%r10),%edx
  lea    0xe(%rdx),%eax
  add    $0x7,%edx
  cmovns %edx,%eax
  mov    %esi,%edx
  sar    $0x3,%eax
  imul   %ecx,%eax
  test   %esi,%esi
  mov    %esi,%ecx
  cmovs  %r9d,%edx
  sar    $0x3,%edx
  add    %edx,%eax
  neg    %r8d
  cltq
  sbb    %r8d,%r8d
  lea    0x14(%r10,%rax,4),%rax
  and    $0x7,%ecx
  je     L57
  mov    $0x8,%edx
  sub    %ecx,%edx
  mov    %edi,%ecx
  sub    %esi,%ecx
  mov    %edx,%esi
  add    $0x1,%ecx
  cmp    %edx,%ecx
  cmovg  %edx,%ecx
  mov    $0x1,%edx
  add    $0x4,%rax
  sub    %ecx,%esi
  shl    %cl,%edx
  sub    $0x1,%edx
  mov    %esi,%ecx
  mov    %r9d,%esi
  shl    %cl,%edx
  mov    -0x4(%rax),%ecx
  and    $0xfffffff8,%esi
  xor    %r8d,%ecx
  and    %ecx,%edx
  xor    -0x4(%rax),%edx
  mov    %edx,-0x4(%rax)
L57:
  mov    %eax,%edx
  test   $0x1,%al
  je     L115
  mov    %edi,%ecx
  sub    %esi,%ecx
  cmp    $0x6,%ecx
  jg     L112
L115:
  and    $0x2,%edx
  je     L18
  mov    %edi,%edx
  sub    %esi,%edx
  cmp    $0xe,%edx
  jg     L85
L18:
  lea    0x1e(%rsi),%edx
  cmp    %edx,%edi
  jle    L53
L35:
  lea    -0x1f(%rdi),%ecx
  sub    %esi,%ecx
  shr    $0x5,%ecx
  lea    0x1(%rcx),%edx
  shl    $0x4,%rdx
  add    %rax,%rdx
L67:
  mov    %r8d,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L67
  shl    $0x5,%ecx
  lea    0x20(%rsi,%rcx,1),%esi
L44:
  lea    0xe(%rsi),%eax
  cmp    %edi,%eax
  jge    L37
  movzwl %r8w,%eax
  add    $0x8,%rdx
  add    $0x10,%esi
  mov    %eax,-0x8(%rdx)
L37:
  lea    0x6(%rsi),%eax
  cmp    %edi,%eax
  jge    L108
  movzbl %r8b,%eax
  add    $0x8,%esi
  add    $0x4,%rdx
  mov    %eax,-0x4(%rdx)
L108:
  cmp    %edi,%esi
  jg     L123
  sub    %esi,%edi
  mov    $0xffffff00,%esi
  mov    $0xff,%eax
  lea    0x1(%rdi),%ecx
  sar    %cl,%esi
  sar    %cl,%eax
  and    (%rdx),%eax
  and    %r8d,%esi
  or     %esi,%eax
  mov    %eax,(%rdx)
L123:
  ret
  xchg   %ax,%ax
L85:
  movzwl %r8w,%edx
  add    $0x10,%esi
  add    $0x8,%rax
  mov    %edx,-0x8(%rax)
  lea    0x1e(%rsi),%edx
  cmp    %edx,%edi
  jg     L35
L53:
  mov    %rax,%rdx
  jmp    L44
  xchg   %ax,%ax
L112:
  lea    0x4(%rax),%rcx
  movzbl %r8b,%edx
  add    $0x8,%esi
  mov    %edx,(%rax)
  mov    %ecx,%edx
  mov    %rcx,%rax
  jmp    L115
```

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);
  }
}
```