Praise be to Allah.
If you uttered what you mention of reviling the faith and the divine decree, then undoubtedly what you did was a serious matter, which is apostasy from Islam. By doing that you behaved badly towards Allaah the Almighty Who has blessed you, created you and guided you, and Who is more merciful towards you than anyone else. Perhaps He diverted you from engineering for some good that He wanted to bring to you, or for some evil that He wanted to ward off from you, and you should have accepted that and been content with it.
But if it is something that you merely thought or said to yourself, and did not utter out loud, and it did not settle in your heart, then you should have hastened to reject it and brought to mind the blessings of Allaah and His bounty towards you.
Whatever the case, your giving up prayer is another sin, and it is known that with regard to the one who does not pray out of laziness there is a difference of opinion among the scholars, but the most correct view is that he is a kaafir, because the texts indicate that.
No matter how great your sin, the forbearance of Allaah is greater.
No matter what your sin, if you repent from it, then Allaah will accept your repentance and forgive you. He has promised that and He is the most sincere of speakers, may He be glorified and exalted.
The verse which you mention, in which Allaah says (interpretation of the meaning): “Verily, Allaah forgives not that partners should be set up with Him (in worship), but He forgives except that (anything else) to whom He wills” [al-Nisa’ 4:48] applies to those who meet Him without having repented from shirk; Allaah will not forgive them. But as for those who repent before the death rattle reaches the throat, and before the sun rises from the west, Allaah will accept that from them, and will turn their bad deeds into good, whether they committed kufr and shirk, or major or minor sins. What matters is sincere repentance, regretting what one has done in the past and resolving never to go back to it.
The evidence for that is the verses in which Allaah says (interpretation of the meaning):
“And those who invoke not any other ilâh (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse ___and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful”
“And verily, I am indeed forgiving to him who repents, believes (in My Oneness, and associates none in worship with Me) and does righteous good deeds, and then remains constant in doing them (till his death)”
“Know they not that Allaah accepts repentance from His slaves and takes the Sadaqaat (alms, charity), and that Allaah Alone is the One Who forgives and accepts repentance, Most Merciful?”
There is no difference between one who was originally a kaafir, then Allaah guided him, and one who was a Muslim and then apostatized – Allaah forbid – then repented and turned back to Allaah. Repentance erases the sins that came before it, and Islam erases that which came before it.
The verse in which Allaah says (interpretation of the meaning): “Say: O ‘Ibaadi (My slaves) who have transgressed against themselves (by committing evil deeds and sins)! Despair not of the Mercy of Allaah, verily, Allaah forgives all sins. Truly, He is Oft‑Forgiving, Most Merciful”[al-Zumar 39:53], is general in meaning and applies to everyone who sins then repents, whether he was originally a kaafir or he was a Muslim then apostatized. It includes all those who commit sin.
Ibn Katheer (may Allaah have mercy on him) said: This verse is a call to all sinners, kaafirs and others, to repent and turn back to Allaah. It tells us that Allaah, may He be blessed and exalted, forgives all sins for the one who repents to Him and gives up the sin, no matter what it is, even if his sins are many and like the foam of the sea. It is not correct to interpret this as meaning that all sins will be forgiven without repentance, because shirk can never be forgiven except in the case of one who repents from it. End quote from Tafseer Ibn Katheer (4/75).
As for those who will be driven away from the Cistern, of whom it will be said: “You do not know what they introduced after you were gone,” this applies to those who did not repent, rather they meet Allaah as sinners and apostates.
If you have repented to Allaah, then be of good cheer and praise Allaah for having caused you to live until you came back to Islam. Do a lot of righteous deeds and strive to do a lot of acts of worship, so that after you repent you will be better than you were before. Beware of neglecting prayer or delaying prayer until the time for it is over, because prayer is very important and it is the connection between a person and his Lord, and it is the door to happiness and peace of mind. We ask Allaah to accept it from you and to pardon your sin.
And Allaah knows best.