#line 1 "./cpcre.c"
/*
 * PCRE - Perl Compatible Regular Expressions
 * <http://www.pcre.org/> up to v 8.01
 * Copyright (C) 2003-2010 Sam Steingold
 * GPL2
 */

#include "clisp.h"
#include "config.h"

#if defined(HAVE_PCRE_H)
# include <pcre.h>
#elif defined(HAVE_PCRE_PCRE_H)
# include <pcre/pcre.h>
#else
# error No PCRE headers!
#endif

#ifndef FOREIGN
#error FOREIGN is not defined.
#error PCRE needs a CLISP built with the foreign pointer datatype support.
#error Go into the main CLISP makefile and add a -DFOREIGN=void*
#error to CFLAGS make variable and rebuild CLISP before coming back here.
#endif

#include <string.h>             /* for memcpy(3) */

DEFMODULE(pcre,"PCRE")

#define O(varname) module__pcre__object_tab._##varname
#define F(varname) subr_tab_ptr_as_object(&(module__pcre__subr_tab._##varname))

struct module__pcre__object_tab_t {
  gcv_object_t _object_Kanchored;
  gcv_object_t _object_Kauto_callout;
#if (defined(PCRE_INFO_BACKREFMAX)) || (defined(PCRE_INFO_NAMEENTRYSIZE))
  gcv_object_t _object_Kbackrefmax;
#endif
#if defined(PCRE_ERROR_BADCOUNT)
  gcv_object_t _object_Kbadcount;
#endif
#if defined(PCRE_ERROR_BADMAGIC)
  gcv_object_t _object_Kbadmagic;
#endif
#if defined(PCRE_ERROR_BADNEWLINE)
  gcv_object_t _object_Kbadnewline;
#endif
#if defined(PCRE_ERROR_BADOPTION)
  gcv_object_t _object_Kbadoption;
#endif
#if defined(PCRE_ERROR_BADPARTIAL)
  gcv_object_t _object_Kbadpartial;
#endif
#if defined(PCRE_ERROR_BADUTF8)
  gcv_object_t _object_Kbadutf8;
#endif
#if defined(PCRE_ERROR_BADUTF8_OFFSET)
  gcv_object_t _object_Kbadutf8_offset;
#endif
#if defined(PCRE_INFO_FIRSTBYTE)
  gcv_object_t _object_Kbol;
#endif
  gcv_object_t _object_Kboolean;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_BSR))
  gcv_object_t _object_Kbsr;
#endif
  gcv_object_t _object_Kbsr_anycrlf;
  gcv_object_t _object_Kbsr_unicode;
#if defined(PCRE_ERROR_CALLOUT)
  gcv_object_t _object_Kcallout;
#endif
  gcv_object_t _object_Kcapturecount;
#if defined(PCRE_CASELESS)
  gcv_object_t _object_Kcaseless;
#endif
  gcv_object_t _object_Kdfa;
#if defined(PCRE_ERROR_DFA_RECURSE)
  gcv_object_t _object_Kdfa_recurse;
#endif
  gcv_object_t _object_Kdfa_restart;
  gcv_object_t _object_Kdfa_shortest;
#if defined(PCRE_ERROR_DFA_UCOND)
  gcv_object_t _object_Kdfa_ucond;
#endif
#if defined(PCRE_ERROR_DFA_UITEM)
  gcv_object_t _object_Kdfa_uitem;
#endif
#if defined(PCRE_ERROR_DFA_UMLIMIT)
  gcv_object_t _object_Kdfa_umlimit;
#endif
#if defined(PCRE_ERROR_DFA_WSSIZE)
  gcv_object_t _object_Kdfa_wssize;
#endif
  gcv_object_t _object_Kdollar_endonly;
  gcv_object_t _object_Kdotall;
  gcv_object_t _object_Kdupnames;
  gcv_object_t _object_Kextended;
  gcv_object_t _object_Kextra;
#if defined(PCRE_INFO_FIRSTBYTE)
  gcv_object_t _object_Kfirstbyte;
#endif
  gcv_object_t _object_Kfirstline;
  gcv_object_t _object_Kfirsttable;
#if defined(PCRE_INFO_HASCRORLF)
  gcv_object_t _object_Khascrorlf;
#endif
  gcv_object_t _object_Kignore_case;
#if defined(PCRE_ERROR_INTERNAL)
  gcv_object_t _object_Kinternal;
#endif
  gcv_object_t _object_Kjavascript_compat;
#if defined(PCRE_INFO_JCHANGED)
  gcv_object_t _object_Kjchanged;
#endif
  gcv_object_t _object_Klastliteral;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_LINK_SIZE))
  gcv_object_t _object_Klink_size;
#endif
#if defined(PCRE_ERROR_MATCHLIMIT)
  gcv_object_t _object_Kmatchlimit;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT))
  gcv_object_t _object_Kmatch_limit;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT_RECURSION))
  gcv_object_t _object_Kmatch_limit_recursion;
#endif
#if defined(PCRE_INFO_MINLENGTH)
  gcv_object_t _object_Kminlength;
#endif
  gcv_object_t _object_Kmultiline;
#if defined(PCRE_INFO_NAMECOUNT)
  gcv_object_t _object_Knamecount;
#endif
#if defined(PCRE_INFO_NAMEENTRYSIZE)
  gcv_object_t _object_Knameentrysize;
#endif
#if (defined(PCRE_INFO_NAMETABLE)) || (defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE))
  gcv_object_t _object_Knametable;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_NEWLINE))
  gcv_object_t _object_Knewline;
#endif
  gcv_object_t _object_Knewline_any;
  gcv_object_t _object_Knewline_anycrlf;
  gcv_object_t _object_Knewline_cr;
  gcv_object_t _object_Knewline_crlf;
  gcv_object_t _object_Knewline_lf;
#if defined(PCRE_ERROR_NOMATCH)
  gcv_object_t _object_Knomatch;
#endif
#if defined(PCRE_ERROR_NOMEMORY)
  gcv_object_t _object_Knomemory;
#endif
#if defined(PCRE_ERROR_NOSUBSTRING)
  gcv_object_t _object_Knosubstring;
#endif
  gcv_object_t _object_Knotbol;
  gcv_object_t _object_Knotempty;
  gcv_object_t _object_Knotempty_atstart;
  gcv_object_t _object_Knoteol;
  gcv_object_t _object_Kno_auto_capture;
  gcv_object_t _object_Kno_start_optimise;
  gcv_object_t _object_Kno_start_optimize;
#if defined(PCRE_NO_UTF8_CHECK)
  gcv_object_t _object_Kno_utf8_check;
#endif
#if defined(PCRE_ERROR_NULL)
  gcv_object_t _object_Knull;
#endif
#if defined(PCRE_ERROR_NULLWSLIMIT)
  gcv_object_t _object_Knullwslimit;
#endif
  gcv_object_t _object_Koffset;
#if defined(PCRE_INFO_OKPARTIAL)
  gcv_object_t _object_Kokpartial;
#endif
  gcv_object_t _object_Koptions;
  gcv_object_t _object_Kpartial;
  gcv_object_t _object_Kpartial_hard;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD))
  gcv_object_t _object_Kposix_malloc_threshold;
#endif
#if defined(PCRE_ERROR_RECURSIONLIMIT)
  gcv_object_t _object_Krecursionlimit;
#endif
#if defined(PCRE_INFO_SIZE)
  gcv_object_t _object_Ksize;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_STACKRECURSE))
  gcv_object_t _object_Kstackrecurse;
#endif
  gcv_object_t _object_Kstudy;
#if defined(PCRE_INFO_STUDYSIZE)
  gcv_object_t _object_Kstudysize;
#endif
  gcv_object_t _object_Kungreedy;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UNICODE_PROPERTIES))
  gcv_object_t _object_Kunicode_properties;
#endif
#if defined(PCRE_ERROR_UNKNOWN_NODE)
  gcv_object_t _object_Kunknown_node;
#endif
#if ((defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UTF8))) || (defined(PCRE_UTF8))
  gcv_object_t _object_Kutf8;
#endif
  gcv_object_t _object_Kwork_space;
  gcv_object_t _object_pcre__make_match_boa;
  gcv_object_t _object_pcre__make_pat;
  gcv_object_t _object_pcre__pattern;
  gcv_object_t _object_stringify_28pcre_date_29;
  gcv_object_t _object___28or_20integer_20_28member_defined_28pcre_caseless_29_Kcaseless_defined_28pcre_multiline_29_Kmultiline_defined_28pcre_dotall_29_Kdotall_defined_28pcre_extended_29_Kextended_defined_28pcre_anchored_29_Kanchored_defined_28pcre_dollar_endonly_29_Kdollar_endonly_defined_28pcre_extra_29_Kextra_defined_28pcre_notbol_29_Knotbol_defined_28pcre_noteol_29_Knoteol_defined_28pcre_ungreedy_29_Kungreedy_defined_28pcre_notempty_29_Knotempty_defined_28pcre_utf8_29_Kutf8_defined_28pcre_no_auto_capture_29_Kno_auto_capture_defined_28pcre_no_utf8_check_29_Kno_utf8_check_defined_28pcre_auto_callout_29_Kauto_callout_defined_28pcre_partial_29_Kpartial_defined_28pcre_dfa_shortest_29_Kdfa_shortest_defined_28pcre_dfa_restart_29_Kdfa_restart_defined_28pcre_firstline_29_Kfirstline_defined_28pcre_dupnames_29_Kdupnames_defined_28pcre_newline_cr_29_Knewline_cr_defined_28pcre_newline_lf_29_Knewline_lf_defined_28pcre_newline_crlf_29_Knewline_crlf_defined_28pcre_newline_any_29_Knewline_any_defined_28pcre_newline_anycrlf_29_Knewline_anycrlf_defined_28pcre_bsr_anycrlf_29_Kbsr_anycrlf_defined_28pcre_bsr_unicode_29_Kbsr_unicode_defined_28pcre_javascript_compat_29_Kjavascript_compat_defined_28pcre_no_start_optimize_29_Kno_start_optimize_defined_28pcre_no_start_optimise_29_Kno_start_optimise_defined_28pcre_partial_hard_29_Kpartial_hard_defined_28pcre_notempty_atstart_29_Knotempty_atstart__29_29;
#if defined(HAVE_PCRE_CONFIG)
  gcv_object_t _object___28or_20integer_20_28member_defined_28pcre_config_utf8_29_Kutf8_defined_28pcre_config_newline_29_Knewline_defined_28pcre_config_link_size_29_Klink_size_defined_28pcre_config_posix_malloc_threshold_29_Kposix_malloc_threshold_defined_28pcre_config_match_limit_29_Kmatch_limit_defined_28pcre_config_stackrecurse_29_Kstackrecurse_defined_28pcre_config_unicode_properties_29_Kunicode_properties_defined_28pcre_config_match_limit_recursion_29_Kmatch_limit_recursion_defined_28pcre_config_bsr_29_Kbsr__29_29;
#endif
  gcv_object_t _object___28or_20integer_20_28member_defined_28pcre_error_nomatch_29_Knomatch_defined_28pcre_error_null_29_Knull_defined_28pcre_error_badoption_29_Kbadoption_defined_28pcre_error_badmagic_29_Kbadmagic_defined_28pcre_error_unknown_node_29_Kunknown_node_defined_28pcre_error_nomemory_29_Knomemory_defined_28pcre_error_nosubstring_29_Knosubstring_defined_28pcre_error_matchlimit_29_Kmatchlimit_defined_28pcre_error_callout_29_Kcallout_defined_28pcre_error_dfa_uitem_29_Kdfa_uitem_defined_28pcre_error_dfa_ucond_29_Kdfa_ucond_defined_28pcre_error_dfa_umlimit_29_Kdfa_umlimit_defined_28pcre_error_dfa_wssize_29_Kdfa_wssize_defined_28pcre_error_dfa_recurse_29_Kdfa_recurse_defined_28pcre_error_badutf8_29_Kbadutf8_defined_28pcre_error_badutf8_offset_29_Kbadutf8_offset_defined_28pcre_error_partial_29_Kpartial_defined_28pcre_error_badpartial_29_Kbadpartial_defined_28pcre_error_internal_29_Kinternal_defined_28pcre_error_badcount_29_Kbadcount_defined_28pcre_error_dfa_uitem_29_Kdfa_uitem_defined_28pcre_error_dfa_ucond_29_Kdfa_ucond_defined_28pcre_error_dfa_umlimit_29_Kdfa_umlimit_defined_28pcre_error_dfa_wssize_29_Kdfa_wssize_defined_28pcre_error_dfa_recurse_29_Kdfa_recurse_defined_28pcre_error_recursionlimit_29_Krecursionlimit_defined_28pcre_error_nullwslimit_29_Knullwslimit_defined_28pcre_error_badnewline_29_Kbadnewline__29_29;
  gcv_object_t _object___28or_20integer_20_28member_defined_28pcre_info_options_29_Koptions_defined_28pcre_info_size_29_Ksize_defined_28pcre_info_capturecount_29_Kcapturecount_defined_28pcre_info_backrefmax_29_Kbackrefmax_defined_28pcre_info_firstbyte_29_Kfirstbyte_defined_28pcre_info_firsttable_29_Kfirsttable_defined_28pcre_info_lastliteral_29_Klastliteral_defined_28pcre_info_nameentrysize_29_Knameentrysize_defined_28pcre_info_namecount_29_Knamecount_defined_28pcre_info_nametable_29_Knametable_defined_28pcre_info_studysize_29_Kstudysize_defined_28pcre_info_okpartial_29_Kokpartial_defined_28pcre_info_jchanged_29_Kjchanged_defined_28pcre_info_hascrorlf_29_Khascrorlf_defined_28pcre_info_minlength_29_Kminlength__29_29;
  gcv_object_t _pcre_version_cache;
} module__pcre__object_tab;
uintC module__pcre__object_tab_size = sizeof(module__pcre__object_tab)/sizeof(gcv_object_t);

struct module__pcre__object_tab_initdata_t {
  object_initdata_t _object_Kanchored;
  object_initdata_t _object_Kauto_callout;
#if (defined(PCRE_INFO_BACKREFMAX)) || (defined(PCRE_INFO_NAMEENTRYSIZE))
  object_initdata_t _object_Kbackrefmax;
#endif
#if defined(PCRE_ERROR_BADCOUNT)
  object_initdata_t _object_Kbadcount;
#endif
#if defined(PCRE_ERROR_BADMAGIC)
  object_initdata_t _object_Kbadmagic;
#endif
#if defined(PCRE_ERROR_BADNEWLINE)
  object_initdata_t _object_Kbadnewline;
#endif
#if defined(PCRE_ERROR_BADOPTION)
  object_initdata_t _object_Kbadoption;
#endif
#if defined(PCRE_ERROR_BADPARTIAL)
  object_initdata_t _object_Kbadpartial;
#endif
#if defined(PCRE_ERROR_BADUTF8)
  object_initdata_t _object_Kbadutf8;
#endif
#if defined(PCRE_ERROR_BADUTF8_OFFSET)
  object_initdata_t _object_Kbadutf8_offset;
#endif
#if defined(PCRE_INFO_FIRSTBYTE)
  object_initdata_t _object_Kbol;
#endif
  object_initdata_t _object_Kboolean;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_BSR))
  object_initdata_t _object_Kbsr;
#endif
  object_initdata_t _object_Kbsr_anycrlf;
  object_initdata_t _object_Kbsr_unicode;
#if defined(PCRE_ERROR_CALLOUT)
  object_initdata_t _object_Kcallout;
#endif
  object_initdata_t _object_Kcapturecount;
#if defined(PCRE_CASELESS)
  object_initdata_t _object_Kcaseless;
#endif
  object_initdata_t _object_Kdfa;
#if defined(PCRE_ERROR_DFA_RECURSE)
  object_initdata_t _object_Kdfa_recurse;
#endif
  object_initdata_t _object_Kdfa_restart;
  object_initdata_t _object_Kdfa_shortest;
#if defined(PCRE_ERROR_DFA_UCOND)
  object_initdata_t _object_Kdfa_ucond;
#endif
#if defined(PCRE_ERROR_DFA_UITEM)
  object_initdata_t _object_Kdfa_uitem;
#endif
#if defined(PCRE_ERROR_DFA_UMLIMIT)
  object_initdata_t _object_Kdfa_umlimit;
#endif
#if defined(PCRE_ERROR_DFA_WSSIZE)
  object_initdata_t _object_Kdfa_wssize;
#endif
  object_initdata_t _object_Kdollar_endonly;
  object_initdata_t _object_Kdotall;
  object_initdata_t _object_Kdupnames;
  object_initdata_t _object_Kextended;
  object_initdata_t _object_Kextra;
#if defined(PCRE_INFO_FIRSTBYTE)
  object_initdata_t _object_Kfirstbyte;
#endif
  object_initdata_t _object_Kfirstline;
  object_initdata_t _object_Kfirsttable;
#if defined(PCRE_INFO_HASCRORLF)
  object_initdata_t _object_Khascrorlf;
#endif
  object_initdata_t _object_Kignore_case;
#if defined(PCRE_ERROR_INTERNAL)
  object_initdata_t _object_Kinternal;
#endif
  object_initdata_t _object_Kjavascript_compat;
#if defined(PCRE_INFO_JCHANGED)
  object_initdata_t _object_Kjchanged;
#endif
  object_initdata_t _object_Klastliteral;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_LINK_SIZE))
  object_initdata_t _object_Klink_size;
#endif
#if defined(PCRE_ERROR_MATCHLIMIT)
  object_initdata_t _object_Kmatchlimit;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT))
  object_initdata_t _object_Kmatch_limit;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT_RECURSION))
  object_initdata_t _object_Kmatch_limit_recursion;
#endif
#if defined(PCRE_INFO_MINLENGTH)
  object_initdata_t _object_Kminlength;
#endif
  object_initdata_t _object_Kmultiline;
#if defined(PCRE_INFO_NAMECOUNT)
  object_initdata_t _object_Knamecount;
#endif
#if defined(PCRE_INFO_NAMEENTRYSIZE)
  object_initdata_t _object_Knameentrysize;
#endif
#if (defined(PCRE_INFO_NAMETABLE)) || (defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE))
  object_initdata_t _object_Knametable;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_NEWLINE))
  object_initdata_t _object_Knewline;
#endif
  object_initdata_t _object_Knewline_any;
  object_initdata_t _object_Knewline_anycrlf;
  object_initdata_t _object_Knewline_cr;
  object_initdata_t _object_Knewline_crlf;
  object_initdata_t _object_Knewline_lf;
#if defined(PCRE_ERROR_NOMATCH)
  object_initdata_t _object_Knomatch;
#endif
#if defined(PCRE_ERROR_NOMEMORY)
  object_initdata_t _object_Knomemory;
#endif
#if defined(PCRE_ERROR_NOSUBSTRING)
  object_initdata_t _object_Knosubstring;
#endif
  object_initdata_t _object_Knotbol;
  object_initdata_t _object_Knotempty;
  object_initdata_t _object_Knotempty_atstart;
  object_initdata_t _object_Knoteol;
  object_initdata_t _object_Kno_auto_capture;
  object_initdata_t _object_Kno_start_optimise;
  object_initdata_t _object_Kno_start_optimize;
#if defined(PCRE_NO_UTF8_CHECK)
  object_initdata_t _object_Kno_utf8_check;
#endif
#if defined(PCRE_ERROR_NULL)
  object_initdata_t _object_Knull;
#endif
#if defined(PCRE_ERROR_NULLWSLIMIT)
  object_initdata_t _object_Knullwslimit;
#endif
  object_initdata_t _object_Koffset;
#if defined(PCRE_INFO_OKPARTIAL)
  object_initdata_t _object_Kokpartial;
#endif
  object_initdata_t _object_Koptions;
  object_initdata_t _object_Kpartial;
  object_initdata_t _object_Kpartial_hard;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD))
  object_initdata_t _object_Kposix_malloc_threshold;
#endif
#if defined(PCRE_ERROR_RECURSIONLIMIT)
  object_initdata_t _object_Krecursionlimit;
#endif
#if defined(PCRE_INFO_SIZE)
  object_initdata_t _object_Ksize;
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_STACKRECURSE))
  object_initdata_t _object_Kstackrecurse;
#endif
  object_initdata_t _object_Kstudy;
#if defined(PCRE_INFO_STUDYSIZE)
  object_initdata_t _object_Kstudysize;
#endif
  object_initdata_t _object_Kungreedy;
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UNICODE_PROPERTIES))
  object_initdata_t _object_Kunicode_properties;
#endif
#if defined(PCRE_ERROR_UNKNOWN_NODE)
  object_initdata_t _object_Kunknown_node;
#endif
#if ((defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UTF8))) || (defined(PCRE_UTF8))
  object_initdata_t _object_Kutf8;
#endif
  object_initdata_t _object_Kwork_space;
  object_initdata_t _object_pcre__make_match_boa;
  object_initdata_t _object_pcre__make_pat;
  object_initdata_t _object_pcre__pattern;
  object_initdata_t _object_stringify_28pcre_date_29;
  object_initdata_t _object___28or_20integer_20_28member_defined_28pcre_caseless_29_Kcaseless_defined_28pcre_multiline_29_Kmultiline_defined_28pcre_dotall_29_Kdotall_defined_28pcre_extended_29_Kextended_defined_28pcre_anchored_29_Kanchored_defined_28pcre_dollar_endonly_29_Kdollar_endonly_defined_28pcre_extra_29_Kextra_defined_28pcre_notbol_29_Knotbol_defined_28pcre_noteol_29_Knoteol_defined_28pcre_ungreedy_29_Kungreedy_defined_28pcre_notempty_29_Knotempty_defined_28pcre_utf8_29_Kutf8_defined_28pcre_no_auto_capture_29_Kno_auto_capture_defined_28pcre_no_utf8_check_29_Kno_utf8_check_defined_28pcre_auto_callout_29_Kauto_callout_defined_28pcre_partial_29_Kpartial_defined_28pcre_dfa_shortest_29_Kdfa_shortest_defined_28pcre_dfa_restart_29_Kdfa_restart_defined_28pcre_firstline_29_Kfirstline_defined_28pcre_dupnames_29_Kdupnames_defined_28pcre_newline_cr_29_Knewline_cr_defined_28pcre_newline_lf_29_Knewline_lf_defined_28pcre_newline_crlf_29_Knewline_crlf_defined_28pcre_newline_any_29_Knewline_any_defined_28pcre_newline_anycrlf_29_Knewline_anycrlf_defined_28pcre_bsr_anycrlf_29_Kbsr_anycrlf_defined_28pcre_bsr_unicode_29_Kbsr_unicode_defined_28pcre_javascript_compat_29_Kjavascript_compat_defined_28pcre_no_start_optimize_29_Kno_start_optimize_defined_28pcre_no_start_optimise_29_Kno_start_optimise_defined_28pcre_partial_hard_29_Kpartial_hard_defined_28pcre_notempty_atstart_29_Knotempty_atstart__29_29;
