void line_abs(x1, y1, x2, y2) float x1, x2, y1, y2;
{
  float x1_out, y1_out, x2_out, y2_out;
  int xp1, yp1, xp2, yp2;
  if (clip(x1, x2, y1, y2, &x1_out, &y1_out, &x2_out, &y2_out)) {
    scale_to_screen(x1_out, y1_out, &xp1, &yp1);
    scale_to_screen(x2_out, y2_out, &xp2, &yp2);
    line(xp1, yp1, xp2, yp2);
  }
}


x86 assembly (clang, -O0):
<line_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
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x10(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x4,%al
call   1030 <clip@plt>
cmp    $0x0,%eax
je     120f <line_abs+0xdf>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x20(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
mov    $0x0,%al
call   1050 <line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_abs>:
sub    $0x28,%rsp
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm4
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
cvtsd2ss %xmm3,%xmm3
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm4,%xmm2
cvtss2sd %xmm3,%xmm3
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    $0x4,%al
call   1030 <clip@plt>
test   %eax,%eax
je     11da <line_abs+0xaa>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x20(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x2,%al
call   1040 <scale_to_screen@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
xor    %eax,%eax
call   1050 <line@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @line_abs(double %0, double %1, double %2, double %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%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 = fpext float %21 to double
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = load float, float* %6
%26 = fpext float %25 to double
%27 = load float, float* %8
%28 = fpext float %27 to double
%29 = call i32 (double, double, double, double, float*, float*, float*, float*, ...) bitcast (i32 (...)* @clip to i32 (double, double, double, double, float*, float*, float*, float*, ...)*)(double %22, double %24, double %26, double %28, float* %9, float* %10, float* %11, float* %12)
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %47
31: ; preds = %4
%32 = load float, float* %9
%33 = fpext float %32 to double
%34 = load float, float* %10
%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* %13, i32* %14)
%37 = load float, float* %11
%38 = fpext float %37 to double
%39 = load float, float* %12
%40 = fpext float %39 to double
%41 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %38, double %40, i32* %15, i32* %16)
%42 = load i32, i32* %13
%43 = load i32, i32* %14
%44 = load i32, i32* %15
%45 = load i32, i32* %16
%46 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @line to i32 (i32, i32, i32, i32, ...)*)(i32 %42, i32 %43, i32 %44, i32 %45)
br label %47
47: ; preds = %31, %4
ret void
}

LLVM IR (-O2):
define void @line_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 = fptrunc double %0 to float
%14 = fptrunc double %1 to float
%15 = fptrunc double %2 to float
%16 = fptrunc double %3 to float
%17 = bitcast float* %5 to i8*
%18 = bitcast float* %6 to i8*
%19 = bitcast float* %7 to i8*
%20 = bitcast float* %8 to i8*
%21 = bitcast i32* %9 to i8*
%22 = bitcast i32* %10 to i8*
%23 = bitcast i32* %11 to i8*
%24 = bitcast i32* %12 to i8*
%25 = fpext float %13 to double
%26 = fpext float %15 to double
%27 = fpext float %14 to double
%28 = fpext float %16 to double
%29 = call i32 (double, double, double, double, float*, float*, float*, float*, ...) bitcast (i32 (...)* @clip to i32 (double, double, double, double, float*, float*, float*, float*, ...)*)(double %25, double %26, double %27, double %28, float* %5, float* %6, float* %7, float* %8)
%30 = icmp eq i32 %29, 0
br i1 %30, label %47, label %31
31: ; preds = %4
%32 = load float, float* %5
%33 = fpext float %32 to double
%34 = load float, float* %6
%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* %9, i32* %10)
%37 = load float, float* %7
%38 = fpext float %37 to double
%39 = load float, float* %8
%40 = fpext float %39 to double
%41 = call i32 (double, double, i32*, i32*, ...) bitcast (i32 (...)* @scale_to_screen to i32 (double, double, i32*, i32*, ...)*)(double %38, double %40, i32* %11, i32* %12)
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = load i32, i32* %11
%45 = load i32, i32* %12
%46 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @line to i32 (i32, i32, i32, i32, ...)*)(i32 %42, i32 %43, i32 %44, i32 %45)
br label %47
47: ; preds = %31, %4
ret void
}