#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 */
float const calc_hidden_output(float const *, float const *, float, float,
                               float, float);
float mu_NN(float Lqnorm, float Ltnorm, float Nqnorm, float Ntnorm) {
  const int inputs = 4;
  const int hidden = 6;
  const float biases[] = {-4.25264, -3.63484, -5.86653,
                          -4.78472, -2.76356, -2.21580};
  const float weights[] = {1.96172,  1.07181,  -7.41256, 0.26471,  0.84643,
                           1.46777,  -1.04800, -0.51425, 1.42697,  1.99927,
                           0.64647,  0.27834,  1.34216,  1.64064,  0.35538,
                           -8.08311, 2.30046,  1.31700,  -0.46435, -0.46803,
                           0.90090,  -3.53067, 0.59212,  1.47503,  -1.26036,
                           1.52812,  1.58413,  -1.90409, 0.92803,  -0.66871};
  float mu = 0.0;
  for (int h = 0; h < hidden; h++) {
    mu += calc_hidden_output(weights + inputs * h, biases + h, Lqnorm, Ltnorm,
                             Nqnorm, Ntnorm) *
          weights[hidden * inputs + h];
  }
  return 20.0 * mu;
}


x86 assembly (clang, -O0):
<mu_NN>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x6,-0x18(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x78,%edx
call   1040 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movl   $0x0,-0xb8(%rbp)
cmpl   $0x6,-0xb8(%rbp)
jge    122c <mu_NN+0x10c>
lea    -0xb0(%rbp),%rdi
mov    -0xb8(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
movslq -0xb8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <calc_hidden_output@plt>
mov    -0xb8(%rbp),%eax
add    $0x18,%eax
cltq
movss  -0xb0(%rbp,%rax,4),%xmm2
ff ff
movss  -0xb4(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    119b <mu_NN+0x7b>
movss  -0xb4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movsd  0xdc0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_NN>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movss  %xmm3,0x1c(%rsp)
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    0xee0(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec4(%rip),%xmm4
movaps %xmm4,0x20(%rsp)
lea    0x30(%rsp),%r14
mov    0xf43(%rip),%rax
mov    %rax,0xb0(%rsp)
movaps 0xf24(%rip),%xmm4
movaps %xmm4,0xa0(%rsp)
movaps 0xf05(%rip),%xmm4
movaps %xmm4,0x90(%rsp)
movaps 0xee6(%rip),%xmm4
movaps %xmm4,0x80(%rsp)
movaps 0xec7(%rip),%xmm4
movaps %xmm4,0x70(%rsp)
movaps 0xeab(%rip),%xmm4
movaps %xmm4,0x60(%rsp)
movaps 0xe8f(%rip),%xmm4
movaps %xmm4,0x50(%rsp)
movaps 0xe73(%rip),%xmm4
movaps %xmm4,0x40(%rsp)
lea    0x90(%rsp),%r15
lea    0x80(%rsp),%r12
lea    0x70(%rsp),%r13
lea    0x60(%rsp),%rbx
lea    0x50(%rsp),%rbp
lea    0x40(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1030 <calc_hidden_output@plt>
mulss  0xa0(%rsp),%xmm0
xorps  %xmm1,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x24(%rsp),%rsi
mov    %rbp,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0xa4(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0xa8(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x2c(%rsp),%rsi
mov    %r13,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0xac(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r12,%rdi
mov    %r14,%rsi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0xb0(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x34(%rsp),%rsi
mov    %r15,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0xb4(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
mulss  0xcd8(%rip),%xmm0
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.mu_NN.biases = [6 x float] [float 0xC01102B400000000, float 0xC00D142700000000, float 0xC0177753A0000000, float 0xC013238DA0000000, float 0xC0061BC560000000, float 0xC001B9F560000000]
@__const.mu_NN.weights = [30 x float] [float 0x3FFF633480000000, float 0x3FF1262240000000, float 0xC01DA67620000000, float 0x3FD0F10240000000, float 0x3FEB15F460000000, float 0x3FF77BFC60000000, float 0xBFF0C49BA0000000, float 0xBFE074BC60000000, float 0x3FF6D4DE80000000, float 0x3FFFFD0280000000, float 0x3FE4AFE1E0000000, float 0x3FD1D052A0000000, float 0x3FF5797CC0000000, float 0x3FFA400FC0000000, float 0x3FD6BE8BC0000000, float 0xC0202A8D60000000, float 0x40026757A0000000, float 0x3FF5126EA0000000, float 0xBFDDB7E900000000, float 0xBFDDF43420000000, float 0x3FECD42C40000000, float 0xC00C3ECFE0000000, float 0x3FE2F2A5A0000000, float 0x3FF799B900000000, float 0xBFF42A6F40000000, float 0x3FF8732E00000000, float 0x3FF95898C0000000, float 0xBFFE772720000000, float 0x3FEDB26C00000000, float 0xBFE5661280000000]
define float @mu_NN(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca [6 x float]
%12 = alloca [30 x float]
%13 = alloca float
%14 = alloca i32
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
store i32 4, i32* %9
store i32 6, i32* %10
%15 = bitcast [6 x float]* %11 to i8*
%16 = bitcast [30 x float]* %12 to i8*
store float 0.000000e+00, float* %13
store i32 0, i32* %14
br label %17
17: ; preds = %42, %4
%18 = load i32, i32* %14
%19 = icmp slt i32 %18, 6
br i1 %19, label %20, label %45
20: ; preds = %17
%21 = getelementptr inbounds [30 x float], [30 x float]* %12, i64 0, i64 0
%22 = load i32, i32* %14
%23 = mul nsw i32 4, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %21, i64 %24
%26 = getelementptr inbounds [6 x float], [6 x float]* %11, i64 0, i64 0
%27 = load i32, i32* %14
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
%30 = load float, float* %5
%31 = load float, float* %6
%32 = load float, float* %7
%33 = load float, float* %8
%34 = call float @calc_hidden_output(float* %25, float* %29, float %30, float %31, float %32, float %33)
%35 = load i32, i32* %14
%36 = add nsw i32 24, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [30 x float], [30 x float]* %12, i64 0, i64 %37
%39 = load float, float* %38
%40 = load float, float* %13
%41 = call float @llvm.fmuladd.f32(float %34, float %39, float %40)
store float %41, float* %13
br label %42
42: ; preds = %20
%43 = load i32, i32* %14
%44 = add nsw i32 %43, 1
store i32 %44, i32* %14
br label %17
45: ; preds = %17
%46 = load float, float* %13
%47 = fpext float %46 to double
%48 = fmul double 2.000000e+01, %47
%49 = fptrunc double %48 to float
ret float %49
}

LLVM IR (-O2):
@__const.mu_NN.biases = [6 x float] [float 0xC01102B400000000, float 0xC00D142700000000, float 0xC0177753A0000000, float 0xC013238DA0000000, float 0xC0061BC560000000, float 0xC001B9F560000000]
@__const.mu_NN.weights = [30 x float] [float 0x3FFF633480000000, float 0x3FF1262240000000, float 0xC01DA67620000000, float 0x3FD0F10240000000, float 0x3FEB15F460000000, float 0x3FF77BFC60000000, float 0xBFF0C49BA0000000, float 0xBFE074BC60000000, float 0x3FF6D4DE80000000, float 0x3FFFFD0280000000, float 0x3FE4AFE1E0000000, float 0x3FD1D052A0000000, float 0x3FF5797CC0000000, float 0x3FFA400FC0000000, float 0x3FD6BE8BC0000000, float 0xC0202A8D60000000, float 0x40026757A0000000, float 0x3FF5126EA0000000, float 0xBFDDB7E900000000, float 0xBFDDF43420000000, float 0x3FECD42C40000000, float 0xC00C3ECFE0000000, float 0x3FE2F2A5A0000000, float 0x3FF799B900000000, float 0xBFF42A6F40000000, float 0x3FF8732E00000000, float 0x3FF95898C0000000, float 0xBFFE772720000000, float 0x3FEDB26C00000000, float 0xBFE5661280000000]
define float @mu_NN(float %0, float %1, float %2, float %3) {
%5 = alloca [6 x float]
%6 = alloca [30 x float]
%7 = bitcast [6 x float]* %5 to i8*
%8 = bitcast [30 x float]* %6 to i8*
%9 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 0
%10 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 0
%11 = call float @calc_hidden_output(float* %9, float* %10, float %0, float %1, float %2, float %3)
%12 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 24
%13 = load float, float* %12
%14 = call float @llvm.fmuladd.f32(float %11, float %13, float 0.000000e+00)
%15 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 4
%16 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 1
%17 = call float @calc_hidden_output(float* %15, float* %16, float %0, float %1, float %2, float %3)
%18 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 25
%19 = load float, float* %18
%20 = call float @llvm.fmuladd.f32(float %17, float %19, float %14)
%21 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 8
%22 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 2
%23 = call float @calc_hidden_output(float* %21, float* %22, float %0, float %1, float %2, float %3)
%24 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 26
%25 = load float, float* %24
%26 = call float @llvm.fmuladd.f32(float %23, float %25, float %20)
%27 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 12
%28 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 3
%29 = call float @calc_hidden_output(float* %27, float* %28, float %0, float %1, float %2, float %3)
%30 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 27
%31 = load float, float* %30
%32 = call float @llvm.fmuladd.f32(float %29, float %31, float %26)
%33 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 16
%34 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 4
%35 = call float @calc_hidden_output(float* %33, float* %34, float %0, float %1, float %2, float %3)
%36 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 28
%37 = load float, float* %36
%38 = call float @llvm.fmuladd.f32(float %35, float %37, float %32)
%39 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 20
%40 = getelementptr inbounds [6 x float], [6 x float]* %5, i64 0, i64 5
%41 = call float @calc_hidden_output(float* %39, float* %40, float %0, float %1, float %2, float %3)
%42 = getelementptr inbounds [30 x float], [30 x float]* %6, i64 0, i64 29
%43 = load float, float* %42
%44 = call float @llvm.fmuladd.f32(float %41, float %43, float %38)
%45 = fmul float %44, 2.000000e+01
ret float %45
}