# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Maintainer: Ray Donnelly <mingw.android@gmail.com>
# Contributor: Saul Ibarra Corretge <saghul@gmail.com>
# Contributor: Frode Solheim <frode@fs-uae.net>

# TODO :: subprocess.Popen .. specifically list2cmdline in subprocess.py
#         needs a fix so it can handle running MSYS2 executables better.
#         Arguments should not be quoted in the Windows fashion as-per:
#         http://www.daviddeley.com/autohotkey/parameters/parameters.htm
#         but instead how Cygwin expects them to be quoted. Checking for
#         {cygwin,msys-2.0}.dll in the executable is the only way that I
#         can think to do this at present.
#         Any double quoted string will cause problems, e.g.
#         -DGNOMELOCALEDIR=\"/mingw64/share/locale\"

_realname=python3
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_pybasever=3.7
pkgver=${_pybasever}.2
pkgrel=1
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
license=('PSF')
url="https://www.python.org/"
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
         "${MINGW_PACKAGE_PREFIX}-expat"
         "${MINGW_PACKAGE_PREFIX}-bzip2"
         "${MINGW_PACKAGE_PREFIX}-libffi"
         "${MINGW_PACKAGE_PREFIX}-mpdecimal"
         "${MINGW_PACKAGE_PREFIX}-ncurses"
         "${MINGW_PACKAGE_PREFIX}-openssl"
         "${MINGW_PACKAGE_PREFIX}-tcl"
         "${MINGW_PACKAGE_PREFIX}-tk"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-xz"
         "${MINGW_PACKAGE_PREFIX}-sqlite3"
        )
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('makeflags') # 'debug' '!strip' )
source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz"
        0000-make-_sysconfigdata.py-relocatable.patch
        0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch
        0002-restore-setup-config.patch
        0100-MINGW-BASE-use-NT-thread-model.patch
        0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch
        0130-MINGW-configure-MACHDEP-and-platform-for-build.patch
        0140-MINGW-preset-configure-defaults.patch
        0150-MINGW-configure-largefile-support-for-windows-builds.patch
        0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch
        0180-MINGW-init-system-calls.patch
        0200-MINGW-build-in-windows-modules-winreg.patch
        0210-MINGW-determine-if-pwdmodule-should-be-used.patch
        0230-MINGW-AC_LIBOBJ-replacement-of-fileblocks.patch
        0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch
        0260-MINGW-compiler-enable-new-dtags.patch
        0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch
        0300-MINGW-configure-for-shared-build.patch
        0310-MINGW-dynamic-loading-support.patch
        0330-MINGW-ignore-main-program-for-frozen-scripts.patch
        0340-MINGW-setup-exclude-termios-module.patch
        0350-MINGW-setup-_multiprocessing-module.patch
        0360-MINGW-setup-select-module.patch
        0370-MINGW-setup-_ctypes-module-with-system-libffi.patch
        0380-MINGW-defect-winsock2-and-setup-_socket-module.patch
        0390-MINGW-exclude-unix-only-modules.patch
        0400-MINGW-setup-msvcrt-and-_winapi-modules.patch
        0410-MINGW-build-extensions-with-GCC.patch
        0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch
        0430-MINGW-find-import-library.patch
        0440-MINGW-setup-_ssl-module.patch
        0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
        0462-MINGW-support-stdcall-without-underscore.patch
        0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch
        0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch
        0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch
        0490-MINGW-customize-site.patch
        0500-add-python-config-sh.patch
        0510-cross-darwin-feature.patch
        0520-py3k-mingw-ntthreads-vs-pthreads.patch
        0530-mingw-system-libffi.patch
        0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch
        0560-mingw-use-posix-getpath.patch
        0565-mingw-add-ModuleFileName-dir-to-PATH.patch
        0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch
        0610-msys-cygwin-semi-native-build-sysconfig.patch
        0620-mingw-sysconfig-like-posix.patch
        0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch
        0640-mingw-x86_64-size_t-format-specifier-pid_t.patch
        0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch
        0660-mingw-use-backslashes-in-compileall-py.patch
        0670-msys-convert_path-fix-and-root-hack.patch
        0690-allow-static-tcltk.patch
        0720-mingw-pdcurses_ISPAD.patch
        0740-grammar-fixes.patch
        0750-builddir-fixes.patch
        0760-msys-monkeypatch-os-system-via-sh-exe.patch
        0770-msys-replace-slashes-used-in-io-redirection.patch
        0800-mingw-install-layout-as-posix.patch
        0810-remove_path_max.default.patch
        0820-dont-link-with-gettext.patch
        0830-ctypes-python-dll.patch
        0840-gdbm-module-includes.patch
        0845-3.7-_abs-mingw.patch
        0850-use-gnu_printf-in-format.patch
        0870-mingw-fix-ssl-dont-use-enum_certificates.patch
        0890-mingw-build-optimized-ext.patch
        0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch
        0910-fix-using-dllhandle-and-winver-mingw.patch
        0920-mingw-add-LIBPL-to-library-dirs.patch
        0930-mingw-w64-build-overlapped-module.patch
        0940-mingw-w64-Also-define-_Py_BEGIN_END_SUPPRESS_IPH-when-Py_BUILD_CORE_MODULE.patch
        0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch
        0990-MINGW-link-with-additional-library.patch
        1010-install-msilib.patch
        1620-fix-signal-module-build.patch
        1630-build-winconsoleio.patch
        1650-expose-sem_unlink.patch
        1700-cygpty-isatty.patch
        1701-disable-broken-gdbm-module.patch
        1800-link-win-resource-files-and-build-pythonw.patch
        1810-3.7-mpdec-mingw.patch
        1830-mingw-implement-setenv-for-PY_COERCE_C_LOCALE.patch
        1850-disable-readline.patch
        1860-fix-isselectable.patch
        2000-warnings-fixes.patch
        1900-ctypes-dont-depend-on-internal-libffi.patch
        smoketests.py)

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
  for _patch in "$@"
  do
    msg2 "Applying ${_patch}"
    patch -Nbp1 -i "${srcdir}/${_patch}"
  done
}

