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

```asm
<main>:
  endbr64
  push   %r13
  lea    D28(%rip),%rdi
  push   %r12
  push   %rbp
  lea    D7(%rip),%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    0x8(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    D54(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  jle    L193
  lea    0x10(%rsp),%r12
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L182:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x1,%ebx
  add    $0x4,%r12
  call   <scanf@plt>
  mov    0x8(%rsp),%edx
  cmp    %ebx,%edx
  jg     L182
L193:
  lea    -0x1(%rdx),%r9d
  test   %r9d,%r9d
  jle    L83
  lea    0x10(%rsp),%rax
  xor    %edi,%edi
  xchg   %ax,%ax
L16:
  mov    %edi,%ecx
  add    $0x1,%edi
  cmp    %edx,%edi
  jge    L170
  movq   (%rax),%xmm0
  pshufd $0xe5,%xmm0,%xmm2
  movd   %xmm0,%esi
  movd   %xmm2,%r8d
  pshufd $0xe1,%xmm0,%xmm1
  cmp    %esi,%r8d
  jge    L20
  movq   %xmm1,(%rax)
L20:
  lea    0x2(%rcx),%esi
  cmp    %edx,%esi
  jge    L170
  mov    (%rax),%esi
  mov    0x8(%rax),%r8d
  cmp    %esi,%r8d
  jge    L71
  mov    %r8d,(%rax)
  mov    %esi,0x8(%rax)
L71:
  lea    0x3(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0xc(%rax),%r8d
  cmp    %r8d,%esi
  jle    L206
  mov    %r8d,(%rax)
  mov    %esi,0xc(%rax)
L206:
  lea    0x4(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0x10(%rax),%r8d
  cmp    %r8d,%esi
  jle    L154
  mov    %r8d,(%rax)
  mov    %esi,0x10(%rax)
L154:
  lea    0x5(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0x14(%rax),%r8d
  cmp    %r8d,%esi
  jle    L45
  mov    %r8d,(%rax)
  mov    %esi,0x14(%rax)
L45:
  lea    0x6(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0x18(%rax),%r8d
  cmp    %r8d,%esi
  jle    L210
  mov    %r8d,(%rax)
  mov    %esi,0x18(%rax)
L210:
  lea    0x7(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0x1c(%rax),%r8d
  cmp    %r8d,%esi
  jle    L169
  mov    %r8d,(%rax)
  mov    %esi,0x1c(%rax)
L169:
  lea    0x8(%rcx),%esi
  cmp    %esi,%edx
  jle    L170
  mov    (%rax),%esi
  mov    0x20(%rax),%r8d
  cmp    %r8d,%esi
  jle    L95
  mov    %r8d,(%rax)
  mov    %esi,0x20(%rax)
L95:
  add    $0x9,%ecx
  cmp    %ecx,%edx
  jle    L170
  mov    (%rax),%ecx
  mov    0x24(%rax),%esi
  cmp    %esi,%ecx
  jle    L170
  mov    %esi,(%rax)
  mov    %ecx,0x24(%rax)
  cs nopw 0x0(%rax,%rax,1)
L170:
  add    $0x4,%rax
  cmp    %r9d,%edi
  jl     L16
L83:
  lea    D39(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L27
  xor    %ebx,%ebx
  lea    0x10(%rsp),%r13
  lea    D19(%rip),%r12
  nop
L311:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,0x8(%rsp)
  jg     L311
L27:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D69(%rip),%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%edx
  sub    $0x1,%edx
  js     L69
  mov    0xc(%rsp),%r8d
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L298:
  lea    (%rcx,%rdx,1),%eax
  sar    %eax
  movslq %eax,%rsi
  cmp    %r8d,0x10(%rsp,%rsi,4)
  je     L51
L203:
  jle    L148
  lea    -0x1(%rax),%edx
  cmp    %ecx,%edx
  jge    L298
L69:
  lea    D73(%rip),%rdi
  call   <puts@plt>
L313:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L143
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L148:
  lea    0x1(%rax),%ecx
  cmp    %edx,%ecx
  jg     L69
  lea    (%rcx,%rdx,1),%eax
  sar    %eax
  movslq %eax,%rsi
  cmp    %r8d,0x10(%rsp,%rsi,4)
  jne    L203
L51:
  lea    0x1(%rax),%edx
  mov    %r8d,%esi
  lea    D53(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L313
L143:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D28
data_type: string
name: extract_symbolic_data
arguments: tag: D7
data_type: string
name: extract_symbolic_data
arguments: tag: D54
data_type: string
name: extract_symbolic_data
arguments: tag: D39
data_type: string
name: extract_symbolic_data
arguments: tag: D19
data_type: string
name: extract_symbolic_data
arguments: tag: D69
data_type: string
name: extract_symbolic_data
arguments: tag: D73
data_type: string
name: extract_symbolic_data
arguments: tag: D53
data_type: string

tool: D28: 
Enter no of elements

tool: D7: %d

tool: D54: 
Enter the elements

tool: D39: 
The Sorted array is 

tool: D19: %d	

tool: D69: 
Enter the Key element

tool: D73: 
Key element not found

tool: D53: 
Key element %d found at position %d


assistant: ```c
int main(void) {
  int iNum, i, j, k, iaArr[10], iTemp, iKey, iPos, iLow, iHigh, iMid, iFound;
  printf("\nEnter no of elements\n");
  scanf("%d", &iNum);
  printf("\nEnter the elements\n");
  for (i = 0; i < iNum; i++)
    scanf("%d", &iaArr[i]);
  for (i = 0; i < iNum - 1; i++) {
    for (j = i + 1; j < iNum; j++) {
      if (iaArr[i] > iaArr[j]) {
        iTemp = iaArr[i];
        iaArr[i] = iaArr[j];
        iaArr[j] = iTemp;
      }
    }
  }
  printf("\nThe Sorted array is \n");
  for (i = 0; i < iNum; i++)
    printf("%d\t", iaArr[i]);
  printf("\n");
  printf("\nEnter the Key element\n");
  scanf("%d", &iKey);
  iFound = 0;
  iLow = 0;
  iHigh = iNum - 1;
  while (iLow <= iHigh) {
    iMid = (iLow + iHigh) / 2;
    if (iKey == iaArr[iMid]) {
      iPos = iMid;
      iFound = 1;
      break;
    } else if (iKey < iaArr[iMid])
      iHigh = iMid - 1;
    else
      iLow = iMid + 1;
  }
  if (iFound)
    printf("\nKey element %d found at position %d\n", iKey, iPos + 1);
  else
    printf("\nKey element not found\n");
  return 0;
}
```