L4:
x=*second_ptr;
second_ptr++;
if(x>=50) goto label1;
if(--ecx) goto L4;
label1:
*third_ptr=x;
print(x);
goto L4;
I think you need to branch back to the top of your loop after you copy and print the third thing. I think you have other problems with the code, but with respect to your specific question, you have to have that "loop L4" everywhere the code execution path needs to go back to the top of the loop. That or branch back to the the end of the loop or turn this into a call rather than a JG.
L4:
x=*second_ptr;
second_ptr++;
if(x>=50) goto label1;
less_than:
if(--ecx) goto L4;
goto jump_over
label1:
*third_ptr=x;
print(x);
goto less_than;
jump_over: