#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 lamda_NN(float Lqnorm, float Ltnorm, float Nqnorm, float Ntnorm) {
  const int inputs = 4;
  const int hidden = 4;
  const float biases[] = {-0.73195, -1.43792, -1.18839, -3.01141};
  const float weights[] = {-0.52356, -3.37650, 1.12984,  -0.46796, -4.71361,
                           0.14166,  1.66807,  0.16383,  -0.94895, -1.24358,
                           -1.20293, 0.95434,  -0.00318, 0.53022,  -0.04914,
                           -0.77046, 2.45630,  3.02905,  2.53803,  2.64379};
  float lamda = 0.0;
  for (int h = 0; h < hidden; h++) {
    lamda += calc_hidden_output(weights + inputs * h, biases + h, Lqnorm,
                                Ltnorm, Nqnorm, Ntnorm) *
             weights[hidden * inputs + h];
  }
  return lamda;
}


x86 assembly (clang, -O0):
<lamda_NN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
mov    0xeac(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movl   $0x0,-0x88(%rbp)
cmpl   $0x4,-0x88(%rbp)
jge    1218 <lamda_NN+0xf8>
lea    -0x80(%rbp),%rdi
mov    -0x88(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
movslq -0x88(%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    -0x88(%rbp),%eax
add    $0x10,%eax
cltq
movss  -0x80(%rbp,%rax,4),%xmm2
movss  -0x84(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    118d <lamda_NN+0x6d>
movss  -0x84(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lamda_NN>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movss  %xmm3,0x1c(%rsp)
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movaps 0xec5(%rip),%xmm4
movaps %xmm4,0x20(%rsp)
movaps 0xf09(%rip),%xmm4
movaps %xmm4,0x70(%rsp)
movaps 0xeed(%rip),%xmm4
movaps %xmm4,0x60(%rsp)
movaps 0xed1(%rip),%xmm4
movaps %xmm4,0x50(%rsp)
movaps 0xeb5(%rip),%xmm4
movaps %xmm4,0x40(%rsp)
movaps 0xe99(%rip),%xmm4
movaps %xmm4,0x30(%rsp)
lea    0x60(%rsp),%r14
lea    0x50(%rsp),%r15
lea    0x40(%rsp),%rbx
lea    0x30(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1030 <calc_hidden_output@plt>
mulss  0x70(%rsp),%xmm0
xorps  %xmm1,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x24(%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  0x74(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x28(%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  0x78(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x2c(%rsp),%rsi
mov    %r14,%rdi
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x1c(%rsp),%xmm3
call   1030 <calc_hidden_output@plt>
mulss  0x7c(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.lamda_NN.biases = [4 x float] [float 0xBFE76C2260000000, float 0xBFF701B860000000, float 0xBFF303A540000000, float 0xC008175E20000000]
@__const.lamda_NN.weights = [20 x float] [float 0xBFE0C100E0000000, float 0xC00B031260000000, float 0x3FF213D320000000, float 0xBFDDF30E80000000, float 0xC012DABCA0000000, float 0x3FC221EA40000000, float 0x3FFAB06A20000000, float 0x3FC4F861A0000000, float 0xBFEE5DCC60000000, float 0xBFF3E5B420000000, float 0xBFF33F3380000000, float 0x3FEE89F400000000, float 0xBF6A0CF180000000, float 0x3FE0F78FE0000000, float 0xBFA928E0C0000000, float 0xBFE8A79BC0000000, float 0x4003A680A0000000, float 0x40083B7EA0000000, float 0x40044DE2A0000000, float 0x4005267B60000000]
define float @lamda_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 [4 x float]
%12 = alloca [20 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 4, i32* %10
%15 = bitcast [4 x float]* %11 to i8*
%16 = bitcast [20 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, 4
br i1 %19, label %20, label %45
20: ; preds = %17
%21 = getelementptr inbounds [20 x float], [20 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 [4 x float], [4 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 16, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [20 x float], [20 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
ret float %46
}

LLVM IR (-O2):
@__const.lamda_NN.biases = [4 x float] [float 0xBFE76C2260000000, float 0xBFF701B860000000, float 0xBFF303A540000000, float 0xC008175E20000000]
@__const.lamda_NN.weights = [20 x float] [float 0xBFE0C100E0000000, float 0xC00B031260000000, float 0x3FF213D320000000, float 0xBFDDF30E80000000, float 0xC012DABCA0000000, float 0x3FC221EA40000000, float 0x3FFAB06A20000000, float 0x3FC4F861A0000000, float 0xBFEE5DCC60000000, float 0xBFF3E5B420000000, float 0xBFF33F3380000000, float 0x3FEE89F400000000, float 0xBF6A0CF180000000, float 0x3FE0F78FE0000000, float 0xBFA928E0C0000000, float 0xBFE8A79BC0000000, float 0x4003A680A0000000, float 0x40083B7EA0000000, float 0x40044DE2A0000000, float 0x4005267B60000000]
define float @lamda_NN(float %0, float %1, float %2, float %3) {
%5 = alloca [4 x float]
%6 = alloca [20 x float]
%7 = bitcast [4 x float]* %5 to i8*
%8 = bitcast [20 x float]* %6 to i8*
%9 = getelementptr inbounds [20 x float], [20 x float]* %6, i64 0, i64 0
%10 = getelementptr inbounds [4 x float], [4 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 [20 x float], [20 x float]* %6, i64 0, i64 16
%13 = load float, float* %12
%14 = call float @llvm.fmuladd.f32(float %11, float %13, float 0.000000e+00)
%15 = getelementptr inbounds [20 x float], [20 x float]* %6, i64 0, i64 4
%16 = getelementptr inbounds [4 x float], [4 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 [20 x float], [20 x float]* %6, i64 0, i64 17
%19 = load float, float* %18
%20 = call float @llvm.fmuladd.f32(float %17, float %19, float %14)
%21 = getelementptr inbounds [20 x float], [20 x float]* %6, i64 0, i64 8
%22 = getelementptr inbounds [4 x float], [4 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 [20 x float], [20 x float]* %6, i64 0, i64 18
%25 = load float, float* %24
%26 = call float @llvm.fmuladd.f32(float %23, float %25, float %20)
%27 = getelementptr inbounds [20 x float], [20 x float]* %6, i64 0, i64 12
%28 = getelementptr inbounds [4 x float], [4 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 [20 x float], [20 x float]* %6, i64 0, i64 19
%31 = load float, float* %30
%32 = call float @llvm.fmuladd.f32(float %29, float %31, float %26)
ret float %32
}