user: What is the c source code of the assembly code below?

```asm
<getcalendar>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  mov    $0x1,%edx
  sub    $0x8,%rsp
  call   <calculateweekindex@plt>
  mov    $0x1f,%edi
  mov    %eax,%r13d
  mov    %r12d,%eax
  and    $0xfffffffd,%eax
  cmp    $0x1,%eax
  je     L236
  cmp    $0xc,%r12d
  ja     L108
  mov    $0x1,%eax
  mov    %r12d,%ecx
  shl    %cl,%rax
  test   $0x15a0,%eax
  jne    L236
  mov    $0x1e,%edi
  cmp    $0x2,%r12d
  je     L141
  nopw   0x0(%rax,%rax,1)
L236:
  xor    %r9d,%r9d
  mov    %rbx,%r8
  mov    $0x1,%r11d
  xor    %r14d,%r14d
  add    $0x1,%r9d
  mov    $0x6,%ecx
  lea    -0x1(%r13),%r15d
  xor    %r10d,%r10d
  cmp    $0x1,%r9d
  je     L100
  nopl   (%rax)
L136:
  movslq %r10d,%rdx
  mov    %r11d,%eax
  cs nopw 0x0(%rax,%rax,1)
L22:
  mov    %edi,%esi
  sub    %eax,%esi
  cmp    %edi,%eax
  cmovle %eax,%esi
  add    $0x1,%eax
  mov    %esi,(%r8,%rdx,4)
  add    $0x1,%rdx
  cmp    $0x6,%edx
  jle    L22
  mov    %ecx,%eax
  sub    %r10d,%eax
  cmp    $0x6,%r10d
  cmovg  %r14d,%eax
  lea    0x1(%r11,%rax,1),%r11d
  cmp    $0x6,%r9d
  je     L23
L62:
  add    $0x1,%r9d
  add    $0x1c,%r8
  xor    %r10d,%r10d
  cmp    $0x1,%r9d
  jne    L136
L100:
  mov    %r15d,%r10d
  cmp    $0x6,%r15d
  jle    L136
  jmp    L62
  nopl   (%rax)
L23:
  cmp    $0xc,%r12d
  ja     L140
  mov    $0x1,%eax
  mov    %r12d,%ecx
  mov    $0x1f,%edx
  shl    %cl,%rax
  test   $0xb54,%eax
  je     L25
L17:
  cmp    $0x1,%r12d
  jne    L228
L53:
  mov    %r13d,%eax
  sub    $0x2,%eax
  js     L181
  cltq
  lea    -0x21(%r13),%ecx
  nopl   0x0(%rax)
L235:
  mov    %ecx,%edx
  sub    %eax,%edx
  mov    %edx,(%rbx,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L235
L181:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L140:
  mov    $0x1e,%edx
L228:
  cmpl   $0x1,(%rbx)
  je     L53
L137:
  sub    $0x2,%r13d
  mov    %r13d,%ecx
  movslq %r13d,%rax
  sub    %edx,%ecx
  test   %r13d,%r13d
  js     L181
  nopl   0x0(%rax)
L165:
  mov    %ecx,%edx
  sub    %eax,%edx
  mov    %edx,(%rbx,%rax,4)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L165
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  cmp    $0xc,%r12d
  je     L228
  mov    $0x1e,%edx
  cmp    $0x3,%r12d
  jne    L17
  mov    %ebp,%edi
  call   <isLeapYear@plt>
  mov    $0x1c,%edx
  cmp    $0x1,%rax
  sbb    $0xffffffff,%edx
  cmpl   $0x1,(%rbx)
  jne    L137
  jmp    L53
L108:
  mov    $0x1e,%edi
  jmp    L236
L141:
  mov    %ebp,%edi
  call   <isLeapYear@plt>
  mov    $0x1c,%edi
  cmp    $0x1,%rax
  sbb    $0xffffffff,%edi
  jmp    L236
```

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--);
    }
  }
}
```