GPIO init setting pull to the wrong value in disassembly

Hi, I'm finding this strange behaviour whereby I'm unable to turn on the internal pull up for GPIO Port C, on pins 14, 15, and 6.
When I look into the gpio.c generated by CubeMX, I see that the C code is correct. GPIO_NOPULL has value of 0. Yet the disassembly shows that a literal 2 (for pull-down) is being written instead. I'm actually trying to set it to pull up, but no matter what value I use, it just keeps writing 2 instead.
It's killing me as I've also tried to write to the PUPDR directly, but the value is not getting changed. please help!
