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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D59(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    D5(%rip),%r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x3c(%rbp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%rsi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L168
L68:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L68
L168:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L78
L143:
  lea    0x3(%rsp),%r13
  xor    %eax,%eax
  lea    D69(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%r15
  and    $0xfffffffffffffffc,%r13
  shr    $0x2,%r15
  cmpl   $0x0,-0x3c(%rbp)
  jle    L157
  mov    %r13,%r12
  xor    %ebx,%ebx
  xchg   %ax,%ax
L138:
  mov    %r12,%rsi
  mov    %r14,%rdi
  add    $0x1,%ebx
  add    $0x4,%r12
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    %ebx,%eax
  jg     L138
  mov    0x0(,%r15,4),%edi
  test   %eax,%eax
  jle    L134
  lea    0x4(%r13),%rdx
  lea    0x0(%r13,%rax,4),%r8
  mov    %edi,%esi
  mov    %edi,%eax
  mov    %rdx,%rcx
  jmp    L103
  nopl   0x0(%rax,%rax,1)
L24:
  mov    (%rcx),%esi
  add    $0x4,%rcx
L103:
  cmp    %esi,%eax
  cmovl  %esi,%eax
  cmp    %r8,%rcx
  jne    L24
  mov    %edi,%r12d
  jmp    L67
  nopl   (%rax)
L73:
  cmp    %edi,%r12d
  jl     L119
  cmp    %r8,%rdx
  je     L166
L1:
  mov    (%rdx),%ecx
  mov    %r12d,%edi
  add    $0x4,%rdx
  mov    %ecx,%r12d
L67:
  cmp    %r12d,%eax
  jg     L73
L119:
  mov    %edi,%r12d
  cmp    %r8,%rdx
  jne    L1
L166:
  lea    D11(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  mov    -0x3c(%rbp),%eax
  lea    D65(%rip),%r14
  test   %eax,%eax
  jle    L30
  nopl   0x0(%rax)
L120:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,-0x3c(%rbp)
  jg     L120
L30:
  lea    D32(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  lea    D45(%rip),%rdi
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L78:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L143
L157:
  mov    0x0(,%r15,4),%edi
L134:
  mov    %edi,%r12d
  jmp    L166
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D59
type_infered: string
name: disassemble_data
arguments: data_tag: D5
type_infered: string
name: disassemble_data
arguments: data_tag: D69
type_infered: string
name: disassemble_data
arguments: data_tag: D11
type_infered: string
name: disassemble_data
arguments: data_tag: D65
type_infered: string
name: disassemble_data
arguments: data_tag: D32
type_infered: string
name: disassemble_data
arguments: data_tag: D45
type_infered: string

tool: D59: Enter the length of the array: 

tool: D5: %d

tool: D69: Enter %d elements of the array: 


tool: D11: The Array: 
{

tool: D65:   %d

tool: D32: }

tool: D45: Second largest element: %d


assistant: ```c
int main() {
  int i, length, largest, secLargest;
  printf("Enter the length of the array: ");
  scanf("%d", &length);
  int arr[length];
  printf("Enter %d elements of the array: \n", length);
  for (i = 0; i < length; i++)
    scanf("%d", &arr[i]);
  secLargest = largest = arr[0];
  for (i = 0; i < length; i++)
    if (largest <= arr[i])
      largest = arr[i];
  for (i = 0; i < length; i++)
    if (secLargest <= arr[i] && arr[i] < largest)
      secLargest = arr[i];
  printf("The Array: \n{");
  for (i = 0; i < length; i++)
    printf("  %d", arr[i]);
  printf("}\n");
  printf("Second largest element: %d\n", secLargest);
}
```