#!/bin/bash

if [ $# -eq 0 ]; then
  echo "No arguments supplied"
  exit 1
fi

arch=$1

# Import the config
. ./config.sh

if [ ! -d $matching_dir ]; then
  mkdir $matching_dir;
fi

cd $arch

for filename in *
do
  echo -e "\nAnalyzing binary: $filename"
  $matching_script_dir/compare-functions.py $ida_json_dir/$filename.stripped.json.ida $revng_json_dir/$filename.ll.isolated.json.revng $filename $matching_dir/$filename $matching_dir/$filename.matching
done;
