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

_primary_python="yes"
_pybasever=3.12
_realname=python

if [[ "${_primary_python}" == "yes" ]]; then
  pkgbase="mingw-w64-${_realname}"
  pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
  provides=("${MINGW_PACKAGE_PREFIX}-python3"
            "${MINGW_PACKAGE_PREFIX}-python${_pybasever}")
  conflicts=("${MINGW_PACKAGE_PREFIX}-python3"
             "${MINGW_PACKAGE_PREFIX}-python${_pybasever}"
            "${MINGW_PACKAGE_PREFIX}-python2<2.7.16-7")
  replaces=("${MINGW_PACKAGE_PREFIX}-python3"
            "${MINGW_PACKAGE_PREFIX}-python${_pybasever}")
else
  pkgbase="mingw-w64-${_realname}${_pybasever}"
  pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}${_pybasever}")
fi
pkgver=${_pybasever}.12
pkgrel=1
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('spdx:PSF-2.0')
url="https://www.python.org/"
msys2_references=(
  "cpe: cpe:/a:python:python"
  "cpe: cpe:/a:python_software_foundation:python"
)
depends=("${MINGW_PACKAGE_PREFIX}-cc-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}-sqlite3"
         "${MINGW_PACKAGE_PREFIX}-tcl"
         "${MINGW_PACKAGE_PREFIX}-tk"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-xz"
         "${MINGW_PACKAGE_PREFIX}-tzdata")
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-cc"
  "${MINGW_PACKAGE_PREFIX}-autotools"
  "autoconf-archive"
)
#options=('debug' '!strip')
source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz"
        "EXTERNALLY-MANAGED"
        0001-sysconfig-make-_sysconfigdata.py-relocatable.patch
        0002-build-add-with-nt-threads-and-make-it-default-on-min.patch
        0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch
        0004-configure-add-MACHDEP-and-platform-on-MINGW.patch
        0005-Add-default-configuration-for-MINGW.patch
        0006-configure-enable-largefile-support-by-default-for-Mi.patch
        0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch
        0008-posixmodule.c-Define-necessary-headers-for-compiling.patch
        0009-Build-winreg-by-default-when-compiling-for-MINGW.patch
        0010-pyport.h-Add-support-for-MINGW.patch
        0011-configure-add-options-so-that-shared-build-is-possib.patch
        0012-Add-dynamic-loading-support-for-MINGW.patch
        0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch
        0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch
        0015-Enable-some-windows-specific-modules.patch
        0016-sysconfig-MINGW-build-extensions-with-GCC.patch
        0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch
        0018-Add-support-for-stdcall-without-underscore.patch
        0019-Customize-site-for-MINGW.patch
        0020-add-python-config-sh.patch
        0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch
        0022-msys-cygwin-semi-native-build-sysconfig.patch
        0023-sysconfig-mingw-sysconfig-like-posix.patch
        0024-mingw-use-backslashes-in-compileall-py.patch
        0025-mingw-pdcurses_ISPAD.patch
        0026-remove_path_max.default.patch
        0027-dont-link-with-gettext.patch
        0028-ctypes-python-dll.patch
        0029-gdbm-module-includes.patch
        0030-use-gnu_printf-in-format.patch
        0031-mingw-fix-ssl-dont-use-enum_certificates.patch
        0032-fix-using-dllhandle-and-winver-mingw.patch
        0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch
        0034-MINGW-link-with-additional-library.patch
        0035-install-msilib.patch
        0036-fix-signal-module-build.patch
        0037-build-build-winconsoleio-and-_testconsole.patch
        0038-expose-sem_unlink.patch
        0039-Use-cygpty-while-using-isatty.patch
        0040-build-link-win-resource-files-and-build-pythonw.patch
        0041-fix-isselectable.patch
        0042-configure.ac-fix-inet_pton-check.patch
        0043-pass-gen-profile-ldflags.patch
        0044-pkg-config-windows-must-link-ext-with-python-lib.patch
        0045-importlib-bootstrap-path-sep.patch
        0046-warnings-fixes.patch
        0047-fix-build-testinternalcapi.patch
        0048-clang-arm64.patch
        0049-configure.ac-set-MINGW-stack-reserve.patch
        0050-Don-t-use-os.pathsep-to-find-EOF.patch
        0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch
        0052-Change-the-get_platform-method-in-sysconfig.patch
        0053-build-Fix-ncursesw-include-lookup.patch
        0054-tests-fix-test_bytes.patch
        0055-time-fix-strftime-not-raising-for-invalid-year-value.patch
        0056-ctypes-find_library-c-should-return-None-with-ucrt.patch
        0057-build-Disable-checks-for-dlopen-dlfcn.patch
        0058-Fix-install-location-of-the-import-library.patch
        0059-build-Integrate-venvlauncher-build-installation-into.patch
        0060-configure.ac-set-_WIN32_WINNT-version.patch
        0061-configure.ac-don-t-check-for-clock_-functions.patch
        0062-expanduser-normpath-paths-coming-from-env-vars.patch
        0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch
        0064-Define-PY3_DLLNAME-to-fix-build.patch
        0065-_testconsole.c-Fix-casing-path-sep.patch
        0066-Return-consistent-architecture-markers-for-python-on.patch
        0067-handle-ncursesw-pkg-config-when-cross-compiling.patch
        0068-mingw_smoketests-fix-_UCRT-condition.patch
        0069-Modify-sys.winver-to-match-upstream.patch
        0070-Change-user-site-packages-path-to-include-the-enviro.patch
        0071-configure-Include-a-header-in-the-check-for-_beginth.patch
        0072-configure.ac-Default-to-without-c-locale-coercion-on.patch
        0073-Fix-failing-tests.patch
        0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch
        0075-def-VPATH-when-compiling-Python-sysmodule.c.patch
        0076-Make-_Py_CheckPython3-extern.patch
        0077-link-with-bcrypt.patch
        0078-correctly-find-native-python.patch
        0079-Add-extra-flags-for-_bootstrap_python.patch
        0080-posixmodule-undefine-HAVE_OPENDIR.patch
        0081-getpath.py-add-support-for-mingw.patch
        0082-Don-t-build-_posixsubprocess-on-Windows.patch
        0083-_ssl-link-with-ws2_32.patch
        0084-Always-normalize-path-in-abspath.patch
        0085-Include-winsock.h-when-checking-for-netdb-function.patch
        0086-include-_multiprocessing-semaphore.c-on-win32.patch
        0087-configure-build-mmap-module-on-win32.patch
        0088-venv-creation-fixes.patch
        0089-move-the-shutdown-function-where-winsock.h-is-includ.patch
        0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch
        0091-configure.ac-fix-building-some-test-modules.patch
        0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch
        0093-Always-convert-to-before-passing-though-pathcch-func.patch
        0094-Build-venvlauncher.exe-from-PC-launcher.c.patch
        0095-getpath.py-fix-dirname.patch
        0096-getpath-use-normpath-on-all-generated-paths.patch
        0097-pathconfig-normpath-sys.path-0.patch
        0098-smoketests-add-some-tests-for-sys-site-paths.patch
        0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch
        0100-Build-and-install-libpython3.dll.patch
        0101-Port-GetPythonImport-to-mingw.patch
        0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch
        0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch
        0104-Add-missing-library-for-multiprocessing-module.patch
        0105-selectmodule-add-support-for-MINGW.patch
        0106-readline-disable-on-MINGW.patch
        0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch
        0108-Add-lpython-version-while-linking-stdlib.patch
        0109-Enable-_uuid-on-MINGW.patch
        0110-Enable-curses-library-on-MINGW.patch
        0111-mingw_smoketests-disable-distutils-related-tests.patch
        0112-configure.ac-use-autoconf-2.69.patch
        0113-CI-clean-up-ignored-tests.patch
        0114-gcc-make-incompatible-pointer-types-as-warning.patch
        0115-test_makefile-normalize-path.patch
        0116-sysconfig.get_platform-use-consistent-naming.patch
        0117-Add-ucrt-to-version-string.patch
        0118-socketmodule-fix-captilization-of-headers.patch
        0119-mingw_smoketests-build-extension-in-a-venv.patch
        0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch
        0121-venv-install-batch-scripts.patch
        0122-winreg-patch-cleanup.patch)

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

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

 apply_patch_with_msg 0001-sysconfig-make-_sysconfigdata.py-relocatable.patch \
  0002-build-add-with-nt-threads-and-make-it-default-on-min.patch \
  0003-Define-MS_WINDOWS-and-others-when-compiling-with-MIN.patch \
  0004-configure-add-MACHDEP-and-platform-on-MINGW.patch \
  0005-Add-default-configuration-for-MINGW.patch \
  0006-configure-enable-largefile-support-by-default-for-Mi.patch \
  0007-Add-PC-to-CPPFLAGS-and-to-SRCDIRS-on-Mingw.patch \
  0008-posixmodule.c-Define-necessary-headers-for-compiling.patch \
  0009-Build-winreg-by-default-when-compiling-for-MINGW.patch \
  0010-pyport.h-Add-support-for-MINGW.patch \
  0011-configure-add-options-so-that-shared-build-is-possib.patch \
  0012-Add-dynamic-loading-support-for-MINGW.patch \
  0013-Ignore-main-program-for-frozen-scripts-on-MINGW.patch \
  0014-Detect-winsock2-and-setup-_socket-module-on-MINGW.patch \
  0015-Enable-some-windows-specific-modules.patch \
  0016-sysconfig-MINGW-build-extensions-with-GCC.patch \
  0017-sysconfig-treat-MINGW-builds-as-POSIX-builds.patch \
  0018-Add-support-for-stdcall-without-underscore.patch \
  0019-Customize-site-for-MINGW.patch \
  0020-add-python-config-sh.patch \
  0021-mingw-prefer-unix-sep-if-MSYSTEM-environment-variabl.patch \
  0022-msys-cygwin-semi-native-build-sysconfig.patch \
  0023-sysconfig-mingw-sysconfig-like-posix.patch \
  0024-mingw-use-backslashes-in-compileall-py.patch \
  0025-mingw-pdcurses_ISPAD.patch \
  0026-remove_path_max.default.patch \
  0027-dont-link-with-gettext.patch \
  0028-ctypes-python-dll.patch \
  0029-gdbm-module-includes.patch \
  0030-use-gnu_printf-in-format.patch \
  0031-mingw-fix-ssl-dont-use-enum_certificates.patch \
  0032-fix-using-dllhandle-and-winver-mingw.patch \
  0033-Add-AMD64-to-sys-config-so-msvccompiler-get_build_ve.patch \
  0034-MINGW-link-with-additional-library.patch \
  0035-install-msilib.patch \
  0036-fix-signal-module-build.patch \
  0037-build-build-winconsoleio-and-_testconsole.patch \
  0038-expose-sem_unlink.patch \
  0039-Use-cygpty-while-using-isatty.patch \
  0040-build-link-win-resource-files-and-build-pythonw.patch \
  0041-fix-isselectable.patch \
  0042-configure.ac-fix-inet_pton-check.patch \
  0043-pass-gen-profile-ldflags.patch \
  0044-pkg-config-windows-must-link-ext-with-python-lib.patch \
  0045-importlib-bootstrap-path-sep.patch \
  0046-warnings-fixes.patch \
  0047-fix-build-testinternalcapi.patch \
  0048-clang-arm64.patch \
  0049-configure.ac-set-MINGW-stack-reserve.patch \
  0050-Don-t-use-os.pathsep-to-find-EOF.patch \
  0051-Fix-extension-suffix-for-c-extensions-on-mingw.patch \
  0052-Change-the-get_platform-method-in-sysconfig.patch \
  0053-build-Fix-ncursesw-include-lookup.patch \
  0054-tests-fix-test_bytes.patch \
  0055-time-fix-strftime-not-raising-for-invalid-year-value.patch \
  0056-ctypes-find_library-c-should-return-None-with-ucrt.patch \
  0057-build-Disable-checks-for-dlopen-dlfcn.patch \
  0058-Fix-install-location-of-the-import-library.patch \
  0059-build-Integrate-venvlauncher-build-installation-into.patch \
  0060-configure.ac-set-_WIN32_WINNT-version.patch \
  0061-configure.ac-don-t-check-for-clock_-functions.patch \
  0062-expanduser-normpath-paths-coming-from-env-vars.patch \
  0063-CI-test-the-build-and-add-some-mingw-specific-tests.patch \
  0064-Define-PY3_DLLNAME-to-fix-build.patch \
  0065-_testconsole.c-Fix-casing-path-sep.patch \
  0066-Return-consistent-architecture-markers-for-python-on.patch \
  0067-handle-ncursesw-pkg-config-when-cross-compiling.patch \
  0068-mingw_smoketests-fix-_UCRT-condition.patch \
  0069-Modify-sys.winver-to-match-upstream.patch \
  0070-Change-user-site-packages-path-to-include-the-enviro.patch \
  0071-configure-Include-a-header-in-the-check-for-_beginth.patch \
  0072-configure.ac-Default-to-without-c-locale-coercion-on.patch \
  0073-Fix-failing-tests.patch \
  0074-Don-t-change-os.sep-with-an-empty-MSYSTEM-env-var-no.patch \
  0075-def-VPATH-when-compiling-Python-sysmodule.c.patch \
  0076-Make-_Py_CheckPython3-extern.patch \
  0077-link-with-bcrypt.patch \
  0078-correctly-find-native-python.patch \
  0079-Add-extra-flags-for-_bootstrap_python.patch \
  0080-posixmodule-undefine-HAVE_OPENDIR.patch \
  0081-getpath.py-add-support-for-mingw.patch \
  0082-Don-t-build-_posixsubprocess-on-Windows.patch \
  0083-_ssl-link-with-ws2_32.patch \
  0084-Always-normalize-path-in-abspath.patch \
  0085-Include-winsock.h-when-checking-for-netdb-function.patch \
  0086-include-_multiprocessing-semaphore.c-on-win32.patch \
  0087-configure-build-mmap-module-on-win32.patch \
  0088-venv-creation-fixes.patch \
  0089-move-the-shutdown-function-where-winsock.h-is-includ.patch \
  0090-configure.ac-set-BUILDEXEEXT-and-EXEEXT.patch \
  0091-configure.ac-fix-building-some-test-modules.patch \
  0092-Don-t-convert-sysconfig.get_config_var-VPATH-to-an-a.patch \
  0093-Always-convert-to-before-passing-though-pathcch-func.patch \
  0094-Build-venvlauncher.exe-from-PC-launcher.c.patch \
  0095-getpath.py-fix-dirname.patch \
  0096-getpath-use-normpath-on-all-generated-paths.patch \
  0097-pathconfig-normpath-sys.path-0.patch \
  0098-smoketests-add-some-tests-for-sys-site-paths.patch \
  0099-Search-DLLs-only-on-paths-added-using-add_dll_direct.patch \
  0100-Build-and-install-libpython3.dll.patch \
  0101-Port-GetPythonImport-to-mingw.patch \
  0102-LoadLibraryExW-make-sure-to-only-use-backslashes-for.patch \
  0103-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch \
  0104-Add-missing-library-for-multiprocessing-module.patch \
  0105-selectmodule-add-support-for-MINGW.patch \
  0106-readline-disable-on-MINGW.patch \
  0107-Add-libraries-to-fix-compile-of-ctypes-on-MINGW.patch \
  0108-Add-lpython-version-while-linking-stdlib.patch \
  0109-Enable-_uuid-on-MINGW.patch \
  0110-Enable-curses-library-on-MINGW.patch \
  0111-mingw_smoketests-disable-distutils-related-tests.patch \
  0112-configure.ac-use-autoconf-2.69.patch \
  0113-CI-clean-up-ignored-tests.patch \
  0114-gcc-make-incompatible-pointer-types-as-warning.patch \
  0115-test_makefile-normalize-path.patch \
  0116-sysconfig.get_platform-use-consistent-naming.patch \
  0117-Add-ucrt-to-version-string.patch \
  0118-socketmodule-fix-captilization-of-headers.patch \
  0119-mingw_smoketests-build-extension-in-a-venv.patch \
  0120-venvlauncher-try-looking-for-the-versioned-.exe-firs.patch \
  0121-venv-install-batch-scripts.patch \
  0122-winreg-patch-cleanup.patch
 
  autoreconf -vfi
}

