mov ecx,eax fld dword [nz] fld dword [indx] ; min+i*dh fldz fcomip st2 jc gsx2 ; nz>0 fsub dword [lhst] ; min+(i-0.5)*dh fld st0 fsub dword [rz] ; min+(i-0.5)*dh-rz fmul dword [csca+edx] ; ai: overburden to edge below fld st2 ; nz fmul st4 ; nz*SCA fsubrp st1 fmul dword [lrst] ; dif: remaining overburden gsx1: cmp ecx,edi ; i==0 jz gsx4 fldz fcomip st1 jbe gsx4 dec ecx fadd dword [csca+ebp+4*ecx] fld dword [lstp] fsubp st2 jmp gsx1 gsx2: fadd dword [lhst] ; min+(i+0.5)*dh fld st0 fsub dword [rz] ; min+(i+0.5)*dh-rz fmul dword [csca+edx] ; ai: overburden to edge above fld st2 ; nz fmul st4 ; nz*SCA fsubrp st1 fmul dword [lrst] ; dif: remaining overburden gsx3: cmp ecx,esi ; i==num-1 jz gsx4 fldz fcomip st1 jae gsx4 inc ecx fsub dword [csca+ebp+4*ecx] fld dword [lstp] faddp st2 jmp gsx3 gsx4: cmp eax,ecx ; if in the same layer jnz gsx5 fstp st0 fstp st0 fstp st0 fld dword [rsca+edx] fmulp st1 ; sca jmp gsx6 gsx5: fld dword [lstp] ; if in the different layer fmul dword [rsca+ebp+4*ecx] fmulp st1 faddp st1 fsub dword [rz] fdivrp st1 fxch st1 fstp st0 gsx6: