The random-access machine invented by Aho, Hopcroft, and Ullman is one of the several known versions of abstract register machines, which are an important computation model. Using a formal framework developed for this architecture in our previous work, we consider a challenging example – a search program that computes the maximum of an integer array of an arbitrary size. Here we present its specification in PVS and complete deductive verification, which turned out to be rather difficult. We have also proved its best-case and worst-case complexity measures as a function on the size of the array. We hope that our use of deductive verification for this example is both novel and appropriate, because the fully automated techniques, such as model-checking, are not perfectly suitable either for the verification of infinite-state programs or for the analysis of their complexity.