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

```asm
<f_set_date>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    0xa0(%rsp),%r12
  test   %edi,%edi
  js     L28
  lea    0x40(%rsp),%r9
  lea    0x34(%rsp),%rdx
  mov    %rsi,%rbp
  lea    0x30(%rsp),%rsi
  mov    %r9,0x18(%rsp)
  lea    0x3c(%rsp),%r15
  mov    %rbp,%rdi
  mov    %rdx,0x10(%rsp)
  lea    0x38(%rsp),%r14
  sub    $0x8,%rsp
  mov    %r15,%r8
  mov    %rsi,0x10(%rsp)
  lea    0x4c(%rsp),%rax
  mov    %r14,%rcx
  mov    %rax,0x8(%rsp)
  push   %rax
  call   <reftime@plt>
  movzbl (%r12),%eax
  pop    %rsi
  pop    %rdi
  sub    $0x2b,%eax
  test   $0xfd,%al
  jne    L215
  lea    0x4e(%rsp),%r13
  xor    %eax,%eax
  lea    0x48(%rsp),%rdx
  lea    0x1(%r12),%rdi
  mov    %r13,%rcx
  lea    D63(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x2,%eax
  jne    L292
  mov    0x48(%rsp),%ecx
  test   %ecx,%ecx
  jns    L62
L292:
  lea    D117(%rip),%rsi
  lea    D98(%rip),%rdi
  call   <fatal_error@plt>
L62:
  lea    D7(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x1,%eax
  test   %r8,%r8
  jne    L241
L35:
  cmpb   $0x2b,(%r12)
  mov    0x48(%rsp),%edx
  je     L2
  push   %rax
  mov    %r15,%rcx
  push   %rdx
  mov    0x10(%rsp),%r9
  mov    %r14,%rdx
  mov    0x28(%rsp),%r8
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <sub_dt@plt>
  mov    0x54(%rsp),%r9d
  mov    0x50(%rsp),%r8d
  mov    0x4c(%rsp),%ecx
  pop    %r12
  pop    %r13
  jmp    L153
  nopl   0x0(%rax,%rax,1)
L235:
  sub    $0x8,%rsp
  mov    0x30(%rsp),%rax
  add    0x20(%rbp),%rax
  push   %rax
  mov    0x54(%rsp),%r9d
  mov    0x50(%rsp),%r8d
  mov    0x4c(%rsp),%ecx
  mov    0x48(%rsp),%edx
  mov    0x44(%rsp),%esi
  mov    0x40(%rsp),%edi
  call   <save_time@plt>
  pop    %rcx
  pop    %rsi
L28:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x68,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L215:
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    -0x4(%rax),%edx
  cmp    $0xa,%edx
  ja     L43
  test   $0x1,%al
  jne    L43
L14:
  push   (%rsp)
  mov    %r15,%r9
  mov    %r14,%r8
  lea    D74(%rip),%rsi
  push   0x20(%rsp)
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    0x20(%rsp),%rcx
  mov    0x18(%rsp),%rdx
  call   <sscanf@plt>
  pop    %r11
  pop    %rbx
  test   %eax,%eax
  jle    L231
L129:
  mov    0x38(%rsp),%edx
  mov    0x34(%rsp),%esi
  mov    0x30(%rsp),%edi
  call   <check_datecode@plt>
  test   %rax,%rax
  jne    L172
  mov    0x3c(%rsp),%ecx
  cmp    $0x17,%ecx
  jbe    L115
L172:
  mov    %r12,%rsi
  lea    D94(%rip),%rdi
  call   <fatal_error@plt>
  mov    0x44(%rsp),%r9d
  mov    0x40(%rsp),%r8d
  mov    0x3c(%rsp),%ecx
L153:
  mov    0x8(%rbp),%rax
  sub    $0x8,%rsp
  add    $0xc,%rax
  push   %rax
  mov    0x48(%rsp),%edx
  mov    0x44(%rsp),%esi
  mov    0x40(%rsp),%edi
  call   <save_time@plt>
  mov    %rbp,%rdi
  call   <stat_proc_n_time_ranges_index@plt>
  pop    %r9
  pop    %r10
  mov    %eax,%r12d
  test   %eax,%eax
  js     L28
  movslq %eax,%rbx
  mov    0x20(%rbp),%rax
  mov    %rbp,%rdi
  movzbl (%rax,%rbx,1),%r11d
  mov    %r11b,0x20(%rsp)
  call   <code_table_4_4@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <forecast_time_in_units@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %eax,0x48(%rsp)
  push   %r13
  push   %rax
  mov    0x10(%rsp),%r9
  mov    0x28(%rsp),%r8
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <add_time@plt>
  lea    -0x7(%r12),%eax
  cltq
  mov    %rax,0x38(%rsp)
  pop    %rdi
  pop    %r8
  movzbl 0x20(%rsp),%r11d
  test   %r11b,%r11b
  je     L235
  lea    -0x1(%r11),%eax
  lea    0x6(%r12),%r10d
  mov    %r14,0x20(%rsp)
  lea    (%rax,%rax,2),%rax
  movslq %r10d,%r13
  lea    0x12(%rbx,%rax,4),%rax
  mov    %r13,%r14
  mov    %rax,%r13
  jmp    L147
  xchg   %ax,%ax
L135:
  lea    D120(%rip),%rdi
  call   <fatal_error_i@plt>
L6:
  add    $0xc,%r14
  cmp    %r13,%r14
  je     L235
L147:
  mov    0x20(%rbp),%rax
  movzbl (%rax,%r14,1),%ebx
  lea    0x2(%rax,%r14,1),%rdi
  movzbl 0x1(%rax,%r14,1),%r12d
  call   <int4@plt>
  movzbl %bl,%esi
  mov    %eax,0x48(%rsp)
  lea    -0x3(%rsi),%edx
  cmp    $0x1,%edx
  jbe    L6
  lea    -0x1(%rsi),%edx
  cmp    $0x1,%edx
  ja     L135
  push   %r12
  mov    %r15,%rcx
  push   %rax
  mov    0x10(%rsp),%r9
  mov    0x28(%rsp),%r8
  mov    0x30(%rsp),%rdx
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <add_time@plt>
  pop    %rax
  pop    %rdx
  jmp    L6
  nopl   0x0(%rax)
L2:
  push   %rax
  mov    %r15,%rcx
  push   %rdx
  mov    0x10(%rsp),%r9
  mov    %r14,%rdx
  mov    0x28(%rsp),%r8
  mov    0x20(%rsp),%rsi
  mov    0x18(%rsp),%rdi
  call   <add_dt@plt>
  mov    0x54(%rsp),%r9d
  mov    0x50(%rsp),%r8d
  mov    0x4c(%rsp),%ecx
  pop    %rax
  pop    %rdx
  jmp    L153
  xchg   %ax,%ax
L43:
  mov    %r12,%rsi
  lea    D94(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L14
  nopl   0x0(%rax)
L241:
  lea    D83(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x2,%eax
  test   %r8,%r8
  je     L35
  lea    D122(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x3,%eax
  test   %r8,%r8
  je     L35
  lea    D113(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  mov    $0x4,%eax
  test   %r8,%r8
  je     L35
  lea    D133(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  mov    %rax,%r8
  xor    %eax,%eax
  test   %r8,%r8
  je     L35
  mov    %r13,%rsi
  lea    D39(%rip),%rdi
  call   <fatal_error@plt>
  mov    $0xffffffff,%eax
  jmp    L35
  xchg   %ax,%ax
L231:
  mov    %r12,%rsi
  lea    D94(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L129
  nopl   0x0(%rax)
L115:
  mov    0x40(%rsp),%r8d
  cmp    $0x3b,%r8d
  ja     L172
  mov    0x44(%rsp),%r9d
  cmp    $0x3b,%r9d
  ja     L172
  jmp    L153
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D63
type_guessed: string
name: extract_symbolic_data
arguments: tag: D117
type_guessed: string
name: extract_symbolic_data
arguments: tag: D98
type_guessed: string
name: extract_symbolic_data
arguments: tag: D7
type_guessed: string
name: extract_symbolic_data
arguments: tag: D74
type_guessed: string
name: extract_symbolic_data
arguments: tag: D94
type_guessed: string
name: extract_symbolic_data
arguments: tag: D120
type_guessed: string
name: extract_symbolic_data
arguments: tag: D83
type_guessed: string
name: extract_symbolic_data
arguments: tag: D122
type_guessed: string
name: extract_symbolic_data
arguments: tag: D113
type_guessed: string
name: extract_symbolic_data
arguments: tag: D133
type_guessed: string
name: extract_symbolic_data
arguments: tag: D39
type_guessed: string

tool: D63: %d%2s

tool: 

tool: D98: set_date: delta-time: (+|-)(int)(hr|dy|mo|yr)

tool: D7: hr

tool: D74: %4d%2d%2d%2d%2d%2d

tool: D94: set_date: bad date code %s

tool: D120: set_date: code 4.11=%d is not supported

tool: D83: dy

tool: D122: mo

tool: D113: yr

tool: D133: mn

tool: D39: set_date: unsupported time unit %s

assistant: ```c
int f_set_date(int mode, unsigned char **sec, float *data, unsigned int ndata, char *inv_out, void **local, const char *arg1) {
  int year, month, day, hour, minute, second, i, j, units, n;
  int code_4_11, idx;
  int dtime, dt_unit;
  char string[10];
  if (mode < 0)
    return 0;
  reftime(sec, &year, &month, &day, &hour, &minute, &second);
  if (arg1[0] == '+' || arg1[0] == '-') {
    i = sscanf(arg1 + 1, "%d%2s", &dtime, string);
    if (i != 2 || dtime < 0)
      fatal_error("set_date: delta-time: (+|-)(int)(hr|dy|mo|yr)", "");
    dt_unit = -1;
    if (strcmp(string, "hr") == 0)
      dt_unit = 1;
    else if (strcmp(string, "dy") == 0)
      dt_unit = 2;
    else if (strcmp(string, "mo") == 0)
      dt_unit = 3;
    else if (strcmp(string, "yr") == 0)
      dt_unit = 4;
    else if (strcmp(string, "mn") == 0)
      dt_unit = 0;
    if (dt_unit == -1)
      fatal_error("set_date: unsupported time unit %s", string);
    if (arg1[0] == '+')
      i = add_dt(&year, &month, &day, &hour, &minute, &second, dtime, dt_unit);
    else
      i = sub_dt(&year, &month, &day, &hour, &minute, &second, dtime, dt_unit);
  } else {
    i = strlen(arg1);
    if (i < 4 || i > 14 || i % 2 == 1)
      fatal_error("set_date: bad date code %s", arg1);
    i = sscanf(arg1, "%4d%2d%2d%2d%2d%2d", &year, &month, &day, &hour, &minute, &second);
    if (i < 1)
      fatal_error("set_date: bad date code %s", arg1);
    if (check_datecode(year, month, day) != 0 || hour < 0 || hour >= 24 || minute < 0 || minute >= 60 || second < 0 || second >= 60)
      fatal_error("set_date: bad date code %s", arg1);
  }
  save_time(year, month, day, hour, minute, second, sec[1] + 12);
  idx = stat_proc_n_time_ranges_index(sec);
  if (idx < 0)
    return 0;
  n = (int)sec[4][idx];
  j = idx + 35 - 42;
  units = code_table_4_4(sec);
  dtime = forecast_time_in_units(sec);
  add_time(&year, &month, &day, &hour, &minute, &second, (unsigned int)dtime, units);
  for (i = 0; i < n; i++) {
    code_4_11 = (int)sec[4][47 - 34 + j + i * 12];
    units = (int)sec[4][48 - 34 + j + i * 12];
    dtime = int4(sec[4] + 49 - 34 + j + i * 12);
    if (code_4_11 == 3 || code_4_11 == 4)
      continue;
    if (code_4_11 == 1 || code_4_11 == 2) {
      add_time(&year, &month, &day, &hour, &minute, &second, (unsigned int)dtime, units);
    } else {
      fatal_error_i("set_date: code 4.11=%d is not supported", code_4_11);
    }
  }
  save_time(year, month, day, hour, minute, second, sec[4] + j);
  return 0;
}
```