rank...ur uai mark is based on both ur hsc and ur school rank.
so say if u come 2nd in ur school, yet in ur hsc ur school gets: 100, 98, 93 (for simplicity only 3 people) and u got the 93, then ur hsc mark is 93, your school mark is 98 and ur uai mark is the average: 96 (rounded up) - im pretty sure this is right, but i may be wrong.
so you have to do well in both school and hsc. if u do well in school, and ur school does well in the hsc, then u'll be fine