user: 请将以下的汇编代码转换成C语言代码：

```asm
<parse_canframe>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  xor    %esi,%esi
  mov    $0x18,%edx
  mov    %rbx,%rdi
  mov    %eax,%r12d
  call   <memset@plt>
  cmp    $0x3,%r12d
  jle    L154
  cmpb   $0x23,0x3(%rbp)
  je     L83
  cmpb   $0x23,0x8(%rbp)
  jne    L154
  mov    %rbp,%r14
  mov    $0x1c,%r13d
  xchg   %ax,%ax
L55:
  movsbl (%r14),%edi
  call   <asc2nibble@plt>
  cmp    $0xf,%al
  ja     L154
  mov    %r13d,%ecx
  movzbl %al,%eax
  sub    $0x4,%r13d
  add    $0x1,%r14
  shl    %cl,%eax
  or     (%rbx),%al
  mov    %al,(%rbx)
  cmp    $0xfffffffc,%r13d
  jne    L55
  mov    D22(%rip),%rdx
  mov    (%rdx),%ecx
  and    %eax,%ecx
  test   %cl,%cl
  jne    L87
  mov    D7(%rip),%rdx
  mov    $0x9,%r13d
  or     (%rdx),%al
  mov    %al,(%rbx)
  mov    $0x9,%eax
  jmp    L114
  nopw   0x0(%rax,%rax,1)
L154:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L83:
  mov    %rbp,%r14
  mov    $0x8,%r13d
L92:
  movsbl (%r14),%edi
  call   <asc2nibble@plt>
  cmp    $0xf,%al
  ja     L154
  mov    %r13d,%ecx
  movzbl %al,%eax
  sub    $0x4,%r13d
  add    $0x1,%r14
  shl    %cl,%eax
  or     %al,(%rbx)
  cmp    $0xfffffffc,%r13d
  jne    L92
  mov    $0x4,%eax
  mov    $0x4,%r13d
L114:
  movzbl 0x0(%rbp,%rax,1),%eax
  xor    %r15d,%r15d
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x52,%dl
  je     L96
L134:
  cmp    $0x2e,%al
  mov    %r15d,%edx
  sete   %al
  movzbl %al,%eax
  add    %eax,%r13d
  cmp    %r12d,%r13d
  jge    L137
  movslq %r13d,%rax
  lea    0x1(%r13),%r14d
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <asc2nibble@plt>
  cmp    $0xf,%al
  ja     L154
  mov    0x8(%rbx),%rdx
  shl    $0x4,%eax
  movslq %r14d,%r14
  add    $0x2,%r13d
  mov    %al,(%rdx,%r15,1)
  movsbl 0x0(%rbp,%r14,1),%edi
  call   <asc2nibble@plt>
  cmp    $0xf,%al
  ja     L154
  mov    0x8(%rbx),%rdx
  add    %r15,%rdx
  add    $0x1,%r15
  or     %al,(%rdx)
  cmp    $0x8,%r15
  je     L45
  movslq %r13d,%rax
  movzbl 0x0(%rbp,%rax,1),%eax
  jmp    L134
  nopl   (%rax)
L45:
  mov    $0x8,%edx
L137:
  mov    %edx,0x10(%rbx)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L96:
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  or     %al,(%rbx)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L87:
  mov    $0x9,%eax
  mov    $0x9,%r13d
  jmp    L114
```

assistant: ```c
int parse_canframe(char *cs, struct can_frame *cf) {
  int i, idx, dlc, len;
  unsigned char tmp;
  len = strlen(cs);
  memset(cf, 0, sizeof(*cf));
  if (len < 4)
    return 1;
  if (cs[3] == '#') {
    idx = 4;
    for (i = 0; i < 3; i++) {
      if ((tmp = asc2nibble(cs[i])) > 0x0F)
        return 1;
      cf->can_id |= (tmp << (2 - i) * 4);
    }
  } else if (cs[8] == '#') {
    idx = 9;
    for (i = 0; i < 8; i++) {
      if ((tmp = asc2nibble(cs[i])) > 0x0F)
        return 1;
      cf->can_id |= (tmp << (7 - i) * 4);
    }
    if (!(cf->can_id & CAN_ERR_FLAG))
      cf->can_id |= CAN_EFF_FLAG;
  } else
    return 1;
  if ((cs[idx] == 'R') || (cs[idx] == 'r')) {
    cf->can_id |= CAN_RTR_FLAG;
    return 0;
  }
  for (i = 0, dlc = 0; i < 8; i++) {
    if (cs[idx] == '.')
      idx++;
    if (idx >= len)
      break;
    if ((tmp = asc2nibble(cs[idx++])) > 0x0F)
      return 1;
    cf->data[i] = (tmp << 4);
    if ((tmp = asc2nibble(cs[idx++])) > 0x0F)
      return 1;
    cf->data[i] |= tmp;
    dlc++;
  }
  cf->can_dlc = dlc;
  return 0;
}
```