#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*/ arb_rotation(double *, int /*<<< orphan*/, double **);
int /*<<< orphan*/ cross(double *, double *, double *);
double **dmatrix(int, int, int, int);
double dot(double *, double *);
double *dvector(int, long);
int /*<<< orphan*/ free_dmatrix(double **, int, int, int, int);
int /*<<< orphan*/ free_dvector(double *, int, long);
int /*<<< orphan*/ ls_plane(double **, long, double *, double *, double *,
                            double *);
int /*<<< orphan*/ magang(double *, double *);
int /*<<< orphan*/ strcmp(char *, char *);
void rot_2_lsplane(long num, char **AtomName, double **xyz) {
  double *adist, odist, ppos[4], z[4];
  double **nxyz, **rotmat, hinge[4];
  double zphy[4] = {-9999.99, 0.0, 0.0, 1.0};
  long j, k, atmnum, inum = 0;
  nxyz = dmatrix(1, num, 1, 3);
  adist = dvector(1, num);
  rotmat = dmatrix(1, 3, 1, 3);
  atmnum = 0;
  for (j = 1; j <= num; j++) {
    if (!strcmp(AtomName[j], " P  ") || !strcmp(AtomName[j], " O5'") ||
        !strcmp(AtomName[j], " C5'") || !strcmp(AtomName[j], " C4'") ||
        !strcmp(AtomName[j], " C3'") || !strcmp(AtomName[j], " O3'")) {
      atmnum++;
      for (k = 1; k <= 3; k++)
        nxyz[atmnum][k] = xyz[j][k];
    }
  }
  ls_plane(nxyz, atmnum, z, ppos, &odist, adist);
  cross(z, zphy, hinge);
  arb_rotation(hinge, magang(zphy, z), rotmat);
  for (j = 1; j <= num; j++) {
    for (k = 1; k <= 3; k++)
      nxyz[j][k] = dot(xyz[j], rotmat[k]);
    for (k = 1; k <= 3; k++)
      xyz[j][k] = nxyz[j][k];
  }
  free_dvector(adist, 1, atmnum);
  free_dmatrix(nxyz, 1, atmnum, 1, 3);
  free_dmatrix(rotmat, 1, 3, 1, 3);
}


