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

```asm
<parse_validity>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %esi,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L295
  cmpb   $0x0,(%rdi)
  mov    %rdi,%r12
  jne    L60
L295:
  mov    0xc(%rsp),%eax
L180:
  mov    0xe8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L204
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L60:
  mov    %rdi,%rcx
  mov    $0x64,%esi
  xor    %eax,%eax
  movb   $0x0,0x10(%rsp)
  lea    0x80(%rsp),%r15
  lea    D112(%rip),%rdx
  mov    %r15,%rdi
  call   <snprintf@plt>
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <cutspaces@plt>
  movsbl 0x80(%rsp),%edi
  test   %dil,%dil
  je     L85
  mov    %r15,%rbp
  xor    %ebx,%ebx
  xor    %r13d,%r13d
  mov    $0x1,%r14d
  jmp    L52
  nopl   (%rax)
L135:
  mov    %al,0x0(%rbp)
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0xa,%eax
  cmovae %r14d,%ebx
  cmovb  %r14d,%r13d
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  test   %dil,%dil
  je     L130
L52:
  call   <tolower@plt>
  cmp    $0x9,%al
  jne    L135
  movb   $0x20,0x0(%rbp)
  movsbl 0x1(%rbp),%edi
  add    $0x1,%rbp
  mov    $0x1,%ebx
  test   %dil,%dil
  jne    L52
L130:
  xor    $0x1,%ebx
  test   %r13d,%ebx
  jne    L87
L85:
  mov    $0x20,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L299
  movb   $0x0,(%rax)
L299:
  mov    %r15,%rsi
  lea    D61(%rip),%rdi
  lea    0x10(%rsp),%rbx
  call   <strstr@plt>
  test   %rax,%rax
  je     L36
  mov    %r15,%rcx
  mov    $0x61,%edx
  mov    %rbx,%rdi
  xor    %eax,%eax
  lea    D29(%rip),%rsi
  call   <sprintf@plt>
L336:
  lea    D113(%rip),%r12
  lea    D105(%rip),%rbp
  lea    D32(%rip),%r13
  lea    D116(%rip),%r14
L73:
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jle    L295
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L257
  cmp    $0x2d0,%r15d
  jle    L196
  movslq %r15d,%rax
  mov    %r15d,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  imul   $0xffffffff88888889,%rax,%rax
  sar    $0x1f,%edx
  shr    $0x20,%rax
  add    %r15d,%eax
  sar    $0x5,%eax
  sub    %edx,%eax
  mov    %eax,%r15d
  mov    %eax,%edx
  xor    %eax,%eax
  call   <sprintf@plt>
L257:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L68
  cmp    $0xc,%r15d
  jle    L283
  cmp    $0x18,%r15d
  jle    L368
  mov    %r15d,%ecx
  mov    $0xaaaaaaab,%eax
  lea    D162(%rip),%rsi
  mov    %rbx,%rdi
  imul   %rax,%rcx
  xor    %eax,%eax
  shr    $0x24,%rcx
  mov    %ecx,%edx
  mov    %rcx,%r15
  call   <sprintf@plt>
L68:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L318
  cmp    $0x1,%r15d
  je     L54
  cmp    $0x22,%r15d
  jle    L224
  mov    %r15d,%eax
  mov    %r15d,%ecx
  lea    D98(%rip),%rsi
  mov    %rbx,%rdi
  imul   $0x24924925,%rax,%rax
  shr    $0x20,%rax
  sub    %eax,%ecx
  shr    %ecx
  add    %eax,%ecx
  xor    %eax,%eax
  shr    $0x2,%ecx
  mov    %ecx,%edx
  mov    %ecx,%r15d
  call   <sprintf@plt>
  lea    D92(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L239
L108:
  mov    $0x3f,%eax
  cmp    %eax,%r15d
  cmovle %r15d,%eax
  lea    0xc0(%rax),%eax
  jmp    L180
  nopl   0x0(%rax)
L318:
  lea    D92(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L239
  cmp    $0x4,%r15d
  jg     L108
  lea    0x0(,%r15,8),%edx
  lea    D162(%rip),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  sub    %r15d,%edx
  call   <sprintf@plt>
  jmp    L73
  nopl   0x0(%rax,%rax,1)
L239:
  lea    D144(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L361
  mov    $0x16d,%edx
  cmp    $0xc,%r15d
  je     L374
  imul   $0x1e,%r15d,%edx
L374:
  lea    D162(%rip),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L73
  nopl   0x0(%rax)
L36:
  mov    %r12,%rcx
  mov    $0x63,%edx
  mov    %rbx,%rdi
  xor    %eax,%eax
  lea    D163(%rip),%rsi
  call   <sprintf@plt>
  jmp    L336
  xchg   %ax,%ax
L87:
  xor    %eax,%eax
  mov    %r15,%rdi
  call   <atoi@plt>
  cmp    $0xff,%eax
  jbe    L180
  jmp    L295
  nopw   0x0(%rax,%rax,1)
L361:
  lea    D135(%rip),%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L295
  cmp    $0x1,%r15d
  je     L69
  mov    $0xff,%eax
  jmp    L180
  nopl   0x0(%rax,%rax,1)
L283:
  imul   $0x3c,%r15d,%edx
  lea    D124(%rip),%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L73
L54:
  movabs $0x72756f68203432,%rax
  mov    %rax,(%rbx)
  jmp    L73
L69:
  movabs $0x6b656577203235,%rax
  mov    %rax,(%rbx)
  jmp    L73
L196:
  xor    %eax,%eax
  cmp    $0x4,%r15d
  jle    L180
  movslq %r15d,%rax
  mov    %r15d,%ecx
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x21,%rax
  sub    %ecx,%eax
  sub    $0x1,%eax
  jmp    L180
L368:
  lea    0x77(%r15,%r15,1),%eax
  jmp    L180
L224:
  mov    $0x1e,%eax
  cmp    %eax,%r15d
  cmovle %r15d,%eax
  add    $0xa6,%eax
  jmp    L180
L204:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D112
type: string
name: extract_symbolic_data
arguments: data_label: D61
type: string
name: extract_symbolic_data
arguments: data_label: D29
type: string
name: extract_symbolic_data
arguments: data_label: D113
type: string
name: extract_symbolic_data
arguments: data_label: D105
type: string
name: extract_symbolic_data
arguments: data_label: D32
type: string
name: extract_symbolic_data
arguments: data_label: D116
type: string
name: extract_symbolic_data
arguments: data_label: D162
type: string
name: extract_symbolic_data
arguments: data_label: D98
type: string
name: extract_symbolic_data
arguments: data_label: D92
type: string
name: extract_symbolic_data
arguments: data_label: D144
type: string
name: extract_symbolic_data
arguments: data_label: D163
type: string
name: extract_symbolic_data
arguments: data_label: D135
type: string
name: extract_symbolic_data
arguments: data_label: D124
type: string

tool: D112: %s

tool: D61: min hour day week month year

tool: D29: 1 %.*s

tool: D113: min

tool: D105: %i hour

tool: D32: hour

tool: D116: day

tool: D162: %i day

tool: D98: %i week

tool: D92: week

tool: D144: month

tool: D163: %.*s

tool: D135: year

tool: D124: %i min

assistant: ```c
int parse_validity(char *value, int defaultvalue) {
  int result = defaultvalue;
  char buffer[100];
  int i;
  char tmp[100];
  int got_numbers = 0;
  int got_letters = 0;
  int idx;
  char *p;
  if (value && *value) {
    *buffer = 0;
    snprintf(tmp, sizeof(tmp), "%s", value);
    cutspaces(tmp);
    for (idx = 0; tmp[idx]; idx++) {
      tmp[idx] = tolower((int)tmp[idx]);
      if (tmp[idx] == '\t')
        tmp[idx] = ' ';
      if (isdigit((int)(tmp[idx])))
        got_numbers = 1;
      else
        got_letters = 1;
    }
    if (got_numbers && !got_letters) {
      i = atoi(tmp);
      if (i >= 0 && i <= 255)
        result = i;
      return result;
    }
    if ((p = strchr(tmp, ' ')))
      *p = 0;
    if (strstr("min hour day week month year", tmp))
      sprintf(buffer, "1 %.*s", (int)sizeof(buffer) - 3, tmp);
    else
      sprintf(buffer, "%.*s", (int)sizeof(buffer) - 1, value);
    while ((i = atoi(buffer)) > 0) {
      if (strstr(buffer, "min")) {
        if (i <= 720) {
          result = (i < 5) ? 0 : i / 5 - 1;
          break;
        }
        sprintf(buffer, "%i hour", i /= 60);
      }
      if (strstr(buffer, "hour")) {
        if (i <= 12) {
          sprintf(buffer, "%i min", i * 60);
          continue;
        }
        if (i <= 24) {
          result = (i - 12) * 2 + 143;
          break;
        }
        sprintf(buffer, "%i day", i /= 24);
      }
      if (strstr(buffer, "day")) {
        if (i < 2) {
          sprintf(buffer, "24 hour");
          continue;
        }
        if (i <= 34) {
          result = (i <= 30) ? i + 166 : 30 + 166;
          break;
        }
        sprintf(buffer, "%i week", i /= 7);
      }
      if (strstr(buffer, "week")) {
        if (i < 5) {
          sprintf(buffer, "%i day", i * 7);
          continue;
        }
        result = (i <= 63) ? i + 192 : 255;
        break;
      }
      if (strstr(buffer, "month")) {
        sprintf(buffer, "%i day", (i == 12) ? 365 : i * 30);
        continue;
      }
      if (strstr(buffer, "year")) {
        if (i == 1) {
          sprintf(buffer, "52 week");
          continue;
        }
        result = 255;
      }
      break;
    }
  }
  return result;
}
```