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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D55(%rip),%rdi
  mov    %rsp,%rbp
  push   %r14
  lea    D36(%rip),%r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x30(%rbp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  movslq -0x30(%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     L98
L142:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L142
L98:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L22
L137:
  xor    %eax,%eax
  lea    D30(%rip),%rdi
  mov    %rsp,%r13
  call   <printf@plt>
  cmpl   $0x0,-0x30(%rbp)
  jle    L67
  mov    %r13,%r12
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L52:
  mov    %r12,%rsi
  mov    %r14,%rdi
  add    $0x1,%ebx
  add    $0x4,%r12
  call   <scanf@plt>
  cmp    %ebx,-0x30(%rbp)
  jg     L52
L67:
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    -0x2c(%rbp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  mov    -0x30(%rbp),%ebx
  sub    $0x1,%ebx
  js     L127
  mov    -0x2c(%rbp),%edx
  xor    %r12d,%r12d
  jmp    L86
  nopl   0x0(%rax)
L108:
  lea    0x1(%rsi),%r12d
  cmp    %r12d,%ebx
  jl     L127
L86:
  lea    (%rbx,%r12,1),%esi
  sar    %esi
  movslq %esi,%rax
  cmp    %edx,0x0(%r13,%rax,4)
  jl     L108
  je     L133
  lea    -0x1(%rsi),%ebx
  cmp    %r12d,%ebx
  jge    L86
L127:
  lea    D40(%rip),%rdi
  call   <puts@plt>
L64:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopl   (%rax)
L133:
  add    $0x1,%esi
  xor    %eax,%eax
  lea    D14(%rip),%rdi
  call   <printf@plt>
  cmp    %r12d,%ebx
  jge    L64
  jmp    L127
L22:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L137
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D55
data_type: string
name: read_data
arguments: data_label: D36
data_type: string
name: read_data
arguments: data_label: D30
data_type: string
name: read_data
arguments: data_label: D6
data_type: string
name: read_data
arguments: data_label: D40
data_type: string
name: read_data
arguments: data_label: D14
data_type: string

tool: D55: Enter the length of the array: 

tool: D36: %d

tool: D30: Enter %d elements of the array in ascending order: 


tool: D6: Enter number to find: 

tool: D40: Not found

tool: D14: Found at location %d.


assistant: ```c
int main() {
  int i, first, last, mid, length, number;
  printf("Enter the length of the array: ");
  scanf("%d", &length);
  int array[length];
  printf("Enter %d elements of the array in ascending order: \n", length);
  for (i = 0; i < length; i++)
    scanf("%d", &array[i]);
  printf("Enter number to find: ");
  scanf("%d", &number);
  first = 0;
  last = length - 1;
  while (first <= last) {
    mid = (first + last) / 2;
    if (array[mid] < number)
      first = mid + 1;
    else if (array[mid] == number) {
      printf("Found at location %d.\n", mid + 1);
      break;
    } else
      last = mid - 1;
  }
  if (first > last)
    printf("Not found\n");
}
```