1@echo off
2set FILTER=cat
3set Y=0
4if /i "%1"=="Y" (
5	set Y=1
6	set EXE=yasm.exe
7	set OPT2=-DUSE_YASM -DXBYAK32
8	set OPT3=win32
9) else if /i "%1"=="64" (
10	set EXE=nasm.exe
11	set OPT2=-DXBYAK64
12	set OPT3=win64
13	set FILTER=normalize_prefix
14) else if /i "%1"=="Y64" (
15	set Y=1
16	set EXE=yasm.exe
17	set OPT2=-DUSE_YASM -DXBYAK64
18	set OPT3=win64
19	set FILTER=normalize_prefix
20) else (
21	set EXE=nasm.exe
22	set OPT2=-DXBYAK32
23	set OPT3=win32
24)
25call set_opt
26bmake -f Makefile.win all
27echo cl -I../ make_nm.cpp %OPT% %OPT2% /EHs /DUSE_AVX
28cl -I../ make_nm.cpp %OPT% %OPT2% /EHs /DUSE_AVX
29make_nm > a.asm
30%EXE% -f %OPT3% -l a.lst a.asm
31rem connect "?????-" and "??"
32if /i "%Y%"=="1" (
33	awk "NR > 1 {if (index($3, ""-"")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = """" }} " < a.lst |%FILTER% > ok.lst
34) else (
35	awk "{if (index($3, ""-"")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = """" }} " < a.lst |%FILTER% > ok.lst
36)
37make_nm jit > nm.cpp
38echo cl -I../ -DXBYAK_TEST nm_frame.cpp %OPT% %OPT2%
39cl -I../ -DXBYAK_TEST nm_frame.cpp %OPT% %OPT2%
40nm_frame |%FILTER% > x.lst
41diff -w x.lst ok.lst
42wc x.lst
43