user: 请从给定的汇编指令推导出C源代码：

```asm
<parse_canframe>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  cmpl   $0x3,-0x4(%rbp)
  jg     L60
  mov    $0x1,%eax
  jmp    L98
L60:
  mov    -0x28(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L208
  movl   $0x4,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L4
L184:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <asc2nibble@plt>
  mov    %al,-0x11(%rbp)
  cmpb   $0xf,-0x11(%rbp)
  jbe    L274
  mov    $0x1,%eax
  jmp    L98
L274:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%esi
  movzbl -0x11(%rbp),%edx
  mov    $0x2,%eax
  sub    -0x10(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %esi,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x10(%rbp)
L4:
  cmpl   $0x2,-0x10(%rbp)
  jle    L184
  jmp    L16
L208:
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  jne    L241
  movl   $0x9,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L219
L269:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <asc2nibble@plt>
  mov    %al,-0x11(%rbp)
  cmpb   $0xf,-0x11(%rbp)
  jbe    L134
  mov    $0x1,%eax
  jmp    L98
L134:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%esi
  movzbl -0x11(%rbp),%edx
  mov    $0x7,%eax
  sub    -0x10(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %esi,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x10(%rbp)
L219:
  cmpl   $0x7,-0x10(%rbp)
  jle    L269
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    D28(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  jne    L16
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L16
L241:
  mov    $0x1,%eax
  jmp    L98
L16:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x52,%al
  je     L118
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x72,%al
  jne    L0
L118:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    D22(%rip),%rax
  mov    (%rax),%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    $0x0,%eax
  jmp    L98
L0:
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L82
L53:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L111
  addl   $0x1,-0xc(%rbp)
L111:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jge    L131
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <asc2nibble@plt>
  mov    %al,-0x11(%rbp)
  cmpb   $0xf,-0x11(%rbp)
  jbe    L108
  mov    $0x1,%eax
  jmp    L98
L108:
  mov    -0x30(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl -0x11(%rbp),%edx
  shl    $0x4,%edx
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <asc2nibble@plt>
  mov    %al,-0x11(%rbp)
  cmpb   $0xf,-0x11(%rbp)
  jbe    L37
  mov    $0x1,%eax
  jmp    L98
L37:
  mov    -0x30(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    -0x30(%rbp),%rdx
  mov    0x8(%rdx),%rcx
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  add    %rcx,%rdx
  or     -0x11(%rbp),%al
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
  addl   $0x1,-0x10(%rbp)
L82:
  cmpl   $0x7,-0x10(%rbp)
  jle    L53
  jmp    L256
L131:
  nop
L256:
  mov    -0x30(%rbp),%rax
  mov    -0x8(%rbp),%edx
  mov    %edx,0x10(%rax)
  mov    $0x0,%eax
L98:
  leave
  ret
```

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