user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    D16(%rip),%rbx
  mov    %rbx,%rdi
  sub    $0x378,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x368(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x4(%rsp)
  test   %eax,%eax
  je     L86
  lea    0xc(%rsp),%r14
  lea    0x8(%rsp),%r13
  nopl   0x0(%rax)
L19:
  mov    %r14,%rdx
  mov    %r13,%rsi
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L64
  lea    0x14(%rsp),%r12
  mov    $0x1,%ebp
  lea    0x1c0(%rsp),%r15
  nopw   0x0(%rax,%rax,1)
L123:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  movl   $0x0,(%r15,%rbp,4)
  call   <scanf@plt>
  mov    0x8(%rsp),%esi
  add    $0x1,%rbp
  add    $0x4,%r12
  cmp    %ebp,%esi
  jge    L123
  test   %esi,%esi
  jle    L64
  lea    -0x1(%rsi),%r8d
  lea    0x1(%rsi),%edi
  mov    $0x1,%edx
  lea    0x10(%rsp),%rcx
  cs nopw 0x0(%rax,%rax,1)
L160:
  movslq (%rcx,%rdx,4),%rax
  cmp    %edx,%eax
  je     L150
  add    $0x1,%rdx
  addl   $0x1,0x1c0(%rsp,%rax,4)
  cmp    %rdi,%rdx
  jne    L160
  mov    0xc(%rsp),%ecx
  cmp    $0x2,%r8d
  jbe    L32
L83:
  mov    %esi,%edx
  movd   %ecx,%xmm5
  pxor   %xmm0,%xmm0
  shr    $0x2,%edx
  pshufd $0x0,%xmm5,%xmm3
  lea    0x1c4(%rsp),%rax
  sub    $0x1,%edx
  movdqa %xmm0,%xmm2
  shl    $0x4,%rdx
  lea    0x1d4(%rsp,%rdx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L139:
  movdqu (%rax),%xmm4
  movdqa %xmm3,%xmm1
  add    $0x10,%rax
  pcmpgtd %xmm4,%xmm1
  pcmpeqd %xmm2,%xmm1
  psubd  %xmm1,%xmm0
  cmp    %rax,%rdx
  jne    L139
  movdqa %xmm0,%xmm1
  mov    %esi,%edx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%edx
  paddd  %xmm1,%xmm0
  lea    0x1(%rdx),%eax
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%r8d
  cmp    %edx,%esi
  je     L50
L93:
  movslq %eax,%rdx
  cmp    0x1c0(%rsp,%rdx,4),%ecx
  jg     L54
  add    $0x1,%r8d
L54:
  lea    0x1(%rax),%edx
  cmp    %edx,%esi
  jl     L50
  movslq %edx,%rdx
  cmp    0x1c0(%rsp,%rdx,4),%ecx
  jg     L6
  add    $0x1,%r8d
L6:
  add    $0x2,%eax
  cmp    %eax,%esi
  jl     L50
  cltq
  cmp    0x1c0(%rsp,%rax,4),%ecx
  jg     L50
  add    $0x1,%r8d
L50:
  mov    %r8d,%esi
  lea    D17(%rip),%rdi
  call   <printf@plt>
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x4(%rsp)
  test   %eax,%eax
  jne    L19
L86:
  mov    0x368(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  add    $0x378,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L150:
  movl   $0xfffffc19,0x1c0(%rsp,%rax,4)
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L160
  mov    0xc(%rsp),%ecx
  cmp    $0x2,%r8d
  ja     L83
L32:
  xor    %r8d,%r8d
  mov    $0x1,%eax
  jmp    L93
  nopl   0x0(%rax,%rax,1)
L64:
  xor    %r8d,%r8d
  jmp    L50
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D16
data_type: string
name: unpack_data
arguments: label: D2
data_type: string
name: unpack_data
arguments: label: D17
data_type: string

tool: D16: %d

tool: D2: %d%d

tool: D17: %d


assistant: ```c
int main(void) {
  int t, n, k, i, a[105];
  scanf("%d", &t);
  while (t--) {
    int c = 0, b[105];
    scanf("%d%d", &n, &k);
    for (i = 1; i <= n; i++) {
      b[i] = 0;
      scanf("%d", &a[i]);
    }
    for (i = 1; i <= n; i++) {
      if (a[i] != i)
        b[a[i]]++;
      else
        b[a[i]] = -999;
    }
    for (i = 1; i <= n; i++) {
      if (b[i] >= k)
        c++;
    }
    printf("%d\n", c);
  }
  return 0;
}
```