Index: /trunk/include/iprt/asn1-generator-pass.h
===================================================================
--- /trunk/include/iprt/asn1-generator-pass.h	(revision 55945)
+++ /trunk/include/iprt/asn1-generator-pass.h	(revision 55946)
@@ -889,5 +889,7 @@
                                                                  PRTERRINFO pErrInfo, const char *pszErrorTag) \
 { \
-    if (RT_UNLIKELY(!RT_CONCAT(RTASN1TMPL_EXT_NAME,_IsPresent)(pThis))) \
+    if (RT_LIKELY(RT_CONCAT(RTASN1TMPL_EXT_NAME,_IsPresent)(pThis))) \
+    { /* likely */ } \
+    else \
         return RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s: Missing (%s).", pszErrorTag, RT_XSTR(RTASN1TMPL_TYPE)); \
     int rc = VINF_SUCCESS
@@ -952,5 +954,7 @@
             { a_Constraints } \
         } \
-        else if (RT_UNLIKELY(RTASN1CORE_IS_PRESENT(&pThis->a_TnNm.a_CtxTagN.Asn1Core) != fInnerPresent)) \
+        else if (RT_LIKELY(RTASN1CORE_IS_PRESENT(&pThis->a_TnNm.a_CtxTagN.Asn1Core) == fInnerPresent)) \
+        { /* likely */ } \
+        else \
             rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
                                "%s::" #a_TnNm "." #a_Name ": Explict tag precense mixup; " #a_CtxTagN "=%d " #a_Name "=%d.", \
@@ -1021,5 +1025,7 @@
     { \
         PCRTASN1CORE pCore = RT_CONCAT(a_Api,_GetAsn1Core)(&pThis->a_Name); \
-        if (RT_UNLIKELY(pCore->cb < (cbMin) || pCore->cb > (cbMax))) \
+        if (RT_LIKELY(pCore->cb >= (cbMin) && pCore->cb <= (cbMax))) \
+        { /* likely */ } \
+        else \
             rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
                                "%s::" #a_Name ": Content size is out of range: %#x not in {%#x..%#x}", \
@@ -1031,6 +1037,8 @@
     if (RT_SUCCESS(rc) && ((cMinBits) != 0 || (cMaxBits) != UINT32_MAX)) \
     { \
-        if (RT_UNLIKELY(   ((cMinBits) == 0          ? false : pThis->a_Name.cBits + 1U < (cMinBits) + 1U /* warning avoiding */) \
-                        || ((cMaxBits) == UINT32_MAX ? false : pThis->a_Name.cBits + 1U > (cMaxBits) + 1U /* ditto */) ) ) \
+        if (RT_LIKELY(   ((cMinBits) == 0          ? true : pThis->a_Name.cBits + 1U >= (cMinBits) + 1U /* warning avoiding */) \
+                      && ((cMaxBits) == UINT32_MAX ? true : pThis->a_Name.cBits + 1U <= (cMaxBits) + 1U /* ditto */) ) ) \
+        { /* likely */ } \
+        else \
             rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
                                "%s::" #a_Name ": Bit size is out of range: %#x not in {%#x..%#x}", \
@@ -1042,6 +1050,8 @@
     if (RT_SUCCESS(rc)) \
     { \
-        if (RT_UNLIKELY(   RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMin) < 0 \
-                        || RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMax) > 0) ) \
+        if (RT_LIKELY(   RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMin) >= 0 \
+                      && RTAsn1Integer_UnsignedCompareWithU64(&pThis->a_Name, uMax) <= 0) ) \
+        { /* likely */ } \
+        else \
             rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, \
                                "%s::" #a_Name ": Out of range: %#x not in {%#llx..%#llx}", \
@@ -1052,6 +1062,11 @@
 
 # define RTASN1TMPL_MEMBER_CONSTR_PRESENT(a_Name, a_Api, a_MoreConstraints) \
-    if (RT_SUCCESS(rc) && RT_UNLIKELY(!RT_CONCAT(a_Api,_IsPresent)(&pThis->a_Name))) \
-        rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s::" #a_Name ": Missing.", pszErrorTag); \
+    if (RT_SUCCESS(rc)) \
+    { \
+        if (RT_LIKELY(RT_CONCAT(a_Api,_IsPresent)(&pThis->a_Name))) \
+        { /* likely */ } \
+        else \
+            rc = RTErrInfoSetF(pErrInfo, VERR_GENERAL_FAILURE, "%s::" #a_Name ": Missing.", pszErrorTag); \
+    } \
     { a_MoreConstraints }
 
