#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 find_min_quartic_root_in_real_interval(double *, double, double);
double find_collision_time(double a_i[3][3], double a_j[3][3], double R,
                           double t0, double t1) {
  double a_ji[3][3] = {
      {a_i[0][0] - a_j[0][0], a_i[0][1] - a_j[0][1], a_i[0][2] - a_j[0][2]},
      {a_i[1][0] - a_j[1][0], a_i[1][1] - a_j[1][1], a_i[1][2] - a_j[1][2]},
      {a_i[2][0] - a_j[2][0], a_i[2][1] - a_j[2][1], a_i[2][2] - a_j[2][2]}};
  double a_x = a_ji[2][0];
  double a_y = a_ji[2][2];
  double b_x = a_ji[1][0];
  double b_y = a_ji[1][2];
  double c_x = a_ji[0][0];
  double c_y = a_ji[0][2];
  double p[5];
  p[4] = a_x * a_x + a_y * a_y;
  p[3] = 2 * (a_x * b_x + a_y * b_y);
  p[2] = b_x * b_x + b_y * b_y + 2 * (a_x * c_x + a_y * c_y);
  p[1] = 2 * (b_x * c_x + b_y * c_y);
  p[0] = c_x * c_x + c_y * c_y - 4 * R * R;
  return find_min_quartic_root_in_real_interval(p, t0, t1);
}


