sysctl_search_old makes several tests in a loop that can be removed.
The first test in the loop is only ever true on the first loop iteration, and is always true on that iteration, so its work can be done before the loop begins.
The upper and lower bounds on the loop variable 'indx' are each tested on each iteration, but 'indx' is changed in one direction or the other only once within the loop, so only one bound needs to be checked.
Two ways remain in the loop that nodes[indx] can change (after one of them is put before the loop start), and one of them applies exactly when indx has been incremented, so no separate test for that case requires testing.