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

```asm
<set_page_tables>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  and    $0xfffffffffffff000,%rsp
  lea    -0x402000(%rsp),%r11
L60:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L60
  mov    %fs:0x28,%rax
  mov    %rax,0x401ff8(%rsp)
  xor    %eax,%eax
  movl   $0xc0000000,0xfd4(%rsp)
  movl   $0xc0000,0xfd8(%rsp)
  movl   $0x4,0xfdc(%rsp)
  movl   $0x400,0xfe0(%rsp)
  movl   $0x400,0xfe4(%rsp)
  mov    0xfdc(%rsp),%eax
  imul   0xfe0(%rsp),%eax
  mov    %eax,0xfe8(%rsp)
  movl   $0x0,0xfcc(%rsp)
  mov    0xfd4(%rsp),%eax
  shl    $0x2,%rax
  neg    %rax
  mov    %rax,%rdx
  lea    0x1000(%rsp),%rax
  add    %rdx,%rax
  mov    %rax,0xff0(%rsp)
  mov    0xfd4(%rsp),%eax
  shl    $0x2,%rax
  neg    %rax
  mov    %rax,%rdx
  lea    0x1000(%rsp),%rax
  add    %rdx,%rax
  mov    %rax,0xff8(%rsp)
  movl   $0x7,0xfd0(%rsp)
  jmp    L27
L25:
  mov    0xfcc(%rsp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0xff0(%rsp),%rax
  add    %rax,%rdx
  mov    0xfd0(%rsp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,0xfcc(%rsp)
  addl   $0x1000,0xfd0(%rsp)
L27:
  mov    0xfe8(%rsp),%eax
  cmp    %eax,0xfcc(%rsp)
  jb     L25
  movl   $0x7,0xfd0(%rsp)
  mov    0xfd8(%rsp),%eax
  mov    %eax,0xfcc(%rsp)
  mov    0xfe8(%rsp),%edx
  mov    0xfd8(%rsp),%eax
  add    %edx,%eax
  mov    %eax,0xfec(%rsp)
  jmp    L79
L20:
  mov    0xfcc(%rsp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0xff0(%rsp),%rax
  add    %rax,%rdx
  mov    0xfd0(%rsp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,0xfcc(%rsp)
  addl   $0x1000,0xfd0(%rsp)
L79:
  mov    0xfcc(%rsp),%eax
  cmp    0xfec(%rsp),%eax
  jb     L20
  mov    0xff0(%rsp),%rax
  mov    %eax,0xfd0(%rsp)
  orl    $0x7,0xfd0(%rsp)
  movl   $0x0,0xfcc(%rsp)
  jmp    L42
L14:
  mov    0xfcc(%rsp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0xff8(%rsp),%rax
  add    %rax,%rdx
  mov    0xfd0(%rsp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,0xfcc(%rsp)
  addl   $0x1000,0xfd0(%rsp)
L42:
  mov    0xfe4(%rsp),%eax
  cmp    %eax,0xfcc(%rsp)
  jb     L14
  nop
  mov    0x401ff8(%rsp),%rax
  sub    %fs:0x28,%rax
  je     L57
  call   <__stack_chk_fail@plt>
L57:
  leave
  ret
```

assistant: ```c
void set_page_tables() {
  unsigned int pages_entry[1024 * 1024] __attribute__((aligned(4096)));
  unsigned int KERNEL_VIRTUAL_OFFSET = 0xC0000000;
  unsigned int KERNEL_FIRST_VIRTUAL_ADDRESS = 0xC0000000 >> 12;
  int numPageTables = 4;
  int numPagesInPageTable = 1024;
  int numPageTableEntriesInPageDirectory = 1024;
  int totalPages = numPageTables * numPagesInPageTable;
  unsigned int index = 0;
  unsigned int *pages_ptr = (unsigned int *)(pages_entry - KERNEL_VIRTUAL_OFFSET);
  unsigned int *page_table_ptr = (unsigned int *)(pages_entry - KERNEL_VIRTUAL_OFFSET);
  unsigned int positionAndFlags = 7;
  while (index < totalPages) {
    pages_ptr[index] = positionAndFlags;
    index = index + 1;
    positionAndFlags += 4096;
  }
  positionAndFlags = 7;
  index = KERNEL_FIRST_VIRTUAL_ADDRESS;
  unsigned int totalPagesLeft = KERNEL_FIRST_VIRTUAL_ADDRESS + totalPages;
  while (index < totalPagesLeft) {
    pages_ptr[index] = positionAndFlags;
    index = index + 1;
    positionAndFlags += 4096;
  }
  positionAndFlags = (unsigned int)&pages_ptr[0];
  positionAndFlags = positionAndFlags | 7;
  index = 0;
  while (index < numPageTableEntriesInPageDirectory) {
    page_table_ptr[index] = positionAndFlags;
    index = index + 1;
    positionAndFlags += 4096;
  }
}
```