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

```asm
<key_schedule_block>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x310,%rsp
  mov    %rdi,-0x308(%rbp)
  mov    %rsi,-0x310(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x308(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x230(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x22c(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x228(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x224(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x220(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x21c(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x218(%rbp)
  mov    -0x308(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x214(%rbp)
  movl   $0x5,-0x2fc(%rbp)
  jmp    L12
L58:
  movl   $0x0,-0x2f8(%rbp)
  jmp    L32
L85:
  movl   $0x0,-0x2f4(%rbp)
  jmp    L114
L78:
  mov    -0x2fc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x2f8(%rbp),%eax
  movslq %eax,%rcx
  movslq %edx,%rax
  shl    $0x3,%rax
  add    %rcx,%rax
  mov    -0x2f0(%rbp,%rax,4),%edx
  mov    $0x7,%eax
  sub    -0x2f4(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    -0x2f8(%rbp),%eax
  lea    0x0(,%rax,8),%ecx
  mov    -0x2f4(%rbp),%eax
  add    %ecx,%eax
  and    $0x1,%edx
  cltq
  mov    %edx,-0x210(%rbp,%rax,4)
  mov    -0x2f8(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x2f4(%rbp),%eax
  lea    (%rdx,%rax,1),%esi
  mov    -0x2f8(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x2f4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    D7(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  movzbl %al,%eax
  lea    -0x1(%rax),%ecx
  movslq %esi,%rax
  mov    -0x210(%rbp,%rax,4),%edx
  movslq %ecx,%rax
  mov    %edx,-0x110(%rbp,%rax,4)
  addl   $0x1,-0x2f4(%rbp)
L114:
  cmpl   $0x7,-0x2f4(%rbp)
  jle    L78
  addl   $0x1,-0x2f8(%rbp)
L32:
  cmpl   $0x7,-0x2f8(%rbp)
  jle    L85
  movl   $0x0,-0x2f8(%rbp)
  jmp    L109
L0:
  mov    -0x2f8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2fc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movl   $0x0,-0x2f0(%rbp,%rax,4)
  movl   $0x0,-0x2f4(%rbp)
  jmp    L64
L73:
  mov    -0x2f8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2fc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    -0x2f0(%rbp,%rax,4),%esi
  mov    -0x2f8(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x2f4(%rbp),%eax
  add    %edx,%eax
  cltq
  mov    -0x110(%rbp,%rax,4),%edx
  mov    $0x7,%eax
  sub    -0x2f4(%rbp),%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  or     %eax,%esi
  mov    %esi,%edx
  mov    -0x2f8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x2fc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  mov    %edx,-0x2f0(%rbp,%rax,4)
  addl   $0x1,-0x2f4(%rbp)
L64:
  cmpl   $0x7,-0x2f4(%rbp)
  jle    L73
  addl   $0x1,-0x2f8(%rbp)
L109:
  cmpl   $0x7,-0x2f8(%rbp)
  jle    L0
  subl   $0x1,-0x2fc(%rbp)
L12:
  cmpl   $0x0,-0x2fc(%rbp)
  jns    L58
  movl   $0x0,-0x2fc(%rbp)
  jmp    L107
L24:
  movl   $0x0,-0x2f8(%rbp)
  jmp    L60
L82:
  mov    -0x2f8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2fc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    -0x2f0(%rbp,%rax,4),%eax
  mov    %eax,%edx
  mov    -0x2fc(%rbp),%eax
  mov    %edx,%ecx
  xor    %eax,%ecx
  mov    -0x2fc(%rbp),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x2f8(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x310(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x2f8(%rbp)
L60:
  cmpl   $0x7,-0x2f8(%rbp)
  jle    L82
  addl   $0x1,-0x2fc(%rbp)
L107:
  cmpl   $0x6,-0x2fc(%rbp)
  jle    L24
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L89
  call   <__stack_chk_fail@plt>
L89:
  leave
  ret
```

assistant: ```c
void key_schedule_block(unsigned char *ck, unsigned char *kk) {
  static const unsigned char key_perm[0x40] = {
      0x12, 0x24, 0x09, 0x07, 0x2A, 0x31, 0x1D, 0x15, 0x1C, 0x36, 0x3E, 0x32, 0x13, 0x21, 0x3B, 0x40, 0x18, 0x14, 0x25, 0x27, 0x02, 0x35, 0x1B, 0x01, 0x22, 0x04, 0x0D, 0x0E, 0x39, 0x28, 0x1A, 0x29, 0x33, 0x23, 0x34, 0x0C, 0x16, 0x30, 0x1E, 0x3A, 0x2D, 0x1F, 0x08, 0x19, 0x17, 0x2F, 0x3D, 0x11, 0x3C, 0x05, 0x38, 0x2B, 0x0B, 0x06, 0x0A, 0x2C, 0x20, 0x3F, 0x2E, 0x0F, 0x03, 0x26, 0x10, 0x37,
  };
  int i, j, k;
  int bit[64];
  int newbit[64];
  int kb[7][8];
  kb[6][0] = ck[0];
  kb[6][1] = ck[1];
  kb[6][2] = ck[2];
  kb[6][3] = ck[3];
  kb[6][4] = ck[4];
  kb[6][5] = ck[5];
  kb[6][6] = ck[6];
  kb[6][7] = ck[7];
  for (i = 5; i >= 0; i--) {
    for (j = 0; j < 8; j++) {
      for (k = 0; k < 8; k++) {
        bit[j * 8 + k] = (kb[i + 1][j] >> (7 - k)) & 1;
        newbit[key_perm[j * 8 + k] - 1] = bit[j * 8 + k];
      }
    }
    for (j = 0; j < 8; j++) {
      kb[i][j] = 0;
      for (k = 0; k < 8; k++) {
        kb[i][j] |= newbit[j * 8 + k] << (7 - k);
      }
    }
  }
  for (i = 0; i < 7; i++) {
    for (j = 0; j < 8; j++) {
      kk[i * 8 + j] = kb[i][j] ^ i;
    }
  }
}
```