Modified the way the specialize_branched_loops recurses through exprs to fix a bug where we need to split on a Select node inside the expression. Also added a slightly more complex test case to exercise this feature to the correctness test.