Can anyone help me why we are using this if( fa-(fa&(-fa))/2 == st) ? how does it help?

bool checkleft(ll st){
ll t=(st&(-st));
ll fa=st+t;
if( fa-(fa&(-fa))/2 == st) return true;
return false;
}

int main(void){
// cout << z<<endl;
ll n,q,len,st,t;
cin>>n>>q;
while(q–){
scanf("%I64d",&st);
scanf("%s",s+1);
len=strlen(s+1);
// cout << s+1<<endl;
for(int i=1;i<=len;i++){
// cout<<“st=”<<st<<endl;
t=(st&(-st));
if(s[i]==‘L’) st-=t/2;
else if(s[i]==‘R’) st+=t/2;
else if(s[i]==‘U’){
if(st==(n+1)/2) continue;
int flag=checkleft(st);
if(flag) st+=t;
else st-=t;
// printf(“st=%I64d\nt=%I64d\n”,st,t);
}
}
cout <<st <<endl;
}