#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*/ gradient(int *, int *, double *, double *, double *);
double innerprod_q2(int *, double *, double *);
int /*<<< orphan*/ linspace(double, double, int, double *);
int /*<<< orphan*/ spline(int, double *, double *, int, double *, double *);
double sqrt(double);
void group_action_by_gamma(int *n1, int *T1, double *q, double *gam,
                           double *qn) {
  int T = *T1, n = *n1;
  int n2 = 1;
  double dt = 1.0 / T, max = 1, min = 0;
  int j, k;
  double val;
  double gammadot[T], ti[T], tmp[T], tmp1[T];
  double *gammadot_ptr, *time_ptr, *tmp_ptr, *tmp1_ptr;
  time_ptr = ti;
  linspace(min, max, T, time_ptr);
  gammadot_ptr = gammadot;
  gradient(T1, &n2, gam, &dt, gammadot_ptr);
  for (k = 0; k < n; k++) {
    tmp_ptr = tmp;
    tmp1_ptr = tmp1;
    for (j = 0; j < T; j++)
      tmp[j] = q[n * j + k];
    spline(T, time_ptr, tmp_ptr, T, gam, tmp1_ptr);
    for (j = 0; j < T; j++)
      qn[n * j + k] = tmp1[j] * sqrt(gammadot[j]);
  }
  val = innerprod_q2(T1, qn, qn);
  for (k = 0; k < T * n; k++)
    qn[k] = qn[k] / sqrt(val);
  return;
}


