#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 */
float dot(float, float, float, float);
float pow(float, double);
int collide(float rx1, float ry1, float vx1, float vy1, float rad1, float rx2,
            float ry2, float vx2, float vy2, float rad2, float *t) {
  float d;
  d = pow(dot(vx1 - vx2, vy1 - vy2, rx1 - rx2, ry1 - ry2), 2) -
      dot(vx1 - vx2, vy1 - vy2, vx1 - vx2, vy1 - vy2) *
          (dot(rx1 - rx2, ry1 - ry2, rx1 - rx2, ry1 - ry2) -
           pow(rad1 + rad2, 2));
  if (dot(vx1 - vx2, vy1 - vy2, rx1 - rx2, ry1 - ry2) >= 0 || d < 0)
    return 0;
  else {
    *t = -(dot(vx1 - vx2, vy1 - vy2, rx1 - rx2, ry1 - ry2) + pow(d, 0.5)) /
         (dot(vx1 - vx2, vy1 - vy2, vx1 - vx2, vy1 - vy2));
    return 1;
  }
}


x86 assembly (clang, -O0):
<collide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  0x18(%rbp),%xmm8
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
movss  %xmm5,-0x1c(%rbp)
movss  %xmm6,-0x20(%rbp)
movss  %xmm7,-0x24(%rbp)
mov    %rdi,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x1c(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
subss  -0x20(%rbp),%xmm3
call   1030 <dot@plt>
movsd  0xe6b(%rip),%xmm1
call   1040 <pow@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0x24(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
subss  0x10(%rbp),%xmm3
call   1030 <dot@plt>
movss  %xmm0,-0x38(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x20(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x1c(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
subss  -0x20(%rbp),%xmm3
call   1030 <dot@plt>
movss  %xmm0,-0x40(%rbp)
movss  -0x18(%rbp),%xmm0
addss  0x18(%rbp),%xmm0
movsd  0xdeb(%rip),%xmm1
call   1040 <pow@plt>
movss  -0x40(%rbp),%xmm2
movss  -0x3c(%rbp),%xmm1
movaps %xmm0,%xmm3
movss  -0x38(%rbp),%xmm0
subss  %xmm3,%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x1c(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
subss  -0x20(%rbp),%xmm3
call   1030 <dot@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    1290 <collide+0x170>
xorps  %xmm0,%xmm0
ucomiss -0x34(%rbp),%xmm0
jbe    129c <collide+0x17c>
movl   $0x0,-0x4(%rbp)
jmp    1346 <collide+0x226>
movss  -0x10(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x1c(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
subss  -0x20(%rbp),%xmm3
call   1030 <dot@plt>
movss  %xmm0,-0x48(%rbp)
movss  -0x34(%rbp),%xmm0
movsd  0xd2d(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x48(%rbp),%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
subss  -0x24(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
subss  0x10(%rbp),%xmm3
call   1030 <dot@plt>
movaps %xmm0,%xmm1
movss  -0x44(%rbp),%xmm0
divss  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collide>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
movss  %xmm4,0x14(%rsp)
movaps %xmm3,%xmm4
movaps %xmm1,%xmm8
movaps %xmm0,%xmm3
movaps %xmm2,%xmm0
subss  %xmm7,%xmm0
movss  %xmm0,0xc(%rsp)
subss  0x50(%rsp),%xmm4
movss  %xmm4,0x10(%rsp)
subss  %xmm5,%xmm3
movss  %xmm3,0x1c(%rsp)
subss  %xmm6,%xmm8
movss  %xmm8,0x20(%rsp)
movaps %xmm4,%xmm1
movaps %xmm3,%xmm2
movaps %xmm8,%xmm3
call   1030 <dot@plt>
movsd  0xe82(%rip),%xmm1
call   1040 <pow@plt>
movss  %xmm0,0x18(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1030 <dot@plt>
movss  %xmm0,0x3c(%rsp)
movss  0x1c(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1030 <dot@plt>
movss  %xmm0,0x38(%rsp)
movss  0x14(%rsp),%xmm0
addss  0x58(%rsp),%xmm0
movsd  0xe29(%rip),%xmm1
call   1040 <pow@plt>
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x20(%rsp),%xmm3
call   1030 <dot@plt>
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    12a9 <collide+0x189>
movss  0x38(%rsp),%xmm0
subss  0x14(%rsp),%xmm0
movss  0x3c(%rsp),%xmm2
mulss  %xmm0,%xmm2
movss  0x18(%rsp),%xmm3
subss  %xmm2,%xmm3
ucomiss %xmm3,%xmm1
ja     12a9 <collide+0x189>
movss  %xmm3,0x18(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x20(%rsp),%xmm3
call   1030 <dot@plt>
movss  %xmm0,0x20(%rsp)
movsd  0xda5(%rip),%xmm1
movss  0x18(%rsp),%xmm0
call   1040 <pow@plt>
addss  0x20(%rsp),%xmm0
xorps  0xd95(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1030 <dot@plt>
movaps 0x20(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @collide(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float* %10) {
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float*
%24 = alloca float
store float %0, float* %13
store float %1, float* %14
store float %2, float* %15
store float %3, float* %16
store float %4, float* %17
store float %5, float* %18
store float %6, float* %19
store float %7, float* %20
store float %8, float* %21
store float %9, float* %22
store float* %10, float** %23
%25 = load float, float* %15
%26 = load float, float* %20
%27 = fsub float %25, %26
%28 = load float, float* %16
%29 = load float, float* %21
%30 = fsub float %28, %29
%31 = load float, float* %13
%32 = load float, float* %18
%33 = fsub float %31, %32
%34 = load float, float* %14
%35 = load float, float* %19
%36 = fsub float %34, %35
%37 = call float @dot(float %27, float %30, float %33, float %36)
%38 = call float @pow(float %37, double 2.000000e+00)
%39 = load float, float* %15
%40 = load float, float* %20
%41 = fsub float %39, %40
%42 = load float, float* %16
%43 = load float, float* %21
%44 = fsub float %42, %43
%45 = load float, float* %15
%46 = load float, float* %20
%47 = fsub float %45, %46
%48 = load float, float* %16
%49 = load float, float* %21
%50 = fsub float %48, %49
%51 = call float @dot(float %41, float %44, float %47, float %50)
%52 = load float, float* %13
%53 = load float, float* %18
%54 = fsub float %52, %53
%55 = load float, float* %14
%56 = load float, float* %19
%57 = fsub float %55, %56
%58 = load float, float* %13
%59 = load float, float* %18
%60 = fsub float %58, %59
%61 = load float, float* %14
%62 = load float, float* %19
%63 = fsub float %61, %62
%64 = call float @dot(float %54, float %57, float %60, float %63)
%65 = load float, float* %17
%66 = load float, float* %22
%67 = fadd float %65, %66
%68 = call float @pow(float %67, double 2.000000e+00)
%69 = fsub float %64, %68
%70 = fneg float %51
%71 = call float @llvm.fmuladd.f32(float %70, float %69, float %38)
store float %71, float* %24
%72 = load float, float* %15
%73 = load float, float* %20
%74 = fsub float %72, %73
%75 = load float, float* %16
%76 = load float, float* %21
%77 = fsub float %75, %76
%78 = load float, float* %13
%79 = load float, float* %18
%80 = fsub float %78, %79
%81 = load float, float* %14
%82 = load float, float* %19
%83 = fsub float %81, %82
%84 = call float @dot(float %74, float %77, float %80, float %83)
%85 = fcmp oge float %84, 0.000000e+00
br i1 %85, label %89, label %86
86: ; preds = %11
%87 = load float, float* %24
%88 = fcmp olt float %87, 0.000000e+00
br i1 %88, label %89, label %90
89: ; preds = %86, %11
store i32 0, i32* %12
br label %123
90: ; preds = %86
%91 = load float, float* %15
%92 = load float, float* %20
%93 = fsub float %91, %92
%94 = load float, float* %16
%95 = load float, float* %21
%96 = fsub float %94, %95
%97 = load float, float* %13
%98 = load float, float* %18
%99 = fsub float %97, %98
%100 = load float, float* %14
%101 = load float, float* %19
%102 = fsub float %100, %101
%103 = call float @dot(float %93, float %96, float %99, float %102)
%104 = load float, float* %24
%105 = call float @pow(float %104, double 5.000000e-01)
%106 = fadd float %103, %105
%107 = fneg float %106
%108 = load float, float* %15
%109 = load float, float* %20
%110 = fsub float %108, %109
%111 = load float, float* %16
%112 = load float, float* %21
%113 = fsub float %111, %112
%114 = load float, float* %15
%115 = load float, float* %20
%116 = fsub float %114, %115
%117 = load float, float* %16
%118 = load float, float* %21
%119 = fsub float %117, %118
%120 = call float @dot(float %110, float %113, float %116, float %119)
%121 = fdiv float %107, %120
%122 = load float*, float** %23
store float %121, float* %122
store i32 1, i32* %12
br label %123
123: ; preds = %90, %89
%124 = load i32, i32* %12
ret i32 %124
}

LLVM IR (-O2):
define i32 @collide(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float* nocapture writeonly %10) {
%12 = fsub float %2, %7
%13 = fsub float %3, %8
%14 = fsub float %0, %5
%15 = fsub float %1, %6
%16 = tail call float @dot(float %12, float %13, float %14, float %15)
%17 = tail call float @pow(float %16, double 2.000000e+00)
%18 = tail call float @dot(float %12, float %13, float %12, float %13)
%19 = tail call float @dot(float %14, float %15, float %14, float %15)
%20 = fadd float %4, %9
%21 = tail call float @pow(float %20, double 2.000000e+00)
%22 = fsub float %19, %21
%23 = fneg float %18
%24 = tail call float @llvm.fmuladd.f32(float %23, float %22, float %17)
%25 = tail call float @dot(float %12, float %13, float %14, float %15)
%26 = fcmp oge float %25, 0.000000e+00
%27 = fcmp olt float %24, 0.000000e+00
%28 = select i1 %26, i1 true, i1 %27
br i1 %28, label %36, label %29
29: ; preds = %11
%30 = tail call float @dot(float %12, float %13, float %14, float %15)
%31 = tail call float @pow(float %24, double 5.000000e-01)
%32 = fadd float %30, %31
%33 = fneg float %32
%34 = tail call float @dot(float %12, float %13, float %12, float %13)
%35 = fdiv float %33, %34
store float %35, float* %10
br label %36
36: ; preds = %11, %29
%37 = phi i32 [ 1, %29 ], [ 0, %11 ]
ret i32 %37
}