user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D31(%rip),%rdi
  mov    %rsp,%rbp
  push   %r14
  lea    D61(%rip),%r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x2c(%rbp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  cmpl   $0x190,-0x2c(%rbp)
  jg     L127
  lea    D3(%rip),%rdi
  call   <puts@plt>
  movslq -0x2c(%rbp),%rax
  mov    %rsp,%rsi
  mov    %rax,%rcx
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rsi
L42:
  cmp    %rsi,%rsp
  je     L38
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L42
L127:
  lea    D50(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D22(%rip),%rdi
  call   <system@plt>
L138:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L142
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L38:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L2
  orq    $0x0,-0x8(%rsp,%rdx,1)
L2:
  mov    %rsp,%rbx
  xor    %r12d,%r12d
  mov    %rbx,%r13
  test   %ecx,%ecx
  jle    L52
L245:
  mov    %r13,%rsi
  mov    %r14,%rdi
  add    $0x1,%r12d
  add    $0x4,%r13
  call   <scanf@plt>
  mov    -0x2c(%rbp),%edx
  cmp    %r12d,%edx
  jg     L245
  test   %edx,%edx
  jle    L52
  xor    %r8d,%r8d
  xor    %edi,%edi
  lea    0x10(%rbx),%r10
  mov    $0x1,%r9d
  nopw   0x0(%rax,%rax,1)
L99:
  test   %edx,%edx
  mov    %r9d,%r11d
  mov    (%rbx,%r8,4),%esi
  cmovg  %edx,%r11d
  cmp    $0x3,%edx
  jle    L43
  movd   %esi,%xmm3
  pxor   %xmm1,%xmm1
  mov    %r11d,%eax
  shr    $0x2,%eax
  pshufd $0x0,%xmm3,%xmm2
  lea    -0x1(%rax),%ecx
  mov    %rbx,%rax
  shl    $0x4,%rcx
  add    %r10,%rcx
  xchg   %ax,%ax
L128:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  pcmpeqd %xmm2,%xmm0
  psubd  %xmm0,%xmm1
  cmp    %rcx,%rax
  jne    L128
  movdqa %xmm1,%xmm0
  mov    %r11d,%ecx
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%ecx
  and    $0x3,%r11d
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  je     L239
L8:
  movslq %ecx,%r11
  xor    %r12d,%r12d
  lea    (%rbx,%r11,4),%r11
  cmp    (%r11),%esi
  sete   %r12b
  add    %r12d,%eax
  lea    0x1(%rcx),%r12d
  cmp    %edx,%r12d
  jge    L239
  xor    %r12d,%r12d
  cmp    0x4(%r11),%esi
  sete   %r12b
  add    $0x2,%ecx
  add    %r12d,%eax
  cmp    %ecx,%edx
  jle    L239
  xor    %ecx,%ecx
  cmp    0x8(%r11),%esi
  sete   %cl
  add    %ecx,%eax
L239:
  cmp    $0x2,%eax
  jg     L184
L144:
  add    $0x1,%r8
  cmp    %r8d,%edx
  jg     L99
  test   %dil,%dil
  je     L52
  mov    %edx,-0x2c(%rbp)
L52:
  lea    D17(%rip),%rdi
  xor    %r12d,%r12d
  lea    D39(%rip),%r13
  call   <puts@plt>
  cmpl   $0x0,-0x2c(%rbp)
  lea    D62(%rip),%r14
  jle    L97
  nopl   0x0(%rax)
L79:
  mov    (%rbx,%r12,4),%esi
  test   $0x3,%r12b
  jne    L167
  mov    %r14,%rdi
  test   %r12d,%r12d
  jne    L75
L167:
  mov    %r13,%rdi
L75:
  xor    %eax,%eax
  add    $0x1,%r12
  call   <printf@plt>
  cmp    %r12d,-0x2c(%rbp)
  jg     L79
L97:
  lea    D22(%rip),%rdi
  call   <system@plt>
  jmp    L138
  nopw   0x0(%rax,%rax,1)
L184:
  xor    %eax,%eax
  xor    %edi,%edi
  nopl   0x0(%rax)
L102:
  mov    (%rbx,%rax,4),%ecx
  cmp    %ecx,%esi
  je     L10
  movslq %edi,%r11
  add    $0x1,%edi
  mov    %ecx,(%rbx,%r11,4)
L10:
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L102
  mov    %edi,%edx
  mov    $0x1,%edi
  jmp    L144
L43:
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L8
L142:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D31
data_type: string
name: retrieve_data
arguments: tag: D61
data_type: string
name: retrieve_data
arguments: tag: D3
data_type: string
name: retrieve_data
arguments: tag: D50
data_type: string
name: retrieve_data
arguments: tag: D22
data_type: string
name: retrieve_data
arguments: tag: D17
data_type: string
name: retrieve_data
arguments: tag: D39
data_type: string
name: retrieve_data
arguments: tag: D62
data_type: string

tool: D31: Vvedit kilkist elementiv masivy (do 400 elementiv) -> 

tool: D61: %d

tool: D3: Vvedit elementy masivy

tool: D50: Vu vvely zabagato elementiv!

tool: D22: PAUSE

tool: D17: Noviy masiv: 

tool: D39: %d 

tool: D62: %d


assistant: ```c
int main(int argc, char *argv[]) {
  int countOfElements;
  printf("Vvedit kilkist elementiv masivy (do 400 elementiv) -> ");
  scanf("%d", &countOfElements);
  if (countOfElements > 400) {
    printf("Vu vvely zabagato elementiv!");
    system("PAUSE");
    return 0;
  }
  printf("Vvedit elementy masivy\n");
  int numbers[countOfElements];
  for (int currentElement = 0; currentElement < countOfElements; currentElement++)
    scanf("%d", &numbers[currentElement]);
  for (int currentElement = 0; currentElement < countOfElements; currentElement++) {
    int countOfRepeats = 0, newArrayElements = 0;
    for (int elementCheck = 0; elementCheck < countOfElements; elementCheck++)
      if (numbers[currentElement] == numbers[elementCheck])
        countOfRepeats++;
    if (countOfRepeats >= 3) {
      int element = numbers[currentElement];
      for (int arrayChanger = 0; arrayChanger < countOfElements; arrayChanger++)
        if (numbers[arrayChanger] != element)
          numbers[newArrayElements++] = numbers[arrayChanger];
      countOfElements = newArrayElements;
    }
  }
  printf("Noviy masiv: \n");
  for (int currentElement = 0; currentElement < countOfElements; currentElement++)
    if (currentElement % 4 == 0 && currentElement != 0)
      printf("%d\n", numbers[currentElement]);
    else
      printf("%d ", numbers[currentElement]);
  system("PAUSE");
  return 0;
}
```