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

```asm
<gen_set_timekeeping_defs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0x0,%r15d
  lea    0x3(%rsp),%r12
  jmp    L63
L0:
  mov    %r14d,%edx
  lea    D37(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  lea    D174(%rip),%rbp
  jmp    L5
L21:
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D171(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D34(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D67(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D70(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D130(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D75(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D199(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D226(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D51(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D81(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D134(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D190(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D128(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D9(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D40(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D46(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  mov    %r12,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  lea    D158(%rip),%rsi
  mov    %r13,%rdi
  call   <fprintf@plt>
  add    $0x1,%r15d
  cmp    $0x18,%r15d
  je     L51
L63:
  movslq %r15d,%r14
  imul   $0x2aaaaaab,%r14,%r14
  sar    $0x21,%r14
  mov    %r15d,%eax
  sar    $0x1f,%eax
  sub    %eax,%r14d
  lea    (%r14,%r14,2),%eax
  shl    $0x2,%eax
  mov    %r15d,%r14d
  sub    %eax,%r14d
  jne    L0
  movb   $0x0,0x3(%rsp)
  lea    D41(%rip),%rbp
L5:
  lea    D205(%rip),%rbx
  cmp    $0xb,%r15d
  jle    L21
  test   %r14d,%r14d
  lea    D28(%rip),%rbx
  lea    D126(%rip),%rax
  cmovne %rax,%rbx
  jmp    L21
L51:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D37
datatype: string
name: parse_data
arguments: label: D174
datatype: string
name: parse_data
arguments: label: D171
datatype: string
name: parse_data
arguments: label: D34
datatype: string
name: parse_data
arguments: label: D67
datatype: string
name: parse_data
arguments: label: D70
datatype: string
name: parse_data
arguments: label: D130
datatype: string
name: parse_data
arguments: label: D75
datatype: string
name: parse_data
arguments: label: D199
datatype: string
name: parse_data
arguments: label: D226
datatype: string
name: parse_data
arguments: label: D51
datatype: string
name: parse_data
arguments: label: D81
datatype: string
name: parse_data
arguments: label: D134
datatype: string
name: parse_data
arguments: label: D190
datatype: string
name: parse_data
arguments: label: D128
datatype: string
name: parse_data
arguments: label: D9
datatype: string
name: parse_data
arguments: label: D40
datatype: string
name: parse_data
arguments: label: D46
datatype: string
name: parse_data
arguments: label: D158
datatype: string
name: parse_data
arguments: label: D41
datatype: string
name: parse_data
arguments: label: D205
datatype: string
name: parse_data
arguments: label: D28
datatype: string
name: parse_data
arguments: label: D126
datatype: string

tool: D37: %d

tool: D174: aux

tool: D171:  INTEGER :: %s%s%s_interval  , &


tool: D34:             %s%s%s_interval_d, &


tool: D67:             %s%s%s_interval_h, &


tool: D70:             %s%s%s_interval_m, &


tool: D130:             %s%s%s_interval_s   


tool: D75:  INTEGER :: %s%s%s_begin  ,    &


tool: D199:             %s%s%s_begin_y,    &


tool: D226:             %s%s%s_begin_d,    &


tool: D51:             %s%s%s_begin_h,    &


tool: D81:             %s%s%s_begin_m,    &


tool: D134:             %s%s%s_begin_s      


tool: D190:  INTEGER :: %s%s%s_end  ,      &


tool: D128:             %s%s%s_end_y,      &


tool: D9:             %s%s%s_end_d,      &


tool: D40:             %s%s%s_end_h,      &


tool: D46:             %s%s%s_end_m,      &


tool: D158:             %s%s%s_end_s        


tool: 

tool: D205: input

tool: D28: history

tool: D126: hist

assistant: ```c
int gen_set_timekeeping_defs(FILE *fp) {
  char *aux, *streamtype, streamno[5];
  int i;
  for (i = 0; i < 2 * 12; i++) {
    if (i % 12 == 0) {
      aux = "";
      streamno[0] = '\0';
    } else {
      aux = "aux";
      sprintf(streamno, "%d", i % 12);
    }
    if (i < 12) {
      streamtype = "input";
    } else {
      streamtype = (i % 12 == 0) ? "history" : "hist";
    }
    fprintf(fp, " INTEGER :: %s%s%s_interval  , &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_interval_d, &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_interval_h, &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_interval_m, &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_interval_s   \n", aux, streamtype, streamno);
    fprintf(fp, " INTEGER :: %s%s%s_begin  ,    &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_begin_y,    &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_begin_d,    &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_begin_h,    &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_begin_m,    &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_begin_s      \n", aux, streamtype, streamno);
    fprintf(fp, " INTEGER :: %s%s%s_end  ,      &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_end_y,      &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_end_d,      &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_end_h,      &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_end_m,      &\n", aux, streamtype, streamno);
    fprintf(fp, "            %s%s%s_end_s        \n", aux, streamtype, streamno);
  }
  return 0;
}
```