#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 sg_vector_neg_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 z = _v0 + _i;
    double *const x = _v1 + _i;
    (void)index;
    {
      { *z = -*x; }
    }
  }
}


x86 assembly (clang, -O0):
<sg_vector_neg_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    1198 <sg_vector_neg_operation_inner+0x98>
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    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1120 <sg_vector_neg_operation_inner+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_vector_neg_operation_inner>:
test   %r8,%r8
je     11d5 <sg_vector_neg_operation_inner+0xd5>
cmp    $0x4,%r8
jae    1116 <sg_vector_neg_operation_inner+0x16>
xor    %eax,%eax
jmp    11b6 <sg_vector_neg_operation_inner+0xb6>
mov    %r8,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rsi
mov    %rsi,%r9
shr    $0x2,%r9
add    $0x1,%r9
test   %rsi,%rsi
je     11d6 <sg_vector_neg_operation_inner+0xd6>
mov    %r9,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
movaps 0xebb(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movups (%rcx,%rsi,8),%xmm1
movups 0x10(%rcx,%rsi,8),%xmm2
xorps  %xmm0,%xmm1
xorps  %xmm0,%xmm2
movups %xmm1,(%rdx,%rsi,8)
movups %xmm2,0x10(%rdx,%rsi,8)
movups 0x20(%rcx,%rsi,8),%xmm1
movups 0x30(%rcx,%rsi,8),%xmm2
xorps  %xmm0,%xmm1
xorps  %xmm0,%xmm2
movups %xmm1,0x20(%rdx,%rsi,8)
movups %xmm2,0x30(%rdx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1150 <sg_vector_neg_operation_inner+0x50>
test   $0x1,%r9b
je     11b1 <sg_vector_neg_operation_inner+0xb1>
movups (%rcx,%rsi,8),%xmm0
movups 0x10(%rcx,%rsi,8),%xmm1
movaps 0xe5e(%rip),%xmm2
xorps  %xmm2,%xmm0
xorps  %xmm2,%xmm1
movups %xmm0,(%rdx,%rsi,8)
movups %xmm1,0x10(%rdx,%rsi,8)
cmp    %r8,%rax
je     11d5 <sg_vector_neg_operation_inner+0xd5>
movaps 0xe43(%rip),%xmm0
nopl   (%rax)
movsd  (%rcx,%rax,8),%xmm1
xorps  %xmm0,%xmm1
movlps %xmm1,(%rdx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r8
jne    11c0 <sg_vector_neg_operation_inner+0xc0>
ret
xor    %esi,%esi
test   $0x1,%r9b
jne    1192 <sg_vector_neg_operation_inner+0x92>
jmp    11b1 <sg_vector_neg_operation_inner+0xb1>

LLVM IR (-O0):
define void @sg_vector_neg_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*
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
%15 = load i8*, i8** %6
store i64 0, i64* %11
br label %16
16: ; preds = %35, %5
%17 = load i64, i64* %11
%18 = load i64, i64* %10
%19 = icmp ult i64 %17, %18
br i1 %19, label %20, label %38
20: ; preds = %16
%21 = load i64, i64* %7
%22 = load i64, i64* %11
%23 = add i64 %21, %22
store i64 %23, i64* %12
%24 = load double*, double** %8
%25 = load i64, i64* %11
%26 = getelementptr inbounds double, double* %24, i64 %25
store double* %26, double** %13
%27 = load double*, double** %9
%28 = load i64, i64* %11
%29 = getelementptr inbounds double, double* %27, i64 %28
store double* %29, double** %14
%30 = load i64, i64* %12
%31 = load double*, double** %14
%32 = load double, double* %31
%33 = fneg double %32
%34 = load double*, double** %13
store double %33, double* %34
br label %35
35: ; preds = %20
%36 = load i64, i64* %11
%37 = add i64 %36, 1
store i64 %37, i64* %11
br label %16
38: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @sg_vector_neg_operation_inner(i8* noalias nocapture readnone %0, i64 %1, double* noalias nocapture writeonly %2, double* noalias nocapture %3, i64 %4) {
%6 = icmp eq i64 %4, 0
br i1 %6, label %77, label %7
7: ; preds = %5
%8 = icmp ult i64 %4, 4
br i1 %8, label %67, label %9
9: ; preds = %7
%10 = and i64 %4, -4
%11 = add i64 %10, -4
%12 = lshr exact i64 %11, 2
%13 = add nuw nsw i64 %12, 1
%14 = and i64 %13, 1
%15 = icmp eq i64 %11, 0
br i1 %15, label %49, label %16
16: ; preds = %9
%17 = and i64 %13, 9223372036854775806
br label %18
18: ; preds = %18, %16
%19 = phi i64 [ 0, %16 ], [ %46, %18 ]
%20 = phi i64 [ 0, %16 ], [ %47, %18 ]
%21 = getelementptr inbounds double, double* %2, i64 %19
%22 = getelementptr inbounds double, double* %3, i64 %19
%23 = bitcast double* %22 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = getelementptr inbounds double, double* %22, i64 2
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = fneg <2 x double> %24
%29 = fneg <2 x double> %27
%30 = bitcast double* %21 to <2 x double>*
store <2 x double> %28, <2 x double>* %30
%31 = getelementptr inbounds double, double* %21, i64 2
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> %29, <2 x double>* %32
%33 = or i64 %19, 4
%34 = getelementptr inbounds double, double* %2, i64 %33
%35 = getelementptr inbounds double, double* %3, i64 %33
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds double, double* %35, i64 2
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = fneg <2 x double> %37
%42 = fneg <2 x double> %40
%43 = bitcast double* %34 to <2 x double>*
store <2 x double> %41, <2 x double>* %43
%44 = getelementptr inbounds double, double* %34, i64 2
%45 = bitcast double* %44 to <2 x double>*
store <2 x double> %42, <2 x double>* %45
%46 = add nuw i64 %19, 8
%47 = add i64 %20, 2
%48 = icmp eq i64 %47, %17
br i1 %48, label %49, label %18
49: ; preds = %18, %9
%50 = phi i64 [ 0, %9 ], [ %46, %18 ]
%51 = icmp eq i64 %14, 0
br i1 %51, label %65, label %52
52: ; preds = %49
%53 = getelementptr inbounds double, double* %2, i64 %50
%54 = getelementptr inbounds double, double* %3, i64 %50
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = getelementptr inbounds double, double* %54, i64 2
%58 = bitcast double* %57 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = fneg <2 x double> %56
%61 = fneg <2 x double> %59
%62 = bitcast double* %53 to <2 x double>*
store <2 x double> %60, <2 x double>* %62
%63 = getelementptr inbounds double, double* %53, i64 2
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %61, <2 x double>* %64
br label %65
65: ; preds = %49, %52
%66 = icmp eq i64 %10, %4
br i1 %66, label %77, label %67
67: ; preds = %7, %65
%68 = phi i64 [ 0, %7 ], [ %10, %65 ]
br label %69
69: ; preds = %67, %69
%70 = phi i64 [ %75, %69 ], [ %68, %67 ]
%71 = getelementptr inbounds double, double* %2, i64 %70
%72 = getelementptr inbounds double, double* %3, i64 %70
%73 = load double, double* %72
%74 = fneg double %73
store double %74, double* %71
%75 = add nuw i64 %70, 1
%76 = icmp eq i64 %75, %4
br i1 %76, label %77, label %69
77: ; preds = %69, %65, %5
ret void
}