▁command ing ▁gener als ▁being ▁designated ▁as ▁s ip ah sal ar ▁or ▁is fah sal ar . ▁The ▁office ' s ▁role ▁under ▁the ▁Sel ju ks ▁is ▁described ▁in ▁the ▁writ ings ▁of ▁N iz am ▁al - M ulk ▁and ▁Muhammad ▁bin ▁Ali ▁Raw and i . ▁An ach ron ist ically ▁as cri bing ▁its ▁existence ▁to ▁the ▁practices ▁of ▁the ▁S as an ian ▁court , ▁the ▁latter ▁writes ▁that ▁the ▁ha j ib ▁was ▁the ▁official ▁responsible ▁for ▁admin ister ing ▁pun ishment . ▁The ▁am ir ▁ha j ib ▁was ▁the ▁highest - ran king ▁court ▁official , ▁and ▁apart ▁from ▁cer emon ies ▁and ▁protocol , ▁he ▁was ▁also ▁responsible ▁for ▁military ▁discipline . ▁Under ▁Muhammad ▁I ▁T ap ar , ▁the ▁am ir ▁ha j ib ▁is ▁recorded ▁as ▁acting ▁as ▁the ▁inter medi ary ▁between ▁the ▁Sel j uk ▁s ultan ▁and ▁his ▁officials , ▁including ▁the ▁viz ier . ▁N iz am ▁al - M ulk ▁also ▁mentions ▁the ▁existence ▁of ▁a ▁ha j ib - i ▁d arg ah , ▁responsible ▁for ▁cer emon ies ▁and ▁order ▁at ▁court ; ▁it ▁is ▁unclear ▁whether ▁that ▁was ▁a ▁distinct ▁office ▁from ▁that ▁of ▁am ir ▁ha j ib . ▁From ▁the ▁names ▁of ▁am ir ▁ha j ib s ▁provided ▁by ▁Raw and i , ▁the ▁office ▁was ▁not ▁her edit ary — with ▁only ▁one ▁exception : ▁Ali ▁Bar , ▁ha j ib ▁of ▁Muhammad ▁I , ▁was ▁succeeded ▁by ▁his