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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  movdqa D56(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D5(%rip),%rax
  movaps %xmm0,0x10(%rsp)
  movdqa D65(%rip),%xmm0
  mov    %rax,0x30(%rsp)
  movaps %xmm0,0x20(%rsp)
  cmp    $0x1,%edi
  jle    L45
  mov    %rsi,%rbx
  mov    $0x5,%edx
  mov    $0xa,%esi
  xor    %eax,%eax
  lea    D6(%rip),%rdi
  xor    %r12d,%r12d
  mov    $0x9,%ebp
  mov    $0x5,%r13d
  call   <printf@plt>
  mov    0x8(%rbx),%rdi
  xor    %ebx,%ebx
  lea    D40(%rip),%r14
  lea    D81(%rip),%r15
  call   <atoi@plt>
  mov    %eax,0xc(%rsp)
  nopw   0x0(%rax,%rax,1)
L74:
  mov    %r13d,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r12d
  call   <printf@plt>
  movslq %r13d,%rax
  mov    0xc(%rsp),%ecx
  cmp    %ecx,0x10(%rsp,%rax,4)
  je     L59
  jle    L69
  lea    -0x1(%r13),%ebp
  mov    %r15,%rdi
  lea    0x0(%rbp,%rbx,1),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  xor    %eax,%eax
  sar    %edx
  mov    %edx,%esi
  mov    %edx,%r13d
  call   <printf@plt>
  cmp    %ebx,%ebp
  jge    L74
L70:
  lea    D20(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
L22:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L69:
  lea    0x1(%r13),%ebx
  mov    %r15,%rdi
  lea    (%rbx,%rbp,1),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %eax,%edx
  xor    %eax,%eax
  sar    %edx
  mov    %edx,%esi
  mov    %edx,%r13d
  call   <printf@plt>
  cmp    %ebp,%ebx
  jle    L74
  jmp    L70
L59:
  mov    0xc(%rsp),%esi
  mov    %r12d,%ecx
  mov    %r13d,%edx
  xor    %eax,%eax
  lea    D17(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L22
L45:
  lea    D87(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L22
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D56
type: byte[16]
name: parse_data
arguments: tag: D5
type: byte[8]
name: parse_data
arguments: tag: D65
type: byte[16]
name: parse_data
arguments: tag: D6
type: string
name: parse_data
arguments: tag: D40
type: string
name: parse_data
arguments: tag: D81
type: string
name: parse_data
arguments: tag: D20
type: string
name: parse_data
arguments: tag: D17
type: string
name: parse_data
arguments: tag: D87
type: string

tool: {"D56": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D5": [0x09,0x00,0x00,0x00,0x0a,0x00,0x00,0x00]}

tool: {"D65": [0x05,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x08,0x00,0x00,0x00]}

tool: D6: cnt = %d, initial index %d


tool: D40: pre index %d


tool: D81: post index %d


tool: D20: not found

tool: D17: found %d, index %d, search %d times


tool: D87: please pass at least one parmeter

assistant: ```c
int main(int argc, char **argv) {
  int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int cnt = sizeof(array) / sizeof(int);
  int index = cnt / 2;
  int target;
  int start = 0, end = cnt - 1;
  int i = 0;
  if (argc < 2) {
    printf("please pass at least one parmeter\n");
    return -1;
  }
  printf("cnt = %d, initial index %d\n", cnt, index);
  target = atoi(argv[1]);
  while (start <= end) {
    i++;
    printf("pre index %d\n", index);
    if (array[index] == target) {
      printf("found %d, index %d, search %d times\n", target, index, i);
      return 0;
    } else if (array[index] > target) {
      end = index - 1;
    } else {
      start = index + 1;
    }
    index = (start + end) / 2;
    printf("post index %d\n", index);
  }
  printf("not found\n");
  return 0;
}
```