how to draw flowchart in latex with code?

Desired flowchart: sample flowchart

So, any ideas how to implement a flowchart like this in LaTeX? Thanks in advance