#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 */
scalar_t__ pow(double const, double);
void vector_div_normsq_operation_inner(double *restrict sum,
                                       const double *restrict numer,
                                       const double *restrict denom,
                                       size_t num_elems) {
  size_t i;
  for (i = 0; i < num_elems; ++i) {
    *sum += pow(numer[i] / denom[i], 2.0);
  }
}


x86 assembly (clang, -O0):
<vector_div_normsq_operation_inner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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    1187 <vector_div_normsq_operation_inner+0x77>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  0xea0(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1130 <vector_div_normsq_operation_inner+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_div_normsq_operation_inner>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rcx,%rcx
je     11e8 <vector_div_normsq_operation_inner+0xd8>
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
cmp    $0x1,%rcx
jne    113a <vector_div_normsq_operation_inner+0x2a>
xor    %ebx,%ebx
jmp    11b5 <vector_div_normsq_operation_inner+0xa5>
mov    %r12,%rbp
and    $0xfffffffffffffffe,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r15,%rbx,8),%xmm0
divsd  (%r14,%rbx,8),%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x0(%r13),%xmm0
movsd  %xmm0,0x0(%r13)
movsd  0x8(%r15,%rbx,8),%xmm0
divsd  0x8(%r14,%rbx,8),%xmm0
movsd  0xe6d(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x0(%r13),%xmm0
movsd  %xmm0,0x0(%r13)
add    $0x2,%rbx
cmp    %rbx,%rbp
jne    1150 <vector_div_normsq_operation_inner+0x40>
test   $0x1,%r12b
je     11e8 <vector_div_normsq_operation_inner+0xd8>
movsd  (%r15,%rbx,8),%xmm0
divsd  (%r14,%rbx,8),%xmm0
movsd  0xe31(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x0(%r13),%xmm0
movsd  %xmm0,0x0(%r13)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @vector_div_normsq_operation_inner(double* noalias nocapture %0, double* noalias nocapture %1, double* noalias nocapture %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %49, label %6
6: ; preds = %4
%7 = and i64 %3, 1
%8 = icmp eq i64 %3, 1
br i1 %8, label %36, label %9
9: ; preds = %6
%10 = and i64 %3, -2
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %33, %11 ]
%13 = phi i64 [ 0, %9 ], [ %34, %11 ]
%14 = getelementptr inbounds double, double* %1, i64 %12
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %2, i64 %12
%17 = load double, double* %16
%18 = fdiv double %15, %17
%19 = tail call i64 @pow(double %18, double 2.000000e+00)
%20 = sitofp i64 %19 to double
%21 = load double, double* %0
%22 = fadd double %21, %20
store double %22, double* %0
%23 = or i64 %12, 1
%24 = getelementptr inbounds double, double* %1, i64 %23
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %2, i64 %23
%27 = load double, double* %26
%28 = fdiv double %25, %27
%29 = tail call i64 @pow(double %28, double 2.000000e+00)
%30 = sitofp i64 %29 to double
%31 = load double, double* %0
%32 = fadd double %31, %30
store double %32, double* %0
%33 = add nuw i64 %12, 2
%34 = add i64 %13, 2
%35 = icmp eq i64 %34, %10
br i1 %35, label %36, label %11
36: ; preds = %11, %6
%37 = phi i64 [ 0, %6 ], [ %33, %11 ]
%38 = icmp eq i64 %7, 0
br i1 %38, label %49, label %39
39: ; preds = %36
%40 = getelementptr inbounds double, double* %1, i64 %37
%41 = load double, double* %40
%42 = getelementptr inbounds double, double* %2, i64 %37
%43 = load double, double* %42
%44 = fdiv double %41, %43
%45 = tail call i64 @pow(double %44, double 2.000000e+00)
%46 = sitofp i64 %45 to double
%47 = load double, double* %0
%48 = fadd double %47, %46
store double %48, double* %0
br label %49
49: ; preds = %39, %36, %4
ret void
}