user: What would the C source look like for the assembly code provided here?

```asm
<bcd_valid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jg     L168
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  cmp    $0x9,%eax
  jle    L108
L168:
  mov    $0x0,%eax
  jmp    L225
L108:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x17,-0xc(%rbp)
  jg     L250
  cmpl   $0x3b,-0x8(%rbp)
  jg     L250
  cmpl   $0x3c,-0x4(%rbp)
  jle    L94
L250:
  mov    $0x0,%eax
  jmp    L225
L94:
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  sar    $0x4,%al
  movsbl %al,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x8(%rbp)
  jle    L308
  cmpl   $0xc,-0x8(%rbp)
  jle    L52
L308:
  mov    $0x0,%eax
  jmp    L225
L52:
  cmpl   $0x0,-0xc(%rbp)
  jle    L245
  cmpl   $0x1c,-0xc(%rbp)
  jle    L64
  mov    -0x4(%rbp),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x7,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x190,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  je     L90
  mov    -0x4(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L50
  mov    -0x4(%rbp),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  je     L50
L90:
  cmpl   $0x1d,-0xc(%rbp)
  jle    L64
L50:
  cmpl   $0x2,-0x8(%rbp)
  je     L261
  cmpl   $0x1e,-0xc(%rbp)
  jle    L64
L261:
  mov    -0x8(%rbp),%eax
  sar    $0x3,%eax
  xor    -0x8(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L245
  cmpl   $0x1f,-0xc(%rbp)
  jle    L64
L245:
  mov    $0x0,%eax
  jmp    L225
L64:
  mov    $0x1,%eax
L225:
  pop    %rbp
  ret
```

assistant: ```c
int bcd_valid(const char *bcd) {
  int a, b, c;
  if (!((((bcd[0]) & 15) < 10 && (((bcd[0]) >> 4) & 15) < 10) && (((bcd[1]) & 15) < 10 && (((bcd[1]) >> 4) & 15) < 10) && (((bcd[2]) & 15) < 10 && (((bcd[2]) >> 4) & 15) < 10) && (((bcd[3]) & 15) < 10 && (((bcd[3]) >> 4) & 15) < 10) && (((bcd[4]) & 15) < 10 && (((bcd[4]) >> 4) & 15) < 10) && (((bcd[5]) & 15) < 10 && (((bcd[5]) >> 4) & 15) < 10)))
    return 0;
  a = (((bcd[0]) & 15) + (((bcd[0]) >> 4) & 15) * 10);
  b = (((bcd[1]) & 15) + (((bcd[1]) >> 4) & 15) * 10);
  c = (((bcd[2]) & 15) + (((bcd[2]) >> 4) & 15) * 10);
  if (a > 23 || b > 59 || c > 60)
    return 0;
  a = (((bcd[3]) & 15) + (((bcd[3]) >> 4) & 15) * 10);
  b = (((bcd[4]) & 15) + (((bcd[4]) >> 4) & 15) * 10);
  c = (((bcd[5]) & 15) + (((bcd[5]) >> 4) & 15) * 10);
  if (b < 1 || b > 12)
    return 0;
  if (!(1 <= a && (a <= 28 || (((c) % 400 == 0 || ((c) % 4 == 0 && (c) % 100 != 0)) && a <= 29) || (b != 2 && a <= 30) || (((((b) >> 3) ^ (b)) & 1) && a <= 31))))
    return 0;
  return 1;
}
```