#if defined(HAVE_PCRE_CONFIG)
  object_initdata_t _object___28or_20integer_20_28member_defined_28pcre_config_utf8_29_Kutf8_defined_28pcre_config_newline_29_Knewline_defined_28pcre_config_link_size_29_Klink_size_defined_28pcre_config_posix_malloc_threshold_29_Kposix_malloc_threshold_defined_28pcre_config_match_limit_29_Kmatch_limit_defined_28pcre_config_stackrecurse_29_Kstackrecurse_defined_28pcre_config_unicode_properties_29_Kunicode_properties_defined_28pcre_config_match_limit_recursion_29_Kmatch_limit_recursion_defined_28pcre_config_bsr_29_Kbsr__29_29;
#endif
  object_initdata_t _object___28or_20integer_20_28member_defined_28pcre_error_nomatch_29_Knomatch_defined_28pcre_error_null_29_Knull_defined_28pcre_error_badoption_29_Kbadoption_defined_28pcre_error_badmagic_29_Kbadmagic_defined_28pcre_error_unknown_node_29_Kunknown_node_defined_28pcre_error_nomemory_29_Knomemory_defined_28pcre_error_nosubstring_29_Knosubstring_defined_28pcre_error_matchlimit_29_Kmatchlimit_defined_28pcre_error_callout_29_Kcallout_defined_28pcre_error_dfa_uitem_29_Kdfa_uitem_defined_28pcre_error_dfa_ucond_29_Kdfa_ucond_defined_28pcre_error_dfa_umlimit_29_Kdfa_umlimit_defined_28pcre_error_dfa_wssize_29_Kdfa_wssize_defined_28pcre_error_dfa_recurse_29_Kdfa_recurse_defined_28pcre_error_badutf8_29_Kbadutf8_defined_28pcre_error_badutf8_offset_29_Kbadutf8_offset_defined_28pcre_error_partial_29_Kpartial_defined_28pcre_error_badpartial_29_Kbadpartial_defined_28pcre_error_internal_29_Kinternal_defined_28pcre_error_badcount_29_Kbadcount_defined_28pcre_error_dfa_uitem_29_Kdfa_uitem_defined_28pcre_error_dfa_ucond_29_Kdfa_ucond_defined_28pcre_error_dfa_umlimit_29_Kdfa_umlimit_defined_28pcre_error_dfa_wssize_29_Kdfa_wssize_defined_28pcre_error_dfa_recurse_29_Kdfa_recurse_defined_28pcre_error_recursionlimit_29_Krecursionlimit_defined_28pcre_error_nullwslimit_29_Knullwslimit_defined_28pcre_error_badnewline_29_Kbadnewline__29_29;
  object_initdata_t _object___28or_20integer_20_28member_defined_28pcre_info_options_29_Koptions_defined_28pcre_info_size_29_Ksize_defined_28pcre_info_capturecount_29_Kcapturecount_defined_28pcre_info_backrefmax_29_Kbackrefmax_defined_28pcre_info_firstbyte_29_Kfirstbyte_defined_28pcre_info_firsttable_29_Kfirsttable_defined_28pcre_info_lastliteral_29_Klastliteral_defined_28pcre_info_nameentrysize_29_Knameentrysize_defined_28pcre_info_namecount_29_Knamecount_defined_28pcre_info_nametable_29_Knametable_defined_28pcre_info_studysize_29_Kstudysize_defined_28pcre_info_okpartial_29_Kokpartial_defined_28pcre_info_jchanged_29_Kjchanged_defined_28pcre_info_hascrorlf_29_Khascrorlf_defined_28pcre_info_minlength_29_Kminlength__29_29;
  object_initdata_t _pcre_version_cache;
  int _dummy_to_avoid_trailing_comma_in_initializer;
} module__pcre__object_tab_initdata = {
  { ":ANCHORED" },
  { ":AUTO-CALLOUT" },
#if (defined(PCRE_INFO_BACKREFMAX)) || (defined(PCRE_INFO_NAMEENTRYSIZE))
  { ":BACKREFMAX" },
#endif
#if defined(PCRE_ERROR_BADCOUNT)
  { ":BADCOUNT" },
#endif
#if defined(PCRE_ERROR_BADMAGIC)
  { ":BADMAGIC" },
#endif
#if defined(PCRE_ERROR_BADNEWLINE)
  { ":BADNEWLINE" },
#endif
#if defined(PCRE_ERROR_BADOPTION)
  { ":BADOPTION" },
#endif
#if defined(PCRE_ERROR_BADPARTIAL)
  { ":BADPARTIAL" },
#endif
#if defined(PCRE_ERROR_BADUTF8)
  { ":BADUTF8" },
#endif
#if defined(PCRE_ERROR_BADUTF8_OFFSET)
  { ":BADUTF8-OFFSET" },
#endif
#if defined(PCRE_INFO_FIRSTBYTE)
  { ":BOL" },
#endif
  { ":BOOLEAN" },
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_BSR))
  { ":BSR" },
#endif
  { ":BSR-ANYCRLF" },
  { ":BSR-UNICODE" },
#if defined(PCRE_ERROR_CALLOUT)
  { ":CALLOUT" },
#endif
  { ":CAPTURECOUNT" },
#if defined(PCRE_CASELESS)
  { ":CASELESS" },
#endif
  { ":DFA" },
#if defined(PCRE_ERROR_DFA_RECURSE)
  { ":DFA-RECURSE" },
#endif
  { ":DFA-RESTART" },
  { ":DFA-SHORTEST" },
#if defined(PCRE_ERROR_DFA_UCOND)
  { ":DFA-UCOND" },
#endif
#if defined(PCRE_ERROR_DFA_UITEM)
  { ":DFA-UITEM" },
#endif
#if defined(PCRE_ERROR_DFA_UMLIMIT)
  { ":DFA-UMLIMIT" },
#endif
#if defined(PCRE_ERROR_DFA_WSSIZE)
  { ":DFA-WSSIZE" },
#endif
  { ":DOLLAR-ENDONLY" },
  { ":DOTALL" },
  { ":DUPNAMES" },
  { ":EXTENDED" },
  { ":EXTRA" },
#if defined(PCRE_INFO_FIRSTBYTE)
  { ":FIRSTBYTE" },
#endif
  { ":FIRSTLINE" },
  { ":FIRSTTABLE" },
#if defined(PCRE_INFO_HASCRORLF)
  { ":HASCRORLF" },
#endif
  { ":IGNORE-CASE" },
#if defined(PCRE_ERROR_INTERNAL)
  { ":INTERNAL" },
#endif
  { ":JAVASCRIPT-COMPAT" },
#if defined(PCRE_INFO_JCHANGED)
  { ":JCHANGED" },
#endif
  { ":LASTLITERAL" },
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_LINK_SIZE))
  { ":LINK-SIZE" },
#endif
#if defined(PCRE_ERROR_MATCHLIMIT)
  { ":MATCHLIMIT" },
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT))
  { ":MATCH-LIMIT" },
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_MATCH_LIMIT_RECURSION))
  { ":MATCH-LIMIT-RECURSION" },
#endif
#if defined(PCRE_INFO_MINLENGTH)
  { ":MINLENGTH" },
#endif
  { ":MULTILINE" },
#if defined(PCRE_INFO_NAMECOUNT)
  { ":NAMECOUNT" },
#endif
#if defined(PCRE_INFO_NAMEENTRYSIZE)
  { ":NAMEENTRYSIZE" },
#endif
#if (defined(PCRE_INFO_NAMETABLE)) || (defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE))
  { ":NAMETABLE" },
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_NEWLINE))
  { ":NEWLINE" },
#endif
  { ":NEWLINE-ANY" },
  { ":NEWLINE-ANYCRLF" },
  { ":NEWLINE-CR" },
  { ":NEWLINE-CRLF" },
  { ":NEWLINE-LF" },
#if defined(PCRE_ERROR_NOMATCH)
  { ":NOMATCH" },
#endif
#if defined(PCRE_ERROR_NOMEMORY)
  { ":NOMEMORY" },
#endif
#if defined(PCRE_ERROR_NOSUBSTRING)
  { ":NOSUBSTRING" },
#endif
  { ":NOTBOL" },
  { ":NOTEMPTY" },
  { ":NOTEMPTY-ATSTART" },
  { ":NOTEOL" },
  { ":NO-AUTO-CAPTURE" },
  { ":NO-START-OPTIMISE" },
  { ":NO-START-OPTIMIZE" },
#if defined(PCRE_NO_UTF8_CHECK)
  { ":NO-UTF8-CHECK" },
#endif
#if defined(PCRE_ERROR_NULL)
  { ":NULL" },
#endif
#if defined(PCRE_ERROR_NULLWSLIMIT)
  { ":NULLWSLIMIT" },
#endif
  { ":OFFSET" },
#if defined(PCRE_INFO_OKPARTIAL)
  { ":OKPARTIAL" },
#endif
  { ":OPTIONS" },
  { ":PARTIAL" },
  { ":PARTIAL-HARD" },
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD))
  { ":POSIX-MALLOC-THRESHOLD" },
#endif
#if defined(PCRE_ERROR_RECURSIONLIMIT)
  { ":RECURSIONLIMIT" },
#endif
#if defined(PCRE_INFO_SIZE)
  { ":SIZE" },
#endif
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_STACKRECURSE))
  { ":STACKRECURSE" },
#endif
  { ":STUDY" },
#if defined(PCRE_INFO_STUDYSIZE)
  { ":STUDYSIZE" },
#endif
  { ":UNGREEDY" },
#if (defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UNICODE_PROPERTIES))
  { ":UNICODE-PROPERTIES" },
#endif
#if defined(PCRE_ERROR_UNKNOWN_NODE)
  { ":UNKNOWN-NODE" },
#endif
#if ((defined(HAVE_PCRE_CONFIG)) && (defined(PCRE_CONFIG_UTF8))) || (defined(PCRE_UTF8))
  { ":UTF8" },
