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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L57:
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  ja     L57
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L142
L93:
  mov    -0x24(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L159
  movl   $0x1,-0x28(%rbp)
  jmp    L126
L159:
  movl   $0x0,-0x28(%rbp)
  jmp    L120
L126:
  addl   $0x1,-0x24(%rbp)
L142:
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cmp    %eax,%edx
  ja     L93
L120:
  jmp    L69
L89:
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L46
L123:
  mov    -0x20(%rbp),%eax
  cltq
  movzbl -0x12(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L40
  movl   $0x1,-0x18(%rbp)
  jmp    L106
L40:
  movl   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  jmp    L78
L106:
  addl   $0x1,-0x20(%rbp)
L46:
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  cmp    %eax,%edx
  ja     L123
L69:
  cmpl   $0x0,-0x28(%rbp)
  je     L89
  lea    -0x12(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L95
  mov    -0x1c(%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     L85
L95:
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L3
L85:
  mov    -0x1c(%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     L100
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L3
L100:
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L3:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    $0x0,%eax
L78:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L101
  call   <__stack_chk_fail@plt>
L101:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D45
type: string
name: retrieve_data
arguments: data_label: D41
type: string
name: retrieve_data
arguments: data_label: D16
type: string
name: retrieve_data
arguments: data_label: D9
type: string

tool: D45: Enter 4 digit year: 

tool: D41: Enter only digits: 

tool: D16: It's not a leap year

tool: D9: It's a leap year

assistant: ```c
int main() {
  char s[10];
  int year;
  do {
    printf("Enter 4 digit year: ");
    gets(s);
  } while ((unsigned)strlen(s) > 4);
  int isNumber = 0;
  for (int i = 0; i < (unsigned)strlen(s); i++) {
    if (isalpha(s[i]) == 0) {
      isNumber = 1;
    } else {
      isNumber = 0;
      break;
    }
  }
  while (!isNumber) {
    printf("Enter only digits: ");
    gets(s);
    int isNumber = 0;
    for (int i = 0; i < (unsigned)strlen(s); i++) {
      if (isalpha(s[i]) == 0) {
        isNumber = 1;
      } else {
        return isNumber = 0;
      }
    }
  }
  year = atoi(s);
  if ((year % 4 != 0) || (year % 400 != 0)) {
    printf("It's not a leap year");
  } else if (year % 100 != 0) {
    printf("It's a leap year");
  } else {
    printf("It's a leap year");
  }
  getchar();
  return 0;
}
```