x86 assembly (clang, -O0):
<find_collision_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x40(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd73(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x80(%rbp),%xmm2
mulsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcdd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xc99(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
lea    -0xd0(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <find_min_quartic_root_in_real_interval@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_collision_time>:
sub    $0x28,%rsp
movsd  (%rdi),%xmm10
movsd  0x10(%rdi),%xmm8
subsd  (%rsi),%xmm10
subsd  0x10(%rsi),%xmm8
movsd  0x18(%rdi),%xmm5
subsd  0x18(%rsi),%xmm5
movsd  0x28(%rdi),%xmm7
subsd  0x28(%rsi),%xmm7
movsd  0x30(%rdi),%xmm3
subsd  0x30(%rsi),%xmm3
movsd  0x40(%rdi),%xmm4
subsd  0x40(%rsi),%xmm4
movaps %xmm2,%xmm9
movapd %xmm4,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm3,%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm2,%xmm6
movsd  %xmm6,0x20(%rsp)
movapd %xmm7,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm3,%xmm6
mulsd  %xmm5,%xmm6
addsd  %xmm2,%xmm6
addsd  %xmm6,%xmm6
movsd  %xmm6,0x18(%rsp)
movapd %xmm8,%xmm2
mulsd  %xmm7,%xmm2
mulsd  %xmm7,%xmm7
movapd %xmm5,%xmm6
mulsd  %xmm5,%xmm6
addsd  %xmm7,%xmm6
mulsd  %xmm8,%xmm4
mulsd  %xmm10,%xmm3
addsd  %xmm4,%xmm3
addsd  %xmm3,%xmm3
addsd  %xmm6,%xmm3
movsd  %xmm3,0x10(%rsp)
mulsd  %xmm10,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm5,%xmm5
movsd  %xmm5,0x8(%rsp)
mulsd  %xmm8,%xmm8
mulsd  %xmm10,%xmm10
addsd  %xmm8,%xmm10
movsd  0xe13(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm10,%xmm2
movsd  %xmm2,(%rsp)
mov    %rsp,%rdi
movaps %xmm1,%xmm0
movaps %xmm9,%xmm1
call   1030 <find_min_quartic_root_in_real_interval@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @find_collision_time([3 x double]* %0, [3 x double]* %1, double %2, double %3, double %4) {
%6 = alloca [3 x double]*
%7 = alloca [3 x double]*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca [3 x [3 x double]]
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca [5 x double]
store [3 x double]* %0, [3 x double]** %6
store [3 x double]* %1, [3 x double]** %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%19 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0
%20 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 0
%21 = load [3 x double]*, [3 x double]** %6
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0
%23 = getelementptr inbounds [3 x double], [3 x double]* %22, i64 0, i64 0
%24 = load double, double* %23
%25 = load [3 x double]*, [3 x double]** %7
%26 = getelementptr inbounds [3 x double], [3 x double]* %25, i64 0
%27 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 0, i64 0
%28 = load double, double* %27
%29 = fsub double %24, %28
store double %29, double* %20
%30 = getelementptr inbounds double, double* %20, i64 1
%31 = load [3 x double]*, [3 x double]** %6
%32 = getelementptr inbounds [3 x double], [3 x double]* %31, i64 0
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 0, i64 1
%34 = load double, double* %33
%35 = load [3 x double]*, [3 x double]** %7
%36 = getelementptr inbounds [3 x double], [3 x double]* %35, i64 0
%37 = getelementptr inbounds [3 x double], [3 x double]* %36, i64 0, i64 1
%38 = load double, double* %37
%39 = fsub double %34, %38
store double %39, double* %30
%40 = getelementptr inbounds double, double* %30, i64 1
%41 = load [3 x double]*, [3 x double]** %6
%42 = getelementptr inbounds [3 x double], [3 x double]* %41, i64 0
%43 = getelementptr inbounds [3 x double], [3 x double]* %42, i64 0, i64 2
%44 = load double, double* %43
%45 = load [3 x double]*, [3 x double]** %7
%46 = getelementptr inbounds [3 x double], [3 x double]* %45, i64 0
%47 = getelementptr inbounds [3 x double], [3 x double]* %46, i64 0, i64 2
%48 = load double, double* %47
%49 = fsub double %44, %48
store double %49, double* %40
%50 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 1
%51 = getelementptr inbounds [3 x double], [3 x double]* %50, i64 0, i64 0
%52 = load [3 x double]*, [3 x double]** %6
%53 = getelementptr inbounds [3 x double], [3 x double]* %52, i64 1
%54 = getelementptr inbounds [3 x double], [3 x double]* %53, i64 0, i64 0
%55 = load double, double* %54
%56 = load [3 x double]*, [3 x double]** %7
%57 = getelementptr inbounds [3 x double], [3 x double]* %56, i64 1
%58 = getelementptr inbounds [3 x double], [3 x double]* %57, i64 0, i64 0
%59 = load double, double* %58
%60 = fsub double %55, %59
store double %60, double* %51
%61 = getelementptr inbounds double, double* %51, i64 1
%62 = load [3 x double]*, [3 x double]** %6
%63 = getelementptr inbounds [3 x double], [3 x double]* %62, i64 1
%64 = getelementptr inbounds [3 x double], [3 x double]* %63, i64 0, i64 1
%65 = load double, double* %64
%66 = load [3 x double]*, [3 x double]** %7
%67 = getelementptr inbounds [3 x double], [3 x double]* %66, i64 1
%68 = getelementptr inbounds [3 x double], [3 x double]* %67, i64 0, i64 1
%69 = load double, double* %68
%70 = fsub double %65, %69
store double %70, double* %61
%71 = getelementptr inbounds double, double* %61, i64 1
%72 = load [3 x double]*, [3 x double]** %6
%73 = getelementptr inbounds [3 x double], [3 x double]* %72, i64 1
%74 = getelementptr inbounds [3 x double], [3 x double]* %73, i64 0, i64 2
%75 = load double, double* %74
%76 = load [3 x double]*, [3 x double]** %7
%77 = getelementptr inbounds [3 x double], [3 x double]* %76, i64 1
%78 = getelementptr inbounds [3 x double], [3 x double]* %77, i64 0, i64 2
%79 = load double, double* %78
%80 = fsub double %75, %79
store double %80, double* %71
%81 = getelementptr inbounds [3 x double], [3 x double]* %50, i64 1
%82 = getelementptr inbounds [3 x double], [3 x double]* %81, i64 0, i64 0
%83 = load [3 x double]*, [3 x double]** %6
%84 = getelementptr inbounds [3 x double], [3 x double]* %83, i64 2
%85 = getelementptr inbounds [3 x double], [3 x double]* %84, i64 0, i64 0
%86 = load double, double* %85
%87 = load [3 x double]*, [3 x double]** %7
%88 = getelementptr inbounds [3 x double], [3 x double]* %87, i64 2
%89 = getelementptr inbounds [3 x double], [3 x double]* %88, i64 0, i64 0
%90 = load double, double* %89
%91 = fsub double %86, %90
store double %91, double* %82
%92 = getelementptr inbounds double, double* %82, i64 1
%93 = load [3 x double]*, [3 x double]** %6
%94 = getelementptr inbounds [3 x double], [3 x double]* %93, i64 2
%95 = getelementptr inbounds [3 x double], [3 x double]* %94, i64 0, i64 1
%96 = load double, double* %95
%97 = load [3 x double]*, [3 x double]** %7
%98 = getelementptr inbounds [3 x double], [3 x double]* %97, i64 2
%99 = getelementptr inbounds [3 x double], [3 x double]* %98, i64 0, i64 1
%100 = load double, double* %99
%101 = fsub double %96, %100
store double %101, double* %92
%102 = getelementptr inbounds double, double* %92, i64 1
%103 = load [3 x double]*, [3 x double]** %6
%104 = getelementptr inbounds [3 x double], [3 x double]* %103, i64 2
%105 = getelementptr inbounds [3 x double], [3 x double]* %104, i64 0, i64 2
%106 = load double, double* %105
%107 = load [3 x double]*, [3 x double]** %7
%108 = getelementptr inbounds [3 x double], [3 x double]* %107, i64 2
%109 = getelementptr inbounds [3 x double], [3 x double]* %108, i64 0, i64 2
%110 = load double, double* %109
%111 = fsub double %106, %110
store double %111, double* %102
%112 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 2
%113 = getelementptr inbounds [3 x double], [3 x double]* %112, i64 0, i64 0
%114 = load double, double* %113
store double %114, double* %12
%115 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 2
%116 = getelementptr inbounds [3 x double], [3 x double]* %115, i64 0, i64 2
%117 = load double, double* %116
store double %117, double* %13
%118 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 1
%119 = getelementptr inbounds [3 x double], [3 x double]* %118, i64 0, i64 0
%120 = load double, double* %119
store double %120, double* %14
%121 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 1
%122 = getelementptr inbounds [3 x double], [3 x double]* %121, i64 0, i64 2
%123 = load double, double* %122
store double %123, double* %15
%124 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0
%125 = getelementptr inbounds [3 x double], [3 x double]* %124, i64 0, i64 0
%126 = load double, double* %125
store double %126, double* %16
%127 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0
%128 = getelementptr inbounds [3 x double], [3 x double]* %127, i64 0, i64 2
%129 = load double, double* %128
store double %129, double* %17
%130 = load double, double* %12
%131 = load double, double* %12
%132 = load double, double* %13
%133 = load double, double* %13
%134 = fmul double %132, %133
%135 = call double @llvm.fmuladd.f64(double %130, double %131, double %134)
%136 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 4
store double %135, double* %136
%137 = load double, double* %12
%138 = load double, double* %14
%139 = load double, double* %13
%140 = load double, double* %15
%141 = fmul double %139, %140
%142 = call double @llvm.fmuladd.f64(double %137, double %138, double %141)
%143 = fmul double 2.000000e+00, %142
%144 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 3
store double %143, double* %144
%145 = load double, double* %14
%146 = load double, double* %14
%147 = load double, double* %15
%148 = load double, double* %15
%149 = fmul double %147, %148
%150 = call double @llvm.fmuladd.f64(double %145, double %146, double %149)
%151 = load double, double* %12
%152 = load double, double* %16
%153 = load double, double* %13
%154 = load double, double* %17
%155 = fmul double %153, %154
%156 = call double @llvm.fmuladd.f64(double %151, double %152, double %155)
%157 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %156, double %150)
%158 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 2
store double %157, double* %158
%159 = load double, double* %14
%160 = load double, double* %16
%161 = load double, double* %15
%162 = load double, double* %17
%163 = fmul double %161, %162
%164 = call double @llvm.fmuladd.f64(double %159, double %160, double %163)
%165 = fmul double 2.000000e+00, %164
%166 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 1
store double %165, double* %166
%167 = load double, double* %16
%168 = load double, double* %16
%169 = load double, double* %17
%170 = load double, double* %17
%171 = fmul double %169, %170
%172 = call double @llvm.fmuladd.f64(double %167, double %168, double %171)
%173 = load double, double* %8
%174 = fmul double 4.000000e+00, %173
%175 = load double, double* %8
%176 = fneg double %174
%177 = call double @llvm.fmuladd.f64(double %176, double %175, double %172)
%178 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 0
store double %177, double* %178
%179 = getelementptr inbounds [5 x double], [5 x double]* %18, i64 0, i64 0
%180 = load double, double* %9
%181 = load double, double* %10
%182 = call double @find_min_quartic_root_in_real_interval(double* %179, double %180, double %181)
ret double %182
}

LLVM IR (-O2):
define double @find_collision_time([3 x double]* nocapture %0, [3 x double]* nocapture %1, double %2, double %3, double %4) {
%6 = alloca [5 x double]
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%13 = load double, double* %12
%14 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%15 = load double, double* %14
%16 = fsub double %13, %15
%17 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%18 = load double, double* %17
%19 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 0
%20 = load double, double* %19
%21 = fsub double %18, %20
%22 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%23 = load double, double* %22
%24 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%25 = load double, double* %24
%26 = fsub double %23, %25
%27 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%28 = load double, double* %27
%29 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 0
%30 = load double, double* %29
%31 = fsub double %28, %30
%32 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%33 = load double, double* %32
%34 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%35 = load double, double* %34
%36 = fsub double %33, %35
%37 = bitcast [5 x double]* %6 to i8*
%38 = fmul double %36, %36
%39 = tail call double @llvm.fmuladd.f64(double %31, double %31, double %38)
%40 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 4
store double %39, double* %40
%41 = fmul double %26, %36
%42 = tail call double @llvm.fmuladd.f64(double %31, double %21, double %41)
%43 = fmul double %42, 2.000000e+00
%44 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 3
store double %43, double* %44
%45 = fmul double %26, %26
%46 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %45)
%47 = fmul double %16, %36
%48 = tail call double @llvm.fmuladd.f64(double %31, double %11, double %47)
%49 = tail call double @llvm.fmuladd.f64(double %48, double 2.000000e+00, double %46)
%50 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 2
store double %49, double* %50
%51 = fmul double %16, %26
%52 = tail call double @llvm.fmuladd.f64(double %21, double %11, double %51)
%53 = fmul double %52, 2.000000e+00
%54 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 1
store double %53, double* %54
%55 = fmul double %16, %16
%56 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %55)
%57 = fmul double %2, -4.000000e+00
%58 = tail call double @llvm.fmuladd.f64(double %57, double %2, double %56)
%59 = getelementptr inbounds [5 x double], [5 x double]* %6, i64 0, i64 0
store double %58, double* %59
%60 = call double @find_min_quartic_root_in_real_interval(double* %59, double %3, double %4)
ret double %60
}