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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D18(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%eax
  mov    %rsp,%rcx
  add    $0x1,%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L143
L26:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L26
L143:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L92
L73:
  movslq -0x3c(%rbp),%rdx
  mov    %rsp,%rsi
  mov    %rsp,%r15
  lea    0x1(%rdx),%eax
  cltq
  add    $0xf,%rax
  mov    %rax,%rdi
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rdi
  and    $0xfffffffffffffff0,%rcx
  sub    %rdi,%rsi
L113:
  cmp    %rsi,%rsp
  je     L118
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L113
L92:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L73
L118:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L121
L24:
  mov    %rax,%rcx
  mov    %rsp,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%r13
  and    $0xfffffffffffffff0,%rcx
  sub    %rax,%rsi
L74:
  cmp    %rsi,%rsp
  je     L71
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L74
L121:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L24
L71:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  je     L115
  orq    $0x0,-0x8(%rsp,%rcx,1)
L115:
  lea    D9(%rip),%r14
  mov    %r15,%rsi
  xor    %eax,%eax
  movb   $0x0,(%rsp,%rdx,1)
  mov    %r14,%rdi
  mov    %rsp,%r12
  call   <scanf@plt>
  mov    %r14,%rdi
  mov    %r13,%rsi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x40(%rbp),%r14d
  mov    -0x3c(%rbp),%ebx
  test   %r14d,%r14d
  jle    L97
  lea    -0x1(%r14),%ecx
  lea    -0x1(%rbx),%edi
  mov    %r14d,%edx
  mov    %rcx,%rax
  movslq %edi,%rdi
  cltq
  sub    %rcx,%rdi
  sub    %rcx,%rax
  add    %rsp,%rdi
  lea    (%r15,%rax,1),%rsi
  call   <memcpy@plt>
L97:
  mov    %ebx,%eax
  sub    %r14d,%eax
  lea    -0x1(%rax),%edx
  cltq
  movslq %edx,%rcx
  lea    (%rdx,%r14,1),%esi
  test   %edx,%edx
  js     L104
  movslq %esi,%rsi
  sub    %rax,%rsi
  lea    0x0(%r13,%rsi,1),%rdi
  add    %r12,%rsi
  nopw   0x0(%rax,%rax,1)
L116:
  movsbl 0x1(%rsi,%rcx,1),%edx
  movsbl 0x1(%rdi,%rcx,1),%eax
  sub    %edx,%eax
  add    $0x1a,%eax
  movslq %eax,%rdx
  mov    %eax,%r8d
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x1f,%r8d
  sar    $0x23,%rdx
  sub    %r8d,%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%eax
  add    $0x61,%eax
  mov    %al,(%r12,%rcx,1)
  sub    $0x1,%rcx
  test   %ecx,%ecx
  jns    L116
L104:
  mov    %r12,%rdi
  call   <puts@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L106
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L106:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D18
type_guessed: string
name: disassemble_data
arguments: data_tag: D9
type_guessed: string

tool: D18: %d %d

tool: D9: %s

assistant: ```c
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  char last[n + 1], encrypted[m + 1], plain[m + 1];
  plain[m] = 0;
  scanf("%s", last);
  scanf("%s", encrypted);
  for (int i = 0; i < n; i++)
    plain[m - 1 - i] = last[n - 1 - i];
  for (int i = m - n - 1; i >= 0; i--)
    plain[i] = (char)(((26 + (((encrypted[i + n]) - 'a') - ((plain[n + i]) - 'a'))) % 26) + 'a');
  printf("%s\n", plain);
  return 0;
}
```