#endif
  { ":WORK-SPACE" },
  { "PCRE::MAKE-MATCH-BOA" },
  { "PCRE::MAKE-PAT" },
  { "PCRE::PATTERN" },
  { "\""STRINGIFY(PCRE_DATE)"\"" },
  {
    " " "(OR INTEGER (MEMBER"
#  if defined(PCRE_CASELESS)
    " " ":CASELESS"
#  endif
#  if defined(PCRE_MULTILINE)
    " " ":MULTILINE"
#  endif
#  if defined(PCRE_DOTALL)
    " " ":DOTALL"
#  endif
#  if defined(PCRE_EXTENDED)
    " " ":EXTENDED"
#  endif
#  if defined(PCRE_ANCHORED)
    " " ":ANCHORED"
#  endif
#  if defined(PCRE_DOLLAR_ENDONLY)
    " " ":DOLLAR-ENDONLY"
#  endif
#  if defined(PCRE_EXTRA)
    " " ":EXTRA"
#  endif
#  if defined(PCRE_NOTBOL)
    " " ":NOTBOL"
#  endif
#  if defined(PCRE_NOTEOL)
    " " ":NOTEOL"
#  endif
#  if defined(PCRE_UNGREEDY)
    " " ":UNGREEDY"
#  endif
#  if defined(PCRE_NOTEMPTY)
    " " ":NOTEMPTY"
#  endif
#  if defined(PCRE_UTF8)
    " " ":UTF8"
#  endif
#  if defined(PCRE_NO_AUTO_CAPTURE)
    " " ":NO-AUTO-CAPTURE"
#  endif
#  if defined(PCRE_NO_UTF8_CHECK)
    " " ":NO-UTF8-CHECK"
#  endif
#  if defined(PCRE_AUTO_CALLOUT)
    " " ":AUTO-CALLOUT"
#  endif
#  if defined(PCRE_PARTIAL)
    " " ":PARTIAL"
#  endif
#  if defined(PCRE_DFA_SHORTEST)
    " " ":DFA-SHORTEST"
#  endif
#  if defined(PCRE_DFA_RESTART)
    " " ":DFA-RESTART"
#  endif
#  if defined(PCRE_FIRSTLINE)
    " " ":FIRSTLINE"
#  endif
#  if defined(PCRE_DUPNAMES)
    " " ":DUPNAMES"
#  endif
#  if defined(PCRE_NEWLINE_CR)
    " " ":NEWLINE-CR"
#  endif
#  if defined(PCRE_NEWLINE_LF)
    " " ":NEWLINE-LF"
#  endif
#  if defined(PCRE_NEWLINE_CRLF)
    " " ":NEWLINE-CRLF"
#  endif
#  if defined(PCRE_NEWLINE_ANY)
    " " ":NEWLINE-ANY"
#  endif
#  if defined(PCRE_NEWLINE_ANYCRLF)
    " " ":NEWLINE-ANYCRLF"
#  endif
#  if defined(PCRE_BSR_ANYCRLF)
    " " ":BSR-ANYCRLF"
#  endif
#  if defined(PCRE_BSR_UNICODE)
    " " ":BSR-UNICODE"
#  endif
#  if defined(PCRE_JAVASCRIPT_COMPAT)
    " " ":JAVASCRIPT-COMPAT"
#  endif
#  if defined(PCRE_NO_START_OPTIMIZE)
    " " ":NO-START-OPTIMIZE"
#  endif
#  if defined(PCRE_NO_START_OPTIMISE)
    " " ":NO-START-OPTIMISE"
#  endif
#  if defined(PCRE_PARTIAL_HARD)
    " " ":PARTIAL-HARD"
#  endif
#  if defined(PCRE_NOTEMPTY_ATSTART)
    " " ":NOTEMPTY-ATSTART"
#  endif
    " " "))"
  },
#if defined(HAVE_PCRE_CONFIG)
  {
    " " "(OR INTEGER (MEMBER"
#  if defined(PCRE_CONFIG_UTF8)
    " " ":UTF8"
#  endif
#  if defined(PCRE_CONFIG_NEWLINE)
    " " ":NEWLINE"
#  endif
#  if defined(PCRE_CONFIG_LINK_SIZE)
    " " ":LINK-SIZE"
#  endif
#  if defined(PCRE_CONFIG_POSIX_MALLOC_THRESHOLD)
    " " ":POSIX-MALLOC-THRESHOLD"
#  endif
#  if defined(PCRE_CONFIG_MATCH_LIMIT)
    " " ":MATCH-LIMIT"
#  endif
#  if defined(PCRE_CONFIG_STACKRECURSE)
    " " ":STACKRECURSE"
#  endif
#  if defined(PCRE_CONFIG_UNICODE_PROPERTIES)
    " " ":UNICODE-PROPERTIES"
#  endif
#  if defined(PCRE_CONFIG_MATCH_LIMIT_RECURSION)
    " " ":MATCH-LIMIT-RECURSION"
#  endif
#  if defined(PCRE_CONFIG_BSR)
    " " ":BSR"
#  endif
    " " "))"
  },
#endif
  {
    " " "(OR INTEGER (MEMBER"
#  if defined(PCRE_ERROR_NOMATCH)
    " " ":NOMATCH"
#  endif
#  if defined(PCRE_ERROR_NULL)
    " " ":NULL"
#  endif
#  if defined(PCRE_ERROR_BADOPTION)
    " " ":BADOPTION"
#  endif
#  if defined(PCRE_ERROR_BADMAGIC)
    " " ":BADMAGIC"
#  endif
#  if defined(PCRE_ERROR_UNKNOWN_NODE)
    " " ":UNKNOWN-NODE"
#  endif
#  if defined(PCRE_ERROR_NOMEMORY)
    " " ":NOMEMORY"
#  endif
#  if defined(PCRE_ERROR_NOSUBSTRING)
    " " ":NOSUBSTRING"
#  endif
#  if defined(PCRE_ERROR_MATCHLIMIT)
    " " ":MATCHLIMIT"
#  endif
#  if defined(PCRE_ERROR_CALLOUT)
    " " ":CALLOUT"
#  endif
#  if defined(PCRE_ERROR_DFA_UITEM)
    " " ":DFA-UITEM"
#  endif
#  if defined(PCRE_ERROR_DFA_UCOND)
    " " ":DFA-UCOND"
#  endif
#  if defined(PCRE_ERROR_DFA_UMLIMIT)
    " " ":DFA-UMLIMIT"
#  endif
#  if defined(PCRE_ERROR_DFA_WSSIZE)
    " " ":DFA-WSSIZE"
#  endif
#  if defined(PCRE_ERROR_DFA_RECURSE)
    " " ":DFA-RECURSE"
#  endif
#  if defined(PCRE_ERROR_BADUTF8)
    " " ":BADUTF8"
#  endif
#  if defined(PCRE_ERROR_BADUTF8_OFFSET)
    " " ":BADUTF8-OFFSET"
#  endif
#  if defined(PCRE_ERROR_PARTIAL)
    " " ":PARTIAL"
#  endif
#  if defined(PCRE_ERROR_BADPARTIAL)
    " " ":BADPARTIAL"
#  endif
#  if defined(PCRE_ERROR_INTERNAL)
    " " ":INTERNAL"
#  endif
#  if defined(PCRE_ERROR_BADCOUNT)
    " " ":BADCOUNT"
#  endif
#  if defined(PCRE_ERROR_DFA_UITEM)
    " " ":DFA-UITEM"
#  endif
#  if defined(PCRE_ERROR_DFA_UCOND)
    " " ":DFA-UCOND"
#  endif
#  if defined(PCRE_ERROR_DFA_UMLIMIT)
    " " ":DFA-UMLIMIT"
#  endif
#  if defined(PCRE_ERROR_DFA_WSSIZE)
    " " ":DFA-WSSIZE"
#  endif
#  if defined(PCRE_ERROR_DFA_RECURSE)
    " " ":DFA-RECURSE"
#  endif
#  if defined(PCRE_ERROR_RECURSIONLIMIT)
    " " ":RECURSIONLIMIT"
#  endif
#  if defined(PCRE_ERROR_NULLWSLIMIT)
    " " ":NULLWSLIMIT"
#  endif
#  if defined(PCRE_ERROR_BADNEWLINE)
    " " ":BADNEWLINE"
#  endif
    " " "))"
  },
  {
    " " "(OR INTEGER (MEMBER"
#  if defined(PCRE_INFO_OPTIONS)
    " " ":OPTIONS"
#  endif
#  if defined(PCRE_INFO_SIZE)
    " " ":SIZE"
#  endif
#  if defined(PCRE_INFO_CAPTURECOUNT)
    " " ":CAPTURECOUNT"
#  endif
#  if defined(PCRE_INFO_BACKREFMAX)
    " " ":BACKREFMAX"
#  endif
#  if defined(PCRE_INFO_FIRSTBYTE)
    " " ":FIRSTBYTE"
#  endif
#  if defined(PCRE_INFO_FIRSTTABLE)
    " " ":FIRSTTABLE"
#  endif
#  if defined(PCRE_INFO_LASTLITERAL)
    " " ":LASTLITERAL"
#  endif
#  if defined(PCRE_INFO_NAMEENTRYSIZE)
    " " ":NAMEENTRYSIZE"
#  endif
#  if defined(PCRE_INFO_NAMECOUNT)
    " " ":NAMECOUNT"
#  endif
#  if defined(PCRE_INFO_NAMETABLE)
    " " ":NAMETABLE"
#  endif
#  if defined(PCRE_INFO_STUDYSIZE)
    " " ":STUDYSIZE"
#  endif
#  if defined(PCRE_INFO_OKPARTIAL)
    " " ":OKPARTIAL"
#  endif
#  if defined(PCRE_INFO_JCHANGED)
    " " ":JCHANGED"
#  endif
#  if defined(PCRE_INFO_HASCRORLF)
    " " ":HASCRORLF"
#  endif
#  if defined(PCRE_INFO_MINLENGTH)
    " " ":MINLENGTH"
#  endif
    " " "))"
  },
  { "NIL" },
  0
};

struct module__pcre__subr_tab_t {
  VAROBJECTS_ALIGNMENT_DUMMY_DECL
  subr_t _subr_pcre_pattern_info;
  subr_t _subr_pcre_pcre_compile;
#if defined(HAVE_PCRE_CONFIG)
  subr_t _subr_pcre_pcre_config;
#endif
  subr_t _subr_pcre_pcre_exec;
  subr_t _subr_pcre_pcre_free;
  subr_t _subr_pcre_pcre_name_to_index;
  subr_t _subr_pcre_pcre_version;
  int _dummy_to_avoid_trailing_comma_in_initializer;
};
extern struct module__pcre__subr_tab_t module__pcre__subr_tab;

