#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_frequency_vect(struct orbita_potential *psi,
                                             int N_pts, double *Rg,
                                             double *Omega) {
  int I_pt;
  for (I_pt = 0; I_pt < N_pts; ++I_pt)
    Omega[I_pt] =
        orbita_potential_circular_velocity(psi, Rg[I_pt], 0.) / Rg[I_pt];
  return 0;
}


x86 assembly (clang, -O0):
<orbita_potential_circular_frequency_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    117a <orbita_potential_circular_frequency_vect+0x6a>
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    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
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_frequency_vect+0x1e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orbita_potential_circular_frequency_vect>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    1157 <orbita_potential_circular_frequency_vect+0x47>
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbx,8),%xmm0
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <orbita_potential_circular_velocity@plt>
divsd  0x0(%r13,%rbx,8),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <orbita_potential_circular_frequency_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_frequency_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 = %32, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %35
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** %7
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
%27 = fdiv double %21, %26
%28 = load double*, double** %8
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
store double %27, double* %31
br label %32
32: ; preds = %14
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %10
35: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
%struct.orbita_potential = type { i32 }
define i32 @orbita_potential_circular_frequency_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 %18
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %16, %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 = load double, double* %10
%14 = fdiv double %12, %13
%15 = getelementptr inbounds double, double* %3, i64 %9
store double %14, double* %15
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %18, label %8
18: ; preds = %8, %4
ret i32 0
}