build() {
  declare -a _extra_config
  if check_option "debug" "n"; then
    _extra_config+=("--enable-optimizations")
    # Upstream defaults to -O3, so we can do too
    CFLAGS+=" -O3"
    # FIXME: https://github.com/msys2-contrib/cpython-mingw/issues/10
    if [[ $MINGW_PACKAGE_PREFIX == *-clang-* ]]; then
      _extra_config+=("--with-lto=full")
    fi
  else
    CFLAGS+=" -O0 -ggdb"
    CXXFLAGS+=" -O0 -ggdb"
    _extra_config+=("--with-pydebug")
  fi

  case "${CARCH}" in
    i686)
      LDFLAGS+=" -Wl,--large-address-aware"
    ;;
  esac

  mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"

  ../Python-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --build=${MINGW_CHOST} \
    --enable-shared \
    --with-system-expat \
    --with-system-ffi \
    --with-system-libmpdec \
    --without-ensurepip \
    --enable-loadable-sqlite-extensions \
    --with-tzpath=${MINGW_PREFIX}/share/zoneinfo \
    "${_extra_config[@]}"

  make
}

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

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

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

  make -j1 install DESTDIR="${pkgdir}"

  # 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
  if [[ "${_primary_python}" == "yes" ]]; then
    [[ -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
  fi

  # 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/

  # License
  install -Dm644 "${srcdir}/Python-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}${_pybasever}/LICENSE"

  # PEP668
  install -Dm644 "${srcdir}/EXTERNALLY-MANAGED" -t "${pkgdir}${MINGW_PREFIX}/lib/python${_pybasever}/"

  # fixup shebangs
  for fscripts in 2to3 2to3-${_pybasever} idle3 idle${_pybasever} pydoc3 pydoc${_pybasever}; do
    sed -e '1 { s|^#!.*$|#!/usr/bin/env python'"${_pybasever}"'.exe| }' -i "${pkgdir}${MINGW_PREFIX}"/bin/${fscripts}
  done

  # default aliases for all scripts/binaries
  if [[ "${_primary_python}" == "yes" ]]; then
    # Default names are aliases for Python now
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3.exe "${pkgdir}${MINGW_PREFIX}"/bin/python.exe
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3w.exe "${pkgdir}${MINGW_PREFIX}"/bin/pythonw.exe
    cp "${pkgdir}${MINGW_PREFIX}"/bin/python3-config "${pkgdir}${MINGW_PREFIX}"/bin/python-config
    cp "${pkgdir}${MINGW_PREFIX}"/bin/idle3 "${pkgdir}${MINGW_PREFIX}"/bin/idle
    cp "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3 "${pkgdir}${MINGW_PREFIX}"/bin/pydoc
  fi

  # delete anything that could conflict with the primary Python
  if [[ "${_primary_python}" != "yes" ]]; then
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3.exe
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3w.exe
    rm "${pkgdir}${MINGW_PREFIX}"/bin/python3-config
    rm "${pkgdir}${MINGW_PREFIX}"/bin/idle3
    rm "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3
    rm "${pkgdir}${MINGW_PREFIX}"/bin/2to3
    rm "${pkgdir}${MINGW_PREFIX}"/bin/libpython3.dll
    rm "${pkgdir}${MINGW_PREFIX}"/lib/libpython3.dll.a
    rm "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/python3-embed.pc
    rm "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/python3.pc
    rm "${pkgdir}${MINGW_PREFIX}"/share/man/man1/python3.1
  fi
}

sha256sums=('fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4'
            '3981fed74ee7d43ad69bd67e634e03d7bf6890558a87062380112e195688728a'
            '129e055903f8b68148b618a9c214cc4ee4efe798fe7421f7d595e1851d0b5e6a'
            'fb9cd23fd99dc59e97721265df226678790435f911a40bd2770e5692375ee854'
            '3274d63d220a465b862f5cca1b274fa9baa793baff5f6eb448ec5f5423662ee7'
            'e17f52c91fcba9ab72561f978fb20a9053d954feaa643dec9cc39772a96deccb'
            '9743fa9631dd227989a22ade48e2270e18de03c264f098610c0c9346ad63df67'
            'a3dc87819ba27f9c51a692862fa948e911eaa8ba540702b8e16506e8bb5f6deb'
            'c0384ad2de32c5d39bcd503bea9a55503ef0939c170ee655e5a6b7cbdd625e21'
            '3bdc199a76f5823b0ce623e1764a2f9ff0132d15ab603abb75582208fa6fb4f4'
            '75d9e8ebe36c40c32047edb80244260960c2cbc71e9fd53af8e7bfd2a0a76330'
            '83d54c63ab8125aff128a9ef649e3869dfc3ff12790a4e163804c366af57e43a'
            '57719613069763a9500a12ddbd159cfb169836e83390017ba939929bd3eeb800'
            '9e63a4b8e83c8fc1b7eaed2104b8c8e391d63022a958cec909f9119517e9702f'
            'e306e21b2dd505d4ef672cb77ee21ef8d1fd3ee40b7b7cfafea646dbe5f6753a'
            '7cd234874590d3ec4cdb7b7890e1221eedc0113509d5565106b2e67d4422a6fe'
            'c370e8d0977ce2c1976fd59373a1edf66e2e530d195d0e21b3e7ca65abfe1045'
            'cc806e4aa326838c8ee5f2d181e2a23f14c8b4d2a4ddf2f15a67189dd3040ee4'
            '1c5ca50061fa2b011c42c0abbbe7f7c83be66dc878ff86165693ac190df452b0'
            'ce1160382eca84194b880bc6a71b97b9199a2439fe159bf2defc8b525ad6a8e4'
            'b80eb4e7da6f77909f2ee39acb7ed275ac93083d0fbec7e8fcd3d06357d22115'
            '350a6d5a5890b7f5d00fd8ae013102d0421c4dee7990516486d16f9b37bcbd14'
            'dbea41894cc371fcd37bd3f9e53a2fe0da678d22646affbe4ef5e33b30d81041'
            'fd3335f2cabc6a98d31305882d812100557277405f47a2b1531c9d16898061ca'
            'aeb49017fd70e311c9bd2dad145de641460999bb4a43089ec6e2c5fb43d59242'
            '70e080bd41007d63b8e026d38181a4f840b18f8a0a65b6b41fcd764e5859d7f8'
            'def26a34f58d0094cd7f5982766f83c9449f12356bb00fc18f74628633685d83'
            '8f855744cb0acda024a321aac178266f5f7213f3d419566417a495684a305a14'
            '791f89de00195d01cce6cdc02b03ec22e3e1be5fe882007bb90155ed82944f4b'
            '313a9690f8048dc3839f46beb700bc4b8bd5601b2083d30de5f3909dd2edc756'
            '2311c9fe4b63d73016595d87720f3bee5161a3b62e3d43f540d620a8f94266c7'
            'f1dfd4bc5e9757a25c9155e501853c0c5b50c810df5e555ff2a50763f189953b'
            'ffec02d0479365a0c06948a57f7c367c8b1bf30f064b835e21b2dcf5ca16a8f1'
            '539df9eb2bbcd8da2b954b6ef965e8a10d187189b3905f183d3f0e8ff53a74e8'
            '686c83deab49bc86475b72c77b180d9e3636fb671808bc17542c068948f04260'
            '3f5a2fc54ef1e69951465046161f09694838eb792607ab14a4fed7adf0beab9c'
            '9cef2f0f336326ad8cbc1fe31ef6e213590807a691ab0e62922838f2a8c0a55a'
            '98addafc878dd86f8e63c1a26b480bee094bacbe5f63ceb8d3890e2937862d3f'
            '581d6ea893efc86222b9e5195de7bd2d7e36ba5171ea5c8082489299b1272abc'
            'b90444b250f11187abb17b3ca220e1d2cccc7cc0feb8a245b3e5d18eb3b5c4e5'
            'd27d3c46505873b19073cb9b27e6210557b8d29e2a74a38fb47f32c2fe270bd7'
            '17fbfd64c7d9204cf4d502e28c2b8a462d3222fd1aa2c3f96645bbd9f13f9dca'
            '731656e9361c5972128dfc3f0404761f790f968c3978771db23f968c3cde1750'
            '01d7fb4e2553fff9126bf366c41055f8b09e0e2ab3435ea9a0ac4a8a90854f00'
            'f53b9e2896c599265db1947299f40fbd7ac5937a11c8e6fffb2455f64425f1a5'
            '5f9640658a9cd18e3818a0ed074e008a5ea2ed772fe777151bc1334de90662fe'
            '55f67c443cfeebc245cb01091d9c10e2425cb2a76ecded123908e49a3a75804c'
            '41d7defdb4a4f9b0b0e14b4797ba338e974ad4d6da983cb91c375129f96e08e9'
            '2f40805ab4e2c0b7132f66c801a182988c2ce17cc33c4f72cf15aabf6eaac175'
            '49c78dc9996ff9156be4aa7afcba8320c9e61b02bfed8fe09c8deb679c697068'
            'de1b297b62c1212b937e98890f7c7d9e867d92a1cb12666f26c1a85a79c76290'
            '78b48f10fdd2de058ab36ba3df7cdf9e1acddbc0d07d315f4235fcdc9a486fb3'
            '061d24d934dbc102a7f0ab24884d1f579c13d061d7aac471a9890fad96bf9c2a'
            '130523daa59dc26da58f8fecb484356dae6f9f7addb0f1924ec2d649ceb116e4'
            '493af2753fe143209aa718cb3d49d4a3c6d3678bfa9fea251cf289f7e4f0459d'
            '18a7ba77a0ba1a2d5fb35006c35579964bc5e4797d24589de567bd48401d1549'
            'bb17b2e81e134b1fc573a54c41e60294280f5779577a89863b3e916efe421407'
            '36462b169d91cd8ec917e05f853d33cca1c92db39bade3e9e46d8ad9601cbdb8'
            'e141ee305658e4a9968294fd87822ecc0ae165fd794bad95096ba088f3f3c188'
            'd5928c14cf7f687b88f42254227d40db160eadcdcb9b04abf368d9a47af87636'
            '6868582d1b9b8019669dc61e1f0b7aa13d8469955cedad74dd035ce037c91e94'
            'e218cfad8a4123b659ba29fc6f839ac730dd5a71b595d3863d015152292687de'
            'ecf20781e452c814a260e61af87cc700738227fed6c5fa448051e4eecb77b02d'
            'feedcd2d507017f2fffcd2ae55271c49abc788b1b4f1e054f81709a989c068ee'
            'dffb20582fa0f561ba9ee139b25a83e0589e61725cc2b0e08f1cc8ddbebfef91'
            '19e54640d63f4f0f0fc50ff69455f4fc4cc9b983db2bf5fc94a4c4d6ed11a97d'
            '93658ca4892c2db353bab2c1335eab69b0d45b581d9be82b7880d6081ccabbdc'
            '2a63b0dfeb18acfbb542aa3896b38d98efa4c0de1d60e79c5c2879e8d49d6873'
            'ca394b04bdac0dc60a1ade43a2b584e4b9318067ec124c1f4222ff511a214f29'
            'f060a590ce1b25f7d82dffd7c2d27d6b20296781450da1642f456e92a6a89e3f'
            'e16c43d1b6703a8e7487b8e016be8b11df3e632e7689fa685084754eef539f8b'
            '0ead1872c0e0892f05d8ecfa4af457375be3dc72571becdb692414df1985d90e'
            '743c1eb3912e170497fa2a047aa68663a7dd00b2f9cb9b41aef28a9a27d83839'
            '40a279bd874c582c1ebc6dfc71d218178de1bcb143fc5b40246eda6728e1790b'
            '93bf3b5fe25af7e7e633855d9f42ea90e4219fb4a0629b067681ac471a26d11f'
            '9fb34396823ab60819456e3430ea15774f8bdfd845a9eeb041f27dea4bc2cdce'
            'adac1cd444eccebab7d49ad8726d0b51bd1a4d60ee19dd64df24296f1cb684df'
            '7fabbdbb1ece2d8cdd07c26c54d983046d43b36862bd05304f15974c1b5c33df'
            '5e362bb336a3a30dae2efe08f7020604455a1f1a389117b2120392687325b317'
            'd5481a772a2dd6c3db75d46e06491e62023f079c92011e8e98fc46883bee366b'
            '56de010c7b70a16643af21cecd9d16dd22164c36f75dc8313841f38ffd43d5d7'
            'c2457ec1a6d3840e0e8ede6906019ac685265505284a999e40ac7d32a446da4a'
            'f7e590d6a3a44a12188e21eae67b4ff636bbc8c933ef9fb1926be7e4f5425ff0'
            '60e5b579033463bf864fe539798c2a5182ee7159200c89cf9dede4a9309afb7c'
            '64c9d8c2c9d7248b44efbb5df259f80b6c1d7be69708ab48b6a9f8bacf17f962'
            '64b2c091d36779c2ab6d58b2fce0f3cf5cde1e8d45a03f946f845b3a38cef366'
            '12797782406b293613f73356c27c7007c33c81c653bdf24f10981562ad63c8e3'
            'df7296c5d2fe3699467963d69e3811c813fb0eec17eeb4a27dd4bc09da02c2f2'
            '606c3713b5e506e32d8373b6d6351b2b72341cd8ca232b4d95cdcf41152aca3b'
            'c634e36d6a998e17ecf411a750de69958d4149477b085c8e98ebebfc6d015e17'
            '48ea3654a79f0b8756907dc657c82c0220fa2a1db663377b2cdb814ce80cb09c'
            '9f677bac7da7bee2c85917d2581f9fb66166c2c62b70c38b5c6241f966d4849b'
            '49e646ec15a44da1293a7f31c52e03a8c363313706c6b3b16a9489b68698424f'
            'fa1557c21bd8a0944cd35fd12eb9335aa2d40d150edc1573f9eb7135d51d6845'
            '9d6dbcc6524fdee59e9d7da6c64ccf2ccd5a48f5c67ea4f1865930af51c4a793'
            '2caa194d29a9a4d96015dede8526cfc27d3482307a5b02eb9adb672145a985de'
            '4600dab4ca2739d65ee6e09b1d611a1825f0b28fe35c61bf7cd8c0fde2c1f9b2'
            '1ada4919e1f4d100ef76f52d20b64f44799b9c1cdf2e9173c169261ed28f8407'
            '70b0ae4e680348c92a2b2a34cbe6dd20819f31be4f1e0ef76948191926b6f64f'
            '28d86984c7c3b7c190a5ff6d5ec176fa0e2e377093d35d90c44421cd7ad97a8c'
            'd0c815699b211f5bb2590845c391888277557aa22bbfc50ccf4cb9649020255b'
            '7e72b5067b5f3d540a0df5d39fb9b5b5f6074063a27a56971204b348042201da'
            '8d1d03bb78283830e689911036d390f84c31e291b4470884343194765104e28e'
            '18ae3a2c93f238a7dc57d3696d2af7c2c604f9e87b4d3af0307be31333418e53'
            '40a81558762e78f0b447ced4dca7c2a12a0921b683057e402d3306f74e45533c'
            'ced7db0fa9e2b5fca949a53c480cd91cce299ddf2e53aceafebd32334801d8a7'
            '12ac5e9185a0bbba390be939712118b770836dae48e7566b980427f0cde7398c'
            '843e0f0a788c9ccf43b9dd919e0f193f5575bc44182dcf8fcf4c08cd374dc17c'
            '673a49a970c5ea9f06285115647f9b329806732effaf671d9247db214c68fde7'
            '9f8d753ff92eb9e85c98a736c2d2b352ce57663cc29f12c4e009f00185ed9d44'
            'cec6d88cc7d8a05245808c177a8e2fd2980c18f4afd7804b0f9af69f938524fd'
            'a01811790c1b5baf5883b00782b8173139cc6c05f8dcfc0c3231a2af4aafe99f'
            '52edace7e4842e6a0f084acd07a50bc625f9910acb2d33d5c71a32c01b58310b'
            '1c9befee6d646288493d7ebab75fce45fff76d8aeac3cee3b0bbde9b9318ff6c'
            '15fb7fa6662e3ac07ceb5786dbff4c9763183b79cb4fa44a671c9aa09577e37c'
            'ec2b8a9a42433c05a1ccec3b05fd32e978ec56ea54829fbd8462de77dece599e'
            '5f0380d944501089133df335d5728efe2775de861dcdc97439a41c240ef8a2c4'
            '0e5a5aab9f743679588dfcbbf322699d8d664c2064fe321df59fc410d73ca5c6'
            '4971c88014689b8514414f59806f91fe8c87beffa25669c0e0c6e5263bc75a2c'
            'd44edea30bd4b25a7d0fe226156ae9c286e5c314314300648e7c81e54dead7a5'
            '917e340bc3d3232c5ba67a5c120cafb82e3b0846b8034bd6f20ba8ac1fabcaa9'
            '71881714a0aa769e2aacc9cae0c7abc754e31379aa72f8d1beecaea90d0dab00'
            'bfc9aab840da24138f2c975b7b36e8f1eb42e538ee27062611cddc15712c6174'
            '76608e9472c44db2ac36b5918a03b83fd870fb70931419e9012c2e9d7dbe229d')
