#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 A2toRH(double *, double *, double *, double *, double *, int *, double *);
int /*<<< orphan*/ Znd(double *, double *, double *, int);
int /*<<< orphan*/ Zu(double *, double *, int);
int /*<<< orphan*/ ZuN(double *, double *, double *, double *, int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ getTransf(double *, double *, double *);
int lap_SVD(double *, double *, double *, int, double *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ mmul(double *, double *, double *, int);
int /*<<< orphan*/ norm10(double *, int *, int, double *, double *);
int /*<<< orphan*/ trnm(double *, int);
int AntoRH(double *u, int *inls, int len, double *h) {
  if (len < 2) {
    return 1;
  }
  double Ni[3 * 3], Di[3 * 3];
  if (len == 2) {
    double N2[3 * 3], D2[3 * 3];
    getTransf(u + 10 * inls[0], Ni, Di);
    getTransf(u + 10 * inls[1], N2, D2);
    return A2toRH(Ni, Di, N2, D2, u, inls, h);
  }
  int do_norm = 1, i;
  double *Z;
  double *U, *VT, *D;
  double T1[3 * 3], iT1[3 * 3], T2[3 * 3], iT2[3 * 3];
  double Nn[3 * 3], Dn[3 * 3], temp[3 * 3];
  int res;
  int noRows = 7 * len;
  int noCols = 9 + 3 * len;
  Z = (double *)malloc(noRows * noCols * sizeof(double));
  U = (double *)malloc(noRows * noRows * sizeof(double));
  VT = (double *)malloc(noCols * noCols * sizeof(double));
  D = (double *)malloc(noCols * sizeof(double));
  for (i = 0; i < noRows * noCols; ++i) {
    Z[i] = 0.0;
  }
  if (do_norm) {
    norm10(u, inls, len, T1, iT1);
    norm10(u + 5, inls, len, T2, iT2);
  }
  for (i = 0; i < len; ++i) {
    getTransf(u + 10 * inls[i], Ni, Di);
    if (do_norm) {
      mmul(Nn, iT2, Ni, 3);
      mmul(Dn, Di, T1, 3);
      ZuN(Z + 7 * i, u + 10 * inls[i], T1, T2, len);
      Znd(Z + len * 7 * 9 + len * 7 * 3 * i + 7 * i, Dn, Nn, len);
    } else {
      Zu(Z + 7 * i, u + 10 * inls[i], len);
      Znd(Z + len * 7 * 9 + len * 7 * 3 * i + 7 * i, Di, Ni, len);
    }
  }
  res = lap_SVD(D, Z, U, noRows, VT, noCols);
  for (i = 0; i < 9; ++i) {
    h[i] = VT[(i + 1) * noCols - 1];
  }
  trnm(h, 3);
  if (do_norm) {
    mmul(temp, T2, h, 3);
    mmul(h, temp, iT1, 3);
  }
  free(Z);
  free(U);
  free(D);
  free(VT);
  return res;
}


x86 assembly (clang, -O0):
<AntoRH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3d0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    11e0 <AntoRH+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1697 <AntoRH+0x4e7>
cmpl   $0x2,-0x1c(%rbp)
jne    126c <AntoRH+0xbc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
imul   $0xa,(%rax),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x70(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
call   1070 <getTransf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
imul   $0xa,0x4(%rax),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x110(%rbp),%rsi
lea    -0x160(%rbp),%rdx
call   1070 <getTransf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x110(%rbp),%rdx
lea    -0x160(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <A2toRH@plt>
mov    %eax,-0x4(%rbp)
jmp    1697 <AntoRH+0x4e7>
movl   $0x1,-0x164(%rbp)
imul   $0x7,-0x1c(%rbp),%eax
mov    %eax,-0x3b8(%rbp)
imul   $0x3,-0x1c(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x3bc(%rbp)
mov    -0x3b8(%rbp),%eax
imul   -0x3bc(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x170(%rbp)
mov    -0x3b8(%rbp),%eax
imul   -0x3b8(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x178(%rbp)
mov    -0x3bc(%rbp),%eax
imul   -0x3bc(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x180(%rbp)
movslq -0x3bc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x188(%rbp)
movl   $0x0,-0x168(%rbp)
mov    -0x168(%rbp),%eax
mov    -0x3b8(%rbp),%ecx
imul   -0x3bc(%rbp),%ecx
cmp    %ecx,%eax
jge    1358 <AntoRH+0x1a8>
mov    -0x170(%rbp),%rax
movslq -0x168(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    1313 <AntoRH+0x163>
cmpl   $0x0,-0x164(%rbp)
je     13a5 <AntoRH+0x1f5>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x1d0(%rbp),%rcx
lea    -0x220(%rbp),%r8
call   10a0 <norm10@plt>
mov    -0x10(%rbp),%rdi
add    $0x28,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x270(%rbp),%rcx
lea    -0x2c0(%rbp),%r8
call   10a0 <norm10@plt>
movl   $0x0,-0x168(%rbp)
mov    -0x168(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    157a <AntoRH+0x3ca>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x168(%rbp),%rcx
imul   $0xa,(%rax,%rcx,4),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x70(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
call   1070 <getTransf@plt>
cmpl   $0x0,-0x164(%rbp)
je     14d5 <AntoRH+0x325>
lea    -0x310(%rbp),%rdi
lea    -0x2c0(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
lea    -0x360(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x1d0(%rbp),%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
mov    -0x170(%rbp),%rdi
imul   $0x7,-0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x168(%rbp),%rcx
imul   $0xa,(%rax,%rcx,4),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    -0x1d0(%rbp),%rdx
lea    -0x270(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1080 <ZuN@plt>
mov    -0x170(%rbp),%rdi
imul   $0x7,-0x1c(%rbp),%eax
imul   $0x9,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
imul   $0x7,-0x1c(%rbp),%eax
imul   $0x3,%eax,%eax
imul   -0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
imul   $0x7,-0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x360(%rbp),%rsi
lea    -0x310(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1090 <Znd@plt>
jmp    1561 <AntoRH+0x3b1>
mov    -0x170(%rbp),%rdi
imul   $0x7,-0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x168(%rbp),%rcx
imul   $0xa,(%rax,%rcx,4),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1050 <Zu@plt>
mov    -0x170(%rbp),%rdi
imul   $0x7,-0x1c(%rbp),%eax
imul   $0x9,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
imul   $0x7,-0x1c(%rbp),%eax
imul   $0x3,%eax,%eax
imul   -0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
imul   $0x7,-0x168(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0xc0(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1090 <Znd@plt>
jmp    1566 <AntoRH+0x3b6>
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    13af <AntoRH+0x1ff>
mov    -0x188(%rbp),%rdi
mov    -0x170(%rbp),%rsi
mov    -0x178(%rbp),%rdx
mov    -0x3b8(%rbp),%ecx
mov    -0x180(%rbp),%r8
mov    -0x3bc(%rbp),%r9d
call   10d0 <lap_SVD@plt>
mov    %eax,-0x3b4(%rbp)
movl   $0x0,-0x168(%rbp)
cmpl   $0x9,-0x168(%rbp)
jge    160b <AntoRH+0x45b>
mov    -0x180(%rbp),%rax
mov    -0x168(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3bc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x168(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    15b8 <AntoRH+0x408>
mov    -0x28(%rbp),%rdi
mov    $0x3,%esi
call   1060 <trnm@plt>
cmpl   $0x0,-0x164(%rbp)
je     165e <AntoRH+0x4ae>
lea    -0x3b0(%rbp),%rdi
lea    -0x270(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
mov    -0x28(%rbp),%rdi
lea    -0x3b0(%rbp),%rsi
lea    -0x220(%rbp),%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
mov    -0x170(%rbp),%rdi
call   1030 <free@plt>
mov    -0x178(%rbp),%rdi
call   1030 <free@plt>
mov    -0x188(%rbp),%rdi
call   1030 <free@plt>
mov    -0x180(%rbp),%rdi
call   1030 <free@plt>
mov    -0x3b4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AntoRH>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x338,%rsp
mov    $0x1,%r14d
cmp    $0x2,%edx
jl     156e <AntoRH+0x3be>
mov    %rcx,%r12
mov    %rsi,%r13
mov    %rdi,%r15
jne    124e <AntoRH+0x9e>
movslq 0x0(%r13),%rax
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
add    %r15,%rdi
lea    0x2a0(%rsp),%r14
lea    0x70(%rsp),%rdx
mov    %r14,%rsi
call   1070 <getTransf@plt>
movslq 0x4(%r13),%rax
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
add    %r15,%rdi
lea    0x160(%rsp),%rbx
lea    0x110(%rsp),%rbp
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1070 <getTransf@plt>
mov    %r12,(%rsp)
mov    %r14,%rdi
lea    0x70(%rsp),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
mov    %r13,%r9
call   1040 <A2toRH@plt>
mov    %eax,%r14d
jmp    156e <AntoRH+0x3be>
mov    %edx,%ebx
mov    %r12,0x40(%rsp)
lea    0x0(,%rbx,8),%r14d
sub    %edx,%r14d
lea    (%rbx,%rbx,2),%eax
mov    %rax,0x18(%rsp)
lea    (%rbx,%rbx,2),%r12d
add    $0x9,%r12d
mov    %r12d,%ebp
imul   %r14d,%ebp
lea    0x0(,%rbp,8),%edi
call   10c0 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%eax
mov    %r14d,0x20(%rsp)
imul   %r14d,%eax
imul   $0x38,%eax,%edi
call   10c0 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    0x18(%rsp),%rax
lea    0x48(,%rax,8),%r14d
mov    %r14d,%edi
mov    %r12d,0x24(%rsp)
imul   %r12d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r14d,%edi
call   10c0 <malloc@plt>
mov    %rax,0x28(%rsp)
test   %ebp,%ebp
jle    12e6 <AntoRH+0x136>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    0x10(%rsp),%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x160(%rsp),%rcx
lea    0x110(%rsp),%r8
mov    %r15,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
call   10a0 <norm10@plt>
lea    0x28(%r15),%rdi
lea    0xc0(%rsp),%rcx
lea    0x250(%rsp),%r8
mov    %r13,%rsi
mov    %ebx,%edx
call   10a0 <norm10@plt>
mov    %ebx,%eax
shl    $0x6,%eax
sub    %ebx,%eax
cltq
mov    0x10(%rsp),%rcx
mov    %r15,0x60(%rsp)
lea    (%rcx,%rax,8),%r15
lea    (%rbx,%rbx,4),%eax
lea    (%rbx,%rax,4),%eax
cltq
mov    %ebx,%ecx
mov    %rcx,0x50(%rsp)
shl    $0x3,%rax
mov    %rax,0x58(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r13,0x18(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
nop
mov    %r13d,%r14d
shl    $0x3,%r14
lea    (%r15,%r14,1),%rax
mov    %rax,0x68(%rsp)
mov    0x18(%rsp),%rax
movslq (%rax,%rbx,4),%rax
lea    (%rax,%rax,4),%rdi
shl    $0x4,%rdi
mov    0x60(%rsp),%rbp
add    %rbp,%rdi
lea    0x2a0(%rsp),%r12
mov    %r12,%rsi
lea    0x70(%rsp),%rdx
call   1070 <getTransf@plt>
lea    0x200(%rsp),%rdi
lea    0x250(%rsp),%rsi
mov    %r12,%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
lea    0x1b0(%rsp),%rdi
lea    0x70(%rsp),%rsi
lea    0x160(%rsp),%r12
mov    %r12,%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
add    0x10(%rsp),%r14
mov    0x18(%rsp),%rax
movslq (%rax,%rbx,4),%rax
lea    (%rax,%rax,4),%rsi
shl    $0x4,%rsi
add    %rbp,%rsi
mov    %r14,%rdi
mov    %r12,%rdx
lea    0xc0(%rsp),%rcx
mov    0x48(%rsp),%rbp
mov    %ebp,%r8d
call   1080 <ZuN@plt>
mov    0x68(%rsp),%rdi
lea    0x1b0(%rsp),%rsi
lea    0x200(%rsp),%rdx
mov    %ebp,%ecx
call   1090 <Znd@plt>
add    $0x1,%rbx
add    $0x7,%r13
add    0x58(%rsp),%r15
cmp    %rbx,0x50(%rsp)
jne    1360 <AntoRH+0x1b0>
mov    0x28(%rsp),%rdi
mov    0x10(%rsp),%r15
mov    %r15,%rsi
mov    0x38(%rsp),%r12
mov    %r12,%rdx
mov    0x20(%rsp),%ecx
mov    0x30(%rsp),%rbp
mov    %rbp,%r8
mov    0x24(%rsp),%ebx
mov    %ebx,%r9d
call   10d0 <lap_SVD@plt>
mov    %eax,%r14d
movslq %ebx,%rax
movsd  -0x8(%rbp,%rax,8),%xmm0
mov    0x40(%rsp),%rbx
movsd  %xmm0,(%rbx)
lea    (%rax,%rax,2),%rcx
mov    %rax,%rdx
lea    (%rax,%rax,4),%r8
imul   $0x38,%rax,%r9
mov    %rax,%rdi
lea    (%rax,%rax,8),%rsi
shl    $0x4,%rax
movsd  -0x8(%rax,%rbp,1),%xmm0
movsd  %xmm0,0x8(%rbx)
movsd  -0x8(%rbp,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rbx)
shl    $0x5,%rdx
movsd  -0x8(%rdx,%rbp,1),%xmm0
movsd  %xmm0,0x18(%rbx)
movsd  -0x8(%rbp,%r8,8),%xmm0
movsd  %xmm0,0x20(%rbx)
shl    $0x4,%rcx
movsd  -0x8(%rcx,%rbp,1),%xmm0
movsd  %xmm0,0x28(%rbx)
movsd  -0x8(%r9,%rbp,1),%xmm0
movsd  %xmm0,0x30(%rbx)
shl    $0x6,%rdi
movsd  -0x8(%rdi,%rbp,1),%xmm0
movsd  %xmm0,0x38(%rbx)
movsd  -0x8(%rbp,%rsi,8),%xmm0
movsd  %xmm0,0x40(%rbx)
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <trnm@plt>
lea    0x2f0(%rsp),%r13
lea    0xc0(%rsp),%rsi
mov    %r13,%rdi
mov    %rbx,%rdx
mov    $0x3,%ecx
call   10b0 <mmul@plt>
lea    0x110(%rsp),%rdx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x3,%ecx
call   10b0 <mmul@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @AntoRH(double* %0, i32* %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca double*
%10 = alloca [9 x double]
%11 = alloca [9 x double]
%12 = alloca [9 x double]
%13 = alloca [9 x double]
%14 = alloca i32
%15 = alloca i32
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca [9 x double]
%21 = alloca [9 x double]
%22 = alloca [9 x double]
%23 = alloca [9 x double]
%24 = alloca [9 x double]
%25 = alloca [9 x double]
%26 = alloca [9 x double]
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
store double* %0, double** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store double* %3, double** %9
%30 = load i32, i32* %8
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %33
32: ; preds = %4
store i32 1, i32* %5
br label %294
33: ; preds = %4
%34 = load i32, i32* %8
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %65
36: ; preds = %33
%37 = load double*, double** %6
%38 = load i32*, i32** %7
%39 = getelementptr inbounds i32, i32* %38, i64 0
%40 = load i32, i32* %39
%41 = mul nsw i32 10, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %37, i64 %42
%44 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%45 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%46 = call i32 @getTransf(double* %43, double* %44, double* %45)
%47 = load double*, double** %6
%48 = load i32*, i32** %7
%49 = getelementptr inbounds i32, i32* %48, i64 1
%50 = load i32, i32* %49
%51 = mul nsw i32 10, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %47, i64 %52
%54 = getelementptr inbounds [9 x double], [9 x double]* %12, i64 0, i64 0
%55 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%56 = call i32 @getTransf(double* %53, double* %54, double* %55)
%57 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%58 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%59 = getelementptr inbounds [9 x double], [9 x double]* %12, i64 0, i64 0
%60 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%61 = load double*, double** %6
%62 = load i32*, i32** %7
%63 = load double*, double** %9
%64 = call i32 @A2toRH(double* %57, double* %58, double* %59, double* %60, double* %61, i32* %62, double* %63)
store i32 %64, i32* %5
br label %294
65: ; preds = %33
store i32 1, i32* %14
%66 = load i32, i32* %8
%67 = mul nsw i32 7, %66
store i32 %67, i32* %28
%68 = load i32, i32* %8
%69 = mul nsw i32 3, %68
%70 = add nsw i32 9, %69
store i32 %70, i32* %29
%71 = load i32, i32* %28
%72 = load i32, i32* %29
%73 = mul nsw i32 %71, %72
%74 = sext i32 %73 to i64
%75 = mul i64 %74, 8
%76 = trunc i64 %75 to i32
%77 = call i64 @malloc(i32 %76)
%78 = inttoptr i64 %77 to double*
store double* %78, double** %16
%79 = load i32, i32* %28
%80 = load i32, i32* %28
%81 = mul nsw i32 %79, %80
%82 = sext i32 %81 to i64
%83 = mul i64 %82, 8
%84 = trunc i64 %83 to i32
%85 = call i64 @malloc(i32 %84)
%86 = inttoptr i64 %85 to double*
store double* %86, double** %17
%87 = load i32, i32* %29
%88 = load i32, i32* %29
%89 = mul nsw i32 %87, %88
%90 = sext i32 %89 to i64
%91 = mul i64 %90, 8
%92 = trunc i64 %91 to i32
%93 = call i64 @malloc(i32 %92)
%94 = inttoptr i64 %93 to double*
store double* %94, double** %18
%95 = load i32, i32* %29
%96 = sext i32 %95 to i64
%97 = mul i64 %96, 8
%98 = trunc i64 %97 to i32
%99 = call i64 @malloc(i32 %98)
%100 = inttoptr i64 %99 to double*
store double* %100, double** %19
store i32 0, i32* %15
br label %101
101: ; preds = %112, %65
%102 = load i32, i32* %15
%103 = load i32, i32* %28
%104 = load i32, i32* %29
%105 = mul nsw i32 %103, %104
%106 = icmp slt i32 %102, %105
br i1 %106, label %107, label %115
107: ; preds = %101
%108 = load double*, double** %16
%109 = load i32, i32* %15
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
store double 0.000000e+00, double* %111
br label %112
112: ; preds = %107
%113 = load i32, i32* %15
%114 = add nsw i32 %113, 1
store i32 %114, i32* %15
br label %101
115: ; preds = %101
%116 = load i32, i32* %14
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %132
118: ; preds = %115
%119 = load double*, double** %6
%120 = load i32*, i32** %7
%121 = load i32, i32* %8
%122 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%123 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 0
%124 = call i32 @norm10(double* %119, i32* %120, i32 %121, double* %122, double* %123)
%125 = load double*, double** %6
%126 = getelementptr inbounds double, double* %125, i64 5
%127 = load i32*, i32** %7
%128 = load i32, i32* %8
%129 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 0
%130 = getelementptr inbounds [9 x double], [9 x double]* %23, i64 0, i64 0
%131 = call i32 @norm10(double* %126, i32* %127, i32 %128, double* %129, double* %130)
br label %132
132: ; preds = %118, %115
store i32 0, i32* %15
br label %133
133: ; preds = %239, %132
%134 = load i32, i32* %15
%135 = load i32, i32* %8
%136 = icmp slt i32 %134, %135
br i1 %136, label %137, label %242
137: ; preds = %133
%138 = load double*, double** %6
%139 = load i32*, i32** %7
%140 = load i32, i32* %15
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %139, i64 %141
%143 = load i32, i32* %142
%144 = mul nsw i32 10, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %138, i64 %145
%147 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%148 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%149 = call i32 @getTransf(double* %146, double* %147, double* %148)
%150 = load i32, i32* %14
%151 = icmp ne i32 %150, 0
br i1 %151, label %152, label %200
152: ; preds = %137
%153 = getelementptr inbounds [9 x double], [9 x double]* %24, i64 0, i64 0
%154 = getelementptr inbounds [9 x double], [9 x double]* %23, i64 0, i64 0
%155 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%156 = call i32 @mmul(double* %153, double* %154, double* %155, i32 3)
%157 = getelementptr inbounds [9 x double], [9 x double]* %25, i64 0, i64 0
%158 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%159 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%160 = call i32 @mmul(double* %157, double* %158, double* %159, i32 3)
%161 = load double*, double** %16
%162 = load i32, i32* %15
%163 = mul nsw i32 7, %162
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %161, i64 %164
%166 = load double*, double** %6
%167 = load i32*, i32** %7
%168 = load i32, i32* %15
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i32, i32* %167, i64 %169
%171 = load i32, i32* %170
%172 = mul nsw i32 10, %171
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %166, i64 %173
%175 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%176 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 0
%177 = load i32, i32* %8
%178 = call i32 @ZuN(double* %165, double* %174, double* %175, double* %176, i32 %177)
%179 = load double*, double** %16
%180 = load i32, i32* %8
%181 = mul nsw i32 %180, 7
%182 = mul nsw i32 %181, 9
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %179, i64 %183
%185 = load i32, i32* %8
%186 = mul nsw i32 %185, 7
%187 = mul nsw i32 %186, 3
%188 = load i32, i32* %15
%189 = mul nsw i32 %187, %188
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %184, i64 %190
%192 = load i32, i32* %15
%193 = mul nsw i32 7, %192
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds double, double* %191, i64 %194
%196 = getelementptr inbounds [9 x double], [9 x double]* %25, i64 0, i64 0
%197 = getelementptr inbounds [9 x double], [9 x double]* %24, i64 0, i64 0
%198 = load i32, i32* %8
%199 = call i32 @Znd(double* %195, double* %196, double* %197, i32 %198)
br label %238
200: ; preds = %137
%201 = load double*, double** %16
%202 = load i32, i32* %15
%203 = mul nsw i32 7, %202
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %201, i64 %204
%206 = load double*, double** %6
%207 = load i32*, i32** %7
%208 = load i32, i32* %15
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i32, i32* %207, i64 %209
%211 = load i32, i32* %210
%212 = mul nsw i32 10, %211
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds double, double* %206, i64 %213
%215 = load i32, i32* %8
%216 = call i32 @Zu(double* %205, double* %214, i32 %215)
%217 = load double*, double** %16
%218 = load i32, i32* %8
%219 = mul nsw i32 %218, 7
%220 = mul nsw i32 %219, 9
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %217, i64 %221
%223 = load i32, i32* %8
%224 = mul nsw i32 %223, 7
%225 = mul nsw i32 %224, 3
%226 = load i32, i32* %15
%227 = mul nsw i32 %225, %226
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %222, i64 %228
%230 = load i32, i32* %15
%231 = mul nsw i32 7, %230
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %229, i64 %232
%234 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%235 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%236 = load i32, i32* %8
%237 = call i32 @Znd(double* %233, double* %234, double* %235, i32 %236)
br label %238
238: ; preds = %200, %152
br label %239
239: ; preds = %238
%240 = load i32, i32* %15
%241 = add nsw i32 %240, 1
store i32 %241, i32* %15
br label %133
242: ; preds = %133
%243 = load double*, double** %19
%244 = load double*, double** %16
%245 = load double*, double** %17
%246 = load i32, i32* %28
%247 = load double*, double** %18
%248 = load i32, i32* %29
%249 = call i32 @lap_SVD(double* %243, double* %244, double* %245, i32 %246, double* %247, i32 %248)
store i32 %249, i32* %27
store i32 0, i32* %15
br label %250
250: ; preds = %267, %242
%251 = load i32, i32* %15
%252 = icmp slt i32 %251, 9
br i1 %252, label %253, label %270
253: ; preds = %250
%254 = load double*, double** %18
%255 = load i32, i32* %15
%256 = add nsw i32 %255, 1
%257 = load i32, i32* %29
%258 = mul nsw i32 %256, %257
%259 = sub nsw i32 %258, 1
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds double, double* %254, i64 %260
%262 = load double, double* %261
%263 = load double*, double** %9
%264 = load i32, i32* %15
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %263, i64 %265
store double %262, double* %266
br label %267
267: ; preds = %253
%268 = load i32, i32* %15
%269 = add nsw i32 %268, 1
store i32 %269, i32* %15
br label %250
270: ; preds = %250
%271 = load double*, double** %9
%272 = call i32 @trnm(double* %271, i32 3)
%273 = load i32, i32* %14
%274 = icmp ne i32 %273, 0
br i1 %274, label %275, label %284
275: ; preds = %270
%276 = getelementptr inbounds [9 x double], [9 x double]* %26, i64 0, i64 0
%277 = getelementptr inbounds [9 x double], [9 x double]* %22, i64 0, i64 0
%278 = load double*, double** %9
%279 = call i32 @mmul(double* %276, double* %277, double* %278, i32 3)
%280 = load double*, double** %9
%281 = getelementptr inbounds [9 x double], [9 x double]* %26, i64 0, i64 0
%282 = getelementptr inbounds [9 x double], [9 x double]* %21, i64 0, i64 0
%283 = call i32 @mmul(double* %280, double* %281, double* %282, i32 3)
br label %284
284: ; preds = %275, %270
%285 = load double*, double** %16
%286 = call i32 @free(double* %285)
%287 = load double*, double** %17
%288 = call i32 @free(double* %287)
%289 = load double*, double** %19
%290 = call i32 @free(double* %289)
%291 = load double*, double** %18
%292 = call i32 @free(double* %291)
%293 = load i32, i32* %27
store i32 %293, i32* %5
br label %294
294: ; preds = %284, %36, %32
%295 = load i32, i32* %5
ret i32 %295
}

LLVM IR (-O2):
define i32 @AntoRH(double* %0, i32* %1, i32 %2, double* %3) {
%5 = alloca [9 x double]
%6 = alloca [9 x double]
%7 = alloca [9 x double]
%8 = alloca [9 x double]
%9 = alloca [9 x double]
%10 = alloca [9 x double]
%11 = alloca [9 x double]
%12 = alloca [9 x double]
%13 = alloca [9 x double]
%14 = alloca [9 x double]
%15 = alloca [9 x double]
%16 = icmp slt i32 %2, 2
br i1 %16, label %168, label %17
17: ; preds = %4
%18 = bitcast [9 x double]* %5 to i8*
%19 = bitcast [9 x double]* %6 to i8*
%20 = icmp eq i32 %2, 2
br i1 %20, label %21, label %40
21: ; preds = %17
%22 = bitcast [9 x double]* %7 to i8*
%23 = bitcast [9 x double]* %8 to i8*
%24 = load i32, i32* %1
%25 = mul nsw i32 %24, 10
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %0, i64 %26
%28 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%29 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%30 = call i32 @getTransf(double* %27, double* %28, double* %29)
%31 = getelementptr inbounds i32, i32* %1, i64 1
%32 = load i32, i32* %31
%33 = mul nsw i32 %32, 10
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %0, i64 %34
%36 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%37 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 0
%38 = call i32 @getTransf(double* %35, double* %36, double* %37)
%39 = call i32 @A2toRH(double* %28, double* %29, double* %36, double* %37, double* %0, i32* %1, double* %3)
br label %166
40: ; preds = %17
%41 = bitcast [9 x double]* %9 to i8*
%42 = bitcast [9 x double]* %10 to i8*
%43 = bitcast [9 x double]* %11 to i8*
%44 = bitcast [9 x double]* %12 to i8*
%45 = bitcast [9 x double]* %13 to i8*
%46 = bitcast [9 x double]* %14 to i8*
%47 = bitcast [9 x double]* %15 to i8*
%48 = mul nsw i32 %2, 7
%49 = mul nsw i32 %2, 3
%50 = add nsw i32 %49, 9
%51 = mul nsw i32 %50, %48
%52 = shl i32 %51, 3
%53 = tail call i64 @malloc(i32 %52)
%54 = inttoptr i64 %53 to double*
%55 = mul i32 %2, 56
%56 = mul i32 %55, %48
%57 = tail call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to double*
%59 = shl i32 %50, 3
%60 = mul i32 %59, %50
%61 = tail call i64 @malloc(i32 %60)
%62 = inttoptr i64 %61 to double*
%63 = tail call i64 @malloc(i32 %59)
%64 = inttoptr i64 %63 to double*
%65 = icmp sgt i32 %51, 0
br i1 %65, label %66, label %70
66: ; preds = %40
%67 = inttoptr i64 %53 to i8*
%68 = zext i32 %51 to i64
%69 = shl nuw nsw i64 %68, 3
br label %70
70: ; preds = %40, %66
%71 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%72 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%73 = call i32 @norm10(double* %0, i32* %1, i32 %2, double* %71, double* %72)
%74 = getelementptr inbounds double, double* %0, i64 5
%75 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%76 = getelementptr inbounds [9 x double], [9 x double]* %12, i64 0, i64 0
%77 = call i32 @norm10(double* %74, i32* %1, i32 %2, double* %75, double* %76)
%78 = getelementptr inbounds [9 x double], [9 x double]* %5, i64 0, i64 0
%79 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%80 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%81 = getelementptr inbounds [9 x double], [9 x double]* %14, i64 0, i64 0
%82 = mul i32 %2, 63
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %54, i64 %83
%85 = mul i32 %2, 21
%86 = sext i32 %85 to i64
%87 = zext i32 %2 to i64
br label %88
88: ; preds = %70, %88
%89 = phi i64 [ 0, %70 ], [ %110, %88 ]
%90 = getelementptr inbounds i32, i32* %1, i64 %89
%91 = load i32, i32* %90
%92 = mul nsw i32 %91, 10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %0, i64 %93
%95 = call i32 @getTransf(double* %94, double* %78, double* %79)
%96 = call i32 @mmul(double* %80, double* %76, double* %78, i32 3)
%97 = call i32 @mmul(double* %81, double* %79, double* %71, i32 3)
%98 = mul i64 %89, 7
%99 = and i64 %98, 4294967295
%100 = getelementptr inbounds double, double* %54, i64 %99
%101 = load i32, i32* %90
%102 = mul nsw i32 %101, 10
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %0, i64 %103
%105 = call i32 @ZuN(double* %100, double* %104, double* %71, double* %75, i32 %2)
%106 = mul nsw i64 %89, %86
%107 = getelementptr inbounds double, double* %84, i64 %106
%108 = getelementptr inbounds double, double* %107, i64 %99
%109 = call i32 @Znd(double* %108, double* %81, double* %80, i32 %2)
%110 = add nuw nsw i64 %89, 1
%111 = icmp eq i64 %110, %87
br i1 %111, label %112, label %88
112: ; preds = %88
%113 = call i32 @lap_SVD(double* %64, double* %54, double* %58, i32 %48, double* %62, i32 %50)
%114 = sext i32 %50 to i64
%115 = add nsw i64 %114, -1
%116 = getelementptr inbounds double, double* %62, i64 %115
%117 = load double, double* %116
store double %117, double* %3
%118 = shl nsw i64 %114, 1
%119 = add nsw i64 %118, -1
%120 = getelementptr inbounds double, double* %62, i64 %119
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %3, i64 1
store double %121, double* %122
%123 = mul nsw i64 %114, 3
%124 = add nsw i64 %123, -1
%125 = getelementptr inbounds double, double* %62, i64 %124
%126 = load double, double* %125
%127 = getelementptr inbounds double, double* %3, i64 2
store double %126, double* %127
%128 = shl nsw i64 %114, 2
%129 = add nsw i64 %128, -1
%130 = getelementptr inbounds double, double* %62, i64 %129
%131 = load double, double* %130
%132 = getelementptr inbounds double, double* %3, i64 3
store double %131, double* %132
%133 = mul nsw i64 %114, 5
%134 = add nsw i64 %133, -1
%135 = getelementptr inbounds double, double* %62, i64 %134
%136 = load double, double* %135
%137 = getelementptr inbounds double, double* %3, i64 4
store double %136, double* %137
%138 = mul nsw i64 %114, 6
%139 = add nsw i64 %138, -1
%140 = getelementptr inbounds double, double* %62, i64 %139
%141 = load double, double* %140
%142 = getelementptr inbounds double, double* %3, i64 5
store double %141, double* %142
%143 = mul nsw i64 %114, 7
%144 = add nsw i64 %143, -1
%145 = getelementptr inbounds double, double* %62, i64 %144
%146 = load double, double* %145
%147 = getelementptr inbounds double, double* %3, i64 6
store double %146, double* %147
%148 = shl nsw i64 %114, 3
%149 = add nsw i64 %148, -1
%150 = getelementptr inbounds double, double* %62, i64 %149
%151 = load double, double* %150
%152 = getelementptr inbounds double, double* %3, i64 7
store double %151, double* %152
%153 = mul nsw i64 %114, 9
%154 = add nsw i64 %153, -1
%155 = getelementptr inbounds double, double* %62, i64 %154
%156 = load double, double* %155
%157 = getelementptr inbounds double, double* %3, i64 8
store double %156, double* %157
%158 = call i32 @trnm(double* %3, i32 3)
%159 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 0
%160 = call i32 @mmul(double* %159, double* %75, double* %3, i32 3)
%161 = call i32 @mmul(double* %3, double* %159, double* %72, i32 3)
%162 = call i32 @free(double* %54)
%163 = call i32 @free(double* %58)
%164 = call i32 @free(double* %64)
%165 = call i32 @free(double* %62)
br label %166
166: ; preds = %112, %21
%167 = phi i32 [ %39, %21 ], [ %113, %112 ]
br label %168
168: ; preds = %4, %166
%169 = phi i32 [ %167, %166 ], [ 1, %4 ]
ret i32 %169
}