mov ecx,eax fld dword [nz] fld dword [indx] ; min+i*dh fldz fcomip st2 jc gax2 ; nz>0 fsub dword [lhst] ; min+(i-0.5)*dh fld st0 fsub dword [rz] ; min+(i-0.5)*dh-rz fmul dword [cabs+edx] ; ai: overburden to edge below fld st2 ; nz fmul st4 ; nz*ABS fsubrp st1 fmul dword [lrst] ; dif: remaining overburden gax1: cmp ecx,edi ; i==0 jz gax4 fldz fcomip st1 jbe gax4 dec ecx fadd dword [cabs+ebp+4*ecx] fld dword [lstp] fsubp st2 jmp gax1 gax2: fadd dword [lhst] ; min+(i+0.5)*dh fld st0 fsub dword [rz] ; min+(i+0.5)*dh-rz fmul dword [cabs+edx] ; ai: overburden to edge above fld st2 ; nz fmul st4 ; nz*ABS fsubrp st1 fmul dword [lrst] ; dif: remaining overburden gax3: cmp ecx,esi ; i==num-1 jz gax4 fldz fcomip st1 jae gax4 inc ecx fsub dword [cabs+ebp+4*ecx] fld dword [lstp] faddp st2 jmp gax3 gax4: cmp eax,ecx ; if in the same layer jnz gax5 fstp st0 fstp st0 fstp st0 fld dword [rabs+edx] fmulp st1 ; abs jmp gax6 gax5: fld dword [lstp] ; if in the different layer fmul dword [rabs+ebp+4*ecx] fmulp st1 faddp st1 fsub dword [rz] fdivrp st1 fxch st1 fstp st0 gax6: