Like:
int square(int x) { return x*x; } int sum_of_squares(int x, int y) { return square(x)+square(y); }
int sum_of_squares(int x, int y) { return x*x + y*y; }
Inlining in the same translation unit is possible though its application is too limited to explain why C is faster than dynamically-typed languages.
Like:
And then the compiler could just know to turn that into (apologies if my syntax is invalid; I'm not actually a C programmer)