How to extract the base address and offset of a machine memory operand

Hello developers,

I need your help on extracting the base address and offset of a machine memory operand. I have following piece of code

for (MachineInstr::mmo_iterator mmo_i = IB->memoperands_begin(), mmo_e = IB->memoperands_end(); mmo_i != mmo_e; ++mmo_i)
     {
     Value const *BaseAddr=(*mmo_i)->getValue();
     int64_t Offset = (*mmo_i)->getOffset();
     BaseAddr->dump();
     }

For example, the dumped BaseAddr is
      %arrayidx.2 = getelementptr inbounds i32, i32* %A, i32 2

But I want to extract/read "i32* %A" and " i32 2", separately as Base_Address and Offset, respectively. How can I do that?

Thanks in advance for your help.