#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ clip(double, double, double, double, float *, float *, float *,
                float *);
int /*<<< orphan*/ line(int, int, int, int);
int /*<<< orphan*/ scale_to_screen(float, float, int *, int *);
void line_abs(double x1, double y1, double x2, double 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  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1030 <clip@plt>
cmp    $0x0,%rax
je     11be <line_abs+0x8e>
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scale_to_screen@plt>
movss  -0x2c(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
lea    -0x3c(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <scale_to_screen@plt>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x40(%rbp),%ecx
call   1050 <line@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_abs>:
sub    $0x28,%rsp
movaps %xmm1,%xmm4
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
movaps %xmm2,%xmm1
movaps %xmm4,%xmm2
call   1030 <clip@plt>
test   %rax,%rax
je     11a6 <line_abs+0x76>
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scale_to_screen@plt>
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scale_to_screen@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
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 double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%17 = load double, double* %5
%18 = load double, double* %7
%19 = load double, double* %6
%20 = load double, double* %8
%21 = call i64 @clip(double %17, double %18, double %19, double %20, float* %9, float* %10, float* %11, float* %12)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %35
23: ; preds = %4
%24 = load float, float* %9
%25 = load float, float* %10
%26 = call i32 @scale_to_screen(float %24, float %25, i32* %13, i32* %14)
%27 = load float, float* %11
%28 = load float, float* %12
%29 = call i32 @scale_to_screen(float %27, float %28, i32* %15, i32* %16)
%30 = load i32, i32* %13
%31 = load i32, i32* %14
%32 = load i32, i32* %15
%33 = load i32, i32* %16
%34 = call i32 @line(i32 %30, i32 %31, i32 %32, i32 %33)
br label %35
35: ; preds = %23, %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 = bitcast float* %5 to i8*
%14 = bitcast float* %6 to i8*
%15 = bitcast float* %7 to i8*
%16 = bitcast float* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = bitcast i32* %11 to i8*
%20 = bitcast i32* %12 to i8*
%21 = call i64 @clip(double %0, double %2, double %1, double %3, float* %5, float* %6, float* %7, float* %8)
%22 = icmp eq i64 %21, 0
br i1 %22, label %35, label %23
23: ; preds = %4
%24 = load float, float* %5
%25 = load float, float* %6
%26 = call i32 @scale_to_screen(float %24, float %25, i32* %9, i32* %10)
%27 = load float, float* %7
%28 = load float, float* %8
%29 = call i32 @scale_to_screen(float %27, float %28, i32* %11, i32* %12)
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = load i32, i32* %12
%34 = call i32 @line(i32 %30, i32 %31, i32 %32, i32 %33)
br label %35
35: ; preds = %23, %4
ret void
}