#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 cos(double);
int /*<<< orphan*/ dtop2(double, double, double *, double *);
double sin(double);
int drot2(double xo, double yo, double t, double *x, double *y) {
  double r, thet, to;
  static double dtor = 1.7453292519943296e-2;
  dtop2(xo, yo, &r, &thet);
  to = (t + thet) * dtor;
  *x = r * cos(to);
  *y = r * sin(to);
  return 0;
}


x86 assembly (clang, -O0):
<drot2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <dtop2@plt>
movsd  -0x18(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
mulsd  0x2ec0(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drot2>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm2,0x10(%rsp)
lea    0x18(%rsp),%rdi
lea    0x20(%rsp),%rsi
call   1040 <dtop2@plt>
movsd  0x10(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
mulsd  0xe9a(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1050 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@drot2.dtor = internal global double 0x3F91DF46A2529D39
define i32 @drot2(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%14 = load double, double* %6
%15 = load double, double* %7
%16 = call i32 @dtop2(double %14, double %15, double* %11, double* %12)
%17 = load double, double* %8
%18 = load double, double* %12
%19 = fadd double %17, %18
%20 = load double, double* @drot2.dtor
%21 = fmul double %19, %20
store double %21, double* %13
%22 = load double, double* %11
%23 = load double, double* %13
%24 = call double @cos(double %23)
%25 = fmul double %22, %24
%26 = load double*, double** %9
store double %25, double* %26
%27 = load double, double* %11
%28 = load double, double* %13
%29 = call double @sin(double %28)
%30 = fmul double %27, %29
%31 = load double*, double** %10
store double %30, double* %31
ret i32 0
}

LLVM IR (-O2):
define i32 @drot2(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %6 to i8*
%9 = bitcast double* %7 to i8*
%10 = call i32 @dtop2(double %0, double %1, double* %6, double* %7)
%11 = load double, double* %7
%12 = fadd double %11, %2
%13 = fmul double %12, 0x3F91DF46A2529D39
%14 = load double, double* %6
%15 = call double @cos(double %13)
%16 = fmul double %14, %15
store double %16, double* %3
%17 = load double, double* %6
%18 = call double @sin(double %13)
%19 = fmul double %17, %18
store double %19, double* %4
ret i32 0
}