x86 assembly (clang, -O0):
<rot_2_lsplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xe42(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xe3c(%rip),%rax
mov    %rax,-0xb8(%rbp)
mov    0xe36(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe30(%rip),%rax
mov    %rax,-0xa8(%rbp)
movq   $0x0,-0xe0(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
call   1080 <dmatrix@plt>
mov    %rax,-0x78(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1090 <dvector@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1080 <dmatrix@plt>
mov    %rax,-0x80(%rbp)
movq   $0x0,-0xd8(%rbp)
movq   $0x1,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     13d6 <rot_2_lsplane+0x236>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xda5(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     133d <rot_2_lsplane+0x19d>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd86(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     133d <rot_2_lsplane+0x19d>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd67(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     133d <rot_2_lsplane+0x19d>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd48(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     133d <rot_2_lsplane+0x19d>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd29(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     133d <rot_2_lsplane+0x19d>
mov    -0x10(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd0a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13ba <rot_2_lsplane+0x21a>
mov    -0xd8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd8(%rbp)
movq   $0x1,-0xd0(%rbp)
cmpq   $0x3,-0xd0(%rbp)
03
jg     13b5 <rot_2_lsplane+0x215>
mov    -0x18(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
mov    -0xd8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    135a <rot_2_lsplane+0x1ba>
jmp    13ba <rot_2_lsplane+0x21a>
jmp    13bf <rot_2_lsplane+0x21f>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    1254 <rot_2_lsplane+0xb4>
mov    -0x78(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x50(%rbp),%rcx
mov    -0x20(%rbp),%r9
lea    -0x28(%rbp),%r8
call   1050 <ls_plane@plt>
lea    -0x70(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   10c0 <cross@plt>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <magang@plt>
mov    -0xe8(%rbp),%rdi
mov    %eax,%esi
mov    -0x80(%rbp),%rdx
call   1040 <arb_rotation@plt>
movq   $0x1,-0xc8(%rbp)
mov    -0xc8(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1549 <rot_2_lsplane+0x3a9>
movq   $0x1,-0xd0(%rbp)
cmpq   $0x3,-0xd0(%rbp)
03
jg     14c7 <rot_2_lsplane+0x327>
mov    -0x18(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x80(%rbp),%rax
mov    -0xd0(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <dot@plt>
mov    -0x78(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    1464 <rot_2_lsplane+0x2c4>
movq   $0x1,-0xd0(%rbp)
cmpq   $0x3,-0xd0(%rbp)
03
jg     152d <rot_2_lsplane+0x38d>
mov    -0x78(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0xc8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xd0(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    14d2 <rot_2_lsplane+0x332>
jmp    1532 <rot_2_lsplane+0x392>
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    1448 <rot_2_lsplane+0x2a8>
mov    -0x20(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
mov    $0x1,%esi
call   10a0 <free_dvector@plt>
mov    -0x78(%rbp),%rdi
mov    -0xd8(%rbp),%rax
mov    %eax,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
call   10b0 <free_dmatrix@plt>
mov    -0x80(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
mov    %r8d,%edx
call   10b0 <free_dmatrix@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_2_lsplane>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %rdx,%r12
mov    %rsi,0x20(%rsp)
mov    %rdi,%rbp
movaps 0xe4d(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe31(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    $0x1,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1080 <dmatrix@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    %rbp,%rsi
call   1090 <dvector@plt>
mov    %rax,0x10(%rsp)
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1080 <dmatrix@plt>
test   %rbp,%rbp
mov    %rax,0x18(%rsp)
jle    12f5 <rot_2_lsplane+0x155>
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    0x20(%rsp),%rax
mov    0x8(%rax,%r14,8),%r13
mov    %r13,%rdi
lea    0xddc(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b0 <rot_2_lsplane+0x110>
mov    %r13,%rdi
lea    0xdce(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b0 <rot_2_lsplane+0x110>
mov    %r13,%rdi
lea    0xdc0(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b0 <rot_2_lsplane+0x110>
mov    %r13,%rdi
lea    0xdb2(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b0 <rot_2_lsplane+0x110>
mov    %r13,%rdi
lea    0xda4(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b0 <rot_2_lsplane+0x110>
mov    %r13,%rdi
lea    0xd96(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    12e6 <rot_2_lsplane+0x146>
nopl   0x0(%rax)
mov    0x8(%r12,%r14,8),%rax
mov    0x8(%rsp),%rdx
mov    0x8(%r15,%rdx,8),%rcx
add    $0x1,%rdx
mov    %rdx,0x8(%rsp)
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%rcx)
add    $0x1,%r14
cmp    %r14,%rbp
jne    1230 <rot_2_lsplane+0x90>
jmp    12fc <rot_2_lsplane+0x15c>
xor    %eax,%eax
mov    %rax,0x8(%rsp)
lea    0x70(%rsp),%rbx
lea    0x90(%rsp),%rcx
lea    0x28(%rsp),%r8
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    0x10(%rsp),%r9
call   1050 <ls_plane@plt>
lea    0x30(%rsp),%r13
lea    0x50(%rsp),%r14
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   10c0 <cross@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <magang@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <arb_rotation@plt>
test   %rbp,%rbp
jle    13e4 <rot_2_lsplane+0x244>
mov    %rbp,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%r12,%rbp,8),%rdi
mov    0x8(%rbx),%rsi
call   1030 <dot@plt>
mov    0x8(%r15,%rbp,8),%rax
movsd  %xmm0,0x8(%rax)
mov    0x8(%r12,%rbp,8),%rdi
mov    0x10(%rbx),%rsi
call   1030 <dot@plt>
mov    0x8(%r15,%rbp,8),%rax
movsd  %xmm0,0x10(%rax)
mov    0x8(%r12,%rbp,8),%rdi
mov    0x18(%rbx),%rsi
call   1030 <dot@plt>
mov    0x8(%r15,%rbp,8),%rax
movsd  %xmm0,0x18(%rax)
mov    0x8(%r12,%rbp,8),%rcx
movsd  0x8(%rax),%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0x10(%rax),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0x18(%rax),%xmm0
movsd  %xmm0,0x18(%rcx)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1370 <rot_2_lsplane+0x1d0>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    0x8(%rsp),%rbp
mov    %rbp,%rdx
call   10a0 <free_dvector@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   10b0 <free_dmatrix@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   10b0 <free_dmatrix@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.rot_2_lsplane.zphy = [4 x double] [double 0xC0C387FEB851EB85, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@.str = [5 x i8] c" P \00"
@.str.1 = [5 x i8] c" O5'\00"
@.str.2 = [5 x i8] c" C5'\00"
@.str.3 = [5 x i8] c" C4'\00"
@.str.4 = [5 x i8] c" C3'\00"
@.str.5 = [5 x i8] c" O3'\00"
define void @rot_2_lsplane(i64 %0, i8** %1, double** %2) {
%4 = alloca i64
%5 = alloca i8**
%6 = alloca double**
%7 = alloca double*
%8 = alloca double
%9 = alloca [4 x double]
%10 = alloca [4 x double]
%11 = alloca double**
%12 = alloca double**
%13 = alloca [4 x double]
%14 = alloca [4 x double]
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
store i64 %0, i64* %4
store i8** %1, i8*** %5
store double** %2, double*** %6
%19 = bitcast [4 x double]* %14 to i8*
store i64 0, i64* %18
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
%22 = call double** @dmatrix(i32 1, i32 %21, i32 1, i32 3)
store double** %22, double*** %11
%23 = load i64, i64* %4
%24 = call double* @dvector(i32 1, i64 %23)
store double* %24, double** %7
%25 = call double** @dmatrix(i32 1, i32 3, i32 1, i32 3)
store double** %25, double*** %12
store i64 0, i64* %17
store i64 1, i64* %15
br label %26
26: ; preds = %97, %3
%27 = load i64, i64* %15
%28 = load i64, i64* %4
%29 = icmp sle i64 %27, %28
br i1 %29, label %30, label %100
30: ; preds = %26
%31 = load i8**, i8*** %5
%32 = load i64, i64* %15
%33 = getelementptr inbounds i8*, i8** %31, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %72
37: ; preds = %30
%38 = load i8**, i8*** %5
%39 = load i64, i64* %15
%40 = getelementptr inbounds i8*, i8** %38, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @strcmp(i8* %41, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %72
44: ; preds = %37
%45 = load i8**, i8*** %5
%46 = load i64, i64* %15
%47 = getelementptr inbounds i8*, i8** %45, i64 %46
%48 = load i8*, i8** %47
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %72
51: ; preds = %44
%52 = load i8**, i8*** %5
%53 = load i64, i64* %15
%54 = getelementptr inbounds i8*, i8** %52, i64 %53
%55 = load i8*, i8** %54
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %72
58: ; preds = %51
%59 = load i8**, i8*** %5
%60 = load i64, i64* %15
%61 = getelementptr inbounds i8*, i8** %59, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %72
65: ; preds = %58
%66 = load i8**, i8*** %5
%67 = load i64, i64* %15
%68 = getelementptr inbounds i8*, i8** %66, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %96, label %72
72: ; preds = %65, %58, %51, %44, %37, %30
%73 = load i64, i64* %17
%74 = add nsw i64 %73, 1
store i64 %74, i64* %17
store i64 1, i64* %16
br label %75
75: ; preds = %92, %72
%76 = load i64, i64* %16
%77 = icmp sle i64 %76, 3
br i1 %77, label %78, label %95
78: ; preds = %75
%79 = load double**, double*** %6
%80 = load i64, i64* %15
%81 = getelementptr inbounds double*, double** %79, i64 %80
%82 = load double*, double** %81
%83 = load i64, i64* %16
%84 = getelementptr inbounds double, double* %82, i64 %83
%85 = load double, double* %84
%86 = load double**, double*** %11
%87 = load i64, i64* %17
%88 = getelementptr inbounds double*, double** %86, i64 %87
%89 = load double*, double** %88
%90 = load i64, i64* %16
%91 = getelementptr inbounds double, double* %89, i64 %90
store double %85, double* %91
br label %92
92: ; preds = %78
%93 = load i64, i64* %16
%94 = add nsw i64 %93, 1
store i64 %94, i64* %16
br label %75
95: ; preds = %75
br label %96
96: ; preds = %95, %65
br label %97
97: ; preds = %96
%98 = load i64, i64* %15
%99 = add nsw i64 %98, 1
store i64 %99, i64* %15
br label %26
100: ; preds = %26
%101 = load double**, double*** %11
%102 = load i64, i64* %17
%103 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%104 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%105 = load double*, double** %7
%106 = call i32 @ls_plane(double** %101, i64 %102, double* %103, double* %104, double* %8, double* %105)
%107 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%108 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%109 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 0
%110 = call i32 @cross(double* %107, double* %108, double* %109)
%111 = getelementptr inbounds [4 x double], [4 x double]* %13, i64 0, i64 0
%112 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%113 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%114 = call i32 @magang(double* %112, double* %113)
%115 = load double**, double*** %12
%116 = call i32 @arb_rotation(double* %111, i32 %114, double** %115)
store i64 1, i64* %15
br label %117
117: ; preds = %166, %100
%118 = load i64, i64* %15
%119 = load i64, i64* %4
%120 = icmp sle i64 %118, %119
br i1 %120, label %121, label %169
121: ; preds = %117
store i64 1, i64* %16
br label %122
122: ; preds = %141, %121
%123 = load i64, i64* %16
%124 = icmp sle i64 %123, 3
br i1 %124, label %125, label %144
125: ; preds = %122
%126 = load double**, double*** %6
%127 = load i64, i64* %15
%128 = getelementptr inbounds double*, double** %126, i64 %127
%129 = load double*, double** %128
%130 = load double**, double*** %12
%131 = load i64, i64* %16
%132 = getelementptr inbounds double*, double** %130, i64 %131
%133 = load double*, double** %132
%134 = call double @dot(double* %129, double* %133)
%135 = load double**, double*** %11
%136 = load i64, i64* %15
%137 = getelementptr inbounds double*, double** %135, i64 %136
%138 = load double*, double** %137
%139 = load i64, i64* %16
%140 = getelementptr inbounds double, double* %138, i64 %139
store double %134, double* %140
br label %141
141: ; preds = %125
%142 = load i64, i64* %16
%143 = add nsw i64 %142, 1
store i64 %143, i64* %16
br label %122
144: ; preds = %122
store i64 1, i64* %16
br label %145
145: ; preds = %162, %144
%146 = load i64, i64* %16
%147 = icmp sle i64 %146, 3
br i1 %147, label %148, label %165
148: ; preds = %145
%149 = load double**, double*** %11
%150 = load i64, i64* %15
%151 = getelementptr inbounds double*, double** %149, i64 %150
%152 = load double*, double** %151
%153 = load i64, i64* %16
%154 = getelementptr inbounds double, double* %152, i64 %153
%155 = load double, double* %154
%156 = load double**, double*** %6
%157 = load i64, i64* %15
%158 = getelementptr inbounds double*, double** %156, i64 %157
%159 = load double*, double** %158
%160 = load i64, i64* %16
%161 = getelementptr inbounds double, double* %159, i64 %160
store double %155, double* %161
br label %162
162: ; preds = %148
%163 = load i64, i64* %16
%164 = add nsw i64 %163, 1
store i64 %164, i64* %16
br label %145
165: ; preds = %145
br label %166
166: ; preds = %165
%167 = load i64, i64* %15
%168 = add nsw i64 %167, 1
store i64 %168, i64* %15
br label %117
169: ; preds = %117
%170 = load double*, double** %7
%171 = load i64, i64* %17
%172 = call i32 @free_dvector(double* %170, i32 1, i64 %171)
%173 = load double**, double*** %11
%174 = load i64, i64* %17
%175 = trunc i64 %174 to i32
%176 = call i32 @free_dmatrix(double** %173, i32 1, i32 %175, i32 1, i32 3)
%177 = load double**, double*** %12
%178 = call i32 @free_dmatrix(double** %177, i32 1, i32 3, i32 1, i32 3)
ret void
}

LLVM IR (-O2):
@__const.rot_2_lsplane.zphy = [4 x double] [double 0xC0C387FEB851EB85, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00]
@.str = [5 x i8] c" P \00"
@.str.1 = [5 x i8] c" O5'\00"
@.str.2 = [5 x i8] c" C5'\00"
@.str.3 = [5 x i8] c" C4'\00"
@.str.4 = [5 x i8] c" C3'\00"
@.str.5 = [5 x i8] c" O3'\00"
define void @rot_2_lsplane(i64 %0, i8** nocapture %1, double** nocapture %2) {
%4 = alloca double
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = alloca [4 x double]
%8 = alloca [4 x double]
%9 = bitcast double* %4 to i8*
%10 = bitcast [4 x double]* %5 to i8*
%11 = bitcast [4 x double]* %6 to i8*
%12 = bitcast [4 x double]* %7 to i8*
%13 = bitcast [4 x double]* %8 to i8*
%14 = trunc i64 %0 to i32
%15 = tail call double** @dmatrix(i32 1, i32 %14, i32 1, i32 3)
%16 = tail call double* @dvector(i32 1, i64 %0)
%17 = tail call double** @dmatrix(i32 1, i32 3, i32 1, i32 3)
%18 = icmp slt i64 %0, 1
br i1 %18, label %60, label %19
19: ; preds = %3, %56
%20 = phi i64 [ %58, %56 ], [ 1, %3 ]
%21 = phi i64 [ %57, %56 ], [ 0, %3 ]
%22 = getelementptr inbounds i8*, i8** %1, i64 %20
%23 = load i8*, i8** %22
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %41, label %26
26: ; preds = %19
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %41, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %41, label %32
32: ; preds = %29
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %56
41: ; preds = %38, %35, %32, %29, %26, %19
%42 = add nsw i64 %21, 1
%43 = getelementptr inbounds double*, double** %2, i64 %20
%44 = load double*, double** %43
%45 = getelementptr inbounds double*, double** %15, i64 %42
%46 = load double*, double** %45
%47 = getelementptr inbounds double, double* %44, i64 1
%48 = load double, double* %47
%49 = getelementptr inbounds double, double* %46, i64 1
store double %48, double* %49
%50 = getelementptr inbounds double, double* %44, i64 2
%51 = load double, double* %50
%52 = getelementptr inbounds double, double* %46, i64 2
store double %51, double* %52
%53 = getelementptr inbounds double, double* %44, i64 3
%54 = load double, double* %53
%55 = getelementptr inbounds double, double* %46, i64 3
store double %54, double* %55
br label %56
56: ; preds = %41, %38
%57 = phi i64 [ %21, %38 ], [ %42, %41 ]
%58 = add nuw i64 %20, 1
%59 = icmp eq i64 %20, %0
br i1 %59, label %60, label %19
60: ; preds = %56, %3
%61 = phi i64 [ 0, %3 ], [ %57, %56 ]
%62 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%63 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%64 = call i32 @ls_plane(double** %15, i64 %61, double* %62, double* %63, double* %4, double* %16)
%65 = getelementptr inbounds [4 x double], [4 x double]* %8, i64 0, i64 0
%66 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%67 = call i32 @cross(double* %62, double* %65, double* %66)
%68 = call i32 @magang(double* %65, double* %62)
%69 = call i32 @arb_rotation(double* %66, i32 %68, double** %17)
br i1 %18, label %104, label %70
70: ; preds = %60
%71 = getelementptr inbounds double*, double** %17, i64 1
%72 = getelementptr inbounds double*, double** %17, i64 2
%73 = getelementptr inbounds double*, double** %17, i64 3
br label %74
74: ; preds = %70, %74
%75 = phi i64 [ %102, %74 ], [ 1, %70 ]
%76 = getelementptr inbounds double*, double** %2, i64 %75
%77 = getelementptr inbounds double*, double** %15, i64 %75
%78 = load double*, double** %76
%79 = load double*, double** %71
%80 = call double @dot(double* %78, double* %79)
%81 = load double*, double** %77
%82 = getelementptr inbounds double, double* %81, i64 1
store double %80, double* %82
%83 = load double*, double** %76
%84 = load double*, double** %72
%85 = call double @dot(double* %83, double* %84)
%86 = load double*, double** %77
%87 = getelementptr inbounds double, double* %86, i64 2
store double %85, double* %87
%88 = load double*, double** %76
%89 = load double*, double** %73
%90 = call double @dot(double* %88, double* %89)
%91 = load double*, double** %77
%92 = getelementptr inbounds double, double* %91, i64 3
store double %90, double* %92
%93 = load double*, double** %76
%94 = getelementptr inbounds double, double* %91, i64 1
%95 = load double, double* %94
%96 = getelementptr inbounds double, double* %93, i64 1
store double %95, double* %96
%97 = getelementptr inbounds double, double* %91, i64 2
%98 = load double, double* %97
%99 = getelementptr inbounds double, double* %93, i64 2
store double %98, double* %99
%100 = load double, double* %92
%101 = getelementptr inbounds double, double* %93, i64 3
store double %100, double* %101
%102 = add nuw i64 %75, 1
%103 = icmp eq i64 %75, %0
br i1 %103, label %104, label %74
104: ; preds = %74, %60
%105 = call i32 @free_dvector(double* %16, i32 1, i64 %61)
%106 = trunc i64 %61 to i32
%107 = call i32 @free_dmatrix(double** %15, i32 1, i32 %106, i32 1, i32 3)
%108 = call i32 @free_dmatrix(double** %17, i32 1, i32 3, i32 1, i32 3)
ret void
}