user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<drawcal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x110,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %esi,-0xfc(%rbp)
  mov    %rdx,-0x108(%rbp)
  mov    %rcx,-0x110(%rbp)
  mov    %r8d,-0x100(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D31(%rip),%rax
  mov    %rax,-0x70(%rbp)
  lea    D198(%rip),%rax
  mov    %rax,-0x68(%rbp)
  lea    D82(%rip),%rax
  mov    %rax,-0x60(%rbp)
  lea    D237(%rip),%rax
  mov    %rax,-0x58(%rbp)
  lea    D21(%rip),%rax
  mov    %rax,-0x50(%rbp)
  lea    D109(%rip),%rax
  mov    %rax,-0x48(%rbp)
  lea    D182(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D80(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    D78(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D131(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D111(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D125(%rip),%rax
  mov    %rax,-0x18(%rbp)
  lea    D68(%rip),%rax
  mov    %rax,-0xb0(%rbp)
  lea    D54(%rip),%rax
  mov    %rax,-0xa8(%rbp)
  lea    D206(%rip),%rax
  mov    %rax,-0xa0(%rbp)
  lea    D11(%rip),%rax
  mov    %rax,-0x98(%rbp)
  lea    D124(%rip),%rax
  mov    %rax,-0x90(%rbp)
  lea    D38(%rip),%rax
  mov    %rax,-0x88(%rbp)
  lea    D26(%rip),%rax
  mov    %rax,-0x80(%rbp)
  movq   $0x0,-0xe0(%rbp)
  jmp    L150
L126:
  mov    -0xe0(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  movq   $0x0,-0xd8(%rbp)
  jmp    L23
L121:
  mov    -0xe0(%rbp),%rax
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mul    %rdx
  shr    $0x3,%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xfc(%rbp),%eax
  movslq %eax,%rsi
  mov    -0xe0(%rbp),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x3,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  lea    (%rsi,%rdx,1),%rax
  mov    %rax,-0xc8(%rbp)
  cmpq   $0xb,-0xc8(%rbp)
  jbe    L4
  subq   $0xc,-0xc8(%rbp)
  addq   $0x1,-0xd0(%rbp)
L4:
  mov    -0xc8(%rbp),%rax
  mov    -0x70(%rbp,%rax,8),%rax
  mov    -0xd0(%rbp),%rdx
  mov    %rax,%rsi
  lea    D167(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D185(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0xd8(%rbp)
  addq   $0x1,-0xe0(%rbp)
L23:
  mov    -0xe0(%rbp),%rax
  cmp    -0x110(%rbp),%rax
  jae    L96
  mov    -0xd8(%rbp),%rax
  cmp    -0x108(%rbp),%rax
  jb     L121
L96:
  mov    $0xa,%edi
  call   <putchar@plt>
  movq   $0x0,-0xd8(%rbp)
  mov    -0xb8(%rbp),%rax
  mov    %rax,-0xe0(%rbp)
  jmp    L36
L113:
  mov    -0x100(%rbp),%eax
  cltq
  mov    %rax,-0xc0(%rbp)
  jmp    L167
L175:
  mov    -0xc0(%rbp),%rcx
  movabs $0x2492492492492493,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  shr    $0x2,%rax
  mov    %rax,%rdx
  shl    $0x3,%rdx
  sub    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  mov    -0xb0(%rbp,%rax,8),%rax
  mov    %rax,%rsi
  lea    D157(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0xc0(%rbp)
L167:
  mov    -0x100(%rbp),%eax
  add    $0x7,%eax
  cltq
  cmp    %rax,-0xc0(%rbp)
  jb     L175
  lea    D185(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0xd8(%rbp)
  addq   $0x1,-0xe0(%rbp)
L36:
  mov    -0xe0(%rbp),%rax
  cmp    -0x110(%rbp),%rax
  jae    L46
  mov    -0xd8(%rbp),%rax
  cmp    -0x108(%rbp),%rax
  jb     L113
L46:
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0xe4(%rbp)
  jmp    L3
L152:
  movq   $0x0,-0xd8(%rbp)
  mov    -0xb8(%rbp),%rax
  mov    %rax,-0xe0(%rbp)
  jmp    L52
L27:
  mov    -0xe0(%rbp),%rax
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mul    %rdx
  shr    $0x3,%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xfc(%rbp),%eax
  movslq %eax,%rsi
  mov    -0xe0(%rbp),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x3,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  lea    (%rsi,%rdx,1),%rax
  mov    %rax,-0xc8(%rbp)
  cmpq   $0xb,-0xc8(%rbp)
  jbe    L11
  subq   $0xc,-0xc8(%rbp)
  addq   $0x1,-0xd0(%rbp)
L11:
  mov    -0xe4(%rbp),%ecx
  mov    -0x100(%rbp),%edx
  mov    -0xc8(%rbp),%rsi
  mov    -0xd0(%rbp),%rax
  mov    %rax,%rdi
  call   <printgrid@plt>
  lea    D185(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0xd8(%rbp)
  addq   $0x1,-0xe0(%rbp)
L52:
  mov    -0xe0(%rbp),%rax
  cmp    -0x110(%rbp),%rax
  jae    L34
  mov    -0xd8(%rbp),%rax
  cmp    -0x108(%rbp),%rax
  jb     L27
L34:
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0xe4(%rbp)
L3:
  cmpl   $0x6,-0xe4(%rbp)
  jle    L152
L150:
  mov    -0xe0(%rbp),%rax
  cmp    -0x110(%rbp),%rax
  jb     L126
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L14
  call   <__stack_chk_fail@plt>
L14:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D31
datatype: string
name: extract_symbolic_data
arguments: data_label: D198
datatype: string
name: extract_symbolic_data
arguments: data_label: D82
datatype: string
name: extract_symbolic_data
arguments: data_label: D237
datatype: string
name: extract_symbolic_data
arguments: data_label: D21
datatype: string
name: extract_symbolic_data
arguments: data_label: D109
datatype: string
name: extract_symbolic_data
arguments: data_label: D182
datatype: string
name: extract_symbolic_data
arguments: data_label: D80
datatype: string
name: extract_symbolic_data
arguments: data_label: D78
datatype: string
name: extract_symbolic_data
arguments: data_label: D131
datatype: string
name: extract_symbolic_data
arguments: data_label: D111
datatype: string
name: extract_symbolic_data
arguments: data_label: D125
datatype: string
name: extract_symbolic_data
arguments: data_label: D68
datatype: string
name: extract_symbolic_data
arguments: data_label: D54
datatype: string
name: extract_symbolic_data
arguments: data_label: D206
datatype: string
name: extract_symbolic_data
arguments: data_label: D11
datatype: string
name: extract_symbolic_data
arguments: data_label: D124
datatype: string
name: extract_symbolic_data
arguments: data_label: D38
datatype: string
name: extract_symbolic_data
arguments: data_label: D26
datatype: string
name: extract_symbolic_data
arguments: data_label: D167
datatype: string
name: extract_symbolic_data
arguments: data_label: D185
datatype: string
name: extract_symbolic_data
arguments: data_label: D157
datatype: string

tool: D31:   January

tool: D198:  February

tool: D82:     March

tool: D237:     April

tool: D21:       May

tool: D109:      June

tool: D182:      July

tool: D80:    August

tool: D78: September

tool: D131:   October

tool: D111:  November

tool: D125:  December

tool: D68: Su

tool: D54: Mo

tool: D206: Tu

tool: D11: We

tool: D124: Th

tool: D38: Fr

tool: D26: Sa

tool: D167:    %s %zu    

tool: D185:   

tool: D157: %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');
    }
  }
}
```