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

```asm
<send_cmd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movb   $0x0,-0x9(%rbp)
  mov    $0xc000a044,%eax
  mov    (%rax),%edx
  mov    $0xc000a044,%eax
  or     $0x2,%edx
  mov    %edx,(%rax)
  movl   $0x0,-0x8(%rbp)
  jmp    L3
L80:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L66
L43:
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  and    $0xfffffffe,%edx
  mov    %edx,(%rax)
  mov    $0x0,%eax
  call   <clkDelay@plt>
  movzbl -0xa(%rbp),%eax
  test   %al,%al
  jns    L27
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  or     $0x2,%edx
  mov    %edx,(%rax)
  jmp    L6
L27:
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  and    $0xfffffffd,%edx
  mov    %edx,(%rax)
L6:
  shlb   -0x9(%rbp)
  mov    $0x0,%eax
  call   <clkDelay@plt>
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  or     $0x1,%edx
  mov    %edx,(%rax)
  movzbl -0x9(%rbp),%eax
  xor    -0xa(%rbp),%al
  test   %al,%al
  jns    L33
  xorb   $0x9,-0x9(%rbp)
L33:
  shlb   -0xa(%rbp)
  addl   $0x1,-0x4(%rbp)
L66:
  cmpl   $0x7,-0x4(%rbp)
  jle    L43
  andb   $0x7f,-0x9(%rbp)
  addl   $0x1,-0x8(%rbp)
L3:
  cmpl   $0x4,-0x8(%rbp)
  jle    L80
  movzbl -0x9(%rbp),%eax
  add    %eax,%eax
  or     $0x1,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  mov    %al,-0xa(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L59
L97:
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  and    $0xfffffffe,%edx
  mov    %edx,(%rax)
  mov    $0x0,%eax
  call   <clkDelay@plt>
  movzbl -0x9(%rbp),%eax
  test   %al,%al
  jns    L58
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  or     $0x2,%edx
  mov    %edx,(%rax)
  jmp    L38
L58:
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  and    $0xfffffffd,%edx
  mov    %edx,(%rax)
L38:
  mov    $0x0,%eax
  call   <clkDelay@plt>
  mov    $0xc000a040,%eax
  mov    (%rax),%edx
  mov    $0xc000a040,%eax
  or     $0x1,%edx
  mov    %edx,(%rax)
  shlb   -0x9(%rbp)
  addl   $0x1,-0x4(%rbp)
L59:
  cmpl   $0x7,-0x4(%rbp)
  jle    L97
  movzbl -0xa(%rbp),%eax
  leave
  ret
```

assistant: ```c
unsigned char send_cmd(unsigned char *in) {
  int i, j;
  unsigned char b, crc = 0;
  *((unsigned int *)0xC000A044) |= (1 << 1);
  for (i = 0; i < 5; i++) {
    b = in[i];
    for (j = 0; j < 8; j++) {
      do {
        *((unsigned int *)0xC000A040) &= ~(1 << 0);
        clkDelay();
      } while (0);
      if (b & 0x80)
        *((unsigned int *)0xC000A040) |= (1 << 1);
      else
        *((unsigned int *)0xC000A040) &= ~(1 << 1);
      crc <<= 1;
      do {
        clkDelay();
        *((unsigned int *)0xC000A040) |= (1 << 0);
      } while (0);
      if ((crc ^ b) & 0x80)
        crc ^= 0x09;
      b <<= 1;
    }
    crc &= 0x7f;
  }
  crc = ((crc << 1) | 0x01);
  b = crc;
  for (j = 0; j < 8; j++) {
    do {
      *((unsigned int *)0xC000A040) &= ~(1 << 0);
      clkDelay();
    } while (0);
    if (crc & 0x80)
      *((unsigned int *)0xC000A040) |= (1 << 1);
    else
      *((unsigned int *)0xC000A040) &= ~(1 << 1);
    do {
      clkDelay();
      *((unsigned int *)0xC000A040) |= (1 << 0);
    } while (0);
    crc <<= 1;
  }
  return b;
}
```