static uintL pcre_compile_flags (void) {
  uintL flags = 0
#  ifdef PCRE_NOTEMPTY_ATSTART
    | (missingp(STACK_(0)) ? 0 : PCRE_NOTEMPTY_ATSTART)
#  endif
#  ifdef PCRE_PARTIAL_HARD
    | (missingp(STACK_(1)) ? 0 : PCRE_PARTIAL_HARD)
#  endif
#  ifdef PCRE_NO_START_OPTIMISE
    | (missingp(STACK_(2)) ? 0 : PCRE_NO_START_OPTIMISE)
#  endif
#  ifdef PCRE_NO_START_OPTIMIZE
    | (missingp(STACK_(3)) ? 0 : PCRE_NO_START_OPTIMIZE)
#  endif
#  ifdef PCRE_JAVASCRIPT_COMPAT
    | (missingp(STACK_(4)) ? 0 : PCRE_JAVASCRIPT_COMPAT)
#  endif
#  ifdef PCRE_BSR_UNICODE
    | (missingp(STACK_(5)) ? 0 : PCRE_BSR_UNICODE)
#  endif
#  ifdef PCRE_BSR_ANYCRLF
    | (missingp(STACK_(6)) ? 0 : PCRE_BSR_ANYCRLF)
#  endif
#  ifdef PCRE_NEWLINE_ANYCRLF
    | (missingp(STACK_(7)) ? 0 : PCRE_NEWLINE_ANYCRLF)
#  endif
#  ifdef PCRE_NEWLINE_ANY
    | (missingp(STACK_(8)) ? 0 : PCRE_NEWLINE_ANY)
#  endif
#  ifdef PCRE_NEWLINE_CRLF
    | (missingp(STACK_(9)) ? 0 : PCRE_NEWLINE_CRLF)
#  endif
#  ifdef PCRE_NEWLINE_LF
    | (missingp(STACK_(10)) ? 0 : PCRE_NEWLINE_LF)
#  endif
#  ifdef PCRE_NEWLINE_CR
    | (missingp(STACK_(11)) ? 0 : PCRE_NEWLINE_CR)
#  endif
#  ifdef PCRE_DUPNAMES
    | (missingp(STACK_(12)) ? 0 : PCRE_DUPNAMES)
#  endif
#  ifdef PCRE_FIRSTLINE
    | (missingp(STACK_(13)) ? 0 : PCRE_FIRSTLINE)
#  endif
#  ifdef PCRE_DFA_RESTART
    | (missingp(STACK_(14)) ? 0 : PCRE_DFA_RESTART)
#  endif
#  ifdef PCRE_DFA_SHORTEST
    | (missingp(STACK_(15)) ? 0 : PCRE_DFA_SHORTEST)
#  endif
#  ifdef PCRE_PARTIAL
    | (missingp(STACK_(16)) ? 0 : PCRE_PARTIAL)
#  endif
#  ifdef PCRE_AUTO_CALLOUT
    | (missingp(STACK_(17)) ? 0 : PCRE_AUTO_CALLOUT)
#  endif
#  ifdef PCRE_NO_AUTO_CAPTURE
    | (missingp(STACK_(18)) ? 0 : PCRE_NO_AUTO_CAPTURE)
#  endif
#  ifdef PCRE_NOTEMPTY
    | (missingp(STACK_(19)) ? 0 : PCRE_NOTEMPTY)
#  endif
#  ifdef PCRE_UNGREEDY
    | (missingp(STACK_(20)) ? 0 : PCRE_UNGREEDY)
#  endif
#  ifdef PCRE_NOTEOL
    | (missingp(STACK_(21)) ? 0 : PCRE_NOTEOL)
#  endif
#  ifdef PCRE_NOTBOL
    | (missingp(STACK_(22)) ? 0 : PCRE_NOTBOL)
#  endif
#  ifdef PCRE_EXTRA
    | (missingp(STACK_(23)) ? 0 : PCRE_EXTRA)
#  endif
#  ifdef PCRE_DOLLAR_ENDONLY
    | (missingp(STACK_(24)) ? 0 : PCRE_DOLLAR_ENDONLY)
#  endif
#  ifdef PCRE_ANCHORED
    | (missingp(STACK_(25)) ? 0 : PCRE_ANCHORED)
#  endif
#  ifdef PCRE_EXTENDED
    | (missingp(STACK_(26)) ? 0 : PCRE_EXTENDED)
#  endif
#  ifdef PCRE_DOTALL
    | (missingp(STACK_(27)) ? 0 : PCRE_DOTALL)
#  endif
#  ifdef PCRE_MULTILINE
    | (missingp(STACK_(28)) ? 0 : PCRE_MULTILINE)
#  endif
#  ifdef PCRE_CASELESS
    | (missingp(STACK_(29)) ? 0 : PCRE_CASELESS)
#  endif
   ;
  skipSTACK(30);
  return flags;
}

static uintL pcre_exec_flags (void) {
  uintL flags = 0
#  ifdef PCRE_DFA_RESTART
    | (missingp(STACK_(0)) ? 0 : PCRE_DFA_RESTART)
#  endif
#  ifdef PCRE_DFA_SHORTEST
    | (missingp(STACK_(1)) ? 0 : PCRE_DFA_SHORTEST)
#  endif
#  ifdef PCRE_PARTIAL
    | (missingp(STACK_(2)) ? 0 : PCRE_PARTIAL)
#  endif
#  ifdef PCRE_NOTEMPTY
    | (missingp(STACK_(3)) ? 0 : PCRE_NOTEMPTY)
#  endif
#  ifdef PCRE_NOTEOL
    | (missingp(STACK_(4)) ? 0 : PCRE_NOTEOL)
#  endif
#  ifdef PCRE_NOTBOL
    | (missingp(STACK_(5)) ? 0 : PCRE_NOTBOL)
#  endif
#  ifdef PCRE_ANCHORED
    | (missingp(STACK_(6)) ? 0 : PCRE_ANCHORED)
#  endif
   ;
  skipSTACK(7);
  return flags;
}


#if defined(HAVE_PCRE_CONFIG)
static const c_lisp_pair_t pcre_config_option_table[] = {
 #ifdef PCRE_CONFIG_UTF8
  { PCRE_CONFIG_UTF8, &(O(object_Kutf8)) },
 #endif
 #ifdef PCRE_CONFIG_NEWLINE
  { PCRE_CONFIG_NEWLINE, &(O(object_Knewline)) },
 #endif
 #ifdef PCRE_CONFIG_LINK_SIZE
  { PCRE_CONFIG_LINK_SIZE, &(O(object_Klink_size)) },
 #endif
 #ifdef PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
  { PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, &(O(object_Kposix_malloc_threshold)) },
 #endif
 #ifdef PCRE_CONFIG_MATCH_LIMIT
  { PCRE_CONFIG_MATCH_LIMIT, &(O(object_Kmatch_limit)) },
 #endif
 #ifdef PCRE_CONFIG_STACKRECURSE
  { PCRE_CONFIG_STACKRECURSE, &(O(object_Kstackrecurse)) },
 #endif
 #ifdef PCRE_CONFIG_UNICODE_PROPERTIES
  { PCRE_CONFIG_UNICODE_PROPERTIES, &(O(object_Kunicode_properties)) },
 #endif
 #ifdef PCRE_CONFIG_MATCH_LIMIT_RECURSION
  { PCRE_CONFIG_MATCH_LIMIT_RECURSION, &(O(object_Kmatch_limit_recursion)) },
 #endif
 #ifdef PCRE_CONFIG_BSR
  { PCRE_CONFIG_BSR, &(O(object_Kbsr)) },
 #endif
  { 0, NULL }
};
static const c_lisp_map_t pcre_config_option_map = {
  pcre_config_option_table,
  (sizeof(pcre_config_option_table)/sizeof(c_lisp_pair_t))-1,
  0,true,
  true,
  "pcre_config_option"
};
#define pcre_config_option(a) (int)map_lisp_to_c(a,&pcre_config_option_map)
#define pcre_config_option_reverse(a) map_c_to_lisp(a,&pcre_config_option_map)

#endif
static const c_lisp_pair_t pcre_options_table[] = {
 #ifdef PCRE_CASELESS
  { PCRE_CASELESS, &(O(object_Kcaseless)) },
 #endif
 #ifdef PCRE_MULTILINE
  { PCRE_MULTILINE, &(O(object_Kmultiline)) },
 #endif
 #ifdef PCRE_DOTALL
  { PCRE_DOTALL, &(O(object_Kdotall)) },
 #endif
 #ifdef PCRE_EXTENDED
  { PCRE_EXTENDED, &(O(object_Kextended)) },
 #endif
 #ifdef PCRE_ANCHORED
  { PCRE_ANCHORED, &(O(object_Kanchored)) },
 #endif
 #ifdef PCRE_DOLLAR_ENDONLY
  { PCRE_DOLLAR_ENDONLY, &(O(object_Kdollar_endonly)) },
 #endif
 #ifdef PCRE_EXTRA
  { PCRE_EXTRA, &(O(object_Kextra)) },
 #endif
 #ifdef PCRE_NOTBOL
  { PCRE_NOTBOL, &(O(object_Knotbol)) },
 #endif
 #ifdef PCRE_NOTEOL
  { PCRE_NOTEOL, &(O(object_Knoteol)) },
 #endif
 #ifdef PCRE_UNGREEDY
  { PCRE_UNGREEDY, &(O(object_Kungreedy)) },
 #endif
 #ifdef PCRE_NOTEMPTY
  { PCRE_NOTEMPTY, &(O(object_Knotempty)) },
 #endif
 #ifdef PCRE_UTF8
  { PCRE_UTF8, &(O(object_Kutf8)) },
 #endif
 #ifdef PCRE_NO_AUTO_CAPTURE
  { PCRE_NO_AUTO_CAPTURE, &(O(object_Kno_auto_capture)) },
 #endif
 #ifdef PCRE_NO_UTF8_CHECK
  { PCRE_NO_UTF8_CHECK, &(O(object_Kno_utf8_check)) },
 #endif
 #ifdef PCRE_AUTO_CALLOUT
  { PCRE_AUTO_CALLOUT, &(O(object_Kauto_callout)) },
 #endif
 #ifdef PCRE_PARTIAL
  { PCRE_PARTIAL, &(O(object_Kpartial)) },
 #endif
 #ifdef PCRE_DFA_SHORTEST
  { PCRE_DFA_SHORTEST, &(O(object_Kdfa_shortest)) },
 #endif
 #ifdef PCRE_DFA_RESTART
  { PCRE_DFA_RESTART, &(O(object_Kdfa_restart)) },
 #endif
 #ifdef PCRE_FIRSTLINE
  { PCRE_FIRSTLINE, &(O(object_Kfirstline)) },
 #endif
 #ifdef PCRE_DUPNAMES
  { PCRE_DUPNAMES, &(O(object_Kdupnames)) },
 #endif
 #ifdef PCRE_NEWLINE_CR
  { PCRE_NEWLINE_CR, &(O(object_Knewline_cr)) },
 #endif
 #ifdef PCRE_NEWLINE_LF
  { PCRE_NEWLINE_LF, &(O(object_Knewline_lf)) },
 #endif
 #ifdef PCRE_NEWLINE_CRLF
  { PCRE_NEWLINE_CRLF, &(O(object_Knewline_crlf)) },
 #endif
 #ifdef PCRE_NEWLINE_ANY
  { PCRE_NEWLINE_ANY, &(O(object_Knewline_any)) },
 #endif
 #ifdef PCRE_NEWLINE_ANYCRLF
  { PCRE_NEWLINE_ANYCRLF, &(O(object_Knewline_anycrlf)) },
 #endif
 #ifdef PCRE_BSR_ANYCRLF
  { PCRE_BSR_ANYCRLF, &(O(object_Kbsr_anycrlf)) },
 #endif
 #ifdef PCRE_BSR_UNICODE
  { PCRE_BSR_UNICODE, &(O(object_Kbsr_unicode)) },
 #endif
 #ifdef PCRE_JAVASCRIPT_COMPAT
  { PCRE_JAVASCRIPT_COMPAT, &(O(object_Kjavascript_compat)) },
 #endif
 #ifdef PCRE_NO_START_OPTIMIZE
  { PCRE_NO_START_OPTIMIZE, &(O(object_Kno_start_optimize)) },
 #endif
 #ifdef PCRE_NO_START_OPTIMISE
  { PCRE_NO_START_OPTIMISE, &(O(object_Kno_start_optimise)) },
 #endif
 #ifdef PCRE_PARTIAL_HARD
  { PCRE_PARTIAL_HARD, &(O(object_Kpartial_hard)) },
 #endif
 #ifdef PCRE_NOTEMPTY_ATSTART
  { PCRE_NOTEMPTY_ATSTART, &(O(object_Knotempty_atstart)) },
 #endif
  { 0, NULL }
};
static const c_lisp_map_t pcre_options_map = {
  pcre_options_table,
  (sizeof(pcre_options_table)/sizeof(c_lisp_pair_t))-1,
  0,true,
  true,
  "pcre_options"
};
#define pcre_options(a) (int)map_lisp_to_c(a,&pcre_options_map)
#define pcre_options_reverse(a) map_c_to_lisp(a,&pcre_options_map)
#define pcre_options_to_list(a) map_c_to_list(a,&pcre_options_map)
#define pcre_options_of_list(a) map_list_to_c(a,&pcre_options_map)

