#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 */
int fabs(double);
int line_inter(double a1, double b1, double c1, double a2, double b2, double c2,
               double *ret_x, double *ret_y) {
  double den = b1 * a2 - b2 * a1;
  if (fabs(den) > 1e-6) {
    *ret_x = (b1 * c2 - b2 * c1) / den;
    *ret_y = (a1 * c2 - a2 * c1) / -den;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<line_inter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %rsi,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe74(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    123d <line_inter+0x12d>
movsd  -0x18(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1244 <line_inter+0x134>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_inter>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm5,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movapd %xmm4,0x30(%rsp)
movapd %xmm4,%xmm2
movsd  %xmm0,0x20(%rsp)
mulsd  %xmm0,%xmm2
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm3,0x28(%rsp)
mulsd  %xmm3,%xmm0
subsd  %xmm2,%xmm0
movapd %xmm0,0x40(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jle    11ce <line_inter+0xbe>
movapd 0x30(%rsp),%xmm0
xorpd  0xe8e(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm0,%xmm4
movapd 0x40(%rsp),%xmm3
divsd  %xmm3,%xmm4
movsd  %xmm4,(%rbx)
movsd  0x28(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm2,%xmm1
xorpd  0xe46(%rip),%xmm3
subsd  %xmm0,%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,(%r14)
mov    $0x1,%eax
jmp    11d0 <line_inter+0xc0>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @line_inter(double %0, double %1, double %2, double %3, double %4, double %5, double* %6, double* %7) {
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double*
%17 = alloca double*
%18 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double* %6, double** %16
store double* %7, double** %17
%19 = load double, double* %11
%20 = load double, double* %13
%21 = load double, double* %14
%22 = load double, double* %10
%23 = fmul double %21, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %19, double %20, double %24)
store double %25, double* %18
%26 = load double, double* %18
%27 = call i32 @fabs(double %26)
%28 = sitofp i32 %27 to double
%29 = fcmp ogt double %28, 0x3EB0C6F7A0B5ED8D
br i1 %29, label %30, label %52
30: ; preds = %8
%31 = load double, double* %11
%32 = load double, double* %15
%33 = load double, double* %14
%34 = load double, double* %12
%35 = fmul double %33, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %31, double %32, double %36)
%38 = load double, double* %18
%39 = fdiv double %37, %38
%40 = load double*, double** %16
store double %39, double* %40
%41 = load double, double* %10
%42 = load double, double* %15
%43 = load double, double* %13
%44 = load double, double* %12
%45 = fmul double %43, %44
%46 = fneg double %45
%47 = call double @llvm.fmuladd.f64(double %41, double %42, double %46)
%48 = load double, double* %18
%49 = fneg double %48
%50 = fdiv double %47, %49
%51 = load double*, double** %17
store double %50, double* %51
store i32 1, i32* %9
br label %53
52: ; preds = %8
store i32 0, i32* %9
br label %53
53: ; preds = %52, %30
%54 = load i32, i32* %9
ret i32 %54
}

LLVM IR (-O2):
define i32 @line_inter(double %0, double %1, double %2, double %3, double %4, double %5, double* nocapture writeonly %6, double* nocapture writeonly %7) {
%9 = fneg double %4
%10 = fmul double %9, %0
%11 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %10)
%12 = tail call i32 @fabs(double %11)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = fmul double %9, %2
%16 = tail call double @llvm.fmuladd.f64(double %1, double %5, double %15)
%17 = fdiv double %16, %11
store double %17, double* %6
%18 = fneg double %3
%19 = fmul double %18, %2
%20 = tail call double @llvm.fmuladd.f64(double %0, double %5, double %19)
%21 = fneg double %11
%22 = fdiv double %20, %21
store double %22, double* %7
br label %23
23: ; preds = %8, %14
%24 = phi i32 [ 1, %14 ], [ 0, %8 ]
ret i32 %24
}