user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<getcalendar>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,0xc(%rsp)
  mov    %esi,%r12d
  mov    %rdx,%rbp
  mov    $0x1,%edx
  call   <calculateweekindex@plt>
  mov    %eax,%ebx
  mov    %r12d,%eax
  and    $0xfffffffd,%eax
  mov    $0x1f,%ecx
  cmp    $0x1,%eax
  je     L132
  cmp    $0xc,%r12d
  ja     L36
  mov    $0x1,%eax
  mov    %r12d,%ecx
  shl    %cl,%rax
  mov    $0x1f,%ecx
  test   $0x15a0,%eax
  jne    L132
  mov    $0x1e,%ecx
  cmp    $0x2,%r12d
  je     L183
L132:
  mov    %rbp,%r11
  mov    $0x1,%r9d
  mov    $0x1,%r10d
  mov    $0x0,%r13d
  mov    $0x6,%r14d
  lea    -0x1(%rbx),%r15d
  jmp    L149
L183:
  mov    0xc(%rsp),%edi
  call   <isLeapYear@plt>
  cmp    $0x1,%rax
  mov    $0x1c,%ecx
  sbb    $0xffffffff,%ecx
  jmp    L132
L36:
  mov    $0x1e,%ecx
  jmp    L132
L195:
  mov    %r11,%rdi
  movslq %r8d,%rdx
  mov    %r10d,%eax
L212:
  mov    %ecx,%esi
  sub    %eax,%esi
  cmp    %eax,%ecx
  cmovge %eax,%esi
  mov    %esi,(%rdi,%rdx,4)
  add    $0x1,%eax
  add    $0x1,%rdx
  cmp    $0x6,%edx
  jle    L212
  mov    %r14d,%eax
  sub    %r8d,%eax
  cmp    $0x6,%r8d
  cmovg  %r13d,%eax
  lea    0x1(%r10,%rax,1),%r10d
  cmp    $0x5,%r9d
  jg     L17
L66:
  add    $0x1,%r9d
  add    $0x1c,%r11
L149:
  mov    %r13d,%r8d
  cmp    $0x1,%r9d
  jne    L195
  mov    %r15d,%r8d
  cmp    $0x6,%r15d
  jle    L195
  jmp    L66
L17:
  cmp    $0xc,%r12d
  ja     L133
  mov    $0x1,%eax
  mov    %r12d,%ecx
  shl    %cl,%rax
  mov    $0x1f,%edx
  test   $0xb54,%eax
  je     L136
L81:
  cmp    $0x1,%r12d
  jne    L129
L95:
  mov    %ebx,%eax
  sub    $0x2,%eax
  js     L201
  cltq
  sub    $0x21,%ebx
L180:
  mov    %ebx,%edx
  sub    %eax,%edx
  mov    %edx,0x0(%rbp,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L180
L201:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L136:
  cmp    $0xc,%r12d
  je     L71
  mov    $0x1e,%edx
  cmp    $0x3,%r12d
  jne    L81
  mov    0xc(%rsp),%edi
  call   <isLeapYear@plt>
  cmp    $0x1,%rax
  mov    $0x1c,%edx
  sbb    $0xffffffff,%edx
L129:
  cmpl   $0x1,0x0(%rbp)
  je     L95
  mov    %ebx,%eax
  sub    $0x2,%eax
  js     L201
  cltq
  sub    $0x2,%ebx
  sub    %edx,%ebx
L116:
  mov    %ebx,%edx
  sub    %eax,%edx
  mov    %edx,0x0(%rbp,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L116
  jmp    L201
L133:
  mov    $0x1e,%edx
  jmp    L81
L71:
  mov    $0x1f,%edx
  jmp    L129
```

assistant: ```c
void getcalendar(int year, int month, int array[6][7]) {
  int n = calculateweekindex(year, month, 1);
  int i, j, t, b;
  int count = 1;
  int daytotal;
  int prevmonth = month - 1;
  if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
    daytotal = 31;
  else if (month != 2)
    daytotal = 30;
  else {
    if (isLeapYear(year))
      daytotal = 29;
    else
      daytotal = 28;
  }
  for (i = 0; i < 6; i++) {
    for (j = i == 0 ? n - 1 : 0; j < 7; j++) {
      array[i][j] = count <= daytotal ? count : -(count - daytotal);
      count++;
    }
  }
  count = 1;
  b = j;
  for (t = i; i < 6; i++) {
    if (i == t) {
      for (j = b; j < 7; j++)
        array[i][j] = -count;
      count++;
    } else {
      for (j = 0; j < 7; j++)
        array[i][j] = -count;
      count++;
    }
  }
  if (prevmonth == 1 || prevmonth == 3 || prevmonth == 5 || prevmonth == 7 || prevmonth == 8 || prevmonth == 10 || month == 12)
    daytotal = 31;
  else if (prevmonth != 2)
    daytotal = 30;
  else {
    if (isLeapYear(year))
      daytotal = 29;
    else
      daytotal = 28;
  }
  if (prevmonth != 0 && array[0][0] != 1) {
    for (j = n - 2; j >= 0; j--) {
      array[0][j] = -(daytotal--);
    }
  } else {
    prevmonth = 12;
    daytotal = 31;
    for (j = n - 2; j >= 0; j--) {
      array[0][j] = -(daytotal--);
    }
  }
}
```