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

```asm
<packData>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %edx,%eax
  mov    %rcx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %esi,%edx
  mov    %dl,-0x1c(%rbp)
  mov    %al,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movb   $0x0,-0x9(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x23,(%rax)
  movzbl -0x20(%rbp),%eax
  lea    0x61(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1c(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L50
L63:
  cmpl   $0x0,-0x2c(%rbp)
  je     L8
  movzbl -0x9(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %dl,-0x9(%rbp)
  movzbl %al,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xc(%rbp)
  subl   $0x1,-0x2c(%rbp)
  jmp    L22
L8:
  movb   $0x0,-0xc(%rbp)
L22:
  cmpl   $0x0,-0x2c(%rbp)
  je     L55
  movzbl -0x9(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %dl,-0x9(%rbp)
  movzbl %al,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xb(%rbp)
  subl   $0x1,-0x2c(%rbp)
  jmp    L40
L55:
  movb   $0x0,-0xb(%rbp)
L40:
  cmpl   $0x0,-0x2c(%rbp)
  je     L32
  movzbl -0x9(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %dl,-0x9(%rbp)
  movzbl %al,%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
  subl   $0x1,-0x2c(%rbp)
  jmp    L33
L32:
  movb   $0x0,-0xa(%rbp)
L33:
  movzbl -0xc(%rbp),%eax
  shr    $0x2,%al
  lea    0x3d(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0xc(%rbp),%eax
  shl    $0x4,%eax
  and    $0x30,%eax
  mov    %eax,%edx
  movzbl -0xb(%rbp),%eax
  shr    $0x4,%al
  or     %edx,%eax
  lea    0x3d(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0xb(%rbp),%eax
  shl    $0x2,%eax
  and    $0x3c,%eax
  mov    %eax,%edx
  movzbl -0xa(%rbp),%eax
  shr    $0x6,%al
  or     %edx,%eax
  lea    0x3d(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0xa(%rbp),%eax
  and    $0x3f,%eax
  lea    0x3d(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L50:
  cmpl   $0x0,-0x2c(%rbp)
  jne    L63
  mov    -0x8(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <addCRC@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int packData(char *txBuffer, unsigned char cmd, unsigned char addr, unsigned char *snd, int len) {
  unsigned int pt = 0;
  unsigned char a, b, c;
  unsigned char ptr = 0;
  int length = 0;
  txBuffer[pt++] = '#';
  txBuffer[pt++] = 'a' + addr;
  txBuffer[pt++] = cmd;
  while (len) {
    if (len) {
      a = snd[ptr++];
      len--;
    } else
      a = 0;
    if (len) {
      b = snd[ptr++];
      len--;
    } else
      b = 0;
    if (len) {
      c = snd[ptr++];
      len--;
    } else
      c = 0;
    txBuffer[pt++] = '=' + (a >> 2);
    txBuffer[pt++] = '=' + (((a & 0x03) << 4) | ((b & 0xf0) >> 4));
    txBuffer[pt++] = '=' + (((b & 0x0f) << 2) | ((c & 0xc0) >> 6));
    txBuffer[pt++] = '=' + (c & 0x3f);
  }
  length = addCRC(txBuffer, pt);
  return length;
}
```