Yeah, so this is what it looks like it is doing (roughly) is this:
seed (RTC minutes like R/S, with the xor high and low bits)
pidh
pidl
if pidh is 0, or it with 0x2003
if pidl is 0, or it with 0x327
-- pid is not used
pidh (again)
pidl (again)
if new pid is shiny, increment pid until not shiny. Increment maxes out at 8.
iv1
iv2
item is based on the original RTC seed calculation, which is indeterminate based on the seed because the RTC seed is xor'd before its sent to seed the RNG.
I never dived into R/S seeding, so I am not sure how the RTC is calculated, like based on minutes from an epoch, a random date, etc. I also don't know the seed period of GBA games, so maybe someone can chime in with that info.