Why is this assembler stuff important?

A close look at how a function call really works will teach you several things:

Call by Reference vs. call by Value

Look at the function arguments arg1 (an integer) and string (a character pointer). The value from the integer is COPIED onto the stack and received as a value from myFunc. At NO time does myFunc access the memory where arg1 really lives on the stack because this stack area belongs to the main function. myFunc works on a COPY of the integer. But now look at the string variable. It is NOT copied onto the stack. Instead, the MEMORY ADDRESS where the string lives is COPIED with the following instruction onto the stack: movl $LC0, -4(%ebp). If the receiving function myFunc would do anything with the string parameter it would go DIRECTLY to where the string lives - leaving its own memory area.

Speed and Pointers

The string from above is a pointer and you have seen it is transported by reference (effectively only its address is copied, not the whole string). This is of course much faster than performing a whole string copy operation across the stack. But it also shows the danger of pointers (or references in general). There are now 2 places which can access the string: main and myFunc. Main cannot prevent myFunc from abusing its variable string through the pointer (not true because of the text segment here but if string would not be a literal it would be true).

Remote Procedure Calls

In distributed systems we will see how this fast function call mechanism is broken up into 2 parts on different machines. We will call the callers part a "stub" and the receiving functions part a "skeleton" and complicated middleware will move the parameters back and forth. And this will be NOT AT ALL FAST because it involves a lot of networking.

Buffer Overflows

Most security attacks involve buffer overflows on the stack. To really understand how those attacks work you need to understand the stack mechanism, especially the return from a function call where an address from the stack becomes the new instruction pointer. If the stack is overwritten with buffer overflow code, an attacker can point the program at return right to its own virus code.