print_banner=[320,322,323,325,328,328,328,328,328,328,328,328,328,328,329;5,40,5,5,5,1,1,1,1,40,1,40,1,40,30];
do_pause=[334,334,334,334,334,335,335,335,335,335,335,335,335,337;25,40,1,10,1,5,25,40,1,1,10,1,1,30];
fd_mcs_detect=[500,401,503,403,506,406,406,507,407,508,408,509,510,511,412,412,413,414,516,517,417,417,518,418,419,420,421,522,426,429,431,431,431,432,432,432,361,362,365,367,467,367,367,367,367,367,368,369,369,369,369,369,471,471,471,473,474,374,475,476,376,377,378,479,480,381,483,383,484,485,486,386,487,488,388,489,389,490,491,391,492,493,494,394,495,496,396,397,498,398,499;1,40,5,5,5,40,5,5,5,5,25,5,5,5,40,5,5,25,40,5,40,5,25,5,5,5,25,30,5,1,1,1,40,1,1,40,40,30,1,1,1,25,40,10,1,1,1,25,40,5,10,1,1,1,1,1,1,5,1,1,5,5,5,1,1,1,1,40,1,1,1,1,1,1,40,1,1,1,1,25,1,1,1,1,1,1,1,1,1,1,1];
fd_mcs_proc_info=[544,546,547,549,551,551,552,552,553,553,554,554,556,556,557,558,559,560;1,40,30,1,1,5,1,5,1,5,1,5,40,1,30,40,1,30];
fd_mcs_select=[603,568,569,572,574,577,577,577,577,577,578,578,579,581,582,584,588;30,5,5,5,1,25,40,1,10,1,1,5,40,5,30,5,5];
fd_mcs_intr=[1007,1007,1008,1009,1010,1010,1011,1016,1024,1024,1024,1024,1024,1024,1024,1024,1025,1027,627,630,1033,1034,1035,633,1037,636,636,636,636,636,636,636,637,637,638,1043,642,643,646,648,651,661,662,662,663,667,667,667,667,667,667,667,667,668,669,670,672,674,676,677,677,680,684,685,686,686,687,689,689,689,693,693,693,693,693,693,693,693,694,695,897,696,898,898,899,899,900,900,901,901,902,902,903,903,702,904,904,905,905,906,906,705,706,908,908,707,909,909,910,910,911,911,912,912,711,913,913,914,914,915,915,916,916,917,917,716,716,918,918,718,920,920,921,921,720,922,922,923,923,722,722,924,924,723,723,723,926,926,928,928,727,929,929,728,728,729,729,931,931,730,731,933,933,733,935,734,734,936,735,735,937,736,737,939,939,940,940,739,740,740,942,741,741,943,944,948,949,949,949,949,949,949,750,751,751,953,752,954,753,955,754,754,755,755,959,960,759,760,962,962,962,963,965,966,967,766,968,969,970,770,770,770,973,974,975,976,977,977,978,980,983,984,984,984,984,984,984,988,989,990,994,995,996,996,996,996,997,999,1000,1001,1002,1003,1004;40,40,1,1,1,5,1,40,25,25,5,5,10,1,10,1,5,5,1,1,40,5,5,1,5,25,40,1,1,1,10,1,40,5,25,30,40,30,1,5,40,40,1,5,40,25,25,5,5,10,1,10,1,5,5,30,1,5,5,5,5,5,30,40,1,5,40,40,5,5,25,25,5,5,10,1,10,1,5,5,40,30,25,40,25,40,25,40,25,40,25,40,25,40,5,25,40,25,40,25,40,1,5,25,40,5,25,40,25,40,25,40,25,40,30,25,40,25,40,25,40,25,40,25,40,1,5,25,40,40,25,40,25,40,40,25,40,25,40,25,40,25,40,5,1,1,25,40,25,40,25,25,40,25,40,40,40,25,40,1,5,25,40,25,1,25,40,5,40,40,25,1,5,25,40,25,1,25,25,40,1,1,5,5,25,40,25,40,1,5,10,1,25,25,40,40,5,1,25,40,25,40,1,5,40,1,40,1,5,1,1,1,1,1,5,25,1,1,1,40,40,40,40,40,1,1,1,5,1,25,40,25,40,1,5,10,1,40,1,40,40,1,1,5,1,1,1,1,1,5,1,1,1];
fd_mcs_release=[1050,1052,1053,1054,1054,1054,1054,1054,1054,1055,1056,1057,1058,1062,1063,1065,1067,1067,1067,1067,1067,1067,1068,1070,1072;5,1,1,1,25,40,10,1,1,40,1,40,1,40,5,1,1,25,40,10,1,1,1,1,30];
fd_mcs_queue=[1077,1079,1080,1088,1090,1091,1095,1095,1096,1097,1097,1098,1099,1099,1101,1102,1103,1104,1108,1109,1110,1111,1112,1115,1116,1117,1118,1119,1120,1122;1,40,5,5,1,1,40,5,5,1,5,1,1,5,1,1,1,1,1,1,1,1,1,5,5,5,1,5,5,30];
fd_mcs_abort=[1206,1206,1206,1206,1206,1206,1206,1206,1207,1211,1212,1214,1220,1222,1224,1227,1229,1230,1199;25,25,5,5,10,1,10,1,40,5,30,5,5,1,1,5,5,30,1];
fd_mcs_bus_reset=[1234,1252,1252,1252,1252,1252,1252,1252,1252,1254,1255,1256,1257,1258,1259,1261,1266;1,25,25,5,5,10,1,10,1,5,5,5,5,5,5,5,30];
fd_mcs_biosparam=[1274,1274,1275,1280,1280,1280,1280,1311,1312,1317,1319,1320,1321,1322,1323,1325,1326,1330,1331,1332;1,5,1,40,40,40,40,1,1,40,1,1,40,1,1,1,1,1,5,30];
init_this_scsi_driver=[19,24,25,28,31,32,34,35,35,36,38,38,38,38,38,38,38,38,38,39,40,41,42,44,46,47,47,47,47,47,48,48,49;1,40,5,30,1,5,5,40,5,30,1,1,25,40,5,10,1,1,1,5,40,25,5,30,1,25,40,1,10,1,5,1,30];
exit_this_scsi_driver=[54,57,57,57,57,57,57,57,57,57,58,59,59,59,59,59,59,59,59,59,59,59,60,62,62,63,65,66,68,68,68,68,68,68,68,68,68,68,68,69,70;1,1,1,25,40,5,10,1,1,1,5,1,1,1,25,40,10,1,1,1,1,1,5,40,5,30,5,5,1,1,1,25,40,10,1,1,1,1,1,5,30];
print_banner=[521,521,523,523,524,527,529,529,530,532,532,533,535,543,543,543,543,543,543,543,543,543,543,543,543,543,548,549,551,553,554;30,40,40,40,5,5,5,40,5,5,40,5,5,5,1,1,1,1,1,1,40,40,1,40,1,40,40,5,5,5,30];
fdomain_setup=[560,562,562,562,562,562,563,563,563,564,564,564,565,565,565,568,568,568,569,569,569,570,570,570,572,572,573,574;5,40,40,40,1,1,5,5,5,5,5,5,30,30,30,1,1,40,1,1,40,1,1,40,1,1,1,30];
fdomain_is_valid_port=[608,608,609,609,609,610,610,610,611,613,613,613,614,621,622,622,623,624,624,625,626,632;40,5,30,40,5,30,40,5,1,30,40,5,1,5,40,5,5,40,5,1,1,30];
fdomain_test_loopback=[640,640,640,640,640,640,641,642,642,643,644,646;1,25,40,10,1,1,5,1,5,40,30,30];
fdomain_isa_detect=[800,700,700,700,700,700,700,701,701,802,704,705,706,707,707,707,708,709,710,713,717,726,727,727,728,728,729,729,729,730,731,731,732,732,732,733,734,734,735,735,735,736,743,743,743,743,743,743,744,745,745,746,747,747,748,749,751,752,753,775,775,775,775,775,775,776,777,777,781,786,686,787,687,788,789,693,693,693,693,693,693,694,694,695,696,797,797,799;1,1,25,40,10,1,1,40,5,30,1,1,1,1,1,40,1,1,25,5,40,40,25,40,25,40,1,5,5,25,25,40,1,5,5,25,25,1,1,5,5,25,1,25,40,10,1,1,40,40,5,25,40,5,5,25,5,1,30,1,25,40,10,1,1,1,40,5,25,5,1,40,1,25,5,1,25,40,10,1,1,1,5,40,25,30,40,5];
fdomain_pci_bios_detect=[828,841,841,842,843,843,844,857,858,860,860,861,866,867,868,875,875,876,877,878,882,882,883,884,885,886,888,890,891;1,40,5,30,40,5,25,1,1,40,5,25,1,1,1,40,5,5,5,25,1,1,1,1,1,1,30,5,30];
fdomain_16x0_info=[1019,1020,1020,1021,1021,1022,1022,1023,1024,1024,1025,1026,1027,1029,1032;5,40,5,5,5,1,5,40,1,5,40,1,1,5,30];
fdomain_select=[1108,1078,1079,1082,1084,1086,1086,1086,1086,1086,1087,1087,1088,1090,1091,1093,1096;30,5,5,5,1,25,40,1,10,1,1,5,40,5,30,5,5];
my_done=[1113,1114,1115,1116,1117,1118,1119,1120,1122,1127;40,1,5,5,1,40,5,5,5,30];
do_fdomain_16x0_intr=[1400,1400,1400,1400,1400,1400,1400,1400,1401,1302,1403,1303,1303,1303,1303,1303,1303,1203,1203,1203,1203,1203,1203,1203,1203,1204,1205,1206,1307,1308,1409,1309,1410,1411,1212,1413,1313,1314,1314,1314,1315,1215,1216,1317,1217,1318,1419,1319,1320,1221,1323,1324,1325,1326,1226,1226,1327,1327,1328,1228,1330,1230,1232,1232,1233,1233,1233,1133,1335,1336,1336,1336,1336,1336,1336,1239,1340,1240,1240,1341,1241,1241,1342,1242,1243,1143,1143,1144,1245,1346,1246,1246,1347,1347,1347,1347,1247,1247,1147,1348,1248,1249,1350,1150,1150,1351,1251,1352,1252,1252,1353,1253,1253,1155,1155,1356,1356,1358,1359,1159,1360,1360,1361,1366,1267,1268,1268,1269,1270,1271,1271,1171,1272,1272,1172,1172,1173,1276,1276,1177,1177,1177,1177,1177,1177,1177,1177,1178,1179,1180,1182,1283,1184,1186,1287,1287,1287,1187,1187,1290,1190,1292,1293,1194,1195,1196,1196,1297,1197,1298,1199,1199,1199;25,25,5,5,10,1,10,1,5,40,5,25,40,1,5,10,1,25,25,5,5,10,1,10,1,5,5,30,40,1,40,40,5,5,5,5,40,5,1,1,1,1,5,1,5,5,30,1,1,30,40,40,1,1,1,5,1,5,1,40,25,40,25,40,5,1,1,1,40,25,40,1,5,10,1,25,40,25,40,1,40,40,40,1,5,40,5,30,25,40,25,40,1,5,1,1,40,40,5,1,1,5,1,40,40,5,25,1,25,40,1,1,5,30,30,40,40,1,1,40,1,5,1,40,25,25,40,5,25,25,40,40,1,5,1,5,40,1,40,25,25,5,5,10,1,10,1,5,5,30,1,25,5,5,40,40,40,5,5,40,5,1,5,30,40,1,5,1,40,5,40,5,5];
fdomain_16x0_queue=[1425,1426,1436,1438,1439,1443,1443,1444,1445,1445,1446,1447,1447,1449,1450,1451,1452,1455,1456,1457,1458,1459,1462,1463,1464,1465,1466,1467,1469;40,5,5,1,1,40,5,5,1,5,1,1,5,1,1,1,1,1,1,1,1,1,5,5,5,1,5,5,30];
fdomain_16x0_bus_reset=[1574,1574,1574,1574,1574,1574,1574,1574,1574,1574,1576,1577,1578,1579,1580,1581,1583,1583,1583,1583,1583,1583,1583,1583,1583,1583,1583,1583,1583,1584;25,25,10,1,25,5,10,1,10,1,5,5,5,5,5,5,25,5,25,10,1,25,10,1,5,40,5,10,1,30];
fdomain_16x0_biosparam=[1714,1715,1722,1723,1724,1725,1726,1727,1729,1730,1734,1735,1738,1643,1644,1645,1647,1649,1650,1651,1651,1654,1655,1656,1656,1657,1658,1659,1659,1660,1661,1662,1662,1663,1664,1666,1667,1668,1669,1670,1670,1670,1673,1675,1676,1677,1680,1680,1682,1682,1682,1682,1592;1,1,40,1,1,40,1,1,1,1,1,5,30,40,5,30,1,40,40,25,40,1,25,25,40,1,25,25,40,1,25,25,1,1,25,5,1,1,1,40,40,40,5,1,1,1,1,5,40,40,40,40,1];
init_this_scsi_driver=[19,24,25,28,31,32,34,35,35,36,38,38,38,38,38,38,38,38,38,39,40,41,42,44,46,47,47,47,47,47,48,48,49;1,40,5,30,1,5,5,40,5,30,1,1,25,40,5,10,1,1,1,5,40,25,5,30,1,25,40,1,10,1,5,1,30];
exit_this_scsi_driver=[54,57,57,57,57,57,57,57,57,57,58,59,59,59,59,59,59,59,59,59,59,59,60,62,62,63,65,66,68,68,68,68,68,68,68,68,68,68,68,69,70;1,1,1,25,40,5,10,1,1,1,5,1,1,1,25,40,10,1,1,1,1,1,5,40,5,30,5,5,1,1,1,25,40,10,1,1,1,1,1,5,30];
S={print_banner do_pause fd_mcs_detect fd_mcs_proc_info fd_mcs_select fd_mcs_intr fd_mcs_release fd_mcs_queue fd_mcs_abort fd_mcs_bus_reset fd_mcs_biosparam init_this_scsi_driver exit_this_scsi_driver print_banner fdomain_setup fdomain_is_valid_port fdomain_test_loopback fdomain_isa_detect fdomain_pci_bios_detect fdomain_16x0_info fdomain_select my_done do_fdomain_16x0_intr fdomain_16x0_queue fdomain_16x0_bus_reset fdomain_16x0_biosparam init_this_scsi_driver exit_this_scsi_driver };Snames={'print_banner' 'do_pause' 'fd_mcs_detect' 'fd_mcs_proc_info' 'fd_mcs_select' 'fd_mcs_intr' 'fd_mcs_release' 'fd_mcs_queue' 'fd_mcs_abort' 'fd_mcs_bus_reset' 'fd_mcs_biosparam' 'init_this_scsi_driver' 'exit_this_scsi_driver' 'print_banner' 'fdomain_setup' 'fdomain_is_valid_port' 'fdomain_test_loopback' 'fdomain_isa_detect' 'fdomain_pci_bios_detect' 'fdomain_16x0_info' 'fdomain_select' 'my_done' 'do_fdomain_16x0_intr' 'fdomain_16x0_queue' 'fdomain_16x0_bus_reset' 'fdomain_16x0_biosparam' 'init_this_scsi_driver' 'exit_this_scsi_driver' };fprintf('Length of list: %d\n', length(S));

file_1 = fopen('output3.txt','w')
fprintf(file_1, 'Length of list: %d\n', length(S));
for o1 = 1:length(S),
%  for o2 = o1+1:length(S),
	%if (length(o1) > 10) 
		%plot (S{o1}, 'r.');
		%plot (S{o2}, 'b.');
		%fprintf('size(o1) %d', length(S{o1}));
		%fprintf('size(o2) %d', length(S{o2}));
		%fprintf('Datasets A %d.\n', S(o1:size(S,2)));
%	        lenf1 =  max (S{o1}(1,:)) -  min(S{o1}(1,:));
%                lenf2 =  max (S{o2}(1,:)) -  min(S{o2}(1,:));
%
%	        fprintf ('Len %d %d\n', lenf1, lenf2);

%		axis equal;
%		if (length(S{o1}) > length(S{o2}))
			Z1 = S{o1};
%			[D,Z2] = procrustes (S{o1}, S{o2}, 'Scaling', false);
%			Z3 = S{o2};

%		else
%			Z1  = S{o2};
%			[D,Z2] = procrustes (S{o2}, S{o1}, 'Scaling', false);
%			Z3 = S{o1};
%		end

%		if (abs(lenf1 - lenf2) < lenf1  && abs(lenf1 - lenf2) < lenf2)

		%fprintf('\nComparing %s %s.\n', Snames{o1}, Snames{o2});
