user: Translate the below assembly code into C programming language:

```asm
<parse_validity>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x110,%rsp
  mov    %rdi,-0x108(%rbp)
  mov    %esi,-0x10c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x10c(%rbp),%eax
  mov    %eax,-0xfc(%rbp)
  movl   $0x0,-0xf4(%rbp)
  movl   $0x0,-0xf0(%rbp)
  cmpq   $0x0,-0x108(%rbp)
  je     L442
  mov    -0x108(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L442
  movb   $0x0,-0xe0(%rbp)
  mov    -0x108(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rcx
  lea    D110(%rip),%rdx
  mov    $0x64,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cutspaces@plt>
  movl   $0x0,-0xec(%rbp)
  jmp    L256
L450:
  mov    -0xec(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,%edx
  mov    -0xec(%rbp),%eax
  cltq
  mov    %dl,-0x70(%rbp,%rax,1)
  mov    -0xec(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  cmp    $0x9,%al
  jne    L167
  mov    -0xec(%rbp),%eax
  cltq
  movb   $0x20,-0x70(%rbp,%rax,1)
L167:
  mov    -0xec(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L163
  movl   $0x1,-0xf4(%rbp)
  jmp    L252
L163:
  movl   $0x1,-0xf0(%rbp)
L252:
  addl   $0x1,-0xec(%rbp)
L256:
  mov    -0xec(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L450
  cmpl   $0x0,-0xf4(%rbp)
  je     L137
  cmpl   $0x0,-0xf0(%rbp)
  jne    L137
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,-0xf8(%rbp)
  cmpl   $0x0,-0xf8(%rbp)
  js     L91
  cmpl   $0xff,-0xf8(%rbp)
  jg     L91
  mov    -0xf8(%rbp),%eax
  mov    %eax,-0xfc(%rbp)
L91:
  mov    -0xfc(%rbp),%eax
  jmp    L212
L137:
  lea    -0x70(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0xe8(%rbp)
  cmpq   $0x0,-0xe8(%rbp)
  je     L0
  mov    -0xe8(%rbp),%rax
  movb   $0x0,(%rax)
L0:
  lea    -0x70(%rbp),%rax
  mov    %rax,%rsi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L426
  lea    -0x70(%rbp),%rdx
  lea    -0xe0(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x61,%edx
  lea    D179(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L426:
  mov    -0x108(%rbp),%rdx
  lea    -0xe0(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x63,%edx
  lea    D22(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L382:
  lea    -0xe0(%rbp),%rax
  lea    D106(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L93
  cmpl   $0x2d0,-0xf8(%rbp)
  jg     L28
  cmpl   $0x4,-0xf8(%rbp)
  jle    L229
  mov    -0xf8(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  sub    $0x1,%eax
  jmp    L63
L229:
  mov    $0x0,%eax
L63:
  mov    %eax,-0xfc(%rbp)
  jmp    L442
L28:
  mov    -0xf8(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xf8(%rbp)
  mov    -0xf8(%rbp),%edx
  lea    -0xe0(%rbp),%rax
  lea    D60(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L93:
  lea    -0xe0(%rbp),%rax
  lea    D130(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L185
  cmpl   $0xc,-0xf8(%rbp)
  jg     L406
  mov    -0xf8(%rbp),%eax
  imul   $0x3c,%eax,%edx
  lea    -0xe0(%rbp),%rax
  lea    D50(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L406:
  cmpl   $0x18,-0xf8(%rbp)
  jg     L343
  mov    -0xf8(%rbp),%eax
  sub    $0xc,%eax
  add    %eax,%eax
  add    $0x8f,%eax
  mov    %eax,-0xfc(%rbp)
  jmp    L442
L343:
  mov    -0xf8(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xf8(%rbp)
  mov    -0xf8(%rbp),%edx
  lea    -0xe0(%rbp),%rax
  lea    D136(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L185:
  lea    -0xe0(%rbp),%rax
  lea    D83(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L295
  cmpl   $0x1,-0xf8(%rbp)
  jg     L377
  lea    -0xe0(%rbp),%rax
  lea    D165(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L377:
  cmpl   $0x22,-0xf8(%rbp)
  jg     L410
  mov    -0xf8(%rbp),%eax
  mov    $0x1e,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  add    $0xa6,%eax
  mov    %eax,-0xfc(%rbp)
  jmp    L442
L410:
  mov    -0xf8(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xf8(%rbp)
  mov    -0xf8(%rbp),%edx
  lea    -0xe0(%rbp),%rax
  lea    D86(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L295:
  lea    -0xe0(%rbp),%rax
  lea    D132(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L161
  cmpl   $0x4,-0xf8(%rbp)
  jg     L344
  mov    -0xf8(%rbp),%ecx
  mov    %ecx,%eax
  shl    $0x3,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  lea    -0xe0(%rbp),%rax
  lea    D136(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L344:
  mov    -0xf8(%rbp),%eax
  mov    $0x3f,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  add    $0xc0,%eax
  mov    %eax,-0xfc(%rbp)
  jmp    L442
L161:
  lea    -0xe0(%rbp),%rax
  lea    D28(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L324
  cmpl   $0xc,-0xf8(%rbp)
  je     L11
  mov    -0xf8(%rbp),%eax
  imul   $0x1e,%eax,%eax
  jmp    L190
L11:
  mov    $0x16d,%eax
L190:
  lea    -0xe0(%rbp),%rcx
  mov    %eax,%edx
  lea    D136(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L324:
  lea    -0xe0(%rbp),%rax
  lea    D166(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L74
  cmpl   $0x1,-0xf8(%rbp)
  jne    L304
  lea    -0xe0(%rbp),%rax
  lea    D159(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L139
L304:
  movl   $0xff,-0xfc(%rbp)
  jmp    L74
L139:
  lea    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,-0xf8(%rbp)
  cmpl   $0x0,-0xf8(%rbp)
  jg     L382
  jmp    L442
L74:
  nop
L442:
  mov    -0xfc(%rbp),%eax
L212:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L144
  call   <__stack_chk_fail@plt>
L144:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D110
type: string
name: unpack_data
arguments: label: D27
type: string
name: unpack_data
arguments: label: D179
type: string
name: unpack_data
arguments: label: D22
type: string
name: unpack_data
arguments: label: D106
type: string
name: unpack_data
arguments: label: D60
type: string
name: unpack_data
arguments: label: D130
type: string
name: unpack_data
arguments: label: D50
type: string
name: unpack_data
arguments: label: D136
type: string
name: unpack_data
arguments: label: D83
type: string
name: unpack_data
arguments: label: D165
type: string
name: unpack_data
arguments: label: D86
type: string
name: unpack_data
arguments: label: D132
type: string
name: unpack_data
arguments: label: D28
type: string
name: unpack_data
arguments: label: D166
type: string
name: unpack_data
arguments: label: D159
type: string

tool: D110: %s

tool: D27: min hour day week month year

tool: D179: 1 %.*s

tool: D22: %.*s

tool: D106: min

tool: D60: %i hour

tool: D130: hour

tool: D50: %i min

tool: D136: %i day

tool: D83: day

tool: D165: 24 hour

tool: D86: %i week

tool: D132: week

tool: D28: month

tool: D166: year

tool: D159: 52 week

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