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

```asm
<drawcal>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %esi,0x2c(%rsp)
  mov    %rdx,%r14
  mov    %rcx,%r15
  mov    %r8d,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  lea    D8(%rip),%rax
  mov    %rax,0x70(%rsp)
  lea    D146(%rip),%rax
  mov    %rax,0x78(%rsp)
  lea    D129(%rip),%rax
  mov    %rax,0x80(%rsp)
  lea    D65(%rip),%rax
  mov    %rax,0x88(%rsp)
  lea    D20(%rip),%rax
  mov    %rax,0x90(%rsp)
  lea    D34(%rip),%rax
  mov    %rax,0x98(%rsp)
  lea    D72(%rip),%rax
  mov    %rax,0xa0(%rsp)
  lea    D35(%rip),%rax
  mov    %rax,0xa8(%rsp)
  lea    D0(%rip),%rax
  mov    %rax,0xb0(%rsp)
  lea    D36(%rip),%rax
  mov    %rax,0xb8(%rsp)
  lea    D126(%rip),%rax
  mov    %rax,0xc0(%rsp)
  lea    D7(%rip),%rax
  mov    %rax,0xc8(%rsp)
  lea    D4(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D161(%rip),%rax
  mov    %rax,0x38(%rsp)
  lea    D145(%rip),%rax
  mov    %rax,0x40(%rsp)
  lea    D130(%rip),%rax
  mov    %rax,0x48(%rsp)
  lea    D136(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D71(%rip),%rax
  mov    %rax,0x58(%rsp)
  lea    D107(%rip),%rax
  mov    %rax,0x60(%rsp)
  movq   $0x0,0x20(%rsp)
  test   %rcx,%rcx
  jne    L60
L145:
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L116
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L168:
  mov    0x70(%rsp,%rax,8),%rsi
  mov    %rcx,%rdx
  lea    D118(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbp
  add    $0x1,%rbx
  cmp    %rbx,%r15
  jbe    L104
  cmp    %rbp,%r14
  jbe    L104
L208:
  movabs $0xaaaaaaaaaaaaaaab,%rax
  mul    %rbx
  shr    $0x3,%rdx
  lea    (%rdx,%r13,1),%rcx
  lea    (%rdx,%rdx,2),%rdx
  shl    $0x2,%rdx
  mov    %rbx,%rax
  sub    %rdx,%rax
  add    0x10(%rsp),%rax
  cmp    $0xb,%rax
  jbe    L168
  sub    $0xc,%rax
  add    $0x1,%rcx
  jmp    L168
L98:
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r13
  mov    0x20(%rsp),%rax
  add    %r13,%rax
  cmp    %rax,%r15
  jbe    L138
  cmp    %r13,%r14
  jbe    L138
L55:
  movslq 0xc(%rsp),%rbx
  cmp    0x10(%rsp),%rbx
  jae    L98
  lea    0x7(%rbx),%rbp
L61:
  movabs $0x2492492492492493,%rax
  mul    %rbx
  mov    %rbx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0x2,%rdx
  lea    0x0(,%rdx,8),%rax
  sub    %rdx,%rax
  mov    %rbx,%rdx
  sub    %rax,%rdx
  mov    0x30(%rsp,%rdx,8),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L61
  jmp    L98
L101:
  mov    %r12d,%ecx
  mov    0xc(%rsp),%edx
  call   <printgrid@plt>
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbp
  add    $0x1,%rbx
  cmp    %rbx,%r15
  jbe    L15
  cmp    %rbp,%r14
  jbe    L15
L137:
  movabs $0xaaaaaaaaaaaaaaab,%rax
  mul    %rbx
  shr    $0x3,%rdx
  mov    0x18(%rsp),%rax
  lea    (%rdx,%rax,1),%rdi
  lea    (%rdx,%rdx,2),%rax
  shl    $0x2,%rax
  mov    %rbx,%rsi
  sub    %rax,%rsi
  add    0x10(%rsp),%rsi
  cmp    $0xb,%rsi
  jbe    L101
  sub    $0xc,%rsi
  add    $0x1,%rdi
  jmp    L101
L15:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r12d
  cmp    $0x7,%r12d
  je     L44
L54:
  mov    0x20(%rsp),%rbx
  mov    $0x0,%ebp
  cmpb   $0x0,0x2b(%rsp)
  jne    L137
  jmp    L15
L44:
  cmp    %rbx,%r15
  jbe    L145
  mov    %rbx,0x20(%rsp)
L60:
  mov    0x20(%rsp),%rbx
  cmp    %rbx,%r15
  seta   %dl
  test   %r14,%r14
  setne  %al
  mov    $0x0,%ebp
  movslq 0x2c(%rsp),%r13
  lea    D27(%rip),%r12
  and    %al,%dl
  mov    %dl,0x2b(%rsp)
  je     L51
  mov    %r13,0x10(%rsp)
  mov    0x18(%rsp),%r13
  jmp    L208
L104:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%r13d
  mov    0xc(%rsp),%eax
  add    $0x7,%eax
  cltq
  mov    %rax,0x10(%rsp)
  lea    D164(%rip),%r12
  jmp    L55
L51:
  mov    $0xa,%edi
  call   <putchar@plt>
L138:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x1,%r12d
  movslq 0x2c(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    D27(%rip),%r13
  jmp    L54
L116:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D8
datatype: string
name: read_data
arguments: data_tag: D146
datatype: string
name: read_data
arguments: data_tag: D129
datatype: string
name: read_data
arguments: data_tag: D65
datatype: string
name: read_data
arguments: data_tag: D20
datatype: string
name: read_data
arguments: data_tag: D34
datatype: string
name: read_data
arguments: data_tag: D72
datatype: string
name: read_data
arguments: data_tag: D35
datatype: string
name: read_data
arguments: data_tag: D0
datatype: string
name: read_data
arguments: data_tag: D36
datatype: string
name: read_data
arguments: data_tag: D126
datatype: string
name: read_data
arguments: data_tag: D7
datatype: string
name: read_data
arguments: data_tag: D4
datatype: string
name: read_data
arguments: data_tag: D161
datatype: string
name: read_data
arguments: data_tag: D145
datatype: string
name: read_data
arguments: data_tag: D130
datatype: string
name: read_data
arguments: data_tag: D136
datatype: string
name: read_data
arguments: data_tag: D71
datatype: string
name: read_data
arguments: data_tag: D107
datatype: string
name: read_data
arguments: data_tag: D118
datatype: string
name: read_data
arguments: data_tag: D27
datatype: string
name: read_data
arguments: data_tag: D164
datatype: string

tool: D8:   January

tool: D146:  February

tool: D129:     March

tool: D65:     April

tool: D20:       May

tool: D34:      June

tool: D72:      July

tool: D35:    August

tool: D0: September

tool: D36:   October

tool: D126:  November

tool: D7:  December

tool: D4: Su

tool: D161: Mo

tool: D145: Tu

tool: D130: We

tool: D136: Th

tool: D71: Fr

tool: D107: Sa

tool: D118:    %s %zu    

tool: D27:   

tool: D164: %s 

assistant: ```c
void drawcal(size_t year, int month, size_t ncols, size_t nmons, int fday) {
  char *smon[] = {"  January", " February", "    March", "    April", "      May", "     June", "     July", "   August", "September", "  October", " November", " December"};
  char *days[] = {
      "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa",
  };
  size_t m, n, col, cur_year, cur_month, dow;
  int line;
  for (m = 0; m < nmons;) {
    n = m;
    for (col = 0; m < nmons && col < ncols; ++col, ++m) {
      cur_year = year + m / 12;
      cur_month = month + m % 12;
      if (cur_month > 11) {
        cur_month -= 12;
        cur_year += 1;
      }
      printf("   %s %zu    ", smon[cur_month], cur_year);
      printf("  ");
    }
    putchar('\n');
    for (col = 0, m = n; m < nmons && col < ncols; ++col, ++m) {
      for (dow = fday; dow < (fday + 7); ++dow)
        printf("%s ", days[dow % 7]);
      printf("  ");
    }
    putchar('\n');
    for (line = 1; line <= 6; ++line) {
      for (col = 0, m = n; m < nmons && col < ncols; ++col, ++m) {
        cur_year = year + m / 12;
        cur_month = month + m % 12;
        if (cur_month > 11) {
          cur_month -= 12;
          cur_year += 1;
        }
        printgrid(cur_year, cur_month, fday, line);
        printf("  ");
      }
      putchar('\n');
    }
  }
}
```