#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 */
double sqrt(double);
int intrsc_(double *p1, double *p2, double *cn, double *p, int *ier) {
  static int i__;
  static double t, d1, d2, pp[3], ppn;
  --p;
  --cn;
  --p2;
  --p1;
  d1 = cn[1] * p1[1] + cn[2] * p1[2] + cn[3] * p1[3];
  d2 = cn[1] * p2[1] + cn[2] * p2[2] + cn[3] * p2[3];
  if (d1 == d2) {
    *ier = 1;
    return 0;
  }
  t = d1 / (d1 - d2);
  ppn = 0.;
  for (i__ = 1; i__ <= 3; ++i__) {
    pp[i__ - 1] = p1[i__] + t * (p2[i__] - p1[i__]);
    ppn += pp[i__ - 1] * pp[i__ - 1];
  }
  if (ppn == 0.) {
    *ier = 2;
    return 0;
  }
  ppn = sqrt(ppn);
  for (i__ = 1; i__ <= 3; ++i__) {
    p[i__] = pp[i__ - 1] / ppn;
  }
  *ier = 0;
  return 0;
}


x86 assembly (clang, -O0):
<intrsc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2ea6(%rip)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2e60(%rip)
movsd  0x2e50(%rip),%xmm0
ucomisd 0x2e50(%rip),%xmm0
jne    122a <intrsc_+0x11a>
jp     122a <intrsc_+0x11a>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    13d6 <intrsc_+0x2c6>
movsd  0x2e1e(%rip),%xmm0
movsd  0x2e16(%rip),%xmm1
subsd  0x2e16(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2dfa(%rip)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2e1f(%rip)
movl   $0x1,0x2ddd(%rip)
cmpl   $0x3,0x2dd6(%rip)
jg     1324 <intrsc_+0x214>
mov    -0x10(%rbp),%rax
movslq 0x2dc5(%rip),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0x2dc0(%rip),%xmm0
mov    -0x18(%rbp),%rax
movslq 0x2dad(%rip),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x10(%rbp),%rax
movslq 0x2d9d(%rip),%rcx
subsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x2d8a(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d9d(%rip),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2d72(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d85(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    0x2d5a(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d6d(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movsd  0x2d78(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2d68(%rip)
mov    0x2d2a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2d21(%rip)
jmp    1263 <intrsc_+0x153>
movsd  0x2d4c(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1355 <intrsc_+0x245>
jp     1355 <intrsc_+0x245>
mov    -0x30(%rbp),%rax
movl   $0x2,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    13d6 <intrsc_+0x2c6>
movsd  0x2d1b(%rip),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,0x2d0e(%rip)
movl   $0x1,0x2ccc(%rip)
cmpl   $0x3,0x2cc5(%rip)
jg     13c5 <intrsc_+0x2b5>
mov    0x2cb9(%rip),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2ccc(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
divsd  0x2cd7(%rip),%xmm0
mov    -0x28(%rbp),%rax
movslq 0x2c94(%rip),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2c89(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c80(%rip)
jmp    1374 <intrsc_+0x264>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrsc_>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%rbx
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm9
movsd  0x10(%rdi),%xmm8
movsd  (%rsi),%xmm3
movsd  0x8(%rsi),%xmm1
movsd  (%rdx),%xmm0
movsd  0x8(%rdx),%xmm6
movsd  0x10(%rdx),%xmm7
unpcklpd %xmm6,%xmm6
movapd %xmm9,%xmm4
unpcklpd %xmm1,%xmm4
mulpd  %xmm6,%xmm4
unpcklpd %xmm0,%xmm0
movapd %xmm2,%xmm5
unpcklpd %xmm3,%xmm5
mulpd  %xmm0,%xmm5
addpd  %xmm4,%xmm5
movsd  0x10(%rsi),%xmm0
unpcklpd %xmm7,%xmm7
movapd %xmm8,%xmm6
unpcklpd %xmm0,%xmm6
mulpd  %xmm7,%xmm6
addpd  %xmm5,%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
mov    $0x1,%eax
ucomisd %xmm7,%xmm6
jne    1196 <intrsc_+0x86>
jnp    124c <intrsc_+0x13c>
movapd %xmm6,%xmm4
subsd  %xmm7,%xmm4
divsd  %xmm4,%xmm6
subsd  %xmm2,%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x2e8a(%rip)
mulsd  %xmm3,%xmm3
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm3
subsd  %xmm9,%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm9,%xmm1
movsd  %xmm1,0x2e78(%rip)
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
subsd  %xmm8,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm8,%xmm0
movsd  %xmm0,0x2e6a(%rip)
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    $0x2,%eax
ucomisd %xmm2,%xmm0
jne    120b <intrsc_+0xfb>
jnp    124c <intrsc_+0x13c>
mov    %rcx,%r14
jb     1216 <intrsc_+0x106>
sqrtsd %xmm0,%xmm0
jmp    121b <intrsc_+0x10b>
call   1030 <sqrt@plt>
movsd  0x2e1d(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x2e1c(%rip),%xmm1
movhpd 0x2e24(%rip),%xmm1
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
movupd %xmm1,0x8(%r14)
xor    %eax,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@intrsc_.i__ = internal global i32 0
@intrsc_.t = internal global double 0.000000e+00
@intrsc_.d1 = internal global double 0.000000e+00
@intrsc_.d2 = internal global double 0.000000e+00
@intrsc_.pp = internal global [3 x double] zeroinitializer
@intrsc_.ppn = internal global double 0.000000e+00
define i32 @intrsc_(double* %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32*
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store i32* %4, i32** %11
%12 = load double*, double** %10
%13 = getelementptr inbounds double, double* %12, i32 -1
store double* %13, double** %10
%14 = load double*, double** %9
%15 = getelementptr inbounds double, double* %14, i32 -1
store double* %15, double** %9
%16 = load double*, double** %8
%17 = getelementptr inbounds double, double* %16, i32 -1
store double* %17, double** %8
%18 = load double*, double** %7
%19 = getelementptr inbounds double, double* %18, i32 -1
store double* %19, double** %7
%20 = load double*, double** %9
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %7
%24 = getelementptr inbounds double, double* %23, i64 1
%25 = load double, double* %24
%26 = load double*, double** %9
%27 = getelementptr inbounds double, double* %26, i64 2
%28 = load double, double* %27
%29 = load double*, double** %7
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double, double* %30
%32 = fmul double %28, %31
%33 = call double @llvm.fmuladd.f64(double %22, double %25, double %32)
%34 = load double*, double** %9
%35 = getelementptr inbounds double, double* %34, i64 3
%36 = load double, double* %35
%37 = load double*, double** %7
%38 = getelementptr inbounds double, double* %37, i64 3
%39 = load double, double* %38
%40 = call double @llvm.fmuladd.f64(double %36, double %39, double %33)
store double %40, double* @intrsc_.d1
%41 = load double*, double** %9
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %8
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = load double*, double** %9
%48 = getelementptr inbounds double, double* %47, i64 2
%49 = load double, double* %48
%50 = load double*, double** %8
%51 = getelementptr inbounds double, double* %50, i64 2
%52 = load double, double* %51
%53 = fmul double %49, %52
%54 = call double @llvm.fmuladd.f64(double %43, double %46, double %53)
%55 = load double*, double** %9
%56 = getelementptr inbounds double, double* %55, i64 3
%57 = load double, double* %56
%58 = load double*, double** %8
%59 = getelementptr inbounds double, double* %58, i64 3
%60 = load double, double* %59
%61 = call double @llvm.fmuladd.f64(double %57, double %60, double %54)
store double %61, double* @intrsc_.d2
%62 = load double, double* @intrsc_.d1
%63 = load double, double* @intrsc_.d2
%64 = fcmp oeq double %62, %63
br i1 %64, label %65, label %67
65: ; preds = %5
%66 = load i32*, i32** %11
store i32 1, i32* %66
store i32 0, i32* %6
br label %142
67: ; preds = %5
%68 = load double, double* @intrsc_.d1
%69 = load double, double* @intrsc_.d1
%70 = load double, double* @intrsc_.d2
%71 = fsub double %69, %70
%72 = fdiv double %68, %71
store double %72, double* @intrsc_.t
store double 0.000000e+00, double* @intrsc_.ppn
store i32 1, i32* @intrsc_.i__
br label %73
73: ; preds = %111, %67
%74 = load i32, i32* @intrsc_.i__
%75 = icmp sle i32 %74, 3
br i1 %75, label %76, label %114
76: ; preds = %73
%77 = load double*, double** %7
%78 = load i32, i32* @intrsc_.i__
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
%81 = load double, double* %80
%82 = load double, double* @intrsc_.t
%83 = load double*, double** %8
%84 = load i32, i32* @intrsc_.i__
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %7
%89 = load i32, i32* @intrsc_.i__
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = fsub double %87, %92
%94 = call double @llvm.fmuladd.f64(double %82, double %93, double %81)
%95 = load i32, i32* @intrsc_.i__
%96 = sub nsw i32 %95, 1
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x double], [3 x double]* @intrsc_.pp, i64 0, i64 %97
store double %94, double* %98
%99 = load i32, i32* @intrsc_.i__
%100 = sub nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [3 x double], [3 x double]* @intrsc_.pp, i64 0, i64 %101
%103 = load double, double* %102
%104 = load i32, i32* @intrsc_.i__
%105 = sub nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [3 x double], [3 x double]* @intrsc_.pp, i64 0, i64 %106
%108 = load double, double* %107
%109 = load double, double* @intrsc_.ppn
%110 = call double @llvm.fmuladd.f64(double %103, double %108, double %109)
store double %110, double* @intrsc_.ppn
br label %111
111: ; preds = %76
%112 = load i32, i32* @intrsc_.i__
%113 = add nsw i32 %112, 1
store i32 %113, i32* @intrsc_.i__
br label %73
114: ; preds = %73
%115 = load double, double* @intrsc_.ppn
%116 = fcmp oeq double %115, 0.000000e+00
br i1 %116, label %117, label %119
117: ; preds = %114
%118 = load i32*, i32** %11
store i32 2, i32* %118
store i32 0, i32* %6
br label %142
119: ; preds = %114
%120 = load double, double* @intrsc_.ppn
%121 = call double @sqrt(double %120)
store double %121, double* @intrsc_.ppn
store i32 1, i32* @intrsc_.i__
br label %122
122: ; preds = %137, %119
%123 = load i32, i32* @intrsc_.i__
%124 = icmp sle i32 %123, 3
br i1 %124, label %125, label %140
125: ; preds = %122
%126 = load i32, i32* @intrsc_.i__
%127 = sub nsw i32 %126, 1
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [3 x double], [3 x double]* @intrsc_.pp, i64 0, i64 %128
%130 = load double, double* %129
%131 = load double, double* @intrsc_.ppn
%132 = fdiv double %130, %131
%133 = load double*, double** %10
%134 = load i32, i32* @intrsc_.i__
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
store double %132, double* %136
br label %137
137: ; preds = %125
%138 = load i32, i32* @intrsc_.i__
%139 = add nsw i32 %138, 1
store i32 %139, i32* @intrsc_.i__
br label %122
140: ; preds = %122
%141 = load i32*, i32** %11
store i32 0, i32* %141
store i32 0, i32* %6
br label %142
142: ; preds = %140, %117, %65
%143 = load i32, i32* %6
ret i32 %143
}

LLVM IR (-O2):
@intrsc_.pp.0 = internal unnamed_addr global double 0.000000e+00
@intrsc_.pp.1 = internal unnamed_addr global double 0.000000e+00
@intrsc_.pp.2 = internal unnamed_addr global double 0.000000e+00
define i32 @intrsc_(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = load double, double* %2
%7 = load double, double* %0
%8 = getelementptr inbounds double, double* %2, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %2, i64 2
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 2
%15 = load double, double* %14
%16 = load double, double* %1
%17 = getelementptr inbounds double, double* %1, i64 1
%18 = load double, double* %17
%19 = insertelement <2 x double> poison, double %9, i64 0
%20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
%21 = insertelement <2 x double> poison, double %11, i64 0
%22 = insertelement <2 x double> %21, double %18, i64 1
%23 = fmul <2 x double> %20, %22
%24 = insertelement <2 x double> poison, double %6, i64 0
%25 = shufflevector <2 x double> %24, <2 x double> poison, <2 x i32> zeroinitializer
%26 = insertelement <2 x double> poison, double %7, i64 0
%27 = insertelement <2 x double> %26, double %16, i64 1
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %27, <2 x double> %23)
%29 = getelementptr inbounds double, double* %1, i64 2
%30 = load double, double* %29
%31 = insertelement <2 x double> poison, double %13, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = insertelement <2 x double> poison, double %15, i64 0
%34 = insertelement <2 x double> %33, double %30, i64 1
%35 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %32, <2 x double> %34, <2 x double> %28)
%36 = extractelement <2 x double> %35, i64 0
%37 = extractelement <2 x double> %35, i64 1
%38 = fcmp oeq double %36, %37
br i1 %38, label %65, label %39
39: ; preds = %5
%40 = fsub double %36, %37
%41 = fdiv double %36, %40
%42 = fsub double %16, %7
%43 = tail call double @llvm.fmuladd.f64(double %41, double %42, double %7)
store double %43, double* @intrsc_.pp.0
%44 = tail call double @llvm.fmuladd.f64(double %43, double %43, double 0.000000e+00)
%45 = fsub double %18, %11
%46 = tail call double @llvm.fmuladd.f64(double %41, double %45, double %11)
store double %46, double* @intrsc_.pp.1
%47 = tail call double @llvm.fmuladd.f64(double %46, double %46, double %44)
%48 = fsub double %30, %15
%49 = tail call double @llvm.fmuladd.f64(double %41, double %48, double %15)
store double %49, double* @intrsc_.pp.2
%50 = tail call double @llvm.fmuladd.f64(double %49, double %49, double %47)
%51 = fcmp oeq double %50, 0.000000e+00
br i1 %51, label %65, label %52
52: ; preds = %39
%53 = tail call double @sqrt(double %50)
%54 = load double, double* @intrsc_.pp.0
%55 = fdiv double %54, %53
store double %55, double* %3
%56 = load double, double* @intrsc_.pp.1
%57 = getelementptr inbounds double, double* %3, i64 1
%58 = load double, double* @intrsc_.pp.2
%59 = insertelement <2 x double> poison, double %56, i64 0
%60 = insertelement <2 x double> %59, double %58, i64 1
%61 = insertelement <2 x double> poison, double %53, i64 0
%62 = shufflevector <2 x double> %61, <2 x double> poison, <2 x i32> zeroinitializer
%63 = fdiv <2 x double> %60, %62
%64 = bitcast double* %57 to <2 x double>*
store <2 x double> %63, <2 x double>* %64
br label %65
65: ; preds = %39, %5, %52
%66 = phi i32 [ 0, %52 ], [ 1, %5 ], [ 2, %39 ]
store i32 %66, i32* %4
ret i32 0
}