#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 */
int /*<<< orphan*/ atan2(int /*<<< orphan*/, int /*<<< orphan*/);
void vectorFPAtan2(double *a, double *b, double *c, int nsize) {
  int j;
  for (j = nsize; j > 0; j--)
    *(c++) = atan2(*(a++), *(b++));
}


x86 assembly (clang, -O0):
<vectorFPAtan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    1187 <vectorFPAtan2+0x77>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cvttsd2si (%rax),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cvttsd2si (%rax),%esi
call   1030 <atan2@plt>
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <vectorFPAtan2+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorFPAtan2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
jle    115a <vectorFPAtan2+0x4a>
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
add    $0x1,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
cvttsd2si (%r12,%rbx,1),%edi
cvttsd2si (%r15,%rbx,1),%esi
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,1)
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x1,%ebp
ja     1130 <vectorFPAtan2+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vectorFPAtan2(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
store i32 %10, i32* %9
br label %11
11: ; preds = %27, %4
%12 = load i32, i32* %9
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i32 1
store double* %16, double** %5
%17 = load double, double* %15
%18 = fptosi double %17 to i32
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i32 1
store double* %20, double** %6
%21 = load double, double* %19
%22 = fptosi double %21 to i32
%23 = call i32 @atan2(i32 %18, i32 %22)
%24 = sitofp i32 %23 to double
%25 = load double*, double** %7
%26 = getelementptr inbounds double, double* %25, i32 1
store double* %26, double** %7
store double %24, double* %25
br label %27
27: ; preds = %14
%28 = load i32, i32* %9
%29 = add nsw i32 %28, -1
store i32 %29, i32* %9
br label %11
30: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @vectorFPAtan2(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %22
6: ; preds = %4, %6
%7 = phi i32 [ %20, %6 ], [ %3, %4 ]
%8 = phi double* [ %11, %6 ], [ %0, %4 ]
%9 = phi double* [ %19, %6 ], [ %2, %4 ]
%10 = phi double* [ %14, %6 ], [ %1, %4 ]
%11 = getelementptr inbounds double, double* %8, i64 1
%12 = load double, double* %8
%13 = fptosi double %12 to i32
%14 = getelementptr inbounds double, double* %10, i64 1
%15 = load double, double* %10
%16 = fptosi double %15 to i32
%17 = tail call i32 @atan2(i32 %13, i32 %16)
%18 = sitofp i32 %17 to double
%19 = getelementptr inbounds double, double* %9, i64 1
store double %18, double* %9
%20 = add nsw i32 %7, -1
%21 = icmp ugt i32 %7, 1
br i1 %21, label %6, label %22
22: ; preds = %6, %4
ret void
}