!#/usr/bin/perl
@instr_names=();
@instr_pctg=();
@instr_names=qw/"movei8","strmgi16","strmovei16","add1","kill2","movestri8"/;
@instr_pctg=(0.3,0.2,0.1,0.1,0.1,0.1,0.1);
%tot_pctg_len=();
for($cur=0;$cur<@instr_names;$cur++){
if($instr_names[cur] =~ /(\d+)/){
$tmp_digit=$1;
$tot_pctg_len{$tmp_digit}+=$instr_pctg[cur];
}
}
while(($key,$value)=each %tot_pctg_len){
print "$key -> $value\n";
}
@instr_names=();
@instr_pctg=();
@instr_names=qw/"movei8","strmgi16","strmovei16","add1","kill2","movestri8"/;
@instr_pctg=(0.3,0.2,0.1,0.1,0.1,0.1,0.1);
%tot_pctg_len=();
for($cur=0;$cur<@instr_names;$cur++){
if($instr_names[cur] =~ /(\d+)/){
$tmp_digit=$1;
$tot_pctg_len{$tmp_digit}+=$instr_pctg[cur];
}
}
while(($key,$value)=each %tot_pctg_len){
print "$key -> $value\n";
}