user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D54(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x50(%rbp),%rax
  mov    %rax,%rsi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x48(%rbp)
  jmp    L15
L165:
  lea    -0x30(%rbp),%rdx
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x48(%rbp)
L15:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L165
  movl   $0x0,-0x48(%rbp)
  jmp    L66
L0:
  movl   $0x0,-0x44(%rbp)
  jmp    L46
L10:
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jle    L27
  mov    -0x44(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x44(%rbp),%eax
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  mov    -0x44(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x34(%rbp),%edx
  mov    %edx,-0x30(%rbp,%rax,4)
L27:
  addl   $0x1,-0x44(%rbp)
L46:
  mov    -0x50(%rbp),%eax
  sub    -0x48(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L10
  addl   $0x1,-0x48(%rbp)
L66:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L0
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x48(%rbp)
  jmp    L157
L90:
  mov    -0x48(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x48(%rbp)
L157:
  mov    -0x50(%rbp),%eax
  cmp    %eax,-0x48(%rbp)
  jl     L90
  lea    D96(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x4c(%rbp),%rax
  mov    %rax,%rsi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x1,-0x40(%rbp)
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L146:
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%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    -0x4c(%rbp),%eax
  cmp    %eax,%edx
  jle    L100
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x3c(%rbp)
  jmp    L37
L100:
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x4c(%rbp),%eax
  cmp    %eax,%edx
  jge    L37
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x40(%rbp)
L37:
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x4c(%rbp),%eax
  cmp    %eax,%edx
  je     L159
  mov    -0x40(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jle    L146
L159:
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x4c(%rbp),%eax
  cmp    %eax,%edx
  jne    L3
  lea    D75(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D100(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L25
L3:
  lea    D72(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L25:
  mov    $0x0,%eax
  call   <getch@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L118
  call   <__stack_chk_fail@plt>
L118:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D54
data_type: string
name: parse_data
arguments: label: D1
data_type: string
name: parse_data
arguments: label: D94
data_type: string
name: parse_data
arguments: label: D19
data_type: string
name: parse_data
arguments: label: D95
data_type: string
name: parse_data
arguments: label: D96
data_type: string
name: parse_data
arguments: label: D75
data_type: string
name: parse_data
arguments: label: D100
data_type: string
name: parse_data
arguments: label: D72
data_type: string

tool: D54: Enter the value of num 

tool: D1: %d

tool: D94: Enter the elements one by one 

tool: D19: Sorted array is...

tool: D95: %d


tool: D96: Enter the element to be searched 

tool: D75: SEARCH SUCCESSFUL 

tool: D100: Number Located at position:%d 

tool: D72: SEARCH FAILED! 
 Number not found.

assistant: ```c
void main() {
  int array[10];
  int i, j, num, temp, keynum;
  int low, mid, high;
  printf("Enter the value of num \n");
  scanf("%d", &num);
  printf("Enter the elements one by one \n");
  for (i = 0; i < num; i++) {
    scanf("%d", &array[i]);
  }
  for (i = 0; i < num; i++) {
    for (j = 0; j < (num - i - 1); j++) {
      if (array[j] > array[j + 1]) {
        temp = array[j];
        array[j] = array[j + 1];
        array[j + 1] = temp;
      }
    }
  }
  printf("Sorted array is...\n");
  for (i = 0; i < num; i++) {
    printf("%d\n", array[i]);
  }
  printf("Enter the element to be searched \n");
  scanf("%d", &keynum);
  low = 1;
  high = num;
  do {
    mid = (low + high) / 2;
    if (keynum < array[mid])
      high = mid - 1;
    else if (keynum > array[mid])
      low = mid + 1;
  } while (keynum != array[mid] && low <= high);
  if (keynum == array[mid]) {
    printf("SEARCH SUCCESSFUL \n");
    printf("Number Located at position:%d ", mid + 1);
  } else {
    printf("SEARCH FAILED! \n Number not found.");
  }
  getch();
}
```