#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 */
double get_integration_weight(double const, double **,
                              double (*)(int const, double const,
                                         double const *),
                              double (*)(int const, int const, double const,
                                         double const *));
void get_integration_weight_at_omegas(
    double *integration_weights, const int num_omegas, const double *omegas,
    double tetrahedra_omegas[24][4],
    double (*gn)(const int, const double, const double[4]),
    double (*IJ)(const int, const int, const double, const double[4])) {
  int i;
#pragma omp parallel for
  for (i = 0; i < num_omegas; i++) {
    integration_weights[i] =
        get_integration_weight(omegas[i], tetrahedra_omegas, gn, IJ);
  }
}


x86 assembly (clang, -O0):
<get_integration_weight_at_omegas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <get_integration_weight_at_omegas+0x6b>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <get_integration_weight@plt>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <get_integration_weight_at_omegas+0x26>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_integration_weight_at_omegas>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1165 <get_integration_weight_at_omegas+0x55>
mov    %r9,%r15
mov    %r8,%r12
mov    %rcx,%r13
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    %esi,%eax
mov    %rax,(%rsp)
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%r14,8),%xmm0
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <get_integration_weight@plt>
movsd  %xmm0,0x0(%rbp,%r14,8)
add    $0x1,%r14
cmp    %r14,(%rsp)
jne    1140 <get_integration_weight_at_omegas+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @get_integration_weight_at_omegas(double* %0, i32 %1, double* %2, [4 x double]* %3, double (i32, double, double*)* %4, double (i32, i32, double, double*)* %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca [4 x double]*
%11 = alloca double (i32, double, double*)*
%12 = alloca double (i32, i32, double, double*)*
%13 = alloca i32
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store [4 x double]* %3, [4 x double]** %10
store double (i32, double, double*)* %4, double (i32, double, double*)** %11
store double (i32, i32, double, double*)* %5, double (i32, i32, double, double*)** %12
store i32 0, i32* %13
br label %14
14: ; preds = %33, %6
%15 = load i32, i32* %13
%16 = load i32, i32* %8
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %36
18: ; preds = %14
%19 = load double*, double** %9
%20 = load i32, i32* %13
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = load double, double* %22
%24 = load [4 x double]*, [4 x double]** %10
%25 = bitcast [4 x double]* %24 to double**
%26 = load double (i32, double, double*)*, double (i32, double, double*)** %11
%27 = load double (i32, i32, double, double*)*, double (i32, i32, double, double*)** %12
%28 = call double @get_integration_weight(double %23, double** %25, double (i32, double, double*)* %26, double (i32, i32, double, double*)* %27)
%29 = load double*, double** %7
%30 = load i32, i32* %13
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double %28, double* %32
br label %33
33: ; preds = %18
%34 = load i32, i32* %13
%35 = add nsw i32 %34, 1
store i32 %35, i32* %13
br label %14
36: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @get_integration_weight_at_omegas(double* nocapture writeonly %0, i32 %1, double* nocapture %2, [4 x double]* %3, double (i32, double, double*)* %4, double (i32, i32, double, double*)* %5) {
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %19
8: ; preds = %6
%9 = bitcast [4 x double]* %3 to double**
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %17, %11 ]
%13 = getelementptr inbounds double, double* %2, i64 %12
%14 = load double, double* %13
%15 = tail call double @get_integration_weight(double %14, double** %9, double (i32, double, double*)* %4, double (i32, i32, double, double*)* %5)
%16 = getelementptr inbounds double, double* %0, i64 %12
store double %15, double* %16
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %10
br i1 %18, label %19, label %11
19: ; preds = %11, %6
ret void
}