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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x50(%rbp)
  jmp    L44
L58:
  lea    -0x30(%rbp),%rdx
  mov    -0x50(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x50(%rbp)
L44:
  mov    -0x58(%rbp),%eax
  cmp    %eax,-0x50(%rbp)
  jl     L58
  movl   $0x0,-0x50(%rbp)
  jmp    L153
L1:
  mov    -0x50(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  jmp    L54
L101:
  mov    -0x50(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x4c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jle    L15
  mov    -0x50(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x50(%rbp),%eax
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  mov    -0x4c(%rbp),%eax
  cltq
  mov    -0x34(%rbp),%edx
  mov    %edx,-0x30(%rbp,%rax,4)
L15:
  addl   $0x1,-0x4c(%rbp)
L54:
  mov    -0x58(%rbp),%eax
  cmp    %eax,-0x4c(%rbp)
  jl     L101
  addl   $0x1,-0x50(%rbp)
L153:
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x50(%rbp)
  jl     L1
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x50(%rbp)
  jmp    L51
L42:
  mov    -0x50(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x50(%rbp)
L51:
  mov    -0x58(%rbp),%eax
  cmp    %eax,-0x50(%rbp)
  jl     L42
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x54(%rbp),%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x44(%rbp)
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x40(%rbp)
  jmp    L96
L59:
  mov    -0x44(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x54(%rbp),%eax
  cmp    %eax,%edx
  jne    L70
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  movl   $0x1,-0x3c(%rbp)
  jmp    L138
L70:
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x54(%rbp),%eax
  cmp    %eax,%edx
  jle    L2
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x40(%rbp)
  jmp    L96
L2:
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x44(%rbp)
L96:
  mov    -0x44(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L59
L138:
  cmpl   $0x0,-0x3c(%rbp)
  je     L133
  mov    -0x48(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x54(%rbp),%eax
  mov    %eax,%esi
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L47
L133:
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L47:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L99
  call   <__stack_chk_fail@plt>
L99:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D83
type_infered: string
name: read_data
arguments: data_tag: D48
type_infered: string
name: read_data
arguments: data_tag: D31
type_infered: string
name: read_data
arguments: data_tag: D25
type_infered: string
name: read_data
arguments: data_tag: D11
type_infered: string
name: read_data
arguments: data_tag: D1
type_infered: string
name: read_data
arguments: data_tag: D40
type_infered: string
name: read_data
arguments: data_tag: D47
type_infered: string

tool: D83: 
Enter no of elements

tool: D48: %d

tool: D31: 
Enter the elements

tool: D25: 
The Sorted array is 

tool: D11: %d	

tool: D1: 
Enter the Key element

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


tool: D47: 
Key element not found

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;
}
```