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

```asm
<is_binary>:
  endbr64
  push   %r15
  mov    %rdx,%r11
  push   %r14
  push   %r13
  movzbl (%rdi),%r13d
  push   %r12
  push   %rbp
  push   %rbx
  test   %esi,%esi
  jle    L105
  lea    -0x2b(%r13),%r8d
  xor    %eax,%eax
  movslq %esi,%rsi
  xor    %edx,%edx
  and    $0xfffffffd,%r8d
  xor    %ecx,%ecx
  mov    $0xffffffff,%r10d
  xor    %r9d,%r9d
  mov    %r8b,-0x1(%rsp)
  mov    $0x39,%ebx
  mov    $0x4,%ebp
  mov    %eax,%r14d
  mov    $0x5,%r12d
  cmp    $0x28,%r13b
  je     L59
  nopl   0x0(%rax)
L117:
  xor    %r8d,%r8d
  cmp    $0x29,%r13b
  sete   %r8b
  sub    %r8d,%edx
L23:
  test   %edx,%edx
  jg     L166
  cmp    $0x2d,%r13b
  je     L64
  jg     L58
  cmp    $0x2a,%r13b
  je     L139
  cmp    $0x2b,%r13b
  jne    L156
  movabs $0xffff53fffffffffe,%r15
  cmp    $0x5e,%cl
  setne  %r8b
  sar    %cl,%r15
  mov    %r8d,%r13d
  and    %r15d,%r8d
  cmp    $0x30,%cl
  mov    $0x2b,%ecx
  cmovae %r13d,%r8d
  test   %r8b,%r8b
  mov    $0x1,%r8d
  cmovne %r14d,%r10d
  cmovne %r8d,%r9d
  nopl   0x0(%rax)
L166:
  add    $0x1,%rax
  cmp    %rsi,%rax
  je     L6
L76:
  movzbl (%rdi,%rax,1),%r13d
  mov    %eax,%r14d
  cmp    $0x28,%r13b
  jne    L117
L59:
  add    $0x1,%edx
  jmp    L23
  nopl   0x0(%rax,%rax,1)
L58:
  cmp    $0x2f,%r13b
  je     L140
  cmp    $0x5e,%r13b
  jne    L156
  mov    $0x5e,%ecx
  test   %r9d,%r9d
  jne    L166
  cmpb   $0x0,-0x1(%rsp)
  cmovne %r14d,%r10d
  cmovne %r12d,%r9d
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L76
L6:
  pop    %rbx
  mov    %r9d,%eax
  pop    %rbp
  mov    %r10d,(%r11)
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L140:
  mov    %r9d,%ecx
  mov    %rbx,%r8
  shr    %cl,%r8
  mov    $0x2f,%ecx
  and    $0x1,%r8d
  cmovne %r14d,%r10d
  cmovne %ebp,%r9d
  jmp    L166
  nop
L139:
  mov    %r9d,%ecx
  mov    %rbx,%r8
  shr    %cl,%r8
  mov    $0x2a,%ecx
  and    $0x1,%r8d
  mov    $0x3,%r8d
  cmovne %r14d,%r10d
  cmovne %r8d,%r9d
  jmp    L166
  nopl   (%rax)
L64:
  movabs $0xffff53fffffffffe,%r15
  cmp    $0x5e,%cl
  setne  %r8b
  sar    %cl,%r15
  mov    %r8d,%r13d
  and    %r15d,%r8d
  cmp    $0x30,%cl
  mov    $0x2,%r15d
  cmovae %r13d,%r8d
  mov    $0x2d,%ecx
  test   %r8b,%r8b
  cmovne %r14d,%r10d
  cmovne %r15d,%r9d
  jmp    L166
  nopl   0x0(%rax)
L105:
  mov    $0xffffffff,%r10d
  xor    %r9d,%r9d
  jmp    L6
L156:
  mov    %r13d,%ecx
  jmp    L166
```

assistant: ```c
int is_binary(const char *string, int length, int *bindex) {
  int op = 0, op_index = -1;
  char c, p = '\0';
  int i, pcount = 0;
  char str0 = string[0];
  for (i = 0; i < length; i++) {
    c = string[i];
    if (c == '(') {
      pcount++;
    } else if (c == ')') {
      pcount--;
    }
    if (pcount > 0)
      continue;
    if (c == '+') {
      if (p != '*' && p != '/' && p != '+' && p != '-' && p != '^' && p != '\0') {
        op = 1;
        op_index = i;
      }
    } else if (c == '-') {
      if (p != '*' && p != '/' && p != '+' && p != '-' && p != '^' && p != '\0') {
        op = 2;
        op_index = i;
      }
    } else if (c == '*') {
      if (op == 0 || op == 3 || op == 4 || op == 5) {
        op = 3;
        op_index = i;
      }
    } else if (c == '/') {
      if (op == 0 || op == 3 || op == 4 || op == 5) {
        op = 4;
        op_index = i;
      }
    } else if (c == '^') {
      if (op == 0 && (str0 != '-' && str0 != '+')) {
        op = 5;
        op_index = i;
      }
    }
    p = c;
  }
  *bindex = op_index;
  return op;
}
```