function recursiveSearch(r,e,t,E,c,n){var o=Math.floor((e-r)/2)+r,s=c(t,E[o],!0);return 0===s?o:s>0?e-o>1?recursiveSearch(o,e,t,E,c,n):n==exports.LEAST_UPPER_BOUND?e<E.length?e:-1:o:o-r>1?recursiveSearch(r,o,t,E,c,n):n==exports.LEAST_UPPER_BOUND?o:r<0?-1:r}exports.GREATEST_LOWER_BOUND=1,exports.LEAST_UPPER_BOUND=2,exports.search=function(r,e,t,E){if(0===e.length)return-1;var c=recursiveSearch(-1,e.length,r,e,t,E||exports.GREATEST_LOWER_BOUND);if(c<0)return-1;for(;c-1>=0&&0===t(e[c],e[c-1],!0);)--c;return c};