#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_assign_operation_inner(const void *restrict ctx,
                                          const size_t _offset,
                                          double *const restrict _v0,
                                          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;
    (void)index;
    {
      { *z *= -1.0; }
    }
  }
}


x86 assembly (clang, -O0):
<sg_vector_neg_assign_operation_inner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116e <sg_vector_neg_assign_operation_inner+0x6e>
mov    -0x10(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsd  0xeab(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111c <sg_vector_neg_assign_operation_inner+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sg_vector_neg_assign_operation_inner(i8* noalias %0, i64 %1, double* noalias %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca double*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca double*
store i8* %0, i8** %5
store i64 %1, i64* %6
store double* %2, double** %7
store i64 %3, i64* %8
%12 = load i8*, i8** %5
store i64 0, i64* %9
br label %13
13: ; preds = %28, %4
%14 = load i64, i64* %9
%15 = load i64, i64* %8
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i64, i64* %6
%19 = load i64, i64* %9
%20 = add i64 %18, %19
store i64 %20, i64* %10
%21 = load double*, double** %7
%22 = load i64, i64* %9
%23 = getelementptr inbounds double, double* %21, i64 %22
store double* %23, double** %11
%24 = load i64, i64* %10
%25 = load double*, double** %11
%26 = load double, double* %25
%27 = fmul double %26, -1.000000e+00
store double %27, double* %25
br label %28
28: ; preds = %17
%29 = load i64, i64* %9
%30 = add i64 %29, 1
store i64 %30, i64* %9
br label %13
31: ; preds = %13
ret void
}

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