To my understanding, the value of GetElementPtr can always be expressed by
val = base + index_1 * length_1 + index_2 * length_2 + ...
index_i is the i’th integer index and
length_i is the i’th element length
The point that I need help with is that how to retrieve these information, I’ve searched the documentation and internet, and asked GPT, no one will give out an general answer.