require '_h2ph_pre.ph';

unless(defined(&__GMP_H__)) {
    unless(defined(&__GNU_MP__)) {
	eval 'sub __GNU_MP__ () {2;}' unless defined(&__GNU_MP__);
	eval 'sub __need_size_t () {1;}' unless defined(&__need_size_t);
	require 'stddef.ph';
	undef(&__need_size_t) if defined(&__need_size_t);
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	    eval 'sub __gmp_const () { &const;}' unless defined(&__gmp_const);
	} else {
	    eval 'sub __gmp_const () {1;}' unless defined(&__gmp_const);
	}
	if(defined ( &__GNUC__)) {
	    eval 'sub __gmp_inline () { &__inline__;}' unless defined(&__gmp_inline);
	} else {
	    eval 'sub __gmp_inline () {1;}' unless defined(&__gmp_inline);
	}
	unless(defined(&_EXTERN_INLINE)) {
	    if(defined(&__GNUC__)) {
		eval 'sub _EXTERN_INLINE () { &extern  &__inline__;}' unless defined(&_EXTERN_INLINE);
	    } else {
		eval 'sub _EXTERN_INLINE () { &static;}' unless defined(&_EXTERN_INLINE);
	    }
	}
	if(defined(&_SHORT_LIMB)) {
	} else {
	    if(defined(&_LONG_LONG_LIMB)) {
	    } else {
	    }
	}
	unless(defined(&__MP_SMALL__)) {
	} else {
	}
    }
    if(0) {
    }
    unless(defined(&_PROTO)) {
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	    eval 'sub _PROTO {
	        local($x) = @_;
    		eval q($x);
	    }' unless defined(&_PROTO);
	} else {
	    eval 'sub _PROTO {
	        local($x) = @_;
    		eval q(());
	    }' unless defined(&_PROTO);
	}
    }
    unless(defined(&__MPN)) {
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	    eval 'sub __MPN {
	        local($x) = @_;
    		eval q( &__mpn_$x);
	    }' unless defined(&__MPN);
	} else {
	    eval 'sub __MPN {
	        local($x) = @_;
    		eval q( &__mpn_x);
	    }' unless defined(&__MPN);
	}
    }
    if(defined  || defined ( &H_STDIO) || defined ( &_H_STDIO) || defined ( &_STDIO_H) || defined ( &_STDIO_H_) || defined ( &__STDIO_H__) || defined ( &_STDIO_INCLUDED)) {
	eval 'sub _GMP_H_HAVE_FILE () {1;}' unless defined(&_GMP_H_HAVE_FILE);
    }
    if(defined ( &__cplusplus)) {
    }
    if(defined(&_GMP_H_HAVE_FILE)) {
    }
    if(defined(&_GMP_H_HAVE_FILE)) {
    }
    if(defined(&_GMP_H_HAVE_FILE)) {
    }
    if(defined(&_GMP_H_HAVE_FILE)) {
    }
    if(defined ( &__cplusplus)) {
    }
    eval 'sub mpn_add () { &__MPN( &add);}' unless defined(&mpn_add);
    eval 'sub mpn_add_1 () { &__MPN( &add_1);}' unless defined(&mpn_add_1);
    eval 'sub mpn_add_n () { &__MPN( &add_n);}' unless defined(&mpn_add_n);
    eval 'sub mpn_addmul_1 () { &__MPN( &addmul_1);}' unless defined(&mpn_addmul_1);
    eval 'sub mpn_bdivmod () { &__MPN( &bdivmod);}' unless defined(&mpn_bdivmod);
    eval 'sub mpn_cmp () { &__MPN( &cmp);}' unless defined(&mpn_cmp);
    eval 'sub mpn_divmod_1 () { &__MPN( &divmod_1);}' unless defined(&mpn_divmod_1);
    eval 'sub mpn_divrem () { &__MPN( &divrem);}' unless defined(&mpn_divrem);
    eval 'sub mpn_divrem_1 () { &__MPN( &divrem_1);}' unless defined(&mpn_divrem_1);
    eval 'sub mpn_dump () { &__MPN( &dump);}' unless defined(&mpn_dump);
    eval 'sub mpn_gcd () { &__MPN( &gcd);}' unless defined(&mpn_gcd);
    eval 'sub mpn_gcd_1 () { &__MPN( &gcd_1);}' unless defined(&mpn_gcd_1);
    eval 'sub mpn_gcdext () { &__MPN( &gcdext);}' unless defined(&mpn_gcdext);
    eval 'sub mpn_get_str () { &__MPN( &get_str);}' unless defined(&mpn_get_str);
    eval 'sub mpn_hamdist () { &__MPN( &hamdist);}' unless defined(&mpn_hamdist);
    eval 'sub mpn_lshift () { &__MPN( &lshift);}' unless defined(&mpn_lshift);
    eval 'sub mpn_mod_1 () { &__MPN( &mod_1);}' unless defined(&mpn_mod_1);
    eval 'sub mpn_mul () { &__MPN( &mul);}' unless defined(&mpn_mul);
    eval 'sub mpn_mul_1 () { &__MPN( &mul_1);}' unless defined(&mpn_mul_1);
    eval 'sub mpn_mul_n () { &__MPN( &mul_n);}' unless defined(&mpn_mul_n);
    eval 'sub mpn_perfect_square_p () { &__MPN( &perfect_square_p);}' unless defined(&mpn_perfect_square_p);
    eval 'sub mpn_popcount () { &__MPN( &popcount);}' unless defined(&mpn_popcount);
    eval 'sub mpn_preinv_mod_1 () { &__MPN( &preinv_mod_1);}' unless defined(&mpn_preinv_mod_1);
    eval 'sub mpn_random2 () { &__MPN( &random2);}' unless defined(&mpn_random2);
    eval 'sub mpn_rshift () { &__MPN( &rshift);}' unless defined(&mpn_rshift);
    eval 'sub mpn_scan0 () { &__MPN( &scan0);}' unless defined(&mpn_scan0);
    eval 'sub mpn_scan1 () { &__MPN( &scan1);}' unless defined(&mpn_scan1);
    eval 'sub mpn_set_str () { &__MPN( &set_str);}' unless defined(&mpn_set_str);
    eval 'sub mpn_sqrtrem () { &__MPN( &sqrtrem);}' unless defined(&mpn_sqrtrem);
    eval 'sub mpn_sub () { &__MPN( &sub);}' unless defined(&mpn_sub);
    eval 'sub mpn_sub_1 () { &__MPN( &sub_1);}' unless defined(&mpn_sub_1);
    eval 'sub mpn_sub_n () { &__MPN( &sub_n);}' unless defined(&mpn_sub_n);
    eval 'sub mpn_submul_1 () { &__MPN( &submul_1);}' unless defined(&mpn_submul_1);
    eval 'sub mpn_udiv_w_sdiv () { &__MPN( &udiv_w_sdiv);}' unless defined(&mpn_udiv_w_sdiv);
    if(defined ( &__cplusplus)) {
    }
    if(defined ( &__cplusplus)) {
    }
    if(defined ( &__GNUC__) || defined ( &_FORCE_INLINES)) {
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	} else {
	}
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	} else {
	}
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	} else {
	}
	if(defined ( &__STDC__) || defined ( &__cplusplus)) {
	} else {
	}
    }
    eval 'sub mpz_sgn {
        local($Z) = @_;
	    eval q((($Z)-> &_mp_size < 0? -1: ($Z)-> &_mp_size > 0));
    }' unless defined(&mpz_sgn);
    eval 'sub mpf_sgn {
        local($F) = @_;
	    eval q((($F)-> &_mp_size < 0? -1: ($F)-> &_mp_size > 0));
    }' unless defined(&mpf_sgn);
    eval 'sub mpq_sgn {
        local($Q) = @_;
	    eval q((($Q)-> ($_mp_num->{_mp_size}) < 0? -1: ($Q)-> ($_mp_num->{_mp_size}) > 0));
    }' unless defined(&mpq_sgn);
    eval 'sub mpq_numref {
        local($Q) = @_;
	    eval q(((($Q)-> &_mp_num)));
    }' unless defined(&mpq_numref);
    eval 'sub mpq_denref {
        local($Q) = @_;
	    eval q(((($Q)-> &_mp_den)));
    }' unless defined(&mpq_denref);
    if(defined ( &__GNUC__)) {
	eval 'sub mpz_cmp_ui {
	    local($Z,$UI) = @_;
    	    eval q(( &__builtin_constant_p ($UI)  && ($UI) == 0?  &mpz_sgn ($Z) :  &mpz_cmp_ui ($Z,$UI)));
	}' unless defined(&mpz_cmp_ui);
	eval 'sub mpz_cmp_si {
	    local($Z,$UI) = @_;
    	    eval q(( &__builtin_constant_p ($UI)  && ($UI) == 0?  &mpz_sgn ($Z) :  &__builtin_constant_p ($UI)  && ($UI) > 0?  &mpz_cmp_ui ($Z,$UI) :  &mpz_cmp_si ($Z,$UI)));
	}' unless defined(&mpz_cmp_si);
	eval 'sub mpq_cmp_ui {
	    local($Q,$NUI,$DUI) = @_;
    	    eval q(( &__builtin_constant_p ($NUI)  && ($NUI) == 0?  &mpq_sgn ($Q) :  &mpq_cmp_ui ($Q,$NUI,$DUI)));
	}' unless defined(&mpq_cmp_ui);
    }
    eval 'sub mpn_divmod {
        local($qp,$np,$nsize,$dp,$dsize) = @_;
	    eval q( &mpn_divrem ($qp,0,$np,$nsize,$dp,$dsize));
    }' unless defined(&mpn_divmod);
    if(0) {
	eval 'sub mpn_divmod_1 {
	    local($qp,$np,$nsize,$dlimb) = @_;
    	    eval q( &mpn_divrem_1 ($qp,0,$np,$nsize,$dlimb));
	}' unless defined(&mpn_divmod_1);
    }
    eval 'sub mpz_mdiv () { &mpz_fdiv_q;}' unless defined(&mpz_mdiv);
    eval 'sub mpz_mdivmod () { &mpz_fdiv_qr;}' unless defined(&mpz_mdivmod);
    eval 'sub mpz_mmod () { &mpz_fdiv_r;}' unless defined(&mpz_mmod);
    eval 'sub mpz_mdiv_ui () { &mpz_fdiv_q_ui;}' unless defined(&mpz_mdiv_ui);
    eval 'sub mpz_mdivmod_ui {
        local($q,$r,$n,$d) = @_;
	    eval q((($r == 0) ?  &mpz_fdiv_q_ui ($q,$n,$d) :  &mpz_fdiv_qr_ui ($q,$r,$n,$d)));
    }' unless defined(&mpz_mdivmod_ui);
    eval 'sub mpz_mmod_ui {
        local($r,$n,$d) = @_;
	    eval q((($r == 0) ?  &mpz_fdiv_ui ($n,$d) :  &mpz_fdiv_r_ui ($r,$n,$d)));
    }' unless defined(&mpz_mmod_ui);
    eval 'sub mpz_div () { &mpz_fdiv_q;}' unless defined(&mpz_div);
    eval 'sub mpz_divmod () { &mpz_fdiv_qr;}' unless defined(&mpz_divmod);
    eval 'sub mpz_div_ui () { &mpz_fdiv_q_ui;}' unless defined(&mpz_div_ui);
    eval 'sub mpz_divmod_ui () { &mpz_fdiv_qr_ui;}' unless defined(&mpz_divmod_ui);
    eval 'sub mpz_mod_ui () { &mpz_fdiv_r_ui;}' unless defined(&mpz_mod_ui);
    eval 'sub mpz_div_2exp () { &mpz_fdiv_q_2exp;}' unless defined(&mpz_div_2exp);
    eval 'sub mpz_mod_2exp () { &mpz_fdiv_r_2exp;}' unless defined(&mpz_mod_2exp);
    eval 'sub __GNU_MP_VERSION () {2;}' unless defined(&__GNU_MP_VERSION);
    eval 'sub __GNU_MP_VERSION_MINOR () {0;}' unless defined(&__GNU_MP_VERSION_MINOR);
    eval 'sub __GMP_H__ () {1;}' unless defined(&__GMP_H__);
}
1;