%			d = similarity_distance(Z1', Z2');
			d1 = anti_similarity_distance (Z1', Z1');
			fprintf(file_1, '\nComparing %s %d .\n', Snames{o1},  d,  d1);
			fprintf('\nComparing %s %d .\n', Snames{o1},  d,  d1);

			%d2 = anti_similarity_distance (Z3', Z3');
			%fprintf('\nComparing %s %s %d %d %d %d.\n', Snames{o1}, Snames{o2}, d, D, d1, d2);
			%fprintf(file_1, '\nComparing %s %s %d %d %d %d.\n', Snames{o1}, Snames{o2}, d, D, d1, d2);
			%if (d == 0)
		%		fprintf('\n\n MATCH : Functions %s %s match.\n', Snames{o1}, Snames{o2} );
		%		fprintf(file_1, '\n\n MATCH : Functions %s %s match.\n', Snames{o1}, Snames{o2} );
		%	end
		%	if (D < 0.03)
		%		fprintf('\n procustes MATCH : Functions %s %s match.\n', Snames{o1}, Snames{o2} );
		%		fprintf(file_1, '\n procustes MATCH : Functions %s %s match.\n', Snames{o1}, Snames{o2} );
		%	end
			%if (abs(d1-d2) <0.02)
            	%		fprintf(file_1, '\n\n antisim MATCH : Functions %s %s match.\n', Snames{o1}, Snames{o2} );
		 %       end
%		end
 %   end
end
fclose(file_1);
