#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 acos(double);
double fabs(double);
double sqrt(double);
float Torsion(float *Coord1, float *Coord2, float *Coord3, float *Coord4) {
  double Comp[3][3], ScalarProd, TripleScalarProd, AbsTorsAng;
  double Perp_123[3], Perp_234[3], Len_Perp_123, Len_Perp_234;
  int i, j, k;
  for (i = 0; i < 3; i++) {
    Comp[0][i] = (double)(Coord2[i] - Coord1[i]);
    Comp[1][i] = (double)(Coord3[i] - Coord2[i]);
    Comp[2][i] = (double)(Coord4[i] - Coord3[i]);
  }
  Len_Perp_123 = 0.0;
  Len_Perp_234 = 0.0;
  for (i = 0; i < 3; i++) {
    j = (i + 1) % 3;
    k = (j + 1) % 3;
    Perp_123[i] = Comp[0][j] * Comp[1][k] - Comp[0][k] * Comp[1][j];
    Perp_234[i] = Comp[1][j] * Comp[2][k] - Comp[1][k] * Comp[2][j];
    Len_Perp_123 += Perp_123[i] * Perp_123[i];
    Len_Perp_234 += Perp_234[i] * Perp_234[i];
  }
  Len_Perp_123 = sqrt(Len_Perp_123);
  Len_Perp_234 = sqrt(Len_Perp_234);
  for (i = 0; i < 3; i++) {
    Perp_123[i] /= Len_Perp_123;
    Perp_234[i] /= Len_Perp_234;
  }
  ScalarProd = 0.0;
  for (i = 0; i < 3; i++)
    ScalarProd += Perp_123[i] * Perp_234[i];
  if (ScalarProd > 0.0 && fabs(ScalarProd - 1.0) < 0.000001)
    ScalarProd -= 0.000001;
  else if (ScalarProd < 0.0 && fabs(ScalarProd + 1.0) < 0.000001)
    ScalarProd += 0.000001;
  AbsTorsAng = 57.2958 * acos(ScalarProd);
  TripleScalarProd = 0.0;
  for (i = 0; i < 3; i++)
    TripleScalarProd += Comp[0][i] * Perp_234[i];
  return ((TripleScalarProd > 0.0) ? (float)AbsTorsAng : (float)(-AbsTorsAng));
}


