#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 /*<<< orphan*/ printf(char *, ...);
void compute_xlylzl(double s[], double f[], double p[4], double r[9],
                    double dist[3], double xlylzl[][3], int n) {
  double s_cen, f_cen, s_size, f_size, v[3];
  int i, j;
  s_cen = p[0];
  f_cen = p[1];
  s_size = p[2];
  f_size = p[3];
  v[0] = 0.0;
  if (0) {
    printf("s_cen %f f_cen %f s_size %f f_size %f\n", s_cen, f_cen, s_size,
           f_size);
    for (j = 0; j < 3; j++)
      printf("dist[%d]=%f ", j, dist[j]);
    for (j = 0; j < 9; j++)
      printf("r[%d]=%f ", j, r[j]);
    printf("\n");
  }
  for (i = 0; i < n; i++) {
    v[1] = (f[i] - f_cen) * f_size;
    v[2] = (s[i] - s_cen) * s_size;
    for (j = 0; j < 3; j++) {
      xlylzl[i][j] = r[3 * j + 1] * v[1] + r[3 * j + 2] * v[2] + dist[j];
    }
  }
}


x86 assembly (clang, -O0):
<compute_xlylzl>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1238 <compute_xlylzl+0x138>
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x40(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x74(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x78(%rbp)
cmpl   $0x3,-0x78(%rbp)
jge    1225 <compute_xlylzl+0x125>
mov    -0x20(%rbp),%rax
imul   $0x3,-0x78(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm2
mov    -0x20(%rbp),%rax
imul   $0x3,-0x78(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x78(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x74(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x78(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11b0 <compute_xlylzl+0xb0>
jmp    122a <compute_xlylzl+0x12a>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1165 <compute_xlylzl+0x65>
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_xlylzl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    0x38(%rsp),%eax
test   %eax,%eax
jle    1368 <compute_xlylzl+0x268>
movsd  (%rdx),%xmm12
movsd  0x8(%rdx),%xmm13
movsd  0x10(%rdx),%xmm14
movsd  0x18(%rdx),%xmm15
mov    %eax,%r10d
cmp    $0x1,%eax
jne    113c <compute_xlylzl+0x3c>
xor    %edx,%edx
jmp    12c9 <compute_xlylzl+0x1c9>
lea    0x8(%rcx),%r14
lea    (%r10,%r10,2),%rax
lea    (%r9,%rax,8),%rdx
lea    (%rsi,%r10,8),%rax
lea    (%rdi,%r10,8),%rbp
cmp    %r9,%rax
seta   %r12b
lea    0x48(%rcx),%rbx
cmp    %rsi,%rdx
seta   %r13b
lea    0x18(%r8),%r15
cmp    %r9,%rbp
seta   %al
cmp    %rdi,%rdx
seta   %bpl
cmp    %r9,%rbx
seta   %r11b
cmp    %rdx,%r14
setb   %r14b
cmp    %r9,%r15
seta   %bl
cmp    %r8,%rdx
seta   %r15b
xor    %edx,%edx
test   %r13b,%r12b
jne    12c9 <compute_xlylzl+0x1c9>
and    %bpl,%al
jne    12c9 <compute_xlylzl+0x1c9>
and    %r14b,%r11b
jne    12c9 <compute_xlylzl+0x1c9>
and    %r15b,%bl
jne    12c9 <compute_xlylzl+0x1c9>
mov    %r10d,%edx
and    $0xfffffffe,%edx
movapd %xmm13,%xmm8
unpcklpd %xmm13,%xmm8
movapd %xmm15,%xmm9
unpcklpd %xmm15,%xmm9
movapd %xmm12,%xmm10
unpcklpd %xmm12,%xmm10
movapd %xmm14,%xmm11
unpcklpd %xmm14,%xmm11
xor    %r11d,%r11d
mov    %r9,%rax
nopl   0x0(%rax,%rax,1)
movupd (%rsi,%r11,8),%xmm4
subpd  %xmm8,%xmm4
mulpd  %xmm9,%xmm4
movupd (%rdi,%r11,8),%xmm5
subpd  %xmm10,%xmm5
mulpd  %xmm11,%xmm5
movsd  0x8(%rcx),%xmm1
movsd  0x10(%rcx),%xmm0
movsd  0x20(%rcx),%xmm2
movsd  0x28(%rcx),%xmm3
unpcklpd %xmm1,%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm5,%xmm0
mulpd  %xmm4,%xmm1
addpd  %xmm0,%xmm1
movsd  (%r8),%xmm6
movsd  0x8(%r8),%xmm7
movsd  0x10(%r8),%xmm0
unpcklpd %xmm6,%xmm6
addpd  %xmm1,%xmm6
unpcklpd %xmm2,%xmm2
unpcklpd %xmm3,%xmm3
mulpd  %xmm5,%xmm3
mulpd  %xmm4,%xmm2
addpd  %xmm3,%xmm2
unpcklpd %xmm7,%xmm7
addpd  %xmm2,%xmm7
movsd  0x38(%rcx),%xmm1
unpcklpd %xmm1,%xmm1
movsd  0x40(%rcx),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm5,%xmm2
mulpd  %xmm4,%xmm1
addpd  %xmm2,%xmm1
unpcklpd %xmm0,%xmm0
addpd  %xmm1,%xmm0
movapd %xmm6,%xmm1
unpcklpd %xmm7,%xmm1
movsd  %xmm0,%xmm6
movhlps %xmm7,%xmm0
movups %xmm0,0x20(%rax)
movupd %xmm6,0x10(%rax)
movupd %xmm1,(%rax)
add    $0x2,%r11
add    $0x30,%rax
cmp    %r11,%rdx
jne    11f0 <compute_xlylzl+0xf0>
cmp    %r10,%rdx
je     1368 <compute_xlylzl+0x268>
lea    (%rdx,%rdx,2),%rax
lea    (%r9,%rax,8),%rax
add    $0x10,%rax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsi,%rdx,8),%xmm0
subsd  %xmm13,%xmm0
mulsd  %xmm15,%xmm0
movsd  (%rdi,%rdx,8),%xmm1
subsd  %xmm12,%xmm1
mulsd  %xmm14,%xmm1
movsd  0x10(%rcx),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x8(%rcx),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  (%r8),%xmm3
movsd  %xmm3,-0x10(%rax)
movsd  0x28(%rcx),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x20(%rcx),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  0x8(%r8),%xmm3
movsd  %xmm3,-0x8(%rax)
mulsd  0x40(%rcx),%xmm1
mulsd  0x38(%rcx),%xmm0
addsd  %xmm1,%xmm0
addsd  0x10(%r8),%xmm0
movsd  %xmm0,(%rax)
add    $0x1,%rdx
add    $0x18,%rax
cmp    %rdx,%r10
jne    12e0 <compute_xlylzl+0x1e0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @compute_xlylzl(double* %0, double* %1, double* %2, double* %3, double* %4, [3 x double]* %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca [3 x double]*
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca [3 x double]
%20 = alloca i32
%21 = alloca i32
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store [3 x double]* %5, [3 x double]** %13
store i32 %6, i32* %14
%22 = load double*, double** %10
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
store double %24, double* %15
%25 = load double*, double** %10
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
store double %27, double* %16
%28 = load double*, double** %10
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
store double %30, double* %17
%31 = load double*, double** %10
%32 = getelementptr inbounds double, double* %31, i64 3
%33 = load double, double* %32
store double %33, double* %18
%34 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 0
store double 0.000000e+00, double* %34
store i32 0, i32* %20
br label %35
35: ; preds = %101, %7
%36 = load i32, i32* %20
%37 = load i32, i32* %14
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %104
39: ; preds = %35
%40 = load double*, double** %9
%41 = load i32, i32* %20
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = load double, double* %43
%45 = load double, double* %16
%46 = fsub double %44, %45
%47 = load double, double* %18
%48 = fmul double %46, %47
%49 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 1
store double %48, double* %49
%50 = load double*, double** %8
%51 = load i32, i32* %20
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
%54 = load double, double* %53
%55 = load double, double* %15
%56 = fsub double %54, %55
%57 = load double, double* %17
%58 = fmul double %56, %57
%59 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 2
store double %58, double* %59
store i32 0, i32* %21
br label %60
60: ; preds = %97, %39
%61 = load i32, i32* %21
%62 = icmp slt i32 %61, 3
br i1 %62, label %63, label %100
63: ; preds = %60
%64 = load double*, double** %11
%65 = load i32, i32* %21
%66 = mul nsw i32 3, %65
%67 = add nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %64, i64 %68
%70 = load double, double* %69
%71 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 1
%72 = load double, double* %71
%73 = load double*, double** %11
%74 = load i32, i32* %21
%75 = mul nsw i32 3, %74
%76 = add nsw i32 %75, 2
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %73, i64 %77
%79 = load double, double* %78
%80 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 2
%81 = load double, double* %80
%82 = fmul double %79, %81
%83 = call double @llvm.fmuladd.f64(double %70, double %72, double %82)
%84 = load double*, double** %12
%85 = load i32, i32* %21
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
%88 = load double, double* %87
%89 = fadd double %83, %88
%90 = load [3 x double]*, [3 x double]** %13
%91 = load i32, i32* %20
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [3 x double], [3 x double]* %90, i64 %92
%94 = load i32, i32* %21
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [3 x double], [3 x double]* %93, i64 0, i64 %95
store double %89, double* %96
br label %97
97: ; preds = %63
%98 = load i32, i32* %21
%99 = add nsw i32 %98, 1
store i32 %99, i32* %21
br label %60
100: ; preds = %60
br label %101
101: ; preds = %100
%102 = load i32, i32* %20
%103 = add nsw i32 %102, 1
store i32 %103, i32* %20
br label %35
104: ; preds = %35
ret void
}

LLVM IR (-O2):
define void @compute_xlylzl(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, [3 x double]* nocapture writeonly %5, i32 %6) {
%8 = load double, double* %2
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %2, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %2, i64 3
%14 = load double, double* %13
%15 = icmp sgt i32 %6, 0
br i1 %15, label %16, label %154
16: ; preds = %7
%17 = getelementptr inbounds double, double* %3, i64 1
%18 = zext i32 %6 to i64
%19 = getelementptr inbounds double, double* %3, i64 2
%20 = getelementptr inbounds double, double* %3, i64 4
%21 = getelementptr inbounds double, double* %3, i64 5
%22 = getelementptr inbounds double, double* %4, i64 1
%23 = getelementptr inbounds double, double* %3, i64 7
%24 = getelementptr inbounds double, double* %3, i64 8
%25 = getelementptr inbounds double, double* %4, i64 2
%26 = icmp eq i32 %6, 1
br i1 %26, label %119, label %27
27: ; preds = %16
%28 = getelementptr [3 x double], [3 x double]* %5, i64 %18, i64 0
%29 = getelementptr double, double* %1, i64 %18
%30 = getelementptr double, double* %0, i64 %18
%31 = getelementptr double, double* %3, i64 9
%32 = getelementptr double, double* %4, i64 3
%33 = bitcast double* %29 to [3 x double]*
%34 = icmp ugt [3 x double]* %33, %5
%35 = icmp ugt double* %28, %1
%36 = and i1 %34, %35
%37 = bitcast double* %30 to [3 x double]*
%38 = icmp ugt [3 x double]* %37, %5
%39 = icmp ugt double* %28, %0
%40 = and i1 %38, %39
%41 = or i1 %36, %40
%42 = bitcast double* %31 to [3 x double]*
%43 = icmp ugt [3 x double]* %42, %5
%44 = icmp ult double* %17, %28
%45 = and i1 %43, %44
%46 = or i1 %41, %45
%47 = bitcast double* %32 to [3 x double]*
%48 = icmp ugt [3 x double]* %47, %5
%49 = icmp ugt double* %28, %4
%50 = and i1 %48, %49
%51 = or i1 %46, %50
br i1 %51, label %119, label %52
52: ; preds = %27
%53 = and i64 %18, 4294967294
%54 = insertelement <2 x double> poison, double %10, i64 0
%55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> zeroinitializer
%56 = insertelement <2 x double> poison, double %14, i64 0
%57 = shufflevector <2 x double> %56, <2 x double> poison, <2 x i32> zeroinitializer
%58 = insertelement <2 x double> poison, double %8, i64 0
%59 = shufflevector <2 x double> %58, <2 x double> poison, <2 x i32> zeroinitializer
%60 = insertelement <2 x double> poison, double %12, i64 0
%61 = shufflevector <2 x double> %60, <2 x double> poison, <2 x i32> zeroinitializer
br label %62
62: ; preds = %62, %52
%63 = phi i64 [ 0, %52 ], [ %115, %62 ]
%64 = getelementptr inbounds double, double* %1, i64 %63
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = fsub <2 x double> %66, %55
%68 = fmul <2 x double> %57, %67
%69 = getelementptr inbounds double, double* %0, i64 %63
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = fsub <2 x double> %71, %59
%73 = fmul <2 x double> %61, %72
%74 = load double, double* %17
%75 = insertelement <2 x double> poison, double %74, i64 0
%76 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> zeroinitializer
%77 = load double, double* %19
%78 = insertelement <2 x double> poison, double %77, i64 0
%79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
%80 = fmul <2 x double> %73, %79
%81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %76, <2 x double> %68, <2 x double> %80)
%82 = load double, double* %4
%83 = insertelement <2 x double> poison, double %82, i64 0
%84 = shufflevector <2 x double> %83, <2 x double> poison, <2 x i32> zeroinitializer
%85 = fadd <2 x double> %84, %81
%86 = load double, double* %20
%87 = insertelement <2 x double> poison, double %86, i64 0
%88 = shufflevector <2 x double> %87, <2 x double> poison, <2 x i32> zeroinitializer
%89 = load double, double* %21
%90 = insertelement <2 x double> poison, double %89, i64 0
%91 = shufflevector <2 x double> %90, <2 x double> poison, <2 x i32> zeroinitializer
%92 = fmul <2 x double> %73, %91
%93 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %88, <2 x double> %68, <2 x double> %92)
%94 = load double, double* %22
%95 = insertelement <2 x double> poison, double %94, i64 0
%96 = shufflevector <2 x double> %95, <2 x double> poison, <2 x i32> zeroinitializer
%97 = fadd <2 x double> %96, %93
%98 = load double, double* %23
%99 = insertelement <2 x double> poison, double %98, i64 0
%100 = shufflevector <2 x double> %99, <2 x double> poison, <2 x i32> zeroinitializer
%101 = load double, double* %24
%102 = insertelement <2 x double> poison, double %101, i64 0
%103 = shufflevector <2 x double> %102, <2 x double> poison, <2 x i32> zeroinitializer
%104 = fmul <2 x double> %73, %103
%105 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %100, <2 x double> %68, <2 x double> %104)
%106 = load double, double* %25
%107 = insertelement <2 x double> poison, double %106, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
%109 = fadd <2 x double> %108, %105
%110 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 %63, i64 0
%111 = bitcast double* %110 to <6 x double>*
%112 = shufflevector <2 x double> %85, <2 x double> %97, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%113 = shufflevector <2 x double> %109, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%114 = shufflevector <4 x double> %112, <4 x double> %113, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
store <6 x double> %114, <6 x double>* %111
%115 = add nuw i64 %63, 2
%116 = icmp eq i64 %115, %53
br i1 %116, label %117, label %62
117: ; preds = %62
%118 = icmp eq i64 %53, %18
br i1 %118, label %154, label %119
119: ; preds = %27, %16, %117
%120 = phi i64 [ 0, %27 ], [ 0, %16 ], [ %53, %117 ]
br label %121
121: ; preds = %119, %121
%122 = phi i64 [ %152, %121 ], [ %120, %119 ]
%123 = getelementptr inbounds double, double* %1, i64 %122
%124 = load double, double* %123
%125 = fsub double %124, %10
%126 = fmul double %14, %125
%127 = getelementptr inbounds double, double* %0, i64 %122
%128 = load double, double* %127
%129 = fsub double %128, %8
%130 = fmul double %12, %129
%131 = load double, double* %17
%132 = load double, double* %19
%133 = fmul double %130, %132
%134 = tail call double @llvm.fmuladd.f64(double %131, double %126, double %133)
%135 = load double, double* %4
%136 = fadd double %135, %134
%137 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 %122, i64 0
store double %136, double* %137
%138 = load double, double* %20
%139 = load double, double* %21
%140 = fmul double %130, %139
%141 = tail call double @llvm.fmuladd.f64(double %138, double %126, double %140)
%142 = load double, double* %22
%143 = fadd double %142, %141
%144 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 %122, i64 1
store double %143, double* %144
%145 = load double, double* %23
%146 = load double, double* %24
%147 = fmul double %130, %146
%148 = tail call double @llvm.fmuladd.f64(double %145, double %126, double %147)
%149 = load double, double* %25
%150 = fadd double %149, %148
%151 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 %122, i64 2
store double %150, double* %151
%152 = add nuw nsw i64 %122, 1
%153 = icmp eq i64 %152, %18
br i1 %153, label %154, label %121
154: ; preds = %121, %117, %7
ret void
}