#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 */
double fabs(double const);
void d_abs(const double x[128], double y[128]) {
  int k;
  for (k = 0; k < 128; k++) {
    y[k] = fabs(x[k]);
  }
}


x86 assembly (clang, -O0):
<d_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    1153 <d_abs+0x53>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xecc(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <d_abs+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_abs>:
lea    0x400(%rdi),%rax
cmp    %rsi,%rax
jbe    1174 <d_abs+0x74>
lea    0x400(%rsi),%rax
cmp    %rdi,%rax
jbe    1174 <d_abs+0x74>
xor    %eax,%eax
movaps 0xedf(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rdi,%rax,8),%xmm1
andps  %xmm0,%xmm1
movlps %xmm1,(%rsi,%rax,8)
movsd  0x8(%rdi,%rax,8),%xmm1
andps  %xmm0,%xmm1
movlps %xmm1,0x8(%rsi,%rax,8)
movsd  0x10(%rdi,%rax,8),%xmm1
andps  %xmm0,%xmm1
movlps %xmm1,0x10(%rsi,%rax,8)
movsd  0x18(%rdi,%rax,8),%xmm1
andps  %xmm0,%xmm1
movlps %xmm1,0x18(%rsi,%rax,8)
add    $0x4,%rax
cmp    $0x80,%rax
jne    1130 <d_abs+0x30>
jmp    11be <d_abs+0xbe>
xor    %eax,%eax
movaps 0xe83(%rip),%xmm0
nopl   (%rax)
movups (%rdi,%rax,8),%xmm1
movups 0x10(%rdi,%rax,8),%xmm2
andps  %xmm0,%xmm1
andps  %xmm0,%xmm2
movups %xmm1,(%rsi,%rax,8)
movups %xmm2,0x10(%rsi,%rax,8)
movups 0x20(%rdi,%rax,8),%xmm1
movups 0x30(%rdi,%rax,8),%xmm2
andps  %xmm0,%xmm1
andps  %xmm0,%xmm2
movups %xmm1,0x20(%rsi,%rax,8)
movups %xmm2,0x30(%rsi,%rax,8)
add    $0x8,%rax
cmp    $0x80,%rax
jne    1180 <d_abs+0x80>
ret

LLVM IR (-O0):
define void @d_abs(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 128
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load double*, double** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = call double @llvm.fabs.f64(double %14)
%16 = load double*, double** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double %15, double* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

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