user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D28(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x1d8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1c8(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rsi
  call   <scanf@plt>
  mov    0x14(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x14(%rsp)
  test   %eax,%eax
  je     L32
  lea    0x18(%rsp),%rax
  lea    0x20(%rsp),%r12
  mov    %rax,0x8(%rsp)
  lea    0x1c(%rsp),%r15
  nopl   0x0(%rax,%rax,1)
L168:
  xor    %eax,%eax
  mov    $0x34,%ecx
  mov    %r12,%rdi
  mov    0x8(%rsp),%rsi
  rep stos %rax,%es:(%rdi)
  mov    %r15,%rdx
  movl   $0x0,(%rdi)
  lea    D3(%rip),%rdi
  call   <scanf@plt>
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L138
  mov    %r12,%rbx
  mov    %r12,%r14
  xor    %r13d,%r13d
  nopl   0x0(%rax)
L17:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%r13d
  call   <scanf@plt>
  mov    0x18(%rsp),%esi
  add    $0x4,%r14
  cmp    %r13d,%esi
  jg     L17
  mov    0x20(%rsp),%ecx
  test   %esi,%esi
  jle    L138
  lea    -0x1(%rsi),%eax
  cmp    $0x2,%eax
  jbe    L126
  mov    %esi,%eax
  movd   %ecx,%xmm5
  pxor   %xmm3,%xmm3
  shr    $0x2,%eax
  pshufd $0x0,%xmm5,%xmm1
  lea    -0x1(%rax),%edx
  lea    0x10(%r12),%rax
  shl    $0x4,%rdx
  add    %rax,%rdx
  jmp    L143
  nopl   0x0(%rax)
L151:
  add    $0x10,%rax
L143:
  movdqa (%rbx),%xmm2
  movdqa %xmm1,%xmm0
  mov    %rax,%rbx
  pcmpgtd %xmm2,%xmm0
  movdqa %xmm2,%xmm4
  paddd  %xmm2,%xmm3
  pand   %xmm0,%xmm4
  pandn  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  por    %xmm4,%xmm1
  cmp    %rdx,%rax
  jne    L151
  movdqa %xmm3,%xmm0
  movdqa %xmm1,%xmm2
  mov    %esi,%edx
  psrldq $0x8,%xmm0
  psrldq $0x8,%xmm2
  and    $0xfffffffc,%edx
  paddd  %xmm0,%xmm3
  movdqa %xmm3,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm3
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  movd   %xmm3,%eax
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movd   %xmm1,%ecx
  test   $0x3,%sil
  je     L96
L163:
  movslq %edx,%rdi
  mov    0x20(%rsp,%rdi,4),%edi
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  add    %edi,%eax
  lea    0x1(%rdx),%edi
  cmp    %edi,%esi
  jle    L96
  movslq %edi,%rdi
  mov    0x20(%rsp,%rdi,4),%edi
  cmp    %edi,%ecx
  cmovg  %edi,%ecx
  add    $0x2,%edx
  add    %edi,%eax
  cmp    %edx,%esi
  jle    L96
  movslq %edx,%rdx
  mov    0x20(%rsp,%rdx,4),%edx
  cmp    %edx,%ecx
  cmovg  %edx,%ecx
  add    %edx,%eax
L96:
  cltd
  idivl  0x1c(%rsp)
  cmp    %ecx,%edx
  jl     L74
  test   %edx,%edx
  jne    L117
L74:
  mov    %eax,%esi
L39:
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L46:
  mov    0x14(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x14(%rsp)
  test   %eax,%eax
  jne    L168
L32:
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x1d8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L117:
  lea    D19(%rip),%rdi
  call   <puts@plt>
  jmp    L46
  xchg   %ax,%ax
L138:
  xor    %esi,%esi
  jmp    L39
L126:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L163
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D28
type_guessed: string
name: extract_symbolic_data
arguments: tag: D3
type_guessed: string
name: extract_symbolic_data
arguments: tag: D9
type_guessed: string
name: extract_symbolic_data
arguments: tag: D19
type_guessed: string

tool: D28: %d

tool: D3: %d%d

tool: D9: %d


tool: D19: -1

assistant: ```c
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, x, i, min, sum = 0;
    int a[105] = {0};
    scanf("%d%d", &n, &x);
    for (i = 0; i < n; i++)
      scanf("%d", &a[i]);
    min = a[0];
    for (i = 0; i < n; i++) {
      if (a[i] < min)
        min = a[i];
      sum += a[i];
    }
    if (sum % x == 0 || sum % x < min)
      printf("%d\n", sum / x);
    else
      printf("-1\n");
  }
  return 0;
}
```