On the basis of 16 years of spectroscopic observations of the four components of the gravitationally lensed broad absorption line (BAL) quasar H1413+117, covering the ultraviolet to visible rest-frame spectral range, we analyze the spectral differences observed in the P Cygni-type line profiles and have used the microlensing effect to derive new clues to the BAL profile formation. We confirm that the spectral differences observed in component D can be attributed to a microlensing effect lasting at least a decade. We show that microlensing magnifies the continuum source in image D, leaving the emission line region essentially unaffected. We interpret the differences seen in the absorption profiles of component D as the result of an emission line superimposed onto a nearly black absorption profile. We also find that the continuum source and a part of the broad emission line region are likely de-magnified in component C, while components A and B are not affected by microlensing. We show that microlensing of the continuum source in component D has a chromatic dependence compatible with the thermal continuum emission of a standard Shakura-Sunyaev accretion disk. Using a simple decomposition method to separate the part of the line profiles affected by microlensing and coming from a compact region from the part unaffected by this effect and coming from a larger region, we disentangle the true absorption line profiles from the true emission line profiles. The extracted emission line profiles appear double-peaked, suggesting that the emission is occulted by a strong absorber, narrower in velocity than the full absorption profile, and emitting little by itself. We propose that the outflow around H1413+117 is constituted by a high-velocity polar flow and a denser, lower velocity disk seen nearly edge-on.