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

```asm
<check_date>:
  endbr64
  movsbl 0x4(%rdi),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x5(%rdi),%eax
  lea    -0x30(%rax,%rdx,2),%esi
  movsbl 0x2(%rdi),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x3(%rdi),%eax
  lea    -0x30(%rax,%rdx,2),%ecx
  movsbl (%rdi),%eax
  lea    -0xf0(%rax,%rax,4),%edx
  movsbl 0x1(%rdi),%eax
  lea    -0x30(%rax,%rdx,2),%r8d
  mov    $0x0,%eax
  cmp    $0x34,%ecx
  ja     L42
  movabs $0x1ffe01ffe01ffe,%rax
  bt     %rcx,%rax
  jae    L19
  cmp    $0x2,%ecx
  je     L51
  lea    -0x4(%rcx),%eax
  cmp    $0x2f,%eax
  ja     L80
  mov    $0x1,%eax
  shl    %cl,%rax
  mov    $0x1e,%edx
  movabs $0xa5000a5000a50,%rdi
  test   %rdi,%rax
  jne    L105
  cmp    $0x2a,%ecx
  je     L16
  cmp    $0x16,%ecx
  je     L60
  mov    $0x1f,%edx
L105:
  test   %esi,%esi
  setg   %cl
  cmp    %esi,%edx
  setge  %al
  movzbl %al,%eax
  and    %ecx,%eax
  ret
L51:
  mov    %r8d,%edx
  and    $0x3,%edx
  cmp    $0x1,%edx
  mov    $0x1c,%edx
  adc    $0x0,%edx
  jmp    L105
L60:
  mov    %r8d,%edx
  and    $0x3,%edx
  cmp    $0x1,%edx
  mov    $0x1c,%edx
  adc    $0x0,%edx
  jmp    L105
L16:
  mov    %r8d,%edx
  and    $0x3,%edx
  cmp    $0x1,%edx
  mov    $0x1c,%edx
  adc    $0x0,%edx
  jmp    L105
L80:
  mov    $0x1f,%edx
  jmp    L105
L19:
  mov    $0x0,%eax
L42:
  ret
```

assistant: ```c
int check_date(char serial_number[12]) {
  int date;
  int month;
  int year;
  int max_date = 31;
  date = (serial_number[4] - '0') * 10 + (serial_number[5] - '0');
  month = (serial_number[2] - '0') * 10 + (serial_number[3] - '0');
  year = (serial_number[0] - '0') * 10 + (serial_number[1] - '0');
  if (!((month >= 1 && month <= 12) || (month >= 21 && month <= 32) || (month >= 41 && month <= 52))) {
    return 0;
  }
  switch (month) {
  case 1:
    max_date = 31;
    break;
  case 2:
    if (year % 4 == 0) {
      max_date = 29;
    } else {
      max_date = 28;
    }
    break;
  case 3:
    max_date = 31;
    break;
  case 4:
    max_date = 30;
    break;
  case 5:
    max_date = 31;
    break;
  case 6:
    max_date = 30;
    break;
  case 7:
    max_date = 31;
    break;
  case 8:
    max_date = 31;
    break;
  case 9:
    max_date = 30;
    break;
  case 10:
    max_date = 31;
    break;
  case 11:
    max_date = 30;
    break;
  case 12:
    max_date = 31;
    break;
  case 21:
    max_date = 31;
    break;
  case 22:
    if (year % 4 == 0) {
      max_date = 29;
    } else {
      max_date = 28;
    }
    break;
  case 23:
    max_date = 31;
    break;
  case 24:
    max_date = 30;
    break;
  case 25:
    max_date = 31;
    break;
  case 26:
    max_date = 30;
    break;
  case 27:
    max_date = 31;
    break;
  case 28:
    max_date = 31;
    break;
  case 29:
    max_date = 30;
    break;
  case 30:
    max_date = 31;
    break;
  case 31:
    max_date = 30;
    break;
  case 32:
    max_date = 31;
    break;
  case 41:
    max_date = 31;
    break;
  case 42:
    if (year % 4 == 0) {
      max_date = 29;
    } else {
      max_date = 28;
    }
    break;
  case 43:
    max_date = 31;
    break;
  case 44:
    max_date = 30;
    break;
  case 45:
    max_date = 31;
    break;
  case 46:
    max_date = 30;
    break;
  case 47:
    max_date = 31;
    break;
  case 48:
    max_date = 31;
    break;
  case 49:
    max_date = 30;
    break;
  case 50:
    max_date = 31;
    break;
  case 51:
    max_date = 30;
    break;
  case 52:
    max_date = 31;
    break;
  }
  if ((1 <= date) && (date <= max_date)) {
    return 1;
  }
  return 0;
}
```