static const c_lisp_pair_t error_pcre_code_table[] = {
 #ifdef PCRE_ERROR_NOMATCH
  { PCRE_ERROR_NOMATCH, &(O(object_Knomatch)) },
 #endif
 #ifdef PCRE_ERROR_NULL
  { PCRE_ERROR_NULL, &(O(object_Knull)) },
 #endif
 #ifdef PCRE_ERROR_BADOPTION
  { PCRE_ERROR_BADOPTION, &(O(object_Kbadoption)) },
 #endif
 #ifdef PCRE_ERROR_BADMAGIC
  { PCRE_ERROR_BADMAGIC, &(O(object_Kbadmagic)) },
 #endif
 #ifdef PCRE_ERROR_UNKNOWN_NODE
  { PCRE_ERROR_UNKNOWN_NODE, &(O(object_Kunknown_node)) },
 #endif
 #ifdef PCRE_ERROR_NOMEMORY
  { PCRE_ERROR_NOMEMORY, &(O(object_Knomemory)) },
 #endif
 #ifdef PCRE_ERROR_NOSUBSTRING
  { PCRE_ERROR_NOSUBSTRING, &(O(object_Knosubstring)) },
 #endif
 #ifdef PCRE_ERROR_MATCHLIMIT
  { PCRE_ERROR_MATCHLIMIT, &(O(object_Kmatchlimit)) },
 #endif
 #ifdef PCRE_ERROR_CALLOUT
  { PCRE_ERROR_CALLOUT, &(O(object_Kcallout)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UITEM
  { PCRE_ERROR_DFA_UITEM, &(O(object_Kdfa_uitem)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UCOND
  { PCRE_ERROR_DFA_UCOND, &(O(object_Kdfa_ucond)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UMLIMIT
  { PCRE_ERROR_DFA_UMLIMIT, &(O(object_Kdfa_umlimit)) },
 #endif
 #ifdef PCRE_ERROR_DFA_WSSIZE
  { PCRE_ERROR_DFA_WSSIZE, &(O(object_Kdfa_wssize)) },
 #endif
 #ifdef PCRE_ERROR_DFA_RECURSE
  { PCRE_ERROR_DFA_RECURSE, &(O(object_Kdfa_recurse)) },
 #endif
 #ifdef PCRE_ERROR_BADUTF8
  { PCRE_ERROR_BADUTF8, &(O(object_Kbadutf8)) },
 #endif
 #ifdef PCRE_ERROR_BADUTF8_OFFSET
  { PCRE_ERROR_BADUTF8_OFFSET, &(O(object_Kbadutf8_offset)) },
 #endif
 #ifdef PCRE_ERROR_PARTIAL
  { PCRE_ERROR_PARTIAL, &(O(object_Kpartial)) },
 #endif
 #ifdef PCRE_ERROR_BADPARTIAL
  { PCRE_ERROR_BADPARTIAL, &(O(object_Kbadpartial)) },
 #endif
 #ifdef PCRE_ERROR_INTERNAL
  { PCRE_ERROR_INTERNAL, &(O(object_Kinternal)) },
 #endif
 #ifdef PCRE_ERROR_BADCOUNT
  { PCRE_ERROR_BADCOUNT, &(O(object_Kbadcount)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UITEM
  { PCRE_ERROR_DFA_UITEM, &(O(object_Kdfa_uitem)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UCOND
  { PCRE_ERROR_DFA_UCOND, &(O(object_Kdfa_ucond)) },
 #endif
 #ifdef PCRE_ERROR_DFA_UMLIMIT
  { PCRE_ERROR_DFA_UMLIMIT, &(O(object_Kdfa_umlimit)) },
 #endif
 #ifdef PCRE_ERROR_DFA_WSSIZE
  { PCRE_ERROR_DFA_WSSIZE, &(O(object_Kdfa_wssize)) },
 #endif
 #ifdef PCRE_ERROR_DFA_RECURSE
  { PCRE_ERROR_DFA_RECURSE, &(O(object_Kdfa_recurse)) },
 #endif
 #ifdef PCRE_ERROR_RECURSIONLIMIT
  { PCRE_ERROR_RECURSIONLIMIT, &(O(object_Krecursionlimit)) },
 #endif
 #ifdef PCRE_ERROR_NULLWSLIMIT
  { PCRE_ERROR_NULLWSLIMIT, &(O(object_Knullwslimit)) },
 #endif
 #ifdef PCRE_ERROR_BADNEWLINE
  { PCRE_ERROR_BADNEWLINE, &(O(object_Kbadnewline)) },
 #endif
  { 0, NULL }
};
static const c_lisp_map_t error_pcre_code_map = {
  error_pcre_code_table,
  (sizeof(error_pcre_code_table)/sizeof(c_lisp_pair_t))-1,
  0,true,
  true,
  "error_pcre_code"
};
#define error_pcre_code(a) (int)map_lisp_to_c(a,&error_pcre_code_map)
#define error_pcre_code_reverse(a) map_c_to_lisp(a,&error_pcre_code_map)

static const c_lisp_pair_t fullinfo_arg_table[] = {
 #ifdef PCRE_INFO_OPTIONS
  { PCRE_INFO_OPTIONS, &(O(object_Koptions)) },
 #endif
 #ifdef PCRE_INFO_SIZE
  { PCRE_INFO_SIZE, &(O(object_Ksize)) },
 #endif
 #ifdef PCRE_INFO_CAPTURECOUNT
  { PCRE_INFO_CAPTURECOUNT, &(O(object_Kcapturecount)) },
 #endif
 #ifdef PCRE_INFO_BACKREFMAX
  { PCRE_INFO_BACKREFMAX, &(O(object_Kbackrefmax)) },
 #endif
 #ifdef PCRE_INFO_FIRSTBYTE
  { PCRE_INFO_FIRSTBYTE, &(O(object_Kfirstbyte)) },
 #endif
 #ifdef PCRE_INFO_FIRSTTABLE
  { PCRE_INFO_FIRSTTABLE, &(O(object_Kfirsttable)) },
 #endif
 #ifdef PCRE_INFO_LASTLITERAL
  { PCRE_INFO_LASTLITERAL, &(O(object_Klastliteral)) },
 #endif
 #ifdef PCRE_INFO_NAMEENTRYSIZE
  { PCRE_INFO_NAMEENTRYSIZE, &(O(object_Knameentrysize)) },
 #endif
 #ifdef PCRE_INFO_NAMECOUNT
  { PCRE_INFO_NAMECOUNT, &(O(object_Knamecount)) },
 #endif
 #ifdef PCRE_INFO_NAMETABLE
  { PCRE_INFO_NAMETABLE, &(O(object_Knametable)) },
 #endif
 #ifdef PCRE_INFO_STUDYSIZE
  { PCRE_INFO_STUDYSIZE, &(O(object_Kstudysize)) },
 #endif
 #ifdef PCRE_INFO_OKPARTIAL
  { PCRE_INFO_OKPARTIAL, &(O(object_Kokpartial)) },
 #endif
 #ifdef PCRE_INFO_JCHANGED
  { PCRE_INFO_JCHANGED, &(O(object_Kjchanged)) },
 #endif
 #ifdef PCRE_INFO_HASCRORLF
  { PCRE_INFO_HASCRORLF, &(O(object_Khascrorlf)) },
 #endif
 #ifdef PCRE_INFO_MINLENGTH
  { PCRE_INFO_MINLENGTH, &(O(object_Kminlength)) },
 #endif
  { 0, NULL }
};
static const c_lisp_map_t fullinfo_arg_map = {
  fullinfo_arg_table,
  (sizeof(fullinfo_arg_table)/sizeof(c_lisp_pair_t))-1,
  0,true,
  true,
  "fullinfo_arg"
};
#define fullinfo_arg(a) (int)map_lisp_to_c(a,&fullinfo_arg_map)
#define fullinfo_arg_reverse(a) map_c_to_lisp(a,&fullinfo_arg_map)


#line 29

DEFVAR(pcre_version_cache)
DEFUN(PCRE::PCRE-VERSION,,(subr_pcre_pcre_version,seclass_default,0,0,norest,nokey,0,NIL))
{ value1 = !nullp(O(pcre_version_cache)) ? O(pcre_version_cache)
    : (O(pcre_version_cache) = safe_to_string(pcre_version()));
  value2 = fixnum(PCRE_MAJOR); value3 = fixnum(PCRE_MINOR);
  value4 = O(object_stringify_28pcre_date_29); mv_count = 4; }
#if defined(HAVE_PCRE_CONFIG)
#line 39

DEFUN(PCRE::PCRE-CONFIG, &optional what,(subr_pcre_pcre_config,seclass_default,0,1,norest,nokey,0,NIL))
{
  if (missingp(STACK_0)) {
    int pos = 0;
    for (; pos < pcre_config_option_map.size; pos++) {
      int ret;
      begin_system_call();
      pcre_config(pcre_config_option_map.table[pos].c_const,&ret);
      end_system_call();
      pushSTACK(*pcre_config_option_map.table[pos].l_const);
      pushSTACK(L_to_I(ret));
    }
    VALUES1(listof(2*pcre_config_option_map.size));
  } else {
    int option = pcre_config_option(STACK_0);
    int ret = 0;
    begin_system_call(); pcre_config(option,&ret); end_system_call();
    VALUES1(L_to_I(ret));
  }
  skipSTACK(1);
}
#endif

DEFUN(PCRE::PCRE-FREE,fp,(subr_pcre_pcre_free,seclass_default,1,0,norest,nokey,0,NIL))
{ /* free the pcre* or pcre_extra* object */
  object fp = popSTACK();
  if (fpointerp(fp) && fp_validp(TheFpointer(fp))) {
    void *datum = TheFpointer(fp)->fp_pointer;
    if (datum) {
      pcre_free(datum);
      TheFpointer(fp)->fp_pointer = NULL;
      mark_fp_invalid(TheFpointer(fp));
      VALUES1(T);
    } else VALUES1(NIL);
  } else VALUES1(NIL);
}

#line 85

#line 92

#line 98
DEFUN(PCRE:PCRE-COMPILE,string &key STUDY IGNORE-CASE MULTILINE DOTALL         EXTENDED ANCHORED DOLLAR-ENDONLY EXTRA NOTBOL NOTEOL UNGREEDY            NOTEMPTY NO-AUTO-CAPTURE AUTO-CALLOUT PARTIAL DFA-SHORTEST DFA-RESTART        FIRSTLINE DUPNAMES NEWLINE-CR NEWLINE-LF NEWLINE-CRLF NEWLINE-ANY        NEWLINE-ANYCRLF BSR-ANYCRLF BSR-UNICODE JAVASCRIPT-COMPAT                NO-START-OPTIMIZE NO-START-OPTIMISE PARTIAL-HARD NOTEMPTY-ATSTART,(subr_pcre_pcre_compile,seclass_default,1,0,norest,key,31,NIL))
{ /* compile the pattern, return PATTERN struct */
  int options = PCRE_UTF8 | pcre_compile_flags();
  bool study = !missingp(STACK_0);
  const char *error_message;
  int error_offset;
  pcre *compiled_pattern;
  gcv_object_t *string = &STACK_1;
 pcre_compile_restart:
  with_string_0(check_string(*string),Symbol_value(S(utf_8)),pattern, {
      begin_system_call();
      compiled_pattern = pcre_compile(pattern,options,&error_message,
                                      &error_offset,NULL);
      end_system_call();
    });
  if (compiled_pattern == NULL) { /* error */
    pushSTACK(NIL);               /* no PLACE */
    pushSTACK(safe_to_string(error_message));
    pushSTACK(fixnum(error_offset));
    pushSTACK(*string); pushSTACK(TheSubr(subr_self)->name);
    check_value(error_condition,GETTEXT("~S(~S) at ~S: ~S"));
    *string = value1;
    goto pcre_compile_restart;
  }
  pushSTACK(allocate_fpointer(compiled_pattern));
  pushSTACK(STACK_0); pushSTACK(F(subr_pcre_pcre_free)); funcall(L(finalize),2);
  if (study) {
    pcre_extra *pe;
    begin_system_call();
    pe = pcre_study(compiled_pattern,0,&error_message);
    end_system_call();
    if (error_message != NULL) { /* error */
      STACK_0 = NIL;           /* no PLACE - discard compiled_pattern */
      pushSTACK(asciz_to_string(error_message,GLO(misc_encoding)));
      pushSTACK(*string); pushSTACK(TheSubr(subr_self)->name);
      check_value(error_condition,"~S(~S): ~S");
      *string = value1;
      goto pcre_compile_restart;
    }
    if (pe) pushSTACK(allocate_fpointer(pe));
    else pushSTACK(NIL);
  } else pushSTACK(NIL);
  funcall(O(object_pcre__make_pat),2);
  skipSTACK(2);
}

/* can trigger GC */
static void check_pattern (gcv_object_t *pat, pcre** compiled_pattern,
                           pcre_extra** study)
{ /* extract compiled pattern and the study results from the PATTERN */
  *pat = check_classname(*pat,O(object_pcre__pattern));
  /* FIXME for derived structs! */
  *compiled_pattern =
    (pcre*)TheFpointer(TheStructure(*pat)->recdata[1])->fp_pointer;
  if (nullp(TheStructure(*pat)->recdata[2])) *study = NULL;
  else *study =
    (pcre_extra*)TheFpointer(TheStructure(*pat)->recdata[2])->fp_pointer;
}

/* two objects should be on STACK for the error message */
#line 163

nonreturning_function(static, error_pcre, (int status)) {
  pushSTACK(error_pcre_code_reverse(status));
  pushSTACK(sfixnum(status)); pushSTACK(TheSubr(subr_self)->name);
  error(error_condition,"~S/~S=~S: ~S ~S");
}


#line 176
#define PCRE_INFO(opt,val,bad)    do {                       begin_system_call();                                     status = pcre_fullinfo(c_pat,study,opt,val);             end_system_call();                                       if (status < bad) error_pcre(status);                  } while(0)
#line 180

/* PCRE_INFO_DEFAULTTABLES -- does not look useful
       Return a pointer to the internal default character tables within  PCRE.
       The  fourth  argument should point to an unsigned char * variable. This
       information call is provided for internal use by the pcre_study() func-
       tion.  External  callers  can  cause PCRE to use its internal tables by
       passing a NULL table pointer. */
static object fullinfo_options (pcre *c_pat, pcre_extra *study) {
  unsigned long int options;
  int status;
  PCRE_INFO(PCRE_INFO_OPTIONS,&options,0);
  return pcre_options_to_list(options);
}
static object fullinfo_size (pcre *c_pat, pcre_extra *study, int opt) {
  size_t length;
  int status;
  PCRE_INFO(opt,&length,0);
  return size_to_I(length);
}
static object fullinfo_int (pcre *c_pat, pcre_extra *study, int opt) {
  int ret, status;
  PCRE_INFO(opt,&ret,0);
  return L_to_I(ret);
}
static object fullinfo_bool (pcre *c_pat, pcre_extra *study, int opt) {
  int ret, status;
  PCRE_INFO(opt,&ret,0);
  return ret == 1 ? T : NIL;
}
#if defined(PCRE_INFO_FIRSTBYTE)
static object fullinfo_firstbyte (pcre *c_pat, pcre_extra *study) {
  int value, status;
  PCRE_INFO(PCRE_INFO_FIRSTBYTE,&value,-2);
  if (status == 0) return int_char(value);
  else if (status == -1) return O(object_Kbol);
  else if (status == -2) return NIL;
  else NOTREACHED;
}
#endif
static object fullinfo_firsttable (pcre *c_pat, pcre_extra *study) {
  unsigned char table[256];
  object ret = allocate_bit_vector(Atype_Bit,256);
  int status;
  void *data = TheSbvector(ret)->data;
  /* no need to pin ret because pcre_fullinfo does not block */
  handle_fault_range(PROT_READ_WRITE,(aint)data,(aint)data + sizeof(table));
  begin_system_call();
  status = pcre_fullinfo(c_pat,study,PCRE_INFO_FIRSTTABLE,&table);
  if (status >= 0) memcpy(data,table,sizeof(table));
  end_system_call();
  if (status < 0) error_pcre(status);
  return ret;
}
static object fullinfo_lastliteral (pcre *c_pat, pcre_extra *study) {
  int value, status;
  PCRE_INFO(PCRE_INFO_LASTLITERAL,&value,0);
  if (status == 0) return int_char(value);
  else return NIL;
}
#if defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE)
static object fullinfo_nametable (pcre *c_pat, pcre_extra *study) {
  int count, size, pos, status;
  char *table;
  begin_system_call();
  status = pcre_fullinfo(c_pat,study,PCRE_INFO_NAMECOUNT,&count);
  if (status < 0) { end_system_call(); error_pcre(status); }
  status = pcre_fullinfo(c_pat,study,PCRE_INFO_NAMEENTRYSIZE,&size);
  if (status < 0) { end_system_call(); error_pcre(status); }
  status = pcre_fullinfo(c_pat,study,PCRE_INFO_NAMETABLE,&table);
  end_system_call();
  if (status < 0) error_pcre(status);
  for (pos = 0; pos < count; pos++, table+=size) {
    pushSTACK(allocate_cons());
    Car(STACK_0) = asciz_to_string(table+2,GLO(misc_encoding));
    Cdr(STACK_0) = fixnum((table[0]<<8) + table[1]);
  }
  return listof(count);
}
#endif
DEFUN(PCRE:PATTERN-INFO,pattern &optional request,(subr_pcre_pattern_info,seclass_default,1,1,norest,nokey,0,NIL))
{
  pcre *c_pat;
  pcre_extra *study;
  check_pattern(&STACK_1,&c_pat,&study);
  if (missingp(STACK_0)) {
    int count = 0;
    pushSTACK(O(object_Koptions)); pushSTACK(fullinfo_options(c_pat,study)); count+=2;
    pushSTACK(S(Ksize));
    pushSTACK(fullinfo_size(c_pat,study,PCRE_INFO_SIZE)); count+=2;
    pushSTACK(O(object_Kcapturecount));
    pushSTACK(fullinfo_int(c_pat,study,PCRE_INFO_CAPTURECOUNT)); count+=2;
#  if defined(PCRE_INFO_FIRSTBYTE)
    pushSTACK(O(object_Kfirstbyte));pushSTACK(fullinfo_firstbyte(c_pat,study));count+=2;
#  endif
    pushSTACK(O(object_Kfirsttable));
    pushSTACK(fullinfo_firsttable(c_pat,study)); count+=2;
    pushSTACK(O(object_Klastliteral));
    pushSTACK(fullinfo_lastliteral(c_pat,study)); count+=2;
#  if defined(PCRE_INFO_NAMEENTRYSIZE)
    pushSTACK(O(object_Kbackrefmax));
    pushSTACK(fullinfo_int(c_pat,study,PCRE_INFO_BACKREFMAX)); count+=2;
#  endif
#  if defined(PCRE_INFO_NAMEENTRYSIZE)
    pushSTACK(O(object_Knameentrysize));
    pushSTACK(fullinfo_int(c_pat,study,PCRE_INFO_NAMEENTRYSIZE)); count+=2;
#  endif
#  if defined(PCRE_INFO_NAMECOUNT)
    pushSTACK(O(object_Knamecount));
    pushSTACK(fullinfo_int(c_pat,study,PCRE_INFO_NAMECOUNT)); count+=2;
#  endif
#  if defined(PCRE_INFO_STUDYSIZE)
    pushSTACK(O(object_Kstudysize));
    pushSTACK(fullinfo_size(c_pat,study,PCRE_INFO_STUDYSIZE)); count+=2;
#  endif
#  if defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE)
    pushSTACK(O(object_Knametable));
    pushSTACK(fullinfo_nametable(c_pat,study)); count+=2;
#  endif
#  if defined(PCRE_INFO_OKPARTIAL)
    pushSTACK(O(object_Kokpartial));
    pushSTACK(fullinfo_bool(c_pat,study,PCRE_INFO_OKPARTIAL)); count+=2;
#  endif
#  if defined(PCRE_INFO_JCHANGED)
    pushSTACK(O(object_Kjchanged));
    pushSTACK(fullinfo_bool(c_pat,study,PCRE_INFO_JCHANGED)); count+=2;
#  endif
#  if defined(PCRE_INFO_HASCRORLF)
    pushSTACK(O(object_Khascrorlf));
    pushSTACK(fullinfo_bool(c_pat,study,PCRE_INFO_HASCRORLF)); count+=2;
#  endif
#  if defined(PCRE_INFO_MINLENGTH)
    pushSTACK(O(object_Kminlength));
    pushSTACK(fullinfo_int(c_pat,study,PCRE_INFO_MINLENGTH)); count+=2;
#  endif
    VALUES1(listof(count));
  } else {
    int arg = fullinfo_arg(STACK_0);
    switch (arg) {
      case PCRE_INFO_OPTIONS: VALUES1(fullinfo_options(c_pat,study)); break;
      case PCRE_INFO_SIZE:
        VALUES1(fullinfo_size(c_pat,study,PCRE_INFO_SIZE)); break;
      case PCRE_INFO_CAPTURECOUNT: case PCRE_INFO_BACKREFMAX:
#    if defined(PCRE_INFO_NAMEENTRYSIZE)
      case PCRE_INFO_NAMEENTRYSIZE:
#    endif
#    if defined(PCRE_INFO_NAMECOUNT)
      case PCRE_INFO_NAMECOUNT:
#    endif
#    if defined(PCRE_INFO_STUDYSIZE)
      case PCRE_INFO_STUDYSIZE:
#    endif
#    if defined(PCRE_INFO_MINLENGTH)
      case PCRE_INFO_MINLENGTH:
#    endif
        VALUES1(fullinfo_int(c_pat,study,arg)); break;
#    if defined(PCRE_INFO_OKPARTIAL)
      case PCRE_INFO_OKPARTIAL:
#    endif
#    if defined(PCRE_INFO_JCHANGED)
      case PCRE_INFO_JCHANGED:
#    endif
#    if defined(PCRE_INFO_HASCRORLF)
      case PCRE_INFO_HASCRORLF:
#    endif
        VALUES1(fullinfo_bool(c_pat,study,arg)); break;
#    if defined(PCRE_INFO_FIRSTBYTE)
      case PCRE_INFO_FIRSTBYTE: VALUES1(fullinfo_firstbyte(c_pat,study)); break;
#    endif
      case PCRE_INFO_FIRSTTABLE:
        VALUES1(fullinfo_firsttable(c_pat,study)); break;
      case PCRE_INFO_LASTLITERAL:
        VALUES1(fullinfo_lastliteral(c_pat,study)); break;
#    if defined(PCRE_INFO_NAMECOUNT) && defined(PCRE_INFO_NAMEENTRYSIZE) && defined(PCRE_INFO_NAMETABLE)
      case PCRE_INFO_NAMETABLE: VALUES1(fullinfo_nametable(c_pat,study)); break;
#    endif
      default: NOTREACHED;
    }
  }
  skipSTACK(2);
}


DEFUN(PCRE:PCRE-NAME-TO-INDEX,pattern name,(subr_pcre_pcre_name_to_index,seclass_default,2,0,norest,nokey,0,NIL))
{ /* pcre_get_stringnumber() : named substring index in OVECTOR */
  pcre *c_pat;
  pcre_extra *study;
  int index;
  check_pattern(&STACK_1,&c_pat,&study);
#if defined(HAVE_PCRE_GET_STRINGNUMBER)
 restart_pcre_get_stringnumber:
  with_string_0(check_string(STACK_0),GLO(misc_encoding),name, {
      index = pcre_get_stringnumber(c_pat,name);
    });
  if (index>0) VALUES1(fixnum(index));
  else { /* error */
    pushSTACK(NIL);             /* no PLACE */
    pushSTACK(STACK_1);         /* name */
    pushSTACK(TheSubr(subr_self)->name);
    check_value(error_condition,GETTEXT("~S: ~S is not a valid pattern name"));
    STACK_0 = value1;
    goto restart_pcre_get_stringnumber;
  }
  skipSTACK(2);
#else /* PCRE versions before 4.0 did not have pcre_get_stringnumber() */
  pushSTACK(TheSubr(subr_self)->name);
  error(error_condition,GETTEXT("~S (~S ~S): PCRE library lacks pcre_get_stringnumber()"));
#endif
}

#line 390

#line 392
DEFUN(PCRE:PCRE-EXEC,pattern subject &key WORK-SPACE DFA BOOLEAN OFFSET        ANCHORED NOTBOL NOTEOL NOTEMPTY PARTIAL DFA-SHORTEST DFA-RESTART,(subr_pcre_pcre_exec,seclass_default,2,0,norest,key,11,NIL))
{ /* match the SUBJECT string against a pre-compiled PATTERN;
     return a vector of MATCH structures or NIL if no matches */
  int options = pcre_exec_flags();
  int offset = check_uint_default0(popSTACK());
  bool bool_p = !missingp(STACK_0);
  bool dfa_p = !missingp(STACK_1);
  int workspace_size = check_uint_defaulted(STACK_2,20);
  int *ovector;
  int capture_count, ovector_size, ret;
  pcre *c_pat;
  pcre_extra *study;
  skipSTACK(3); /* drop all options */
  check_pattern(&STACK_1,&c_pat,&study);
  begin_system_call();
  ret = pcre_fullinfo(c_pat,study,PCRE_INFO_CAPTURECOUNT,&capture_count);
  end_system_call();
  if (ret < 0) error_pcre(ret);
  /* when DFA is enabled, the number of matches is not easily estimated */
  ovector_size = 3 * (capture_count + (dfa_p ? workspace_size : 1));
 pcre_exec_retry:
  ovector = (int*)alloca(sizeof(int)*ovector_size);
# if !defined(HAVE_PCRE_DFA_EXEC)
  /* use pcre_exec instead */
#line 417
#  define pcre_dfa_exec(re,st,su,sb,of,op,ov,os,ws,wz)                pcre_exec(re,st,su,sb,of,op,ov,os)
# endif
  with_string_0(check_string(STACK_0),Symbol_value(S(utf_8)),subject, {
      begin_system_call();
      /* subject_bytelen is the length of subject in bytes,
         defined in with_string_0 */
      ret = dfa_p
        ? pcre_dfa_exec(c_pat,study,subject,subject_bytelen,offset,options,
                        ovector,ovector_size,
                        (int*)alloca(sizeof(int)*workspace_size),workspace_size)
        : pcre_exec(c_pat,study,subject,subject_bytelen,offset,options,
                    ovector,ovector_size);
      end_system_call();
    });
  if (ret == PCRE_ERROR_NOMATCH) VALUES1(NIL);
  else if (ret == 0) {          /* not enough space in ovector */
    ovector_size <<= 1;
    goto pcre_exec_retry;
  } else if (ret > 0) {
    if (bool_p) VALUES1(T); /* success indicator */
    else { /* return a vector */
      int pos, ov_pos;
      ASSERT(ret <= ovector_size);
      pushSTACK(allocate_vector(ret)); /* return value */
      for (pos = ov_pos = 0; pos < ret; pos++, ov_pos+=2)
        if (ovector[ov_pos] >= 0) {
          pushSTACK(L_to_I(ovector[ov_pos]));
          pushSTACK(L_to_I(ovector[ov_pos+1]));
          funcall(O(object_pcre__make_match_boa),2);
          TheSvector(STACK_0)->data[pos] = value1;
        }
      VALUES1(popSTACK());
    }
  } else error_pcre(ret);
  skipSTACK(2);                 /* drop pattern & subject */
}

void module__pcre__init_function_2 (module_t* module);
void module__pcre__init_function_2 (module_t* module)
{ /* the original pcre_malloc() and pcre_free() cause a crash in FINALIZE */
  pcre_malloc = malloc;
  pcre_free = free;
}



struct module__pcre__subr_tab_t module__pcre__subr_tab
  #if defined(HEAPCODES) && (alignment_long < varobject_alignment) && defined(__GNUC__)
    __attribute__ ((aligned (varobject_alignment)))
  #endif
  = {
  #if varobjects_misaligned
  { 0 },
  #endif
  LISPFUN_F(subr_pcre_pattern_info,seclass_default,1,1,norest,nokey,0,NIL)
  LISPFUN_F(subr_pcre_pcre_compile,seclass_default,1,0,norest,key,31,NIL)
#if defined(HAVE_PCRE_CONFIG)
  LISPFUN_F(subr_pcre_pcre_config,seclass_default,0,1,norest,nokey,0,NIL)
#endif
  LISPFUN_F(subr_pcre_pcre_exec,seclass_default,2,0,norest,key,11,NIL)
  LISPFUN_F(subr_pcre_pcre_free,seclass_default,1,0,norest,nokey,0,NIL)
  LISPFUN_F(subr_pcre_pcre_name_to_index,seclass_default,2,0,norest,nokey,0,NIL)
  LISPFUN_F(subr_pcre_pcre_version,seclass_default,0,0,norest,nokey,0,NIL)
  0
};
uintC module__pcre__subr_tab_size = (sizeof(struct module__pcre__subr_tab_t)-varobjects_misaligned-sizeof(int))/sizeof(subr_t);

struct module__pcre__subr_tab_initdata_t {
  subr_initdata_t _subr_pcre_pattern_info;
  subr_initdata_t _subr_pcre_pcre_compile;
#if defined(HAVE_PCRE_CONFIG)
  subr_initdata_t _subr_pcre_pcre_config;
#endif
  subr_initdata_t _subr_pcre_pcre_exec;
  subr_initdata_t _subr_pcre_pcre_free;
  subr_initdata_t _subr_pcre_pcre_name_to_index;
  subr_initdata_t _subr_pcre_pcre_version;
  int _dummy_to_avoid_trailing_comma_in_initializer;
} module__pcre__subr_tab_initdata = {
  { "PCRE", "PATTERN-INFO" },
  { "PCRE", "PCRE-COMPILE" },
#if defined(HAVE_PCRE_CONFIG)
  { "PCRE", "PCRE-CONFIG" },
#endif
  { "PCRE", "PCRE-EXEC" },
  { "PCRE", "PCRE-FREE" },
  { "PCRE", "PCRE-NAME-TO-INDEX" },
  { "PCRE", "PCRE-VERSION" },
  0
};

void module__pcre__init_function_1 (module_t* module);
void module__pcre__init_function_1 (module_t* module)
{
  pushSTACK(O(object_Kstudy));
  pushSTACK(O(object_Kignore_case));
  pushSTACK(O(object_Kmultiline));
  pushSTACK(O(object_Kdotall));
  pushSTACK(O(object_Kextended));
  pushSTACK(O(object_Kanchored));
  pushSTACK(O(object_Kdollar_endonly));
  pushSTACK(O(object_Kextra));
  pushSTACK(O(object_Knotbol));
  pushSTACK(O(object_Knoteol));
  pushSTACK(O(object_Kungreedy));
  pushSTACK(O(object_Knotempty));
  pushSTACK(O(object_Kno_auto_capture));
  pushSTACK(O(object_Kauto_callout));
  pushSTACK(O(object_Kpartial));
  pushSTACK(O(object_Kdfa_shortest));
  pushSTACK(O(object_Kdfa_restart));
  pushSTACK(O(object_Kfirstline));
  pushSTACK(O(object_Kdupnames));
  pushSTACK(O(object_Knewline_cr));
  pushSTACK(O(object_Knewline_lf));
  pushSTACK(O(object_Knewline_crlf));
  pushSTACK(O(object_Knewline_any));
  pushSTACK(O(object_Knewline_anycrlf));
  pushSTACK(O(object_Kbsr_anycrlf));
  pushSTACK(O(object_Kbsr_unicode));
  pushSTACK(O(object_Kjavascript_compat));
  pushSTACK(O(object_Kno_start_optimize));
  pushSTACK(O(object_Kno_start_optimise));
  pushSTACK(O(object_Kpartial_hard));
  pushSTACK(O(object_Knotempty_atstart));
  module__pcre__subr_tab._subr_pcre_pcre_compile.keywords = vectorof(31);
  pushSTACK(O(object_Kwork_space));
  pushSTACK(O(object_Kdfa));
  pushSTACK(O(object_Kboolean));
  pushSTACK(O(object_Koffset));
  pushSTACK(O(object_Kanchored));
  pushSTACK(O(object_Knotbol));
  pushSTACK(O(object_Knoteol));
  pushSTACK(O(object_Knotempty));
  pushSTACK(O(object_Kpartial));
  pushSTACK(O(object_Kdfa_shortest));
  pushSTACK(O(object_Kdfa_restart));
  module__pcre__subr_tab._subr_pcre_pcre_exec.keywords = vectorof(11);
  O(pcre_version_cache) = (NIL);
}

void module__pcre__fini_function (module_t* module);
void module__pcre__fini_function (module_t* module)
{
}
