/*
 * Copyright (c) 1997-1999 Massachusetts Institute of Technology
 * Copyright (c) 2000-2002 Stefan Kral
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Tue Feb 19 15:24:17 CET 2002 */

#include <fftw-int.h>
#include <fftw.h>



/* Generated by: ./genfft_orig -magic-twiddle-load-all -magic-variables 4 -magic-loopi -hc2hc-forward 2 */

/*
 * This function contains 8 FP additions, 4 FP multiplications,
 * (or, 6 additions, 2 multiplications, 2 fused multiply/add),
 * 11 stack variables, and 16 memory accesses
 */


/*
 * Generator Id's : 
 * $Id: exprdag.ml,v 1.41 1999/05/26 15:44:14 fftw Exp $
 * $Id: fft.ml,v 1.43 1999/05/17 19:44:18 fftw Exp $
 * $Id: to_c.ml,v 1.25 1999/10/26 21:41:32 stevenj Exp $
 */

void
fftw_hc2hc_forward_2 (fftw_real * A, const fftw_complex * W, int iostride,
		      int m, int dist)
{
     int i;
     fftw_real *X;
     fftw_real *Y;
     X = A;
     Y = A + (2 * iostride);
     {
	  fftw_real tmp11;
	  fftw_real tmp12;
	  tmp11 = X[0];
	  tmp12 = X[iostride];
	  X[iostride] = tmp11 - tmp12;
	  X[0] = tmp11 + tmp12;
     }
     X = X + dist;
     Y = Y - dist;
     for (i = 2; i < m; i = i + 2, X = X + dist, Y = Y - dist, W = W + 1)
       {
	    fftw_real tmp3;
	    fftw_real tmp9;
	    fftw_real tmp8;
	    fftw_real tmp10;
	    tmp3 = X[0];
	    tmp9 = Y[-iostride];
	    {
		 fftw_real tmp5;
		 fftw_real tmp7;
		 fftw_real tmp4;
		 fftw_real tmp6;
		 tmp5 = X[iostride];
		 tmp7 = Y[0];
		 tmp4 = c_re (W[0]);
		 tmp6 = c_im (W[0]);
		 tmp8 = (tmp4 * tmp5) - (tmp6 * tmp7);
		 tmp10 = (tmp6 * tmp5) + (tmp4 * tmp7);
	    }
	    Y[-iostride] = tmp3 - tmp8;
	    X[0] = tmp3 + tmp8;
	    X[iostride] = -(tmp9 - tmp10);
	    Y[0] = tmp10 + tmp9;
       }
     if (i == m)
       {
	    fftw_real tmp1;
	    fftw_real tmp2;
	    tmp1 = X[0];
	    X[0] = tmp1;
	    tmp2 = X[iostride];
	    Y[0] = -tmp2;
       }
}


static const int twiddle_order[] = { 1 };
fftw_codelet_desc fftw_hc2hc_forward_2_desc = {
     "fftw_hc2hc_forward_2",
     (void (*)()) fftw_hc2hc_forward_2,
     2,
     FFTW_FORWARD,
     FFTW_HC2HC,
     47,
     1,
     twiddle_order,
};
