void frect_abs(x1, y1, w, h) float x1, y1, w, h;
{
  int i1, i2, j1, j2;
  int ih, iw;
  float x2 = x1 + w;
  float y2 = y1 + h;
  scale_to_screen(x1, y1, &i1, &j1);
  scale_to_screen(x2, y2, &i2, &j2);
  iw = abs(i2 - i1);
  ih = abs(j2 - j1);
  frect(i1, j1, iw + 1, ih + 1);
}


x86 assembly (clang, -O0):
<frect_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movaps %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm3,%xmm3
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm3,-0x4(%rbp)
movss  %xmm2,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x14(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x30(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
mov    -0x18(%rbp),%edi
sub    -0x14(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
sub    -0x1c(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
add    $0x1,%edx
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    $0x0,%al
call   1050 <frect@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frect_abs>:
sub    $0x18,%rsp
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm3,%xmm3
addss  %xmm0,%xmm2
movss  %xmm2,0x4(%rsp)
addss  %xmm1,%xmm3
movss  %xmm3,(%rsp)
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%al
call   1030 <scale_to_screen@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x2,%al
call   1030 <scale_to_screen@plt>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%edi
sub    %edi,%eax
mov    %eax,%edx
neg    %edx
cmovs  %eax,%edx
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%esi
sub    %esi,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
add    $0x1,%edx
add    $0x1,%ecx
xor    %eax,%eax
call   1040 <frect@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @frect_abs(double %0, double %1, double %2, double %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca float
%17 = fptrunc double %0 to float
%18 = fptrunc double %1 to float
%19 = fptrunc double %2 to float
%20 = fptrunc double %3 to float
store float %17, float* %5
store float %18, float* %6
store float %19, float* %7
store float %20, float* %8
%21 = load float, float* %5
%22 = load float, float* %7
%23 = fadd float %21, %22
store float %23, float* %15
%24 = load float, float* %6
%25 = load float, float* %8
%26 = fadd float %24, %25
store float %26, float* %16
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = load float, float* %6
%30 = fpext float %29 to double
%31 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %28, double %30, i32* %9, i32* %11)
%32 = load float, float* %15
%33 = fpext float %32 to double
%34 = load float, float* %16
%35 = fpext float %34 to double
%36 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %33, double %35, i32* %10, i32* %12)
%37 = load i32, i32* %10
%38 = load i32, i32* %9
%39 = sub nsw i32 %37, %38
%40 = call i32 @abs(i32 %39)
store i32 %40, i32* %14
%41 = load i32, i32* %12
%42 = load i32, i32* %11
%43 = sub nsw i32 %41, %42
%44 = call i32 @abs(i32 %43)
store i32 %44, i32* %13
%45 = load i32, i32* %9
%46 = load i32, i32* %11
%47 = load i32, i32* %14
%48 = add nsw i32 %47, 1
%49 = load i32, i32* %13
%50 = add nsw i32 %49, 1
%51 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @frect to i32 (i32, i32, i32, i32, ...)*)(i32 %45, i32 %46, i32 %48, i32 %50)
ret void
}

LLVM IR (-O2):
define void @frect_abs(double %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = fptrunc double %0 to float
%10 = fptrunc double %1 to float
%11 = fptrunc double %2 to float
%12 = fptrunc double %3 to float
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = fadd float %9, %11
%18 = fadd float %10, %12
%19 = fpext float %9 to double
%20 = fpext float %10 to double
%21 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %19, double %20, i32* %5, i32* %7)
%22 = fpext float %17 to double
%23 = fpext float %18 to double
%24 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %22, double %23, i32* %6, i32* %8)
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = sub nsw i32 %25, %26
%28 = call i32 @llvm.abs.i32(i32 %27, i1 true)
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = sub nsw i32 %29, %30
%32 = call i32 @llvm.abs.i32(i32 %31, i1 true)
%33 = add nuw nsw i32 %28, 1
%34 = add nuw nsw i32 %32, 1
%35 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @frect to i32 (i32, i32, i32, i32, ...)*)(i32 %26, i32 %30, i32 %33, i32 %34)
ret void
}