skip=0
win=76105
count=$win
while true; do
  win1=$(( ($win/2) + 2 ))

  skip1=$(( $skip ))
  skip2=$(( $skip + $win1 - 1 ))

  echo "analyze range start $skip1 win $win1"

  if [ $win1 -le 3 -o $skip1 -ge $count ]; then
    exit 0
  fi

  if dd if=2682-1444613756.bits bs=4096 count=$win1 skip=$skip1 | tetrapol_dump -t TCH 2>&1 | grep -q "EY_REFERENCE: KEY_TYPE=0 KEY_INDEX=0"; then
    echo FOUND in $win blocks at $skip1
    skip=$skip1
  else
    echo NOT FOUND in $win blocks at $skip1
    skip=$skip2
  fi

  win=$win1

done
