#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 */
struct orbita_potential {
  int dummy;
};

/* Variables and functions */
double orbita_potential_circular_velocity(struct orbita_potential *, double,
                                          int);
int orbita_potential_circular_velocity_vect(struct orbita_potential *psi,
                                            int N_pts, double *R, double *V) {
  int I_pt;
  for (I_pt = 0; I_pt < N_pts; ++I_pt)
    V[I_pt] = orbita_potential_circular_velocity(psi, R[I_pt], 0.);
  return 0;
}


x86 assembly (clang, -O0):
<orbita_potential_circular_velocity_vect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116d <orbita_potential_circular_velocity_vect+0x5d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xor    %esi,%esi
call   1030 <orbita_potential_circular_velocity@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <orbita_potential_circular_velocity_vect+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orbita_potential_circular_velocity_vect>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    114f <orbita_potential_circular_velocity_vect+0x3f>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%r12
mov    %esi,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r12,%rdi
xor    %esi,%esi
call   1030 <orbita_potential_circular_velocity@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <orbita_potential_circular_velocity_vect+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.orbita_potential = type { i32 }
define i32 @orbita_potential_circular_velocity_vect(%struct.orbita_potential* %0, i32 %1, double* %2, double* %3) {
%5 = alloca %struct.orbita_potential*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store %struct.orbita_potential* %0, %struct.orbita_potential** %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
store i32 0, i32* %9
br label %10
10: ; preds = %26, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %29
14: ; preds = %10
%15 = load %struct.orbita_potential*, %struct.orbita_potential** %5
%16 = load double*, double** %7
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = call double @orbita_potential_circular_velocity(%struct.orbita_potential* %15, double %20, i32 0)
%22 = load double*, double** %8
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double %21, double* %25
br label %26
26: ; preds = %14
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %10
29: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
%struct.orbita_potential = type { i32 }
define i32 @orbita_potential_circular_velocity_vect(%struct.orbita_potential* %0, i32 %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds double, double* %2, i64 %9
%11 = load double, double* %10
%12 = tail call double @orbita_potential_circular_velocity(%struct.orbita_potential* %0, double %11, i32 0)
%13 = getelementptr inbounds double, double* %3, i64 %9
store double %12, double* %13
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %4
ret i32 0
}