8 &function_begin
($name,"");
18 &xor($c,$c); # clear carry
19 &mov
($r,&wparam
(0)); #
21 &mov
("ecx",&wparam
(2)); #
22 &mov
($a,&wparam
(1)); #
24 &and("ecx",0xfffffff8); # num / 8
25 &mov
($w,&wparam
(3)); #
27 &push("ecx"); # Up the stack for a tmp variable
29 &jz
(&label
("maw_finish"));
31 &set_label
("maw_loop",0);
33 &mov
(&swtmp
(0),"ecx"); #
35 for ($i=0; $i<32; $i+=4)
39 &mov
("eax",&DWP
($i,$a,"",0)); # *a
41 &add
("eax",$c); # L(t)+= *r
42 &mov
($c,&DWP
($i,$r,"",0)); # L(t)+= *r
43 &adc
("edx",0); # H(t)+=carry
44 &add
("eax",$c); # L(t)+=c
45 &adc
("edx",0); # H(t)+=carry
46 &mov
(&DWP
($i,$r,"",0),"eax"); # *r= L(t);
47 &mov
($c,"edx"); # c= H(t);
51 &mov
("ecx",&swtmp
(0)); #
55 &jnz
(&label
("maw_loop"));
57 &set_label
("maw_finish",0);
58 &mov
("ecx",&wparam
(2)); # get num
60 &jnz
(&label
("maw_finish2")); # helps branch prediction
61 &jmp
(&label
("maw_end"));
63 &set_label
("maw_finish2",1);
64 for ($i=0; $i<7; $i++)
66 &comment
("Tail Round $i");
67 &mov
("eax",&DWP
($i*4,$a,"",0));# *a
69 &add
("eax",$c); # L(t)+=c
70 &mov
($c,&DWP
($i*4,$r,"",0)); # L(t)+= *r
71 &adc
("edx",0); # H(t)+=carry
73 &adc
("edx",0); # H(t)+=carry
74 &dec
("ecx") if ($i != 7-1);
75 &mov
(&DWP
($i*4,$r,"",0),"eax"); # *r= L(t);
76 &mov
($c,"edx"); # c= H(t);
77 &jz
(&label
("maw_end")) if ($i != 7-1);
79 &set_label
("maw_end",0);
82 &pop("ecx"); # clear variable from