user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D24(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    D13(%rip),%r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%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     L71
L24:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L24
L71:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L38
L137:
  lea    0x3(%rsp),%r13
  lea    D54(%rip),%rdi
  mov    %r13,%rax
  and    $0xfffffffffffffffc,%r13
  shr    $0x2,%rax
  mov    %rax,-0x48(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  jle    L36
  mov    %r13,%rbx
  mov    %r13,%r15
  xor    %r12d,%r12d
  cs nopw 0x0(%rax,%rax,1)
L189:
  mov    %r15,%rsi
  mov    %r14,%rdi
  add    $0x1,%r12d
  add    $0x4,%r15
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    %r12d,%eax
  jg     L189
  mov    -0x48(%rbp),%rdx
  mov    0x0(,%rdx,4),%r12d
  test   %eax,%eax
  jle    L116
  lea    -0x1(%rax),%edx
  cmp    $0x2,%edx
  jbe    L104
  mov    %eax,%ecx
  movd   %r12d,%xmm3
  mov    %r13,%rdx
  shr    $0x2,%ecx
  pshufd $0x0,%xmm3,%xmm2
  shl    $0x4,%rcx
  add    %r13,%rcx
  nopl   0x0(%rax)
L159:
  movdqu (%rdx),%xmm0
  add    $0x10,%rdx
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  por    %xmm0,%xmm2
  cmp    %rcx,%rdx
  jne    L159
  movdqa %xmm2,%xmm1
  mov    %eax,%ecx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%ecx
  movdqa %xmm1,%xmm0
  pcmpgtd %xmm2,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movd   %xmm1,%edx
  test   $0x3,%al
  je     L67
L135:
  movslq %ecx,%rsi
  lea    0x0(%r13,%rsi,4),%rsi
  mov    (%rsi),%edi
  cmp    %edi,%edx
  cmovl  %edi,%edx
  lea    0x1(%rcx),%edi
  cmp    %eax,%edi
  jge    L67
  mov    0x4(%rsi),%edi
  cmp    %edi,%edx
  cmovl  %edi,%edx
  add    $0x2,%ecx
  cmp    %ecx,%eax
  jle    L67
  mov    0x8(%rsi),%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
L67:
  lea    0x0(%r13,%rax,4),%rcx
  cs nopw 0x0(%rax,%rax,1)
L180:
  mov    (%rbx),%eax
  cmp    %r12d,%eax
  jl     L57
  cmp    %edx,%eax
  cmovl  %eax,%r12d
L57:
  add    $0x4,%rbx
  cmp    %rcx,%rbx
  jne    L180
L116:
  lea    D56(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    -0x3c(%rbp),%eax
  test   %eax,%eax
  jle    L74
  xor    %ebx,%ebx
  lea    D47(%rip),%r14
  nopl   0x0(%rax)
L70:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,-0x3c(%rbp)
  jg     L70
L74:
  lea    D45(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  mov    %r12d,%esi
  lea    D44(%rip),%rdi
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L38:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L137
L36:
  mov    -0x48(%rbp),%rax
  mov    0x0(,%rax,4),%r12d
  jmp    L116
L104:
  mov    %r12d,%edx
  xor    %ecx,%ecx
  jmp    L135
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D24
data_type: string
name: parse_data
arguments: tag: D13
data_type: string
name: parse_data
arguments: tag: D54
data_type: string
name: parse_data
arguments: tag: D56
data_type: string
name: parse_data
arguments: tag: D47
data_type: string
name: parse_data
arguments: tag: D45
data_type: string
name: parse_data
arguments: tag: D44
data_type: string

tool: D24: Enter the length of the array: 

tool: D13: %d

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


tool: D56: The Array: 
{

tool: D47:   %d

tool: D45: }

tool: D44: 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);
}
```