#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*/ FST_semi_memo(double *, double *, double *, double *, int,
                                 double **, double *, int, int);
int /*<<< orphan*/ InvFST_semi_memo(double *, double *, double *, double *, int,
                                    double **, double *, int, int);
int /*<<< orphan*/ rotateCoefAll(int, int, int, double, double, double,
                                 double *, double *, double *, double *,
                                 double *);
void rotateFct(int bwIn, int bwOut, int degOut, double *sigInR, double *sigInI,
               double *sigOutR, double *sigOutI, double alpha, double beta,
               double gamma, double *scratch, double **spharmonic_pml_table,
               double **transpose_spharmonic_pml_table) {
  double *rcoeffs, *icoeffs, *workspace;
  double *coefOutR, *coefOutI;
  int i;
  rcoeffs = scratch;
  icoeffs = rcoeffs + (bwIn * bwIn);
  coefOutR = icoeffs + (bwIn * bwIn);
  coefOutI = coefOutR + (bwOut * bwOut);
  workspace = coefOutI + (bwOut * bwOut);
  for (i = 0; i < (bwOut * bwOut); i++) {
    coefOutR[i] = 0.;
    coefOutI[i] = 0.;
  }
  FST_semi_memo(sigInR, sigInI, rcoeffs, icoeffs, 2 * bwIn,
                spharmonic_pml_table, workspace, 1, bwIn);
  rotateCoefAll(bwIn, bwOut, degOut, alpha, beta, gamma, rcoeffs, icoeffs,
                coefOutR, coefOutI, workspace);
  InvFST_semi_memo(coefOutR, coefOutI, sigOutR, sigOutI, 2 * bwOut,
                   transpose_spharmonic_pml_table, workspace, 1, bwOut);
}


