#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 */
void vector_eval_y_operation_inner(
    const void *restrict ctx, const size_t _offset, double *const restrict _v0,
    double *const restrict _v1, double *const restrict _v2,
    double *const restrict _v3, const size_t _num_elems) {
  size_t _i;
  (void)ctx;
  for (_i = 0; _i < _num_elems; ++_i) {
    size_t index = _offset + _i;
    double *const p = _v0 + _i;
    double *const yp = _v1 + _i;
    double *const phi0 = _v2 + _i;
    double *const y = _v3 + _i;
    (void)index;
    {
      {
        const double hgk = *(const double *)ctx;
        *y = *p + hgk * (*yp - *phi0);
      }
    }
  }
}


x86 assembly (clang, -O0):
<vector_eval_y_operation_inner>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    0x10(%rbp),%rax
jae    11d9 <vector_eval_y_operation_inner+0xd9>
mov    -0x10(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x58(%rbp),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1128 <vector_eval_y_operation_inner+0x28>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_eval_y_operation_inner>:
mov    0x8(%rsp),%rax
test   %rax,%rax
je     11b3 <vector_eval_y_operation_inner+0xb3>
movsd  (%rdi),%xmm0
cmp    $0x4,%rax
jae    111c <vector_eval_y_operation_inner+0x1c>
xor    %esi,%esi
jmp    1190 <vector_eval_y_operation_inner+0x90>
mov    %rax,%rsi
and    $0xfffffffffffffffc,%rsi
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
xor    %edi,%edi
nopl   (%rax)
movupd (%rdx,%rdi,8),%xmm2
movupd 0x10(%rdx,%rdi,8),%xmm3
movupd (%rcx,%rdi,8),%xmm4
movupd 0x10(%rcx,%rdi,8),%xmm5
movupd (%r8,%rdi,8),%xmm6
subpd  %xmm6,%xmm4
movupd 0x10(%r8,%rdi,8),%xmm6
subpd  %xmm6,%xmm5
mulpd  %xmm1,%xmm4
addpd  %xmm2,%xmm4
mulpd  %xmm1,%xmm5
addpd  %xmm3,%xmm5
movupd %xmm4,(%r9,%rdi,8)
movupd %xmm5,0x10(%r9,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%rsi
jne    1130 <vector_eval_y_operation_inner+0x30>
cmp    %rax,%rsi
je     11b3 <vector_eval_y_operation_inner+0xb3>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm1
subsd  (%r8,%rsi,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdx,%rsi,8),%xmm1
movsd  %xmm1,(%r9,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1190 <vector_eval_y_operation_inner+0x90>
ret

LLVM IR (-O0):
define void @vector_eval_y_operation_inner(i8* noalias %0, i64 %1, double* noalias %2, double* noalias %3, double* noalias %4, double* noalias %5, i64 %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double
store i8* %0, i8** %8
store i64 %1, i64* %9
store double* %2, double** %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store i64 %6, i64* %14
%22 = load i8*, i8** %8
store i64 0, i64* %15
br label %23
23: ; preds = %57, %7
%24 = load i64, i64* %15
%25 = load i64, i64* %14
%26 = icmp ult i64 %24, %25
br i1 %26, label %27, label %60
27: ; preds = %23
%28 = load i64, i64* %9
%29 = load i64, i64* %15
%30 = add i64 %28, %29
store i64 %30, i64* %16
%31 = load double*, double** %10
%32 = load i64, i64* %15
%33 = getelementptr inbounds double, double* %31, i64 %32
store double* %33, double** %17
%34 = load double*, double** %11
%35 = load i64, i64* %15
%36 = getelementptr inbounds double, double* %34, i64 %35
store double* %36, double** %18
%37 = load double*, double** %12
%38 = load i64, i64* %15
%39 = getelementptr inbounds double, double* %37, i64 %38
store double* %39, double** %19
%40 = load double*, double** %13
%41 = load i64, i64* %15
%42 = getelementptr inbounds double, double* %40, i64 %41
store double* %42, double** %20
%43 = load i64, i64* %16
%44 = load i8*, i8** %8
%45 = bitcast i8* %44 to double*
%46 = load double, double* %45
store double %46, double* %21
%47 = load double*, double** %17
%48 = load double, double* %47
%49 = load double, double* %21
%50 = load double*, double** %18
%51 = load double, double* %50
%52 = load double*, double** %19
%53 = load double, double* %52
%54 = fsub double %51, %53
%55 = call double @llvm.fmuladd.f64(double %49, double %54, double %48)
%56 = load double*, double** %20
store double %55, double* %56
br label %57
57: ; preds = %27
%58 = load i64, i64* %15
%59 = add i64 %58, 1
store i64 %59, i64* %15
br label %23
60: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @vector_eval_y_operation_inner(i8* noalias nocapture %0, i64 %1, double* noalias nocapture %2, double* noalias nocapture %3, double* noalias nocapture %4, double* noalias nocapture writeonly %5, i64 %6) {
%8 = icmp eq i64 %6, 0
br i1 %8, label %66, label %9
9: ; preds = %7
%10 = bitcast i8* %0 to double*
%11 = load double, double* %10
%12 = icmp ult i64 %6, 4
br i1 %12, label %51, label %13
13: ; preds = %9
%14 = and i64 %6, -4
%15 = insertelement <2 x double> poison, double %11, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = insertelement <2 x double> poison, double %11, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
br label %19
19: ; preds = %19, %13
%20 = phi i64 [ 0, %13 ], [ %47, %19 ]
%21 = getelementptr inbounds double, double* %2, i64 %20
%22 = getelementptr inbounds double, double* %3, i64 %20
%23 = getelementptr inbounds double, double* %4, i64 %20
%24 = getelementptr inbounds double, double* %5, i64 %20
%25 = bitcast double* %21 to <2 x double>*
%26 = load <2 x double>, <2 x double>* %25
%27 = getelementptr inbounds double, double* %21, i64 2
%28 = bitcast double* %27 to <2 x double>*
%29 = load <2 x double>, <2 x double>* %28
%30 = bitcast double* %22 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = getelementptr inbounds double, double* %22, i64 2
%33 = bitcast double* %32 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = bitcast double* %23 to <2 x double>*
%36 = load <2 x double>, <2 x double>* %35
%37 = getelementptr inbounds double, double* %23, i64 2
%38 = bitcast double* %37 to <2 x double>*
%39 = load <2 x double>, <2 x double>* %38
%40 = fsub <2 x double> %31, %36
%41 = fsub <2 x double> %34, %39
%42 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %16, <2 x double> %40, <2 x double> %26)
%43 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %41, <2 x double> %29)
%44 = bitcast double* %24 to <2 x double>*
store <2 x double> %42, <2 x double>* %44
%45 = getelementptr inbounds double, double* %24, i64 2
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %43, <2 x double>* %46
%47 = add nuw i64 %20, 4
%48 = icmp eq i64 %47, %14
br i1 %48, label %49, label %19
49: ; preds = %19
%50 = icmp eq i64 %14, %6
br i1 %50, label %66, label %51
51: ; preds = %9, %49
%52 = phi i64 [ 0, %9 ], [ %14, %49 ]
br label %53
53: ; preds = %51, %53
%54 = phi i64 [ %64, %53 ], [ %52, %51 ]
%55 = getelementptr inbounds double, double* %2, i64 %54
%56 = getelementptr inbounds double, double* %3, i64 %54
%57 = getelementptr inbounds double, double* %4, i64 %54
%58 = getelementptr inbounds double, double* %5, i64 %54
%59 = load double, double* %55
%60 = load double, double* %56
%61 = load double, double* %57
%62 = fsub double %60, %61
%63 = tail call double @llvm.fmuladd.f64(double %11, double %62, double %59)
store double %63, double* %58
%64 = add nuw i64 %54, 1
%65 = icmp eq i64 %64, %6
br i1 %65, label %66, label %53
66: ; preds = %53, %49, %7
ret void
}