How C#5 “await” works?

Let’s we have the following method that’s contain await keyword. The way the compiler will rewrite this its take the first half (marked as red), it’s splitting your method in to halfway see’s the await keyword and identifying first half of the code and second half will be the following code (marked it as green).
And then rewrites in to the following
In this first half of the code running synchronously in your method and the second half inside the continue with callback. If you are not in C#5 you can write code like that.