#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 eval(char *, int, double **, double **, int, double *, double *);
scalar_t__ malloc(int);
int main() {
  char func[] = "extsigma";
  char *funcPtr = func;
  int nArgs = 3;
  int blockSize = 1;
  int i;
  double **inReal = (double **)malloc(nArgs * sizeof(double *));
  for (i = 0; i < nArgs; i++)
    inReal[i] = (double *)malloc(blockSize * sizeof(double *));
  double **inImag = (double **)malloc(nArgs * sizeof(double *));
  for (i = 0; i < nArgs; i++)
    inImag[i] = (double *)malloc(blockSize * sizeof(double *));
  double *outReal = (double *)malloc(blockSize * sizeof(double *));
  double *outImag = (double *)malloc(blockSize * sizeof(double *));
  int stat = 0;
  double wrf = 600e6;
  double n_m3 = 1e19;
  double Z = 1;
  inReal[0][0] = wrf;
  inReal[1][0] = n_m3;
  inReal[2][0] = Z;
  inImag[0][0] = 0;
  inImag[1][0] = 0;
  inImag[2][0] = 0;
  stat = eval(funcPtr, nArgs, (double **)inReal, (double **)inImag, blockSize,
              (double *)outReal, (double *)outImag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xee2(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xee0(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xd(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11ab <main+0x8b>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1173 <main+0x53>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11fd <main+0xdd>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c5 <main+0xa5>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movsd  0xdde(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdc9(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdb4(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <eval@plt>
mov    %eax,-0x4c(%rbp)
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movabs $0x616d676973747865,%rax
67 6d 61
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,(%r14)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x8(%r14)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x10(%r14)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x8(%rbx)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,0x10(%rbx)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%r15
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    (%r14),%rcx
movabs $0x41c1e1a300000000,%rdx
e1 c1 41
mov    %rdx,(%rcx)
mov    0x8(%r14),%rcx
movabs $0x43e158e460913d00,%rdx
58 e1 43
mov    %rdx,(%rcx)
mov    0x10(%r14),%rcx
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%rcx)
mov    (%rbx),%rcx
movq   $0x0,(%rcx)
mov    0x8(%rbx),%rcx
movq   $0x0,(%rcx)
mov    0x10(%rbx),%rcx
movq   $0x0,(%rcx)
mov    %rax,(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x3,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    $0x1,%r8d
mov    %r15,%r9
call   1040 <eval@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.func = [9 x i8] c"extsigma\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
%8 = alloca double**
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 0, i32* %1
%15 = bitcast [9 x i8]* %2 to i8*
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
store i8* %16, i8** %3
store i32 3, i32* %4
store i32 1, i32* %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 8
%20 = trunc i64 %19 to i32
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to double**
store double** %22, double*** %7
store i32 0, i32* %6
br label %23
23: ; preds = %38, %0
%24 = load i32, i32* %6
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 8
%31 = trunc i64 %30 to i32
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to double*
%34 = load double**, double*** %7
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double*, double** %34, i64 %36
store double* %33, double** %37
br label %38
38: ; preds = %27
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %23
41: ; preds = %23
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to double**
store double** %47, double*** %8
store i32 0, i32* %6
br label %48
48: ; preds = %63, %41
%49 = load i32, i32* %6
%50 = load i32, i32* %4
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %66
52: ; preds = %48
%53 = load i32, i32* %5
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 8
%56 = trunc i64 %55 to i32
%57 = call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to double*
%59 = load double**, double*** %8
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double*, double** %59, i64 %61
store double* %58, double** %62
br label %63
63: ; preds = %52
%64 = load i32, i32* %6
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %48
66: ; preds = %48
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = mul i64 %68, 8
%70 = trunc i64 %69 to i32
%71 = call i64 @malloc(i32 %70)
%72 = inttoptr i64 %71 to double*
store double* %72, double** %9
%73 = load i32, i32* %5
%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** %10
store i32 0, i32* %11
store double 6.000000e+08, double* %12
store double 1.000000e+19, double* %13
store double 1.000000e+00, double* %14
%79 = load double, double* %12
%80 = load double**, double*** %7
%81 = getelementptr inbounds double*, double** %80, i64 0
%82 = load double*, double** %81
%83 = getelementptr inbounds double, double* %82, i64 0
store double %79, double* %83
%84 = load double, double* %13
%85 = load double**, double*** %7
%86 = getelementptr inbounds double*, double** %85, i64 1
%87 = load double*, double** %86
%88 = getelementptr inbounds double, double* %87, i64 0
store double %84, double* %88
%89 = load double, double* %14
%90 = load double**, double*** %7
%91 = getelementptr inbounds double*, double** %90, i64 2
%92 = load double*, double** %91
%93 = getelementptr inbounds double, double* %92, i64 0
store double %89, double* %93
%94 = load double**, double*** %8
%95 = getelementptr inbounds double*, double** %94, i64 0
%96 = load double*, double** %95
%97 = getelementptr inbounds double, double* %96, i64 0
store double 0.000000e+00, double* %97
%98 = load double**, double*** %8
%99 = getelementptr inbounds double*, double** %98, i64 1
%100 = load double*, double** %99
%101 = getelementptr inbounds double, double* %100, i64 0
store double 0.000000e+00, double* %101
%102 = load double**, double*** %8
%103 = getelementptr inbounds double*, double** %102, i64 2
%104 = load double*, double** %103
%105 = getelementptr inbounds double, double* %104, i64 0
store double 0.000000e+00, double* %105
%106 = load i8*, i8** %3
%107 = load i32, i32* %4
%108 = load double**, double*** %7
%109 = load double**, double*** %8
%110 = load i32, i32* %5
%111 = load double*, double** %9
%112 = load double*, double** %10
%113 = call i32 @eval(i8* %106, i32 %107, double** %108, double** %109, i32 %110, double* %111, double* %112)
store i32 %113, i32* %11
ret i32 0
}

LLVM IR (-O2):
@__const.main.func = [9 x i8] c"extsigma\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @malloc(i32 24)
%4 = inttoptr i64 %3 to double**
%5 = tail call i64 @malloc(i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %4
%7 = tail call i64 @malloc(i32 8)
%8 = inttoptr i64 %7 to double*
%9 = getelementptr inbounds double*, double** %4, i64 1
store double* %8, double** %9
%10 = tail call i64 @malloc(i32 8)
%11 = inttoptr i64 %10 to double*
%12 = getelementptr inbounds double*, double** %4, i64 2
store double* %11, double** %12
%13 = tail call i64 @malloc(i32 24)
%14 = inttoptr i64 %13 to double**
%15 = tail call i64 @malloc(i32 8)
%16 = inttoptr i64 %15 to double*
store double* %16, double** %14
%17 = tail call i64 @malloc(i32 8)
%18 = inttoptr i64 %17 to double*
%19 = getelementptr inbounds double*, double** %14, i64 1
store double* %18, double** %19
%20 = tail call i64 @malloc(i32 8)
%21 = inttoptr i64 %20 to double*
%22 = getelementptr inbounds double*, double** %14, i64 2
store double* %21, double** %22
%23 = tail call i64 @malloc(i32 8)
%24 = inttoptr i64 %23 to double*
%25 = tail call i64 @malloc(i32 8)
%26 = inttoptr i64 %25 to double*
%27 = load double*, double** %4
store double 6.000000e+08, double* %27
%28 = load double*, double** %9
store double 1.000000e+19, double* %28
%29 = load double*, double** %12
store double 1.000000e+00, double* %29
%30 = load double*, double** %14
store double 0.000000e+00, double* %30
%31 = load double*, double** %19
store double 0.000000e+00, double* %31
%32 = load double*, double** %22
store double 0.000000e+00, double* %32
%33 = call i32 @eval(i8* %2, i32 3, double** %4, double** %14, i32 1, double* %24, double* %26)
ret i32 0
}