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

```asm
<getcalendar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    $0x1,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <calculateweekindex@plt>
  mov    %eax,-0x10(%rbp)
  movl   $0x1,-0x18(%rbp)
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0x28(%rbp)
  je     L42
  cmpl   $0x3,-0x28(%rbp)
  je     L42
  cmpl   $0x5,-0x28(%rbp)
  je     L42
  cmpl   $0x7,-0x28(%rbp)
  je     L42
  cmpl   $0x8,-0x28(%rbp)
  je     L42
  cmpl   $0xa,-0x28(%rbp)
  je     L42
  cmpl   $0xc,-0x28(%rbp)
  jne    L283
L42:
  movl   $0x1f,-0x14(%rbp)
  jmp    L40
L283:
  cmpl   $0x2,-0x28(%rbp)
  je     L200
  movl   $0x1e,-0x14(%rbp)
  jmp    L40
L200:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <isLeapYear@plt>
  test   %rax,%rax
  je     L235
  movl   $0x1d,-0x14(%rbp)
  jmp    L40
L235:
  movl   $0x1c,-0x14(%rbp)
L40:
  movl   $0x0,-0x20(%rbp)
  jmp    L231
L89:
  cmpl   $0x0,-0x20(%rbp)
  jne    L212
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  jmp    L131
L212:
  mov    $0x0,%eax
L131:
  mov    %eax,-0x1c(%rbp)
  jmp    L98
L244:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L51
  mov    -0x14(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edx
  jmp    L417
L51:
  mov    -0x18(%rbp),%edx
L417:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x3,%rax
  sub    %rcx,%rax
  shl    $0x2,%rax
  mov    %rax,%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0x1c(%rbp),%eax
  cltq
  mov    %edx,(%rcx,%rax,4)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
L98:
  cmpl   $0x6,-0x1c(%rbp)
  jle    L244
  addl   $0x1,-0x20(%rbp)
L231:
  cmpl   $0x5,-0x20(%rbp)
  jle    L89
  movl   $0x1,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L56
L37:
  mov    -0x20(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L429
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L81
L120:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  neg    %eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  mov    %ecx,(%rdx,%rax,4)
  addl   $0x1,-0x1c(%rbp)
L81:
  cmpl   $0x6,-0x1c(%rbp)
  jle    L120
  addl   $0x1,-0x18(%rbp)
  jmp    L289
L429:
  movl   $0x0,-0x1c(%rbp)
  jmp    L185
L170:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  neg    %eax
  mov    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  cltq
  mov    %ecx,(%rdx,%rax,4)
  addl   $0x1,-0x1c(%rbp)
L185:
  cmpl   $0x6,-0x1c(%rbp)
  jle    L170
  addl   $0x1,-0x18(%rbp)
L289:
  addl   $0x1,-0x20(%rbp)
L56:
  cmpl   $0x5,-0x20(%rbp)
  jle    L37
  cmpl   $0x1,-0xc(%rbp)
  je     L95
  cmpl   $0x3,-0xc(%rbp)
  je     L95
  cmpl   $0x5,-0xc(%rbp)
  je     L95
  cmpl   $0x7,-0xc(%rbp)
  je     L95
  cmpl   $0x8,-0xc(%rbp)
  je     L95
  cmpl   $0xa,-0xc(%rbp)
  je     L95
  cmpl   $0xc,-0x28(%rbp)
  jne    L434
L95:
  movl   $0x1f,-0x14(%rbp)
  jmp    L261
L434:
  cmpl   $0x2,-0xc(%rbp)
  je     L272
  movl   $0x1e,-0x14(%rbp)
  jmp    L261
L272:
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <isLeapYear@plt>
  test   %rax,%rax
  je     L180
  movl   $0x1d,-0x14(%rbp)
  jmp    L261
L180:
  movl   $0x1c,-0x14(%rbp)
L261:
  cmpl   $0x0,-0xc(%rbp)
  je     L141
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L141
  mov    -0x10(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L355
L326:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  neg    %eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  subl   $0x1,-0x1c(%rbp)
L355:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L326
  jmp    L415
L141:
  movl   $0xc,-0xc(%rbp)
  movl   $0x1f,-0x14(%rbp)
  mov    -0x10(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L159
L266:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  neg    %eax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  subl   $0x1,-0x1c(%rbp)
L159:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L266
  nop
L415:
  nop
  leave
  ret
```

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