user: Please show me the C implementation that matches the assembly code listed below:

```asm
<encode_page>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x890,%rsp
  mov    %rdi,-0x878(%rbp)
  mov    %rsi,-0x880(%rbp)
  mov    %edx,-0x884(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x7c,-0x850(%rbp)
  movl   $0x4e,-0x84c(%rbp)
  movl   $0x3,-0x848(%rbp)
  movl   $0x4,-0x844(%rbp)
  movl   $0x55,-0x840(%rbp)
  movl   $0x5,-0x83c(%rbp)
  movl   $0x9,-0x838(%rbp)
  movl   $0x7,-0x834(%rbp)
  movl   $0x2d,-0x830(%rbp)
  movl   $0x2c,-0x82c(%rbp)
  movl   $0x7b,-0x828(%rbp)
  movl   $0x38,-0x824(%rbp)
  movl   $0x17,-0x820(%rbp)
  movl   $0xd,-0x81c(%rbp)
  movl   $0x17,-0x818(%rbp)
  movl   $0x11,-0x814(%rbp)
  movl   $0x0,-0x864(%rbp)
  jmp    L11
L13:
  mov    -0x864(%rbp),%eax
  cltq
  mov    -0x864(%rbp),%edx
  mov    %edx,-0x810(%rbp,%rax,4)
  mov    -0x864(%rbp),%eax
  and    $0xf,%eax
  cltq
  mov    -0x850(%rbp,%rax,4),%edx
  mov    -0x864(%rbp),%eax
  cltq
  mov    %edx,-0x410(%rbp,%rax,4)
  addl   $0x1,-0x864(%rbp)
L11:
  cmpl   $0xff,-0x864(%rbp)
  jle    L13
  movl   $0x0,-0x860(%rbp)
  movl   $0x0,-0x864(%rbp)
  jmp    L59
L56:
  mov    -0x864(%rbp),%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%eax
  mov    %eax,-0x858(%rbp)
  mov    -0x864(%rbp),%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%eax
  add    %eax,-0x860(%rbp)
  mov    -0x864(%rbp),%eax
  cltq
  mov    -0x410(%rbp,%rax,4),%eax
  add    %eax,-0x860(%rbp)
  andl   $0xff,-0x860(%rbp)
  mov    -0x860(%rbp),%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%edx
  mov    -0x864(%rbp),%eax
  cltq
  mov    %edx,-0x810(%rbp,%rax,4)
  mov    -0x860(%rbp),%eax
  cltq
  mov    -0x858(%rbp),%edx
  mov    %edx,-0x810(%rbp,%rax,4)
  addl   $0x1,-0x864(%rbp)
L59:
  cmpl   $0xff,-0x864(%rbp)
  jle    L56
  movl   $0x0,-0x85c(%rbp)
  movl   $0x0,-0x864(%rbp)
  jmp    L52
L48:
  mov    -0x864(%rbp),%eax
  add    $0x1,%eax
  movzbl %al,%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%eax
  mov    %eax,-0x858(%rbp)
  mov    -0x858(%rbp),%eax
  mov    %eax,-0x854(%rbp)
  mov    -0x858(%rbp),%edx
  mov    -0x85c(%rbp),%eax
  add    %edx,%eax
  and    $0xff,%eax
  mov    %eax,-0x85c(%rbp)
  mov    -0x864(%rbp),%eax
  add    $0x1,%eax
  movzbl %al,%ecx
  mov    -0x85c(%rbp),%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%edx
  movslq %ecx,%rax
  mov    %edx,-0x810(%rbp,%rax,4)
  mov    -0x858(%rbp),%eax
  movzbl %al,%edx
  mov    -0x85c(%rbp),%eax
  cltq
  mov    %edx,-0x810(%rbp,%rax,4)
  mov    -0x864(%rbp),%eax
  add    $0x1,%eax
  movzbl %al,%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%edx
  mov    -0x858(%rbp),%eax
  add    %edx,%eax
  and    $0xff,%eax
  mov    %eax,-0x854(%rbp)
  mov    -0x854(%rbp),%eax
  cltq
  mov    -0x810(%rbp,%rax,4),%eax
  mov    %eax,-0x854(%rbp)
  mov    -0x864(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x878(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x864(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x880(%rbp),%rdx
  add    %rcx,%rdx
  xor    -0x854(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x864(%rbp)
L52:
  mov    -0x864(%rbp),%eax
  cmp    -0x884(%rbp),%eax
  jl     L48
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
void encode_page(uint8_t *inpg, uint8_t *outpg, const int size) {
  uint8_t key[] = {0x7C, 0x4E, 0x03, 0x04, 0x55, 0x05, 0x09, 0x07, 0x2D, 0x2C, 0x7B, 0x38, 0x17, 0x0D, 0x17, 0x11};
  int i, i3, x, val, idx;
  uint8_t key1[0x100];
  uint8_t key2[0x100];
  for (i = 0; i < 0x100; i++) {
    key1[i] = i;
    key2[i] = key[i & 0xf];
  }
  i3 = 0;
  for (i = 0; i < 0x100; i++) {
    x = key1[i];
    i3 = key1[i] + i3;
    i3 += key2[i];
    i3 &= 0xff;
    key1[i] = key1[i3];
    key1[i3] = x;
  }
  idx = 0;
  for (i = 0; i < size; i++) {
    x = key1[(i + 1) & 0xff];
    val = x;
    idx = (x + idx) & 0xff;
    key1[(i + 1) & 0xff] = key1[idx];
    key1[idx] = (x & 0xff);
    val = (key1[(i + 1) & 0xff] + x) & 0xff;
    val = key1[val];
    outpg[i] = val ^ inpg[i];
  }
}
```