Hi,
Good news, the GPIO pins toggle as you expected.
After you write the GPIO direction register, for the first execution of the following instruction
LPC_GPIO0->FIOCLR = ((1<<2) | (1<<3) | (1<<24) | (1<<25));
It appears that all the port pins which are configured as GPIO output will response with the default FIOPIN register value, which leads to the problem.
If you do want to get deterministic pin logic, pls write the FIOPIN register value before you configure the GPIO direction register.
Hope it can help you
BR
XiangJun Rong