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

```asm
<cmp_barker>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1c(%rbp)
  movl   $0x4,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L459:
  cmpl   $0x0,-0x18(%rbp)
  jne    L46
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L452
  mov    $0xfffffffe,%eax
  jmp    L214
L452:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L986
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L986:
  movl   $0x1,-0x18(%rbp)
  jmp    L363
L46:
  cmpl   $0x1,-0x18(%rbp)
  jne    L433
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L993
  mov    $0xfffffffe,%eax
  jmp    L214
L993:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L946
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L946:
  movl   $0x2,-0x18(%rbp)
  jmp    L363
L433:
  cmpl   $0x2,-0x18(%rbp)
  jne    L614
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L603
  mov    $0xfffffffe,%eax
  jmp    L214
L603:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L334
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L334:
  movl   $0x3,-0x18(%rbp)
  jmp    L363
L614:
  cmpl   $0x3,-0x18(%rbp)
  jne    L83
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L104
  mov    $0xfffffffe,%eax
  jmp    L214
L104:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L587
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L587:
  movl   $0x4,-0x18(%rbp)
  jmp    L363
L83:
  cmpl   $0x4,-0x18(%rbp)
  jne    L246
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L616
  mov    $0xfffffffe,%eax
  jmp    L214
L616:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L728
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L728:
  movl   $0x5,-0x18(%rbp)
  jmp    L363
L246:
  cmpl   $0x5,-0x18(%rbp)
  jne    L703
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L538
  mov    $0xfffffffe,%eax
  jmp    L214
L538:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L623
  movl   $0x5,-0x18(%rbp)
  jmp    L363
L623:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L703
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L703:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L710
  mov    $0xfffffffe,%eax
  jmp    L214
L710:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L488
  movl   $0x1,-0x18(%rbp)
  jmp    L363
L488:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L229
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L229:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L790
  mov    $0xfffffffe,%eax
  jmp    L214
L790:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L365
  movl   $0x1,-0x18(%rbp)
  jmp    L363
L365:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L905
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L905:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L740
  mov    $0xfffffffe,%eax
  jmp    L214
L740:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L724
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L724:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L776
  mov    $0xfffffffe,%eax
  jmp    L214
L776:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L933
  movl   $0x2,-0x18(%rbp)
  jmp    L363
L933:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L481
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L481:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L1029
  mov    $0xfffffffe,%eax
  jmp    L214
L1029:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L857
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L857:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L917
  mov    $0xfffffffe,%eax
  jmp    L214
L917:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L983
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L983:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L594
  mov    $0xfffffffe,%eax
  jmp    L214
L594:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L86
  movl   $0x3,-0x18(%rbp)
  jmp    L363
L86:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L593
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L593:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L544
  mov    $0xfffffffe,%eax
  jmp    L214
L544:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L762
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L762:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L2
  mov    $0xfffffffe,%eax
  jmp    L214
L2:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L511
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L511:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L320
  mov    $0xfffffffe,%eax
  jmp    L214
L320:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  je     L248
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L248:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L615
  mov    $0xfffffffe,%eax
  jmp    L214
L615:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L74
  movl   $0x4,-0x18(%rbp)
  jmp    L363
L74:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L654
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L654:
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  mov    -0x14(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L858
  mov    $0xfffffffe,%eax
  jmp    L214
L858:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  and    $0xfff8,%eax
  test   %eax,%eax
  jne    L989
  movl   $0x1,-0x18(%rbp)
  jmp    L363
L989:
  mov    -0x20(%rbp),%eax
  or     $0xffff0007,%eax
  cmp    $0xffffffff,%eax
  je     L976
  movl   $0x0,-0x18(%rbp)
  jmp    L363
L976:
  mov    -0x14(%rbp),%eax
  lea    (%rax,%rax,1),%esi
  mov    -0x14(%rbp),%ecx
  mov    -0x28(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread_bo@plt>
  cmp    $0x1,%eax
  je     L67
  mov    $0xfffffffe,%eax
  jmp    L214
L67:
  mov    $0x0,%eax
  jmp    L214
L363:
  cmpl   $0x3a97,-0x1c(%rbp)
  jle    L459
  mov    $0xffffffff,%eax
L214:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L645
  call   <__stack_chk_fail@plt>
L645:
  leave
  ret
```

assistant: ```c
int cmp_barker(FILE *fp) {
  int word, ncount = 0, wsize = sizeof(int), buf[2], state = 0;
  while (ncount < 15000) {
    if (state == 0) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) != 0x00000000) {
        state = 0;
        continue;
      } else {
        state = 1;
        continue;
      }
    }
    if (state == 1) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) != 0x00000000) {
        state = 0;
        continue;
      } else {
        state = 2;
        continue;
      }
    }
    if (state == 2) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) != 0x00000000) {
        state = 0;
        continue;
      } else {
        state = 3;
        continue;
      }
    }
    if (state == 3) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) != 0x00000000) {
        state = 0;
        continue;
      } else {
        state = 4;
        continue;
      }
    }
    if (state == 4) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) != 0x00000000) {
        state = 0;
        continue;
      } else {
        state = 5;
        continue;
      }
    }
    if (state == 5) {
      if (1 != fread_bo(&word, wsize, 1, fp, wsize))
        return (-2);
      ncount++;
      if ((word & 0x0000fff8) == 0x00000000) {
        state = 5;
        continue;
      } else if ((word | 0xffff0007) != 0xffffffff) {
        state = 0;
        continue;
      }
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 1;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 1;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 2;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 3;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) != 0x00000000) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 4;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(&word, wsize, 1, fp, wsize))
      return (-2);
    ncount++;
    if ((word & 0x0000fff8) == 0x00000000) {
      state = 1;
      continue;
    } else if ((word | 0xffff0007) != 0xffffffff) {
      state = 0;
      continue;
    }
    if (1 != fread_bo(buf, 2 * wsize, 1, fp, wsize))
      return (-2);
    return (0);
  }
  return (-1);
}
```