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


x86 assembly (clang, -O0):
<vectorFPSincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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    1196 <vectorFPSincos+0x76>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cvttsd2si (%rax),%edi
call   1040 <cos@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    113d <vectorFPSincos+0x1d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorFPSincos>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
jle    1193 <vectorFPSincos+0x73>
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rdi,%r12
test   $0x1,%r15b
jne    1146 <vectorFPSincos+0x26>
mov    %r15d,%ebp
cmp    $0x1,%r15d
je     1193 <vectorFPSincos+0x73>
jmp    119c <vectorFPSincos+0x7c>
movsd  (%r12),%xmm0
ucomisd 0xeac(%rip),%xmm0
jae    1246 <vectorFPSincos+0x126>
movsd  0xea6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1246 <vectorFPSincos+0x126>
add    $0x8,%r12
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%r14
lea    -0x1(%r15),%ebp
cmp    $0x1,%r15d
jne    119c <vectorFPSincos+0x7c>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x2,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,1),%xmm0
ucomisd 0xe42(%rip),%xmm0
jae    122b <vectorFPSincos+0x10b>
movsd  0xe40(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    122b <vectorFPSincos+0x10b>
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,1)
movsd  0x8(%r12,%rbx,1),%xmm0
ucomisd 0xe0d(%rip),%xmm0
jae    1238 <vectorFPSincos+0x118>
movsd  0xe0b(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1238 <vectorFPSincos+0x118>
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%r14,%rbx,1)
add    $0x10,%rbx
add    $0xfffffffe,%ebp
cmp    $0x2,%ebp
jg     11b0 <vectorFPSincos+0x90>
jmp    1193 <vectorFPSincos+0x73>
call   1030 <sin@plt>
movsd  (%r12,%rbx,1),%xmm0
jmp    11ce <vectorFPSincos+0xae>
call   1030 <sin@plt>
movsd  0x8(%r12,%rbx,1),%xmm0
jmp    1203 <vectorFPSincos+0xe3>
call   1030 <sin@plt>
movsd  (%r12),%xmm0
jmp    116c <vectorFPSincos+0x4c>

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

LLVM IR (-O2):
define void @vectorFPSincos(double* nocapture %0, double* nocapture readnone %1, double* nocapture writeonly %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %64
6: ; preds = %4
%7 = and i32 %3, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = load double, double* %0
%11 = fcmp oeq double %10, 0xFFF0000000000000
%12 = fcmp oeq double %10, 0x7FF0000000000000
%13 = or i1 %12, %11
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = tail call double @sin(double %10)
%16 = load double, double* %0
br label %17
17: ; preds = %14, %9
%18 = phi double [ %10, %9 ], [ %16, %14 ]
%19 = getelementptr inbounds double, double* %0, i64 1
%20 = fptosi double %18 to i32
%21 = tail call i32 @cos(i32 %20)
%22 = sitofp i32 %21 to double
%23 = getelementptr inbounds double, double* %2, i64 1
store double %22, double* %2
%24 = add nsw i32 %3, -1
br label %25
25: ; preds = %17, %6
%26 = phi double* [ %0, %6 ], [ %19, %17 ]
%27 = phi i32 [ %3, %6 ], [ %24, %17 ]
%28 = phi double* [ %2, %6 ], [ %23, %17 ]
%29 = icmp eq i32 %3, 1
br i1 %29, label %64, label %30
30: ; preds = %25, %55
%31 = phi double* [ %57, %55 ], [ %26, %25 ]
%32 = phi i32 [ %62, %55 ], [ %27, %25 ]
%33 = phi double* [ %61, %55 ], [ %28, %25 ]
%34 = load double, double* %31
%35 = fcmp oeq double %34, 0xFFF0000000000000
%36 = fcmp oeq double %34, 0x7FF0000000000000
%37 = or i1 %36, %35
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = tail call double @sin(double %34)
%40 = load double, double* %31
br label %41
41: ; preds = %30, %38
%42 = phi double [ %34, %30 ], [ %40, %38 ]
%43 = getelementptr inbounds double, double* %31, i64 1
%44 = fptosi double %42 to i32
%45 = tail call i32 @cos(i32 %44)
%46 = sitofp i32 %45 to double
%47 = getelementptr inbounds double, double* %33, i64 1
store double %46, double* %33
%48 = load double, double* %43
%49 = fcmp oeq double %48, 0xFFF0000000000000
%50 = fcmp oeq double %48, 0x7FF0000000000000
%51 = or i1 %50, %49
br i1 %51, label %52, label %55
52: ; preds = %41
%53 = tail call double @sin(double %48)
%54 = load double, double* %43
br label %55
55: ; preds = %52, %41
%56 = phi double [ %48, %41 ], [ %54, %52 ]
%57 = getelementptr inbounds double, double* %31, i64 2
%58 = fptosi double %56 to i32
%59 = tail call i32 @cos(i32 %58)
%60 = sitofp i32 %59 to double
%61 = getelementptr inbounds double, double* %33, i64 2
store double %60, double* %47
%62 = add nsw i32 %32, -2
%63 = icmp sgt i32 %32, 2
br i1 %63, label %30, label %64
64: ; preds = %25, %55, %4
ret void
}