#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 G(float);
size_t IN(int, int const, int const);
size_t OUT(int /*<<< orphan*/, int const, int const);
float myFunc(const int vIndex, const float *restrict p,
             const float *restrict ex, const int nExamples, float *pred) {
  register float h1;
  register float o;
  float in[2];
  in[0] = ex[IN(0, nExamples, vIndex)];
  in[1] = ex[IN(1, nExamples, vIndex)];
  h1 = p[0];
  o = p[1];
  h1 += in[0] * p[2];
  h1 += in[1] * p[3];
  h1 = G(h1);
  o += in[0] * p[4];
  o += in[1] * p[5];
  o += h1 * p[6];
  return o - ex[OUT(0, nExamples, vIndex)];
}


x86 assembly (clang, -O0):
<myFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x4(%rbp),%edx
xor    %edi,%edi
call   1050 <IN@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
call   1050 <IN@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
movss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x34(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
movss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1030 <G@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm2
movss  -0x30(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x34(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm2
movss  -0x30(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  0x18(%rax),%xmm2
movss  -0x30(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x4(%rbp),%edx
xor    %edi,%edi
call   1040 <OUT@plt>
movss  -0x44(%rbp),%xmm0
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
subss  (%rax,%rcx,4),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFunc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %edi,%edi
mov    %ecx,%esi
mov    %ebx,%edx
call   1050 <IN@plt>
movss  (%r14,%rax,4),%xmm0
movss  %xmm0,0xc(%rsp)
mov    $0x1,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   1050 <IN@plt>
movss  (%r14,%rax,4),%xmm2
movss  %xmm2,0x10(%rsp)
movss  0x8(%rbp),%xmm1
mulss  0xc(%rsp),%xmm1
addss  0x0(%rbp),%xmm1
movss  0x4(%rbp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0xc(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <G@plt>
movss  0xc(%rsp),%xmm1
mulss  0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
addss  0x14(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
mulss  0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
mulss  0x18(%rbp),%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,0xc(%rsp)
xor    %edi,%edi
mov    %r15d,%esi
mov    %ebx,%edx
call   1040 <OUT@plt>
movss  0xc(%rsp),%xmm0
subss  (%r14,%rax,4),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @myFunc(i32 %0, float* noalias %1, float* noalias %2, i32 %3, float* %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca i32
%10 = alloca float*
%11 = alloca float
%12 = alloca float
%13 = alloca [2 x float]
store i32 %0, i32* %6
store float* %1, float** %7
store float* %2, float** %8
store i32 %3, i32* %9
store float* %4, float** %10
%14 = load float*, float** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %6
%17 = call i64 @IN(i32 0, i32 %15, i32 %16)
%18 = getelementptr inbounds float, float* %14, i64 %17
%19 = load float, float* %18
%20 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 0
store float %19, float* %20
%21 = load float*, float** %8
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = call i64 @IN(i32 1, i32 %22, i32 %23)
%25 = getelementptr inbounds float, float* %21, i64 %24
%26 = load float, float* %25
%27 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 1
store float %26, float* %27
%28 = load float*, float** %7
%29 = getelementptr inbounds float, float* %28, i64 0
%30 = load float, float* %29
store float %30, float* %11
%31 = load float*, float** %7
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
store float %33, float* %12
%34 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 0
%35 = load float, float* %34
%36 = load float*, float** %7
%37 = getelementptr inbounds float, float* %36, i64 2
%38 = load float, float* %37
%39 = load float, float* %11
%40 = call float @llvm.fmuladd.f32(float %35, float %38, float %39)
store float %40, float* %11
%41 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 1
%42 = load float, float* %41
%43 = load float*, float** %7
%44 = getelementptr inbounds float, float* %43, i64 3
%45 = load float, float* %44
%46 = load float, float* %11
%47 = call float @llvm.fmuladd.f32(float %42, float %45, float %46)
store float %47, float* %11
%48 = load float, float* %11
%49 = call float @G(float %48)
store float %49, float* %11
%50 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 0
%51 = load float, float* %50
%52 = load float*, float** %7
%53 = getelementptr inbounds float, float* %52, i64 4
%54 = load float, float* %53
%55 = load float, float* %12
%56 = call float @llvm.fmuladd.f32(float %51, float %54, float %55)
store float %56, float* %12
%57 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 1
%58 = load float, float* %57
%59 = load float*, float** %7
%60 = getelementptr inbounds float, float* %59, i64 5
%61 = load float, float* %60
%62 = load float, float* %12
%63 = call float @llvm.fmuladd.f32(float %58, float %61, float %62)
store float %63, float* %12
%64 = load float, float* %11
%65 = load float*, float** %7
%66 = getelementptr inbounds float, float* %65, i64 6
%67 = load float, float* %66
%68 = load float, float* %12
%69 = call float @llvm.fmuladd.f32(float %64, float %67, float %68)
store float %69, float* %12
%70 = load float, float* %12
%71 = load float*, float** %8
%72 = load i32, i32* %9
%73 = load i32, i32* %6
%74 = call i64 @OUT(i32 0, i32 %72, i32 %73)
%75 = getelementptr inbounds float, float* %71, i64 %74
%76 = load float, float* %75
%77 = fsub float %70, %76
ret float %77
}

LLVM IR (-O2):
define float @myFunc(i32 %0, float* noalias nocapture %1, float* noalias nocapture %2, i32 %3, float* nocapture readnone %4) {
%6 = tail call i64 @IN(i32 0, i32 %3, i32 %0)
%7 = getelementptr inbounds float, float* %2, i64 %6
%8 = load float, float* %7
%9 = tail call i64 @IN(i32 1, i32 %3, i32 %0)
%10 = getelementptr inbounds float, float* %2, i64 %9
%11 = load float, float* %10
%12 = load float, float* %1
%13 = getelementptr inbounds float, float* %1, i64 1
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = tail call float @llvm.fmuladd.f32(float %8, float %16, float %12)
%18 = getelementptr inbounds float, float* %1, i64 3
%19 = load float, float* %18
%20 = tail call float @llvm.fmuladd.f32(float %11, float %19, float %17)
%21 = tail call float @G(float %20)
%22 = getelementptr inbounds float, float* %1, i64 4
%23 = load float, float* %22
%24 = tail call float @llvm.fmuladd.f32(float %8, float %23, float %14)
%25 = getelementptr inbounds float, float* %1, i64 5
%26 = load float, float* %25
%27 = tail call float @llvm.fmuladd.f32(float %11, float %26, float %24)
%28 = getelementptr inbounds float, float* %1, i64 6
%29 = load float, float* %28
%30 = tail call float @llvm.fmuladd.f32(float %21, float %29, float %27)
%31 = tail call i64 @OUT(i32 0, i32 %3, i32 %0)
%32 = getelementptr inbounds float, float* %2, i64 %31
%33 = load float, float* %32
%34 = fsub float %30, %33
ret float %34
}