#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 */
struct confinement {
  int dummy;
};

/* Variables and functions */
double CF_fr(struct confinement *, double);
double sqrt(double);
void CF_cylinder(struct confinement *cf, double x, double y, double z, double a,
                 double x1, double y1, double z1, double x2, double y2,
                 double z2, double r_cyl, double *f) {
  double rx = x2 - x1;
  double ry = y2 - y1;
  double rz = z2 - z1;
  double r = sqrt(rx * rx + ry * ry + rz * rz);
  rx /= r;
  ry /= r;
  rz /= r;
  double px = x - x1;
  double py = y - y1;
  double pz = z - z1;
  double pr = px * rx + py * ry + pz * rz;
  double tx = pr * rx;
  double ty = pr * ry;
  double tz = pr * rz;
  double nx = px - tx;
  double ny = py - ty;
  double nz = pz - tz;
  double n2 = nx * nx + ny * ny + nz * nz;
  double ra = r_cyl - a;
  double ra2 = ra * ra;
  if (n2 <= ra2)
    return;
  double n = sqrt(n2);
  double dx = nx / n;
  double dy = ny / n;
  double dz = nz / n;
  double fr = CF_fr(cf, n - ra);
  f[0] += -fr * dx;
  f[1] += -fr * dy;
  f[2] += -fr * dz;
}


x86 assembly (clang, -O0):
<CF_cylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x10(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0x18(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1386 <CF_cylinder+0x266>
jmp    14b9 <CF_cylinder+0x399>
movsd  -0xc8(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
divsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
divsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0x8(%rbp),%rdi
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0xd0(%rbp),%xmm0
ff
call   1030 <CF_fr@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xe8(%rbp),%xmm2
ff
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xf0(%rbp),%xmm2
ff
mov    -0x50(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xf8(%rbp),%xmm2
ff
mov    -0x50(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CF_cylinder>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbx
movapd %xmm4,%xmm10
movapd %xmm0,%xmm4
mov    %rdi,%r14
movsd  0x90(%rsp),%xmm8
movsd  0x88(%rsp),%xmm9
movhpd 0x80(%rsp),%xmm7
unpcklpd %xmm5,%xmm10
subpd  %xmm10,%xmm7
subsd  %xmm6,%xmm9
movapd %xmm7,%xmm0
mulpd  %xmm7,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm7,%xmm5
mulsd  %xmm7,%xmm5
addsd  %xmm0,%xmm5
movapd %xmm9,%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm5,%xmm0
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm0
jb     1198 <CF_cylinder+0x78>
sqrtsd %xmm0,%xmm0
jmp    1208 <CF_cylinder+0xe8>
movsd  %xmm2,(%rsp)
movapd %xmm4,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
movapd %xmm7,0x50(%rsp)
movsd  %xmm9,0x28(%rsp)
movsd  %xmm6,0x20(%rsp)
movapd %xmm10,0x40(%rsp)
movaps %xmm1,0x30(%rsp)
call   1040 <sqrt@plt>
movapd 0x30(%rsp),%xmm1
movapd 0x40(%rsp),%xmm10
movsd  0x20(%rsp),%xmm6
movsd  0x28(%rsp),%xmm9
movapd 0x50(%rsp),%xmm7
movsd  0x8(%rsp),%xmm3
movsd  0x90(%rsp),%xmm8
movapd 0x10(%rsp),%xmm4
movsd  (%rsp),%xmm2
divsd  %xmm0,%xmm9
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm7
unpcklpd %xmm1,%xmm4
subpd  %xmm10,%xmm4
subsd  %xmm6,%xmm2
movapd %xmm4,%xmm0
mulpd  %xmm7,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm9
unpcklpd %xmm0,%xmm0
mulpd  %xmm7,%xmm0
subpd  %xmm0,%xmm4
subsd  %xmm9,%xmm2
movapd %xmm4,%xmm0
mulpd  %xmm4,%xmm0
unpckhpd %xmm0,%xmm0
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm3,%xmm8
movapd %xmm8,%xmm1
mulsd  %xmm8,%xmm1
ucomisd %xmm0,%xmm1
jae    1328 <CF_cylinder+0x208>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12aa <CF_cylinder+0x18a>
sqrtsd %xmm0,%xmm0
jmp    12d3 <CF_cylinder+0x1b3>
movsd  %xmm2,(%rsp)
movapd %xmm4,0x10(%rsp)
movsd  %xmm8,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm8
movapd 0x10(%rsp),%xmm4
movsd  (%rsp),%xmm2
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
divpd  %xmm1,%xmm4
movapd %xmm4,0x10(%rsp)
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
subsd  %xmm8,%xmm0
mov    %r14,%rdi
call   1030 <CF_fr@plt>
movupd (%rbx),%xmm1
movsd  (%rsp),%xmm2
mulsd  %xmm0,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  0x10(%rsp),%xmm0
subpd  %xmm0,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rbx)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

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