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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  lea    D3(%rip),%r15
  push   %r14
  lea    -0x3c(%rbp),%rsi
  mov    %r15,%rdi
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%rsi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rdi
  and    $0xfffffffffffffff0,%rdx
  sub    %rdi,%rcx
  cmp    %rcx,%rsp
  je     L173
L133:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L133
L173:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L130
L167:
  mov    %rax,%rdx
  mov    %rsp,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%r14
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L45:
  cmp    %rcx,%rsp
  je     L143
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L45
L130:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L167
L143:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L21
L132:
  lea    0x3(%rsp),%r13
  mov    %r13,%rax
  and    $0xfffffffffffffffc,%r13
  shr    $0x2,%rax
  mov    %rax,-0x48(%rbp)
  test   %esi,%esi
  jle    L158
  mov    %r14,%rbx
  xor    %r12d,%r12d
  nopw   0x0(%rax,%rax,1)
L68:
  mov    %rbx,%rsi
  mov    %r15,%rdi
  add    $0x1,%r12d
  add    $0x4,%rbx
  call   <scanf@plt>
  mov    -0x3c(%rbp),%esi
  cmp    %r12d,%esi
  jg     L68
L158:
  mov    %r14,%rdi
  call   <ms@plt>
  mov    -0x3c(%rbp),%ecx
  cmp    $0x1,%ecx
  jle    L40
  lea    -0x2(%rcx),%esi
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L16:
  mov    (%r14,%rax,4),%edx
  sub    -0x4(%r14,%rax,4),%edx
  mov    %edx,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L16
  mov    -0x48(%rbp),%rax
  lea    0x8(%r13,%rsi,4),%rsi
  mov    0x4(,%rax,4),%ecx
  lea    0x8(%r13),%rax
  mov    %ecx,%edx
  mov    %ecx,%r12d
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L79:
  mov    (%rax),%edx
  add    $0x4,%rax
L90:
  cmp    %edx,%r12d
  cmovg  %edx,%r12d
  cmp    %rax,%rsi
  jne    L79
  mov    $0x1,%ebx
  lea    D5(%rip),%r15
  jmp    L74
  nopl   0x0(%rax,%rax,1)
L0:
  add    $0x1,%rbx
  cmp    %ebx,-0x3c(%rbp)
  jle    L40
L121:
  mov    0x0(%r13,%rbx,4),%ecx
L74:
  cmp    %ecx,%r12d
  jne    L0
  mov    (%r14,%rbx,4),%edx
  mov    -0x4(%r14,%rbx,4),%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,-0x3c(%rbp)
  jg     L121
  nop
L40:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L89
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L21:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L132
L89:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D3
type: string
name: disassemble_data
arguments: tag: D5
type: string

tool: D3: %d

tool: D5: %d %d 

assistant: ```c
int main() {
  int n, i, j, m;
  scanf("%d", &n);
  int a[n], d[n];
  for (i = 0; i < n; ++i)
    scanf("%d", &a[i]);
  ms(a, n);
  for (i = 1; i < n; ++i)
    d[i] = a[i] - a[i - 1];
  for (i = 1, m = d[1]; i < n; ++i)
    if (d[i] < m)
      m = d[i];
  for (i = 1; i < n; ++i)
    if (d[i] == m)
      printf("%d %d ", a[i - 1], a[i]);
  printf("\n");
  return 0;
}
```