x86 assembly (clang, -O0):
<group_action_by_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xe6b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x68(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xb0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x78(%rbp)
mov    -0x2c(%rbp),%ecx
lea    0xf(,%rcx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xc0(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x80(%rbp)
mov    -0x2c(%rbp),%ecx
lea    0xf(,%rcx,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0xb8(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x88(%rbp)
mov    %rax,-0x98(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
mov    -0x2c(%rbp),%edi
mov    -0x98(%rbp),%rsi
call   1050 <linspace@plt>
mov    -0xb0(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x90(%rbp),%r8
lea    -0x34(%rbp),%rsi
lea    -0x40(%rbp),%rcx
call   1040 <gradient@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    13af <group_action_by_gamma+0x25f>
mov    -0xb8(%rbp),%rax
mov    -0xc0(%rbp),%rcx
mov    %rcx,-0xa0(%rbp)
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1305 <group_action_by_gamma+0x1b5>
mov    -0xc0(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%edx
imul   -0x54(%rbp),%edx
add    -0x58(%rbp),%edx
movslq %edx,%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x54(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12c5 <group_action_by_gamma+0x175>
mov    -0x2c(%rbp),%edi
mov    -0x98(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0xa8(%rbp),%r9
call   1070 <spline@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    139c <group_action_by_gamma+0x24c>
mov    -0xb0(%rbp),%rax
mov    -0xb8(%rbp),%rcx
movslq -0x54(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x54(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1330 <group_action_by_gamma+0x1e0>
jmp    13a1 <group_action_by_gamma+0x251>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1296 <group_action_by_gamma+0x146>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <innerprod_q2@plt>
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x30(%rbp),%ecx
cmp    %ecx,%eax
jge    1427 <group_action_by_gamma+0x2d7>
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    13cc <group_action_by_gamma+0x27c>
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<group_action_by_gamma>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r8,-0x78(%rbp)
mov    %rcx,-0x80(%rbp)
mov    %rdx,-0x90(%rbp)
mov    %rsi,%r14
mov    %rsp,-0xc8(%rbp)
mov    (%rsi),%ebx
mov    (%rdi),%r12d
cvtsi2sd %ebx,%xmm0
movl   $0x1,-0x84(%rbp)
movsd  0xe68(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,-0xe0(%rbp)
ff
mov    %rsp,%r13
lea    0xf(,%rbx,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
xorpd  %xmm0,%xmm0
mov    %ebx,%edi
mov    %rsi,-0xa0(%rbp)
call   1050 <linspace@plt>
lea    -0x84(%rbp),%rsi
lea    -0xe0(%rbp),%rcx
mov    %r14,-0xc0(%rbp)
mov    %r14,%rdi
mov    -0x80(%rbp),%rdx
mov    %rbx,%r14
mov    %r13,-0x40(%rbp)
mov    %r13,%r8
call   1040 <gradient@plt>
test   %r12d,%r12d
jle    153f <group_action_by_gamma+0x3ef>
lea    -0x1(%r14),%rax
mov    %rax,-0x98(%rbp)
mov    %r14d,%r8d
and    $0x3,%r8d
mov    %r14d,%edx
and    $0xfffffffc,%edx
mov    %r14d,%eax
and    $0xfffffffe,%eax
mov    %rax,-0xd8(%rbp)
mov    %r12,%rsi
shl    $0x4,%rsi
mov    %r12,%rdi
shl    $0x5,%rdi
lea    0x0(,%r12,8),%r13
lea    0x0(,%r13,2),%rbx
add    %r13,%rbx
xor    %eax,%eax
mov    %rax,-0x70(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    %r12,-0xd0(%rbp)
mov    %r14,-0xb8(%rbp)
mov    %r8,-0x38(%rbp)
mov    %rdx,-0x68(%rbp)
mov    %rdi,-0x60(%rbp)
mov    %rbx,-0x58(%rbp)
mov    %rsi,-0x50(%rbp)
jmp    1310 <group_action_by_gamma+0x1c0>
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    -0xa0(%rbp),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    -0x80(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1070 <spline@plt>
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rbx
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    -0x38(%rbp),%r8
mov    -0x70(%rbp),%rcx
add    $0x1,%rcx
addq   $0x8,-0xb0(%rbp)
08
addq   $0x8,-0xa8(%rbp)
08
mov    %rcx,%rax
mov    %rcx,-0x70(%rbp)
cmp    %r12,%rcx
mov    -0xb8(%rbp),%r14
je     153f <group_action_by_gamma+0x3ef>
test   %r14d,%r14d
jle    12b0 <group_action_by_gamma+0x160>
cmpq   $0x3,-0x98(%rbp)
03
jae    1330 <group_action_by_gamma+0x1e0>
xor    %eax,%eax
jmp    137b <group_action_by_gamma+0x22b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0xb0(%rbp),%rcx
xor    %eax,%eax
nopl   0x0(%rax)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%r15,%rax,8)
movsd  (%rcx,%r12,8),%xmm0
movsd  %xmm0,0x8(%r15,%rax,8)
movsd  (%rcx,%rsi,1),%xmm0
movsd  %xmm0,0x10(%r15,%rax,8)
movsd  (%rcx,%rbx,1),%xmm0
movsd  %xmm0,0x18(%r15,%rax,8)
add    $0x4,%rax
add    %rdi,%rcx
cmp    %rax,%rdx
jne    1340 <group_action_by_gamma+0x1f0>
test   %r8,%r8
je     13b5 <group_action_by_gamma+0x265>
lea    (%r15,%rax,8),%rcx
imul   %r12,%rax
add    -0x70(%rbp),%rax
mov    -0x90(%rbp),%rdx
lea    (%rdx,%rax,8),%rax
xor    %edx,%edx
nopl   0x0(%rax)
movsd  (%rax),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
add    $0x1,%rdx
add    %r13,%rax
cmp    %rdx,%r8
jne    13a0 <group_action_by_gamma+0x250>
mov    %r14d,%edi
mov    -0xa0(%rbp),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    -0x80(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1070 <spline@plt>
mov    -0x38(%rbp),%r8
test   %r14d,%r14d
mov    -0x68(%rbp),%rdx
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rbx
mov    -0x50(%rbp),%rsi
jle    12e1 <group_action_by_gamma+0x191>
cmpq   $0x0,-0x98(%rbp)
je     14c6 <group_action_by_gamma+0x376>
mov    -0xa8(%rbp),%r12
xor    %r14d,%r14d
jmp    144d <group_action_by_gamma+0x2fd>
nopl   0x0(%rax)
movsd  %xmm1,-0x48(%rbp)
call   1060 <sqrt@plt>
movsd  -0x48(%rbp),%xmm1
mov    -0x38(%rbp),%r8
mov    -0x68(%rbp),%rdx
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rbx
mov    -0x50(%rbp),%rsi
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%r13,1)
add    $0x2,%r14
add    %rsi,%r12
cmp    %r14,-0xd8(%rbp)
je     14c9 <group_action_by_gamma+0x379>
mov    -0x30(%rbp),%rax
movsd  (%rax,%r14,8),%xmm1
mov    -0x40(%rbp),%rax
movsd  (%rax,%r14,8),%xmm0
ucomisd 0xb9f(%rip),%xmm0
jb     1480 <group_action_by_gamma+0x330>
sqrtsd %xmm0,%xmm0
jmp    148f <group_action_by_gamma+0x33f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,-0x48(%rbp)
call   1060 <sqrt@plt>
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r12)
mov    -0x30(%rbp),%rax
movsd  0x8(%rax,%r14,8),%xmm1
mov    -0x40(%rbp),%rax
movsd  0x8(%rax,%r14,8),%xmm0
ucomisd 0xb51(%rip),%xmm0
jb     1410 <group_action_by_gamma+0x2c0>
sqrtsd %xmm0,%xmm0
jmp    141f <group_action_by_gamma+0x2cf>
xor    %r14d,%r14d
testb  $0x1,-0xb8(%rbp)
mov    -0xd0(%rbp),%r12
je     12e1 <group_action_by_gamma+0x191>
mov    -0x30(%rbp),%rax
movsd  (%rax,%r14,8),%xmm1
mov    -0x40(%rbp),%rax
movsd  (%rax,%r14,8),%xmm0
ucomisd 0xb0f(%rip),%xmm0
jb     1501 <group_action_by_gamma+0x3b1>
sqrtsd %xmm0,%xmm0
jmp    1524 <group_action_by_gamma+0x3d4>
movsd  %xmm1,-0x48(%rbp)
call   1060 <sqrt@plt>
movsd  -0x48(%rbp),%xmm1
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rbx
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    -0x38(%rbp),%r8
mulsd  %xmm0,%xmm1
imul   %r12,%r14
add    -0x70(%rbp),%r14
mov    -0x78(%rbp),%rax
movsd  %xmm1,(%rax,%r14,8)
jmp    12e1 <group_action_by_gamma+0x191>
mov    -0xc0(%rbp),%rdi
mov    %r12,%rbx
mov    -0x78(%rbp),%r12
mov    %r12,%rsi
mov    %r12,%rdx
call   1030 <innerprod_q2@plt>
imul   %r14d,%ebx
test   %ebx,%ebx
jle    1663 <group_action_by_gamma+0x513>
movapd %xmm0,%xmm1
mov    %ebx,%r14d
cmp    $0x1,%ebx
jne    159c <group_action_by_gamma+0x44c>
xor    %ebx,%ebx
test   $0x1,%r14b
je     1663 <group_action_by_gamma+0x513>
movsd  (%r12,%rbx,8),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1646 <group_action_by_gamma+0x4f6>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1659 <group_action_by_gamma+0x509>
mov    %r14d,%r15d
and    $0xfffffffe,%r15d
xor    %ebx,%ebx
xorps  %xmm2,%xmm2
sqrtsd %xmm1,%xmm2
xorpd  %xmm3,%xmm3
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm2,-0x40(%rbp)
jmp    15d4 <group_action_by_gamma+0x484>
nopl   0x0(%rax)
divsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%r12,%rbx,8)
add    $0x2,%rbx
cmp    %rbx,%r15
je     1572 <group_action_by_gamma+0x422>
movsd  (%r12,%rbx,8),%xmm4
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
jae    1605 <group_action_by_gamma+0x4b5>
movapd %xmm1,%xmm0
movsd  %xmm4,-0x38(%rbp)
call   1060 <sqrt@plt>
movsd  -0x38(%rbp),%xmm4
xorpd  %xmm3,%xmm3
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
divsd  %xmm0,%xmm4
movsd  %xmm4,(%r12,%rbx,8)
movsd  0x8(%r12,%rbx,8),%xmm4
ucomisd %xmm3,%xmm1
movapd %xmm2,%xmm0
jae    15c0 <group_action_by_gamma+0x470>
movapd %xmm1,%xmm0
movsd  %xmm4,-0x38(%rbp)
call   1060 <sqrt@plt>
movsd  -0x38(%rbp),%xmm4
xorpd  %xmm3,%xmm3
movsd  -0x40(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
jmp    15c0 <group_action_by_gamma+0x470>
movapd %xmm1,%xmm0
movsd  %xmm2,-0x30(%rbp)
call   1060 <sqrt@plt>
movsd  -0x30(%rbp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%r12,%rbx,8)
mov    -0xc8(%rbp),%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @group_action_by_gamma(i32* %0, i32* %1, double* %2, double* %3, double* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
store i32* %0, i32** %6
store i32* %1, i32** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%29 = load i32*, i32** %7
%30 = load i32, i32* %29
store i32 %30, i32* %11
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
store i32 %32, i32* %12
store i32 1, i32* %13
%33 = load i32, i32* %11
%34 = sitofp i32 %33 to double
%35 = fdiv double 1.000000e+00, %34
store double %35, double* %14
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %16
%36 = load i32, i32* %11
%37 = zext i32 %36 to i64
%38 = call i8* @llvm.stacksave()
store i8* %38, i8** %20
%39 = alloca double, i64 %37
store i64 %37, i64* %21
%40 = load i32, i32* %11
%41 = zext i32 %40 to i64
%42 = alloca double, i64 %41
store i64 %41, i64* %22
%43 = load i32, i32* %11
%44 = zext i32 %43 to i64
%45 = alloca double, i64 %44
store i64 %44, i64* %23
%46 = load i32, i32* %11
%47 = zext i32 %46 to i64
%48 = alloca double, i64 %47
store i64 %47, i64* %24
store double* %42, double** %26
%49 = load double, double* %16
%50 = load double, double* %15
%51 = load i32, i32* %11
%52 = load double*, double** %26
%53 = call i32 @linspace(double %49, double %50, i32 %51, double* %52)
store double* %39, double** %25
%54 = load i32*, i32** %7
%55 = load double*, double** %9
%56 = load double*, double** %25
%57 = call i32 @gradient(i32* %54, i32* %13, double* %55, double* %14, double* %56)
store i32 0, i32* %18
br label %58
58: ; preds = %118, %5
%59 = load i32, i32* %18
%60 = load i32, i32* %12
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %121
62: ; preds = %58
store double* %45, double** %27
store double* %48, double** %28
store i32 0, i32* %17
br label %63
63: ; preds = %80, %62
%64 = load i32, i32* %17
%65 = load i32, i32* %11
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %83
67: ; preds = %63
%68 = load double*, double** %8
%69 = load i32, i32* %12
%70 = load i32, i32* %17
%71 = mul nsw i32 %69, %70
%72 = load i32, i32* %18
%73 = add nsw i32 %71, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %68, i64 %74
%76 = load double, double* %75
%77 = load i32, i32* %17
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %45, i64 %78
store double %76, double* %79
br label %80
80: ; preds = %67
%81 = load i32, i32* %17
%82 = add nsw i32 %81, 1
store i32 %82, i32* %17
br label %63
83: ; preds = %63
%84 = load i32, i32* %11
%85 = load double*, double** %26
%86 = load double*, double** %27
%87 = load i32, i32* %11
%88 = load double*, double** %9
%89 = load double*, double** %28
%90 = call i32 @spline(i32 %84, double* %85, double* %86, i32 %87, double* %88, double* %89)
store i32 0, i32* %17
br label %91
91: ; preds = %114, %83
%92 = load i32, i32* %17
%93 = load i32, i32* %11
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %117
95: ; preds = %91
%96 = load i32, i32* %17
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %48, i64 %97
%99 = load double, double* %98
%100 = load i32, i32* %17
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %39, i64 %101
%103 = load double, double* %102
%104 = call double @sqrt(double %103)
%105 = fmul double %99, %104
%106 = load double*, double** %10
%107 = load i32, i32* %12
%108 = load i32, i32* %17
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %18
%111 = add nsw i32 %109, %110
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %106, i64 %112
store double %105, double* %113
br label %114
114: ; preds = %95
%115 = load i32, i32* %17
%116 = add nsw i32 %115, 1
store i32 %116, i32* %17
br label %91
117: ; preds = %91
br label %118
118: ; preds = %117
%119 = load i32, i32* %18
%120 = add nsw i32 %119, 1
store i32 %120, i32* %18
br label %58
121: ; preds = %58
%122 = load i32*, i32** %7
%123 = load double*, double** %10
%124 = load double*, double** %10
%125 = call double @innerprod_q2(i32* %122, double* %123, double* %124)
store double %125, double* %19
store i32 0, i32* %18
br label %126
126: ; preds = %145, %121
%127 = load i32, i32* %18
%128 = load i32, i32* %11
%129 = load i32, i32* %12
%130 = mul nsw i32 %128, %129
%131 = icmp slt i32 %127, %130
br i1 %131, label %132, label %148
132: ; preds = %126
%133 = load double*, double** %10
%134 = load i32, i32* %18
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = load double, double* %19
%139 = call double @sqrt(double %138)
%140 = fdiv double %137, %139
%141 = load double*, double** %10
%142 = load i32, i32* %18
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
store double %140, double* %144
br label %145
145: ; preds = %132
%146 = load i32, i32* %18
%147 = add nsw i32 %146, 1
store i32 %147, i32* %18
br label %126
148: ; preds = %126
%149 = load i8*, i8** %20
ret void
}

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