#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 M_PI;
int /*<<< orphan*/ rotate(double, double, double, double *, double *);
void pixel2hpl(double x, double y, double crota2, double crpix1, double crpix2,
               double cdelt1, double cdelt2, double *tx, double *ty) {
  double x0, y0;
  double trad;
  double nx, ny;
  x0 = crpix1 - 1;
  y0 = crpix2 - 1;
  trad = M_PI / 180.0 * crota2;
  rotate(x - x0, y - y0, trad, &nx, &ny);
  *tx = cdelt1 * nx;
  *ty = cdelt2 * ny;
  return;
}


x86 assembly (clang, -O0):
<pixel2hpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %rsi,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x2e72(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
lea    -0x68(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <rotate@plt>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel2hpl>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm6,0x10(%rsp)
movsd  %xmm5,0x8(%rsp)
movsd  0xecf(%rip),%xmm5
addsd  %xmm5,%xmm3
mov    0x2eac(%rip),%rax
movsd  (%rax),%xmm6
divsd  0xec0(%rip),%xmm6
addsd  %xmm5,%xmm4
mulsd  %xmm6,%xmm2
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <rotate@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @pixel2hpl(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double* %7, double** %17
store double* %8, double** %18
%24 = load double, double* %13
%25 = fsub double %24, 1.000000e+00
store double %25, double* %19
%26 = load double, double* %14
%27 = fsub double %26, 1.000000e+00
store double %27, double* %20
%28 = load double, double* @M_PI
%29 = fdiv double %28, 1.800000e+02
%30 = load double, double* %12
%31 = fmul double %29, %30
store double %31, double* %21
%32 = load double, double* %10
%33 = load double, double* %19
%34 = fsub double %32, %33
%35 = load double, double* %11
%36 = load double, double* %20
%37 = fsub double %35, %36
%38 = load double, double* %21
%39 = call i32 @rotate(double %34, double %37, double %38, double* %22, double* %23)
%40 = load double, double* %15
%41 = load double, double* %22
%42 = fmul double %40, %41
%43 = load double*, double** %17
store double %42, double* %43
%44 = load double, double* %16
%45 = load double, double* %23
%46 = fmul double %44, %45
%47 = load double*, double** %18
store double %46, double* %47
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @pixel2hpl(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = alloca double
%11 = alloca double
%12 = bitcast double* %10 to i8*
%13 = bitcast double* %11 to i8*
%14 = fadd double %3, -1.000000e+00
%15 = fadd double %4, -1.000000e+00
%16 = load double, double* @M_PI
%17 = fdiv double %16, 1.800000e+02
%18 = fmul double %17, %2
%19 = fsub double %0, %14
%20 = fsub double %1, %15
%21 = call i32 @rotate(double %19, double %20, double %18, double* %10, double* %11)
%22 = load double, double* %10
%23 = fmul double %22, %5
store double %23, double* %7
%24 = load double, double* %11
%25 = fmul double %24, %6
store double %25, double* %8
ret void
}