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

```asm
<main>:
  endbr64
  push   %r13
  lea    D10(%rip),%rdi
  push   %r12
  push   %rbp
  lea    D63(%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    D2(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  jle    L100
  lea    0x10(%rsp),%rbx
  xor    %r12d,%r12d
  mov    %rbx,%r13
  nopl   0x0(%rax)
L4:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12d
  add    $0x4,%r13
  call   <scanf@plt>
  mov    0x8(%rsp),%r9d
  cmp    %r12d,%r9d
  jg     L4
  cmp    $0x1,%r9d
  jle    L100
  lea    -0x2(%r9),%r10d
  mov    %rbx,%rsi
  mov    $0x1,%r8d
  add    $0x2,%r10
  lea    -0x1(%r9),%ebx
  lea    0x14(%rsp),%r11
  nopl   (%rax)
L158:
  cmp    %r8d,%r9d
  jle    L118
  mov    %ebx,%eax
  sub    %r8d,%eax
  lea    -0x1(%r8,%rax,1),%rax
  lea    (%r11,%rax,4),%rdi
  mov    %rsi,%rax
  xchg   %ax,%ax
L38:
  mov    (%rsi),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L115
  mov    %ecx,(%rsi)
  mov    %edx,0x4(%rax)
L115:
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L38
L118:
  add    $0x1,%r8
  add    $0x4,%rsi
  cmp    %r10,%r8
  jne    L158
L100:
  lea    D66(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L83
  xor    %r12d,%r12d
  lea    0x10(%rsp),%rbx
  lea    D33(%rip),%r13
  nopw   0x0(%rax,%rax,1)
L126:
  mov    (%rbx,%r12,4),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r12
  call   <printf@plt>
  cmp    %r12d,0x8(%rsp)
  jg     L126
L83:
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D73(%rip),%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%edx
  sub    $0x1,%edx
  js     L110
  mov    0xc(%rsp),%r8d
  xor    %ecx,%ecx
  jmp    L96
  xchg   %ax,%ax
L35:
  lea    -0x1(%rax),%edx
  cmp    %ecx,%edx
  jl     L110
L96:
  lea    (%rcx,%rdx,1),%eax
  sar    %eax
  movslq %eax,%rsi
  cmp    %r8d,0x10(%rsp,%rsi,4)
  je     L105
  jg     L35
  lea    0x1(%rax),%ecx
  cmp    %ecx,%edx
  jge    L96
L110:
  lea    D7(%rip),%rdi
  call   <puts@plt>
L9:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L108
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L105:
  lea    0x1(%rax),%edx
  mov    %r8d,%esi
  lea    D62(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L9
L108:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D10
type_infered: string
name: retrieve_data
arguments: data_tag: D63
type_infered: string
name: retrieve_data
arguments: data_tag: D2
type_infered: string
name: retrieve_data
arguments: data_tag: D66
type_infered: string
name: retrieve_data
arguments: data_tag: D33
type_infered: string
name: retrieve_data
arguments: data_tag: D73
type_infered: string
name: retrieve_data
arguments: data_tag: D7
type_infered: string
name: retrieve_data
arguments: data_tag: D62
type_infered: string

tool: D10: 
Enter no of elements

tool: D63: %d

tool: D2: 
Enter the elements

tool: D66: 
The Sorted array is 

tool: D33: %d	

tool: D73: 
Enter the Key element

tool: D7: 
Key element not found

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