#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 */
double const cosl(long double);
double const sinl(long double);
void cvector_rotate_z_l(double *vdest, const double *vorg, long double angle) {
  vdest[0] = vorg[0] * cosl(angle) + vorg[1] * sinl(angle);
  vdest[1] = -vorg[0] * sinl(angle) + vorg[1] * cosl(angle);
  vdest[2] = vorg[2];
}


x86 assembly (clang, -O0):
<cvector_rotate_z_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
fstpt  -0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xe5b(%rip),%xmm1
pxor   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvector_rotate_z_l>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x20(%rsp)
fstpt  (%rsp)
call   1040 <cosl@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
call   1040 <cosl@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cvector_rotate_z_l(double* %0, double* %1, x86_fp80 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca x86_fp80
store double* %0, double** %4
store double* %1, double** %5
store x86_fp80 %2, x86_fp80* %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load x86_fp80, x86_fp80* %6
%11 = call double @cosl(x86_fp80 %10)
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load x86_fp80, x86_fp80* %6
%16 = call double @sinl(x86_fp80 %15)
%17 = fmul double %14, %16
%18 = call double @llvm.fmuladd.f64(double %9, double %11, double %17)
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 0
store double %18, double* %20
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fneg double %23
%25 = load x86_fp80, x86_fp80* %6
%26 = call double @sinl(x86_fp80 %25)
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = load x86_fp80, x86_fp80* %6
%31 = call double @cosl(x86_fp80 %30)
%32 = fmul double %29, %31
%33 = call double @llvm.fmuladd.f64(double %24, double %26, double %32)
%34 = load double*, double** %4
%35 = getelementptr inbounds double, double* %34, i64 1
store double %33, double* %35
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 2
%38 = load double, double* %37
%39 = load double*, double** %4
%40 = getelementptr inbounds double, double* %39, i64 2
store double %38, double* %40
ret void
}

LLVM IR (-O2):
define void @cvector_rotate_z_l(double* nocapture writeonly %0, double* nocapture %1, x86_fp80 %2) {
%4 = load double, double* %1
%5 = tail call double @cosl(x86_fp80 %2)
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = tail call double @sinl(x86_fp80 %2)
%9 = fmul double %7, %8
%10 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %9)
store double %10, double* %0
%11 = load double, double* %1
%12 = fneg double %11
%13 = tail call double @sinl(x86_fp80 %2)
%14 = load double, double* %6
%15 = tail call double @cosl(x86_fp80 %2)
%16 = fmul double %14, %15
%17 = tail call double @llvm.fmuladd.f64(double %12, double %13, double %16)
%18 = getelementptr inbounds double, double* %0, i64 1
store double %17, double* %18
%19 = getelementptr inbounds double, double* %1, i64 2
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %0, i64 2
store double %20, double* %21
ret void
}