#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 exp(float);
float calc_hidden_output(const float *weights, const float *bias, float Lqnorm,
                         float Ltnorm, float Nqnorm, float Ntnorm) {
  float res;
  res = Lqnorm * weights[0] + Ltnorm * weights[1] + Nqnorm * weights[2] +
        Ntnorm * weights[3] + *bias;
  res = 1.0 / (1.0 + exp(-(res)));
  return res;
}


x86 assembly (clang, -O0):
<calc_hidden_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
movss  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x1c(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movsd  0xe51(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe45(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hidden_output>:
push   %rax
mulss  0x4(%rdi),%xmm1
mulss  (%rdi),%xmm0
addss  %xmm1,%xmm0
mulss  0x8(%rdi),%xmm2
addss  %xmm2,%xmm0
mulss  0xc(%rdi),%xmm3
addss  %xmm3,%xmm0
addss  (%rsi),%xmm0
xorps  0xec5(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calc_hidden_output(float* %0, float* %1, float %2, float %3, float %4, float %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float* %0, float** %7
store float* %1, float** %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%14 = load float, float* %9
%15 = load float*, float** %7
%16 = getelementptr inbounds float, float* %15, i64 0
%17 = load float, float* %16
%18 = load float, float* %10
%19 = load float*, float** %7
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fmul float %18, %21
%23 = call float @llvm.fmuladd.f32(float %14, float %17, float %22)
%24 = load float, float* %11
%25 = load float*, float** %7
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = call float @llvm.fmuladd.f32(float %24, float %27, float %23)
%29 = load float, float* %12
%30 = load float*, float** %7
%31 = getelementptr inbounds float, float* %30, i64 3
%32 = load float, float* %31
%33 = call float @llvm.fmuladd.f32(float %29, float %32, float %28)
%34 = load float*, float** %8
%35 = load float, float* %34
%36 = fadd float %33, %35
store float %36, float* %13
%37 = load float, float* %13
%38 = fneg float %37
%39 = call double @exp(float %38)
%40 = fadd double 1.000000e+00, %39
%41 = fdiv double 1.000000e+00, %40
%42 = fptrunc double %41 to float
store float %42, float* %13
%43 = load float, float* %13
ret float %43
}

LLVM IR (-O2):
define float @calc_hidden_output(float* nocapture %0, float* nocapture %1, float %2, float %3, float %4, float %5) {
%7 = load float, float* %0
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fmul float %9, %3
%11 = tail call float @llvm.fmuladd.f32(float %2, float %7, float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
%13 = load float, float* %12
%14 = tail call float @llvm.fmuladd.f32(float %4, float %13, float %11)
%15 = getelementptr inbounds float, float* %0, i64 3
%16 = load float, float* %15
%17 = tail call float @llvm.fmuladd.f32(float %5, float %16, float %14)
%18 = load float, float* %1
%19 = fadd float %18, %17
%20 = fneg float %19
%21 = tail call double @exp(float %20)
%22 = fadd double %21, 1.000000e+00
%23 = fdiv double 1.000000e+00, %22
%24 = fptrunc double %23 to float
ret float %24
}