user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %r13
  lea    D4(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  mov    $0x8,%esi
  lea    0x1(%rax),%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %rax,%r12
  mov    0x4(%rsp),%eax
  lea    0x1(%rax),%edi
  call   <calloc@plt>
  mov    $0x7f,%esi
  mov    %r12,%rdi
  mov    %rax,%rbp
  mov    0x4(%rsp),%eax
  lea    0x8(,%rax,8),%edx
  call   <memset@plt>
  mov    (%rsp),%eax
  test   %eax,%eax
  jle    L87
  xor    %r13d,%r13d
  lea    D31(%rip),%rbx
  nopw   0x0(%rax,%rax,1)
L9:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  movslq 0x4(%rsp),%rsi
  mov    0x0(%rbp),%rax
  mov    %r12,%rdx
  shl    $0x3,%rsi
  mov    %rax,(%r12)
  lea    (%r12,%rsi,1),%rdi
  cmp    %rdi,%r12
  jb     L100
  jmp    L13
  nopl   0x0(%rax)
L6:
  movups %xmm1,(%rdx)
  add    $0x8,%rdx
  cmp    %rdx,%rdi
  jbe    L13
L100:
  movdqu (%rdx),%xmm0
  movhlps %xmm0,%xmm2
  movdqa %xmm0,%xmm1
  movq   %xmm0,%rcx
  movq   %xmm2,%rax
  shufpd $0x1,%xmm0,%xmm1
  cmp    %rax,%rcx
  jl     L6
L13:
  add    %rbp,%rsi
  cmp    %rsi,%rbp
  jae    L65
  mov    %rbp,%rdx
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L7:
  movups %xmm1,(%rdx)
  add    $0x8,%rdx
  cmp    %rdx,%rsi
  jbe    L65
L44:
  movdqu (%rdx),%xmm0
  movhlps %xmm0,%xmm3
  movdqa %xmm0,%xmm1
  movq   %xmm0,%rcx
  movq   %xmm3,%rax
  shufpd $0x1,%xmm0,%xmm1
  cmp    %rax,%rcx
  jg     L7
L65:
  add    $0x1,%r13d
  cmp    %r13d,(%rsp)
  jg     L9
L87:
  mov    0x8(%rbp),%r13
  sub    0x8(%r12),%r13
  mov    %r13,%rdi
  call   <isprime@plt>
  lea    D45(%rip),%rsi
  mov    %r13,%rdx
  lea    D37(%rip),%rdi
  test   %rax,%rax
  lea    D0(%rip),%rax
  cmove  %rax,%rsi
  call   <printf@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L84
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D4
data_type: string
name: extract_symbolic_data
arguments: data_label: D31
data_type: string
name: extract_symbolic_data
arguments: data_label: D45
data_type: string
name: extract_symbolic_data
arguments: data_label: D37
data_type: string
name: extract_symbolic_data
arguments: data_label: D0
data_type: string

tool: D4: %d %d

tool: D31: %ld

tool: D45: YES

tool: D37: %s
%d


tool: D0: NO

assistant: ```c
int main(void) {
  int n, k;
  scanf("%d %d", &n, &k);
  long *p1, *p2, temp;
  long *min = (long *)calloc(k + 1, sizeof(long));
  long *max = (long *)calloc(k + 1, sizeof(long));
  memset(min, 0x7F, (k + 1) * sizeof(long));
  for (int i = 0; i < n; i++) {
    scanf("%ld", max);
    *(p1 = min) = *(p2 = max);
    while (p1 < min + k && p1[0] < p1[1]) {
      {
        temp = (p1)[1];
        (p1)[1] = *(p1);
        *(p1)++ = temp;
      };
    }
    while (p2 < max + k && p2[0] > p2[1]) {
      {
        temp = (p2)[1];
        (p2)[1] = *(p2);
        *(p2)++ = temp;
      };
    }
  }
  temp = max[1] - min[1];
  printf("%s\n%d\n", isprime(temp) ? "YES" : "NO", temp);
  free(min);
  free(max);
  return 0;
}
```