The condition is here because main code (at transRec.bcMapping[i].aStart) may belong to stubs address range. Note that it genCodeImpl() in code-gen-x64.cpp the emitBlock lambda is called in two loops, and the value of cb argument is mainCode in the first loop, but stubsCode in the second - so when the second loop is executed, ranges from stubs code range are written to the aStart field.
In my code, I need to separate the code that goes to main and stubs code ranges, because MethodLoad event expects continuous address range.