user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D5(%rip),%rdi
  call   <printf@plt>
  lea    -0x3c(%rbp),%rsi
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  lea    D38(%rip),%rdi
  call   <puts@plt>
  mov    -0x3c(%rbp),%ecx
  movslq %ecx,%rax
  shl    $0x2,%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L139:
  cmp    %rsi,%rsp
  je     L63
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L139
L63:
  mov    %rdi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L141
  orq    $0x0,-0x8(%rsp,%rdx,1)
L141:
  mov    %rsp,%r12
  add    $0xf,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L58:
  cmp    %rdx,%rsp
  je     L62
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L58
L62:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L233
  orq    $0x0,-0x8(%rsp,%rax,1)
L233:
  mov    %rsp,%rbx
  test   %ecx,%ecx
  jle    L122
  mov    %r12,%r15
  mov    $0x0,%r14d
L76:
  mov    %r15,%rsi
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  movl   $0x0,(%rbx,%r14,4)
  mov    -0x3c(%rbp),%edi
  add    $0x1,%r14
  add    $0x4,%r15
  cmp    %r14d,%edi
  jg     L76
  test   %edi,%edi
  jle    L122
  lea    -0x1(%rdi),%r8d
  mov    $0x0,%edx
  lea    -0x2(%rdi),%esi
  add    $0x2,%rsi
  jmp    L0
L195:
  mov    %ecx,%r13d
L61:
  add    $0x1,%rax
  cmp    %rsi,%rax
  je     L22
L228:
  cmpl   $0x1,(%rbx,%rax,4)
  je     L61
  mov    (%r12,%rdx,4),%ecx
  cmp    %ecx,(%r12,%rax,4)
  jne    L195
  cmp    %edx,%eax
  je     L195
  movl   $0x1,(%rbx,%rdx,4)
  movl   $0x1,(%rbx,%rax,4)
  jmp    L61
L22:
  lea    0x1(%rdx),%rax
  cmp    %r8,%rdx
  je     L166
  mov    %rax,%rdx
L0:
  cmpl   $0x1,(%rbx,%rdx,4)
  je     L22
  cmp    $0x1,%edi
  jle    L22
  mov    $0x1,%eax
  jmp    L228
L166:
  mov    $0x0,%eax
  jmp    L93
L15:
  lea    0x1(%rax),%rdx
  cmp    %r8,%rax
  je     L122
  mov    %rdx,%rax
L93:
  mov    (%r12,%rax,4),%edx
  cmp    %r13d,%edx
  jle    L15
  cmpl   $0x0,(%rbx,%rax,4)
  cmove  %edx,%r13d
  jmp    L15
L122:
  mov    %r13d,%esi
  lea    D40(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D3(%rip),%rdi
  call   <system@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L186
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L186:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D5
type_guessed: string
name: retrieve_data
arguments: data_label: D1
type_guessed: string
name: retrieve_data
arguments: data_label: D38
type_guessed: string
name: retrieve_data
arguments: data_label: D40
type_guessed: string
name: retrieve_data
arguments: data_label: D3
type_guessed: string

tool: D5: Vvedit kilkist elementiv masivy -> 

tool: D1: %d

tool: D38: Vvedit elementy masivy

tool: D40: Max element z masiva(bez povtoren): %d

tool: D3: PAUSE

assistant: ```c
int main(int argc, char *argv[]) {
  int countOfElements;
  printf("Vvedit kilkist elementiv masivy -> ");
  scanf("%d", &countOfElements);
  printf("Vvedit elementy masivy\n");
  int numbers[countOfElements], check[countOfElements], maxElement;
  for (int currentElement = 0; currentElement < countOfElements; currentElement++) {
    scanf("%d", &numbers[currentElement]);
    check[currentElement] = 0;
  };
  for (int currentElement = 0; currentElement < countOfElements; currentElement++) {
    if (check[currentElement] == 1)
      continue;
    for (int nextElement = 1; nextElement < countOfElements; nextElement++) {
      if (check[nextElement] == 1)
        continue;
      if (numbers[currentElement] == numbers[nextElement] && currentElement != nextElement) {
        check[currentElement] = 1;
        check[nextElement] = 1;
      } else
        maxElement = numbers[currentElement];
    }
  }
  for (int currentElement = 0; currentElement < countOfElements; currentElement++)
    if (maxElement < numbers[currentElement] && check[currentElement] == 0)
      maxElement = numbers[currentElement];
  printf("Max element z masiva(bez povtoren): %d", maxElement);
  system("PAUSE");
  return 0;
}
```