Dependency of NVIC register values on Preemption enable/disable

Hello!

I see that after coming out of wfi() on receiving an interrupt, when I enable preemption (writing 0 to primask), the interrupt bit on my NVIC_ICPR register is getting cleared and the corresponding bit is set on NVIC_IABR register.

Below is an example of this scenario

Eg: Let us consider NVIC_ICPR[0] = 0x00010000 and NVIC_IABR[0] = 0x00000000,

on writing 0 to PRIMASK,

NVIC_ICPR[0] = 0x00000000 and NVIC_IABR[0] = 0x00010000

Can you please help me understand why this is happening and the associated dependencies?

Thank you!