If an input profile is specified for CMYK, it is attached to DeviceCMYK. All DeviceCMYK colours or process colours are converted to the output colour space using this profile. The overprint settings in the PDF are ignored, regardless if an input profile is specified for CMYK or not.
If an input profile is specified for CMYK, it is used as blend colour space. Any overprint in the PDF is simulated and the result of the overprint simulation is transformed from CMYK colour space to output colour space. DeviceCMYK colours or process colours that are not involved in overprint are also transformed from CMYK colour space to output colour space.