x86 assembly (clang, -O0):
<rotateFct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
mov    0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1222 <rotateFct+0xf2>
mov    -0x60(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%rax
movslq -0x6c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    11e2 <rotateFct+0xb2>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x4(%rbp),%r8d
shl    $0x1,%r8d
mov    0x20(%rbp),%r9
mov    -0x58(%rbp),%r10
mov    -0x4(%rbp),%eax
mov    %r10,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <FST_semi_memo@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x60(%rbp),%r9
mov    -0x68(%rbp),%r10
mov    -0x58(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <rotateCoefAll@plt>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8d
shl    $0x1,%r8d
mov    0x28(%rbp),%r9
mov    -0x58(%rbp),%r10
mov    -0x8(%rbp),%eax
mov    %r10,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <InvFST_semi_memo@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateFct>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm2,0x38(%rsp)
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %r9,0x40(%rsp)
mov    %r8,%r10
mov    %edx,0xc(%rsp)
mov    %edi,%r14d
mov    0x90(%rsp),%r9
mov    0x88(%rsp),%rdx
mov    %edi,%r8d
imul   %r8d,%r8d
lea    (%rdx,%r8,8),%r15
lea    (%r15,%r8,8),%r12
mov    %rsi,0x20(%rsp)
mov    %esi,%r13d
imul   %r13d,%r13d
lea    (%r12,%r13,8),%rbp
lea    0x0(,%r13,8),%rax
add    %rbp,%rax
test   %r13d,%r13d
je     130a <rotateFct+0x1da>
cmp    $0x4,%r13d
jae    11af <rotateFct+0x7f>
xor    %esi,%esi
jmp    12f0 <rotateFct+0x1c0>
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r13d,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rdi
mov    %rdi,%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %eax,%r11d
and    $0x3,%r11d
cmp    $0xc,%rdi
jae    11e5 <rotateFct+0xb5>
mov    %rdx,%rbx
xor    %edi,%edi
jmp    1278 <rotateFct+0x148>
and    $0xfffffffffffffffc,%rax
mov    %r8,%rdi
shl    $0x4,%rdi
lea    (%rdi,%rdx,1),%r10
add    $0x70,%r10
mov    %rdx,%rbx
add    %rdx,%rdi
lea    (%rdi,%r13,8),%r9
add    $0x70,%r9
xor    %edi,%edi
xorps  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x70(%r10,%rdi,8)
movups %xmm0,-0x60(%r10,%rdi,8)
movups %xmm0,-0x70(%r9,%rdi,8)
movups %xmm0,-0x60(%r9,%rdi,8)
movups %xmm0,-0x50(%r10,%rdi,8)
movups %xmm0,-0x40(%r10,%rdi,8)
movups %xmm0,-0x50(%r9,%rdi,8)
movups %xmm0,-0x40(%r9,%rdi,8)
movups %xmm0,-0x30(%r10,%rdi,8)
movups %xmm0,-0x20(%r10,%rdi,8)
movups %xmm0,-0x30(%r9,%rdi,8)
movups %xmm0,-0x20(%r9,%rdi,8)
movups %xmm0,-0x10(%r10,%rdi,8)
movups %xmm0,(%r10,%rdi,8)
movups %xmm0,-0x10(%r9,%rdi,8)
movups %xmm0,(%r9,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rax
jne    1210 <rotateFct+0xe0>
test   %r11,%r11
mov    %rbx,%rdx
je     12cb <rotateFct+0x19b>
lea    (%rdi,%r8,2),%rdi
lea    (%rdi,%r13,1),%rax
lea    (%rdx,%rax,8),%rax
add    $0x10,%rax
lea    (%rdx,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%r11
xor    %ebx,%ebx
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rdi,%rbx,1)
movups %xmm0,(%rdi,%rbx,1)
movups %xmm0,-0x10(%rax,%rbx,1)
movups %xmm0,(%rax,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r11
jne    12b0 <rotateFct+0x180>
cmp    %r13,%rsi
mov    0x18(%rsp),%rax
mov    0x10(%rsp),%r10
mov    0x90(%rsp),%r9
je     130a <rotateFct+0x1da>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movq   $0x0,(%r12,%rsi,8)
movq   $0x0,0x0(%rbp,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%r13
jne    12f0 <rotateFct+0x1c0>
lea    (%r14,%r14,1),%r8d
sub    $0x8,%rsp
mov    %rcx,%rdi
mov    %r10,%rsi
mov    %r15,%rcx
mov    %rdx,%r13
push   %r14
push   $0x1
push   %rax
mov    %r14,%rbx
mov    %rax,%r14
call   1050 <FST_semi_memo@plt>
add    $0x20,%rsp
mov    %ebx,%edi
mov    0x20(%rsp),%rbx
mov    %ebx,%esi
mov    0xc(%rsp),%edx
movsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
mov    %r13,%rcx
mov    %r15,%r8
mov    %r12,%r9
push   %r14
push   %rbp
call   1040 <rotateCoefAll@plt>
add    $0x10,%rsp
lea    (%rbx,%rbx,1),%r8d
sub    $0x8,%rsp
mov    %r12,%rdi
mov    %rbp,%rsi
mov    0x48(%rsp),%rdx
mov    0x88(%rsp),%rcx
mov    0xa0(%rsp),%r9
push   %rbx
push   $0x1
push   %r14
call   1030 <InvFST_semi_memo@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rotateFct(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5, double* %6, double %7, double %8, double %9, double* %10, double** %11, double** %12) {
%14 = mul nsw i32 %0, %0
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds double, double* %10, i64 %15
%17 = getelementptr double, double* %16, i64 %15
%18 = mul i32 %1, %1
%19 = zext i32 %18 to i64
%20 = getelementptr double, double* %17, i64 %19
%21 = getelementptr inbounds double, double* %20, i64 %19
%22 = icmp eq i32 %18, 0
br i1 %22, label %102, label %23
23: ; preds = %13
%24 = icmp ult i32 %18, 4
br i1 %24, label %94, label %25
25: ; preds = %23
%26 = and i64 %19, 4294967292
%27 = add nsw i64 %26, -4
%28 = lshr exact i64 %27, 2
%29 = add nuw nsw i64 %28, 1
%30 = and i64 %29, 3
%31 = icmp ult i64 %27, 12
br i1 %31, label %75, label %32
32: ; preds = %25
%33 = and i64 %29, 9223372036854775804
br label %34
34: ; preds = %34, %32
%35 = phi i64 [ 0, %32 ], [ %72, %34 ]
%36 = phi i64 [ 0, %32 ], [ %73, %34 ]
%37 = getelementptr inbounds double, double* %17, i64 %35
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %38
%39 = getelementptr inbounds double, double* %37, i64 2
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %40
%41 = getelementptr inbounds double, double* %20, i64 %35
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %44
%45 = or i64 %35, 4
%46 = getelementptr inbounds double, double* %17, i64 %45
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %49
%50 = getelementptr inbounds double, double* %20, i64 %45
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %53
%54 = or i64 %35, 8
%55 = getelementptr inbounds double, double* %17, i64 %54
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %58
%59 = getelementptr inbounds double, double* %20, i64 %54
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %60
%61 = getelementptr inbounds double, double* %59, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %62
%63 = or i64 %35, 12
%64 = getelementptr inbounds double, double* %17, i64 %63
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %65
%66 = getelementptr inbounds double, double* %64, i64 2
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %67
%68 = getelementptr inbounds double, double* %20, i64 %63
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %69
%70 = getelementptr inbounds double, double* %68, i64 2
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %71
%72 = add nuw i64 %35, 16
%73 = add nuw i64 %36, 4
%74 = icmp eq i64 %73, %33
br i1 %74, label %75, label %34
75: ; preds = %34, %25
%76 = phi i64 [ 0, %25 ], [ %72, %34 ]
%77 = icmp eq i64 %30, 0
br i1 %77, label %92, label %78
78: ; preds = %75, %78
%79 = phi i64 [ %89, %78 ], [ %76, %75 ]
%80 = phi i64 [ %90, %78 ], [ 0, %75 ]
%81 = getelementptr inbounds double, double* %17, i64 %79
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %82
%83 = getelementptr inbounds double, double* %81, i64 2
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %84
%85 = getelementptr inbounds double, double* %20, i64 %79
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %86
%87 = getelementptr inbounds double, double* %85, i64 2
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %88
%89 = add nuw i64 %79, 4
%90 = add i64 %80, 1
%91 = icmp eq i64 %90, %30
br i1 %91, label %92, label %78
92: ; preds = %78, %75
%93 = icmp eq i64 %26, %19
br i1 %93, label %102, label %94
94: ; preds = %23, %92
%95 = phi i64 [ 0, %23 ], [ %26, %92 ]
br label %96
96: ; preds = %94, %96
%97 = phi i64 [ %100, %96 ], [ %95, %94 ]
%98 = getelementptr inbounds double, double* %17, i64 %97
store double 0.000000e+00, double* %98
%99 = getelementptr inbounds double, double* %20, i64 %97
store double 0.000000e+00, double* %99
%100 = add nuw nsw i64 %97, 1
%101 = icmp eq i64 %100, %19
br i1 %101, label %102, label %96
102: ; preds = %96, %92, %13
%103 = shl nsw i32 %0, 1
%104 = tail call i32 @FST_semi_memo(double* %3, double* %4, double* %10, double* %16, i32 %103, double** %11, double* %21, i32 1, i32 %0)
%105 = tail call i32 @rotateCoefAll(i32 %0, i32 %1, i32 %2, double %7, double %8, double %9, double* %10, double* %16, double* %17, double* %20, double* %21)
%106 = shl nsw i32 %1, 1
%107 = tail call i32 @InvFST_semi_memo(double* %17, double* %20, double* %5, double* %6, i32 %106, double** %12, double* %21, i32 1, i32 %1)
ret void
}