## High level inline function expand question <<<<<<<<<<<

I am working on a real-time data processing application which is
sensitive to runtime code performance.  I am willing to trade runtime
code size to gain any addition performance.  To help minimize needless
call/return overhead, the same key inner loop of approx 10-15 lines
of code has been replicated rather than coded as a function call.
An example is given below:

for i:=1 to 100 do
begin
z:=sqrt( sqr(apple[i].x) + sqr(apple[i].y) );
apple[i].x:=1200+x/z*500;
apple[i].y:=1500+y/z*600;
end;

{still elsewhere in the code}
for i:=1 to 2 do
begin
z:=sqrt( sqr(orange[i].x) + sqr(orange[i].y) );
orange[i].x:=1200+x/z*500;
orange[i].y:=1500+y/z*600;
end;

{elsewhere in the code another billion times later}
for i:=1 to 10 do
for j:=20 to 30 do
begin
z:=sqrt( sqr(banana[i,j].x) + sqr(banana[i,j].y) );
banana[i,j].x:=1200+x/z*500;
banana[i,j].y:=1500+y/z*600;
end;

==================================================

To assist in the management of the software, I would like to define a
transform function once and inline expand each occurrence.  The code
given above would then be compatible with:

{define generic transform function}
function transform(argument:fruit_type):fruit_type;
cool_inline_expand_directive; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
var
temp : real;
begin
temp:=sqrt( sqr(argument.x) + sqr(argument.y) );
transform.x:=1200+x/z*500;
transform.y:=1500+y/z*600;
end;

for i:=1 to 100 do
apple[i]:=transform(apple[i]);

{still elsewhere in the code}
for i:=1 to 2 do
orange[i]:=transform(orange[i]);

{elsewhere in the code another billion times}
for i:=1 to 10 do
for j:=20 to 30 do
banana[i,j]:=transform(banana[i,j]);

=========================================================

Any thoughts would be surely welcomed.  Please limit responses to solutions
were the transform function can be managed using high-level entry, I already
understand how to function/procedure inline assembly expansion.  Rest
assured, you wouldn't want to support all the future changes to the
application code were these kind of "tricks" are defined using machine code.

Thank you for your patience, time, and help,
m...@procyon.cdev.com

P.S.  Please don't correct any syntax errors I may have made representing
my problem.  The code given above should only be used as a rough guide to
help understand the problem better.  :^)