#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Inverse_SO3_Naive_sym(int, double *, double *, double *,
                                         double *, double *, double *,
                                         int /*<<< orphan*/);
int atoi(char *);
scalar_t__ calloc(int, int);
double csecond();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
int totalCoeffs_so3(int);
int main(int argc, char **argv) {
  int i, bw, n, n3;
  double *rsignal, *isignal;
  double *rcoeffs, *icoeffs;
  double *workspace1, *workspace2;
  double tstart, tstop, runtime;
  FILE *fp;
  if (argc != 4) {
    fprintf(stdout, "Usage: test_soft_sym_inv bw coeffFile ");
    fprintf(stdout, "sampleFile\n");
    exit(0);
  }
  bw = atoi(argv[1]);
  n = 2 * bw;
  n3 = n * n * n;
  rsignal = (double *)calloc(n3, sizeof(double));
  isignal = (double *)calloc(n3, sizeof(double));
  rcoeffs = (double *)malloc(sizeof(double) * totalCoeffs_so3(bw));
  icoeffs = (double *)malloc(sizeof(double) * totalCoeffs_so3(bw));
  workspace1 = (double *)malloc(sizeof(double) * 4 * n3);
  workspace2 = (double *)malloc(sizeof(double) * (24 * bw + 2 * bw * bw));
  if ((rsignal == NULL) || (isignal == NULL) || (rcoeffs == NULL) ||
      (icoeffs == NULL) || (workspace1 == NULL) || (workspace2 == NULL)) {
    perror("Error in allocating memory");
    exit(1);
  }
  fp = fopen(argv[2], "r");
  for (i = 0; i < totalCoeffs_so3(bw); i++) {
    fscanf(fp, "%lf", rcoeffs + i);
    fscanf(fp, "%lf", icoeffs + i);
  }
  fclose(fp);
  tstart = csecond();
  Inverse_SO3_Naive_sym(bw, rcoeffs, icoeffs, rsignal, isignal, workspace1,
                        workspace2, 0);
  tstop = csecond();
  runtime = tstop - tstart;
  fprintf(stdout, "runtime: %.5f seconds\n", runtime);
  fp = fopen(argv[3], "w");
  for (i = 0; i < n3; i++)
    fprintf(fp, "%.16f\n%.16f\n", rsignal[i], isignal[i]);
  fclose(fp);
  free(workspace2);
  free(workspace1);
  free(icoeffs);
  free(rcoeffs);
  free(isignal);
  free(rsignal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     122a <main+0x5a>
mov    0x2de6(%rip),%rax
movslq (%rax),%rdi
lea    0xdfc(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2dce(%rip),%rax
movslq (%rax),%rdi
lea    0xe0b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%edi
call   10f0 <totalCoeffs_so3@plt>
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%edi
call   10f0 <totalCoeffs_so3@plt>
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x20(%rbp),%rax
shl    $0x5,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
imul   $0x18,-0x18(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     131b <main+0x14b>
cmpq   $0x0,-0x30(%rbp)
je     131b <main+0x14b>
cmpq   $0x0,-0x38(%rbp)
je     131b <main+0x14b>
cmpq   $0x0,-0x40(%rbp)
je     131b <main+0x14b>
cmpq   $0x0,-0x48(%rbp)
je     131b <main+0x14b>
cmpq   $0x0,-0x50(%rbp)
jne    1331 <main+0x161>
lea    0xd11(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd0e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x18(%rbp),%edi
call   10f0 <totalCoeffs_so3@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
jge    13b7 <main+0x1e7>
mov    -0x70(%rbp),%rdi
mov    -0x38(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xccb(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xcac(%rip),%rsi
call   1060 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1350 <main+0x180>
mov    -0x70(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x0,%al
call   1050 <csecond@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x50(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   10a0 <Inverse_SO3_Naive_sym@plt>
mov    $0x0,%al
call   1050 <csecond@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x2bc3(%rip),%rax
movslq (%rax),%rdi
movsd  -0x68(%rbp),%xmm0
lea    0xc28(%rip),%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc29(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1498 <main+0x2c8>
mov    -0x70(%rbp),%rdi
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xbea(%rip),%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1452 <main+0x282>
mov    -0x70(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x4,%edi
jne    1453 <main+0x273>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
lea    (%r15,%r15,1),%eax
mov    %eax,%ebp
imul   %eax,%ebp
imul   %eax,%ebp
mov    %ebp,%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,%r12
mov    %r15d,%edi
call   1100 <totalCoeffs_so3@plt>
lea    0x0(,%rax,8),%edi
call   1090 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r15d,%edi
call   1100 <totalCoeffs_so3@plt>
lea    0x0(,%rax,8),%edi
call   1090 <malloc@plt>
mov    %rax,(%rsp)
mov    %ebp,0x14(%rsp)
shl    $0x5,%ebp
mov    %ebp,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
lea    (%r15,%r15,1),%edi
add    $0x18,%edi
imul   %r15d,%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    %rbx,0x40(%rsp)
test   %rbx,%rbx
je     1493 <main+0x2b3>
test   %r12,%r12
je     1493 <main+0x2b3>
cmpq   $0x0,0x8(%rsp)
je     1493 <main+0x2b3>
cmpq   $0x0,(%rsp)
je     1493 <main+0x2b3>
test   %rbp,%rbp
je     1493 <main+0x2b3>
test   %rax,%rax
je     1493 <main+0x2b3>
mov    %rax,0x18(%rsp)
mov    %rbp,0x20(%rsp)
mov    %r12,0x38(%rsp)
mov    %r14,0x30(%rsp)
mov    0x10(%r14),%rdi
lea    0xd6a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
mov    %r15d,%edi
call   1100 <totalCoeffs_so3@plt>
test   %eax,%eax
jle    1347 <main+0x167>
xor    %ebx,%ebx
lea    0xd4f(%rip),%r13
mov    0x8(%rsp),%rbp
mov    (%rsp),%r14
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
add    $0x1,%rbx
mov    %r15d,%edi
call   1100 <totalCoeffs_so3@plt>
cltq
add    $0x8,%r14
add    $0x8,%rbp
cmp    %rax,%rbx
jl     1310 <main+0x130>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
call   1050 <csecond@plt>
movsd  %xmm0,0x28(%rsp)
mov    %r15d,%edi
mov    0x8(%rsp),%rsi
mov    (%rsp),%rdx
mov    0x40(%rsp),%r12
mov    %r12,%rcx
mov    0x38(%rsp),%r13
mov    %r13,%r8
mov    0x20(%rsp),%r9
push   $0x0
push   0x20(%rsp)
call   10a0 <Inverse_SO3_Naive_sym@plt>
add    $0x10,%rsp
xor    %eax,%eax
call   1050 <csecond@plt>
subsd  0x28(%rsp),%xmm0
mov    0x2c40(%rip),%rax
movslq (%rax),%rdi
lea    0xcaa(%rip),%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    0x30(%rsp),%rax
mov    0x18(%rax),%rdi
lea    0xcaa(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    1403 <main+0x223>
mov    %eax,%ebx
xor    %ebp,%ebp
lea    0xc91(%rip),%r14
nopl   0x0(%rax)
movsd  (%r12,%rbp,8),%xmm0
movsd  0x0(%r13,%rbp,8),%xmm1
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1080 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    13e0 <main+0x200>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b86(%rip),%rbx
movslq (%rbx),%rcx
lea    0xb9c(%rip),%rdi
mov    $0x26,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
movslq (%rbx),%rcx
lea    0xbaa(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    0xb99(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [39 x i8] c"Usage: test_soft_sym_inv bw coeffFile \00"
@.str.1 = [12 x i8] c"sampleFile\0A\00"
@.str.2 = [27 x i8] c"Error in allocating memory\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [23 x i8] c"runtime: %.5f seconds\0A\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [13 x i8] c"%.16f\0A%.16f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 4
br i1 %21, label %22, label %32
22: ; preds = %2
%23 = load i32, i32* @stdout
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @exit(i32 0)
unreachable
32: ; preds = %2
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = mul nsw i32 2, %37
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = load i32, i32* %8
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %8
%43 = mul nsw i32 %41, %42
store i32 %43, i32* %9
%44 = load i32, i32* %9
%45 = call i64 @calloc(i32 %44, i32 8)
%46 = inttoptr i64 %45 to double*
store double* %46, double** %10
%47 = load i32, i32* %9
%48 = call i64 @calloc(i32 %47, i32 8)
%49 = inttoptr i64 %48 to double*
store double* %49, double** %11
%50 = load i32, i32* %7
%51 = call i32 @totalCoeffs_so3(i32 %50)
%52 = sext i32 %51 to i64
%53 = mul i64 8, %52
%54 = trunc i64 %53 to i32
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to double*
store double* %56, double** %12
%57 = load i32, i32* %7
%58 = call i32 @totalCoeffs_so3(i32 %57)
%59 = sext i32 %58 to i64
%60 = mul i64 8, %59
%61 = trunc i64 %60 to i32
%62 = call i64 @malloc(i32 %61)
%63 = inttoptr i64 %62 to double*
store double* %63, double** %13
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = mul i64 32, %65
%67 = trunc i64 %66 to i32
%68 = call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to double*
store double* %69, double** %14
%70 = load i32, i32* %7
%71 = mul nsw i32 24, %70
%72 = load i32, i32* %7
%73 = mul nsw i32 2, %72
%74 = load i32, i32* %7
%75 = mul nsw i32 %73, %74
%76 = add nsw i32 %71, %75
%77 = sext i32 %76 to i64
%78 = mul i64 8, %77
%79 = trunc i64 %78 to i32
%80 = call i64 @malloc(i32 %79)
%81 = inttoptr i64 %80 to double*
store double* %81, double** %15
%82 = load double*, double** %10
%83 = icmp eq double* %82, null
br i1 %83, label %99, label %84
84: ; preds = %32
%85 = load double*, double** %11
%86 = icmp eq double* %85, null
br i1 %86, label %99, label %87
87: ; preds = %84
%88 = load double*, double** %12
%89 = icmp eq double* %88, null
br i1 %89, label %99, label %90
90: ; preds = %87
%91 = load double*, double** %13
%92 = icmp eq double* %91, null
br i1 %92, label %99, label %93
93: ; preds = %90
%94 = load double*, double** %14
%95 = icmp eq double* %94, null
br i1 %95, label %99, label %96
96: ; preds = %93
%97 = load double*, double** %15
%98 = icmp eq double* %97, null
br i1 %98, label %99, label %102
99: ; preds = %96, %93, %90, %87, %84, %32
%100 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%101 = call i32 @exit(i32 1)
unreachable
102: ; preds = %96
%103 = load i8**, i8*** %5
%104 = getelementptr inbounds i8*, i8** %103, i64 2
%105 = load i8*, i8** %104
%106 = call i32* @fopen(i8* %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %106, i32** %19
store i32 0, i32* %6
br label %107
107: ; preds = %125, %102
%108 = load i32, i32* %6
%109 = load i32, i32* %7
%110 = call i32 @totalCoeffs_so3(i32 %109)
%111 = icmp slt i32 %108, %110
br i1 %111, label %112, label %128
112: ; preds = %107
%113 = load i32*, i32** %19
%114 = load double*, double** %12
%115 = load i32, i32* %6
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %114, i64 %116
%118 = call i32 @fscanf(i32* %113, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %117)
%119 = load i32*, i32** %19
%120 = load double*, double** %13
%121 = load i32, i32* %6
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = call i32 @fscanf(i32* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %123)
br label %125
125: ; preds = %112
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
store i32 %127, i32* %6
br label %107
128: ; preds = %107
%129 = load i32*, i32** %19
%130 = call i32 @fclose(i32* %129)
%131 = call double (...) @csecond()
store double %131, double* %16
%132 = load i32, i32* %7
%133 = load double*, double** %12
%134 = load double*, double** %13
%135 = load double*, double** %10
%136 = load double*, double** %11
%137 = load double*, double** %14
%138 = load double*, double** %15
%139 = call i32 @Inverse_SO3_Naive_sym(i32 %132, double* %133, double* %134, double* %135, double* %136, double* %137, double* %138, i32 0)
%140 = call double (...) @csecond()
store double %140, double* %17
%141 = load double, double* %17
%142 = load double, double* %16
%143 = fsub double %141, %142
store double %143, double* %18
%144 = load i32, i32* @stdout
%145 = sext i32 %144 to i64
%146 = inttoptr i64 %145 to i32*
%147 = load double, double* %18
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %147)
%149 = load i8**, i8*** %5
%150 = getelementptr inbounds i8*, i8** %149, i64 3
%151 = load i8*, i8** %150
%152 = call i32* @fopen(i8* %151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %152, i32** %19
store i32 0, i32* %6
br label %153
153: ; preds = %170, %128
%154 = load i32, i32* %6
%155 = load i32, i32* %9
%156 = icmp slt i32 %154, %155
br i1 %156, label %157, label %173
157: ; preds = %153
%158 = load i32*, i32** %19
%159 = load double*, double** %10
%160 = load i32, i32* %6
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
%163 = load double, double* %162
%164 = load double*, double** %11
%165 = load i32, i32* %6
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %164, i64 %166
%168 = load double, double* %167
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %163, double %168)
br label %170
170: ; preds = %157
%171 = load i32, i32* %6
%172 = add nsw i32 %171, 1
store i32 %172, i32* %6
br label %153
173: ; preds = %153
%174 = load i32*, i32** %19
%175 = call i32 @fclose(i32* %174)
%176 = load double*, double** %15
%177 = call i32 @free(double* %176)
%178 = load double*, double** %14
%179 = call i32 @free(double* %178)
%180 = load double*, double** %13
%181 = call i32 @free(double* %180)
%182 = load double*, double** %12
%183 = call i32 @free(double* %182)
%184 = load double*, double** %11
%185 = call i32 @free(double* %184)
%186 = load double*, double** %10
%187 = call i32 @free(double* %186)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [39 x i8] c"Usage: test_soft_sym_inv bw coeffFile \00"
@.str.1 = [12 x i8] c"sampleFile\0A\00"
@.str.2 = [27 x i8] c"Error in allocating memory\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [4 x i8] c"%lf\00"
@.str.5 = [23 x i8] c"runtime: %.5f seconds\0A\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [13 x i8] c"%.16f\0A%.16f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 38, i64 1, i32* %7)
%9 = load i32, i32* @stdout
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %11)
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = shl nsw i32 %17, 1
%19 = mul nsw i32 %18, %18
%20 = mul nsw i32 %19, %18
%21 = tail call i64 @calloc(i32 %20, i32 8)
%22 = inttoptr i64 %21 to double*
%23 = tail call i64 @calloc(i32 %20, i32 8)
%24 = inttoptr i64 %23 to double*
%25 = tail call i32 @totalCoeffs_so3(i32 %17)
%26 = shl i32 %25, 3
%27 = tail call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to double*
%29 = tail call i32 @totalCoeffs_so3(i32 %17)
%30 = shl i32 %29, 3
%31 = tail call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to double*
%33 = shl i32 %20, 5
%34 = tail call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to double*
%36 = add i32 %18, 24
%37 = shl i32 %17, 3
%38 = mul i32 %37, %36
%39 = tail call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to double*
%41 = icmp eq i64 %21, 0
%42 = icmp eq i64 %23, 0
%43 = select i1 %41, i1 true, i1 %42
%44 = icmp eq i64 %27, 0
%45 = select i1 %43, i1 true, i1 %44
%46 = icmp eq i64 %31, 0
%47 = select i1 %45, i1 true, i1 %46
%48 = icmp eq i64 %34, 0
%49 = select i1 %47, i1 true, i1 %48
%50 = icmp eq i64 %39, 0
%51 = select i1 %49, i1 true, i1 %50
br i1 %51, label %52, label %55
52: ; preds = %14
%53 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%54 = tail call i32 @exit(i32 1)
unreachable
55: ; preds = %14
%56 = getelementptr inbounds i8*, i8** %1, i64 2
%57 = load i8*, i8** %56
%58 = tail call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%59 = tail call i32 @totalCoeffs_so3(i32 %17)
%60 = icmp sgt i32 %59, 0
br i1 %60, label %61, label %71
61: ; preds = %55, %61
%62 = phi i64 [ %67, %61 ], [ 0, %55 ]
%63 = getelementptr inbounds double, double* %28, i64 %62
%64 = tail call i32 @fscanf(i32* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %63)
%65 = getelementptr inbounds double, double* %32, i64 %62
%66 = tail call i32 @fscanf(i32* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double* %65)
%67 = add nuw nsw i64 %62, 1
%68 = tail call i32 @totalCoeffs_so3(i32 %17)
%69 = sext i32 %68 to i64
%70 = icmp slt i64 %67, %69
br i1 %70, label %61, label %71
71: ; preds = %61, %55
%72 = tail call i32 @fclose(i32* %58)
%73 = tail call double (...) @csecond()
%74 = tail call i32 @Inverse_SO3_Naive_sym(i32 %17, double* %28, double* %32, double* %22, double* %24, double* %35, double* %40, i32 0)
%75 = tail call double (...) @csecond()
%76 = fsub double %75, %73
%77 = load i32, i32* @stdout
%78 = sext i32 %77 to i64
%79 = inttoptr i64 %78 to i32*
%80 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), double %76)
%81 = getelementptr inbounds i8*, i8** %1, i64 3
%82 = load i8*, i8** %81
%83 = tail call i32* @fopen(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%84 = icmp sgt i32 %20, 0
br i1 %84, label %85, label %96
85: ; preds = %71
%86 = zext i32 %20 to i64
br label %87
87: ; preds = %85, %87
%88 = phi i64 [ 0, %85 ], [ %94, %87 ]
%89 = getelementptr inbounds double, double* %22, i64 %88
%90 = load double, double* %89
%91 = getelementptr inbounds double, double* %24, i64 %88
%92 = load double, double* %91
%93 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), double %90, double %92)
%94 = add nuw nsw i64 %88, 1
%95 = icmp eq i64 %94, %86
br i1 %95, label %96, label %87
96: ; preds = %87, %71
%97 = tail call i32 @fclose(i32* %83)
%98 = tail call i32 @free(double* %40)
%99 = tail call i32 @free(double* %35)
%100 = tail call i32 @free(double* %32)
%101 = tail call i32 @free(double* %28)
%102 = tail call i32 @free(double* %24)
%103 = tail call i32 @free(double* %22)
ret i32 0
}