del_file_exists() {
  for _fname in "$@"
  do
    if [ -f ${_fname} ]; then
      rm -rf ${_fname}
    fi
  done
}
# =========================================== #

prepare() {
  cd "${srcdir}/Python-${pkgver}"

  # these are created by patches
  rm -f Misc/config_mingw \
        Misc/cross_mingw32 \
        Modules/Setup.config.in \
        Python/fileblocks.c

  plain "Apply Ray Donnelly's should-be-upstreamed patches"
  apply_patch_with_msg \
    0000-make-_sysconfigdata.py-relocatable.patch \
    0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch \
    0002-restore-setup-config.patch

  plain "Apply Roumen Petrov's core patches (10)"
  apply_patch_with_msg \
    0100-MINGW-BASE-use-NT-thread-model.patch \
    0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch \
    0130-MINGW-configure-MACHDEP-and-platform-for-build.patch \
    0140-MINGW-preset-configure-defaults.patch \
    0150-MINGW-configure-largefile-support-for-windows-builds.patch \
    0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch \
    0180-MINGW-init-system-calls.patch \
    0200-MINGW-build-in-windows-modules-winreg.patch \
    0210-MINGW-determine-if-pwdmodule-should-be-used.patch \
    0230-MINGW-AC_LIBOBJ-replacement-of-fileblocks.patch

  plain "Apply Roumen Petrov's compiler patch (2)"
  apply_patch_with_msg \
    0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch \
    0260-MINGW-compiler-enable-new-dtags.patch

  plain "Apply Roumen Petrov's extensions patches (21)"
  apply_patch_with_msg \
    0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch \
    0300-MINGW-configure-for-shared-build.patch \
    0310-MINGW-dynamic-loading-support.patch \
    0330-MINGW-ignore-main-program-for-frozen-scripts.patch \
    0340-MINGW-setup-exclude-termios-module.patch \
    0350-MINGW-setup-_multiprocessing-module.patch \
    0360-MINGW-setup-select-module.patch \
    0370-MINGW-setup-_ctypes-module-with-system-libffi.patch \
    0380-MINGW-defect-winsock2-and-setup-_socket-module.patch \
    0390-MINGW-exclude-unix-only-modules.patch \
    0400-MINGW-setup-msvcrt-and-_winapi-modules.patch \
    0410-MINGW-build-extensions-with-GCC.patch \
    0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch \
    0430-MINGW-find-import-library.patch \
    0440-MINGW-setup-_ssl-module.patch \
    0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch \
    0462-MINGW-support-stdcall-without-underscore.patch \
    0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch \
    0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch \
    0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch \
    0490-MINGW-customize-site.patch

  plain "Apply Ray Donnelly's general/cross patches (42)"
  apply_patch_with_msg \
    0500-add-python-config-sh.patch \
    0510-cross-darwin-feature.patch \
    0520-py3k-mingw-ntthreads-vs-pthreads.patch \
    0530-mingw-system-libffi.patch \
    0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch \
    0560-mingw-use-posix-getpath.patch \
    0565-mingw-add-ModuleFileName-dir-to-PATH.patch \
    0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch
  # 0610- changed to not using -DVPATH='"$(VPATH_b2h)"' anymore since VPATH is
  # relative, therefore getpath.c:355: joinpath(prefix, vpath) works naturally
  apply_patch_with_msg \
    0610-msys-cygwin-semi-native-build-sysconfig.patch \
    0620-mingw-sysconfig-like-posix.patch \
    0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch \
    0640-mingw-x86_64-size_t-format-specifier-pid_t.patch \
    0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch \
    0660-mingw-use-backslashes-in-compileall-py.patch \
    0670-msys-convert_path-fix-and-root-hack.patch \
    0690-allow-static-tcltk.patch

  apply_patch_with_msg \
    0720-mingw-pdcurses_ISPAD.patch \
    0740-grammar-fixes.patch \
    0750-builddir-fixes.patch \
    0760-msys-monkeypatch-os-system-via-sh-exe.patch \
    0770-msys-replace-slashes-used-in-io-redirection.patch \
    0800-mingw-install-layout-as-posix.patch \
    0810-remove_path_max.default.patch \
    0820-dont-link-with-gettext.patch \
    0830-ctypes-python-dll.patch \
    0840-gdbm-module-includes.patch \
    0845-3.7-_abs-mingw.patch \
    0850-use-gnu_printf-in-format.patch \
    0870-mingw-fix-ssl-dont-use-enum_certificates.patch \
    0890-mingw-build-optimized-ext.patch \
    0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch \
    0910-fix-using-dllhandle-and-winver-mingw.patch \
    0920-mingw-add-LIBPL-to-library-dirs.patch \
    0930-mingw-w64-build-overlapped-module.patch \
    0940-mingw-w64-Also-define-_Py_BEGIN_END_SUPPRESS_IPH-when-Py_BUILD_CORE_MODULE.patch \
    0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch \
    0990-MINGW-link-with-additional-library.patch \
    1010-install-msilib.patch

  plain "New patches added for the update from 3.5.3 to 3.6.1"
  apply_patch_with_msg \
    1620-fix-signal-module-build.patch \
    1630-build-winconsoleio.patch \
    1650-expose-sem_unlink.patch

  # Extend some isatty calls to check for mintty when checking for
  # a terminal output.
  # https://github.com/Alexpux/MINGW-packages/issues/2645
  # https://github.com/Alexpux/MINGW-packages/issues/2656
  apply_patch_with_msg \
    1700-cygpty-isatty.patch

  # gdbm is broken and as a result breaks dbm/shelve.
  # Don't include it so the dbm.dumb backend is used instead,
  # like with the official CPython build.
  apply_patch_with_msg \
    1701-disable-broken-gdbm-module.patch

  # https://github.com/Alexpux/MINGW-packages/issues/3139
  apply_patch_with_msg \
    1800-link-win-resource-files-and-build-pythonw.patch

  apply_patch_with_msg \
    1810-3.7-mpdec-mingw.patch \
    1830-mingw-implement-setenv-for-PY_COERCE_C_LOCALE.patch \
    1850-disable-readline.patch \
    1860-fix-isselectable.patch

  apply_patch_with_msg 2000-warnings-fixes.patch

  # https://github.com/python/cpython/pull/9258
  apply_patch_with_msg 1900-ctypes-dont-depend-on-internal-libffi.patch

  autoreconf -vfi

  # Temporary workaround for FS#22322
  # See https://bugs.python.org/issue10835 for upstream report
  #sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c

  touch Include/graminit.h
  touch Python/graminit.c
  touch Parser/Python.asdl
  touch Parser/asdl.py
  touch Parser/asdl_c.py
  touch Include/Python-ast.h
  touch Python/Python-ast.c
  echo \"\" > Parser/pgen.stamp

  # Ensure that we are using the system copy of various libraries (expat, zlib and libffi),
  # rather than copies shipped in the tarball
  rm -r Modules/expat
  #rm -r Modules/zlib
  rm -r Modules/_ctypes/{darwin,libffi}*
}

check() {
  cd "${srcdir}/build-${CARCH}"

  # Some basic tests to ensure nothing major or MSYS2 specific features are
  # broken
  ./python.exe "${srcdir}/smoketests.py"
  MSYSTEM= ./python.exe "${srcdir}/smoketests.py"

  # make test EXTRATESTOPTS="-v"
}

build() {
  local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})

  CFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601"
  CXXFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601"
  CPPFLAGS+=" -I${PREFIX_WIN}/include/ncursesw "

  declare -a _extra_config
  if check_option "strip" "y"; then
    LDFLAGS+=" -s "
  fi
  if check_option "debug" "n"; then
    CFLAGS+=" -DNDEBUG "
    CXXFLAGS+=" -DNDEBUG "
  else
    plain " -DDEBUG -DPy_DEBUG -D_DEBUG does not work unfortunately .."
    #    CFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
    #    CXXFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
    CFLAGS+=" -O0 -ggdb"
    CXXFLAGS+=" -O0 -ggdb"
    _extra_config+=("--with-pydebug")
  fi

  # Workaround for conftest error on 64-bit builds
  export ac_cv_working_tzset=no

  [[ -d "${srcdir}/build-${CARCH}" ]] && rm -rf "${srcdir}/build-${CARCH}"
  mkdir -p "${srcdir}/build-${CARCH}" && cd "${srcdir}/build-${CARCH}"

  MSYSTEM=MINGW ../Python-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --build=${MINGW_CHOST} \
    --enable-shared \
    --with-nt-threads \
    --with-system-expat \
    --with-system-ffi \
    --with-system-libmpdec \
    --without-ensurepip \
    "${_extra_config[@]}" \
    OPT=""

  make
}

package() {
  cd "${srcdir}/build-${CARCH}"

  local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
  MSYSTEM=MINGW \
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  make -j1 install DESTDIR="${pkgdir}"
  if check_option "debug" "n"; then
    VERABI=${_pybasever}m
  else
    VERABI=${_pybasever}dm
  fi

  # gdb pretty printers for debugging Python itself; to use:
  # python
  # sys.path.append('C:/msys64/mingw64/share/gdb/python3')
  # import python_gdb
  # reload(python_gdb)
  # end
  [[ -d "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/ ]] || mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/
  cp -f python.exe-gdb.py "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/python_gdb.py

  rm "${pkgdir}${MINGW_PREFIX}"/bin/2to3
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/libpython${VERABI}.dll.a

  # Need for building boost python3 module
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/libpython${_pybasever}.dll.a
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${_pybasever}.dll.a

  # some useful "stuff"
  install -dm755 "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/{i18n,scripts}
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/i18n/
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/scripts/{README,*py} "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/scripts/

  # clean up #!s
  find "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/ -name '*.py' | \
    xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python3|"

  # clean-up reference to build directory
  sed -i "s#${srcdir}/Python-${pkgver}:##" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/Makefile

  for fscripts in 2to3-${_pybasever} idle3 idle${_pybasever} pydoc3 pydoc${_pybasever} pyvenv pyvenv-${_pybasever}; do
    sed -e "s|${PREFIX_WIN}/bin/python${_pybasever}.exe|/usr/bin/env python${_pybasever}.exe|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${fscripts}
  done

  sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${VERABI}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/python-config.py

  # fix permissons
  find ${pkgdir}${MINGW_PREFIX} -type f \( -name "*.dll" -o -name "*.exe" \) | xargs chmod 0755

  # Fix up two instances of MSYS2 paths in python-config.sh in-case the final consumer of the results are native executables.
  sed -e "s|${MINGW_PREFIX}|${PREFIX_WIN}|" \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python${VERABI}-config \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python${_pybasever}-config \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python3-config

  # replace paths in sysconfig
  sed -i "s|${pkgdir}${MINGW_PREFIX}|${MINGW_PREFIX}|g" \
    "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/lib-dynload/_sysconfigdata*.py \
    "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/smtpd.py

  # Doing sysconfig relocatable as patch 0000 do it only partially
  sed -e "s/sys.prefix + //g" \
      -e "s/'\/bin'/sys.prefix + '\/bin'/g" \
      -e "s/'\/include\//sys.prefix + '\/include\//g" \
      -e "s/'\/include /sys.prefix + '\/include /g" \
      -e "s/'\/include'/sys.prefix + '\/include'/g" \
      -e "s/ \/include\// ' + sys.prefix + '\/include\//g" \
      -e "s/ \/include / ' + sys.prefix + '\/include /g" \
      -e "s/'\/lib\//sys.prefix + '\/lib\//g" \
      -e "s/'\/lib /sys.prefix + '\/lib /g" \
      -e "s/'\/lib'/sys.prefix + '\/lib'/g" \
      -e "s/ \/lib\// ' + sys.prefix + '\/lib\//g" \
      -e "s/ \/lib / ' + sys.prefix + '\/lib /g" \
      -e "s/'\/share\//sys.prefix + '\/share\//g" \
      -e "s/'\/share'/sys.prefix + '\/share'/g" \
      -i "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/lib-dynload/_sysconfigdata*.py
}

sha256sums=('d83fe8ce51b1bb48bbcf0550fd265b9a75cdfdfa93f916f9e700aef8444bf1bb'
            'fa58527f17b1c3defeb9345ef0606d937b2c6ea2746033bfe980879eefe2c50e'
            '8b2c7d6b3d0efec48f44c1e46be25fcfb4ba6711ca49b93cf9fa40fb4f0966b6'
            'b2111d31e812b33e5cec85f6505bd730975dd242f8eb138307f71ffe0d7fdf6b'
            '7983bc803f4b845c09589b039d4dd099570e68716c339c940d785ef4785ee1a8'
            '43be25da4f4d58ab4f40e3338907c057fd98999f7f32e83816ad20c7a41e6f2e'
            'cac9b0ec37bd5fb6e21fa6b4708242b160b60de1e7cdfaa7a843b4f5e1a0e498'
            '3028e28ce3c76e2cde223c39ef903b789015773834b69260b4116adb22b31e7b'
            'e05770b5fc8126141ee21ccb252a126d366c4249253ab7a2aeafafbd2e1d4f54'
            '2556db898b65b642455161839e9682d07a3910359a8367db6b73b8abd3a02047'
            '8946c6ee9dab5ed24c083a82e71d74013a3690afc7e98f58d239d2afb1fbef70'
            'b026d5fa0eddeda532d4a3352b4d6f5506593cef0aae4c361be791faedd45bd7'
            '578e395e45ce69445639b0bb1ad9c09934acfa6090d4bca96d0955a4b325ace8'
            'ce1e3f39cd6e4003f1dfbf43a81425a5cf34969a76f9ca7715edd8d8ae337725'
            'a2934b7de03c247291a09ab5509a6b6a98f93cb132f87cd428167b5f7339d632'
            '3b923d508432cc9df6f3593ed1bbe7e97b6956ae8d6eaaf047c7263186679e0a'
            '1121c2bed2e4bd6415e3e246d48a3bd5ae66e01390cb5bae2ea55eb8ed4c64ae'
            'a2c96cc1e0014121a09ba25dd08f722cb0d507488be52b217ee94a28238532cb'
            'd334e3a50ce9464961739218c4832ade990e14d613416a66f6896c20b6a14873'
            'ef0c54f898cf8511766f7d4ea5c043fbf50b0280618a81efc48f5448397c112e'
            '364e3afbfe4b436b2c63d352a98d552b55baebbe4bee0b19dadaadd369f6fe97'
            'b86c646b8eca162f73a107e453498d06ed7c79b14d5823a48f7108822230bdfd'
            '22e002727f64cac5f5ba38d1da516fb10e04f41f3366e15796ed36a05f1f1685'
            'c629be9a191948eff146f07dcb09c760ab55acfd08639dfc94dc1bc43160012f'
            '92d106d0dbc273cb08cb52759ba8467e16e6d61019eeb3464397822b991ed861'
            '8e2ae92f24ca52b16215612a57fe5076d5b0ea1cc0923d5ab9bd7395b6330816'
            'b21b63eb077c4ed9380034957034d9fc726992e34abd9185d9f57080e088b4e8'
            '4f28511452f8c56aadc79e6e1079531aad94392778f9a62090e9c423487baf4c'
            'd555fac5000a86ade7a1c191d3eb09bdb8aa46d0beb73e54e6243731fae35e8f'
            '4fb0f33a99784b2f397adc013591c64bdbdbb8e7a4f839880a8fc4678ee2b435'
            '986bcf760501ca0f069588b124afd53ffdd37fa1edfd85a8b631d63709859f75'
            '3fa1ceb829d311ee42c919b42c78917b2ca3b8ab1b30a5247232f4ac0cef1d2f'
            '85546a45a460e42e43e97d158d0f78082c711c5a369e3bbac1bfa5065208d51c'
            'ae5c4001975f10c15aae614b48671821a23ea7367fb2e6a911707dde48c28638'
            'a14d40567e6bf6d08fab55e95a56495eb6fcdfc9d06d80b959b487df26481190'
            'a8b2096f3b4a26d32a325e778ed47cd921d40a1ef481a0387a5ff3592d5d9c77'
            'c0fa618b89fd43b27862f4c765926f19cf5679a46e8af3d8eb918a648e33429b'
            '4802eceab9a147fc1cddaadf84917839edfca0b3dcd33d3be92e4c2edde3c726'
            'f0d20525f42387153cf82e2d4a3139a7b7a39a7408833c8b02e9c072a9967674'
            '8bd4dddfda38e8dae700eca868693cba3b2fb766088b46a52a4ac475e9e6b25e'
            'a88ed0a61dcb0a860286ab1d6bf489b272a670625687924943713a58c6068a94'
            '80dabe16710799fb070dfeed071161dfd439f156e2cf79e0c5ab7d51279d342f'
            '3f743eb2e067dc0d315dee875c4525791388a2d7636f9a74cd9721002fc13b83'
            'e7be78409c070ea2fa76a8f568d6121deaa3fc4545fc0565745c044a67376616'
            'c64baa4c0457186269f02c74f5f58f4c56fd435384c45f778e86deac9b9f435f'
            '65454f7d338af3a41f574f87b2d5a91ec3a96d474fb61d2d5fc9f9938a7a83fb'
            '5a5e9bbe642e2c86b3feee87b14ca3c4716178266a08deaa02a79b71fd36f00f'
            'acea1a2bdbb96fa2bcb368225d42df54c41ea308f91f849e2c3c2770845207c6'
            'ec4d73e328cf5f0cc83b2d865aec9ca66dea1ecd9f4da4be98e1170a8d20b3b4'
            '77cf11ea1d75d0a08dc03ff6978294e923a4123119b36822fd1bd724cabb75c7'
            'b1ffcbd24d5ca05a6f4b10288ff0e720db3cc106a6d44cdb65b896ce44bec461'
            'dc2badcbac568895c37fe5add0e59087c7864937f3c0ce01fb910de5bafab024'
            '7aeee8c27434f4684a253b5c91ece99f01f78db04cab92739c19ff71adbe1bf0'
            '59b7abb07b3ee572668fee1ad021837187d267a715fcd5a1a4fc93276a9646ed'
            'ce32ddf6bb7876237fdfad713f1c8f1d97afa470d428d3129e1c01308f4c8302'
            'f445523eff779faa76740eb32daf3ffb61834a6a49bd05939e61726e1174cd4b'
            '8c906d78bc2a8542e5f52fa178d398fb2c298beef8cbb5efd2d74729bee2bb47'
            '5094776bb60411f48ed57c35ccf1da76fe9aafabaf13f20ed8eb199ef5b51c66'
            'c4adc7cfc4f182c953c1792472728eac848cec0bac9526f7fab0f03a172e4c4d'
            '4f3eaf5a4fbaa5848a68bf1f686e3854ac6bee7e31a0a643dcaa22b52c1cd078'
            'e176cd882818e857d6647a4fc08b00f353f11883f8cded1326239c3b2138b6ba'
            '4eace191297b47ebab2bf7dd68f6edaa1cb46d3f44dc86c9ebc88f96d6a46dff'
            '508ebdc995055ace5673d4734f015da4d989953f57a7ac076d04c97a79d5e1a7'
            'c9510eea8d927f3ea1478b7e4f9f4dc652995a768fdfe85bc3f4083fa93fdc4f'
            'd37f6c6683784a5554e2065a52dc05ad55cf28ea18333acf42af421b7d4d5803'
            'e076f36172f8b4fa76d06d41fef66e73b4e64a88e91e6ecbd9fd6822a0d14b32'
            '28684b03d3bab789983163449afa9da4d910fcfe944c9ff9853feb4c672e82fc'
            'f6a9909714c553ef6c2ea1c2e96a7e3f61e5cd8c60fe833657f5d62c31e0266b'
            '088117409d4f60cec42aff46695f4f80911519d5488466efcdbd9d3d9cbcd583'
            '0ae09d2f23e346b2f33256782b9ac42bfaae47f6b1175b16a5e30ba2dfcbaa5e'
            '30b60e3242d9dfe8314e099fac1aa9ee478032abe4c6a35644fbdb1dee774c41'
            '587d8c789d152145608ad5ccc74a178b37335b9accc5d26798fb80040c1579ac'
            'a032186578651a66e20157e73728487d8c2845fb01200178182f300ef1253f2c'
            'cb562435b70aa4184751df111278e333402fdacad04248859dfc973878f81461'
            '0593d93f5f9312bb4233b6809d2fdb30edbac37889fb0e4e96abe818d884194a'
            '6a6e2de169adcf5d9f13b4ae31171f11f29d82fd1dd29b406fd248044b6d3776'
            '56a68e711806062161a1ddf4a7f16f1141bada46ef5f64f526ecda460edf299d'
            'bc8057f54cb377d9fe3cf4e2a7d00980d32249a57471af7f94234f6258486c61'
            '204b1e14b4a9614182a68074bd66c33a4ae84134210458079d22d61d8526ff1c'
            '0d76ffdca82b978e9fda07e12351cd61f23973af204e65db69ebafce71aa7880'
            '9785322e90050ad9019ce7edd1f3c549ac4ae78d0ed240ca1bffffe9de588d2e'
            'f8d3b68097cc0bc53d846cd55744dc9b311f3f32eaefb8d03c6b17cfb61485f0'
            'cdbdbfe4b8c02d58fd36db15d94425ae0b48124e709645fb717167280ff1bf15'
            '3262ce24714dc6cfea5b18d528d7f1a333128eadf5aa9c3a026131c34f082e1f'
            'bd9b934e8c1f92573115efaef6b6b04966e3222ba769511e006366d1217d34d6'
            'e91f897e43063e0c4e52d971f5de4b5e193d9eb6a35fc3acfca1dc057a2fcd65'
            'e3b0171303b3e28a7347a81b1110dfe42df92a87d160caf624510304d5390728'
            'ea41f389324bf56277ef27a02f3510d22e5c88becbdb465468bdad9c15e0d229')
