user: Translate the below assembly code into C programming language:

```asm
<key_schedule_block>:
  endbr64
  push   %r14
  mov    %rsi,%r10
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D1(%rip),%rbx
  sub    $0x1f0,%rsp
  movzbl (%rdi),%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x1e8(%rsp)
  xor    %eax,%eax
  movzbl 0x1(%rdi),%eax
  mov    %rsp,%r12
  lea    0xa0(%rsp),%rbp
  mov    %esi,0xc0(%rsp)
  mov    %r12,%r11
  lea    0xe0(%rsp),%r13
  mov    %eax,0xc4(%rsp)
  movzbl 0x2(%rdi),%eax
  mov    %eax,0xc8(%rsp)
  movzbl 0x3(%rdi),%eax
  mov    %eax,0xcc(%rsp)
  movzbl 0x4(%rdi),%eax
  mov    %eax,0xd0(%rsp)
  movzbl 0x5(%rdi),%eax
  mov    %eax,0xd4(%rsp)
  movzbl 0x6(%rdi),%eax
  mov    %eax,0xd8(%rsp)
  movzbl 0x7(%rdi),%eax
  mov    $0x7,%edi
  mov    %eax,0xdc(%rsp)
  nopw   0x0(%rax,%rax,1)
L9:
  lea    0x24(%rbp),%r9
  lea    D3(%rip),%r8
  mov    $0x12,%eax
  nopl   0x0(%rax,%rax,1)
L36:
  mov    %r8,%rdx
  mov    $0x7,%ecx
  jmp    L94
  nopw   0x0(%rax,%rax,1)
L66:
  movzbl (%rdx),%eax
L94:
  mov    %esi,%r14d
  sub    $0x1,%eax
  add    $0x1,%rdx
  sar    %cl,%r14d
  cltq
  sub    $0x1,%ecx
  and    $0x1,%r14d
  mov    %r14d,0xe0(%rsp,%rax,4)
  cmp    $0xffffffff,%ecx
  jne    L66
  add    $0x8,%r8
  cmp    %rbx,%r8
  je     L102
  mov    (%r9),%esi
  movzbl (%r8),%eax
  add    $0x4,%r9
  jmp    L36
  nopl   0x0(%rax)
L102:
  pxor   %xmm0,%xmm0
  mov    %r13,%r8
  mov    %rbp,%r14
  xor    %r9d,%r9d
  movups %xmm0,0x0(%rbp)
  movups %xmm0,0x10(%rbp)
  nopl   (%rax)
L92:
  xor    %eax,%eax
  xor    %esi,%esi
  nopl   0x0(%rax)
L67:
  mov    (%r8,%rax,4),%edx
  mov    %edi,%ecx
  sub    %eax,%ecx
  add    $0x1,%rax
  shl    %cl,%edx
  or     %edx,%esi
  cmp    $0x8,%rax
  jne    L67
  add    $0x8,%r9d
  mov    %esi,(%r14)
  add    $0x20,%r8
  add    $0x4,%r14
  cmp    $0x40,%r9d
  jne    L92
  cmp    %r12,%rbp
  je     L87
  mov    0x0(%rbp),%esi
  sub    $0x20,%rbp
  jmp    L9
L87:
  xor    %esi,%esi
  xchg   %ax,%ax
L2:
  mov    %esi,%ecx
  xor    %eax,%eax
  nopl   0x0(%rax)
L71:
  movzbl (%r11,%rax,4),%edx
  xor    %ecx,%edx
  mov    %dl,(%r10,%rax,1)
  add    $0x1,%rax
  cmp    $0x8,%rax
  jne    L71
  add    $0x1,%esi
  add    $0x20,%r11
  add    $0x8,%r10
  cmp    $0x7,%esi
  jne    L2
  mov    0x1e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x1f0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L45:
  call   <__stack_chk_fail@plt>
```

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