PUBLIC gcm ; Function compile flags: /Ogtpy _TEXT SEGMENT max$ = 8 n$ = 16 gcm PROC ; 16 : U64 c, lcm; ; 17 : ; 18 : for( c = 1; ( ~n & 1 ) && ( c < 4096 ); c <<= 1 ) n >>= 1; movzx eax, dl mov r8d, 1 mov r9, rdx not al test al, r8b je SHORT $LN1@gcm $LL3@gcm: cmp r8, 4096 ; 00001000H jae SHORT $LN1@gcm shr r9, 1 add r8, r8 movzx eax, r9b not al test al, 1 jne SHORT $LL3@gcm $LN1@gcm: ; 19 : lcm = n * 4096; shl r9, 12 ; 20 : return ( max / lcm ) * lcm; xor edx, edx mov rax, rcx div r9 imul rax, r9 ; 21 : } ret 0 gcm ENDP