#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_ibeta_diff_operation_inner(const void *restrict ctx,
                                       const size_t _offset,
                                       double *const restrict _v0,
                                       double *const restrict _v1,
                                       const size_t _num_elems) {
  size_t _i;
  (void)ctx;
  for (_i = 0; _i < _num_elems; ++_i) {
    size_t index = _offset + _i;
    double *const phiip1 = _v0 + _i;
    double *const phii = _v1 + _i;
    (void)index;
    {
      {
        const double ibetai = *(const double *)ctx;
        *phii = ibetai * (*phii - *phiip1);
      }
    }
  }
}


x86 assembly (clang, -O0):
<vector_ibeta_diff_operation_inner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    119f <vector_ibeta_diff_operation_inner+0x9f>
mov    -0x10(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x40(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1120 <vector_ibeta_diff_operation_inner+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_ibeta_diff_operation_inner>:
test   %r8,%r8
je     121c <vector_ibeta_diff_operation_inner+0x11c>
movsd  (%rdi),%xmm0
cmp    $0x4,%r8
jae    111a <vector_ibeta_diff_operation_inner+0x1a>
xor    %eax,%eax
jmp    1200 <vector_ibeta_diff_operation_inner+0x100>
mov    %r8,%rax
and    $0xfffffffffffffffc,%rax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rax),%rsi
mov    %rsi,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rsi,%rsi
je     121d <vector_ibeta_diff_operation_inner+0x11d>
mov    %r9,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movupd (%rdx,%rsi,8),%xmm2
movupd 0x10(%rdx,%rsi,8),%xmm3
movupd (%rcx,%rsi,8),%xmm4
subpd  %xmm2,%xmm4
movupd 0x10(%rcx,%rsi,8),%xmm2
subpd  %xmm3,%xmm2
movupd 0x20(%rcx,%rsi,8),%xmm3
movupd 0x30(%rcx,%rsi,8),%xmm5
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm2
movupd %xmm4,(%rcx,%rsi,8)
movupd %xmm2,0x10(%rcx,%rsi,8)
movupd 0x20(%rdx,%rsi,8),%xmm2
subpd  %xmm2,%xmm3
movupd 0x30(%rdx,%rsi,8),%xmm2
subpd  %xmm2,%xmm5
mulpd  %xmm1,%xmm3
mulpd  %xmm1,%xmm5
movupd %xmm3,0x20(%rcx,%rsi,8)
movupd %xmm5,0x30(%rcx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1150 <vector_ibeta_diff_operation_inner+0x50>
test   $0x1,%r9b
je     11f6 <vector_ibeta_diff_operation_inner+0xf6>
movupd (%rcx,%rsi,8),%xmm2
movupd 0x10(%rcx,%rsi,8),%xmm3
movupd (%rdx,%rsi,8),%xmm4
subpd  %xmm4,%xmm2
movupd 0x10(%rdx,%rsi,8),%xmm4
subpd  %xmm4,%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rcx,%rsi,8)
movupd %xmm3,0x10(%rcx,%rsi,8)
cmp    %r8,%rax
je     121c <vector_ibeta_diff_operation_inner+0x11c>
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm1
subsd  (%rdx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rcx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r8
jne    1200 <vector_ibeta_diff_operation_inner+0x100>
ret
xor    %esi,%esi
test   $0x1,%r9b
jne    11c5 <vector_ibeta_diff_operation_inner+0xc5>
jmp    11f6 <vector_ibeta_diff_operation_inner+0xf6>

LLVM IR (-O0):
define void @vector_ibeta_diff_operation_inner(i8* noalias %0, i64 %1, double* noalias %2, double* noalias %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca double*
%9 = alloca double*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store double* %2, double** %8
store double* %3, double** %9
store i64 %4, i64* %10
%16 = load i8*, i8** %6
store i64 0, i64* %11
br label %17
17: ; preds = %43, %5
%18 = load i64, i64* %11
%19 = load i64, i64* %10
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %46
21: ; preds = %17
%22 = load i64, i64* %7
%23 = load i64, i64* %11
%24 = add i64 %22, %23
store i64 %24, i64* %12
%25 = load double*, double** %8
%26 = load i64, i64* %11
%27 = getelementptr inbounds double, double* %25, i64 %26
store double* %27, double** %13
%28 = load double*, double** %9
%29 = load i64, i64* %11
%30 = getelementptr inbounds double, double* %28, i64 %29
store double* %30, double** %14
%31 = load i64, i64* %12
%32 = load i8*, i8** %6
%33 = bitcast i8* %32 to double*
%34 = load double, double* %33
store double %34, double* %15
%35 = load double, double* %15
%36 = load double*, double** %14
%37 = load double, double* %36
%38 = load double*, double** %13
%39 = load double, double* %38
%40 = fsub double %37, %39
%41 = fmul double %35, %40
%42 = load double*, double** %14
store double %41, double* %42
br label %43
43: ; preds = %21
%44 = load i64, i64* %11
%45 = add i64 %44, 1
store i64 %45, i64* %11
br label %17
46: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @vector_ibeta_diff_operation_inner(i8* noalias nocapture %0, i64 %1, double* noalias nocapture %2, double* noalias nocapture %3, i64 %4) {
%6 = icmp eq i64 %4, 0
br i1 %6, label %103, label %7
7: ; preds = %5
%8 = bitcast i8* %0 to double*
%9 = load double, double* %8
%10 = icmp ult i64 %4, 4
br i1 %10, label %91, label %11
11: ; preds = %7
%12 = and i64 %4, -4
%13 = insertelement <2 x double> poison, double %9, i64 0
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
%15 = insertelement <2 x double> poison, double %9, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = add i64 %12, -4
%18 = lshr exact i64 %17, 2
%19 = add nuw nsw i64 %18, 1
%20 = and i64 %19, 1
%21 = icmp eq i64 %17, 0
br i1 %21, label %67, label %22
22: ; preds = %11
%23 = and i64 %19, 9223372036854775806
br label %24
24: ; preds = %24, %22
%25 = phi i64 [ 0, %22 ], [ %64, %24 ]
%26 = phi i64 [ 0, %22 ], [ %65, %24 ]
%27 = getelementptr inbounds double, double* %2, i64 %25
%28 = getelementptr inbounds double, double* %3, i64 %25
%29 = bitcast double* %28 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = getelementptr inbounds double, double* %28, i64 2
%32 = bitcast double* %31 to <2 x double>*
%33 = load <2 x double>, <2 x double>* %32
%34 = bitcast double* %27 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = getelementptr inbounds double, double* %27, i64 2
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = fsub <2 x double> %30, %35
%40 = fsub <2 x double> %33, %38
%41 = fmul <2 x double> %14, %39
%42 = fmul <2 x double> %16, %40
%43 = bitcast double* %28 to <2 x double>*
store <2 x double> %41, <2 x double>* %43
%44 = bitcast double* %31 to <2 x double>*
store <2 x double> %42, <2 x double>* %44
%45 = or i64 %25, 4
%46 = getelementptr inbounds double, double* %2, i64 %45
%47 = getelementptr inbounds double, double* %3, i64 %45
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %47, i64 2
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = bitcast double* %46 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %46, i64 2
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = fsub <2 x double> %49, %54
%59 = fsub <2 x double> %52, %57
%60 = fmul <2 x double> %14, %58
%61 = fmul <2 x double> %16, %59
%62 = bitcast double* %47 to <2 x double>*
store <2 x double> %60, <2 x double>* %62
%63 = bitcast double* %50 to <2 x double>*
store <2 x double> %61, <2 x double>* %63
%64 = add nuw i64 %25, 8
%65 = add i64 %26, 2
%66 = icmp eq i64 %65, %23
br i1 %66, label %67, label %24
67: ; preds = %24, %11
%68 = phi i64 [ 0, %11 ], [ %64, %24 ]
%69 = icmp eq i64 %20, 0
br i1 %69, label %89, label %70
70: ; preds = %67
%71 = getelementptr inbounds double, double* %2, i64 %68
%72 = getelementptr inbounds double, double* %3, i64 %68
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = getelementptr inbounds double, double* %72, i64 2
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = bitcast double* %71 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %71, i64 2
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = fsub <2 x double> %74, %79
%84 = fsub <2 x double> %77, %82
%85 = fmul <2 x double> %14, %83
%86 = fmul <2 x double> %16, %84
%87 = bitcast double* %72 to <2 x double>*
store <2 x double> %85, <2 x double>* %87
%88 = bitcast double* %75 to <2 x double>*
store <2 x double> %86, <2 x double>* %88
br label %89
89: ; preds = %67, %70
%90 = icmp eq i64 %12, %4
br i1 %90, label %103, label %91
91: ; preds = %7, %89
%92 = phi i64 [ 0, %7 ], [ %12, %89 ]
br label %93
93: ; preds = %91, %93
%94 = phi i64 [ %101, %93 ], [ %92, %91 ]
%95 = getelementptr inbounds double, double* %2, i64 %94
%96 = getelementptr inbounds double, double* %3, i64 %94
%97 = load double, double* %96
%98 = load double, double* %95
%99 = fsub double %97, %98
%100 = fmul double %9, %99
store double %100, double* %96
%101 = add nuw i64 %94, 1
%102 = icmp eq i64 %101, %4
br i1 %102, label %103, label %93
103: ; preds = %93, %89, %5
ret void
}