x86 assembly (clang, -O0):
<Torsion>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    11f9 <Torsion+0xd9>
mov    -0x10(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xd4(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x18(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0xd4(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0x58(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0xd4(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1145 <Torsion+0x25>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    139e <Torsion+0x27e>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xd8(%rbp)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xdc(%rbp)
movslq -0xd8(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm0
movslq -0xdc(%rbp),%rax
movsd  -0x58(%rbp,%rax,8),%xmm2
movslq -0xdc(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm1
movslq -0xd8(%rbp),%rax
mulsd  -0x58(%rbp,%rax,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
movslq -0xd8(%rbp),%rax
movsd  -0x58(%rbp,%rax,8),%xmm0
movslq -0xdc(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm2
movslq -0xdc(%rbp),%rax
movsd  -0x58(%rbp,%rax,8),%xmm1
movslq -0xd8(%rbp),%rax
mulsd  -0x40(%rbp,%rax,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0xd4(%rbp),%rax
movsd  %xmm0,-0xc0(%rbp,%rax,8)
ff ff
movslq -0xd4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movslq -0xd4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0xc8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movslq -0xd4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
movslq -0xd4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0xd0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1219 <Torsion+0xf9>
movsd  -0xc8(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    143d <Torsion+0x31d>
movsd  -0xc8(%rbp),%xmm1
ff
movslq -0xd4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
movsd  -0xd0(%rbp),%xmm1
ff
movslq -0xd4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm0
ff ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp,%rax,8)
ff ff
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    13d2 <Torsion+0x2b2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    14a2 <Torsion+0x382>
movslq -0xd4(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movslq -0xd4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    144f <Torsion+0x32f>
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14fd <Torsion+0x3dd>
movsd  -0x78(%rbp),%xmm1
movsd  0xb47(%rip),%xmm0
subsd  %xmm0,%xmm1
movaps 0xb54(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xb28(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14fd <Torsion+0x3dd>
movsd  -0x78(%rbp),%xmm0
movsd  0xb11(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    154c <Torsion+0x42c>
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1547 <Torsion+0x427>
movsd  0xaf5(%rip),%xmm1
addsd  -0x78(%rbp),%xmm1
movaps 0xb01(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xad5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1547 <Torsion+0x427>
movsd  0xac3(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    154c <Torsion+0x42c>
movsd  -0x78(%rbp),%xmm0
call   1030 <acos@plt>
movaps %xmm0,%xmm1
movsd  0xaaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0xd4(%rbp)
cmpl   $0x3,-0xd4(%rbp)
jge    15cf <Torsion+0x4af>
movslq -0xd4(%rbp),%rax
movsd  -0x70(%rbp,%rax,8),%xmm0
movslq -0xd4(%rbp),%rax
movsd  -0xc0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    157f <Torsion+0x45f>
movsd  -0x80(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    15fa <Torsion+0x4da>
movsd  -0x88(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xe0(%rbp)
ff
jmp    1625 <Torsion+0x505>
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xe0(%rbp)
ff
movss  -0xe0(%rbp),%xmm0
ff
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Torsion>:
sub    $0x58,%rsp
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
movss  (%rcx),%xmm2
subss  %xmm1,%xmm2
subss  %xmm0,%xmm1
subss  (%rdi),%xmm0
movss  0x4(%rsi),%xmm3
cvtss2sd %xmm0,%xmm8
movss  0x4(%rdx),%xmm4
cvtss2sd %xmm1,%xmm14
movss  0x4(%rcx),%xmm5
cvtss2sd %xmm2,%xmm10
subss  %xmm4,%xmm5
subss  %xmm3,%xmm4
subss  0x4(%rdi),%xmm3
cvtss2sd %xmm3,%xmm9
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm5,%xmm2
movss  0x8(%rsi),%xmm3
movss  0x8(%rdx),%xmm4
movss  0x8(%rcx),%xmm5
subss  %xmm4,%xmm5
subss  %xmm3,%xmm4
subss  0x8(%rdi),%xmm3
cvtss2sd %xmm3,%xmm11
cvtss2sd %xmm4,%xmm4
cvtss2sd %xmm5,%xmm12
movaps %xmm9,%xmm6
mulsd  %xmm4,%xmm6
movaps %xmm1,%xmm7
mulsd  %xmm12,%xmm7
movaps %xmm11,%xmm3
mulsd  %xmm14,%xmm3
mulsd  %xmm14,%xmm12
movapd %xmm14,%xmm13
mulsd  %xmm2,%xmm14
mulsd  %xmm4,%xmm2
movapd %xmm4,%xmm5
mulsd  %xmm10,%xmm4
movaps %xmm8,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm10
movsd  %xmm11,0x40(%rsp)
mulsd  %xmm11,%xmm1
subsd  %xmm1,%xmm6
subsd  %xmm2,%xmm7
movsd  %xmm6,0x38(%rsp)
movapd %xmm6,%xmm1
mulsd  %xmm6,%xmm1
xorpd  %xmm6,%xmm6
addsd  %xmm6,%xmm1
movsd  %xmm7,0x8(%rsp)
movapd %xmm7,%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm6,%xmm2
movsd  %xmm8,0x50(%rsp)
mulsd  %xmm8,%xmm5
subsd  %xmm5,%xmm3
subsd  %xmm12,%xmm4
movsd  %xmm3,0x30(%rsp)
mulsd  %xmm3,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm4,0x10(%rsp)
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm9,0x48(%rsp)
mulsd  %xmm9,%xmm13
subsd  %xmm13,%xmm0
subsd  %xmm10,%xmm14
movsd  %xmm0,0x28(%rsp)
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm14,%xmm2
mulsd  %xmm14,%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm6,%xmm0
movsd  %xmm14,0x18(%rsp)
jb     12ba <Torsion+0x19a>
xorps  %xmm7,%xmm7
sqrtsd %xmm0,%xmm7
ucomisd %xmm6,%xmm2
jae    12d9 <Torsion+0x1b9>
movapd %xmm2,%xmm0
movsd  %xmm7,0x20(%rsp)
call   1040 <sqrt@plt>
movsd  0x20(%rsp),%xmm7
jmp    12e0 <Torsion+0x1c0>
movsd  %xmm2,0x20(%rsp)
call   1040 <sqrt@plt>
movsd  0x20(%rsp),%xmm2
xorpd  %xmm6,%xmm6
movapd %xmm0,%xmm7
ucomisd %xmm6,%xmm2
jb     12a3 <Torsion+0x183>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
movsd  0x18(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm5
movsd  0x28(%rsp),%xmm6
movsd  0x38(%rsp),%xmm1
divsd  %xmm7,%xmm1
divsd  %xmm0,%xmm5
movsd  0x30(%rsp),%xmm2
divsd  %xmm7,%xmm2
divsd  %xmm0,%xmm4
divsd  %xmm7,%xmm6
divsd  %xmm0,%xmm3
mulsd  %xmm5,%xmm1
xorpd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm6
addsd  %xmm2,%xmm6
ucomisd %xmm0,%xmm6
movsd  %xmm3,0x18(%rsp)
movsd  %xmm4,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
jbe    137c <Torsion+0x25c>
movsd  0xca8(%rip),%xmm1
addsd  %xmm6,%xmm1
andpd  0xccc(%rip),%xmm1
movsd  0xc9c(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    137c <Torsion+0x25c>
addsd  0xc9e(%rip),%xmm6
jmp    13ac <Torsion+0x28c>
ucomisd %xmm6,%xmm0
jbe    13ac <Torsion+0x28c>
movsd  0xc86(%rip),%xmm0
addsd  %xmm6,%xmm0
andpd  0xc9a(%rip),%xmm0
movsd  0xc6a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    13ac <Torsion+0x28c>
addsd  0xc5c(%rip),%xmm6
movapd %xmm6,%xmm0
call   1030 <acos@plt>
movsd  0x50(%rsp),%xmm2
mulsd  0x8(%rsp),%xmm2
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm2
movsd  0x48(%rsp),%xmm3
mulsd  0x10(%rsp),%xmm3
addsd  %xmm2,%xmm3
movsd  0x40(%rsp),%xmm2
mulsd  0x18(%rsp),%xmm2
addsd  %xmm3,%xmm2
mulsd  0xc2f(%rip),%xmm0
ucomisd %xmm1,%xmm2
cvtsd2ss %xmm0,%xmm0
ja     1402 <Torsion+0x2e2>
xorps  0xc3e(%rip),%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define float @Torsion(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca [3 x [3 x double]]
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca [3 x double]
%14 = alloca [3 x double]
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
store i32 0, i32* %17
br label %20
20: ; preds = %72, %4
%21 = load i32, i32* %17
%22 = icmp slt i32 %21, 3
br i1 %22, label %23, label %75
23: ; preds = %20
%24 = load float*, float** %6
%25 = load i32, i32* %17
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
%29 = load float*, float** %5
%30 = load i32, i32* %17
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %29, i64 %31
%33 = load float, float* %32
%34 = fsub float %28, %33
%35 = fpext float %34 to double
%36 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%37 = load i32, i32* %17
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [3 x double], [3 x double]* %36, i64 0, i64 %38
store double %35, double* %39
%40 = load float*, float** %7
%41 = load i32, i32* %17
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds float, float* %40, i64 %42
%44 = load float, float* %43
%45 = load float*, float** %6
%46 = load i32, i32* %17
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds float, float* %45, i64 %47
%49 = load float, float* %48
%50 = fsub float %44, %49
%51 = fpext float %50 to double
%52 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 1
%53 = load i32, i32* %17
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x double], [3 x double]* %52, i64 0, i64 %54
store double %51, double* %55
%56 = load float*, float** %8
%57 = load i32, i32* %17
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float, float* %56, i64 %58
%60 = load float, float* %59
%61 = load float*, float** %7
%62 = load i32, i32* %17
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float, float* %61, i64 %63
%65 = load float, float* %64
%66 = fsub float %60, %65
%67 = fpext float %66 to double
%68 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 2
%69 = load i32, i32* %17
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [3 x double], [3 x double]* %68, i64 0, i64 %70
store double %67, double* %71
br label %72
72: ; preds = %23
%73 = load i32, i32* %17
%74 = add nsw i32 %73, 1
store i32 %74, i32* %17
br label %20
75: ; preds = %20
store double 0.000000e+00, double* %15
store double 0.000000e+00, double* %16
store i32 0, i32* %17
br label %76
76: ; preds = %158, %75
%77 = load i32, i32* %17
%78 = icmp slt i32 %77, 3
br i1 %78, label %79, label %161
79: ; preds = %76
%80 = load i32, i32* %17
%81 = add nsw i32 %80, 1
%82 = srem i32 %81, 3
store i32 %82, i32* %18
%83 = load i32, i32* %18
%84 = add nsw i32 %83, 1
%85 = srem i32 %84, 3
store i32 %85, i32* %19
%86 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%87 = load i32, i32* %18
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [3 x double], [3 x double]* %86, i64 0, i64 %88
%90 = load double, double* %89
%91 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 1
%92 = load i32, i32* %19
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [3 x double], [3 x double]* %91, i64 0, i64 %93
%95 = load double, double* %94
%96 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%97 = load i32, i32* %19
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [3 x double], [3 x double]* %96, i64 0, i64 %98
%100 = load double, double* %99
%101 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 1
%102 = load i32, i32* %18
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [3 x double], [3 x double]* %101, i64 0, i64 %103
%105 = load double, double* %104
%106 = fmul double %100, %105
%107 = fneg double %106
%108 = call double @llvm.fmuladd.f64(double %90, double %95, double %107)
%109 = load i32, i32* %17
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %110
store double %108, double* %111
%112 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 1
%113 = load i32, i32* %18
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [3 x double], [3 x double]* %112, i64 0, i64 %114
%116 = load double, double* %115
%117 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 2
%118 = load i32, i32* %19
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [3 x double], [3 x double]* %117, i64 0, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 1
%123 = load i32, i32* %19
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [3 x double], [3 x double]* %122, i64 0, i64 %124
%126 = load double, double* %125
%127 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 2
%128 = load i32, i32* %18
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [3 x double], [3 x double]* %127, i64 0, i64 %129
%131 = load double, double* %130
%132 = fmul double %126, %131
%133 = fneg double %132
%134 = call double @llvm.fmuladd.f64(double %116, double %121, double %133)
%135 = load i32, i32* %17
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %136
store double %134, double* %137
%138 = load i32, i32* %17
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %139
%141 = load double, double* %140
%142 = load i32, i32* %17
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %143
%145 = load double, double* %144
%146 = load double, double* %15
%147 = call double @llvm.fmuladd.f64(double %141, double %145, double %146)
store double %147, double* %15
%148 = load i32, i32* %17
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %149
%151 = load double, double* %150
%152 = load i32, i32* %17
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %153
%155 = load double, double* %154
%156 = load double, double* %16
%157 = call double @llvm.fmuladd.f64(double %151, double %155, double %156)
store double %157, double* %16
br label %158
158: ; preds = %79
%159 = load i32, i32* %17
%160 = add nsw i32 %159, 1
store i32 %160, i32* %17
br label %76
161: ; preds = %76
%162 = load double, double* %15
%163 = call double @sqrt(double %162)
store double %163, double* %15
%164 = load double, double* %16
%165 = call double @sqrt(double %164)
store double %165, double* %16
store i32 0, i32* %17
br label %166
166: ; preds = %182, %161
%167 = load i32, i32* %17
%168 = icmp slt i32 %167, 3
br i1 %168, label %169, label %185
169: ; preds = %166
%170 = load double, double* %15
%171 = load i32, i32* %17
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %172
%174 = load double, double* %173
%175 = fdiv double %174, %170
store double %175, double* %173
%176 = load double, double* %16
%177 = load i32, i32* %17
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %178
%180 = load double, double* %179
%181 = fdiv double %180, %176
store double %181, double* %179
br label %182
182: ; preds = %169
%183 = load i32, i32* %17
%184 = add nsw i32 %183, 1
store i32 %184, i32* %17
br label %166
185: ; preds = %166
store double 0.000000e+00, double* %10
store i32 0, i32* %17
br label %186
186: ; preds = %200, %185
%187 = load i32, i32* %17
%188 = icmp slt i32 %187, 3
br i1 %188, label %189, label %203
189: ; preds = %186
%190 = load i32, i32* %17
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [3 x double], [3 x double]* %13, i64 0, i64 %191
%193 = load double, double* %192
%194 = load i32, i32* %17
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %195
%197 = load double, double* %196
%198 = load double, double* %10
%199 = call double @llvm.fmuladd.f64(double %193, double %197, double %198)
store double %199, double* %10
br label %200
200: ; preds = %189
%201 = load i32, i32* %17
%202 = add nsw i32 %201, 1
store i32 %202, i32* %17
br label %186
203: ; preds = %186
%204 = load double, double* %10
%205 = fcmp ogt double %204, 0.000000e+00
br i1 %205, label %206, label %214
206: ; preds = %203
%207 = load double, double* %10
%208 = fsub double %207, 1.000000e+00
%209 = call double @llvm.fabs.f64(double %208)
%210 = fcmp olt double %209, 0x3EB0C6F7A0B5ED8D
br i1 %210, label %211, label %214
211: ; preds = %206
%212 = load double, double* %10
%213 = fsub double %212, 0x3EB0C6F7A0B5ED8D
store double %213, double* %10
br label %226
214: ; preds = %206, %203
%215 = load double, double* %10
%216 = fcmp olt double %215, 0.000000e+00
br i1 %216, label %217, label %225
217: ; preds = %214
%218 = load double, double* %10
%219 = fadd double %218, 1.000000e+00
%220 = call double @llvm.fabs.f64(double %219)
%221 = fcmp olt double %220, 0x3EB0C6F7A0B5ED8D
br i1 %221, label %222, label %225
222: ; preds = %217
%223 = load double, double* %10
%224 = fadd double %223, 0x3EB0C6F7A0B5ED8D
store double %224, double* %10
br label %225
225: ; preds = %222, %217, %214
br label %226
226: ; preds = %225, %211
%227 = load double, double* %10
%228 = call double @acos(double %227)
%229 = fmul double 5.729580e+01, %228
store double %229, double* %12
store double 0.000000e+00, double* %11
store i32 0, i32* %17
br label %230
230: ; preds = %245, %226
%231 = load i32, i32* %17
%232 = icmp slt i32 %231, 3
br i1 %232, label %233, label %248
233: ; preds = %230
%234 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %9, i64 0, i64 0
%235 = load i32, i32* %17
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds [3 x double], [3 x double]* %234, i64 0, i64 %236
%238 = load double, double* %237
%239 = load i32, i32* %17
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0, i64 %240
%242 = load double, double* %241
%243 = load double, double* %11
%244 = call double @llvm.fmuladd.f64(double %238, double %242, double %243)
store double %244, double* %11
br label %245
245: ; preds = %233
%246 = load i32, i32* %17
%247 = add nsw i32 %246, 1
store i32 %247, i32* %17
br label %230
248: ; preds = %230
%249 = load double, double* %11
%250 = fcmp ogt double %249, 0.000000e+00
br i1 %250, label %251, label %254
251: ; preds = %248
%252 = load double, double* %12
%253 = fptrunc double %252 to float
br label %258
254: ; preds = %248
%255 = load double, double* %12
%256 = fneg double %255
%257 = fptrunc double %256 to float
br label %258
258: ; preds = %254, %251
%259 = phi float [ %253, %251 ], [ %257, %254 ]
ret float %259
}

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