diff --git a/AUTHORS b/AUTHORS index bde29b4ec2445..3df78225cce76 100644 --- a/AUTHORS +++ b/AUTHORS @@ -180,4 +180,5 @@ a license to everyone to use it as detailed in LICENSE.) * Matt McCormick * Thaddée Tyl * Philipp Wiesemann +* Jan Jongboom (copyright owned by Telenor Digital AS) diff --git a/ChangeLog.markdown b/ChangeLog.markdown index 60640b7435309..d995034b7a126 100644 --- a/ChangeLog.markdown +++ b/ChangeLog.markdown @@ -10,41 +10,223 @@ Not all changes are documented here. In particular, new features, user-oriented Current trunk code ------------------ - To see a list of commits in the active development branch 'incoming', which have not yet been packaged in a release, see - - Emscripten: https://github.com/kripken/emscripten/compare/1.27.1...incoming - - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.27.1...incoming - - Emscripten-Clang: https://github.com/kripken/emscripten-fastcomp-clang/compare/1.27.1...incoming + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.12...incoming + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.12...incoming + - Emscripten-Clang: https://github.com/kripken/emscripten-fastcomp-clang/compare/1.29.12...incoming -v1.29.1: 01/07/2015 +v1.29.12: 3/15/2015 +------------------- + - Fix a bug where SDL_malloc and SDL_free were not available. (#3247) + - Fix various issues with emrun usage. (#3234) + - Fixed a off-by-one memory access in native optimizer. + - Improve emterpreter support. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.11...1.29.12 + - Emscripten-LLVM: no changes. + - Emscripten-Clang: no changes. + +v1.29.11: 3/11/2015 +------------------- + - Remove the requirement to pass -s PRECISE_F32=1 manually when building with SIMD support. + - Fix a temp directory leak that could leave behind empty directories in the temp directory after build (#706) + - Improve support for growable Emscripten heap in asm.js mode. + - Added a warning message when generating huge asset bundles with file packager. + - Fixed a bug where emscripten_get_gamepad_status might throw a JS exception if called after a gamepad was disconnected. + - Improve emterpreter sleep support. + - Optimize code generation when multiple consecutive bitshifts are present. + - Optimize redundant stack save and restores, and memcpy/memsets. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.10...1.29.11 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.10...1.29.11 + - Emscripten-Clang: no changes. + +v1.29.10: 2/19/2015 +------------------- + - Add a warning message when generating code that has a very large number of variables, which optimization flags could remove. + - Improve support for SIMD casts and special loads. + - Fix the process return code when using EMCONFIGURE_JS=1. + - Improved the error message in abort(). + - Fix main loop handling during emterpreter sync save/load. + - Handle emscripten_async_call and friends during sleep, by pausing all safeSet*() operations. + - Add support for Google WTF when building with --tracing. + - Improve emterpreter stability with fuzzing. + - Add an option to load the memory initializer file from a typed array (#3187) + - Remove linker warning message when linking to -lm, since Emscripten includes musl that implements the math libraries built-in. + - Add support for SDL_WM_SetCaption(), which calls to Module['setWindowTitle'], or if not present, sets the web page title. (#3192) + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.9...1.29.10 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.9...1.29.10 + - Emscripten-Clang: no changes. + +v1.29.9: 2/9/2015 +------------------- + - Documented FORCE_ALIGNED_MEMORY to be no longer supported. + - Fixes issues with native optimizer handling of "if () else {}" statements. (#3129) + - Improved cross-browser support for EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST. (#3165) + - Added new linker option --profiling-funcs, which generates output that is otherwise minified, except that function names are kept intact, for use in profilers and getting descriptive call stacks. + - The Module object is no longer written in global scope. (#3167) + - Added new emscripten_idb_* API. (#3169) + - Added new function emscripten_wget_data(). + - Add support for GL_RED with GLES3/WebGL2. (#3176) + - Added basic WebVR support. (#3177) + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.8...1.29.9 + - Emscripten-LLVM: no changes. + - Emscripten-Clang: no changes. + +v1.29.8: 1/31/2015 +------------------- + - Fix a temp file leak with emterpreter. (#3156) + - Fix a typo that broke glBlitFramebuffer. (#3159) + - Added scandir() and alphasort() from musl. (#3161) + - Add a warning if multiple .a files with same basename are being linked together. (#2619) + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.7...1.29.8 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.7...1.29.8 + - Emscripten-Clang: no changes. + +v1.29.7: 1/28/2015 +------------------- + - Fixed an issue with backwards compatibility in emscripten-ports. (#3144) + - Warn on duplicate entries in archives. (#2619) + - Removed the MAX_SETJMPS limitation to improve setjmp/longjpmp support. (#3151) + - Improve the native optimizer to not emit empty if clauses in some cases. (#3154) + - Optimize Math.clz32, Math.min, NaN, and inf handling in asm.js. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.6...1.29.7 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.6...1.29.7 + - Emscripten-Clang: no changes. + +v1.29.6: 1/23/2015 +------------------- + - Fixed an issue where calling glGen*() when the GL context was lost might throw a JS exception, instead a GL_INVALID_OPERATION is now recorded. + - Improve label handling in native optimizer. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.5...1.29.6 + - Emscripten-LLVM: no changes. + - Emscripten-Clang: no changes. + +v1.29.5: 1/23/2015 +------------------- + - Enable compiling source files with the extension ".c++". + - Enable versioning of the emscripten ports so that older Emscripten versions can keep using older versions of the ports (#3144) + - Added a whitelist option to emterpreter, a linker flag of form -s EMTERPRETIFY_WHITELIST=["symbol1","symbol2"]. (#3129) + - Improved emscripten_get_pointerlock_status() to always fill the output structure even when pointer lock is not supported. + - Added an environment variable EMCC_NO_OPT_SORT=0/1 option to configure whether the generated output should have the functions sorted by length, useful for debugging. + - Added new tool tools/merge_pair.py which allows bisecting differences between two output files to find discrepancies. + - Improved parsing in cashew. + - Improved output message from emconfigure and emmake when inputs are unexpected. + - Added built-in asm handler for LLVM fabs operation. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.4...1.29.5 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.4...1.29.5 + - Emscripten-Clang: no changes. + +v1.29.4: 1/21/2015 +------------------- + - Added new C <-> JS string marshalling functions asciiToString(), stringToAscii(), UTF8ToString(), stringToUTF8() that can be used to copy strings across the JS and C boundaries. (#2363) + - Added new functions lengthBytesUTF8(), lengthBytesUTF16() and lengthBytesUTF32() to allow computing the byte lengths of strings in different encodings. (#2363) + - Upgraded SDL2 port to version 4. + - Add support for saving the emterpreter stack when there are functions returning a value on the stack (#3129) + - Notice async state in emterpreter trampolines (#3129) + - Optimize SDL1 pixel copying to the screen. + - Fixed an issue with emterpreter parsing. (#3141) + - Fixed an issue with native optimizer and -s PPRECISE_F32=1. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.3...1.29.4 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.3...1.29.4 + - Emscripten-Clang: no changes. + +v1.29.3: 1/16/2015 +------------------- + - Fixed a bug with OpenGL context initialization enableExtensionsByDefault. (#3135) + - Fixed an issue with nested if parsing in native optimizer. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.2...1.29.3 + - Emscripten-LLVM: no changes. + - Emscripten-Clang: no changes. + +v1.29.2: 1/16/2015 +------------------- + - Fixed an issue with embind compilation in LLVM 3.5. + - Fixed an issue with SDL audio queueing stability, which would queue audio too eagerly and cause stutter in some applications (#3122, #3124) + - Enabled native JS optimizer to be built automatically on Windows, requires VS2012 or VS2013. + - Improve error message to reflect the fact that DLOPEN_SUPPORT is currently not available (#2365) + - Improve SIMD load and store support. + - Upgraded SDL2 port to version 3. + - Fix a bug with native JS optimizer and braces in nested ifs. + - Improved emterpreter support. + - Fixed LLVM 3.5 to build with Visual Studio on Windows (emscripten-fastcomp #61) + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.1...1.29.2 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.1...1.29.2 + - Emscripten-Clang: no changes. + +v1.29.1: 1/7/2015 ------------------- - Migrated to upstream PNaCl LLVM+Clang 3.5 from the previous 3.4. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.29.0...1.29.1 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.29.0...1.29.1 + - Emscripten-Clang: https://github.com/kripken/emscripten-fastcomp-clang/compare/1.29.0...1.29.1 -v1.29.0: 01/07/2015 +v1.29.0: 1/7/2015 ------------------- + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.28.3...1.29.0 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.28.3...1.29.0 + - Emscripten-Clang: no changes. -v1.28.3: 01/04/2015 +v1.28.3: 1/4/2015 ------------------- - embuilder.py tool - Many fixes for native optimizer on Windows - Perform LLVM LTO in a separate invocation of opt, so that it does not mix with legalization and other stuff we do at link time + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.28.2...1.28.3 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.28.2...1.28.3 + - Emscripten-Clang: https://github.com/kripken/emscripten-fastcomp-clang/compare/1.28.2...1.28.3 v1.28.2: 12/17/2014 ------------------- - Enable native optimizer by default - Disable slow2asm legacy testing (asm.js mode in pre-fastcomp) + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.28.1...1.28.2 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.28.1...1.28.2 + - Emscripten-Clang: no changes. v1.28.1: 12/15/2014 ------------------- - Use a lot more MUSL math functions + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.28.0...1.28.1 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.28.0...1.28.1 + - Emscripten-Clang: no changes. v1.28.0: 12/12/2014 ------------------- + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.27.2...1.28.0 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.27.2...1.28.0 + - Emscripten-Clang: no changes. v1.27.2: 12/10/2014 ------------------- + - Added more complete support for SSE1 SIMD intrinsics API. (#2792) + - Fixed an issue with glTexImage2D on GL_LUMINANCE + GL_FLOAT textures. (#3039) + - Use the cashew asm.js parser in native optimizer. + - Fixed issues with IE when running closure minified pages. (#3012) + - Enabled asm.js validation for SIMD compilation. + - Full list of changes: + - Emscripten: https://github.com/kripken/emscripten/compare/1.27.1...1.27.2 + - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.27.1...1.27.2 + - Emscripten-Clang: no changes. v1.27.1: 11/20/2014 ------------------- - Migrated to upstream PNaCl LLVM+Clang 3.4 from the previous 3.3. + - Added a FindOpenGL.cmake to support find_package() for OpenGL in CMake scripts. - Full list of changes: - Emscripten: https://github.com/kripken/emscripten/compare/1.27.0...1.27.1 - Emscripten-LLVM: https://github.com/kripken/emscripten-fastcomp/compare/1.27.0...1.27.1 diff --git a/emcc b/emcc index 4caa122112ec2..18879774894b7 100755 --- a/emcc +++ b/emcc @@ -109,7 +109,8 @@ stderr = PIPE if not DEBUG else None # unless we are in DEBUG mode EMCC_CXX = '--emscripten-cxx' in sys.argv sys.argv = filter(lambda x: x != '--emscripten-cxx', sys.argv) -shared.check_sanity(force=DEBUG) +if len(sys.argv) <= 1 or ('--help' not in sys.argv and len(sys.argv) >= 2 and sys.argv[1] != '--version'): + shared.check_sanity(force=DEBUG) # Handle some global flags @@ -707,10 +708,6 @@ try: if opt_level == 0: debug_level = max(3, debug_level) if memory_init_file is None: memory_init_file = opt_level >= 2 - if llvm_lto is None and bind: - logging.debug('running lto for embind') # XXX this is a workaround for a pointer issue - llvm_lto = 1 - # TODO: support source maps with js_transform if js_transform and debug_level >= 4: logging.warning('disabling source maps because a js transform is being done') @@ -944,7 +941,8 @@ try: fastcomp_opts += ['-emscripten-asyncify-whitelist=' + ','.join(shared.Settings.ASYNCIFY_WHITELIST)] else: # non-fastcomp - logging.warning('Using old (non-fastcomp) compiler due to EMCC_FAST_COMPILER=0 in the env. This is dangerous, as there are known bugs, and this code path is no longer maintained. Please use emscripten in the default configuration (i.e., do not disable fastcomp)') + logging.critical('Non-fastcomp compiler is no longer available, please use fastcomp or an older version of emscripten') + sys.exit(1) if shared.Settings.ASM_JS: assert opt_level >= 1 or fastcomp, 'asm.js requires -O1 or above' @@ -978,10 +976,25 @@ try: shared.Settings.ASM_JS = 2 if shared.Settings.POINTER_MASKING: - logging.warning('POINTER_MASKING is experimental') - size = shared.Settings.POINTER_MASKING + 1 # size plus 1 should be a power of 2 - if size & (size-1) != 0: - raise Exception('POINTER_MASKING value must be a power of 2 minus 1') + if shared.Settings.ALLOW_MEMORY_GROWTH: + raise Exception('With POINTER_MASKING the ALLOW_MEMORY_GROWTH feature is not supported') + if not shared.Settings.POINTER_MASKING_DYNAMIC: + shared.Settings.POINTER_MASKING_DEFAULT_ENABLED = 1; + size = shared.Settings.TOTAL_MEMORY + if size & (size - 1) != 0: + raise Exception('With POINTER_MASKING the TOTAL_MEMORY must be a power of 2') + if shared.Settings.ASM_JS: + # Silently keep the total length a valid asm.js heap buffer length. + overflow = shared.Settings.POINTER_MASKING_OVERFLOW; + if overflow > 0: + if size <= 0x01000000: + shared.Settings.POINTER_MASKING_OVERFLOW = size; + else: + shared.Settings.POINTER_MASKING_OVERFLOW = (overflow + 0x00ffffff) & 0xff000000; + elif shared.Settings.POINTER_MASKING_DYNAMIC: + raise Exception('POINTER_MASKING_DYNAMIC requires POINTER_MASKING') + else: + shared.Settings.POINTER_MASKING_DEFAULT_ENABLED = 0 assert shared.LLVM_TARGET in shared.COMPILER_OPTS if shared.LLVM_TARGET == 'i386-pc-linux-gnu': @@ -1495,13 +1508,21 @@ try: js_optimizer_queue += [get_eliminate()] if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION: + # note that this happens before registerize/minification, which can obfuscate the name of 'label', which is tricky js_optimizer_queue += ['aggressiveVariableElimination'] js_optimizer_queue += ['simplifyExpressions'] - if shared.Settings.EMTERPRETIFY: # emterpreter code will not run through a JS optimizing JIT, do more work ourselves + if shared.Settings.EMTERPRETIFY: + # emterpreter code will not run through a JS optimizing JIT, do more work ourselves js_optimizer_queue += ['localCSE'] + if shared.Settings.EMTERPRETIFY: + # add explicit label setting, as we will run aggressiveVariableElimination late, *after* 'label' is no longer notable by name + js_optimizer_queue += ['safeLabelSetting'] + + if opt_level >= 1 and js_opts: + if opt_level >= 2: if shared.Settings.RELOOP and not shared.Settings.ASM_JS: js_optimizer_queue += ['optimizeShiftsAggressive', get_eliminate()] # aggressive shifts optimization requires loops, it breaks on switches @@ -1549,7 +1570,8 @@ try: else: js_optimizer_queue += ['registerize'] - if shared.Settings.POINTER_MASKING and shared.Settings.ASM_JS: js_optimizer_queue += ['pointerMasking'] + if shared.Settings.POINTER_MASKING: + js_optimizer_queue += ['pointerMasking'] if not shared.Settings.EMTERPRETIFY: do_minify() @@ -1590,6 +1612,7 @@ try: js_target = unsuffixed(target) + '.js' if shared.Settings.EMTERPRETIFY: + flush_js_optimizer_queue() logging.debug('emterpretifying') assert memory_init_file, 'emterpreter requires a mem init file' import json diff --git a/emrun b/emrun index ec296886ea1a0..7b4f6dea04a94 100755 --- a/emrun +++ b/emrun @@ -163,6 +163,7 @@ def unquote_u(source): # Returns whether the browser page we spawned is still running. # (note, not perfect atm, in case we are running in detached mode) def is_browser_process_alive(): + global browser_process return browser_process and browser_process.poll() == None # Kills browser_process and processname_killed_atexit. @@ -172,9 +173,11 @@ def kill_browser_process(): try: logv('Terminating browser process..') browser_process.kill() - except: - pass + except Exception, e: + logv('Failed with error ' + str(e) + '!') browser_process = None + processname_killed_atexit = '' + return if len(processname_killed_atexit) > 0: if emrun_options.android: logv("Terminating Android app '" + processname_killed_atexit + "'.") @@ -270,15 +273,17 @@ class HTTPWebServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): while self.is_running: now = tick() # Did user close browser? - if not emrun_options.serve_after_close and browser_process and browser_process.poll() != None: - if not have_received_messages: - emrun_options.serve_after_close = True - logv('Warning: emrun got detached from the target browser process. Cannot detect when user closes the browser. Behaving as if --serve_after_close was passed in.') - if not emrun_options.browser: - logv('Try passing the --browser=/path/to/browser option to avoid this from occurring. See https://github.com/kripken/emscripten/issues/3234 for more discussion.') - else: - self.shutdown() - logv('Browser process has quit. Shutting down web server.. Pass --serve_after_close to keep serving the page even after the browser closes.') + if browser_process: + browser_quit_code = browser_process.poll() + if not emrun_options.serve_after_close and browser_quit_code != None: + if not have_received_messages: + emrun_options.serve_after_close = True + logv('Warning: emrun got detached from the target browser process (the process quit with code ' + str(browser_quit_code) + '). Cannot detect when user closes the browser. Behaving as if --serve_after_close was passed in.') + if not emrun_options.browser: + logv('Try passing the --browser=/path/to/browser option to avoid this from occurring. See https://github.com/kripken/emscripten/issues/3234 for more discussion.') + else: + self.shutdown() + logv('Browser process has quit. Shutting down web server.. Pass --serve_after_close to keep serving the page even after the browser closes.') # Serve HTTP self.handle_request() @@ -356,6 +361,7 @@ class HTTPHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): self.send_header("Content-Length", str(fs[6])) self.send_header("Last-Modified", self.date_time_string(fs.st_mtime)) self.send_header('Cache-Control','no-cache, must-revalidate') + self.send_header('Connection','close') self.send_header('Expires','-1') self.end_headers() page_last_served_time = tick() @@ -424,6 +430,7 @@ class HTTPHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): self.send_response(200) self.send_header("Content-type", "text/plain") self.send_header('Cache-Control','no-cache, must-revalidate') + self.send_header('Connection','close') self.send_header('Expires','-1') self.end_headers() self.wfile.write('OK') @@ -1020,7 +1027,15 @@ def main(): browser = [ADB, 'shell', 'am', 'start', '-a', 'android.intent.action.VIEW', '-n', browser_app, '-d', url] processname_killed_atexit = browser_app[:browser_app.find('/')] else: #Launching a web page on local system. + if options.browser: + # Be resilient to quotes and whitespace + options.browser = options.browser.strip() + if (options.browser.startswith('"') and options.browser.endswith('"')) or (options.browser.startswith("'") and options.browser.endswith("'")): + options.browser = options.browser[1:-1].strip() browser = find_browser(str(options.browser)) + if not browser: + loge('Unable to find browser "' + str(options.browser) + '"! Check the correctness of the passed --browser=xxx parameter!') + return 1 browser_exe = browser[0] browser_args = [] @@ -1100,17 +1115,19 @@ def main(): if options.android: browser_process = None - if browser_process and browser_process.poll() == None: - options.serve_after_close = True - logv('Warning: emrun got detached from the target browser process. Cannot detect when user closes the browser. Behaving as if --serve_after_close was passed in.') - if not options.browser: - logv('Try passing the --browser=/path/to/browser option to avoid this from occurring. See https://github.com/kripken/emscripten/issues/3234 for more discussion.') + if browser_process: + premature_quit_code = browser_process.poll() + if premature_quit_code != None: + options.serve_after_close = True + logv('Warning: emrun got immediately detached from the target browser process (the process quit with exit code ' + str(premature_quit_code) + '). Cannot detect when user closes the browser. Behaving as if --serve_after_close was passed in.') + if not options.browser: + logv('Try passing the --browser=/path/to/browser option to avoid this from occurring. See https://github.com/kripken/emscripten/issues/3234 for more discussion.') if not options.no_server: try: httpd.serve_forever() except KeyboardInterrupt: - httpd.server_close() + pass httpd.server_close() logv('Closed web server.') diff --git a/emscripten-version.txt b/emscripten-version.txt index 3cbbdce235dcf..ee345b3bbea91 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1,2 +1,2 @@ -1.29.12 +1.30.0 diff --git a/emscripten.py b/emscripten.py index c3dc9ac163838..39f301b0acfb1 100755 --- a/emscripten.py +++ b/emscripten.py @@ -1102,7 +1102,8 @@ def make_emulated_param(i): 'withX', 'withY', 'withZ', 'withW', 'load', 'store', 'loadX', 'storeX', 'loadXY', 'storeXY', 'loadXYZ', 'storeXYZ'] simdfloatfuncs = simdfuncs + ['div', 'min', 'max', 'minNum', 'maxNum', 'sqrt', - 'abs', 'fromInt32x4', 'fromInt32x4Bits']; + 'abs', 'fromInt32x4', 'fromInt32x4Bits', + 'reciprocalApproximation', 'reciprocalSqrtApproximation']; simdintfuncs = simdfuncs + ['fromFloat32x4', 'fromFloat32x4Bits', 'shiftRightArithmeticByScalar', 'shiftRightLogicalByScalar', @@ -1267,7 +1268,11 @@ def math_fix(g): if settings['POINTER_MASKING']: for i in [0, 1, 2, 3]: - asm_global_vars += ' var MASK%d=%d;\n' % (i, (settings['TOTAL_MEMORY']-1) & (~((2**i)-1))); + if settings['POINTER_MASKING_DYNAMIC']: + asm_global_vars += ' const MASK%d=env' % i + access_quote('MASK%d' % i) + '|0;\n'; + basic_vars += ['MASK%d' %i] + else: + asm_global_vars += ' const MASK%d=%d;\n' % (i, (settings['TOTAL_MEMORY']-1) & (~((2**i)-1))); # sent data the_global = '{ ' + ', '.join(['"' + math_fix(s) + '": ' + s for s in fundamentals]) + ' }' @@ -1378,7 +1383,12 @@ def math_fix(g): buffer = newBuffer; return true; } -'''] + [''' +'''] + \ + ['' if not settings['POINTER_MASKING'] or settings['POINTER_MASKING_DYNAMIC'] else ''' +function _declare_heap_length() { + return HEAP8[%s] | 0; +} + ''' % (settings['TOTAL_MEMORY'] + settings['POINTER_MASKING_OVERFLOW'] - 1)] + [''' // EMSCRIPTEN_START_FUNCS function stackAlloc(size) { size = size|0; @@ -1528,6 +1538,9 @@ def fix(m): if os.environ.get('EMCC_FAST_COMPILER') != '0': emscript = emscript_fast +else: + logging.critical('Non-fastcomp compiler is no longer available, please use fastcomp or an older version of emscripten') + sys.exit(1) def main(args, compiler_engine, cache, jcache, relooper, temp_files, DEBUG, DEBUG_CACHE): # Prepare settings for serialization to JSON. diff --git a/site/source/docs/api_reference/Filesystem-API.rst b/site/source/docs/api_reference/Filesystem-API.rst index af2f29ad7541c..8b9767224c4d0 100644 --- a/site/source/docs/api_reference/Filesystem-API.rst +++ b/site/source/docs/api_reference/Filesystem-API.rst @@ -14,7 +14,7 @@ Emscripten predominantly compiles code that uses synchronous file I/O, so the ma File data in Emscripten is partitioned by mounted file systems. Several file systems are provided. An instance of :ref:`MEMFS ` is mounted to ``/`` by default. Instances of :ref:`NODEFS ` and :ref:`IDBFS ` can be mounted to other directories if your application needs to :ref:`persist data `. -The automatic tests in `tests/test_core.py `_ (search for ``test_files``) contain many examples of how to use this API. The :ref:`tutorial ` also shows how to pre-load a file so that it can be read from compiled C/C++. +The automatic tests in `tests/test_core.py `_ (search for ``test_files``) contain many examples of how to use this API. The :ref:`tutorial ` also shows how to pre-load a file so that it can be read from compiled C/C++. A high level overview of the way File Systems work in Emscripten-ported code is provided in the :ref:`file-system-overview`. @@ -87,7 +87,7 @@ The device node acts as an interface between the device and the file system. Any Registers the specified device driver with a set of callbacks. :param dev: The specific device driver id, created using :js:func:`makedev`. - :param object ops: The set of callbacks required by the device. For an example, see the `NODEFS default callbacks `_. + :param object ops: The set of callbacks required by the device. For an example, see the `NODEFS default callbacks `_. diff --git a/site/source/docs/api_reference/emscripten.h.rst b/site/source/docs/api_reference/emscripten.h.rst index 15ca9934e46bf..dff34a3adbd68 100644 --- a/site/source/docs/api_reference/emscripten.h.rst +++ b/site/source/docs/api_reference/emscripten.h.rst @@ -179,7 +179,7 @@ Functions The JavaScript environment will call that function at a specified number of frames per second. Setting 0 or a negative value as the ``fps`` will instead use the browser’s ``requestAnimationFrame`` mechanism to call the main loop function. This is **HIGHLY** recommended if you are doing rendering, as the browser’s ``requestAnimationFrame`` will make sure you render at a proper smooth rate that lines up properly with the the browser and monitor. If you do not render at all in your application, then you should pick a specific frame rate that makes sense for your code. - If ``simulate_infinite_loop`` is true, the function will throw an exception in order to stop execution of the caller. This will lead to the main loop being entered instead of code after the call to :c:func:`emscripten_set_main_loop` being run, which is the closest we can get to simulating an infinite loop (we do something similar in `glutMainLoop `_ in `GLUT `_). If this parameter is ``false``, then the behavior is the same as it was before this parameter was added to the API, which is that execution continues normally. Note that in both cases we do not run global destructors, ``atexit``, etc., since we know the main loop will still be running, but if we do not simulate an infinite loop then the stack will be unwound. That means that if ``simulate_infinite_loop`` is ``false``, and you created an object on the stack, it will be cleaned up before the main loop is called for the first time. + If ``simulate_infinite_loop`` is true, the function will throw an exception in order to stop execution of the caller. This will lead to the main loop being entered instead of code after the call to :c:func:`emscripten_set_main_loop` being run, which is the closest we can get to simulating an infinite loop (we do something similar in `glutMainLoop `_ in `GLUT `_). If this parameter is ``false``, then the behavior is the same as it was before this parameter was added to the API, which is that execution continues normally. Note that in both cases we do not run global destructors, ``atexit``, etc., since we know the main loop will still be running, but if we do not simulate an infinite loop then the stack will be unwound. That means that if ``simulate_infinite_loop`` is ``false``, and you created an object on the stack, it will be cleaned up before the main loop is called for the first time. .. tip:: There can be only *one* main loop function at a time. To change the main loop function, first :c:func:`cancel ` the current loop, and then call this function to set another. diff --git a/site/source/docs/api_reference/module.rst b/site/source/docs/api_reference/module.rst index 29bffc0fac6dd..00c9cee6d29a6 100644 --- a/site/source/docs/api_reference/module.rst +++ b/site/source/docs/api_reference/module.rst @@ -33,7 +33,7 @@ When generating only JavaScript (as opposed to HTML), no ``Module`` object is cr .. important:: If you run the :term:`Closure Compiler` on your code (which is optional, and can be done by ``--closure 1``), you will need quotation marks around the properties of ``Module`` as in the example above. In addition, you need to run closure on the compiled code together with the declaration of ``Module`` — this is done automatically for a ``-pre-js`` file. -When generating HTML, Emscripten creates a ``Module`` object with default methods (see `src/shell.html `_). In this case you should again use ``--pre-js``, but this time you add properties to the *existing* ``Module`` object, for example +When generating HTML, Emscripten creates a ``Module`` object with default methods (see `src/shell.html `_). In this case you should again use ``--pre-js``, but this time you add properties to the *existing* ``Module`` object, for example :: diff --git a/site/source/docs/compiling/Running-html-files-with-emrun.rst b/site/source/docs/compiling/Running-html-files-with-emrun.rst index 12353fb5aeb25..2005cce72017e 100644 --- a/site/source/docs/compiling/Running-html-files-with-emrun.rst +++ b/site/source/docs/compiling/Running-html-files-with-emrun.rst @@ -156,6 +156,10 @@ When running web pages via ``emrun`` using Firefox, you may want to set one or m ; Always run in private browsing mode to avoid caching any pages (but also disables IndexedDB persistency!). browser.privatebrowsing.autostart;true + ; When switching between multiple Firefox browser versions/channels, suppress showing the first time welcome page. + startup.homepage_override_url;about:blank + startup.homepage_welcome_url;about:blank + To set a Firefox browser pref, navigate to the page ``about:config`` in the browser navigation bar. Running web pages on an Android device diff --git a/site/source/docs/getting_started/FAQ.rst b/site/source/docs/getting_started/FAQ.rst index 2e6452f78ba34..c2e32d1f4968c 100644 --- a/site/source/docs/getting_started/FAQ.rst +++ b/site/source/docs/getting_started/FAQ.rst @@ -249,7 +249,7 @@ Why do functions in my C/C++ source code vanish when I compile to JavaScript, an Emscripten does dead code elimination of functions that are not called from the compiled code. While this does minimize code size, it can remove functions that you plan to call yourself (outside of the compiled code). -To make sure a C function remains available to be called from normal JavaScript, it must be added to the `EXPORTED_FUNCTIONS `_ using the *emcc* command line. For example, to prevent functions ``my_func()`` and ``main()`` from being removed/renamed, run *emcc* with: :: +To make sure a C function remains available to be called from normal JavaScript, it must be added to the `EXPORTED_FUNCTIONS `_ using the *emcc* command line. For example, to prevent functions ``my_func()`` and ``main()`` from being removed/renamed, run *emcc* with: :: ./emcc -s EXPORTED_FUNCTIONS="['_main', '_my_func']" ... diff --git a/site/source/docs/getting_started/test-suite.rst b/site/source/docs/getting_started/test-suite.rst index e57578c28675e..3f73253508935 100644 --- a/site/source/docs/getting_started/test-suite.rst +++ b/site/source/docs/getting_started/test-suite.rst @@ -69,7 +69,7 @@ You can also run a specific mode or test in a mode, or a specific test across al # Run one test in all modes. python tests/runner.py ALL.test_hello_world -The core test modes are documented at the end of `/tests/test_core.py `_. +The core test modes are documented at the end of `/tests/test_core.py `_. .. _emscripten-test-suite-modes: diff --git a/site/source/docs/optimizing/Optimizing-Code.rst b/site/source/docs/optimizing/Optimizing-Code.rst index ddaf836ac17e9..a2b2d0c96a962 100644 --- a/site/source/docs/optimizing/Optimizing-Code.rst +++ b/site/source/docs/optimizing/Optimizing-Code.rst @@ -37,7 +37,7 @@ In addition to the ``-Ox`` options, there are separate compiler options that can Advanced compiler settings ========================== -There are several flags you can :ref:`pass to the compiler ` to affect code generation, which will also affect performance — for example :ref:`DISABLE_EXCEPTION_CATCHING `. These are documented in `src/settings.js `_. Some of these will be directly affected by the optimization settings (you can find out which ones by searching for ``apply_opt_level`` in `tools/shared.py `_). +There are several flags you can :ref:`pass to the compiler ` to affect code generation, which will also affect performance — for example :ref:`DISABLE_EXCEPTION_CATCHING `. These are documented in `src/settings.js `_. Some of these will be directly affected by the optimization settings (you can find out which ones by searching for ``apply_opt_level`` in `tools/shared.py `_). A few useful flags are: diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index bbca9a5cfabe4..085c7974fabe1 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -464,12 +464,12 @@ for defining the binding: natural fit for the project and its build system. .. _library.js: https://github.com/kripken/emscripten/blob/master/src/library.js -.. _test_js_libraries: https://github.com/kripken/emscripten/blob/master/tests/test_core.py#L4800 +.. _test_js_libraries: https://github.com/kripken/emscripten/blob/1.29.12/tests/test_core.py#L5043 .. _src/deps_info.json: https://github.com/kripken/emscripten/blob/master/src/deps_info.json .. _tools/system_libs.py: https://github.com/kripken/emscripten/blob/master/tools/system_libs.py .. _library_\*.js: https://github.com/kripken/emscripten/tree/master/src -.. _test_add_function in tests/test_core.py: https://github.com/kripken/emscripten/blob/master/tests/test_core.py#L5904 +.. _test_add_function in tests/test_core.py: https://github.com/kripken/emscripten/blob/1.29.12/tests/test_core.py#L6237 .. _tests/core/test_utf.in: https://github.com/kripken/emscripten/blob/master/tests/core/test_utf.in -.. _tests/test_core.py: https://github.com/kripken/emscripten/blob/master/tests/test_core.py#L5704 +.. _tests/test_core.py: https://github.com/kripken/emscripten/blob/1.29.12/tests/test_core.py#L4597 .. _Box2D: https://github.com/kripken/box2d.js/#box2djs .. _Bullet: https://github.com/kripken/ammo.js/#ammojs diff --git a/site/source/docs/porting/files/Synchronous-Virtual-XHR-Backed-File-System-Usage.rst b/site/source/docs/porting/files/Synchronous-Virtual-XHR-Backed-File-System-Usage.rst index 7ee3e283bd14c..207de296c1530 100644 --- a/site/source/docs/porting/files/Synchronous-Virtual-XHR-Backed-File-System-Usage.rst +++ b/site/source/docs/porting/files/Synchronous-Virtual-XHR-Backed-File-System-Usage.rst @@ -16,7 +16,7 @@ The backend can improve start up time as the whole file system does not need to Test code ========= -An example of how to implement a synchronous virtual XHR backed file system is provided in the test code at `tests/test_browser.py `_ (see ``test_chunked_synchronous_xhr``). The test case also contains an HTTP server (see `test_chunked_synchronous_xhr_server `_) showing CORS headers that might need to be set (if the resources are hosted from the same domain Emscripten runs from, there is no issue). +An example of how to implement a synchronous virtual XHR backed file system is provided in the test code at `tests/test_browser.py `_ (see ``test_chunked_synchronous_xhr``). The test case also contains an HTTP server (see `test_chunked_synchronous_xhr_server `_) showing CORS headers that might need to be set (if the resources are hosted from the same domain Emscripten runs from, there is no issue). The tests use `checksummer.c `_ as the Emscripten-compiled program. This is simply a vanilla C program using synchronous *libc* file system calls like ``fopen()``, ``fread()``, ``fclose()`` etc. @@ -59,7 +59,7 @@ Instructions #. You will need a page that spawns the web worker. - The `test code `_ that does this is shown below: + The `test code `_ that does this is shown below: .. include:: ../../../../../tests/test_browser.py :literal: @@ -72,4 +72,4 @@ Instructions - \ No newline at end of file + diff --git a/site/source/docs/porting/guidelines/function_pointer_issues.rst b/site/source/docs/porting/guidelines/function_pointer_issues.rst index 940a45d64314c..23e51e57803a8 100644 --- a/site/source/docs/porting/guidelines/function_pointer_issues.rst +++ b/site/source/docs/porting/guidelines/function_pointer_issues.rst @@ -25,7 +25,7 @@ There are three general issues with function pointers: #. - When using optimisation :ref:`-O2 ` and above, comparing function pointers of different types can give false positives, and bugs with incorrect function pointers are potentially more misleading. To check if this is the cause of problems with your code, you can compile with `ALIASING_FUNCTION_POINTERS `_ unset (``-s ALIASING_FUNCTION_POINTERS=0``). + When using optimisation :ref:`-O2 ` and above, comparing function pointers of different types can give false positives, and bugs with incorrect function pointers are potentially more misleading. To check if this is the cause of problems with your code, you can compile with `ALIASING_FUNCTION_POINTERS `_ unset (``-s ALIASING_FUNCTION_POINTERS=0``). .. note:: In **asm.js**, function pointers are stored within a function-type specific table (as in the ``FUNCTION_TABLE_ii`` example from before). diff --git a/site/source/docs/porting/guidelines/portability_guidelines.rst b/site/source/docs/porting/guidelines/portability_guidelines.rst index 453fd65df69f5..185046c58bdf7 100644 --- a/site/source/docs/porting/guidelines/portability_guidelines.rst +++ b/site/source/docs/porting/guidelines/portability_guidelines.rst @@ -34,7 +34,7 @@ The following types of code will compile, but may not run as fast as expected: - 64-bit ``int`` variables. Mathematical operations (+, -, \*, /) are slow because they are emulated (bitwise operations are reasonably fast). JavaScript does not have a native 64-bit ``int`` type so this is unavoidable. -- C++ Exceptions. In JavaScript such code generally makes the JavaScript engine turn off various optimizations. For that reason exceptions are turned off by default in ``-O1`` and above. To re-enable them, run *emcc* with ``-s DISABLE_EXCEPTION_CATCHING=0`` (see `src/settings.js `_). +- C++ Exceptions. In JavaScript such code generally makes the JavaScript engine turn off various optimizations. For that reason exceptions are turned off by default in ``-O1`` and above. To re-enable them, run *emcc* with ``-s DISABLE_EXCEPTION_CATCHING=0`` (see `src/settings.js `_). - ``setjmp`` also prevents :term:`relooping` around it, forcing us to emulate control flow using a less efficient approach. diff --git a/src/ecmascript_simd.js b/src/ecmascript_simd.js index 75ec3c241abc7..280d53aecf542 100644 --- a/src/ecmascript_simd.js +++ b/src/ecmascript_simd.js @@ -18,6 +18,18 @@ 3. This notice may not be removed or altered from any source distribution. */ +// A conforming SIMD.js implementation may contain the following deviations to +// normal JS numeric behavior: +// - Subnormal numbers may or may not be flushed to zero on input or output of +// any SIMD operation. + +// Many of the operations in SIMD.js have semantics which correspond to scalar +// operations in JS, however there are a few differences: +// - The conversion of integers to booleans uses <0 rather than !=0. +// - Vector shifts don't mask the shift count. +// - Conversions from float to int32 throw on error. +// - Load and store operations throw when out of bounds. + if (typeof SIMD === "undefined") { // SIMD module. We don't use the var keyword here, so that we put the // SIMD object in the global scope even if this polyfill code is included @@ -91,6 +103,12 @@ _SIMD_PRIVATE.frombool = function(x) { return !x - 1; } +_SIMD_PRIVATE.int32FromFloat = function(x) { + if (x >= -0x80000000 && x <= 0x7fffffff) + return x|0; + throw new RangeError("Conversion from floating-point to integer failed"); +} + // Save/Restore utilities for implementing bitwise conversions. _SIMD_PRIVATE.saveFloat64x2 = function(x) { @@ -564,7 +582,10 @@ if (typeof SIMD.int32x4.fromFloat32x4 === "undefined") { */ SIMD.int32x4.fromFloat32x4 = function(t) { t = SIMD.float32x4.check(t); - return SIMD.int32x4(t.x, t.y, t.z, t.w); + return SIMD.int32x4(_SIMD_PRIVATE.int32FromFloat(t.x), + _SIMD_PRIVATE.int32FromFloat(t.y), + _SIMD_PRIVATE.int32FromFloat(t.z), + _SIMD_PRIVATE.int32FromFloat(t.w)); } } @@ -575,7 +596,10 @@ if (typeof SIMD.int32x4.fromFloat64x2 === "undefined") { */ SIMD.int32x4.fromFloat64x2 = function(t) { t = SIMD.float64x2.check(t); - return SIMD.int32x4(t.x, t.y, 0, 0); + return SIMD.int32x4(_SIMD_PRIVATE.int32FromFloat(t.x), + _SIMD_PRIVATE.int32FromFloat(t.y), + 0, + 0); } } @@ -1225,25 +1249,25 @@ if (typeof SIMD.float32x4.maxNum === "undefined") { } } -if (typeof SIMD.float32x4.reciprocal === "undefined") { +if (typeof SIMD.float32x4.reciprocalApproximation === "undefined") { /** * @param {float32x4} t An instance of float32x4. - * @return {float32x4} New instance of float32x4 with reciprocal value of - * t. + * @return {float32x4} New instance of float32x4 with an approximation of the + * reciprocal value of t. */ - SIMD.float32x4.reciprocal = function(t) { + SIMD.float32x4.reciprocalApproximation = function(t) { t = SIMD.float32x4.check(t); return SIMD.float32x4(1.0 / t.x, 1.0 / t.y, 1.0 / t.z, 1.0 / t.w); } } -if (typeof SIMD.float32x4.reciprocalSqrt === "undefined") { +if (typeof SIMD.float32x4.reciprocalSqrtApproximation === "undefined") { /** * @param {float32x4} t An instance of float32x4. - * @return {float32x4} New instance of float32x4 with square root of the - * reciprocal value of t. + * @return {float32x4} New instance of float32x4 with an approximation of the + * square root of the reciprocal value of t. */ - SIMD.float32x4.reciprocalSqrt = function(t) { + SIMD.float32x4.reciprocalSqrtApproximation = function(t) { t = SIMD.float32x4.check(t); return SIMD.float32x4(Math.sqrt(1.0 / t.x), Math.sqrt(1.0 / t.y), Math.sqrt(1.0 / t.z), Math.sqrt(1.0 / t.w)); @@ -1962,25 +1986,25 @@ if (typeof SIMD.float64x2.maxNum === "undefined") { } } -if (typeof SIMD.float64x2.reciprocal === "undefined") { +if (typeof SIMD.float64x2.reciprocalApproximation === "undefined") { /** * @param {float64x2} t An instance of float64x2. - * @return {float64x2} New instance of float64x2 with reciprocal value of - * t. + * @return {float64x2} New instance of float64x2 with an approximation of the + * reciprocal value of t. */ - SIMD.float64x2.reciprocal = function(t) { + SIMD.float64x2.reciprocalApproximation = function(t) { t = SIMD.float64x2.check(t); return SIMD.float64x2(1.0 / t.x, 1.0 / t.y); } } -if (typeof SIMD.float64x2.reciprocalSqrt === "undefined") { +if (typeof SIMD.float64x2.reciprocalSqrtApproximation === "undefined") { /** * @param {float64x2} t An instance of float64x2. - * @return {float64x2} New instance of float64x2 with square root of the - * reciprocal value of t. + * @return {float64x2} New instance of float64x2 with an approximation of the + * square root of the reciprocal value of t. */ - SIMD.float64x2.reciprocalSqrt = function(t) { + SIMD.float64x2.reciprocalSqrtApproximation = function(t) { t = SIMD.float64x2.check(t); return SIMD.float64x2(Math.sqrt(1.0 / t.x), Math.sqrt(1.0 / t.y)); } @@ -2173,8 +2197,10 @@ if (typeof SIMD.float64x2.select === "undefined") { t = SIMD.int32x4.check(t); trueValue = SIMD.float64x2.check(trueValue); falseValue = SIMD.float64x2.check(falseValue); + // We use t.z for the second element because t is an int32x4, because + // int64x2 isn't available. return SIMD.float64x2(_SIMD_PRIVATE.tobool(t.x) ? trueValue.x : falseValue.x, - _SIMD_PRIVATE.tobool(t.y) ? trueValue.y : falseValue.y); + _SIMD_PRIVATE.tobool(t.z) ? trueValue.y : falseValue.y); } } @@ -2666,6 +2692,8 @@ if (typeof SIMD.int32x4.shiftLeftByScalar === "undefined") { */ SIMD.int32x4.shiftLeftByScalar = function(a, bits) { a = SIMD.int32x4.check(a); + if (bits>>>0 >= 32) + return SIMD.int32x4.splat(0.0); var x = a.x << bits; var y = a.y << bits; var z = a.z << bits; @@ -2682,6 +2710,8 @@ if (typeof SIMD.int32x4.shiftRightLogicalByScalar === "undefined") { */ SIMD.int32x4.shiftRightLogicalByScalar = function(a, bits) { a = SIMD.int32x4.check(a); + if (bits>>>0 >= 32) + return SIMD.int32x4.splat(0.0); var x = a.x >>> bits; var y = a.y >>> bits; var z = a.z >>> bits; @@ -2698,6 +2728,8 @@ if (typeof SIMD.int32x4.shiftRightArithmeticByScalar === "undefined") { */ SIMD.int32x4.shiftRightArithmeticByScalar = function(a, bits) { a = SIMD.int32x4.check(a); + if (bits>>>0 >= 32) + bits = 31; var x = a.x >> bits; var y = a.y >> bits; var z = a.z >> bits; @@ -3046,6 +3078,77 @@ if (typeof SIMD.int16x8.mul === "undefined") { } } +if (typeof SIMD.int16x8.swizzle === "undefined") { + /** + * @param {int16x8} t An instance of int16x8 to be swizzled. + * @param {integer} s0 - Index in t for lane s0 + * @param {integer} s1 - Index in t for lane s1 + * @param {integer} s2 - Index in t for lane s2 + * @param {integer} s3 - Index in t for lane s3 + * @param {integer} s4 - Index in t for lane s4 + * @param {integer} s5 - Index in t for lane s5 + * @param {integer} s6 - Index in t for lane s6 + * @param {integer} s7 - Index in t for lane s7 + * @return {int16x8} New instance of int16x8 with lanes swizzled. + */ + SIMD.int16x8.swizzle = function(t, s0, s1, s2, s3, s4, s5, s6, s7) { + t = SIMD.int16x8.check(t); + var storage = _SIMD_PRIVATE._i16x8; + storage[0] = t.s0; + storage[1] = t.s1; + storage[2] = t.s2; + storage[3] = t.s3; + storage[4] = t.s4; + storage[5] = t.s5; + storage[6] = t.s6; + storage[7] = t.s7; + return SIMD.int16x8(storage[s0], storage[s1], storage[s2], storage[s3], + storage[s4], storage[s5], storage[s6], storage[s7]); + } +} + +if (typeof SIMD.int16x8.shuffle === "undefined") { + + _SIMD_PRIVATE._i16x16 = new Int16Array(16); + + /** + * @param {int16x8} t0 An instance of int16x8 to be shuffled. + * @param {int16x8} t1 An instance of int16x8 to be shuffled. + * @param {integer} s0 - Index in concatenation of t0 and t1 for lane s0 + * @param {integer} s1 - Index in concatenation of t0 and t1 for lane s1 + * @param {integer} s2 - Index in concatenation of t0 and t1 for lane s2 + * @param {integer} s3 - Index in concatenation of t0 and t1 for lane s3 + * @param {integer} s4 - Index in concatenation of t0 and t1 for lane s4 + * @param {integer} s5 - Index in concatenation of t0 and t1 for lane s5 + * @param {integer} s6 - Index in concatenation of t0 and t1 for lane s6 + * @param {integer} s7 - Index in concatenation of t0 and t1 for lane s7 + * @return {int16x8} New instance of int16x8 with lanes shuffled. + */ + SIMD.int16x8.shuffle = function(t0, t1, s0, s1, s2, s3, s4, s5, s6, s7) { + t0 = SIMD.int16x8.check(t0); + t1 = SIMD.int16x8.check(t1); + var storage = _SIMD_PRIVATE._i16x16; + storage[0] = t0.s0; + storage[1] = t0.s1; + storage[2] = t0.s2; + storage[3] = t0.s3; + storage[4] = t0.s4; + storage[5] = t0.s5; + storage[6] = t0.s6; + storage[7] = t0.s7; + storage[8] = t1.s0; + storage[9] = t1.s1; + storage[10] = t1.s2; + storage[11] = t1.s3; + storage[12] = t1.s4; + storage[13] = t1.s5; + storage[14] = t1.s6; + storage[15] = t1.s7; + return SIMD.int16x8(storage[s0], storage[s1], storage[s2], storage[s3], + storage[s4], storage[s5], storage[s6], storage[s7]); + } +} + if (typeof SIMD.int16x8.select === "undefined") { /** * @param {int16x8} t Selector mask. An instance of int16x8 @@ -3231,6 +3334,8 @@ if (typeof SIMD.int16x8.shiftLeftByScalar === "undefined") { */ SIMD.int16x8.shiftLeftByScalar = function(a, bits) { a = SIMD.int16x8.check(a); + if (bits>>>0 > 16) + bits = 16; var s0 = a.s0 << bits; var s1 = a.s1 << bits; var s2 = a.s2 << bits; @@ -3251,6 +3356,8 @@ if (typeof SIMD.int16x8.shiftRightLogicalByScalar === "undefined") { */ SIMD.int16x8.shiftRightLogicalByScalar = function(a, bits) { a = SIMD.int16x8.check(a); + if (bits>>>0 > 16) + bits = 16; var s0 = (a.s0 & 0xffff) >>> bits; var s1 = (a.s1 & 0xffff) >>> bits; var s2 = (a.s2 & 0xffff) >>> bits; @@ -3271,6 +3378,8 @@ if (typeof SIMD.int16x8.shiftRightArithmeticByScalar === "undefined") { */ SIMD.int16x8.shiftRightArithmeticByScalar = function(a, bits) { a = SIMD.int16x8.check(a); + if (bits>>>0 > 16) + bits = 16; var s0 = a.s0 >> bits; var s1 = a.s1 >> bits; var s2 = a.s2 >> bits; @@ -3472,6 +3581,123 @@ if (typeof SIMD.int8x16.mul === "undefined") { } } +if (typeof SIMD.int8x16.swizzle === "undefined") { + /** + * @param {int8x16} t An instance of int8x16 to be swizzled. + * @param {integer} s0 - Index in t for lane s0 + * @param {integer} s1 - Index in t for lane s1 + * @param {integer} s2 - Index in t for lane s2 + * @param {integer} s3 - Index in t for lane s3 + * @param {integer} s4 - Index in t for lane s4 + * @param {integer} s5 - Index in t for lane s5 + * @param {integer} s6 - Index in t for lane s6 + * @param {integer} s7 - Index in t for lane s7 + * @param {integer} s8 - Index in t for lane s8 + * @param {integer} s9 - Index in t for lane s9 + * @param {integer} s10 - Index in t for lane s10 + * @param {integer} s11 - Index in t for lane s11 + * @param {integer} s12 - Index in t for lane s12 + * @param {integer} s13 - Index in t for lane s13 + * @param {integer} s14 - Index in t for lane s14 + * @param {integer} s15 - Index in t for lane s15 + * @return {int8x16} New instance of int8x16 with lanes swizzled. + */ + SIMD.int8x16.swizzle = function(t, s0, s1, s2, s3, s4, s5, s6, s7, + s8, s9, s10, s11, s12, s13, s14, s15) { + t = SIMD.int8x16.check(t); + var storage = _SIMD_PRIVATE._i8x16; + storage[0] = t.s0; + storage[1] = t.s1; + storage[2] = t.s2; + storage[3] = t.s3; + storage[4] = t.s4; + storage[5] = t.s5; + storage[6] = t.s6; + storage[7] = t.s7; + storage[8] = t.s8; + storage[9] = t.s9; + storage[10] = t.s10; + storage[11] = t.s11; + storage[12] = t.s12; + storage[13] = t.s13; + storage[14] = t.s14; + storage[15] = t.s15; + return SIMD.int8x16(storage[s0], storage[s1], storage[s2], storage[s3], + storage[s4], storage[s5], storage[s6], storage[s7], + storage[s8], storage[s9], storage[s10], storage[s11], + storage[s12], storage[s13], storage[s14], storage[s15]); + } +} + +if (typeof SIMD.int8x16.shuffle === "undefined") { + + _SIMD_PRIVATE._i8x32 = new Int8Array(32); + + /** + * @param {int8x16} t0 An instance of int8x16 to be shuffled. + * @param {int8x16} t1 An instance of int8x16 to be shuffled. + * @param {integer} s0 - Index in concatenation of t0 and t1 for lane s0 + * @param {integer} s1 - Index in concatenation of t0 and t1 for lane s1 + * @param {integer} s2 - Index in concatenation of t0 and t1 for lane s2 + * @param {integer} s3 - Index in concatenation of t0 and t1 for lane s3 + * @param {integer} s4 - Index in concatenation of t0 and t1 for lane s4 + * @param {integer} s5 - Index in concatenation of t0 and t1 for lane s5 + * @param {integer} s6 - Index in concatenation of t0 and t1 for lane s6 + * @param {integer} s7 - Index in concatenation of t0 and t1 for lane s7 + * @param {integer} s8 - Index in concatenation of t0 and t1 for lane s8 + * @param {integer} s9 - Index in concatenation of t0 and t1 for lane s9 + * @param {integer} s10 - Index in concatenation of t0 and t1 for lane s10 + * @param {integer} s11 - Index in concatenation of t0 and t1 for lane s11 + * @param {integer} s12 - Index in concatenation of t0 and t1 for lane s12 + * @param {integer} s13 - Index in concatenation of t0 and t1 for lane s13 + * @param {integer} s14 - Index in concatenation of t0 and t1 for lane s14 + * @param {integer} s15 - Index in concatenation of t0 and t1 for lane s15 + * @return {int8x16} New instance of int8x16 with lanes shuffled. + */ + SIMD.int8x16.shuffle = function(t0, t1, s0, s1, s2, s3, s4, s5, s6, s7, + s8, s9, s10, s11, s12, s13, s14, s15) { + t0 = SIMD.int8x16.check(t0); + t1 = SIMD.int8x16.check(t1); + var storage = _SIMD_PRIVATE._i8x32; + storage[0] = t0.s0; + storage[1] = t0.s1; + storage[2] = t0.s2; + storage[3] = t0.s3; + storage[4] = t0.s4; + storage[5] = t0.s5; + storage[6] = t0.s6; + storage[7] = t0.s7; + storage[8] = t0.s8; + storage[9] = t0.s9; + storage[10] = t0.s10; + storage[11] = t0.s11; + storage[12] = t0.s12; + storage[13] = t0.s13; + storage[14] = t0.s14; + storage[15] = t0.s15; + storage[16] = t1.s0; + storage[17] = t1.s1; + storage[18] = t1.s2; + storage[19] = t1.s3; + storage[20] = t1.s4; + storage[21] = t1.s5; + storage[22] = t1.s6; + storage[23] = t1.s7; + storage[24] = t1.s8; + storage[25] = t1.s9; + storage[26] = t1.s10; + storage[27] = t1.s11; + storage[28] = t1.s12; + storage[29] = t1.s13; + storage[30] = t1.s14; + storage[31] = t1.s15; + return SIMD.int8x16(storage[s0], storage[s1], storage[s2], storage[s3], + storage[s4], storage[s5], storage[s6], storage[s7], + storage[s8], storage[s9], storage[s10], storage[s11], + storage[s12], storage[s13], storage[s14], storage[s15]); + } +} + if (typeof SIMD.int8x16.select === "undefined") { /** * @param {int8x16} t Selector mask. An instance of int8x16 @@ -3719,6 +3945,8 @@ if (typeof SIMD.int8x16.shiftLeftByScalar === "undefined") { */ SIMD.int8x16.shiftLeftByScalar = function(a, bits) { a = SIMD.int8x16.check(a); + if (bits>>>0 > 8) + bits = 8; var s0 = a.s0 << bits; var s1 = a.s1 << bits; var s2 = a.s2 << bits; @@ -3748,6 +3976,8 @@ if (typeof SIMD.int8x16.shiftRightLogicalByScalar === "undefined") { */ SIMD.int8x16.shiftRightLogicalByScalar = function(a, bits) { a = SIMD.int8x16.check(a); + if (bits>>>0 > 8) + bits = 8; var s0 = (a.s0 & 0xff) >>> bits; var s1 = (a.s1 & 0xff) >>> bits; var s2 = (a.s2 & 0xff) >>> bits; @@ -3777,6 +4007,8 @@ if (typeof SIMD.int8x16.shiftRightArithmeticByScalar === "undefined") { */ SIMD.int8x16.shiftRightArithmeticByScalar = function(a, bits) { a = SIMD.int8x16.check(a); + if (bits>>>0 > 8) + bits = 8; var s0 = a.s0 >> bits; var s1 = a.s1 >> bits; var s2 = a.s2 >> bits; diff --git a/src/embind/embind.js b/src/embind/embind.js index afc1acf4bdbf3..e3f8a6904ca19 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -523,12 +523,21 @@ var LibraryEmbind = { } var shift = getShiftFromSize(size); + + var fromWireType = function(value) { + return value; + }; + + if (minRange === 0) { + var bitshift = 32 - 8*size; + fromWireType = function(value) { + return (value << bitshift) >>> bitshift; + }; + } registerType(primitiveType, { name: name, - 'fromWireType': function(value) { - return value; - }, + 'fromWireType': fromWireType, 'toWireType': function(destructors, value) { // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: we could // avoid the following two if()s and assume value is of proper type. diff --git a/src/library.js b/src/library.js index c8586f244a89e..bccb86eb311c7 100644 --- a/src/library.js +++ b/src/library.js @@ -1657,7 +1657,10 @@ LibraryManager.library = { Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') }; } var ret = DYNAMICTOP; - if (bytes != 0) self.alloc(bytes); + if (bytes != 0) { + var success = self.alloc(bytes); + if (!success) return -1 >>> 0; // sbrk failure code + } return ret; // Previous break location. }, @@ -3371,7 +3374,6 @@ LibraryManager.library = { if ((ret | 0) == 32) ret = ret + (Math_clz32(l) | 0) | 0; tempRet0 = 0; return ret | 0; -#endif }, llvm_cttz_i32__deps: [function() { diff --git a/src/library_browser.js b/src/library_browser.js index a090b6059f94d..bd6fd55479682 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -1312,7 +1312,6 @@ mergeInto(LibraryManager.library, { }, emscripten_worker_respond_provisionally: function(data, size) { - if (!inWorkerCall) throw 'not in worker call!'; if (workerResponded) throw 'already responded with final response!'; postMessage({ 'callbackId': workerCallbackId, @@ -1322,7 +1321,6 @@ mergeInto(LibraryManager.library, { }, emscripten_worker_respond: function(data, size) { - if (!inWorkerCall) throw 'not in worker call!'; if (workerResponded) throw 'already responded with final response!'; workerResponded = true; postMessage({ diff --git a/src/library_fs.js b/src/library_fs.js index 32a106000dc8d..95b5cf19b51ec 100644 --- a/src/library_fs.js +++ b/src/library_fs.js @@ -97,7 +97,7 @@ mergeInto(LibraryManager.library, { while (FS.isLink(current.mode)) { var link = FS.readlink(current_path); current_path = PATH.resolve(PATH.dirname(current_path), link); - + var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count }); current = lookup.node; @@ -427,7 +427,7 @@ mergeInto(LibraryManager.library, { // we employ a simple trick: the pointer to a stream is its fd plus 1. This // means that all valid streams have a valid non-zero pointer while allowing // the fs for stdin to be the standard value of zero. - // + // // getStreamFromPtr: function(ptr) { return FS.streams[ptr - 1]; @@ -838,7 +838,7 @@ mergeInto(LibraryManager.library, { if (!link.node_ops.readlink) { throw new FS.ErrnoError(ERRNO_CODES.EINVAL); } - return link.node_ops.readlink(link); + return PATH.resolve(FS.getPath(lookup.node.parent), link.node_ops.readlink(link)); }, stat: function(path, dontFollow) { var lookup = FS.lookupPath(path, { follow: !dontFollow }); diff --git a/src/library_gl.js b/src/library_gl.js index b76699050557e..6753d97a5a3ae 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -784,7 +784,7 @@ var LibraryGL = { deleteContext: function(contextHandle) { if (GL.currentContext === GL.contexts[contextHandle]) GL.currentContext = null; - if (typeof JSEvents === 'object') JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].canvas); // Release all JS event handlers on the DOM element that the GL context is associated with since the context is now deleted. + if (typeof JSEvents === 'object') JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas); // Release all JS event handlers on the DOM element that the GL context is associated with since the context is now deleted. if (GL.contexts[contextHandle] && GL.contexts[contextHandle].GLctx.canvas) GL.contexts[contextHandle].GLctx.canvas.GLctxObject = undefined; // Make sure the canvas object no longer refers to the context object so there are no GC surprises. GL.contexts[contextHandle] = null; }, @@ -866,13 +866,15 @@ var LibraryGL = { return ret; } - - GLctx.getSupportedExtensions().forEach(function(ext) { - ext = ext.replace('MOZ_', '').replace('WEBKIT_', ''); - if (automaticallyEnabledExtensions.indexOf(ext) != -1) { - GLctx.getExtension(ext); // Calling .getExtension enables that extension permanently, no need to store the return value to be enabled. - } - }); + var exts = GLctx.getSupportedExtensions(); + if (exts && exts.length > 0) { + GLctx.getSupportedExtensions().forEach(function(ext) { + ext = ext.replace('MOZ_', '').replace('WEBKIT_', ''); + if (automaticallyEnabledExtensions.indexOf(ext) != -1) { + GLctx.getExtension(ext); // Calling .getExtension enables that extension permanently, no need to store the return value to be enabled. + } + }); + } }, // In WebGL, uniforms in a shader program are accessed through an opaque object type 'WebGLUniformLocation'. diff --git a/src/library_html5.js b/src/library_html5.js index d740e065f6fbf..3da7c7747f5f9 100644 --- a/src/library_html5.js +++ b/src/library_html5.js @@ -125,11 +125,11 @@ var LibraryJSEvents = { isInternetExplorer: function() { return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; }, - // Removes all event handlers on the given DOM element of the given type. Pass in eventType == undefined/null to remove all event handlers regardless of the type. + // Removes all event handlers on the given DOM element of the given type. Pass in eventTypeString == undefined/null to remove all event handlers regardless of the type. removeAllHandlersOnTarget: function(target, eventTypeString) { for(var i = 0; i < JSEvents.eventHandlers.length; ++i) { if (JSEvents.eventHandlers[i].target == target && - (!eventType || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { + (!eventTypeString || eventTypeString == JSEvents.eventHandlers[i].eventTypeString)) { JSEvents._removeHandler(i--); } } @@ -1722,6 +1722,7 @@ var LibraryJSEvents = { {{{ makeSetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.enableExtensionsByDefault, 1, 'i32') }}}; }, + emscripten_webgl_create_context__deps: ['$GL'], emscripten_webgl_create_context: function(target, attributes) { var contextAttributes = {}; contextAttributes.alpha = !!{{{ makeGetValue('attributes', C_STRUCTS.EmscriptenWebGLContextAttributes.alpha, 'i32') }}}; diff --git a/src/library_nodefs.js b/src/library_nodefs.js index 623be260d4eda..31fbe4a439027 100644 --- a/src/library_nodefs.js +++ b/src/library_nodefs.js @@ -1,6 +1,6 @@ mergeInto(LibraryManager.library, { $NODEFS__deps: ['$FS', '$PATH'], - $NODEFS__postset: 'if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); NODEFS.staticInit(); }', + $NODEFS__postset: 'if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); var NODEJS_PATH = require("path"); NODEFS.staticInit(); }', $NODEFS: { isWindows: false, staticInit: function() { @@ -24,7 +24,7 @@ mergeInto(LibraryManager.library, { try { stat = fs.lstatSync(path); if (NODEFS.isWindows) { - // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so + // On Windows, directories return permission bits 'rw-rw-rw-', even though they have 'rwxrwxrwx', so // propagate write bits to execute bits. stat.mode = stat.mode | ((stat.mode & 146) >> 1); } @@ -203,7 +203,9 @@ mergeInto(LibraryManager.library, { readlink: function(node) { var path = NODEFS.realPath(node); try { - return fs.readlinkSync(path); + path = fs.readlinkSync(path); + path = NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root), path); + return path; } catch (e) { if (!e.code) throw e; throw new FS.ErrnoError(ERRNO_CODES[e.code]); diff --git a/src/parseTools.js b/src/parseTools.js index d072dbed27d7f..bea46f6d1d49e 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -57,8 +57,10 @@ function preprocess(text) { ret += '\n' + preprocess(included) + '\n' } } else if (line[2] == 'l') { // else + assert(showStack.length > 0); showStack.push(!showStack.pop()); } else if (line[2] == 'n') { // endif + assert(showStack.length > 0); showStack.pop(); } else { throw "Unclear preprocessor command: " + line; diff --git a/src/postamble.js b/src/postamble.js index 030189d45e179..1c88597686a06 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -300,7 +300,7 @@ function messageResender() { } var buffer = 0, bufferSize = 0; -var inWorkerCall = false, workerResponded = false, workerCallbackId = -1; +var workerResponded = false, workerCallbackId = -1; onmessage = function onmessage(msg) { // if main has not yet been called (mem init file, other async things), buffer messages @@ -326,7 +326,6 @@ onmessage = function onmessage(msg) { HEAPU8.set(data, buffer); } - inWorkerCall = true; workerResponded = false; workerCallbackId = msg.data['callbackId']; if (data) { @@ -334,7 +333,6 @@ onmessage = function onmessage(msg) { } else { func(0, 0); } - inWorkerCall = false; } #endif diff --git a/src/preamble.js b/src/preamble.js index 96b2f0eb002d0..95e51684203bc 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -1206,8 +1206,12 @@ Module['stackTrace'] = stackTrace; // Memory management var PAGE_SIZE = 4096; + function alignMemoryPage(x) { - return (x+4095)&-4096; + if (x % 4096 > 0) { + x += (4096 - (x % 4096)); + } + return x; } var HEAP; @@ -1243,12 +1247,24 @@ function enlargeMemory() { _emscripten_trace_report_memory_layout(); #endif + var LIMIT = Math.pow(2, 31); // 2GB is a practical maximum, as we use signed ints as pointers + // and JS engines seem unhappy to give us 2GB arrays currently + if (DYNAMICTOP >= LIMIT) return false; + while (TOTAL_MEMORY <= DYNAMICTOP) { // Simple heuristic. - TOTAL_MEMORY = alignMemoryPage(2*TOTAL_MEMORY); + if (TOTAL_MEMORY < LIMIT/2) { + TOTAL_MEMORY = alignMemoryPage(2*TOTAL_MEMORY); // double until 1GB + } else { + var last = TOTAL_MEMORY; + TOTAL_MEMORY = alignMemoryPage((3*TOTAL_MEMORY + LIMIT)/4); // add smaller increments towards 2GB, which we cannot reach + if (TOTAL_MEMORY <= last) return false; + } } TOTAL_MEMORY = Math.max(TOTAL_MEMORY, 16*1024*1024); + if (TOTAL_MEMORY >= LIMIT) return false; + #if ASSERTIONS Module.printErr('Warning: Enlarging memory arrays, this is not fast! ' + [OLD_TOTAL_MEMORY, TOTAL_MEMORY]); #endif @@ -1259,19 +1275,26 @@ function enlargeMemory() { _emscripten_trace_report_memory_layout(); #endif - assert(TOTAL_MEMORY <= Math.pow(2, 30)); // 2^30==1GB is a practical maximum - 2^31 is already close to possible negative numbers etc. - #if ASSERTIONS var start = Date.now(); #endif -#if USE_TYPED_ARRAYS == 2 - if (ArrayBuffer.transfer) { - buffer = ArrayBuffer.transfer(buffer, TOTAL_MEMORY); - } else { - var oldHEAP8 = HEAP8; - buffer = new ArrayBuffer(TOTAL_MEMORY); + try { + if (ArrayBuffer.transfer) { + buffer = ArrayBuffer.transfer(buffer, TOTAL_MEMORY); + } else { + var oldHEAP8 = HEAP8; + buffer = new ArrayBuffer(TOTAL_MEMORY); + } + } catch(e) { + return false; } + + var success = _emscripten_replace_memory(buffer); + if (!success) return false; + + // everything worked + Module['buffer'] = buffer; Module['HEAP8'] = HEAP8 = new Int8Array(buffer); Module['HEAP16'] = HEAP16 = new Int16Array(buffer); @@ -1284,18 +1307,12 @@ function enlargeMemory() { if (!ArrayBuffer.transfer) { HEAP8.set(oldHEAP8); } -#else - abort('cannot enlarge memory arrays in non-ta2 modes'); -#endif -#if ASM_JS - var success = _emscripten_replace_memory(buffer); - assert(success); -#endif #if ASSERTIONS Module.printErr('enlarged memory arrays from ' + OLD_TOTAL_MEMORY + ' to ' + TOTAL_MEMORY + ', took ' + (Date.now() - start) + ' ms (has ArrayBuffer.transfer? ' + (!!ArrayBuffer.transfer) + ')'); #endif + return true; #endif } #endif @@ -1312,9 +1329,49 @@ try { var TOTAL_STACK = Module['TOTAL_STACK'] || {{{ TOTAL_STACK }}}; var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || {{{ TOTAL_MEMORY }}}; -var FAST_MEMORY = Module['FAST_MEMORY'] || {{{ FAST_MEMORY }}}; -#if ASM_JS +#if POINTER_MASKING + +#if POINTER_MASKING_DYNAMIC +var POINTER_MASKING_ENABLED = Module['POINTER_MASKING_DEFAULT_ENABLED'] || {{{ POINTER_MASKING_DEFAULT_ENABLED }}}; +var POINTER_MASKING_OVERFLOW = Module['POINTER_MASKING_OVERFLOW'] || {{{ POINTER_MASKING_OVERFLOW }}} +var MASK0 = -1, MASK1 = -1, MASK2 = -1, MASK3 = -1; +function initPointerMasking() { + var totalMemory = 64*1024; + while (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) { + if (POINTER_MASKING_ENABLED || totalMemory < 16*1024*1024) { + totalMemory *= 2; + } else { + totalMemory += 16*1024*1024 + } + } + if (totalMemory !== TOTAL_MEMORY) { + Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be compliant with the asm.js spec (and given that TOTAL_STACK=' + TOTAL_STACK + ')'); + TOTAL_MEMORY = totalMemory; + } + // Silently keep the total length a valid asm.js heap buffer length. + if (POINTER_MASKING_OVERFLOW > 0) { + if (TOTAL_MEMORY <= 0x01000000) { + POINTER_MASKING_OVERFLOW = TOTAL_MEMORY; + } else { + POINTER_MASKING_OVERFLOW = (POINTER_MASKING_OVERFLOW + 0x00ffffff) & 0xff000000; + } + } + MASK0 = POINTER_MASKING_ENABLED ? TOTAL_MEMORY - 1 : -1; + MASK1 = POINTER_MASKING_ENABLED ? (TOTAL_MEMORY - 1) & ~1 : -1; + MASK2 = POINTER_MASKING_ENABLED ? (TOTAL_MEMORY - 1) & ~3 : -1; + MASK3 = POINTER_MASKING_ENABLED ? (TOTAL_MEMORY - 1) & ~7 : -1; +} +initPointerMasking(); +#else // POINTER_MASKING_DYNAMIC +var totalMemory = 64*1024; +while (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) { + totalMemory *= 2; +} +#endif // POINTER_MASKING_DYNAMIC + +#else // POINTER_MASKING + var totalMemory = 64*1024; while (totalMemory < TOTAL_MEMORY || totalMemory < 2*TOTAL_STACK) { if (totalMemory < 16*1024*1024) { @@ -1330,7 +1387,9 @@ if (totalMemory !== TOTAL_MEMORY) { Module.printErr('increasing TOTAL_MEMORY to ' + totalMemory + ' to be compliant with the asm.js spec (and given that TOTAL_STACK=' + TOTAL_STACK + ')'); TOTAL_MEMORY = totalMemory; } -#endif + +#endif // POINTER_MASKING + // Initialize the runtime's memory #if USE_TYPED_ARRAYS @@ -1345,8 +1404,19 @@ IHEAPU = new Uint32Array(IHEAP.buffer); FHEAP = new Float64Array(TOTAL_MEMORY); #endif #endif + #if USE_TYPED_ARRAYS == 2 +#if POINTER_MASKING +#if POINTER_MASKING_DYNAMIC +var buffer = new ArrayBuffer(TOTAL_MEMORY + (POINTER_MASKING_ENABLED ? POINTER_MASKING_OVERFLOW : 0)); +#else +var buffer = new ArrayBuffer(TOTAL_MEMORY + {{{ POINTER_MASKING_OVERFLOW }}}); +#endif +#else var buffer = new ArrayBuffer(TOTAL_MEMORY); +#endif // POINTER_MASKING +#endif // USE_TYPED_ARRAYS == 2 + HEAP8 = new Int8Array(buffer); HEAP16 = new Int16Array(buffer); HEAP32 = new Int32Array(buffer); @@ -1359,14 +1429,7 @@ HEAPF64 = new Float64Array(buffer); // Endianness check (note: assumes compiler arch was little-endian) HEAP32[0] = 255; assert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system'); -#endif -#else -// Make sure that our HEAP is implemented as a flat array. -HEAP = []; // Hinting at the size with |new Array(TOTAL_MEMORY)| should help in theory but makes v8 much slower -for (var i = 0; i < FAST_MEMORY; i++) { - HEAP[i] = 0; // XXX We do *not* use {{| makeSetValue(0, 'i', 0, 'null') |}} here, since this is done just to optimize runtime speed -} -#endif +#endif // USE_TYPED_ARRAYS Module['HEAP'] = HEAP; #if USE_TYPED_ARRAYS == 1 diff --git a/src/proxyWorker.js b/src/proxyWorker.js index 1158758451ebf..ec6f6189db6cc 100644 --- a/src/proxyWorker.js +++ b/src/proxyWorker.js @@ -61,6 +61,7 @@ var KeyboardEvent = { function PropertyBag() { this.addProperty = function(){}; this.removeProperty = function(){}; + this.setProperty = function(){}; }; var IndexedObjects = { @@ -295,6 +296,11 @@ Audio.prototype.cloneNode = function() { return new Audio; } +var screen = { + width: 0, + height: 0 +}; + Module.canvas = document.createElement('canvas'); Module.setStatus = function(){}; @@ -397,8 +403,8 @@ onmessage = function onmessage(message) { } case 'worker-init': { Module.canvas = document.createElement('canvas'); - Module.canvas.width_ = message.data.width; - Module.canvas.height_ = message.data.height; + screen.width = Module.canvas.width_ = message.data.width; + screen.height = Module.canvas.height_ = message.data.height; document.URL = message.data.URL; window.fireEvent({ type: 'load' }); removeRunDependency('worker-init'); diff --git a/src/runtime.js b/src/runtime.js index 72f37b5117cfe..1b4b2f8cd2494 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -67,7 +67,7 @@ var RuntimeGenerator = { dynamicAlloc: function(size) { if (ASSERTIONS) size = '(assert(DYNAMICTOP > 0),' + size + ')'; // dynamic area must be ready var ret = RuntimeGenerator.alloc(size, 'DYNAMIC', INIT_HEAP); - if (USE_TYPED_ARRAYS) ret += '; if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();' + if (USE_TYPED_ARRAYS) ret += '; if (DYNAMICTOP >= TOTAL_MEMORY) { var success = enlargeMemory(); if (!success) return 0; }' return ret; }, diff --git a/src/settings.js b/src/settings.js index 0142dfe8e8826..5c7b0643bad72 100644 --- a/src/settings.js +++ b/src/settings.js @@ -58,8 +58,6 @@ var TOTAL_STACK = 5*1024*1024; // The total stack size. There is no way to enlar var TOTAL_MEMORY = 16777216; // The total amount of memory to use. Using more memory than this will // cause us to expand the heap, which can be costly with typed arrays: // we need to copy the old heap into a new one in that case. -var FAST_MEMORY = 2*1024*1024; // The amount of memory to initialize to 0. This ensures it will be - // in a flat array. This only matters in non-typed array builds. var ALLOW_MEMORY_GROWTH = 0; // If false, we abort with an error if we try to allocate more memory than // we can (TOTAL_MEMORY). If true, we will grow the memory arrays at // runtime, seamlessly and dynamically. This has a performance cost though, @@ -190,8 +188,26 @@ var OUTLINING_LIMIT = 0; // A function size above which we try to automatically var AGGRESSIVE_VARIABLE_ELIMINATION = 0; // Run aggressiveVariableElimination in js-optimizer.js var SIMPLIFY_IFS = 1; // Whether to simplify ifs in js-optimizer.js -var POINTER_MASKING = 0; // Whether to mask pointers (experimental optimization trying to reduce VM bounds checks). - // When using this option, TOTAL_MEMORY must be a power of 2. + +var POINTER_MASKING = 0; // Whether pointers can be masked to a power-of-two heap + // length. An experimental optimization trying to reduce VM + // bounds checks. +var POINTER_MASKING_OVERFLOW = 64 * 1024; // The length added to the heap length to allow + // the compiler to derive that accesses are + // within bounds even when adding small constant + // offsets. This defaults to 64K, but in asm.js + // mode it is silently adjusted to keep the + // total buffer length a valid asm.js heap + // buffer length. +var POINTER_MASKING_DYNAMIC = 0; // When disabled, the masking is baked into the code with + // static masks and a static heap buffer length and the + // TOTAL_MEMORY must be a power of 2. When enabled, the + // masks are defined at runtime rather than compling them + // into the asm.js module as literal constants and the + // TOTAL_MEMORY can be defined at run time. +var POINTER_MASKING_DEFAULT_ENABLED = 1; // When POINTER_MASKING_DYNAMIC is enabled this + // sets the default for POINTER_MASKING_ENABLED, + // enabling or disabling pointer masking. // Generated code debugging options var SAFE_HEAP = 0; // Check each write to the heap, for example, this will give a clear @@ -614,6 +630,8 @@ var EMTERPRETIFY_ADVISE = 0; // Performs a static analysis to suggest which func // appears they can be on the stack when a sync function is called in the EMTERPRETIFY_ASYNC option. // After showing the suggested list, compilation will halt. You can apply the provided list as an // emcc argument when compiling later. + // This will also advise on the YIELDLIST, if it contains at least one value (it then reports + // all things reachable from that function, as they may need to be in the YIELDLIST as well). // Note that this depends on things like inlining. If you run this with different inlining than // when you use the list, it might not work. diff --git a/system/bin/sdl-config.bat b/system/bin/sdl-config.bat new file mode 100644 index 0000000000000..d04904df779a7 --- /dev/null +++ b/system/bin/sdl-config.bat @@ -0,0 +1,2 @@ +@echo off +python "%~dp0\sdl-config" %* \ No newline at end of file diff --git a/system/bin/sdl2-config.bat b/system/bin/sdl2-config.bat new file mode 100644 index 0000000000000..38bba6f9b8db6 --- /dev/null +++ b/system/bin/sdl2-config.bat @@ -0,0 +1,2 @@ +@echo off +python "%~dp0\sdl2-config" %* \ No newline at end of file diff --git a/system/include/emscripten/vector.h b/system/include/emscripten/vector.h index 46305bad5b3a9..3f28599fc63f7 100644 --- a/system/include/emscripten/vector.h +++ b/system/include/emscripten/vector.h @@ -16,6 +16,8 @@ float32x4 emscripten_float32x4_min(float32x4 __a, float32x4 __b) __attribute__(( float32x4 emscripten_float32x4_max(float32x4 __a, float32x4 __b) __attribute__((__nothrow__, __const__)); float32x4 emscripten_float32x4_abs(float32x4 __a) __attribute__((__nothrow__, __const__)); float32x4 emscripten_float32x4_sqrt(float32x4 __a) __attribute__((__nothrow__, __const__)); +float32x4 emscripten_float32x4_reciprocalApproximation(float32x4 __a) __attribute__((__nothrow__, __const__)); +float32x4 emscripten_float32x4_reciprocalSqrtApproximation(float32x4 __a) __attribute__((__nothrow__, __const__)); int32x4 emscripten_float32x4_lessThan(float32x4 __a, float32x4 __b) __attribute__((__nothrow__, __const__)); int32x4 emscripten_float32x4_lessThanOrEqual(float32x4 __a, float32x4 __b) __attribute__((__nothrow__, __const__)); int32x4 emscripten_float32x4_equal(float32x4 __a, float32x4 __b) __attribute__((__nothrow__, __const__)); diff --git a/system/include/emscripten/xmmintrin.h b/system/include/emscripten/xmmintrin.h index 2958e5b581a20..9685d2921cb7a 100644 --- a/system/include/emscripten/xmmintrin.h +++ b/system/include/emscripten/xmmintrin.h @@ -241,7 +241,11 @@ _mm_max_ss(__m128 __a, __m128 __b) return _mm_move_ss(__a, _mm_max_ps(__a, __b)); } -// TODO: we should re-evaluate rcpps, rsqrtps, and friends once we figure out what we're doing with SIMD.float32x4.reciprocal, SIMD.float32x4.reciprocalSqrt, and friends in SIMD.js. +// TODO: we should re-evaluate whether rcpps and rsqrtps can be implemented in +// the reciprocalApproximation and reciprocalSqrtApproximation operations. It's +// unclear, because while they are implemented with actiuap rcp and rsqrt on x86, +// they may be specified to have a looser tolerance in order to accomodate +// reciprocal sqrt implementations on other platforms. #define _mm_rcp_ps(__a) (_mm_set1_ps(1.0f) / (__a)) static __inline__ __m128 __attribute__((__always_inline__)) diff --git a/tests/benchmark_sse1.cpp b/tests/benchmark_sse1.cpp index 6a1efaab16243..bca474d3bcb4a 100644 --- a/tests/benchmark_sse1.cpp +++ b/tests/benchmark_sse1.cpp @@ -8,8 +8,8 @@ #ifdef __EMSCRIPTEN__ #include -#define _mm_storeu_ps _mm_store_ps // Hack for missing function. Works for now since Emscripten does not care about alignment. -#define aligned_alloc(align, size) malloc(size) // Hack for missing function. Works for now since Emscripten does not care about alignment. +// This test never frees, so we can be carefree and just round up to be aligned. +#define aligned_alloc(align, size) (void*)(((uintptr_t)malloc((size) + ((align)-1)) + ((align)-1)) & (~((align)-1))) #endif #if defined(__unix__) && !defined(__EMSCRIPTEN__) // Native build without Emscripten. @@ -22,9 +22,14 @@ #ifdef __APPLE__ #include -#define aligned_alloc(align, size) malloc(size) +#define aligned_alloc(align, size) malloc((size)) #endif +#ifdef WIN32 +#include +#define tick_t unsigned long long +#define aligned_alloc(align, size) _aligned_malloc((size), (align)) +#endif // Scalar horizonal max across four lanes. float hmax(__m128 m) @@ -69,6 +74,19 @@ tick_t ticks_per_sec() { return 1000 * 1000; } +#elif defined(WIN32) +inline tick_t tick() +{ + LARGE_INTEGER ddwTimer; + QueryPerformanceCounter(&ddwTimer); + return ddwTimer.QuadPart; +} +tick_t ticks_per_sec() +{ + LARGE_INTEGER ddwTimerFrequency; + QueryPerformanceFrequency(&ddwTimerFrequency); + return ddwTimerFrequency.QuadPart; +} #else #error No tick_t #endif @@ -114,9 +132,17 @@ void Print(__m128 m) bool always_true() { return time(NULL) != 0; } // This function always returns true, but the compiler should not know this. -float __attribute__((noinline)) *get_src() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } -float __attribute__((noinline)) *get_src2() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } -float __attribute__((noinline)) *get_dst() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } +#ifdef _MSC_VER +#define NOINLINE __declspec(noinline) +#define INLINE __forceinline +#else +#define NOINLINE __attribute__((noinline)) +#define INLINE __inline__ +#endif + +float NOINLINE *get_src() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } +float NOINLINE *get_src2() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } +float NOINLINE *get_dst() { return always_true() ? (float*)aligned_alloc(16, (N+16)*sizeof(float)) : 0; } float checksum_dst(float *dst) { @@ -138,6 +164,13 @@ float ucastf(uint32_t t) { return *(float*)&t; } store_instr((float*)dst+store_offset+i, load_instr(src+load_offset+i)); \ END(checksum_dst(dst), msg); +// loadh/l - store test +#define LSH_TEST(msg, reg, load_instr, load_offset, store_instr, store_offset) \ + START(); \ + for(int i = 0; i < N; i += 4) \ + store_instr((float*)dst+store_offset+i, load_instr(reg, (const __m64*)(src+load_offset+i))); \ + END(checksum_dst(dst), msg); + #define LS64_TEST(msg, load_instr, load_offset, store_instr, store_offset) \ START(); \ for(int i = 0; i < N; i += 4) \ @@ -171,7 +204,7 @@ float ucastf(uint32_t t) { return *(float*)&t; } #define Max(a,b) ((a) >= (b) ? (a) : (b)) #define Min(a,b) ((a) <= (b) ? (a) : (b)) -static __inline__ int Isnan(float __f) +static INLINE int Isnan(float __f) { return (*(unsigned int*)&__f << 1) > 0xFF000000u; } @@ -203,8 +236,11 @@ int main() LS_TEST("_mm_load_ps1", _mm_load_ps1, 1, _mm_store_ps, 0); LS_TEST("_mm_load_ss", _mm_load_ss, 1, _mm_store_ps, 0); LS_TEST("_mm_load1_ps", _mm_load1_ps, 1, _mm_store_ps, 0); - // _mm_loadh_pi - // _mm_loadl_pi + + __m128 tempReg = _mm_set_ps(1.f, 2.f, 3.f, 4.f); + LSH_TEST("_mm_loadh_pi", tempReg, _mm_loadh_pi, 1, _mm_store_ps, 0); + LSH_TEST("_mm_loadl_pi", tempReg, _mm_loadh_pi, 1, _mm_store_ps, 0); + LS_TEST("_mm_loadr_ps", _mm_loadr_ps, 0, _mm_store_ps, 0); LS_TEST("_mm_loadu_ps", _mm_loadu_ps, 1, _mm_store_ps, 0); @@ -269,7 +305,6 @@ int main() BINARYOP_TEST("_mm_xor_ps", _mm_xor_ps, _mm_load_ps(src), _mm_load_ps(src2)); SETCHART("cmp"); -#ifndef __EMSCRIPTEN__ // TODO: Disabled due to https://github.com/kripken/emscripten/issues/2841 START(); dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; for(int i = 0; i < N; ++i) { dst[0] = (dst[0] == src2[0]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[1] = (dst[1] == src2[1]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[2] = (dst[2] == src2[2]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[3] = (dst[3] == src2[3]) ? ucastf(0xFFFFFFFFU) : 0.f; } ENDSCALAR(checksum_dst(dst), "scalar cmp=="); BINARYOP_TEST("_mm_cmpeq_ps", _mm_cmpeq_ps, _mm_load_ps(src), _mm_load_ps(src2)); BINARYOP_TEST("_mm_cmpeq_ss", _mm_cmpeq_ss, _mm_load_ps(src), _mm_load_ps(src2)); @@ -285,7 +320,6 @@ int main() START(); dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; for(int i = 0; i < N; ++i) { dst[0] = (dst[0] < src2[0]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[1] = (dst[1] < src2[1]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[2] = (dst[2] < src2[2]) ? ucastf(0xFFFFFFFFU) : 0.f; dst[3] = (dst[3] < src2[3]) ? ucastf(0xFFFFFFFFU) : 0.f; } ENDSCALAR(checksum_dst(dst), "scalar cmp<"); BINARYOP_TEST("_mm_cmplt_ps", _mm_cmplt_ps, _mm_load_ps(src), _mm_load_ps(src2)); BINARYOP_TEST("_mm_cmplt_ss", _mm_cmplt_ss, _mm_load_ps(src), _mm_load_ps(src2)); -#endif START(); dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; for(int i = 0; i < N; ++i) { dst[0] = (!Isnan(dst[0]) && !Isnan(src2[0])) ? ucastf(0xFFFFFFFFU) : 0.f; dst[1] = (!Isnan(dst[1]) && !Isnan(src2[1])) ? ucastf(0xFFFFFFFFU) : 0.f; dst[2] = (!Isnan(dst[2]) && !Isnan(src2[2])) ? ucastf(0xFFFFFFFFU) : 0.f; dst[3] = (!Isnan(dst[3]) && !Isnan(src2[3])) ? ucastf(0xFFFFFFFFU) : 0.f; } ENDSCALAR(checksum_dst(dst), "scalar cmpord"); BINARYOP_TEST("_mm_cmpord_ps", _mm_cmpord_ps, _mm_load_ps(src), _mm_load_ps(src2)); diff --git a/tests/benchmark_sse1.py b/tests/benchmark_sse1.py index fca0ddfeb6111..1dd9f90ff9259 100755 --- a/tests/benchmark_sse1.py +++ b/tests/benchmark_sse1.py @@ -11,16 +11,17 @@ def path_from_root(*pathelems): temp_dir = tempfile.mkdtemp() # System info -system_info = Popen([path_from_root('emrun'), '--system_info'], stdout=PIPE, stderr=PIPE).communicate() +system_info = Popen([PYTHON, path_from_root('emrun'), '--system_info'], stdout=PIPE, stderr=PIPE).communicate() # Native info native_info = Popen(['clang', '-v'], stdout=PIPE, stderr=PIPE).communicate() # Emscripten info -emscripten_info = Popen([EMCC, '-v'], stdout=PIPE, stderr=PIPE).communicate() +emscripten_info = Popen([PYTHON, EMCC, '-v'], stdout=PIPE, stderr=PIPE).communicate() # Run native build out_file = os.path.join(temp_dir, 'benchmark_sse1_native') +if WINDOWS: out_file += '.exe' cmd = [CLANG_CPP] + get_clang_native_args() + [path_from_root('tests', 'benchmark_sse1.cpp'), '-O3', '-o', out_file] print 'Building native version of the benchmark:' print ' '.join(cmd) @@ -34,7 +35,7 @@ def path_from_root(*pathelems): # Run emscripten build out_file = os.path.join(temp_dir, 'benchmark_sse1_html.html') -cmd = [EMCC, path_from_root('tests', 'benchmark_sse1.cpp'), '-O3', '--emrun', '-s', 'TOTAL_MEMORY=536870912', '-o', out_file] +cmd = [PYTHON, EMCC, path_from_root('tests', 'benchmark_sse1.cpp'), '-O3', '--emrun', '-s', 'TOTAL_MEMORY=536870912', '-o', out_file] print 'Building Emscripten version of the benchmark:' print ' '.join(cmd) build = Popen(cmd) @@ -69,7 +70,7 @@ def path_from_root(*pathelems): print ' - Make sure that all Firefox debugging, profiling etc. add-ons that might impact performance are disabled (Firebug, Geckoprofiler, ...).' print '' print 'Once the test has finished, close the browser application to continue.' -html_results = Popen([path_from_root('emrun'), '--browser=' + browser, out_file], stdout=PIPE, stderr=PIPE).communicate() +html_results = Popen([PYTHON, path_from_root('emrun'), '--browser=' + browser, out_file], stdout=PIPE, stderr=PIPE).communicate() if not html_results or not html_results[0].strip(): print 'Running Firefox Nightly failed! Please rerun with the command line parameter --browser=/path/to/firefox/nightly/firefox' @@ -79,6 +80,11 @@ def strip_comments(text): return re.sub('//.*?\n|/\*.*?\*/', '', text, re.S) benchmark_results = strip_comments(html_results[0]) +# Strip out unwanted print output. +benchmark_results = benchmark_results[benchmark_results.find('{'):].strip() +if '*************************' in benchmark_results: + benchmark_results = benchmark_results[:benchmark_results.find('*************************')].strip() + ##html_results = native_results print benchmark_results diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index 9e7a4e5aa77f4..8cbbafb716077 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -732,6 +732,20 @@ module({ assert.throws(TypeError, function() { cm.unsigned_long_to_string(4294967296); }); }); + test("unsigned values are correctly returned when stored in memory", function() { + cm.store_unsigned_char(255); + assert.equal(255, cm.load_unsigned_char()); + + cm.store_unsigned_short(32768); + assert.equal(32768, cm.load_unsigned_short()); + + cm.store_unsigned_int(2147483648); + assert.equal(2147483648, cm.load_unsigned_int()); + + cm.store_unsigned_long(2147483648); + assert.equal(2147483648, cm.load_unsigned_long()); + }); + test("throws appropriate type error when attempting to coerce null to int", function() { var e = assert.throws(TypeError, function() { cm.int_to_string(null); diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 4dc33502a9018..21f30a1500be2 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -1585,6 +1585,43 @@ std::string unsigned_long_to_string(unsigned long val) { return str; } +//test loading unsigned value from memory +static unsigned char uchar; +void store_unsigned_char(unsigned char arg) { + uchar = arg; +} + +unsigned char load_unsigned_char() { + return uchar; +} + +static unsigned short ushort; +void store_unsigned_short(unsigned short arg) { + ushort = arg; +} + +unsigned short load_unsigned_short() { + return ushort; +} + +static unsigned int uint; +void store_unsigned_int(unsigned int arg) { + uint = arg; +} + +unsigned int load_unsigned_int() { + return uint; +} + +static unsigned long ulong; +void store_unsigned_long(unsigned long arg) { + ulong = arg; +} + +unsigned long load_unsigned_long() { + return ulong; +} + EMSCRIPTEN_BINDINGS(tests) { register_vector("IntegerVector"); register_vector("CharVector"); @@ -2047,6 +2084,15 @@ EMSCRIPTEN_BINDINGS(tests) { function("unsigned_int_to_string", &unsigned_int_to_string); function("long_to_string", &long_to_string); function("unsigned_long_to_string", &unsigned_long_to_string); + + function("store_unsigned_char", &store_unsigned_char); + function("load_unsigned_char", &load_unsigned_char); + function("store_unsigned_short", &store_unsigned_short); + function("load_unsigned_short", &load_unsigned_short); + function("store_unsigned_int", &store_unsigned_int); + function("load_unsigned_int", &load_unsigned_int); + function("store_unsigned_long", &store_unsigned_long); + function("load_unsigned_long", &load_unsigned_long); } int overloaded_function(int i) { diff --git a/tests/fuzz/24.cpp b/tests/fuzz/24.cpp new file mode 100644 index 0000000000000..1752fe59fb2e4 --- /dev/null +++ b/tests/fuzz/24.cpp @@ -0,0 +1,4807 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.3.0 + * Git version: 3453904 + * Options: --no-volatiles --no-packed-struct --no-math64 --no-bitfields --max-funcs 28 --lang-cpp + * Seed: 3622210064 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +/* --- GLOBAL VARIABLES --- */ +static uint16_t g_9 = 8UL; +static int32_t g_14 = 0xCB8F6C21L; +static uint32_t g_18 = 0x7B722BA7L; +static int8_t g_36 = 0L; +static int32_t g_46 = 0x95A52772L; +static int32_t *g_45 = &g_46; +static uint16_t g_48 = 1UL; +static int32_t * const g_65 = &g_46; +static uint8_t g_206 = 255UL; +static int16_t g_209 = 0L; +static int32_t *g_225 = &g_46; +static int32_t **g_224 = &g_225; +static int32_t g_254 = 0xFEDBD156L; +static uint32_t g_255 = 0UL; +static uint32_t g_260[10][7][2] = {{{0x335B14A6L,0x41D4D588L},{3UL,1UL},{0x2895D01DL,0xEBF16E3DL},{4294967292UL,0xD2F48C2FL},{0xD2F48C2FL,0xEAF5C805L},{4294967293UL,4294967292UL},{0UL,1UL}},{{0xEBF16E3DL,1UL},{0UL,4294967292UL},{4294967293UL,0xEAF5C805L},{0xD2F48C2FL,0xD2F48C2FL},{4294967292UL,0xEBF16E3DL},{0x2895D01DL,1UL},{3UL,0x41D4D588L}},{{0x335B14A6L,3UL},{4294967295UL,0UL},{4294967295UL,3UL},{0x335B14A6L,0x41D4D588L},{3UL,1UL},{0x2895D01DL,0xEBF16E3DL},{4294967292UL,0xD2F48C2FL}},{{0xD2F48C2FL,0xEAF5C805L},{4294967293UL,4294967292UL},{0x41D4D588L,0UL},{4294967293UL,0UL},{0x41D4D588L,0xEAF5C805L},{0x2895D01DL,5UL},{4294967295UL,4294967295UL}},{{0xEAF5C805L,4294967293UL},{4294967295UL,1UL},{4294967295UL,0xD2F48C2FL},{3UL,4294967295UL},{0xEBF16E3DL,0x41D4D588L},{0xEBF16E3DL,4294967295UL},{3UL,0xD2F48C2FL}},{{4294967295UL,1UL},{4294967295UL,4294967293UL},{0xEAF5C805L,4294967295UL},{4294967295UL,5UL},{0x2895D01DL,0xEAF5C805L},{0x41D4D588L,0UL},{4294967293UL,0UL}},{{0x41D4D588L,0xEAF5C805L},{0x2895D01DL,5UL},{4294967295UL,4294967295UL},{0xEAF5C805L,4294967293UL},{4294967295UL,1UL},{4294967295UL,0xD2F48C2FL},{3UL,4294967295UL}},{{0xEBF16E3DL,0x41D4D588L},{0xEBF16E3DL,4294967295UL},{3UL,0xD2F48C2FL},{4294967295UL,1UL},{4294967295UL,4294967293UL},{0xEAF5C805L,4294967295UL},{4294967295UL,5UL}},{{0x2895D01DL,0xEAF5C805L},{0x41D4D588L,0UL},{4294967293UL,0UL},{0x41D4D588L,0xEAF5C805L},{0x2895D01DL,5UL},{4294967295UL,4294967295UL},{0xEAF5C805L,4294967293UL}},{{4294967295UL,1UL},{4294967295UL,0xD2F48C2FL},{3UL,4294967295UL},{0xEBF16E3DL,0x41D4D588L},{0xEBF16E3DL,4294967295UL},{3UL,0xD2F48C2FL},{4294967295UL,1UL}}}; +static int8_t g_263 = 0xAFL; +static int8_t *g_262 = &g_263; +static int8_t g_282 = 0L; +static uint32_t *g_284[10][9] = {{&g_260[1][4][0],&g_260[7][0][0],&g_260[3][2][0],&g_260[4][6][1],&g_260[8][5][0],&g_260[8][5][0],&g_260[4][6][1],&g_260[3][2][0],&g_260[7][0][0]},{NULL,&g_260[3][2][0],&g_260[1][4][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1]},{NULL,&g_260[9][3][1],NULL,&g_260[9][3][1],&g_260[4][6][1],&g_260[1][4][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[1][4][0]},{&g_260[1][4][0],&g_260[3][2][0],NULL,&g_260[3][2][0],&g_260[1][4][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1]},{&g_260[3][2][0],&g_260[7][0][0],&g_260[1][4][0],&g_260[9][3][1],&g_260[1][4][0],&g_260[7][0][0],&g_260[3][2][0],&g_260[4][6][1],&g_260[8][5][0]},{&g_260[9][3][1],&g_260[8][5][0],&g_260[3][2][0],&g_260[9][3][1],&g_260[4][6][1],&g_260[9][3][1],&g_260[3][2][0],&g_260[8][5][0],&g_260[9][3][1]},{&g_260[7][0][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[4][6][1],&g_260[9][3][1],&g_260[1][4][0],&g_260[9][3][1],&g_260[4][6][1],&g_260[9][3][1]},{&g_260[9][3][1],&g_260[9][3][1],&g_260[7][0][0],NULL,&g_260[8][5][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1],&g_260[8][5][0]},{&g_260[7][0][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[7][0][0],NULL,&g_260[8][5][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[9][3][1]},{&g_260[9][3][1],&g_260[9][3][1],&g_260[7][0][0],&g_260[7][0][0],&g_260[9][3][1],&g_260[9][3][1],&g_260[4][6][1],&g_260[9][3][1],&g_260[1][4][0]}}; +static uint32_t ** const g_283[1][4][5] = {{{&g_284[4][0],&g_284[4][0],&g_284[8][0],&g_284[8][0],&g_284[4][0]},{&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0]},{&g_284[4][0],&g_284[8][0],&g_284[8][0],&g_284[4][0],&g_284[4][0]},{&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0]}}}; +static int16_t g_300 = 0x241CL; +static uint32_t g_393 = 0x9A03E547L; +static uint16_t g_405 = 65531UL; +static uint32_t g_416 = 0UL; +static const int32_t g_438 = 0x40DDB9D4L; +static uint8_t g_447 = 0xC4L; +static uint8_t g_450 = 254UL; +static int32_t g_459 = 6L; +static int32_t g_460[7] = {0x5448FBCCL,0x5448FBCCL,0x5448FBCCL,0x5448FBCCL,0x5448FBCCL,0x5448FBCCL,0x5448FBCCL}; +static int8_t g_462 = 0x99L; +static uint8_t g_463 = 0x9FL; +static uint8_t g_466 = 0UL; +static int8_t **g_539 = &g_262; +static int8_t ***g_538 = &g_539; +static int8_t ***g_540 = &g_539; +static int32_t ***g_567 = NULL; +static int32_t *** const *g_566 = &g_567; +static uint32_t g_582 = 0xCA479C78L; +static uint32_t g_592 = 0xB0365C96L; +static int16_t g_620 = 0x76D7L; +static int32_t g_621 = 6L; +static uint16_t g_622[1] = {0x0A1DL}; +static int8_t *g_635 = &g_462; +static int32_t g_641 = (-3L); +static int32_t g_642 = 0x4E0AD6DDL; +static int32_t g_643[7] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; +static uint16_t g_644 = 65531UL; +static uint32_t g_765 = 1UL; +static int32_t *g_810[6] = {&g_254,&g_254,&g_254,&g_254,&g_254,&g_254}; +static int32_t ** const g_809 = &g_810[0]; +static int32_t ** const *g_808[10] = {&g_809,&g_809,&g_809,&g_809,&g_809,&g_809,&g_809,&g_809,&g_809,&g_809}; +static int16_t g_838[6][10] = {{0xF5A4L,0x814BL,0x150AL,2L,0xBFB5L,0x68A2L,0x68A2L,0xBFB5L,2L,0x150AL},{0xBFB5L,0xBFB5L,(-10L),0xF5A4L,0xE22FL,0x68A2L,(-1L),0x68A2L,0xE22FL,0xF5A4L},{0xF5A4L,(-1L),0xF5A4L,0x68A2L,0x77B8L,0x150AL,(-1L),(-1L),0x150AL,0x77B8L},{(-10L),0xBFB5L,0xBFB5L,(-10L),0xF5A4L,0xE22FL,0x68A2L,(-1L),0x68A2L,0xE22FL},{0x150AL,0x814BL,0xF5A4L,0x814BL,0x150AL,2L,0xBFB5L,0x68A2L,0x68A2L,0xBFB5L},{(-1L),2L,(-10L),(-10L),2L,(-1L),0x77B8L,0xBFB5L,0x150AL,0xBFB5L}}; +static uint8_t g_921[3] = {254UL,254UL,254UL}; +static uint16_t **g_1103 = NULL; +static int16_t *g_1119[4] = {&g_838[4][4],&g_838[4][4],&g_838[4][4],&g_838[4][4]}; +static int16_t **g_1118 = &g_1119[1]; +static int16_t *** const g_1117 = &g_1118; +static int32_t g_1217 = 0xA0E92E0DL; +static uint32_t g_1335 = 4294967288UL; +static int32_t ****g_1352 = &g_567; +static uint32_t g_1391 = 0x463D5B8BL; +static uint32_t g_1577[7][6][4] = {{{18446744073709551615UL,0x50564461L,0x3C401667L,0xE71D6D6BL},{0UL,1UL,18446744073709551615UL,3UL},{4UL,0UL,0UL,3UL},{0xAEF75DDAL,1UL,5UL,0xE71D6D6BL},{5UL,0x50564461L,0x1E8D18A2L,1UL},{0UL,0x1CF368FEL,18446744073709551615UL,4UL}},{{0x3C401667L,0xA71B754CL,5UL,0x623A2DADL},{0xF7402B5DL,0UL,0x7AD007D9L,0UL},{4UL,5UL,0xAEF75DDAL,0x50564461L},{5UL,0xA71B754CL,0x3C401667L,0UL},{1UL,0UL,0x0E26B0FFL,1UL},{1UL,0x623A2DADL,0x3C401667L,0x0B074489L}},{{5UL,1UL,0xAEF75DDAL,0UL},{4UL,0x7D3ADB1EL,0x7AD007D9L,3UL},{0xF7402B5DL,18446744073709551615UL,5UL,0x0B074489L},{0x3C401667L,0x50564461L,18446744073709551615UL,18446744073709551615UL},{0UL,0UL,0x1E8D18A2L,4UL},{5UL,0UL,5UL,0x50564461L}},{{0xAEF75DDAL,0UL,0UL,5UL},{4UL,0UL,18446744073709551615UL,18446744073709551615UL},{0UL,18446744073709551615UL,0x7AD007D9L,0x623A2DADL},{0x0E26B0FFL,0UL,0xDC8C4D6EL,0x0E26B0FFL},{0x1CF368FEL,18446744073709551615UL,4UL,0UL},{0UL,0x0E26B0FFL,1UL,5UL}},{{5UL,0xE71D6D6BL,5UL,0xF867151CL},{0x3C401667L,0x1CF368FEL,0x7D3ADB1EL,0UL},{0UL,0x1E8D18A2L,0x0E26B0FFL,0x1CF368FEL},{0xDC8C4D6EL,0UL,0x0E26B0FFL,5UL},{0UL,0xAEF75DDAL,0x7D3ADB1EL,18446744073709551615UL},{0x3C401667L,0x8257D1F7L,5UL,0UL}},{{5UL,0UL,1UL,0x1E8D18A2L},{0UL,0xAEF75DDAL,4UL,0x623A2DADL},{0x1CF368FEL,0xDC8C4D6EL,0xDC8C4D6EL,0x1CF368FEL},{0x0E26B0FFL,18446744073709551615UL,0x7AD007D9L,18446744073709551615UL},{0UL,0x1CF368FEL,5UL,5UL},{0x623A2DADL,0xB258936DL,5UL,5UL}},{{1UL,0x1CF368FEL,0x8257D1F7L,18446744073709551615UL},{0UL,18446744073709551615UL,0UL,0x1CF368FEL},{0UL,0xDC8C4D6EL,0x0E26B0FFL,0x623A2DADL},{0x7AD007D9L,0xAEF75DDAL,0x8257D1F7L,0x1E8D18A2L},{0x3C401667L,0UL,0x50564461L,0UL},{0x623A2DADL,0x8257D1F7L,1UL,18446744073709551615UL}}}; +static uint8_t g_1665 = 1UL; +static uint32_t g_1679 = 0xABC6B670L; +static int8_t g_1760 = 4L; +static uint16_t g_1844 = 0x1C08L; +static const int32_t *g_1859[4][10] = {{&g_438,&g_621,&g_254,&g_641,NULL,&g_46,&g_46,&g_641,&g_641,&g_46},{&g_46,&g_438,&g_641,&g_641,&g_438,&g_46,&g_438,&g_46,&g_621,NULL},{NULL,&g_641,&g_621,&g_642,&g_254,&g_46,&g_46,&g_46,&g_254,&g_642},{NULL,&g_46,NULL,&g_641,&g_46,&g_46,&g_642,NULL,&g_621,&g_46}}; +static uint8_t *g_1950 = &g_450; +static uint8_t **g_1949 = &g_1950; +static uint16_t g_1961 = 0x1EC5L; +static uint8_t ***g_2102 = &g_1949; +static uint16_t *g_2115 = &g_622[0]; +static uint32_t g_2280 = 0x29057EC3L; +static uint32_t g_2284 = 0xD2A84AADL; +static uint32_t g_2287[6] = {1UL,1UL,1UL,1UL,1UL,1UL}; +static uint32_t * const g_2286 = &g_2287[5]; +static uint32_t * const *g_2285 = &g_2286; +static uint32_t g_2291 = 0UL; +static int32_t * const g_2442 = &g_621; +static int32_t *g_2446 = &g_643[3]; +static const int32_t **g_2460 = &g_1859[3][5]; +static const int32_t ***g_2459 = &g_2460; +static const int32_t ****g_2458 = &g_2459; +static const int32_t *****g_2457 = &g_2458; +static uint32_t **g_2470 = &g_284[3][4]; +static int16_t g_2490 = 0L; +static int8_t g_2576 = 0x13L; +static int8_t g_2579 = 4L; +static int8_t g_2582 = (-1L); +static int8_t g_2586[10][7] = {{5L,0xF3L,0x1CL,0x77L,0x77L,0x1CL,0xF3L},{5L,0xB1L,0x7DL,5L,4L,4L,5L},{0x7DL,0xF3L,0x7DL,4L,0xF3L,0xB1L,0xB1L},{0xF3L,5L,0x1CL,5L,0xF3L,0x1CL,0x77L},{0x77L,0xB1L,4L,0x77L,4L,0xB1L,0x77L},{0x7DL,0x77L,0xB1L,4L,0x77L,4L,0xB1L},{0x77L,0x77L,0x1CL,0xF3L,5L,0x1CL,5L},{0xF3L,0xB1L,0xB1L,0xF3L,4L,0x7DL,0xF3L},{0L,4L,0L,0L,4L,0L,0x1CL},{4L,0xB1L,0x77L,0x7DL,0x7DL,0x77L,0xB1L}}; +static int8_t g_2588 = 0x73L; +static int8_t g_2591 = 0x4AL; +static int8_t g_2593 = 0x7DL; +static int8_t g_2594 = 9L; +static int8_t g_2595 = 1L; +static int8_t g_2596 = (-10L); +static int8_t g_2597 = 0x25L; +static int8_t g_2598 = (-1L); +static int8_t g_2599 = 0L; +static int8_t g_2600[1] = {0x9DL}; +static int8_t g_2601 = 0x15L; +static int8_t g_2602 = 0xF0L; +static int8_t g_2603[2][2] = {{1L,1L},{1L,1L}}; +static int8_t g_2604 = (-1L); +static int8_t g_2605 = 0x93L; +static int8_t g_2606 = 0xA6L; +static int8_t g_2607 = 3L; +static int8_t g_2608 = (-1L); +static int8_t g_2609 = (-3L); +static int8_t g_2610 = 0x27L; +static int8_t g_2611 = (-5L); +static int8_t g_2612[5] = {1L,1L,1L,1L,1L}; +static int8_t g_2613 = 7L; +static int8_t g_2614[8][9] = {{0x9FL,0xF2L,0x9FL,0x73L,0x6CL,(-4L),0xB2L,0xB2L,(-4L)},{(-4L),0xA3L,0x9FL,0xA3L,(-4L),0x38L,0xC9L,0x73L,0x73L},{0xA3L,0L,(-4L),0x73L,(-4L),0L,0xA3L,0x6CL,(-1L)},{0xB2L,(-1L),0xA3L,0x38L,0x6CL,0x38L,0xA3L,(-1L),0xB2L},{0L,0x38L,0xB2L,0x6CL,0xC9L,(-4L),0xC9L,0x6CL,0xB2L},{0xC9L,0xC9L,0L,0x9FL,(-1L),0x73L,0xB2L,0x73L,(-1L)},{0L,0xC9L,0xC9L,0L,0x9FL,(-1L),0x73L,0xB2L,0x73L},{0xB2L,0x38L,0L,0L,0x38L,0xB2L,0x6CL,0xC9L,(-4L)}}; +static int8_t g_2615 = 0x8BL; +static int8_t g_2616 = 9L; +static int8_t g_2617 = 0x8AL; +static int8_t g_2618 = 0x89L; +static int8_t g_2619 = 1L; +static int8_t g_2620 = 0x18L; +static int8_t g_2622 = 1L; +static int8_t g_2624 = 0x10L; +static int8_t g_2626 = 0x5EL; +static int8_t g_2628[9][4][3] = {{{0xFEL,(-1L),(-4L)},{1L,0x60L,(-4L)},{(-4L),0x63L,0L},{1L,0x63L,1L}},{{0xFEL,0x60L,0L},{0xFEL,(-1L),(-4L)},{1L,0x60L,(-4L)},{(-4L),0x63L,0L}},{{1L,0x63L,1L},{0xFEL,0x60L,0L},{0xFEL,(-1L),(-4L)},{1L,0x60L,(-4L)}},{{(-4L),0x63L,0L},{1L,0x63L,1L},{0xFEL,0x60L,0L},{0xFEL,(-1L),(-4L)}},{{1L,0x60L,(-4L)},{(-4L),0x63L,0L},{1L,0x63L,1L},{0xFEL,0x60L,0L}},{{0xFEL,(-1L),(-4L)},{1L,0x60L,(-4L)},{(-4L),0x63L,0L},{1L,0x63L,1L}},{{0xFEL,0x60L,0L},{0xFEL,(-1L),(-4L)},{1L,0x60L,(-4L)},{(-4L),0x63L,0L}},{{1L,0x63L,1L},{0xFEL,0x60L,0L},{0xFEL,(-1L),(-4L)},{1L,0x60L,0L}},{{0L,0xFEL,1L},{0xBEL,0xFEL,0xBEL},{0x3CL,1L,1L},{0x3CL,(-4L),0L}}}; +static int8_t g_2629 = (-7L); +static int8_t g_2630[2][7] = {{9L,9L,9L,9L,9L,9L,9L},{0x2DL,0x2DL,0x2DL,0x2DL,0x2DL,0x2DL,0x2DL}}; +static int8_t g_2632[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L}; +static int8_t g_2634 = (-6L); +static int8_t g_2636 = 0x0AL; +static int8_t g_2638 = 0L; +static int8_t g_2640 = 0xE1L; +static int8_t g_2642[6][10][4] = {{{0xACL,9L,0xB3L,0x42L},{4L,0xFCL,0xE8L,0xFCL},{2L,0xE8L,0L,0xEDL},{0x42L,(-5L),(-3L),0xDCL},{0xBCL,0L,0xD8L,0xA5L},{0xBCL,0xC1L,(-3L),1L},{0x42L,0xA5L,0L,0x7AL},{2L,1L,0xE8L,0xACL},{4L,6L,0xB3L,2L},{0xACL,0x35L,2L,(-1L)}},{{(-6L),0x10L,0xFCL,(-1L)},{6L,(-1L),(-6L),3L},{0x34L,0x42L,0x42L,0x34L},{0x35L,0xB3L,3L,(-1L)},{1L,(-1L),(-2L),0xC1L},{0xD8L,0x7AL,0L,0xC1L},{9L,(-1L),(-6L),(-1L)},{(-1L),0xB3L,0x4BL,0x34L},{0xDCL,0x42L,(-1L),3L},{(-2L),(-1L),0xEDL,(-1L)}},{{(-3L),0x10L,1L,(-1L)},{1L,0x35L,4L,2L},{(-1L),6L,1L,0xACL},{0L,1L,0L,0x7AL},{0x7AL,0xA5L,(-1L),1L},{0xE8L,0xC1L,0xBFL,0xA5L},{0x72L,0L,0xBFL,0xDCL},{0xE8L,(-5L),(-1L),0xEDL},{0x7AL,0xE8L,0L,0xFCL},{0L,0xFCL,1L,0x42L}},{{(-1L),9L,4L,0x72L},{1L,0xEDL,1L,0x4BL},{(-3L),0xD8L,0xEDL,4L},{(-2L),0L,(-1L),(-1L)},{0xDCL,0xDCL,0x4BL,0xBCL},{(-1L),2L,(-6L),0xB3L},{9L,1L,0L,(-6L)},{0xD8L,1L,(-2L),0xB3L},{1L,2L,3L,6L},{0L,(-1L),0x28L,1L}},{{4L,1L,0x35L,1L},{0L,(-1L),0L,0xACL},{0x35L,0xE8L,(-1L),0xA5L},{3L,0x42L,(-6L),0x28L},{1L,0L,0x72L,0L},{(-1L),0x72L,(-1L),0xE8L},{0x28L,0xC1L,0xD8L,(-1L)},{6L,(-1L),(-1L),(-6L)},{6L,2L,0xD8L,0xDCL},{0x28L,(-6L),(-1L),0xBFL}},{{(-1L),0x34L,0x72L,3L},{1L,0L,(-6L),(-1L)},{3L,0L,(-1L),0x7AL},{0x35L,0xFCL,0L,0L},{0L,(-5L),0x35L,0x10L},{4L,0x28L,0x28L,4L},{0L,(-6L),0x10L,(-5L)},{9L,0x7AL,(-1L),2L},{(-1L),0xBFL,1L,2L},{0x42L,0x7AL,(-2L),(-5L)}}}; +static int8_t g_2644 = (-10L); +static int8_t g_2646 = 5L; +static int8_t g_2648 = 1L; +static int8_t g_2650 = 0x5CL; +static int8_t g_2652 = 0x74L; +static int8_t g_2655[8][4] = {{0xF4L,0x2FL,(-10L),(-10L)},{0x93L,0x93L,0xF4L,(-10L)},{0x89L,0x2FL,0x89L,0xF4L},{0x89L,0xF4L,0xF4L,0x89L},{0x93L,0xF4L,(-10L),0xF4L},{0xF4L,0x2FL,(-10L),(-10L)},{0x93L,0x93L,0xF4L,(-10L)},{0x89L,0x2FL,0x89L,0xF4L}}; +static int8_t g_2657 = 8L; +static int8_t g_2659[2][8] = {{6L,0xB7L,6L,0xB7L,6L,0xB7L,6L,0xB7L},{6L,0xB7L,6L,0xB7L,6L,0xB7L,6L,0xB7L}}; +static int8_t g_2661 = 0x1CL; +static int8_t g_2662 = 0xABL; +static int8_t g_2664 = 0x00L; +static int8_t g_2668 = 0x6EL; +static int8_t g_2670[4] = {(-3L),(-3L),(-3L),(-3L)}; +static int8_t g_2672 = 0xD6L; +static int8_t g_2674[6] = {0x0FL,0x0FL,0x0FL,0x0FL,0x0FL,0x0FL}; +static int8_t g_2676 = 5L; +static int8_t g_2678 = (-1L); +static int8_t g_2679[2] = {0xEEL,0xEEL}; +static int8_t g_2681 = (-5L); +static int8_t g_2683 = 0L; +static int8_t g_2684[1][8] = {{0x8CL,0x88L,0x88L,0x8CL,0x88L,0x88L,0x8CL,0x88L}}; +static int8_t g_2685[8] = {0x63L,0x63L,0x63L,0x63L,0x63L,0x63L,0x63L,0x63L}; +static int8_t g_2686 = (-2L); +static int8_t g_2687 = 0x35L; +static int8_t g_2688 = 0x7FL; +static int8_t g_2689 = 0x47L; +static int8_t g_2690 = 0xD1L; +static int8_t g_2692 = 1L; +static int8_t g_2694[4][4] = {{0x2BL,0x2BL,0x2BL,0x2BL},{0x2BL,0x2BL,0x2BL,0x2BL},{0x2BL,0x2BL,0x2BL,0x2BL},{0x2BL,0x2BL,0x2BL,0x2BL}}; +static int8_t g_2696 = 0x7CL; +static int8_t g_2698[6] = {0x3BL,0x3BL,0x3BL,0x3BL,0x3BL,0x3BL}; +static int8_t g_2700 = 0xB1L; +static int8_t g_2702 = 0x60L; +static int8_t g_2703 = 0x1BL; +static int8_t g_2704[7] = {0x44L,0x44L,0x44L,0x44L,0x44L,0x44L,0x44L}; +static int8_t g_2705 = 4L; +static int8_t g_2706 = 1L; +static int8_t g_2707 = 0L; +static int8_t g_2708 = (-1L); +static int8_t g_2709 = 0x87L; +static int8_t g_2710 = (-6L); +static int8_t g_2711 = 0L; +static int8_t g_2712 = 0xBCL; +static int8_t g_2713 = 0xE0L; +static int8_t g_2714[3][4] = {{0xAFL,0xAFL,0xAFL,0xAFL},{0xAFL,0xAFL,0xAFL,0xAFL},{0xAFL,0xAFL,0xAFL,0xAFL}}; +static int8_t g_2715 = 0x69L; +static int8_t g_2716 = (-1L); +static int8_t g_2717 = 0xC2L; +static int8_t g_2718[6][2][9] = {{{3L,0L,0x4EL,0xF9L,9L,(-1L),0xE6L,0xE6L,(-1L)},{0xF9L,(-9L),1L,(-9L),0xF9L,0L,(-4L),0x4EL,5L}},{{(-4L),0L,0xF9L,(-9L),1L,(-9L),0xF9L,0L,(-4L)},{0xE6L,(-1L),9L,0xF9L,0x4EL,0L,3L,0L,0x4EL}},{{5L,3L,3L,5L,(-9L),(-1L),(-10L),0x4EL,9L},{0xE6L,0x4EL,3L,(-5L),(-5L),3L,0x4EL,0xE6L,1L}},{{(-4L),(-5L),9L,0xE6L,(-9L),0x4EL,0x4EL,(-9L),0xE6L},{0xF9L,(-4L),0xF9L,(-1L),0x4EL,(-5L),(-10L),1L,1L}},{{3L,(-4L),1L,0x4EL,1L,(-4L),3L,(-10L),9L},{(-10L),(-5L),0x4EL,(-1L),0xF9L,(-4L),0xF9L,(-1L),0x4EL}},{{0x4EL,0x4EL,(-9L),0xE6L,9L,(-5L),(-4L),(-10L),(-4L)},{0x4EL,3L,(-5L),(-5L),3L,0x4EL,0xE6L,1L,5L}}}; +static int8_t g_2719 = 3L; +static int8_t g_2720[3][6] = {{6L,6L,6L,6L,6L,6L},{6L,6L,6L,6L,6L,6L},{6L,6L,6L,6L,6L,6L}}; +static int8_t g_2721 = 0x71L; +static int8_t g_2722[3] = {8L,8L,8L}; +static int8_t g_2723 = (-1L); +static int8_t g_2724 = 0xC7L; +static int8_t g_2725 = (-5L); +static int8_t g_2726 = (-1L); +static int8_t g_2727 = (-1L); +static int8_t g_2728 = 0L; +static int8_t g_2729[8][10] = {{(-7L),0xBAL,(-2L),0x7BL,(-2L),0xBAL,(-7L),0xBAL,(-2L),0x7BL},{(-2L),0x7BL,(-2L),0xBAL,(-7L),0xBAL,(-2L),0x7BL,(-2L),0xBAL},{(-7L),0x7BL,1L,0x7BL,(-7L),0xE4L,(-7L),0x7BL,1L,0x7BL},{(-7L),0xBAL,(-2L),0x7BL,(-2L),0xBAL,(-7L),0xBAL,(-2L),0x7BL},{(-2L),0x7BL,(-2L),0xBAL,(-7L),0xBAL,(-2L),0x7BL,(-2L),0xBAL},{(-2L),0xBAL,(-7L),0xBAL,(-2L),0x7BL,(-2L),0xBAL,(-7L),0xBAL},{(-2L),0xE4L,1L,0xBAL,1L,0xE4L,(-2L),0xE4L,1L,0xBAL},{1L,0xBAL,1L,0xE4L,(-2L),0xE4L,1L,0xBAL,1L,0xE4L}}; +static int8_t g_2730 = 0x58L; +static int8_t g_2731 = 0x1FL; +static int8_t g_2732 = 0x03L; +static int8_t g_2733 = 1L; +static int8_t g_2734 = 1L; +static int8_t g_2735 = 3L; +static int8_t g_2736 = (-4L); +static int8_t g_2737 = 0x0DL; +static int8_t g_2738 = 0x54L; +static int8_t g_2739 = 0L; +static int8_t g_2740 = 0L; +static int8_t g_2741 = 0x50L; +static int8_t g_2742 = 0x2DL; +static int8_t g_2743[4] = {1L,1L,1L,1L}; +static int8_t g_2744 = 8L; +static int8_t g_2745 = 0x64L; +static int8_t g_2746 = 0xD6L; +static int8_t g_2747 = (-8L); +static int8_t g_2748 = 1L; +static int8_t g_2749[7][10][3] = {{{(-1L),1L,(-7L)},{0L,0x44L,0x70L},{0xA8L,1L,0x1BL},{(-3L),0x80L,0L},{8L,1L,0x6BL},{0L,0x44L,0xEAL},{8L,1L,0L},{0xA5L,0xD9L,0xDFL},{0x7DL,0L,0xA5L},{0L,0xE6L,9L}},{{0x7DL,4L,0x78L},{0xA5L,1L,0x44L},{8L,(-6L),2L},{0L,0L,1L},{8L,0x3AL,0x9AL},{(-3L),0xEAL,1L},{0xA8L,2L,2L},{0L,0x9AL,0x44L},{(-1L),(-7L),0x78L},{(-2L),(-8L),9L}},{{0x49L,0x69L,0xA5L},{0x84L,(-8L),0xDFL},{0xA3L,(-7L),0L},{(-1L),0x9AL,0xEAL},{9L,2L,0x6BL},{0xDAL,0xEAL,0L},{0xF2L,0x3AL,0x1BL},{0xDAL,0L,0x70L},{9L,(-6L),(-7L)},{(-1L),1L,0xD9L}},{{0xA3L,4L,(-6L)},{0x84L,0xE6L,0x2BL},{0x49L,0L,(-6L)},{(-2L),0xD9L,0xD9L},{(-1L),1L,(-7L)},{0L,0x44L,0x70L},{0xA8L,1L,0x1BL},{(-3L),0x80L,0L},{8L,1L,0x6BL},{0L,0x44L,0xEAL}},{{8L,1L,0L},{0xA5L,0xD9L,0xDFL},{0x7DL,0L,0xA5L},{0L,0xE6L,9L},{0x7DL,4L,0x78L},{0xA5L,1L,0x44L},{8L,(-6L),2L},{0L,0L,1L},{8L,0x3AL,0x9AL},{(-3L),0xEAL,1L}},{{0xA8L,2L,2L},{0L,0x9AL,0x44L},{(-1L),0x40L,0x27L},{0x94L,(-1L),(-9L)},{1L,0x4FL,0xE8L},{0L,(-1L),0xE7L},{0x05L,0x40L,1L},{0xD9L,0x18L,0xCAL},{0x78L,1L,0x22L},{0xEAL,0xCAL,0xAFL}},{{0L,(-1L),0xA6L},{0xEAL,(-2L),9L},{0x78L,(-3L),0x40L},{0xD9L,0L,0x12L},{0x05L,0xA5L,(-3L)},{0L,7L,6L},{1L,1L,(-3L)},{0x94L,0x12L,0x12L},{0x1BL,1L,0x40L},{9L,9L,9L}}}; +static int8_t g_2750 = 2L; +static int8_t g_2751[2] = {0x11L,0x11L}; +static int8_t g_2752 = 0x34L; +static int8_t g_2753[9] = {(-1L),8L,(-1L),8L,(-1L),8L,(-1L),8L,(-1L)}; +static int8_t g_2754[6] = {0L,0L,0x7EL,0L,0L,0x7EL}; +static int8_t g_2755[7][7] = {{7L,7L,0x69L,7L,7L,0x69L,7L},{7L,3L,3L,7L,3L,3L,7L},{3L,7L,3L,3L,7L,3L,3L},{7L,7L,0x69L,7L,7L,0x69L,7L},{7L,3L,3L,7L,3L,3L,7L},{3L,7L,3L,3L,7L,3L,3L},{7L,7L,0x69L,7L,7L,0x69L,7L}}; +static int8_t g_2756 = (-1L); +static int8_t g_2757 = 0xF5L; +static int8_t g_2758 = 1L; +static int8_t g_2759 = 2L; +static int8_t g_2760 = (-8L); +static int8_t g_2761 = (-8L); +static int8_t g_2762[6][1] = {{0x79L},{0x79L},{0x79L},{0x79L},{0x79L},{0x79L}}; +static int8_t g_2763 = 0x82L; +static int8_t g_2764 = 0x14L; +static int8_t g_2765[2][5] = {{0x58L,5L,5L,0x58L,0x99L},{0x58L,5L,5L,0x58L,0x99L}}; +static int8_t g_2766 = 2L; +static int8_t g_2767[4] = {1L,1L,1L,1L}; +static int8_t g_2768[4][6] = {{4L,0xCDL,4L,0xCDL,4L,0xCDL},{4L,0xCDL,4L,0xCDL,4L,0xCDL},{4L,0xCDL,4L,0xCDL,4L,0xCDL},{4L,0xCDL,4L,0xCDL,4L,0xCDL}}; +static int8_t g_2769 = 7L; +static int8_t g_2770 = 0x73L; +static int8_t g_2771[1] = {0x5DL}; +static int8_t g_2772 = (-8L); +static int8_t g_2773 = 0L; +static int8_t g_2775 = 0xD4L; +static int8_t g_2777 = 0x56L; +static int8_t g_2779[6] = {0x54L,0xBAL,0xBAL,0x54L,0xBAL,0xBAL}; +static int8_t g_2781[5][7][7] = {{{0x3FL,0L,0x3FL,0L,(-10L),0x91L,0x1FL},{0L,0x72L,0x7AL,8L,(-10L),0xDBL,0L},{1L,0x3FL,0x91L,0x66L,0x66L,0x91L,0x5FL},{0x95L,(-4L),0x1DL,0x12L,0x21L,0xDBL,(-4L)},{0x91L,0x9FL,0xDBL,(-1L),0xBAL,0L,0x12L},{0xC1L,0x89L,0L,0x12L,(-10L),(-1L),0x65L},{0xDBL,0x12L,0L,0xC0L,0x3FL,(-9L),0x1FL}},{{(-4L),(-1L),0x1AL,(-1L),(-9L),0x89L,(-9L)},{0x3FL,0x12L,0x12L,0x3FL,0x9FL,0xC0L,0L},{4L,0x89L,(-1L),(-1L),0x95L,0x65L,0L},{(-9L),0x9FL,0L,0x91L,0xDBL,0x91L,0L},{0x1AL,(-4L),0L,0x04L,0L,(-1L),(-9L)},{(-1L),0x5FL,1L,0x12L,(-9L),(-1L),0x1FL},{0x65L,(-10L),0L,1L,0L,(-10L),0x65L}},{{0x66L,0x91L,0x3FL,1L,0xDBL,0x1FL,0x12L},{0L,8L,(-1L),(-10L),0x95L,0x31L,(-4L)},{0x9FL,0x5DL,0x3FL,0x5DL,0x9FL,(-1L),0x5FL},{0L,0x04L,0L,(-1L),(-9L),1L,0x95L},{0x5DL,(-5L),1L,0xBAL,0x3FL,0x3FL,0xBAL},{0L,(-1L),0L,0xDBL,(-10L),8L,0x7AL},{0x9FL,0xC0L,0L,(-1L),0xBAL,0x5FL,0x66L}},{{0L,0x87L,(-1L),(-10L),0x21L,8L,0L},{0x66L,0xDBL,0x12L,0L,0xC0L,0x3FL,(-9L)},{0x65L,6L,0x1AL,0x65L,0x7AL,1L,0x1DL},{(-1L),0x1FL,0L,0L,0x1FL,(-1L),0x91L},{0x1AL,(-10L),0L,(-10L),4L,0x31L,(-10L)},{(-9L),0xBAL,0xDBL,(-1L),1L,0x1FL,1L},{4L,(-10L),0x1DL,0xDBL,(-1L),(-10L),1L}},{{0x3FL,0x1FL,(-5L),0xBAL,0x66L,(-1L),0L},{(-4L),6L,1L,(-1L),0x1AL,(-1L),1L},{0xDBL,(-9L),0x66L,0x12L,0x9FL,(-5L),0L},{(-9L),0x72L,0L,(-4L),0x5EL,6L,0x7AL},{(-5L),(-1L),0x9FL,0L,0x9FL,(-1L),(-5L)},{0x21L,8L,0L,0x12L,(-4L),(-1L),0x1AL},{0x3FL,(-1L),0x5DL,0xDBL,0xC0L,(-10L),(-10L)}}}; +static int8_t g_2783 = 9L; +static int8_t g_2786 = 0xABL; +static int8_t g_2788 = 0L; +static int8_t g_2790 = 0L; +static int8_t g_2792 = 0xB3L; +static int8_t g_2794 = (-8L); +static int8_t g_2796 = 1L; +static int8_t g_2798 = (-2L); +static int8_t g_2800 = 0xA1L; +static int8_t g_2802 = 0x15L; +static uint16_t *g_3102 = &g_622[0]; +static uint16_t **g_3170 = NULL; +static const int16_t g_3269 = 1L; +static const int16_t g_3271 = 1L; +static int32_t *****g_3277 = &g_1352; +static int32_t ******g_3276 = &g_3277; +static uint8_t g_3292[9] = {0xB4L,0xB4L,0xB4L,0xB4L,0xB4L,0xB4L,0xB4L,0xB4L,0xB4L}; +static int16_t g_3356[4] = {0x9144L,0x9144L,0x9144L,0x9144L}; +static uint32_t *g_3378 = &g_1577[1][1][3]; +static uint32_t **g_3377 = &g_3378; +static uint32_t ***g_3376 = &g_3377; +static int8_t g_3412[8] = {0xC9L,0xC9L,0xC9L,0xC9L,0xC9L,0xC9L,0xC9L,0xC9L}; +static int32_t g_3459 = 1L; +static const int16_t g_3467 = 0x82C4L; +static const int16_t *g_3466 = &g_3467; +static uint16_t g_3505[8][9] = {{0xEB51L,0xEB51L,65532UL,0x1398L,0x549FL,65532UL,0x549FL,0x1398L,65532UL},{0UL,0x405DL,0xA381L,65530UL,65535UL,0x2F47L,65535UL,65530UL,0xA381L},{0xEB51L,0xEB51L,65532UL,0x1398L,0x549FL,65532UL,0x549FL,0x1398L,65532UL},{0UL,0x405DL,0xA381L,65530UL,65535UL,0x2F47L,65535UL,65530UL,0xA381L},{0xEB51L,0xEB51L,65532UL,0x1398L,0x549FL,65532UL,0x549FL,0x1398L,65532UL},{0UL,0x405DL,0xA381L,65530UL,65535UL,0x2F47L,65535UL,65530UL,0xA381L},{0xEB51L,0xEB51L,65532UL,0x1398L,0x549FL,65532UL,0x549FL,0x1398L,65532UL},{0UL,0x405DL,0xA381L,65530UL,65535UL,0x2F47L,65535UL,65530UL,0xA381L}}; +static uint16_t ***g_3622 = &g_1103; +static uint16_t ****g_3621[1] = {&g_3622}; +static uint8_t ***g_3714 = NULL; +static uint16_t ** const *g_3836 = &g_3170; +static uint16_t ** const **g_3835[3] = {&g_3836,&g_3836,&g_3836}; +static const int32_t g_4125[5][7][7] = {{{(-6L),(-1L),(-1L),(-6L),(-1L),(-1L),(-6L)},{0x6FD7DD1AL,1L,0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL},{(-6L),(-6L),(-4L),(-6L),(-6L),(-4L),(-6L)},{0x2A015C34L,0x92800E9AL,0x6FD7DD1AL,1L,0x6FD7DD1AL,0x92800E9AL,0x2A015C34L},{(-1L),(-6L),(-1L),(-1L),(-6L),(-1L),(-1L)},{0x2A015C34L,1L,0L,1L,0x2A015C34L,0x0DF9C082L,0x2A015C34L},{(-6L),(-1L),(-1L),(-6L),(-1L),(-1L),(-6L)}},{{0x6FD7DD1AL,1L,0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL},{(-6L),(-6L),(-4L),(-6L),(-1L),(-6L),(-1L)},{0x6FD7DD1AL,0x0DF9C082L,0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL},{(-4L),(-1L),(-4L),(-4L),(-1L),(-4L),(-4L)},{0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL,1L,0x6FD7DD1AL},{(-1L),(-4L),(-4L),(-1L),(-4L),(-4L),(-1L)},{0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL,0x0DF9C082L,0L}},{{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L)},{0x6FD7DD1AL,0x0DF9C082L,0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL},{(-4L),(-1L),(-4L),(-4L),(-1L),(-4L),(-4L)},{0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL,1L,0x6FD7DD1AL},{(-1L),(-4L),(-4L),(-1L),(-4L),(-4L),(-1L)},{0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL,0x0DF9C082L,0L},{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L)}},{{0x6FD7DD1AL,0x0DF9C082L,0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL},{(-4L),(-1L),(-4L),(-4L),(-1L),(-4L),(-4L)},{0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL,1L,0x6FD7DD1AL},{(-1L),(-4L),(-4L),(-1L),(-4L),(-4L),(-1L)},{0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL,0x0DF9C082L,0L},{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L)},{0x6FD7DD1AL,0x0DF9C082L,0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL}},{{(-4L),(-1L),(-4L),(-4L),(-1L),(-4L),(-4L)},{0x6FD7DD1AL,0x92800E9AL,0x2A015C34L,0x92800E9AL,0x6FD7DD1AL,1L,0x6FD7DD1AL},{(-1L),(-4L),(-4L),(-1L),(-4L),(-4L),(-1L)},{0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL,0x0DF9C082L,0L},{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L)},{0x6FD7DD1AL,0x0DF9C082L,0L,0x92800E9AL,0L,0x0DF9C082L,0x6FD7DD1AL},{(-4L),(-1L),(-4L),(-4L),(-1L),(-4L),(-4L)}}}; +static const uint8_t g_4174 = 6UL; +static const uint8_t g_4176 = 248UL; +static uint32_t g_4198 = 0xF097C384L; +static int16_t * const g_4305 = NULL; +static int16_t * const *g_4304[2][4][9] = {{{&g_4305,&g_4305,NULL,&g_4305,&g_4305,&g_4305,&g_4305,&g_4305,NULL},{&g_4305,&g_4305,NULL,&g_4305,NULL,&g_4305,NULL,&g_4305,&g_4305},{NULL,&g_4305,NULL,NULL,&g_4305,&g_4305,NULL,&g_4305,&g_4305},{NULL,NULL,NULL,NULL,&g_4305,&g_4305,&g_4305,&g_4305,NULL}},{{NULL,&g_4305,NULL,&g_4305,&g_4305,NULL,&g_4305,NULL,NULL},{&g_4305,&g_4305,NULL,NULL,&g_4305,&g_4305,&g_4305,&g_4305,NULL},{NULL,&g_4305,NULL,&g_4305,&g_4305,&g_4305,&g_4305,NULL,NULL},{NULL,&g_4305,NULL,&g_4305,NULL,&g_4305,NULL,&g_4305,NULL}}}; +static int16_t g_4308 = 0x48E9L; +static int16_t * const g_4307 = &g_4308; +static int16_t * const *g_4306[8] = {&g_4307,&g_4307,&g_4307,&g_4307,&g_4307,&g_4307,&g_4307,&g_4307}; +static uint32_t **g_4324[2] = {&g_3378,&g_3378}; +static int32_t g_4424 = 0L; +static int16_t **g_4618 = &g_1119[1]; +static uint8_t g_4663 = 0x48L; +static uint32_t ***g_4680 = NULL; +static uint32_t **** const g_4679 = &g_4680; +static int8_t g_4770[9][3] = {{0L,0xB3L,0x77L},{0L,0x98L,0x8AL},{0L,0L,0x8AL},{0x98L,0L,0x77L},{0xB3L,0L,0xB3L},{0xB3L,0x98L,0L},{0x98L,0xB3L,0xB3L},{0L,0xB3L,0x77L},{0L,0x98L,0x8AL}}; +static int32_t g_4886 = 0xF60728C7L; +static int32_t g_4961 = 0xD9D8424EL; +static uint16_t g_4962 = 6UL; +static uint16_t *g_5096[9] = {&g_4962,&g_4962,&g_4962,&g_4962,&g_4962,&g_4962,&g_4962,&g_4962,&g_4962}; +static const uint16_t *g_5158 = NULL; +static int16_t ******g_5261 = NULL; +static uint16_t g_5310 = 65535UL; +static uint8_t ****g_5312 = &g_3714; +static uint8_t *****g_5311 = &g_5312; +static int8_t g_5400 = 0x25L; +static int8_t g_5464 = (-1L); +static int8_t g_5628 = (-1L); +static int32_t *g_5637 = &g_641; +static uint32_t g_5786 = 0UL; +static int8_t g_5857 = 0x12L; +static const int8_t *g_5957 = NULL; +static uint32_t g_6022[7][9] = {{0x6FD8C5FDL,4294967291UL,0x43342007L,0xA369A958L,0x43342007L,4294967291UL,0x6FD8C5FDL,0x6E279589L,0x784B88DBL},{4294967295UL,0xD2F09A8EL,0x9AFCD7DAL,0xD2F09A8EL,4294967295UL,0x2AD3F67EL,0x2AD3F67EL,4294967295UL,0xD2F09A8EL},{0x6FD8C5FDL,0x16FF277CL,0x6FD8C5FDL,1UL,4294967286UL,0xD82E3653L,0x43B448BCL,0x6E279589L,0x43342007L},{5UL,4294967295UL,0x2AD3F67EL,0x9AFCD7DAL,0x9AFCD7DAL,0x2AD3F67EL,4294967295UL,5UL,4294967295UL},{0x784B88DBL,0xA369A958L,0x43B448BCL,1UL,0x584A27FFL,4294967291UL,4294967286UL,4294967291UL,0x584A27FFL},{0xD2F09A8EL,4294967295UL,4294967295UL,0xD2F09A8EL,5UL,4294967295UL,5UL,0xD2F09A8EL,4294967295UL},{0x43342007L,0x16FF277CL,4294967286UL,0xA369A958L,4294967294UL,0xA369A958L,4294967286UL,0x16FF277CL,0x43342007L}}; +static int32_t ** const **g_6080 = &g_808[5]; +static int32_t ** const ***g_6079 = &g_6080; +static int32_t ** const ****g_6078 = &g_6079; +static uint32_t g_6166 = 0UL; +static int8_t g_6188 = 0L; +static int32_t g_6191 = (-1L); +static int32_t **g_6213[8][1][6] = {{{NULL,&g_2446,&g_2446,&g_2446,&g_2446,NULL}},{{&g_2446,NULL,&g_2446,NULL,&g_2446,&g_2446}},{{&g_2446,NULL,NULL,&g_2446,&g_2446,&g_2446}},{{&g_2446,&g_2446,&g_2446,&g_2446,&g_2446,&g_2446}},{{NULL,NULL,&g_2446,&g_2446,&g_2446,NULL}},{{&g_2446,&g_2446,&g_2446,&g_2446,&g_2446,&g_2446}},{{NULL,&g_2446,&g_2446,&g_2446,NULL,NULL}},{{&g_2446,&g_2446,&g_2446,&g_2446,&g_2446,&g_2446}}}; +static int32_t ***g_6212 = &g_6213[5][0][5]; +static uint32_t *g_6216 = NULL; +static int32_t * const *g_6319 = &g_225; +static int32_t * const **g_6318 = &g_6319; +static int32_t * const ***g_6317 = &g_6318; +static int32_t * const ****g_6316 = &g_6317; +static int32_t * const *****g_6315 = &g_6316; +static int32_t * const ******g_6314 = &g_6315; +static int32_t * const *******g_6313 = &g_6314; +static int32_t ***** const *g_6373 = NULL; +static int32_t ***** const **g_6372 = &g_6373; +static uint32_t g_6438 = 0x9F149FF8L; +static const uint32_t g_6794[10] = {3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL}; +static const uint32_t *g_6793[5][4] = {{&g_6794[0],&g_6794[7],&g_6794[0],&g_6794[5]},{&g_6794[0],&g_6794[5],&g_6794[5],&g_6794[0]},{&g_6794[4],&g_6794[5],&g_6794[0],&g_6794[5]},{&g_6794[5],&g_6794[7],&g_6794[0],&g_6794[0]},{&g_6794[4],&g_6794[4],&g_6794[5],&g_6794[0]}}; +static const uint32_t **g_6792 = &g_6793[4][3]; +static uint8_t g_6812 = 247UL; +static uint32_t g_6897 = 4294967290UL; +static uint8_t g_6899 = 249UL; +static const uint8_t *g_6993[6] = {&g_921[2],&g_921[2],&g_921[2],&g_921[2],&g_921[2],&g_921[2]}; +static const uint8_t **g_6992[7] = {&g_6993[5],&g_6993[5],&g_6993[5],&g_6993[5],&g_6993[5],&g_6993[5],&g_6993[5]}; +static const uint8_t ***g_6991 = &g_6992[3]; +static const uint8_t ****g_6990 = &g_6991; +static int16_t g_6997 = 0x18FEL; +static const int32_t g_7110 = 5L; +static int8_t g_7279 = 5L; +static int32_t *g_7356 = &g_4886; +static int32_t g_7380 = 8L; +static uint32_t g_7382 = 0x589E3AFAL; +static uint32_t g_7589 = 1UL; + + +/* --- FORWARD DECLARATIONS --- */ +static uint32_t func_1(void); +static const uint32_t func_25(const uint32_t p_26, uint16_t p_27); +static uint32_t func_39(int32_t * p_40, uint16_t * const p_41, uint16_t * p_42, uint32_t * p_43, int32_t p_44); +static int8_t * func_50(uint16_t * const p_51, uint32_t * p_52); +static uint32_t * func_54(uint32_t p_55); +static int16_t func_59(int32_t * const p_60, uint32_t * const p_61, int32_t * p_62, uint32_t p_63, int8_t * p_64); +static uint32_t * func_66(int32_t * p_67, int16_t p_68, int8_t p_69, int32_t * p_70, uint16_t * p_71); +static int32_t * func_73(int32_t p_74); +static int8_t * func_77(uint32_t p_78, int32_t p_79, uint16_t * p_80, int8_t * const p_81); +static uint16_t * func_82(uint32_t * p_83, int8_t * p_84, uint16_t p_85, int32_t p_86); +static uint32_t * func_87(int16_t p_88, int8_t p_89, const uint16_t * p_90, int32_t p_91, uint16_t * p_92); +static int32_t * func_96(const int32_t p_97, uint16_t * p_98); +static int32_t func_107(uint16_t * const p_108, uint16_t * p_109, uint32_t p_110); +static uint16_t * func_111(int32_t p_112, uint32_t p_113); +static int32_t func_122(uint8_t p_123, uint16_t * const p_124, int16_t p_125, uint32_t p_126, int32_t p_127); +static uint8_t func_128(int32_t p_129, const int8_t p_130, int32_t p_131, int8_t p_132, int32_t ** p_133); +static int8_t func_134(uint32_t p_135, int32_t p_136); +static uint32_t func_137(int32_t p_138, int8_t p_139, int16_t p_140, uint16_t * p_141); +static const uint16_t func_143(uint16_t * p_144, int32_t ** p_145, int8_t * p_146, int8_t p_147, uint32_t p_148); +static int32_t ** func_150(int32_t ** const p_151, uint32_t p_152, uint16_t p_153, int8_t * p_154); +static int32_t func_155(int32_t * p_156); +static int32_t * func_157(uint16_t * p_158, int16_t p_159, int32_t p_160); +static uint16_t * func_161(uint8_t p_162); +static uint8_t func_163(uint32_t p_164); +static const int32_t * func_170(uint32_t p_171, int32_t * p_172, uint32_t p_173, int8_t * p_174); +static uint32_t * func_187(uint8_t p_188, int16_t p_189); +static int16_t func_190(int16_t p_191, int8_t p_192, uint32_t p_193, int32_t p_194); +static int8_t func_196(int8_t p_197, const uint32_t p_198, uint32_t p_199, uint32_t p_200, uint16_t * p_201); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_9 g_14 g_45 g_46 g_65 g_48 g_2758 g_809 g_4307 g_2285 g_2286 g_2287 g_2757 g_538 g_539 g_262 g_2683 g_635 g_462 g_2102 g_1949 g_1950 g_810 g_463 g_450 g_2687 g_644 g_2659 g_3836 g_3170 g_2442 g_4962 g_224 g_225 g_3277 g_1352 g_3102 g_622 g_3466 g_3467 g_2760 g_2720 g_206 g_255 g_2457 g_2458 g_2459 g_2460 g_459 g_2703 g_3377 g_3378 g_2628 g_466 g_621 g_254 g_641 g_5096 g_405 g_1577 g_2719 g_1859 g_2115 g_2595 g_2446 g_5400 g_4961 g_2678 g_5312 g_3714 g_4308 g_5637 g_2470 g_284 g_540 g_4618 g_5311 g_5786 g_2576 g_2727 g_643 g_3622 g_1103 g_5857 g_1119 g_6022 g_2662 g_2690 g_2772 g_6078 g_3376 g_2706 g_5261 g_282 g_6166 g_6212 g_6216 g_6313 g_6317 g_6318 g_6319 g_6314 g_6315 g_6316 g_6372 g_6080 g_808 g_6438 g_2798 g_3505 g_3459 g_4424 g_2674 g_2740 g_2773 g_4886 g_6191 g_2579 g_2777 g_6079 g_2608 g_2694 g_2794 g_2738 g_2622 g_2613 g_2746 g_7279 g_6991 g_6992 g_6993 g_921 g_6792 g_6793 g_7356 g_1117 g_1118 g_7382 g_2648 g_2748 g_1844 g_2783 g_6990 g_2670 g_460 g_7589 g_2769 g_2800 g_765 g_2612 g_2718 g_2692 + * writes: g_9 g_18 g_36 g_2758 g_810 g_2657 g_4308 g_2757 g_262 g_2683 g_644 g_3621 g_2287 g_450 g_46 g_254 g_641 g_2760 g_463 g_2687 g_621 g_4962 g_567 g_459 g_622 g_2720 g_209 g_224 g_255 g_1859 g_2628 g_2703 g_1577 g_2595 g_405 g_2719 g_1335 g_2698 g_643 g_462 g_4961 g_2678 g_3714 g_48 g_3356 g_5312 g_2576 g_2769 g_2727 g_2734 g_1103 g_284 g_1950 g_5957 g_2662 g_5637 g_2690 g_2772 g_6078 g_466 g_3378 g_2706 g_282 g_539 g_6166 g_2280 g_2446 g_2661 g_393 g_6022 g_45 g_225 g_5261 g_2712 g_2593 g_3459 g_4424 g_5857 g_2605 g_2798 g_2686 g_2617 g_6213 g_2611 g_2740 g_2773 g_4886 g_6191 g_2579 g_635 g_2777 g_2608 g_2624 g_2794 g_2738 g_6212 g_2622 g_2613 g_2746 g_7382 g_2648 g_2748 g_1118 g_1844 g_2783 g_6438 g_7589 g_2459 g_2490 g_2800 g_765 g_2692 + */ +static uint32_t func_1(void) +{ + func_39(g_45, &g_48, &g_48, (uint32_t*) g_45, 0); + return 0; +} + + +/* ------------------------------------------ */ +/* + * reads : g_2738 g_643 g_2102 g_1949 g_1950 g_2727 g_450 g_2442 g_621 g_2286 g_2287 g_2457 g_2458 g_2459 g_2460 g_6080 g_808 g_809 g_6314 g_6315 g_6316 g_6317 g_6318 g_6319 g_3466 g_3467 g_4307 g_4308 g_6078 g_6079 g_65 g_3102 g_622 g_7279 g_46 g_2115 g_6991 g_6992 g_6993 g_463 g_921 g_6792 g_6793 g_2285 g_7356 g_1117 g_1118 g_2446 g_7382 g_641 g_6990 g_2470 g_6438 g_2659 g_2670 g_4886 g_460 g_7589 g_3459 g_4424 g_3277 g_1352 g_2612 g_2800 g_2718 g_5096 g_4962 g_2622 g_2613 g_2746 g_2648 g_2748 g_1844 g_2783 g_2769 g_765 g_48 g_2692 + * writes: g_2738 g_6212 g_621 g_1859 g_2712 g_810 g_2727 g_450 g_4308 g_2622 g_2613 g_2746 g_46 g_2287 g_4886 g_643 g_3459 g_4424 g_7382 g_2648 g_2748 g_622 g_1118 g_1844 g_641 g_2783 g_4962 g_48 g_284 g_6438 g_7589 g_2459 g_567 g_2490 g_2769 g_2800 g_765 g_2692 + */ +static const uint32_t func_25(const uint32_t p_26, uint16_t p_27) +{ /* block id: 3115 */ + uint32_t l_7161 = 0x06852DB5L; + int32_t l_7162 = 0xE572DBE4L; + int32_t ** const *l_7181 = &g_6213[5][0][5]; + int32_t l_7193[2][6] = {{(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)},{(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)}}; + uint32_t l_7195[3][4][6]; + int32_t *l_7198 = NULL; + int8_t l_7302 = 2L; + uint32_t l_7440 = 0x5A1780E1L; + uint32_t ****l_7449 = &g_3376; + uint32_t **l_7519 = &g_6216; + int16_t *** const **l_7526 = NULL; + int16_t *** const ***l_7525 = &l_7526; + int32_t l_7575[5]; + int8_t l_7609[3]; + uint32_t l_7672 = 6UL; + uint16_t **l_7721 = &g_5096[8]; + int32_t l_7729 = 0xC5DD1782L; + int i, j, k; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 6; k++) + l_7195[i][j][k] = 18446744073709551607UL; + } + } + for (i = 0; i < 5; i++) + l_7575[i] = 0xA1BAE244L; + for (i = 0; i < 3; i++) + l_7609[i] = 0x5FL; +lbl_7419: + for (g_2738 = 5; (g_2738 >= 2); g_2738 -= 1) + { /* block id: 3118 */ + int16_t ***l_7142[2]; + int16_t ****l_7141 = &l_7142[1]; + int32_t l_7146[10][6][2] = {{{(-1L),1L},{1L,0xDAAFD55BL},{0xDAAFD55BL,0xC01E07ADL},{0x497F3C88L,(-1L)},{0x497F3C88L,0xC01E07ADL},{0xDAAFD55BL,0xDAAFD55BL}},{{1L,1L},{(-1L),0x497F3C88L},{1L,0L},{0xDAAFD55BL,1L},{0x497F3C88L,(-6L)},{0x497F3C88L,1L}},{{0xDAAFD55BL,0L},{1L,0x497F3C88L},{(-1L),1L},{1L,0xDAAFD55BL},{0xDAAFD55BL,0xC01E07ADL},{0x497F3C88L,(-1L)}},{{0x497F3C88L,0xC01E07ADL},{0xDAAFD55BL,0xDAAFD55BL},{1L,1L},{(-1L),0x497F3C88L},{1L,0L},{0xDAAFD55BL,1L}},{{0x497F3C88L,(-6L)},{0x497F3C88L,1L},{0xDAAFD55BL,0L},{1L,0x497F3C88L},{(-1L),1L},{1L,0xDAAFD55BL}},{{0xDAAFD55BL,0xC01E07ADL},{0x497F3C88L,(-1L)},{0x497F3C88L,0xC01E07ADL},{0xDAAFD55BL,0xDAAFD55BL},{1L,1L},{(-1L),0x497F3C88L}},{{1L,0L},{0xDAAFD55BL,1L},{0x497F3C88L,(-6L)},{0x497F3C88L,1L},{0xDAAFD55BL,0L},{1L,0x497F3C88L}},{{(-1L),1L},{1L,0xDAAFD55BL},{0xDAAFD55BL,0xC01E07ADL},{0x497F3C88L,(-1L)},{1L,(-6L)},{0x9A67B9C5L,0x9A67B9C5L}},{{(-1L),0xC01E07ADL},{(-8L),1L},{(-1L),0L},{0x9A67B9C5L,(-1L)},{1L,0x04286A4AL},{1L,(-1L)}},{{0x9A67B9C5L,0L},{(-1L),1L},{(-8L),0xC01E07ADL},{(-1L),0x9A67B9C5L},{0x9A67B9C5L,(-6L)},{1L,(-8L)}}}; + uint32_t ***l_7151 = &g_2470; + int32_t ****l_7178 = &g_6212; + int32_t ***l_7180[6] = {&g_6213[0][0][4],&g_6213[0][0][4],&g_6213[0][0][4],&g_6213[0][0][4],&g_6213[0][0][4],&g_6213[0][0][4]}; + int32_t ****l_7179 = &l_7180[3]; + int32_t ** const **l_7182 = &l_7181; + int32_t l_7187 = 0x7083F7A5L; + int32_t l_7188 = 0xF7E1E514L; + int32_t l_7189 = (-3L); + uint16_t l_7190 = 0x3C7DL; + int32_t *l_7194[5]; + int i, j, k; + for (i = 0; i < 2; i++) + l_7142[i] = &g_4618; + for (i = 0; i < 5; i++) + l_7194[i] = &l_7189; + l_7162 = ((safe_mod_func_uint32_t_u_u(((g_643[g_2738] >= (NULL != l_7141)) ^ (!(safe_sub_func_uint32_t_u_u((l_7146[8][3][1] = 0x08AF066BL), (safe_add_func_uint32_t_u_u((safe_lshift_func_uint16_t_u_s((l_7151 != NULL), 4)), g_643[g_2738])))))), (~((safe_sub_func_int8_t_s_s(((g_643[g_2738] < ((safe_sub_func_uint16_t_u_u((((safe_div_func_uint32_t_u_u((safe_mul_func_uint8_t_u_u((g_643[g_2738] | p_26), (***g_2102))), (-2L))) > l_7161) , 0UL), 0x2B87L)) , l_7161)) ^ 4294967295UL), 0UL)) || 248UL)))) || l_7161); + l_7189 ^= (safe_div_func_int32_t_s_s((l_7188 &= (safe_add_func_int32_t_s_s((safe_lshift_func_uint8_t_u_u((+(((((((((safe_add_func_uint8_t_u_u((safe_mod_func_int8_t_s_s(((safe_mul_func_uint8_t_u_u((safe_sub_func_uint16_t_u_u(((((*l_7179) = ((*l_7178) = NULL)) != ((*l_7182) = l_7181)) , (((safe_lshift_func_int8_t_s_u(p_26, 0)) < ((safe_add_func_uint16_t_u_u(l_7146[8][3][1], 0x5EB2L)) & (p_26 > p_26))) < ((*g_2442) &= (l_7187 = (g_643[g_2738] , (0x2DC26034L <= l_7161)))))), p_27)), 9L)) > 1UL), l_7162)), 0UL)) && 4294967293UL) >= g_643[g_2738]) , 0x708470FBL) , 0x6DL) || p_27) >= (*g_2286)) >= 0x80L) , l_7161)), l_7146[8][3][1])), p_27))), 0x4E0D2C3DL)); + l_7190--; + ++l_7195[1][3][3]; + for (l_7189 = 0; (l_7189 <= 2); l_7189 += 1) + { /* block id: 3132 */ + (****g_2457) = &l_7146[8][3][1]; + (*g_2460) = (l_7198 = &l_7187); + (*g_2442) = (-2L); + for (g_2712 = 0; (g_2712 <= 2); g_2712 += 1) + { /* block id: 3139 */ + (*l_7198) = p_26; + (***g_6080) = &l_7193[0][3]; + } + } + } + if (((*****g_6314) != NULL)) + { /* block id: 3145 */ + int32_t l_7209 = 6L; + int32_t *l_7211 = NULL; + uint16_t l_7295 = 1UL; + uint32_t **l_7336 = &g_3378; + uint32_t l_7351[10] = {0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL,0x8D13D5EFL}; + uint32_t l_7355 = 0x5BBD4001L; + int32_t l_7379 = 0xBE280712L; + const uint16_t *l_7385[7][8] = {{&g_622[0],NULL,&g_622[0],NULL,&g_622[0],&g_4962,&g_622[0],&g_3505[1][0]},{NULL,&g_622[0],NULL,&g_4962,&g_4962,NULL,&g_622[0],NULL},{NULL,NULL,&g_622[0],&g_622[0],&g_622[0],&g_4962,NULL,&g_4962},{&g_622[0],&g_622[0],&g_3505[1][0],&g_622[0],&g_622[0],&g_4962,NULL,&g_622[0]},{&g_622[0],NULL,&g_622[0],NULL,NULL,NULL,NULL,&g_622[0]},{&g_622[0],&g_622[0],&g_622[0],NULL,&g_622[0],&g_4962,NULL,&g_622[0]},{NULL,NULL,&g_3505[1][0],&g_622[0],&g_3505[1][0],NULL,NULL,&g_622[0]}}; + uint32_t ****l_7417 = NULL; + int32_t *l_7473 = &l_7379; + int32_t *l_7474 = &g_641; + int32_t *l_7475 = &g_641; + int32_t *l_7476[1][3]; + uint32_t l_7477 = 0xB88A4C04L; + int32_t l_7500 = 0L; + const int32_t l_7520[4][9] = {{1L,0x76EDE2A5L,0x76EDE2A5L,1L,1L,0x76EDE2A5L,0x76EDE2A5L,1L,1L},{0x44C3237FL,0xE08A2711L,0x44C3237FL,0xE08A2711L,0x44C3237FL,0xE08A2711L,0x44C3237FL,0xE08A2711L,0x44C3237FL},{1L,1L,0x76EDE2A5L,0x76EDE2A5L,1L,1L,0x76EDE2A5L,0x76EDE2A5L,1L},{0x493943B9L,0xE08A2711L,0x493943B9L,0xE08A2711L,0x493943B9L,0xE08A2711L,0x493943B9L,0xE08A2711L,0x493943B9L}}; + uint8_t ***l_7528 = &g_1949; + uint8_t l_7585 = 5UL; + uint32_t **l_7601 = &g_284[3][0]; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 3; j++) + l_7476[i][j] = NULL; + } + if ((((safe_sub_func_int32_t_s_s((safe_add_func_uint8_t_u_u(p_27, p_27)), 0xC631A1BBL)) , (((*g_4307) &= (((safe_sub_func_uint8_t_u_u(((**g_1949) = (safe_lshift_func_uint8_t_u_s((p_26 > 0x20L), (safe_sub_func_uint32_t_u_u(l_7209, ((*g_3466) || (0xA9L < p_27))))))), 255UL)) == 0L) , 0x2247L)) || 0xEE88L)) ^ p_27)) + { /* block id: 3148 */ + uint16_t *l_7210 = &g_1961; + const int32_t l_7218 = (-1L); + uint32_t *** const *l_7249 = NULL; + int32_t l_7255[9][6] = {{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL},{(-4L),0x957D00FEL,0x957D00FEL,(-4L),0x957D00FEL,0x957D00FEL}}; + int32_t l_7256 = 0x3C0195D4L; + uint32_t l_7300[10][8][3] = {{{0xD741C726L,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL}},{{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L}},{{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L}},{{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL}},{{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL}},{{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL}},{{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L}},{{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0x42089E89L},{0xF3ABBA9BL,0xD741C726L,0xF3ABBA9BL},{7UL,6UL,0x42089E89L},{7UL,7UL,6UL},{0xF3ABBA9BL,6UL,6UL},{6UL,0xD741C726L,0xD741C726L}},{{0x42089E89L,7UL,0x42089E89L},{6UL,0xF3ABBA9BL,0xD741C726L},{6UL,6UL,0xF3ABBA9BL},{0x42089E89L,0xF3ABBA9BL,0xF3ABBA9BL},{0xF3ABBA9BL,7UL,0xD741C726L},{0x42089E89L,7UL,0x42089E89L},{6UL,0xF3ABBA9BL,0xD741C726L},{6UL,6UL,0xF3ABBA9BL}},{{0x42089E89L,0xF3ABBA9BL,0xF3ABBA9BL},{0xF3ABBA9BL,7UL,0xD741C726L},{0x42089E89L,7UL,0x42089E89L},{6UL,0xF3ABBA9BL,0xD741C726L},{6UL,6UL,0xF3ABBA9BL},{0x42089E89L,0xF3ABBA9BL,0xF3ABBA9BL},{0xF3ABBA9BL,7UL,0xD741C726L},{0x42089E89L,7UL,0x42089E89L}}}; + uint16_t ** const **l_7308 = &g_3836; + int16_t **l_7362 = &g_1119[0]; + uint32_t l_7415 = 0x141A13E0L; + uint8_t **l_7427 = &g_1950; + int i, j, k; + (*****g_6078) = l_7211; + if (((*g_2442) = ((safe_div_func_uint32_t_u_u(4294967295UL, p_26)) , p_27))) + { /* block id: 3151 */ + int32_t l_7234 = 0x9881100BL; + uint16_t **l_7239 = &g_2115; + int32_t l_7257 = 0x5A690670L; + int16_t l_7301 = (-1L); + int32_t l_7312 = 0L; + int16_t l_7350 = 0xB0D0L; + int32_t l_7354[4]; + int32_t l_7374 = 0xAB47B460L; + uint32_t *l_7414 = &l_7351[2]; + int i; + for (i = 0; i < 4; i++) + l_7354[i] = 0x4505418CL; + for (g_2622 = 0; (g_2622 > (-15)); g_2622 = safe_sub_func_int32_t_s_s(g_2622, 4)) + { /* block id: 3154 */ + for (g_2613 = (-8); (g_2613 >= 26); g_2613++) + { /* block id: 3157 */ + return l_7218; + } + if (p_27) + break; + return p_27; + } + if (p_26) + { /* block id: 3163 */ + const uint32_t l_7221 = 0x6A0368A9L; + for (g_2746 = 28; (g_2746 != (-13)); g_2746 = safe_sub_func_int8_t_s_s(g_2746, 5)) + { /* block id: 3166 */ + return l_7221; + } + } + else + { /* block id: 3169 */ + int16_t l_7240 = 0x0FF8L; + int32_t l_7241 = 0xED184ED8L; + uint32_t l_7248 = 4294967295UL; + int32_t l_7284 = 0x36C55944L; + uint32_t *l_7321 = &g_4198; + int32_t * const **l_7349 = NULL; + uint32_t l_7352 = 0UL; + uint8_t l_7353[7] = {0x9BL,0x9BL,0x9BL,0x9BL,0x9BL,0x9BL,0x9BL}; + uint16_t *l_7357[5] = {&g_5310,&g_5310,&g_5310,&g_5310,&g_5310}; + int32_t l_7381 = 0x9C5EA17FL; + uint8_t l_7393 = 1UL; + int i; + if ((safe_rshift_func_uint8_t_u_s((!(safe_add_func_uint32_t_u_u((l_7241 = (safe_rshift_func_int16_t_s_s((l_7240 = ((+p_27) >= (((p_26 , (safe_add_func_uint8_t_u_u((l_7218 ^ ((*g_65) = p_27)), 0xBCL))) == 0x7D6A2031L) < ((***g_2102) = (safe_add_func_int32_t_s_s(l_7234, ((safe_lshift_func_int16_t_s_s(p_27, 12)) < (~(!(l_7239 == l_7239)))))))))), l_7241))), 0x0EC93635L))), l_7234))) + { /* block id: 3174 */ + int32_t l_7254 = 7L; + uint32_t ****l_7260 = &g_3376; + uint32_t l_7283 = 0xC2E3E759L; + l_7256 = ((p_26 ^ ((safe_add_func_uint16_t_u_u(((((l_7255[0][0] = (safe_mul_func_uint8_t_u_u((!(((((*g_2442) = (l_7248 = ((~1UL) != l_7241))) < (((*g_3102) >= p_26) <= (((((((((NULL != l_7249) ^ (safe_mul_func_uint8_t_u_u((1UL != (safe_sub_func_uint16_t_u_u(((p_27 , 0x12L) >= (-6L)), p_27))), l_7234))) != p_27) <= 3UL) || (*g_3466)) != l_7254) , 0x1AE6350AL) , 255UL) && 2UL))) , p_27) ^ p_26)), 1L))) <= p_27) == p_27) ^ l_7240), 65535UL)) > 1UL)) && (-1L)); + (*g_2442) = ((l_7255[0][0] = (l_7257 |= (0x99L < 3UL))) != (&g_3376 != ((safe_rshift_func_uint16_t_u_s((0x8A53124DL != l_7234), 0)) , l_7260))); + l_7284 = (safe_mod_func_uint32_t_u_u(((safe_mod_func_int8_t_s_s((l_7234 ^ ((***g_2102) &= (safe_sub_func_uint16_t_u_u(((l_7257 & (((p_27 ^ (l_7241 ^= (safe_mul_func_int8_t_s_s((safe_add_func_int32_t_s_s(1L, (safe_div_func_int16_t_s_s((safe_sub_func_uint16_t_u_u((safe_lshift_func_int8_t_s_s((safe_sub_func_int8_t_s_s(((g_7279 & 2L) , (~((*g_65) |= ((((*g_6315) != NULL) >= (safe_add_func_uint8_t_u_u(((p_27 , l_7234) , p_26), 0L))) == 0UL)))), l_7248)), p_26)), l_7283)), p_27)))), l_7240)))) , 1UL) , 1UL)) , (*g_2115)), p_26)))), 255UL)) && p_26), p_27)); + l_7302 ^= ((0UL > ((((--(**g_1949)) || (safe_rshift_func_int16_t_s_s((safe_div_func_int16_t_s_s((((l_7284 = (safe_lshift_func_int16_t_s_s(((*g_4307) = l_7255[6][1]), (safe_add_func_uint8_t_u_u(((l_7295 , p_26) <= 0UL), (246UL != (l_7257 > l_7256))))))) >= (safe_div_func_int8_t_s_s((safe_sub_func_int8_t_s_s((l_7283 > 2UL), l_7300[6][5][1])), l_7254))) , 2L), p_27)), p_26))) && 0xB5L) , p_27)) , l_7301); + } + else + { /* block id: 3190 */ + uint32_t l_7303[2][7][1] = {{{1UL},{0x6075C13AL},{1UL},{0x6075C13AL},{1UL},{0x6075C13AL},{1UL}},{{0x6075C13AL},{1UL},{0x6075C13AL},{1UL},{0x6075C13AL},{1UL},{0x6075C13AL}}}; + int32_t l_7311 = (-7L); + int i, j, k; + l_7303[0][4][0] |= 0x57C8D395L; + (*g_2460) = NULL; + l_7256 &= (safe_div_func_uint16_t_u_u((&g_3622 == (((*g_4307) = (safe_rshift_func_uint8_t_u_u(p_27, 4))) , l_7308)), (safe_mul_func_uint8_t_u_u(((((((l_7300[4][7][0] , 0x25FB0083L) , (uint16_t***) NULL) == (l_7234 , ((0x8181L > (l_7311 |= (p_27 || 0xB82205B7L))) , (uint16_t***) NULL))) , l_7312) | p_26) && 1L), (***g_6991))))); + (*g_2442) = p_26; + } + (*g_7356) = (((l_7255[4][1] = (p_26 & (0xF1619DF5L == ((safe_rshift_func_uint8_t_u_s(((((**g_2285) = ((safe_lshift_func_uint8_t_u_u((safe_mul_func_int8_t_s_s((safe_mod_func_int16_t_s_s(((0xC2D74987L & (l_7321 == ((safe_lshift_func_uint16_t_u_u(0x218EL, 9)) , (*g_6792)))) || (*g_4307)), 4L)), 0x15L)), l_7300[8][6][2])) || l_7301)) == 0x08CDEDC7L) , (***g_6991)), 1)) || p_27)))) , l_7336) != NULL); + if ((safe_sub_func_uint32_t_u_u(((safe_mul_func_int8_t_s_s((((*g_2446) = ((((*g_1117) != l_7362) , p_26) >= (safe_div_func_int16_t_s_s((safe_sub_func_int8_t_s_s(((((!(safe_add_func_int32_t_s_s((safe_lshift_func_int16_t_s_u(p_27, 11)), p_26))) , ((((safe_sub_func_int8_t_s_s(p_27, l_7374)) , (**g_2285)) ^ ((l_7255[0][0] = 0x2DL) <= p_27)) || p_26)) , p_27) ^ 0xB00D12D8L), l_7257)), 1UL)))) , p_26), (***g_6991))) , p_27), p_26))) + { /* block id: 3210 */ + int32_t *l_7375 = &l_7255[0][0]; + int32_t *l_7376 = &g_254; + int32_t *l_7377 = &l_7241; + int32_t *l_7378[1][2]; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + l_7378[i][j] = &g_254; + } + (*****g_6078) = l_7211; + g_7382--; + } + else + { /* block id: 3213 */ +lbl_7418: + (*g_809) = &l_7255[3][4]; + l_7257 = ((*g_65) = (NULL == l_7385[0][5])); + (*g_65) |= l_7312; + } + for (g_2648 = 0; (g_2648 == 3); g_2648++) + { /* block id: 3221 */ + uint32_t l_7416[2]; + int i; + for (i = 0; i < 2; i++) + l_7416[i] = 5UL; + (*g_65) = (safe_div_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u((((safe_unary_minus_func_uint32_t_u(l_7393)) != (safe_add_func_int32_t_s_s((safe_mod_func_int16_t_s_s(p_27, ((*g_4307) ^= ((((safe_lshift_func_uint8_t_u_u((safe_mod_func_int32_t_s_s(((safe_sub_func_int32_t_s_s((safe_lshift_func_uint16_t_u_u((((safe_div_func_int32_t_s_s((safe_mul_func_int16_t_s_s(((safe_rshift_func_uint8_t_u_s(p_27, 0)) , (-1L)), (safe_div_func_uint8_t_u_u((NULL != l_7414), 1UL)))), 5UL)) & ((((((l_7415 |= 0x7CL) || p_26) <= p_26) != 0x8FE4L) | l_7416[1]) >= l_7353[4])) != 1UL), 10)), 0xFB761E78L)) <= 0UL), (**g_2285))), p_27)) , &g_3376) != l_7417) == p_26)))), p_26))) , 0UL), l_7301)), p_26)); + if (g_3467) + goto lbl_7418; + l_7241 = 0x6502CA6FL; + if (l_7240) + goto lbl_7419; + } + } + for (g_2748 = 0; (g_2748 <= 29); g_2748 = safe_add_func_int16_t_s_s(g_2748, 1)) + { /* block id: 3232 */ + uint8_t **l_7426 = NULL; + int32_t l_7428 = 0xAEBDD5C6L; + if ((~(p_27 != (safe_sub_func_uint32_t_u_u((+((*g_4307) = (((*g_3102) = p_26) || (l_7426 != l_7427)))), l_7428))))) + { /* block id: 3235 */ + int32_t l_7429 = 0x4FA4196AL; + uint32_t * const l_7452 = &g_2280; + uint8_t l_7453[5][3][6] = {{{251UL,255UL,248UL,251UL,0x45L,8UL},{251UL,0x45L,8UL,255UL,255UL,8UL},{0xCAL,0xCAL,248UL,0xEEL,255UL,246UL}},{{255UL,0x45L,0x2CL,0xEEL,0x45L,248UL},{0xCAL,255UL,0x2CL,255UL,0xCAL,246UL},{251UL,255UL,248UL,251UL,0x45L,8UL}},{{251UL,0x45L,8UL,255UL,255UL,8UL},{0xCAL,0xCAL,248UL,0xEEL,255UL,246UL},{255UL,0x45L,0x2CL,0xEEL,0x45L,248UL}},{{0xCAL,255UL,0x2CL,255UL,0xCAL,246UL},{251UL,255UL,248UL,251UL,0x45L,8UL},{251UL,0x45L,8UL,255UL,255UL,8UL}},{{0xCAL,0xCAL,248UL,0xEEL,255UL,246UL},{255UL,0x45L,0x2CL,0xEEL,0x45L,248UL},{0xCAL,255UL,0x2CL,255UL,0xCAL,246UL}}}; + int i, j, k; + l_7255[0][5] = ((l_7429 , ((safe_sub_func_int8_t_s_s(((p_26 | (l_7428 || (0xCC54L ^ (++(*g_2115))))) , (safe_div_func_uint8_t_u_u((safe_rshift_func_uint8_t_u_u(0xA6L, (!p_27))), (~(l_7440 == ((((((safe_sub_func_uint32_t_u_u((((((safe_add_func_int8_t_s_s((safe_unary_minus_func_uint32_t_u(l_7428)), (safe_rshift_func_int16_t_s_u((+(((l_7428 == (**g_1949)) | p_26) == 248UL)), 11)))) >= (*g_2286)) , &g_3376) == l_7449) >= p_27), l_7429)) >= 0xAB3579C4L) , (*g_3466)) & p_26) , l_7218) > 0L)))))), l_7429)) , p_27)) >= (**g_2285)); + l_7429 = (((l_7374 >= (safe_sub_func_uint16_t_u_u(65526UL, (((l_7452 == ((l_7453[3][1][3] ^ ((safe_add_func_int16_t_s_s((safe_rshift_func_int8_t_s_s((((safe_sub_func_uint32_t_u_u((safe_mul_func_uint8_t_u_u(0UL, 1L)), (safe_div_func_int32_t_s_s(0x8B18FD82L, (safe_mul_func_uint16_t_u_u(((*g_2115) = (safe_div_func_int16_t_s_s((+p_27), (safe_mul_func_int16_t_s_s(p_26, 0x94EEL))))), 65535UL)))))) || 0x72B082A3L) && l_7453[4][1][4]), l_7428)), p_27)) < p_26)) , (uint32_t*) NULL)) > 0xA522L) , p_27)))) , p_27) , l_7255[7][5]); + } + else + { /* block id: 3240 */ + (***g_2458) = &l_7379; + } + } + } + else + { /* block id: 3244 */ + int16_t **l_7471[10][9][2]; + int i, j, k; + for (i = 0; i < 10; i++) + { + for (j = 0; j < 9; j++) + { + for (k = 0; k < 2; k++) + l_7471[i][j][k] = &g_1119[1]; + } + } + (*g_1117) = l_7471[5][5][0]; + } + } + else + { /* block id: 3247 */ + int32_t *l_7472 = &g_4886; + (***g_6080) = l_7472; + (***g_6080) = &l_7162; + } + l_7477++; + for (g_1844 = (-15); (g_1844 != 55); g_1844 = safe_add_func_uint8_t_u_u(g_1844, 5)) + { /* block id: 3254 */ + (*l_7475) &= p_26; + } + for (g_2783 = 0; (g_2783 == 7); g_2783 = safe_add_func_uint8_t_u_u(g_2783, 3)) + { /* block id: 3259 */ + uint32_t l_7494 = 4294967290UL; + uint16_t *l_7495 = &g_4962; + uint8_t l_7498 = 255UL; + uint32_t l_7499 = 8UL; + int32_t l_7527 = 0x6980B8B4L; + int32_t l_7567 = 0x3AA8436AL; + int8_t l_7576 = (-10L); + int32_t l_7577[4][2] = {{0x7F85A7FDL,0x7F85A7FDL},{0x7F85A7FDL,0x7F85A7FDL},{0x7F85A7FDL,0x7F85A7FDL},{0x7F85A7FDL,0x7F85A7FDL}}; + uint16_t l_7578 = 0x98ECL; + int32_t ***l_7608[6][5] = {{&g_224,NULL,&g_224,&g_224,&g_224},{&g_224,&g_224,&g_224,NULL,NULL},{&g_224,&g_224,&g_224,NULL,&g_224},{&g_224,NULL,&g_224,NULL,NULL},{&g_224,&g_224,&g_224,&g_224,&g_224},{&g_224,&g_224,&g_224,NULL,&g_224}}; + int i, j; + if ((((safe_mul_func_uint16_t_u_u(((safe_mod_func_int32_t_s_s((safe_rshift_func_uint16_t_u_s((*g_2115), (*l_7475))), 0xB6B452FFL)) == (*l_7474)), (((safe_rshift_func_int16_t_s_s((p_27 != (safe_lshift_func_int8_t_s_s((((*l_7495) = (l_7494 != l_7494)) & (safe_mul_func_int16_t_s_s((-5L), l_7498))), l_7499))), p_26)) , p_26) < 65527UL))) && l_7500) && l_7499)) + { /* block id: 3261 */ + int32_t l_7505 = 0xD60B8108L; + uint32_t *l_7556 = &g_6022[3][1]; + int32_t l_7557 = (-8L); + int32_t l_7573[6][7][6] = {{{0x2E65C68BL,0xB573E327L,0x2E65C68BL,0x5F434B5AL,0xFD63609CL,0xD271C27CL},{0x5F434B5AL,0xFD63609CL,0xD271C27CL,0x1A29EAC0L,0x71214B1BL,0L},{0x5D64C1A4L,0xD271C27CL,(-9L),0x1A29EAC0L,0x5F434B5AL,0x5F434B5AL},{0x5F434B5AL,0x05B540A9L,0x05B540A9L,0x5F434B5AL,0xE539DC15L,0xD1F2138BL},{0x2E65C68BL,0x5D64C1A4L,0L,0xB573E327L,(-9L),0L},{(-1L),0x1A29EAC0L,0xD3CB1D23L,0xA77FB132L,(-9L),0xFD63609CL},{0xE539DC15L,0x5D64C1A4L,0x5F434B5AL,0x5D64C1A4L,0xE539DC15L,0xA77FB132L}},{{0xD3CB1D23L,0x05B540A9L,6L,0xD1F2138BL,0x5F434B5AL,(-1L)},{6L,0xD271C27CL,0xE539DC15L,0x05B540A9L,0x71214B1BL,(-1L)},{0xA77FB132L,0xFD63609CL,6L,6L,0xFD63609CL,0xA77FB132L},{0x71214B1BL,0xB573E327L,0x5F434B5AL,(-9L),0xD3CB1D23L,0xFD63609CL},{0xB573E327L,0xE539DC15L,0xD3CB1D23L,0L,0x1A29EAC0L,0L},{0xB573E327L,0xD1F2138BL,0L,(-9L),0L,0xD1F2138BL},{0x71214B1BL,0xD3CB1D23L,0x05B540A9L,6L,0xD1F2138BL,0x5F434B5AL}},{{0xA77FB132L,0x2E65C68BL,(-9L),0x05B540A9L,(-1L),0L},{6L,0x2E65C68BL,0xD271C27CL,0xD1F2138BL,0xD1F2138BL,0xD271C27CL},{0xD3CB1D23L,0xD3CB1D23L,0x2E65C68BL,0x5D64C1A4L,0L,0xB573E327L},{0xE539DC15L,0xD1F2138BL,0L,0xA77FB132L,0x1A29EAC0L,0x2E65C68BL},{(-1L),0xE539DC15L,0L,0xB573E327L,0xD3CB1D23L,0xB573E327L},{0x2E65C68BL,0xB573E327L,0x2E65C68BL,0x5F434B5AL,0xFD63609CL,0xD271C27CL},{0x5F434B5AL,0xFD63609CL,0xD271C27CL,0x1A29EAC0L,0x71214B1BL,0L}},{{0x5D64C1A4L,0xD271C27CL,(-9L),0x1A29EAC0L,0x5F434B5AL,0x5F434B5AL},{0x5F434B5AL,0x05B540A9L,0x05B540A9L,0x5F434B5AL,0xE539DC15L,0xD1F2138BL},{0x2E65C68BL,0x5D64C1A4L,0L,0xB573E327L,(-9L),0L},{(-1L),0x1A29EAC0L,0xD3CB1D23L,0xA77FB132L,(-9L),0xFD63609CL},{0xE539DC15L,0x5D64C1A4L,0x5F434B5AL,0x5D64C1A4L,0xE539DC15L,0xA77FB132L},{0xD3CB1D23L,0x05B540A9L,6L,0xD1F2138BL,0x5F434B5AL,(-1L)},{6L,0xD271C27CL,0xE539DC15L,0x05B540A9L,0x71214B1BL,(-1L)}},{{0xA77FB132L,0xFD63609CL,6L,6L,0xFD63609CL,0xA77FB132L},{0x71214B1BL,0xB573E327L,0x5F434B5AL,(-9L),0xD3CB1D23L,0x1A29EAC0L},{0xD271C27CL,0x5D64C1A4L,(-1L),0xE539DC15L,0L,0xB573E327L},{0xD271C27CL,0L,0xE539DC15L,6L,0xE539DC15L,0L},{0xD1F2138BL,(-1L),0xD3CB1D23L,0x5F434B5AL,0L,0x2E65C68BL},{(-9L),0x71214B1BL,6L,0xD3CB1D23L,0L,0xE539DC15L},{0x5F434B5AL,0x71214B1BL,0xA77FB132L,0L,0L,0xA77FB132L}},{{(-1L),(-1L),0x71214B1BL,0x05B540A9L,0xE539DC15L,0xD271C27CL},{0x5D64C1A4L,0L,0xB573E327L,(-9L),0L,0x71214B1BL},{0L,0x5D64C1A4L,0xB573E327L,0xD271C27CL,(-1L),0xD271C27CL},{0x71214B1BL,0xD271C27CL,0x71214B1BL,0x2E65C68BL,0x1A29EAC0L,0xA77FB132L},{0x2E65C68BL,0x1A29EAC0L,0xA77FB132L,0L,0xD1F2138BL,0xE539DC15L},{0x05B540A9L,0xA77FB132L,6L,0L,0x2E65C68BL,0x2E65C68BL},{0x2E65C68BL,0xD3CB1D23L,0xD3CB1D23L,0x2E65C68BL,0x5D64C1A4L,0L}}}; + int i, j, k; + for (g_3459 = 0; (g_3459 == 23); g_3459++) + { /* block id: 3264 */ + int32_t ******l_7510 = &g_3277; + int16_t ***l_7524 = &g_1118; + int16_t ****l_7523 = &l_7524; + int16_t **** const *l_7522 = &l_7523; + int16_t **** const **l_7521 = &l_7522; + int32_t l_7529 = 0x1F8C9C4AL; + int32_t l_7569 = 0xC3267DC2L; + int32_t l_7572[6]; + int i; + for (i = 0; i < 6; i++) + l_7572[i] = 0x9E9193C4L; + for (g_48 = (-28); (g_48 != 19); g_48++) + { /* block id: 3267 */ + if (l_7505) + break; + } + if (((((safe_lshift_func_int16_t_s_u((*g_4307), l_7440)) & ((***g_2102) |= (*l_7474))) , l_7498) || ((safe_div_func_uint8_t_u_u((((l_7510 == l_7510) >= ((l_7529 = (safe_add_func_uint8_t_u_u((((safe_lshift_func_int8_t_s_s((((safe_mul_func_uint8_t_u_u((0xEBL || (l_7505 , (((NULL == l_7519) != 0x2E4D3A5AL) > l_7505))), l_7520[2][0])) , l_7521) == l_7525), l_7527)) , l_7528) != (*g_6990)), 0UL))) , p_26)) < l_7494), 7UL)) >= p_26))) + { /* block id: 3272 */ + uint32_t l_7530[10][9][2] = {{{1UL,0UL},{18446744073709551612UL,1UL},{0UL,8UL},{0xBA59C8C1L,0xBA59C8C1L},{0UL,5UL},{1UL,0x3F31BB72L},{0UL,0x732053EDL},{18446744073709551611UL,0UL},{0xD498FD51L,1UL}},{{0xD498FD51L,0UL},{18446744073709551611UL,0x732053EDL},{0UL,0x3F31BB72L},{1UL,5UL},{0UL,0xBA59C8C1L},{0xBA59C8C1L,8UL},{0UL,1UL},{18446744073709551612UL,0UL},{1UL,18446744073709551615UL}},{{8UL,18446744073709551612UL},{1UL,5UL},{18446744073709551615UL,18446744073709551611UL},{0x732053EDL,0UL},{4UL,1UL},{0x3F31BB72L,18446744073709551615UL},{0xB6524629L,0xCDC27C53L},{0UL,0xD498FD51L},{1UL,4UL}},{{18446744073709551609UL,1UL},{18446744073709551615UL,0xFA1B2E63L},{5UL,1UL},{5UL,18446744073709551609UL},{0xCDC27C53L,0xB6524629L},{0xFA1B2E63L,0UL},{1UL,0UL},{0xFA1B2E63L,0xB6524629L},{0xCDC27C53L,18446744073709551609UL}},{{5UL,1UL},{5UL,0xFA1B2E63L},{18446744073709551615UL,1UL},{18446744073709551609UL,4UL},{1UL,0xD498FD51L},{0UL,0xCDC27C53L},{0xB6524629L,18446744073709551615UL},{0x3F31BB72L,1UL},{4UL,0UL}},{{0x732053EDL,18446744073709551611UL},{18446744073709551615UL,5UL},{1UL,18446744073709551612UL},{8UL,18446744073709551615UL},{1UL,0UL},{18446744073709551612UL,1UL},{0UL,8UL},{0xBA59C8C1L,0xBA59C8C1L},{0UL,5UL}},{{1UL,0x3F31BB72L},{0UL,0x732053EDL},{18446744073709551611UL,0UL},{0xD498FD51L,1UL},{0xD498FD51L,0xAA9BD53FL},{0x903D483CL,0xE2F5E56BL},{0xAA9BD53FL,8UL},{0UL,18446744073709551609UL},{0UL,0xC5282BA2L}},{{0xC5282BA2L,0x8C1E6EF7L},{0UL,18446744073709551615UL},{18446744073709551615UL,0UL},{18446744073709551607UL,0UL},{0x8C1E6EF7L,18446744073709551615UL},{0UL,0UL},{1UL,0x903D483CL},{0xE2F5E56BL,1UL},{0xFA1B2E63L,18446744073709551615UL}},{{8UL,1UL},{0x119EE3AAL,0x54265742L},{1UL,0UL},{0UL,0xFA1B2E63L},{18446744073709551609UL,18446744073709551607UL},{0UL,9UL},{0UL,18446744073709551615UL},{18446744073709551609UL,18446744073709551609UL},{0x54265742L,0x119EE3AAL}},{{9UL,0UL},{0UL,0UL},{9UL,0x119EE3AAL},{0x54265742L,18446744073709551609UL},{18446744073709551609UL,18446744073709551615UL},{0UL,9UL},{0UL,18446744073709551607UL},{18446744073709551609UL,0xFA1B2E63L},{0UL,0UL}}}; + int i, j, k; + (*g_2442) &= l_7530[2][6][1]; + (*l_7473) &= 0xAD5A2DB1L; + } + else + { /* block id: 3275 */ + int16_t l_7533 = 1L; + (*l_7475) |= ((((safe_rshift_func_int8_t_s_s(((((p_27 | ((0xFBBAL > (l_7533 ^ ((safe_add_func_uint16_t_u_u(((safe_mul_func_uint8_t_u_u(((safe_lshift_func_int16_t_s_s((safe_rshift_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s((~(l_7505 = ((*g_65) = (!(safe_div_func_uint8_t_u_u((((safe_rshift_func_uint16_t_u_s((safe_mul_func_uint16_t_u_u((p_27 <= 0x7B717F75L), ((((*g_2442) = (safe_sub_func_int8_t_s_s(((safe_mul_func_int8_t_s_s(0x07L, p_27)) <= (l_7556 == ((*g_2470) = &l_7355))), 0x29L))) & p_27) >= 4294967295UL))), 2)) , p_26) != 0x9FC9L), p_27)))))), 7)), l_7533)), 3)) || 0x91FC8B71L), (-5L))) ^ l_7499), p_26)) | l_7557))) || p_26)) , 255UL) & l_7499) >= p_26), l_7557)) < (-7L)) != p_26) , p_26); + l_7557 |= (((safe_sub_func_int32_t_s_s((l_7533 <= (safe_lshift_func_int16_t_s_s(((!((p_27 || p_26) & l_7533)) , (-1L)), ((l_7499 == ((0x95BCL && (safe_mul_func_uint16_t_u_u(p_27, (((((safe_mul_func_uint8_t_u_u(((**g_1949) = (l_7533 & p_27)), p_26)) == p_26) > 0x58L) >= l_7567) == 0UL)))) == p_27)) , l_7505)))), (*l_7475))) , 0xC6L) || l_7533); + } + if (l_7557) + { /* block id: 3284 */ + if (l_7505) + goto lbl_7419; + } + else + { /* block id: 3286 */ + int16_t l_7568 = 0x9319L; + int32_t l_7570 = (-1L); + int32_t l_7571 = (-9L); + int32_t l_7574[8] = {0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L,0x3AFCCA44L}; + int i; + l_7578++; + } + } + return p_26; + } + else + { /* block id: 3291 */ + int32_t l_7584 = 1L; + int32_t l_7592 = 0x96B79697L; + int32_t l_7594 = 0x978E78E5L; + int32_t l_7595 = 0L; + if ((*l_7475)) + { /* block id: 3292 */ + int8_t l_7581 = 0x1DL; + int32_t l_7582 = 7L; + int32_t l_7583 = 1L; + --l_7585; + for (g_6438 = 0; (g_6438 <= 1); g_6438 += 1) + { /* block id: 3296 */ + int i, j; + (*l_7473) = (safe_unary_minus_func_int8_t_s(g_2659[g_6438][(g_6438 + 3)])); + (*g_7356) &= g_2670[(g_6438 + 2)]; + if (g_460[(g_6438 + 5)]) + continue; + if (l_7581) + break; + } + g_7589--; + } + else + { /* block id: 3303 */ + int32_t l_7593[7]; + uint32_t l_7596 = 0x18D655FEL; + uint32_t **l_7602 = &g_284[0][1]; + const int32_t ***l_7607 = &g_2460; + int i; + for (i = 0; i < 7; i++) + l_7593[i] = (-10L); + ++l_7596; + l_7592 &= ((safe_mod_func_uint8_t_u_u(((((p_26 ^ (l_7601 == l_7602)) , ((**g_2285) = 0xE8B6983BL)) ^ (safe_unary_minus_func_int32_t_s((p_27 , p_27)))) >= ((*g_2446) , ((((*l_7474) = p_26) >= 0UL) & l_7527))), p_27)) , l_7593[1]); + if (((p_27 == (-1L)) < (l_7609[0] = (((*l_7474) , (p_26 | (~p_27))) , ((safe_div_func_int16_t_s_s((1UL || (((((**g_2457) = l_7607) == ((**g_3277) = l_7608[5][4])) != ((((*g_2115) = 65528UL) && p_26) >= p_27)) == 0x2FL)), p_26)) ^ l_7592))))) + { /* block id: 3312 */ + uint32_t l_7610 = 4294967295UL; + l_7610--; + (***g_2458) = ((0x2AL == (safe_unary_minus_func_uint16_t_u((safe_lshift_func_int8_t_s_s(l_7592, 4))))) , &l_7162); + } + else + { /* block id: 3315 */ + l_7594 = p_27; + return p_27; + } + } + for (g_2490 = 0; (g_2490 < (-17)); g_2490 = safe_sub_func_int16_t_s_s(g_2490, 1)) + { /* block id: 3322 */ + (*g_809) = &l_7379; + (*l_7474) = p_26; + for (g_2769 = 0; (g_2769 <= 8); g_2769 += 1) + { /* block id: 3327 */ + int16_t l_7618 = 0x70BAL; + (*l_7473) = (l_7618 = (-3L)); + } + } + } + } + } + else + { /* block id: 3334 */ + int32_t l_7627 = 0x7D747A9DL; + int32_t l_7637 = 0xB81B01CCL; + int16_t ***l_7641 = &g_4618; + int32_t ** const ** const l_7649 = NULL; + int32_t l_7692 = 0x187DEDC4L; + int32_t l_7695 = 1L; + int32_t l_7696 = 1L; + int32_t l_7697[2]; + int16_t l_7698 = 3L; + uint32_t l_7700 = 0x2C4F666BL; + int32_t l_7722 = 0x27F2479EL; + uint32_t l_7730 = 0UL; + int i; + for (i = 0; i < 2; i++) + l_7697[i] = 1L; +lbl_7673: + (*g_7356) ^= (*g_2442); + for (g_2800 = 7; (g_2800 >= 0); g_2800 -= 1) + { /* block id: 3338 */ + int32_t l_7619 = 0x70A81F96L; + int32_t l_7620 = 0x45923820L; + int8_t *** const l_7635 = &g_539; + int32_t l_7636 = (-8L); + int32_t *******l_7648[8][3][2] = {{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}},{{&g_3276,NULL},{&g_3276,&g_3276},{&g_3276,&g_3276}}}; + int8_t ****l_7660[8] = {&g_540,&g_540,&g_540,&g_540,&g_540,&g_540,&g_540,&g_540}; + int8_t *****l_7659 = &l_7660[1]; + int32_t **l_7671 = &g_2446; + int8_t l_7723 = 0xA6L; + const int8_t l_7728 = 1L; + int i, j, k; + l_7620 = l_7619; + if ((((safe_sub_func_uint8_t_u_u(((safe_add_func_int32_t_s_s((*g_7356), (safe_mul_func_uint16_t_u_u(p_26, (l_7627 && ((~(((safe_mul_func_uint16_t_u_u(p_26, l_7619)) <= (safe_div_func_int16_t_s_s((l_7620 = 0x0804L), ((p_27 == (safe_lshift_func_int8_t_s_s(l_7619, 5))) || (((((l_7636 = ((*g_2286) = (&g_539 == l_7635))) != l_7627) <= 0x14D61557L) ^ 0UL) && l_7636))))) <= l_7637)) != 0xB2L)))))) < 0xD75EE240L), p_26)) | 0x4C66L) != p_26)) + { /* block id: 3343 */ + int32_t ** const ** const l_7638 = &g_808[5]; + int32_t *******l_7647[9][3] = {{NULL,&g_3276,&g_3276},{&g_3276,&g_3276,&g_3276},{NULL,NULL,&g_3276},{&g_3276,&g_3276,&g_3276},{NULL,&g_3276,&g_3276},{&g_3276,&g_3276,&g_3276},{NULL,NULL,&g_3276},{&g_3276,&g_3276,&g_3276},{NULL,&g_3276,&g_3276}}; + uint32_t *** const l_7656 = &l_7519; + int8_t ** const **l_7663 = NULL; + int8_t ** const ***l_7662 = &l_7663; + int8_t ** const ****l_7661 = &l_7662; + int32_t **l_7670 = &g_2446; + int8_t l_7699[7]; + int i, j; + for (i = 0; i < 7; i++) + l_7699[i] = 0x62L; + (*g_2442) = ((l_7638 != ((safe_add_func_int16_t_s_s((NULL == l_7641), ((safe_mul_func_int16_t_s_s((((l_7195[1][3][3] < ((0x660D6D90L != (safe_div_func_int32_t_s_s((~(((*g_2446) = p_27) , (l_7647[3][0] == l_7648[0][2][1]))), (p_27 & l_7637)))) && 0x6BD2CCABL)) && l_7637) & 0x3D30L), 65535UL)) >= l_7637))) , l_7649)) && p_27); + (****g_6079) = &l_7193[0][3]; + for (l_7302 = 0; (l_7302 <= 1); l_7302 += 1) + { /* block id: 3350 */ + int16_t l_7690 = 0xC346L; + int32_t l_7693 = (-9L); + int32_t l_7694[4][9] = {{0L,0L,0x8788C335L,0L,0L,(-6L),0L,0L,0x8788C335L},{0x16BA3F95L,0x16BA3F95L,1L,0x16BA3F95L,0x16BA3F95L,1L,0x16BA3F95L,0x16BA3F95L,1L},{0L,0L,0x8788C335L,0L,0L,(-6L),0L,0L,0x8788C335L},{0x16BA3F95L,0x16BA3F95L,1L,0x16BA3F95L,0x16BA3F95L,1L,0x16BA3F95L,0x16BA3F95L,1L}}; + int i, j; + for (g_765 = 2; (g_765 <= 7); g_765 += 1) + { /* block id: 3353 */ + int32_t *l_7691[1]; + int i, j, k; + for (i = 0; i < 1; i++) + l_7691[i] = NULL; + if (g_463) + goto lbl_7673; + if (g_621) + goto lbl_7419; + (*g_7356) &= (safe_unary_minus_func_int32_t_s((safe_mod_func_int8_t_s_s((safe_add_func_int8_t_s_s(g_2612[(l_7302 + 2)], (((0xD329L == (((g_2718[(l_7302 + 1)][l_7302][(g_2800 + 1)] || (safe_mod_func_uint8_t_u_u(255UL, p_27))) && (safe_lshift_func_uint8_t_u_u(((**g_1949) = (((safe_rshift_func_int16_t_s_s(((!(safe_mod_func_int16_t_s_s(0xFD6DL, (safe_rshift_func_uint8_t_u_u(0x02L, 6))))) && ((p_26 >= (NULL != &g_6990)) , p_26)), p_27)) , (*g_2286)) <= p_27)), l_7690))) | 0xC5336E4BL)) , g_2612[(l_7302 + 2)]) && p_26))), p_26)))); + l_7691[0] = &l_7627; + } + l_7700++; + if (l_7690) + continue; + } + } + else + { /* block id: 3363 */ + uint32_t l_7703 = 0x589DA82BL; + uint16_t **l_7720 = &g_2115; + int32_t l_7725 = 0x090FAF84L; + for (g_48 = 2; (g_48 <= 7); g_48 += 1) + { /* block id: 3366 */ + uint32_t l_7724 = 0x7020694CL; + l_7703--; + (*g_65) = (l_7725 = ((((((safe_add_func_int8_t_s_s((l_7723 = ((p_27 ^ ((((1L >= (safe_mod_func_int16_t_s_s((+p_27), ((safe_add_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u((safe_add_func_int16_t_s_s(p_27, (l_7722 = ((((l_7703 , p_26) || ((((**l_7721) |= ((+(safe_sub_func_int8_t_s_s((l_7720 == l_7721), ((*g_1950) = (*g_1950))))) > 65535UL)) <= p_27) || 0x4D4857A7L)) < p_26) >= l_7703)))), p_27)), p_26)) & p_26)))) == 1L) < 0x7740E7A3L) <= 0x1CD3ED32L)) <= l_7703)), l_7703)) >= 0xCBC61C4DL) & l_7724) , (****g_6990)) != 1UL) ^ 0x7FD2C732L)); + } + for (g_2692 = 0; (g_2692 <= 7); g_2692 += 1) + { /* block id: 3377 */ + uint32_t l_7727 = 18446744073709551609UL; + if (l_7609[1]) + break; + for (l_7302 = 7; (l_7302 >= 0); l_7302 -= 1) + { /* block id: 3381 */ + const uint8_t l_7726 = 254UL; + return l_7726; + } + l_7727 = ((*g_65) |= p_26); + } + return l_7728; + } + --l_7730; + if (g_621) + goto lbl_7419; + } + } + return l_7609[0]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_65 g_48 g_46 g_2758 g_809 g_4307 g_2285 g_2286 g_2287 g_2757 g_538 g_539 g_262 g_2683 g_635 g_462 g_2102 g_1949 g_1950 g_810 g_463 g_450 g_2687 g_644 g_2659 g_3836 g_3170 g_2442 g_4962 g_45 g_224 g_225 g_3277 g_1352 g_3102 g_622 g_3466 g_3467 g_2760 g_2720 g_206 g_255 g_2457 g_2458 g_2459 g_2460 g_459 g_2703 g_3377 g_3378 g_2628 g_466 g_621 g_254 g_641 g_5096 g_405 g_1577 g_2719 g_1859 g_2115 g_2595 g_2446 g_5400 g_4961 g_2678 g_5312 g_3714 g_4308 g_5637 g_2470 g_284 g_540 g_4618 g_5311 g_5786 g_2576 g_2727 g_643 g_3622 g_1103 g_5857 g_1119 g_6022 g_2662 g_2690 g_2772 g_6078 g_3376 g_2706 g_5261 g_282 g_6166 g_6212 g_6216 g_6313 g_6317 g_6318 g_6319 g_6314 g_6315 g_6316 g_6372 g_6080 g_808 g_6438 g_2798 g_3505 g_3459 g_4424 g_2674 g_2740 g_2773 g_4886 g_6191 g_2579 g_2777 g_6079 g_2608 g_2694 g_2794 + * writes: g_2758 g_810 g_2657 g_4308 g_2757 g_262 g_2683 g_644 g_3621 g_2287 g_450 g_46 g_254 g_641 g_2760 g_463 g_2687 g_621 g_4962 g_567 g_459 g_622 g_2720 g_209 g_36 g_224 g_255 g_1859 g_2628 g_2703 g_1577 g_2595 g_405 g_2719 g_1335 g_2698 g_643 g_462 g_4961 g_2678 g_3714 g_48 g_3356 g_5312 g_2576 g_2769 g_2727 g_2734 g_1103 g_284 g_1950 g_5957 g_2662 g_5637 g_2690 g_2772 g_6078 g_466 g_3378 g_2706 g_282 g_539 g_6166 g_2280 g_2446 g_2661 g_393 g_6022 g_45 g_225 g_5261 g_2712 g_2593 g_3459 g_4424 g_5857 g_2605 g_2798 g_2686 g_2617 g_6213 g_2611 g_2740 g_2773 g_4886 g_6191 g_2579 g_635 g_2777 g_2608 g_2624 g_2794 + */ +static uint32_t func_39(int32_t * p_40, uint16_t * const p_41, uint16_t * p_42, uint32_t * p_43, int32_t p_44) +{ /* block id: 5 */ + int32_t * temp = func_73(0x7D26L); + func_66(&g_46, g_48, 0, temp, p_42); + return 0; +} + + +/* ------------------------------------------ */ +/* + * reads : g_635 g_65 g_46 g_4886 g_2690 g_2659 g_2459 g_2460 g_6191 g_2579 g_540 g_539 g_262 + * writes: g_4886 g_462 g_46 g_2690 g_1859 g_6191 g_2579 + */ +static int8_t * func_50(uint16_t * const p_51, uint32_t * p_52) +{ /* block id: 2896 */ + int16_t l_6761 = 3L; + int32_t l_6762[4][3][9] = {{{1L,(-3L),1L,1L,1L,0L,0L,1L,0L},{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)},{0L,1L,0L,0L,1L,0L,0L,1L,0L}},{{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)},{0L,1L,0L,0L,1L,0L,0L,1L,0L},{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)}},{{0L,1L,0L,0L,1L,0L,0L,1L,0L},{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)},{0L,1L,0L,0L,1L,0L,0L,1L,0L}},{{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)},{0L,1L,0L,0L,1L,0L,0L,1L,0L},{(-1L),0x7796CDC7L,(-1L),0L,(-5L),0L,(-1L),0x7796CDC7L,(-1L)}}}; + const int32_t **l_6763 = NULL; + uint16_t l_6774 = 8UL; + uint32_t l_6782 = 0x6F79FAE4L; + const uint32_t *l_6789 = &g_2291; + const uint32_t **l_6788 = &l_6789; + int16_t *l_6895[5]; + int32_t *l_6900 = &g_641; + uint8_t *l_6901 = &g_1665; + uint32_t **l_6906 = &g_3378; + const int16_t *** const *l_6914 = NULL; + int16_t *****l_6922 = NULL; + int16_t ******l_6921 = &l_6922; + int8_t l_6924[2][10] = {{(-1L),(-7L),(-7L),(-1L),0xABL,0x40L,0xABL,(-1L),(-7L),(-7L)},{0xABL,(-7L),0xCFL,(-5L),(-5L),0xCFL,(-7L),0xABL,(-7L),0xCFL}}; + uint8_t ***l_6934[7][5][1]; + int32_t *l_6950 = &g_621; + int32_t l_6965[10] = {(-10L),0x443B62B9L,0x443B62B9L,(-10L),0x443B62B9L,0x443B62B9L,(-10L),0x443B62B9L,0x443B62B9L,(-10L)}; + const uint16_t * const ***l_7022 = NULL; + const uint16_t * const ****l_7021 = &l_7022; + int32_t *l_7024[3][2][4] = {{{NULL,&l_6762[3][1][5],&g_642,&l_6762[3][1][5]},{&l_6762[3][1][5],&g_621,&g_642,&g_642}},{{NULL,NULL,&l_6762[3][1][5],&g_642},{NULL,&g_621,NULL,&l_6762[3][1][5]}},{{NULL,&l_6762[3][1][5],&l_6762[3][1][5],NULL},{NULL,&l_6762[3][1][5],&g_642,&l_6762[3][1][5]}}}; + uint32_t l_7025 = 0UL; + int i, j, k; + for (i = 0; i < 5; i++) + l_6895[i] = &g_838[4][4]; + for (i = 0; i < 7; i++) + { + for (j = 0; j < 5; j++) + { + for (k = 0; k < 1; k++) + l_6934[i][j][k] = &g_1949; + } + } +lbl_7028: + for (g_4886 = 1; (g_4886 >= 0); g_4886 -= 1) + { /* block id: 2899 */ + int32_t l_6756 = 1L; + const int32_t ***l_6764 = NULL; + const int32_t ***l_6765 = &l_6763; + int32_t l_6772 = (-4L); + int32_t l_6773 = (-1L); + const uint32_t l_6839 = 0UL; + int8_t *l_6864[8] = {&g_2634,&g_2634,&g_2634,&g_2634,&g_2634,&g_2634,&g_2634,&g_2634}; + int16_t *l_6884 = NULL; + uint8_t l_6887 = 255UL; + uint32_t l_6896[8] = {0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL,0x6AEBD34AL}; + int32_t l_6905[5][4] = {{0x722CAF41L,0x722CAF41L,0x2A5279ADL,0x722CAF41L},{0x722CAF41L,0xD48120F1L,0xD48120F1L,0x722CAF41L},{0xD48120F1L,0x722CAF41L,0xD48120F1L,0xD48120F1L},{0x722CAF41L,0x722CAF41L,0x2A5279ADL,0x722CAF41L},{0x722CAF41L,0x2A5279ADL,0x2A5279ADL,0xD48120F1L}}; + int16_t ***l_6912 = NULL; + int16_t ****l_6911 = &l_6912; + uint8_t ***l_6935 = &g_1949; + int16_t l_6940 = 2L; + uint8_t l_6945 = 0UL; + uint32_t l_6946[2][2][2] = {{{0x4D411FF8L,0UL},{0UL,0x4D411FF8L}},{{0UL,0UL},{0x4D411FF8L,0UL}}}; + int32_t l_6960 = 0x064DC60BL; + int32_t l_6962 = 8L; + int32_t l_6966 = 0L; + int32_t l_6967 = 0xB83F244FL; + int32_t l_6968 = (-1L); + int32_t l_6969 = (-6L); + int32_t l_6970 = 0x55239A34L; + uint8_t l_6985 = 0xD2L; + const uint8_t *****l_6994 = &g_6990; + int32_t l_6995 = 0x868673A7L; + int8_t l_6996 = 0x08L; + uint16_t ***l_6998 = &g_3170; + int i, j, k; + (*g_65) |= (safe_lshift_func_uint16_t_u_s((((*g_635) = l_6756) != 0x5DL), (safe_mod_func_uint16_t_u_u((safe_mul_func_int8_t_s_s((l_6762[3][1][5] = ((l_6761 || ((-1L) && (-4L))) <= l_6761)), ((((*l_6765) = l_6763) != NULL) ^ 0x6E1E9B88L))), l_6761)))); + for (g_2690 = 1; (g_2690 >= 0); g_2690 -= 1) + { /* block id: 2906 */ + int8_t l_6766 = (-7L); + int32_t l_6767 = 0L; + int32_t l_6768 = (-4L); + int32_t *l_6769 = NULL; + int32_t *l_6770 = &l_6767; + int32_t *l_6771[8] = {&g_254,&l_6762[3][1][5],&l_6762[3][1][5],&g_254,&l_6762[3][1][5],&l_6762[3][1][5],&g_254,&l_6762[3][1][5]}; + uint16_t *l_6817 = NULL; + uint8_t ***l_6833 = &g_1949; + uint8_t l_6838[9]; + uint16_t l_6915 = 0x3B36L; + int32_t *l_6920[8]; + uint32_t l_6971 = 1UL; + int i, j; + for (i = 0; i < 9; i++) + l_6838[i] = 0xAAL; + for (i = 0; i < 8; i++) + l_6920[i] = &g_46; + l_6774--; + if (g_2659[g_4886][(g_2690 + 5)]) + break; + l_6762[3][1][5] |= (safe_rshift_func_int8_t_s_s(0x3DL, 3)); + } + (**g_2459) = (int32_t*) p_52; + for (g_6191 = 1; (g_6191 >= 0); g_6191 -= 1) + { /* block id: 3037 */ + uint16_t ***l_7000 = &g_3170; + int32_t l_7001 = 0x302B5734L; + int32_t l_7011[2][5] = {{(-1L),(-1L),(-1L),(-1L),(-1L)},{0xD5735731L,0L,0xD5735731L,0L,0xD5735731L}}; + const int8_t **l_7020[3]; + const int8_t ***l_7019 = &l_7020[0]; + uint32_t l_7023 = 0xA70D3377L; + int i, j; + for (i = 0; i < 3; i++) + l_7020[i] = &g_5957; + for (g_2579 = 1; (g_2579 >= 0); g_2579 -= 1) + { /* block id: 3040 */ + uint16_t ****l_6999[1][10] = {{&g_3622,&g_3622,&g_3622,&g_3622,&g_3622,&g_3622,&g_3622,&g_3622,&g_3622,&g_3622}}; + int8_t ***l_7017 = &g_539; + int8_t ****l_7018 = &l_7017; + int i, j; + (*g_2460) = (int32_t*) p_52; + } + return (**g_540); + } + } + ++l_7025; + if (g_4886) + goto lbl_7028; + return (**g_540); +} + + +/* ------------------------------------------ */ +/* + * reads : g_2115 g_622 g_5261 g_45 g_46 g_2286 g_2287 g_540 g_539 g_538 g_2102 g_1949 g_1950 g_2727 g_450 g_225 g_6166 g_3466 g_3467 g_635 g_462 g_2442 g_621 g_282 g_6212 g_6216 g_2457 g_2458 g_2459 g_2460 g_4307 g_4308 g_224 g_2285 g_6313 g_6317 g_6318 g_6319 g_6314 g_6315 g_6316 g_3102 g_6372 g_6080 g_808 g_809 g_6438 g_2446 g_5857 g_2798 g_3505 g_3622 g_1103 g_206 g_48 g_255 g_65 g_643 g_3459 g_4424 g_641 g_2674 g_2470 g_284 g_2740 g_2773 g_2706 + * writes: g_2706 g_622 g_46 g_282 g_2287 g_539 g_6166 g_621 g_2727 g_450 g_209 g_1859 g_2280 g_462 g_2446 g_2661 g_393 g_6022 g_4308 g_641 g_45 g_225 g_5261 g_810 g_2712 g_2593 g_643 g_3459 g_4424 g_5857 g_254 g_2605 g_2798 g_36 g_2686 g_2617 g_224 g_255 g_6213 g_2611 g_463 g_2740 g_2773 + */ +static uint32_t * func_54(uint32_t p_55) +{ /* block id: 2607 */ + uint16_t * const l_6114 = NULL; + int16_t l_6126 = (-5L); + uint16_t *l_6127[6][6] = {{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405},{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405},{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405},{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405},{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405},{&g_405,&g_405,&g_405,&g_405,&g_405,&g_405}}; + int32_t l_6128 = 0x8BB04012L; + int32_t l_6129 = (-1L); + int32_t l_6130 = 1L; + int32_t l_6131[5][8] = {{0xEECC9F24L,0xEECC9F24L,6L,(-1L),0x9E1671D0L,0L,(-1L),0xA31DA6DAL},{0x03911E8BL,(-1L),0x268103C5L,0xEECC9F24L,0x268103C5L,(-1L),0x03911E8BL,0xA31DA6DAL},{(-1L),0L,0x9E1671D0L,(-1L),6L,0xEECC9F24L,0xEECC9F24L,6L},{0L,0x03911E8BL,0x03911E8BL,0L,6L,0x59D7CA23L,0xA31DA6DAL,0xEECC9F24L},{(-1L),0xE3F7F7F2L,2L,6L,0x268103C5L,6L,2L,0xE3F7F7F2L}}; + uint16_t l_6132 = 3UL; + uint32_t *l_6183 = &g_2287[5]; + int32_t l_6187 = 0L; + int8_t l_6197 = 0L; + int32_t ** const l_6210 = &g_2446; + int32_t ** const *l_6209[9][4][7] = {{{&l_6210,NULL,&l_6210,&l_6210,NULL,NULL,&l_6210},{NULL,&l_6210,&l_6210,NULL,NULL,&l_6210,NULL},{NULL,&l_6210,&l_6210,NULL,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,NULL,NULL,&l_6210,&l_6210}},{{&l_6210,&l_6210,&l_6210,NULL,&l_6210,&l_6210,NULL},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,NULL,&l_6210},{&l_6210,NULL,&l_6210,NULL,NULL,&l_6210,&l_6210},{NULL,&l_6210,&l_6210,NULL,&l_6210,&l_6210,&l_6210}},{{&l_6210,NULL,&l_6210,NULL,&l_6210,&l_6210,&l_6210},{&l_6210,NULL,&l_6210,NULL,&l_6210,&l_6210,NULL},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210}},{{NULL,&l_6210,NULL,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,NULL,&l_6210,NULL},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,NULL},{&l_6210,&l_6210,NULL,&l_6210,NULL,NULL,NULL}},{{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,NULL,NULL,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{NULL,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,NULL}},{{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,NULL},{&l_6210,NULL,&l_6210,&l_6210,&l_6210,&l_6210,NULL},{NULL,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210}},{{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{NULL,NULL,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{NULL,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,NULL,NULL,&l_6210,&l_6210,NULL,&l_6210}},{{&l_6210,&l_6210,&l_6210,NULL,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210},{NULL,&l_6210,&l_6210,NULL,NULL,NULL,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210}},{{&l_6210,&l_6210,&l_6210,&l_6210,NULL,&l_6210,&l_6210},{NULL,&l_6210,NULL,&l_6210,&l_6210,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,NULL,NULL,&l_6210,&l_6210},{&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210,&l_6210}}}; + int16_t l_6238 = (-3L); + int16_t l_6289 = 0L; + int32_t l_6311 = 0xC8558119L; + uint8_t ***l_6562 = NULL; + int32_t l_6624[4][1]; + uint32_t l_6647 = 0UL; + int32_t l_6652 = 0xDBA6E8D0L; + uint32_t **l_6696 = &g_3378; + uint32_t l_6704 = 0x524D9FDEL; + int32_t *l_6707 = &g_641; + int16_t ***l_6728 = NULL; + uint16_t ** const *l_6736 = NULL; + uint16_t l_6749 = 65535UL; + uint32_t *l_6753 = &l_6704; + int i, j, k; + for (i = 0; i < 4; i++) + { + for (j = 0; j < 1; j++) + l_6624[i][j] = 0x40F360E3L; + } +lbl_6425: + for (g_2706 = 0; (g_2706 >= (-3)); g_2706--) + { /* block id: 2610 */ + uint32_t *l_6113[3][9][8] = {{{&g_260[9][3][1],&g_393,&g_260[9][3][1],&g_2287[3],NULL,&g_260[7][3][1],&g_2287[5],&g_6022[5][5]},{&g_1335,&g_393,&g_2280,NULL,NULL,&g_1335,&g_2280,NULL},{NULL,&g_1335,&g_393,&g_1335,&g_2284,&g_260[7][3][1],&g_1335,&g_260[9][3][1]},{NULL,&g_6022[1][3],&g_260[4][5][0],&g_393,&g_260[4][4][1],NULL,&g_393,&g_2280},{NULL,&g_2287[2],&g_6022[5][7],NULL,&g_1335,&g_260[9][3][1],&g_2284,&g_2280},{&g_6022[5][7],&g_1335,NULL,NULL,&g_2284,&g_393,&g_2287[5],&g_260[9][3][1]},{&g_260[9][3][1],&g_2284,&g_1679,&g_260[4][5][0],&g_1335,NULL,NULL,&g_260[9][3][1]},{&g_1679,NULL,NULL,&g_1335,NULL,&g_2287[5],NULL,NULL},{&g_6022[1][3],&g_1679,&g_393,&g_260[9][3][1],&g_2280,&g_260[6][2][0],NULL,&g_2287[2]}},{{&g_2287[5],&g_2284,NULL,&g_6022[1][7],&g_1335,&g_6022[1][7],NULL,&g_2284},{&g_2280,&g_2287[5],&g_1679,NULL,&g_260[3][6][0],&g_2284,&g_2284,&g_2287[1]},{NULL,NULL,&g_260[9][3][1],&g_2280,&g_2280,NULL,&g_2284,&g_260[9][3][1]},{NULL,&g_2280,&g_1679,&g_2284,&g_260[9][3][1],&g_6022[3][1],NULL,&g_6022[0][6]},{&g_260[9][3][1],&g_6022[3][1],NULL,&g_6022[0][6],&g_1335,NULL,NULL,&g_6022[5][7]},{&g_260[9][3][1],&g_2287[2],&g_393,&g_6022[6][3],NULL,NULL,NULL,&g_1335},{&g_260[1][4][0],&g_260[3][6][0],NULL,NULL,&g_6022[2][4],NULL,NULL,&g_2287[1]},{&g_260[1][2][0],&g_2284,&g_1679,&g_260[1][4][0],NULL,&g_2284,&g_2287[5],NULL},{&g_6022[3][1],&g_1335,NULL,NULL,NULL,NULL,&g_2284,&g_1679}},{{&g_260[9][3][1],NULL,&g_6022[5][7],&g_260[9][3][1],&g_260[4][5][0],NULL,&g_393,&g_2287[0]},{&g_2284,&g_1335,&g_260[4][5][0],&g_260[9][3][1],&g_260[9][3][1],&g_6022[5][5],&g_1335,&g_1335},{&g_2284,&g_260[3][6][0],&g_393,&g_393,&g_260[3][6][0],&g_2284,&g_2280,&g_260[9][3][1]},{NULL,&g_1335,&g_2287[5],&g_2287[0],&g_1335,&g_260[9][3][1],&g_6022[3][1],&g_2284},{&g_2287[3],&g_393,NULL,&g_2287[0],NULL,&g_6022[3][1],&g_6022[5][7],&g_260[9][3][1]},{&g_6022[1][3],NULL,&g_1335,&g_393,&g_1335,&g_2284,&g_260[7][3][1],&g_1335},{NULL,NULL,&g_2284,&g_260[9][3][1],NULL,&g_6022[6][3],NULL,&g_2287[0]},{&g_260[4][4][1],&g_2287[5],&g_1335,&g_260[9][3][1],&g_2287[3],NULL,&g_2284,NULL},{NULL,NULL,&g_1679,NULL,&g_2284,&g_393,NULL,&g_260[9][3][1]}}}; + int i, j, k; + return l_6113[2][0][2]; + } +lbl_6239: + (*g_45) ^= ((l_6114 != NULL) & (safe_add_func_int32_t_s_s((((safe_div_func_uint16_t_u_u((((0xA42179B6L || (+((*g_2115)++))) >= ((safe_sub_func_uint16_t_u_u(((safe_mod_func_int8_t_s_s((0xDDL == ((l_6132--) && 0xE41EL)), (0x1430L | (NULL != g_5261)))) <= (((l_6126 ^ 1UL) , l_6129) <= p_55)), l_6128)) && (-1L))) ^ p_55), l_6128)) == 0xE92BL) , (-1L)), p_55))); + for (g_282 = 4; (g_282 >= 1); g_282 -= 1) + { /* block id: 2618 */ + uint16_t l_6147 = 65528UL; + int32_t l_6153[10][3][3] = {{{0x66916668L,0x66916668L,0x5870851FL},{0x1D94E6A9L,5L,9L},{0x66916668L,(-8L),(-1L)}},{{0xD3AB46C7L,5L,4L},{(-3L),0x66916668L,(-1L)},{9L,0x24BD40F9L,9L}},{{1L,(-1L),0x5870851FL},{0xD3AB46C7L,0x24BD40F9L,0x5F603B7AL},{0xCBE31FD6L,0x66916668L,0L}},{{0x1D94E6A9L,5L,9L},{0xCBE31FD6L,(-8L),(-8L)},{0xD3AB46C7L,5L,4L}},{{1L,0x66916668L,(-8L)},{9L,0x41205F4DL,9L},{(-3L),(-1L),0L}},{{0xD3AB46C7L,0x41205F4DL,0x5F603B7AL},{0x66916668L,0x66916668L,0x5870851FL},{0x1D94E6A9L,5L,9L}},{{0x66916668L,(-8L),(-1L)},{0xD3AB46C7L,5L,4L},{(-3L),0x66916668L,(-1L)}},{{9L,0x24BD40F9L,9L},{1L,(-1L),0x5870851FL},{0xD3AB46C7L,0x24BD40F9L,0x5F603B7AL}},{{0xCBE31FD6L,0x66916668L,0L},{0x1D94E6A9L,5L,9L},{0xCBE31FD6L,(-8L),(-8L)}},{{0xD3AB46C7L,5L,4L},{1L,0x66916668L,(-8L)},{9L,0x41205F4DL,9L}}}; + uint16_t l_6199[9] = {0UL,0UL,1UL,0UL,0UL,1UL,0UL,0UL,1UL}; + uint32_t *l_6251[9] = {&g_393,&g_393,&g_393,&g_393,&g_393,&g_393,&g_393,&g_393,&g_393}; + uint8_t ** const l_6275 = &g_1950; + uint16_t *l_6361 = &g_622[0]; + int16_t ***l_6397 = &g_4618; + int16_t ****l_6396 = &l_6397; + int16_t *****l_6395 = &l_6396; + int16_t ******l_6394 = &l_6395; + int32_t *l_6421[4][8][2] = {{{&g_14,&g_459},{&g_459,&g_14},{&g_14,&g_643[2]},{&g_14,&g_14},{&g_459,&g_459},{&g_14,&g_14},{&g_643[2],&g_14},{&g_14,&g_459}},{{&g_459,&g_14},{&g_14,&g_643[2]},{&g_14,&g_14},{&g_459,&g_459},{&g_14,&g_14},{&g_643[2],&g_14},{&g_14,&g_459},{&g_459,&g_14}},{{&g_14,&g_643[2]},{&g_14,&g_14},{&g_459,&g_459},{&g_14,&g_14},{&g_643[2],&g_14},{&g_14,&g_459},{&g_459,&g_14},{&g_14,&g_643[2]}},{{&g_14,&g_14},{&g_459,&g_459},{&g_14,&g_14},{&g_643[2],&g_14},{&g_14,&g_459},{&g_459,&g_14},{&g_14,&g_643[2]},{&g_14,&g_14}}}; + int32_t *l_6461 = &g_46; + int32_t l_6525 = 0xDC711859L; + int32_t l_6650 = 0xDD2A9D7FL; + int i, j, k; + if ((~p_55)) + { /* block id: 2619 */ + uint8_t l_6136 = 0x97L; + int32_t l_6158 = 0x54FA589FL; + int32_t l_6160 = 7L; + int32_t l_6162 = (-6L); + int32_t l_6163 = 2L; + int32_t l_6164 = 0x6D3FCB08L; + int32_t l_6165 = (-1L); + int32_t l_6193 = (-7L); + int32_t l_6194 = 0x7481B68BL; + int32_t l_6195 = 1L; + int32_t l_6196[1]; + int32_t *l_6246 = &g_4424; + uint8_t ***l_6247 = &g_1949; + int i; + for (i = 0; i < 1; i++) + l_6196[i] = 0xCBF9A180L; + if ((0UL < ((*g_2286) |= l_6136))) + { /* block id: 2621 */ + int8_t ** const l_6145 = NULL; + int32_t l_6146[7][2][2] = {{{(-1L),0xB09BADD7L},{0xAEDB0C76L,1L}},{{0xAEB4A825L,0xAEDB0C76L},{0xB5EF9E11L,0xAEDB0C76L}},{{0xB09BADD7L,0xDFE8E0D5L},{(-1L),(-1L)}},{{0xDFE8E0D5L,0xAEB4A825L},{0xB5EF9E11L,1L}},{{4L,(-9L)},{(-9L),(-1L)}},{{0x9759F67EL,(-1L)},{(-9L),(-9L)}},{{4L,1L},{0xB5EF9E11L,0xAEB4A825L}}}; + int16_t l_6184 = 1L; + int8_t l_6198[7][2][5] = {{{(-1L),(-2L),0xCCL,0xCCL,(-2L)},{(-9L),0L,0xCFL,0xCCL,8L}},{{(-1L),8L,0xA8L,(-1L),0x53L},{1L,(-10L),0x63L,0x53L,1L}},{{(-1L),1L,1L,1L,(-1L)},{(-9L),0xD2L,1L,0x63L,0L}},{{(-1L),0x11L,0x63L,0xCFL,0x10L},{0x10L,(-1L),0xA8L,0xD2L,0L}},{{1L,0xCFL,0xCFL,1L,(-1L)},{0L,0xCFL,0xCCL,8L,1L}},{{0xD2L,(-1L),0L,0x56L,0x53L},{0xCCL,0x11L,(-10L),8L,8L}},{{0x11L,0xD2L,0x11L,1L,(-2L)},{0x11L,1L,0x56L,0xD2L,0x63L}}}; + uint32_t l_6220[10][9] = {{0x240D52F0L,4294967294UL,0x1AB42A90L,0UL,4294967291UL,0UL,0x1AB42A90L,4294967294UL,0x240D52F0L},{0x6D35F909L,4294967286UL,0UL,0x470F1CBFL,0x553956E8L,0x4CBD6A4FL,0x553956E8L,0x470F1CBFL,0UL},{0x4E759DF7L,0x4E759DF7L,0UL,0UL,4294967294UL,0x237395F9L,0x240D52F0L,0x237395F9L,4294967294UL},{0x6D35F909L,0x553956E8L,0x553956E8L,0x6D35F909L,0xF1CB5897L,1UL,0xB482087CL,0UL,0xB482087CL},{0x240D52F0L,0UL,0UL,0UL,0UL,0x240D52F0L,4294967291UL,0x4E759DF7L,4294967295UL},{0xC74809A0L,1UL,0UL,0xF1CB5897L,0xF1CB5897L,0UL,1UL,0xC74809A0L,4294967286UL},{4294967295UL,0UL,0x1AB42A90L,4294967291UL,4294967294UL,4294967294UL,4294967291UL,0x1AB42A90L,0UL},{0xF1CB5897L,0xC74809A0L,0x4CBD6A4FL,4294967286UL,0x553956E8L,0xB482087CL,0xB482087CL,0x553956E8L,4294967286UL},{0UL,1UL,0UL,0x237395F9L,4294967291UL,4294967295UL,0x240D52F0L,0x240D52F0L,4294967295UL},{0x4CBD6A4FL,0xC74809A0L,0xF1CB5897L,0xC74809A0L,0x4CBD6A4FL,4294967286UL,0x553956E8L,0xB482087CL,0xB482087CL}}; + int i, j, k; + if (l_6136) + { /* block id: 2622 */ + int8_t l_6139 = 0L; + (*g_225) = (safe_rshift_func_uint16_t_u_u(0x1CC9L, ((((p_55 < (247UL <= (l_6139 , (safe_rshift_func_int8_t_s_s(l_6139, ((p_55 == (6UL > ((~(((((*g_538) = (*g_540)) == l_6145) != p_55) > p_55)) == p_55))) != l_6146[5][0][0])))))) , 0x73C6L) , (***g_2102)) ^ l_6147))); + l_6146[3][0][0] &= 2L; + } + else + { /* block id: 2626 */ + int32_t l_6154 = (-1L); + int32_t l_6155 = 0x70EBE93AL; + int32_t l_6159 = 0x8B8B6E09L; + int32_t l_6161[5]; + int32_t l_6182 = (-10L); + int32_t *l_6217 = &l_6158; + int32_t *l_6218 = &l_6196[0]; + int32_t *l_6219[10][3] = {{&g_621,NULL,&g_621},{NULL,NULL,&l_6163},{&l_6128,NULL,NULL},{&l_6163,NULL,NULL},{&g_621,&g_621,&g_621},{&l_6163,NULL,NULL},{NULL,NULL,&l_6128},{&l_6159,NULL,NULL},{&l_6128,&g_621,NULL},{&l_6159,NULL,&l_6159}}; + int i, j; + for (i = 0; i < 5; i++) + l_6161[i] = (-1L); + if ((l_6146[5][0][0] , l_6146[3][1][1])) + { /* block id: 2627 */ + uint32_t *l_6152[1][3][2]; + int i, j, k; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 3; j++) + { + for (k = 0; k < 2; k++) + l_6152[i][j][k] = &g_2280; + } + } + (*g_225) |= (safe_lshift_func_int16_t_s_s((safe_rshift_func_int16_t_s_u((-1L), 9)), 4)); + return l_6152[0][2][0]; + } + else + { /* block id: 2630 */ + int8_t l_6156 = 0x40L; + int32_t *l_6157[4][9] = {{&g_46,&l_6153[5][1][1],&g_621,&l_6153[5][1][1],&g_46,&g_621,&l_6129,&l_6129,&g_621},{&g_46,&l_6153[5][1][1],&g_621,&l_6153[5][1][1],&g_46,&g_621,&l_6129,&l_6129,&g_621},{&g_46,&l_6153[5][1][1],&g_621,&l_6153[5][1][1],&g_46,&g_621,&l_6129,&l_6129,&g_621},{&g_46,&l_6153[5][1][1],&g_621,&l_6153[5][1][1],&g_46,&g_621,&l_6129,&l_6129,&g_621}}; + uint32_t l_6185[2][5] = {{0UL,0UL,0UL,0UL,0UL},{0x51B516A6L,18446744073709551615UL,0x51B516A6L,18446744073709551615UL,0x51B516A6L}}; + int32_t l_6186[9][6][4] = {{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}},{{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)},{9L,0x7B60C7A8L,(-9L),(-9L)},{0x7B60C7A8L,0x7B60C7A8L,(-2L),(-9L)}}}; + int i, j, k; + --g_6166; + (*g_2442) &= ((((l_6130 &= ((NULL == &l_6153[1][0][1]) && ((safe_mod_func_int8_t_s_s((l_6146[5][0][0] = (-1L)), (safe_mod_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u(((+((p_55 , ((safe_mul_func_int8_t_s_s(((*g_3466) <= ((safe_rshift_func_uint8_t_u_s(((safe_rshift_func_uint16_t_u_s(65535UL, ((((((1UL && (l_6182 , 0x2EL)) != p_55) , l_6183) != NULL) ^ p_55) , l_6184))) || p_55), 4)) && l_6185[0][3])), p_55)) > 1UL)) >= (-1L))) > l_6186[7][0][0]), (**g_1949))), 0x286BL)))) >= (*g_635)))) != p_55) & 0xCDL) || (*g_45)); + } + for (l_6165 = 0; (l_6165 <= 5); l_6165 += 1) + { /* block id: 2638 */ + int32_t *l_6189 = &l_6131[4][4]; + int32_t *l_6190[10][7][3] = {{{&l_6131[2][4],&l_6164,&l_6129},{&g_4886,&g_621,NULL},{&l_6155,&l_6161[3],&l_6164},{NULL,&g_4886,NULL},{&g_641,&l_6146[5][0][0],&l_6129},{NULL,&l_6146[5][0][0],NULL},{&l_6161[3],&l_6131[2][4],&l_6155}},{{&g_621,&l_6146[5][0][0],&l_6146[5][0][0]},{&l_6161[3],&l_6160,&l_6155},{NULL,NULL,NULL},{&g_641,&l_6155,&l_6161[3]},{NULL,NULL,&l_6164},{&l_6155,&l_6155,&l_6159},{&g_4886,NULL,NULL}},{{&l_6131[2][4],&l_6160,&l_6131[4][0]},{NULL,&l_6146[5][0][0],NULL},{&l_6131[4][0],&l_6131[2][4],&l_6131[4][0]},{&l_6163,&l_6146[5][0][0],NULL},{&l_6161[2],&l_6146[5][0][0],&l_6159},{&l_6146[5][0][0],&g_4886,&l_6164},{&l_6153[6][0][2],&l_6161[3],&l_6161[3]}},{{&l_6146[5][0][0],&g_621,NULL},{&l_6161[2],&l_6164,&l_6155},{&l_6163,NULL,&l_6146[5][0][0]},{&l_6131[4][0],&l_6159,&l_6155},{NULL,NULL,NULL},{&l_6131[2][4],&l_6164,&l_6129},{&g_4886,&g_621,NULL}},{{&l_6155,&l_6161[3],&l_6164},{NULL,&g_4886,NULL},{&g_641,&l_6146[5][0][0],&l_6129},{NULL,&l_6146[5][0][0],NULL},{&l_6161[3],&l_6131[2][4],&l_6155},{NULL,&g_621,&g_621},{&l_6153[6][0][2],&l_6129,&l_6159}},{{NULL,&l_6146[5][0][0],NULL},{&l_6146[5][0][0],&l_6159,&l_6153[6][0][2]},{NULL,&g_4886,NULL},{&l_6159,&l_6159,&l_6131[2][4]},{&l_6163,&l_6146[5][0][0],&l_6164},{&g_641,&l_6129,&l_6164},{NULL,&g_621,&l_6146[5][0][0]}},{{&l_6164,&g_641,&l_6164},{&l_6146[5][0][0],&g_621,&l_6164},{&l_6131[4][0],&l_6160,&l_6131[2][4]},{&g_621,&l_6163,NULL},{&l_6155,&l_6153[6][0][2],&l_6153[6][0][2]},{&g_621,NULL,NULL},{&l_6131[4][0],&l_6161[3],&l_6159}},{{&l_6146[5][0][0],NULL,&g_621},{&l_6164,&l_6131[2][4],&l_6161[2]},{NULL,NULL,&g_4886},{&g_641,&l_6161[3],&l_6155},{&l_6163,NULL,NULL},{&l_6159,&l_6153[6][0][2],&l_6161[3]},{NULL,&l_6163,NULL}},{{&l_6146[5][0][0],&l_6160,&l_6155},{NULL,&g_621,&g_4886},{&l_6153[6][0][2],&g_641,&l_6161[2]},{NULL,&g_621,&g_621},{&l_6153[6][0][2],&l_6129,&l_6159},{NULL,&l_6146[5][0][0],NULL},{&l_6146[5][0][0],&l_6159,&l_6153[6][0][2]}},{{NULL,&g_4886,NULL},{&l_6159,&l_6159,&l_6131[2][4]},{&l_6163,&l_6146[5][0][0],&l_6164},{&g_641,&l_6129,&l_6164},{NULL,&g_621,&l_6146[5][0][0]},{&l_6164,&g_641,&l_6164},{&l_6146[5][0][0],&g_621,&l_6164}}}; + int16_t l_6192[6] = {0x7393L,1L,1L,0x7393L,1L,1L}; + int32_t ** const **l_6211 = &l_6209[6][0][6]; + int i, j, k; + l_6199[0]++; + (*l_6189) &= (safe_rshift_func_uint8_t_u_u(((*g_1950) = ((!0x32CD8B6DL) , (safe_mul_func_int8_t_s_s(((safe_mod_func_int8_t_s_s((l_6127[g_282][(g_282 + 1)] == NULL), (((((p_55 , ((*l_6211) = l_6209[6][0][6])) == g_6212) > l_6130) , ((safe_add_func_int32_t_s_s(l_6187, 4L)) , p_55)) , p_55))) != 0x1E524819L), 0UL)))), l_6193)); + } + for (g_209 = 0; (g_209 <= 5); g_209 += 1) + { /* block id: 2646 */ + return g_6216; + } + --l_6220[4][8]; + } + (****g_2457) = &l_6153[6][0][2]; + for (l_6193 = 5; (l_6193 >= 1); l_6193 -= 1) + { /* block id: 2654 */ + for (g_2280 = 1; (g_2280 <= 5); g_2280 += 1) + { /* block id: 2657 */ + (*g_45) = (((((safe_sub_func_int16_t_s_s((((**g_1949) = ((l_6196[0] , (p_55 && (safe_add_func_uint32_t_u_u((65535UL > ((safe_rshift_func_int8_t_s_u((((safe_mul_func_uint16_t_u_u(((9L >= ((~(safe_lshift_func_uint16_t_u_s((l_6198[0][0][3] != ((((((*g_4307) <= ((((l_6153[6][0][2] >= (safe_lshift_func_uint16_t_u_u((((~(~((*g_635) ^= (l_6146[6][1][0] |= ((NULL != &l_6160) <= p_55))))) & 0xA7L) > p_55), 3))) == l_6147) , l_6199[0]) > (-1L))) && 0x7489195AL) , l_6199[0]) > p_55) <= (*g_2115))), 15))) | p_55)) , 0xB5F2L), 6UL)) , 1L) == 248UL), (**g_1949))) == p_55)), 4294967295UL)))) < l_6198[4][1][0])) && l_6238), 6UL)) >= l_6198[0][0][4]) == p_55) ^ 0x5A3FL) || (*g_1950)); + } + (**g_224) = l_6165; + } + } + else + { /* block id: 2665 */ + int32_t *l_6245 = &g_643[2]; + const int32_t *l_6250 = &l_6196[0]; + if (g_46) + goto lbl_6239; + if (l_6187) + continue; + for (g_2280 = 2; (g_2280 <= 6); g_2280 += 1) + { /* block id: 2670 */ + uint8_t *** const l_6241 = &g_1949; + (*g_2442) = (~1L); + l_6187 = (l_6241 == (((l_6131[4][7] = 6UL) != ((!p_55) | (safe_mod_func_int8_t_s_s((l_6245 == ((*l_6210) = l_6246)), 0x1FL)))) , l_6247)); + for (g_2661 = 0; (g_2661 <= 6); g_2661 += 1) + { /* block id: 2677 */ + l_6131[0][5] = ((--p_55) >= 0UL); + (**g_2459) = l_6250; + } + } + } + if (l_6153[6][0][2]) + continue; + return l_6251[8]; + } + else + { /* block id: 2686 */ + int8_t l_6257[5] = {0xB1L,0xB1L,0xB1L,0xB1L,0xB1L}; + uint32_t l_6258 = 6UL; + int32_t l_6266 = (-2L); + uint32_t ** const l_6279 = &l_6251[1]; + int32_t ******l_6287 = NULL; + uint8_t l_6355 = 0x63L; + uint8_t ***l_6359 = &g_1949; + uint32_t l_6376[4][7] = {{0x5732C28EL,0x1A7591EFL,0x70A5756DL,0x9F59200EL,0x17C98814L,4294967290UL,0x17C98814L},{0x5732C28EL,0x17C98814L,0x17C98814L,0x5732C28EL,4294967295UL,0xF7C74F14L,4294967295UL},{1UL,0xF7C74F14L,0x70A5756DL,4294967295UL,4294967295UL,0x70A5756DL,0xF7C74F14L},{4294967295UL,1UL,4294967290UL,0x1A7591EFL,0x17C98814L,4294967295UL,4294967295UL}}; + int16_t ***l_6393 = &g_4618; + int16_t ****l_6392[8][5] = {{&l_6393,&l_6393,&l_6393,&l_6393,NULL},{&l_6393,&l_6393,&l_6393,&l_6393,&l_6393},{&l_6393,&l_6393,&l_6393,&l_6393,&l_6393},{&l_6393,&l_6393,&l_6393,&l_6393,NULL},{&l_6393,&l_6393,&l_6393,&l_6393,&l_6393},{&l_6393,&l_6393,&l_6393,&l_6393,&l_6393},{&l_6393,&l_6393,&l_6393,&l_6393,NULL},{&l_6393,&l_6393,&l_6393,&l_6393,&l_6393}}; + int16_t *****l_6391[7][9][4] = {{{&l_6392[6][2],NULL,NULL,NULL},{&l_6392[5][2],NULL,&l_6392[5][2],NULL},{NULL,&l_6392[5][2],NULL,&l_6392[5][2]},{&l_6392[5][2],&l_6392[5][2],&l_6392[5][2],&l_6392[5][2]},{&l_6392[3][0],&l_6392[4][4],&l_6392[4][4],&l_6392[1][2]},{&l_6392[3][0],&l_6392[2][3],&l_6392[5][2],&l_6392[3][2]},{&l_6392[5][2],&l_6392[1][2],NULL,&l_6392[2][1]},{NULL,&l_6392[5][2],&l_6392[5][2],&l_6392[5][2]},{&l_6392[5][2],&l_6392[4][0],NULL,NULL}},{{NULL,&l_6392[5][2],&l_6392[3][0],&l_6392[1][2]},{&l_6392[4][4],&l_6392[0][4],&l_6392[1][2],NULL},{&l_6392[5][2],NULL,&l_6392[5][2],&l_6392[2][3]},{&l_6392[6][2],&l_6392[5][2],&l_6392[5][2],&l_6392[5][2]},{&l_6392[5][2],&l_6392[5][2],&l_6392[6][2],&l_6392[5][2]},{&l_6392[6][1],NULL,NULL,NULL},{&l_6392[3][0],&l_6392[0][4],&l_6392[0][4],&l_6392[3][0]},{&l_6392[4][0],&l_6392[2][3],&l_6392[5][2],&l_6392[0][1]},{NULL,NULL,NULL,&l_6392[5][2]}},{{&l_6392[5][2],&l_6392[5][4],NULL,&l_6392[5][2]},{NULL,NULL,&l_6392[6][1],&l_6392[0][1]},{NULL,&l_6392[2][3],&l_6392[1][2],&l_6392[3][0]},{&l_6392[5][4],&l_6392[0][4],&l_6392[2][0],NULL},{&l_6392[5][2],NULL,&l_6392[5][2],&l_6392[5][2]},{&l_6392[5][2],&l_6392[5][2],NULL,&l_6392[5][2]},{NULL,&l_6392[5][2],NULL,&l_6392[2][3]},{&l_6392[6][1],NULL,&l_6392[5][2],NULL},{&l_6392[4][0],&l_6392[0][4],NULL,&l_6392[1][2]}},{{&l_6392[1][2],&l_6392[5][2],&l_6392[5][2],NULL},{&l_6392[5][2],&l_6392[4][0],&l_6392[6][2],&l_6392[5][2]},{NULL,&l_6392[5][2],NULL,&l_6392[2][1]},{NULL,&l_6392[1][2],NULL,&l_6392[3][2]},{&l_6392[5][2],&l_6392[2][3],&l_6392[2][0],&l_6392[1][2]},{&l_6392[0][4],&l_6392[4][4],&l_6392[2][0],&l_6392[5][2]},{&l_6392[5][2],&l_6392[5][2],NULL,&l_6392[5][2]},{NULL,&l_6392[5][2],NULL,NULL},{NULL,NULL,&l_6392[6][2],NULL}},{{&l_6392[5][2],NULL,&l_6392[5][2],NULL},{&l_6392[1][2],&l_6392[4][4],NULL,&l_6392[2][0]},{&l_6392[4][0],NULL,&l_6392[5][2],NULL},{&l_6392[6][1],NULL,NULL,&l_6392[2][1]},{NULL,&l_6392[5][2],NULL,&l_6392[5][2]},{&l_6392[5][2],&l_6392[1][2],&l_6392[5][2],&l_6392[0][1]},{&l_6392[5][2],&l_6392[5][2],&l_6392[2][0],&l_6392[2][0]},{&l_6392[5][4],&l_6392[5][4],&l_6392[1][2],&l_6392[5][2]},{NULL,NULL,&l_6392[6][1],&l_6392[2][3]}},{{NULL,NULL,NULL,&l_6392[6][1]},{&l_6392[5][2],NULL,NULL,&l_6392[2][3]},{NULL,NULL,&l_6392[5][2],&l_6392[5][2]},{&l_6392[0][4],&l_6392[2][1],&l_6392[5][2],&l_6392[4][4]},{NULL,&l_6392[4][0],&l_6392[5][2],&l_6392[1][0]},{&l_6392[0][0],&l_6392[4][4],NULL,&l_6392[5][2]},{&l_6392[2][3],&l_6392[3][2],&l_6392[5][2],&l_6392[6][1]},{NULL,&l_6392[5][4],&l_6392[5][2],NULL},{NULL,&l_6392[1][2],&l_6392[4][4],&l_6392[4][4]}},{{&l_6392[5][2],&l_6392[5][2],NULL,NULL},{&l_6392[5][2],NULL,&l_6392[6][2],&l_6392[2][0]},{&l_6392[5][2],&l_6392[6][2],&l_6392[5][2],&l_6392[6][2]},{NULL,&l_6392[5][4],&l_6392[6][2],NULL},{&l_6392[5][2],&l_6392[6][2],NULL,&l_6392[5][2]},{NULL,&l_6392[5][2],&l_6392[5][2],&l_6392[4][4]},{NULL,&l_6392[3][0],NULL,&l_6392[6][3]},{&l_6392[5][2],&l_6392[4][4],&l_6392[6][2],&l_6392[6][1]},{NULL,&l_6392[6][0],&l_6392[5][2],&l_6392[5][2]}}}; + int16_t ******l_6390 = &l_6391[1][2][1]; + uint8_t l_6400 = 0x44L; + int32_t *l_6416 = &g_3459; + int16_t l_6433 = 1L; + int32_t l_6470 = 2L; + int32_t l_6472 = 0x8A9FBF52L; + int32_t l_6473 = 0L; + int32_t l_6474 = 0x15DA7217L; + int32_t l_6493 = 0x5F289B99L; + int8_t *l_6494 = &g_5857; + uint16_t *l_6495 = &g_1844; + int i, j, k; + if ((safe_rshift_func_int8_t_s_u(0x6BL, (+1UL)))) + { /* block id: 2687 */ + int32_t *l_6255 = &g_642; + int32_t *l_6256[1]; + int16_t ******l_6274 = NULL; + int i; + for (i = 0; i < 1; i++) + l_6256[i] = NULL; + l_6258++; + (*g_225) = ((safe_mod_func_uint16_t_u_u(((~((safe_add_func_uint32_t_u_u(1UL, 0xEA274FA3L)) != ((((l_6266 = (*g_45)) | ((((safe_add_func_uint16_t_u_u(p_55, ((((**g_2285) &= (safe_lshift_func_uint16_t_u_u(((0UL >= (safe_mul_func_int16_t_s_s(((safe_unary_minus_func_int16_t_s(0L)) , l_6238), ((-2L) < ((g_5261 == l_6274) ^ p_55))))) , (*g_2115)), 12))) >= p_55) <= l_6131[0][5]))) | 0xB16563A4L) , (uint8_t**) NULL) == l_6275)) || 6L) && 0xE5L))) ^ 0x2B166389L), 3UL)) ^ 0x9C1EL); + } + else + { /* block id: 2692 */ + uint32_t l_6278 = 2UL; + uint32_t **l_6288[8]; + const int32_t ***l_6310 = NULL; + uint16_t *l_6325[9]; + int32_t l_6340 = (-10L); + int32_t l_6341 = (-6L); + uint8_t * const **l_6360 = NULL; + int32_t l_6468 = 0x8B65C220L; + int32_t l_6469 = 5L; + int32_t l_6471[3]; + int i; + for (i = 0; i < 8; i++) + l_6288[i] = &g_6216; + for (i = 0; i < 9; i++) + l_6325[i] = &l_6132; + for (i = 0; i < 3; i++) + l_6471[i] = 0xB36BAD27L; + (*g_2442) |= (safe_add_func_int8_t_s_s(p_55, p_55)); + if ((l_6128 , (0x5F4EAB6DL | ((**g_224) = (((l_6278 = 0xC1F029DDL) , l_6279) != ((((safe_unary_minus_func_uint8_t_u(l_6153[8][2][2])) < (l_6266 = (*g_2442))) , (safe_mul_func_int16_t_s_s((((*g_635) &= l_6258) || l_6266), (safe_lshift_func_uint16_t_u_u(((safe_add_func_uint8_t_u_u(((((((((l_6257[2] || l_6153[6][0][0]) != p_55) , l_6153[6][0][2]) , l_6287) != &g_3277) > 0UL) && 0xC1B2L) , p_55), p_55)) < p_55), 1))))) , l_6288[5])))))) + { /* block id: 2698 */ + uint32_t l_6312 = 0xD14B8EB9L; + int32_t l_6320 = 2L; + uint16_t l_6349 = 65535UL; + l_6320 ^= (l_6289 <= (safe_div_func_int16_t_s_s(0x6098L, (safe_rshift_func_uint8_t_u_s(((-1L) | (((safe_mod_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u(((safe_div_func_int32_t_s_s(p_55, (safe_sub_func_uint32_t_u_u(((*g_2286) = (safe_lshift_func_int8_t_s_u((!((safe_lshift_func_uint16_t_u_s((((~((*g_2442) = (safe_rshift_func_int16_t_s_u((NULL == &g_6213[5][0][5]), (((NULL == l_6310) == p_55) , p_55))))) >= 0xADBFL) || 1L), l_6311)) >= l_6312)), p_55))), (*g_225))))) , 0xB0L), p_55)), p_55)) , (int32_t********) NULL) == g_6313)), l_6278))))); + l_6341 &= (((safe_add_func_uint8_t_u_u((((((*g_2442) = (((l_6325[2] != l_6325[2]) , ((****g_6317) |= p_55)) , (********g_6313))) ^ ((safe_sub_func_uint32_t_u_u(((**l_6279) = ((**g_2285)--)), (safe_add_func_uint32_t_u_u((l_6340 = (safe_rshift_func_uint16_t_u_s(((*g_3102) = ((1L & ((p_55 != (safe_div_func_int32_t_s_s((((safe_sub_func_int16_t_s_s(((*g_4307) = ((p_55 , (safe_rshift_func_uint8_t_u_s((0xC8L != p_55), l_6199[5]))) >= 0x181598CCL)), 0xB386L)) , p_55) ^ 0xEFL), 0x4B6B80BAL))) ^ l_6147)) , 65535UL)), 12))), p_55)))) >= p_55)) | l_6312) >= p_55), 0x70L)) < l_6278) != l_6278); + l_6320 &= ((safe_sub_func_int16_t_s_s((safe_unary_minus_func_uint16_t_u(p_55)), l_6312)) < ((p_55 < l_6153[8][0][0]) != (((safe_rshift_func_int16_t_s_u(((*g_4307) = ((safe_mul_func_int8_t_s_s(((p_55 >= l_6312) , p_55), l_6153[6][0][2])) , p_55)), 12)) || p_55) <= p_55))); + for (g_641 = 6; (g_641 >= 3); g_641 -= 1) + { /* block id: 2714 */ + int32_t l_6358 = 1L; + int i; + (*g_45) = l_6349; + (****g_6317) = ((l_6340 = (((+(((safe_mod_func_int16_t_s_s(p_55, p_55)) , &l_6325[g_641]) != &l_6325[g_641])) <= ((0x4750L >= l_6153[0][0][0]) >= (((*g_2115) &= p_55) < ((safe_div_func_uint8_t_u_u(l_6355, l_6312)) , l_6278)))) , 0x5AD4L)) < 65526UL); + if (l_6199[0]) + continue; + (*g_224) = &l_6187; + } + } + else + { /* block id: 2723 */ + uint16_t l_6371 = 0UL; + int32_t ***** const **l_6374 = &g_6373; + uint8_t ***l_6377[4]; + int i; + for (i = 0; i < 4; i++) + l_6377[i] = &g_1949; + if ((safe_add_func_uint16_t_u_u((safe_rshift_func_int16_t_s_u((l_6341 <= ((l_6199[0] <= p_55) != (safe_unary_minus_func_uint16_t_u((((safe_div_func_uint32_t_u_u((safe_add_func_uint32_t_u_u(((((((*g_1950) = (l_6371 , ((*g_6313) != (l_6374 = g_6372)))) >= (safe_unary_minus_func_uint16_t_u(l_6376[2][6]))) , l_6377[1]) != NULL) > l_6266), l_6371)), 4294967292UL)) , p_55) >= p_55))))), p_55)), 65530UL))) + { /* block id: 2726 */ + (*g_2460) = &l_6341; + } + else + { /* block id: 2728 */ + int16_t l_6401 = 4L; + (******g_6315) = (4L && ((++(*g_1950)) & ((safe_rshift_func_int16_t_s_s((((*g_635) = p_55) || ((*g_635) |= (safe_sub_func_uint16_t_u_u(((!(safe_sub_func_uint16_t_u_u((((safe_mul_func_int16_t_s_s(p_55, p_55)) , l_6390) != (l_6394 = (g_5261 = g_5261))), ((*l_6361) &= (((p_55 <= (p_55 > ((safe_mul_func_uint8_t_u_u(l_6400, 0xFFL)) > 1L))) != p_55) , 0x5EECL))))) || 0x173DL), l_6401)))), p_55)) || p_55))); + l_6153[3][1][0] = l_6199[0]; + l_6153[6][0][2] |= (safe_rshift_func_uint16_t_u_u(65532UL, ((*g_3102)--))); + if (l_6401) + continue; + } + if ((*****g_6316)) + break; + (***g_6080) = &l_6266; + } + l_6266 = ((safe_rshift_func_int16_t_s_s((((((safe_lshift_func_int8_t_s_s((NULL == &l_6130), 0)) && ((safe_mul_func_uint16_t_u_u(((0x2F09L == 0x2A65L) < p_55), (4294967290UL == ((l_6153[0][1][1] = (safe_div_func_uint32_t_u_u((((*l_6210) = l_6416) != (l_6421[3][4][1] = (((safe_rshift_func_uint8_t_u_u((safe_mul_func_int8_t_s_s(4L, (**g_1949))), (*g_1950))) || 1L) , l_6416))), l_6278))) <= 0xFEBEL)))) ^ (-7L))) , 0L) || (*g_635)) < 0xBBL), 9)) < p_55); + for (g_2712 = 0; (g_2712 <= 5); g_2712 += 1) + { /* block id: 2750 */ + uint32_t l_6424[1]; + uint8_t * const *l_6444[9] = {&g_1950,&g_1950,&g_1950,&g_1950,&g_1950,&g_1950,&g_1950,&g_1950,&g_1950}; + uint8_t * const **l_6443 = &l_6444[3]; + int32_t l_6465 = 0xC9AF0E44L; + int32_t l_6466 = 6L; + int32_t l_6467 = 0x7CED8968L; + int i; + for (i = 0; i < 1; i++) + l_6424[i] = 0x5FB913DCL; + l_6424[0] &= (safe_mul_func_int16_t_s_s((0x1F6CL == ((*g_4307) ^= p_55)), (p_55 ^ 0xC7A4L))); + for (g_2593 = 0; (g_2593 <= 5); g_2593 += 1) + { /* block id: 2755 */ + (**g_2459) = NULL; + if (p_55) + break; + if (p_55) + continue; + if (l_6187) + goto lbl_6425; + } + (****g_6317) |= (safe_div_func_int16_t_s_s(((safe_sub_func_uint32_t_u_u((+(3L | (safe_mod_func_int32_t_s_s(l_6128, l_6433)))), (safe_lshift_func_uint8_t_u_u((**g_1949), 0)))) < 0xC9L), ((*g_3102) |= (safe_mod_func_uint16_t_u_u((p_55 >= 252UL), (4294967295UL & l_6278)))))); + for (g_4308 = 5; (g_4308 >= 0); g_4308 -= 1) + { /* block id: 2765 */ + uint32_t l_6453 = 0x390EB116L; + int32_t l_6460 = 0x5101984EL; + int32_t *l_6462 = NULL; + int32_t *l_6463 = NULL; + int32_t *l_6464[2]; + uint32_t l_6475 = 18446744073709551611UL; + int i; + for (i = 0; i < 2; i++) + l_6464[i] = NULL; + (*g_809) = ((g_6438 , (((safe_mod_func_uint8_t_u_u((l_6341 ^= (safe_add_func_uint8_t_u_u((NULL == l_6443), (&g_3376 != &g_3376)))), (safe_add_func_int16_t_s_s(((((safe_rshift_func_uint8_t_u_s((((((5UL || (((**l_6210) = (safe_sub_func_uint8_t_u_u(0UL, (safe_mod_func_uint16_t_u_u(((*g_3102) &= (--l_6453)), (safe_rshift_func_uint16_t_u_s((safe_rshift_func_uint16_t_u_s((0xEE5CE54AL && ((*l_6183) = l_6340)), (*g_3466))), l_6460))))))) , 0L)) | (*g_635)) < 1UL) > p_55) && p_55), p_55)) , 0x9EL) < 1UL) , p_55), 0L)))) , 0UL) != p_55)) , &l_6153[6][0][2]); + l_6461 = NULL; + ++l_6475; + } + } + } + (****g_2457) = (int32_t*) func_87(p_55, p_55, &l_6132, ((p_55 ^ ((!((*l_6494) &= ((safe_add_func_int8_t_s_s(((*g_635) = (safe_sub_func_uint16_t_u_u((safe_rshift_func_uint8_t_u_u((l_6131[1][5] = (safe_rshift_func_int16_t_s_u((safe_add_func_uint8_t_u_u((1L == ((p_55 >= 0x9FL) ^ (safe_add_func_int16_t_s_s(((safe_rshift_func_uint16_t_u_s(p_55, p_55)) ^ (*g_2286)), p_55)))), l_6493)), p_55))), 3)), p_55))), l_6187)) & (*g_2286)))) | p_55)) <= (**g_1949)), l_6495); + for (g_254 = 0; (g_254 <= 5); g_254 += 1) + { /* block id: 2783 */ + return (uint32_t*) l_6421[3][6][1]; + } + } + (********g_6313) |= (NULL == &g_3377); + for (g_2605 = 5; (g_2605 >= 0); g_2605 -= 1) + { /* block id: 2790 */ + uint32_t l_6496 = 4294967288UL; + int32_t **l_6499 = &l_6461; + int8_t l_6521 = 1L; + uint8_t l_6544 = 0x03L; + int16_t l_6568 = 0xEB71L; + int32_t l_6642 = 0x3E77AD8EL; + int32_t l_6643[1]; + int32_t l_6667 = 9L; + int i; + for (i = 0; i < 1; i++) + l_6643[i] = (-1L); + l_6496++; + if (p_55) + break; + (*l_6499) = (*****g_6315); + for (g_2798 = 6; (g_2798 >= 0); g_2798 -= 1) + { /* block id: 2796 */ + int8_t l_6505 = 1L; + int32_t l_6516 = (-6L); + int16_t *****l_6526 = &l_6396; + int16_t l_6527[3]; + int8_t l_6533 = 0xD6L; + int8_t * const *l_6597 = &g_635; + int32_t l_6634 = 0x738850EFL; + int32_t l_6641 = 1L; + int32_t l_6644 = 0xDA150D33L; + int32_t l_6645 = 1L; + int32_t l_6646 = (-1L); + int32_t l_6651[4][10][6] = {{{1L,4L,1L,(-1L),0x2D513B9EL,0L},{(-1L),0x2D513B9EL,0L,8L,0xDB2057C1L,0x4B359CA5L},{(-1L),9L,8L,(-1L),(-9L),1L},{1L,0x2D513B9EL,8L,0x49DA1E28L,0L,0x4B359CA5L},{0x4B359CA5L,4L,0L,(-1L),0L,0L},{0xBBD01D05L,0x2D513B9EL,1L,8L,(-9L),0x4B359CA5L},{0xBBD01D05L,9L,0x49DA1E28L,(-1L),0xDB2057C1L,1L},{0x4B359CA5L,0x2D513B9EL,0x49DA1E28L,0x49DA1E28L,0x2D513B9EL,0x4B359CA5L},{1L,4L,1L,(-1L),0x2D513B9EL,0L},{(-1L),0x2D513B9EL,0L,8L,0xDB2057C1L,0x4B359CA5L}},{{(-1L),9L,8L,(-1L),(-9L),1L},{1L,0x2D513B9EL,8L,0x49DA1E28L,0L,0x4B359CA5L},{0x4B359CA5L,4L,0L,(-1L),0L,0L},{0xBBD01D05L,0x2D513B9EL,1L,8L,(-9L),0x4B359CA5L},{0xBBD01D05L,9L,0x49DA1E28L,(-1L),0xDB2057C1L,1L},{0x4B359CA5L,0x2D513B9EL,0x49DA1E28L,0x49DA1E28L,0x2D513B9EL,0x4B359CA5L},{1L,4L,1L,(-1L),0x2D513B9EL,0L},{(-1L),0x2D513B9EL,0L,8L,0xDB2057C1L,0x4B359CA5L},{(-1L),9L,8L,(-1L),(-9L),1L},{1L,0x2D513B9EL,8L,0x49DA1E28L,0L,0x4B359CA5L}},{{0x4B359CA5L,0x49DA1E28L,0L,(-1L),(-1L),0L},{0x58BD99EEL,0xBBD01D05L,0x512F6989L,0x3EA7E564L,1L,0xFBAA7380L},{0x58BD99EEL,8L,0x6A7A48A7L,(-1L),0x4B359CA5L,0x512F6989L},{0xFBAA7380L,0xBBD01D05L,0x6A7A48A7L,0x6A7A48A7L,0xBBD01D05L,0xFBAA7380L},{0xEE220E93L,0x49DA1E28L,0x512F6989L,(-1L),0xBBD01D05L,0L},{(-1L),0xBBD01D05L,0L,0x3EA7E564L,0x4B359CA5L,0xFBAA7380L},{(-1L),8L,0x3EA7E564L,(-1L),1L,0x512F6989L},{0xEE220E93L,0xBBD01D05L,0x3EA7E564L,0x6A7A48A7L,(-1L),0xFBAA7380L},{0xFBAA7380L,0x49DA1E28L,0L,(-1L),(-1L),0L},{0x58BD99EEL,0xBBD01D05L,0x512F6989L,0x3EA7E564L,1L,0xFBAA7380L}},{{0x58BD99EEL,8L,0x6A7A48A7L,(-1L),0x4B359CA5L,0x512F6989L},{0xFBAA7380L,0xBBD01D05L,0x6A7A48A7L,0x6A7A48A7L,0xBBD01D05L,0xFBAA7380L},{0xEE220E93L,0x49DA1E28L,0x512F6989L,(-1L),0xBBD01D05L,0L},{(-1L),0xBBD01D05L,0L,0x3EA7E564L,0x4B359CA5L,0xFBAA7380L},{(-1L),8L,0x3EA7E564L,(-1L),1L,0x512F6989L},{0xEE220E93L,0xBBD01D05L,0x3EA7E564L,0x6A7A48A7L,(-1L),0xFBAA7380L},{0xFBAA7380L,0x49DA1E28L,0L,(-1L),(-1L),0L},{0x58BD99EEL,0xBBD01D05L,0x512F6989L,0x3EA7E564L,1L,0xFBAA7380L},{0x58BD99EEL,8L,0x6A7A48A7L,(-1L),0x4B359CA5L,0x512F6989L},{0xFBAA7380L,0xBBD01D05L,0x6A7A48A7L,0x6A7A48A7L,0xBBD01D05L,0xFBAA7380L}}}; + int32_t **l_6666 = &l_6421[3][4][1]; + int i, j, k; + for (i = 0; i < 3; i++) + l_6527[i] = 0x0B4DL; + for (g_36 = 4; (g_36 >= 0); g_36 -= 1) + { /* block id: 2799 */ + int8_t *l_6512 = &g_2686; + int32_t l_6515 = 9L; + int i, j; + l_6516 ^= (!(safe_sub_func_uint8_t_u_u((((((*g_635) = (safe_lshift_func_uint8_t_u_s(1UL, 0))) || g_3505[(g_2798 + 1)][g_2798]) | 0x33CAL) , ((l_6505 | (safe_sub_func_int32_t_s_s(((*g_2442) ^= ((safe_mul_func_uint16_t_u_u(((((l_6515 &= ((safe_mul_func_uint8_t_u_u((((*l_6512) = ((*g_635) = p_55)) & p_55), ((safe_div_func_int32_t_s_s((8UL ^ 1L), 0x0A8CD1DDL)) <= 8UL))) >= 250UL)) | (**l_6499)) , p_55) || p_55), 0x0773L)) , (*******g_6314))), l_6128))) & 0L)), p_55))); + for (g_2617 = 0; (g_2617 >= 0); g_2617 -= 1) + { /* block id: 2808 */ + uint32_t *l_6517 = NULL; + if (p_55) + break; + return l_6517; + } + } + if (((((+(safe_rshift_func_int8_t_s_u(((*g_635) = (((l_6521 || 65533UL) & (0x45L & (p_55 , (((safe_rshift_func_int16_t_s_u((((*g_2286) | (safe_unary_minus_func_uint32_t_u(p_55))) >= (l_6525 = 0x9BE3L)), 7)) , (((((p_55 <= (((((********g_6313) = p_55) && p_55) , (**l_6499)) || p_55)) , (*g_4307)) == p_55) , (int16_t*****) NULL) != l_6526)) == p_55)))) , p_55)), 3))) < l_6197) , l_6527[1]) < 6L)) + { /* block id: 2816 */ + int32_t l_6534 = (-1L); + int8_t *l_6535[3][7][5] = {{{&g_2648,&g_2576,&g_2696,&g_2696,&g_2576},{&g_2576,NULL,&g_2648,&g_2576,&g_2696},{&g_2612[0],&g_2576,NULL,&g_2576,&g_2612[0]},{&g_2648,&g_2746,NULL,&g_2696,&g_2746},{&g_2612[0],NULL,NULL,&g_2612[0],&g_2696},{&g_2576,&g_2612[0],NULL,&g_2746,&g_2746},{&g_2648,&g_2612[0],&g_2648,&g_2696,&g_2612[0]}},{{&g_2746,NULL,&g_2696,&g_2746,&g_2696},{&g_2746,&g_2746,NULL,&g_2612[0],&g_2576},{&g_2648,&g_2576,&g_2696,&g_2696,&g_2576},{&g_2576,NULL,&g_2648,&g_2576,&g_2696},{&g_2612[0],&g_2576,NULL,&g_2576,&g_2612[0]},{&g_2648,&g_2746,NULL,&g_2696,&g_2746},{&g_2612[0],NULL,NULL,&g_2612[0],&g_2696}},{{&g_2576,NULL,&g_2746,&g_2648,&g_2648},{&g_2591,NULL,&g_2591,&g_2664,NULL},{&g_2648,NULL,&g_2664,&g_2648,&g_2664},{&g_2648,&g_2648,&g_2746,NULL,&g_2696},{&g_2591,&g_2696,&g_2664,&g_2664,&g_2696},{&g_2696,NULL,&g_2591,&g_2696,&g_2664},{NULL,&g_2696,&g_2746,&g_2696,NULL}}}; + uint8_t l_6545 = 1UL; + uint8_t ***l_6563 = &g_1949; + int i, j, k; + (*****g_6316) = (((!(((*g_2442) = l_6505) <= (safe_mod_func_int8_t_s_s((*l_6461), (((safe_sub_func_uint16_t_u_u(l_6533, (l_6534 = (-2L)))) ^ (*l_6461)) , (l_6516 = ((*g_635) = 0xB7L))))))) , (safe_div_func_uint32_t_u_u((safe_mod_func_uint16_t_u_u((safe_mod_func_int8_t_s_s(((safe_sub_func_uint8_t_u_u((NULL != (*g_3622)), 255UL)) >= p_55), l_6544)), 0x3ED5L)), 0xC1940E01L))) == p_55); + if (p_55) + continue; + --l_6545; + (*g_809) = (int32_t*) func_187((*g_1950), (safe_lshift_func_int8_t_s_u(((safe_div_func_uint32_t_u_u(((**g_2285) = l_6129), (safe_div_func_int8_t_s_s(((safe_lshift_func_uint16_t_u_s(((safe_lshift_func_uint16_t_u_u((p_55 >= ((p_55 || (safe_lshift_func_int16_t_s_s(((safe_add_func_int16_t_s_s(0xFBEEL, (((l_6563 = l_6562) != NULL) != (safe_sub_func_uint16_t_u_u((**l_6499), ((safe_rshift_func_int8_t_s_u(((*g_4307) , p_55), 0)) < l_6197)))))) , p_55), p_55))) ^ l_6568)), p_55)) > (**l_6499)), 6)) ^ 0UL), p_55)))) || 1L), 0))); + } + else + { /* block id: 2827 */ + int16_t l_6582 = (-10L); + int16_t * const **l_6592 = &g_4304[0][3][8]; + int16_t * const ***l_6591 = &l_6592; + int32_t l_6626[2][8][2] = {{{(-5L),(-9L)},{(-5L),0L},{4L,4L},{0L,(-5L)},{(-9L),(-5L)},{0L,4L},{4L,0L},{(-5L),(-9L)}},{{(-5L),0L},{4L,4L},{0L,(-5L)},{(-9L),(-5L)},{0L,4L},{4L,0L},{(-5L),(-9L)},{(-5L),0L}}}; + int32_t *l_6627 = &l_6129; + int32_t *l_6628 = &l_6153[5][1][0]; + int32_t *l_6629 = NULL; + int32_t *l_6630 = NULL; + int32_t *l_6631 = NULL; + int32_t *l_6632 = &l_6624[3][0]; + int32_t *l_6633 = &l_6516; + int32_t *l_6635 = NULL; + int32_t *l_6636 = &l_6626[1][1][1]; + int32_t *l_6637 = &g_641; + int32_t *l_6638 = &l_6128; + int32_t *l_6639 = &g_46; + int32_t *l_6640[6][10][4] = {{{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL}},{{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL}},{{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634}},{{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254}},{{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL}},{{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL},{&l_6128,NULL,&l_6624[1][0],&l_6525},{&l_6153[7][2][2],&l_6626[0][3][0],&l_6153[7][2][2],&l_6634},{&l_6128,&g_254,&l_6153[7][2][2],&g_254},{&l_6153[7][2][2],&g_254,&l_6624[1][0],&g_254},{&l_6128,&l_6634,&l_6624[1][0],&l_6626[0][3][0]},{&l_6153[7][2][2],&l_6525,&l_6153[7][2][2],NULL},{&l_6128,NULL,&l_6153[7][2][2],&l_6153[6][0][2]},{&l_6153[7][2][2],&l_6153[6][0][2],&l_6624[1][0],NULL}}}; + uint32_t l_6653 = 0x1DBB577EL; + int i, j, k; + (*g_45) = (*g_65); + for (p_55 = 1; (p_55 <= 5); p_55 += 1) + { /* block id: 2831 */ + uint32_t l_6598[8] = {0x0D570715L,9UL,9UL,0x0D570715L,9UL,9UL,0x0D570715L,9UL}; + int16_t l_6625[2]; + int i; + for (i = 0; i < 2; i++) + l_6625[i] = (-7L); + (*l_6461) &= 0x00691C7FL; + l_6130 &= (((!((safe_lshift_func_int16_t_s_s((safe_mod_func_int16_t_s_s((((((((safe_sub_func_int8_t_s_s((safe_add_func_uint16_t_u_u((safe_add_func_int16_t_s_s((safe_sub_func_uint16_t_u_u(l_6582, ((*g_4307) |= (safe_div_func_int32_t_s_s((safe_lshift_func_uint8_t_u_s((safe_rshift_func_uint16_t_u_s((l_6131[0][3] = ((safe_mod_func_int16_t_s_s(((((-1L) && (0x3BL != ((**l_6499) = (((*g_2446) , &g_1117) != l_6591)))) , (p_55 , p_55)) , (safe_div_func_int32_t_s_s((((safe_mul_func_int16_t_s_s((0x27A25F0AL & (*l_6461)), (**l_6499))) == p_55) == l_6582), 0xBD142252L))), 0x3283L)) ^ l_6505)), 8)), l_6582)), l_6582))))), l_6197)), p_55)), 0x2AL)) ^ 0xAEDFL) , l_6597) != (*g_538)) > (*g_635)) || 0x7EL) | p_55), 0xBAFCL)), 10)) <= 0xED2FL)) <= 4294967294UL) , 0x646F7715L); + l_6598[7] |= (p_55 ^ ((*g_225) = 0x8EC040ADL)); + (*l_6461) = (safe_mul_func_uint16_t_u_u((safe_add_func_uint8_t_u_u((l_6598[6] != ((***g_2102) = ((safe_unary_minus_func_int16_t_s((((safe_lshift_func_uint8_t_u_s((**l_6499), ((safe_add_func_int16_t_s_s(0L, (safe_sub_func_int32_t_s_s(((((-7L) || (((((safe_mul_func_int8_t_s_s((safe_add_func_int16_t_s_s((safe_div_func_int32_t_s_s((safe_lshift_func_uint8_t_u_u((safe_rshift_func_int16_t_s_u(((*g_4307) = (-7L)), ((0x1617L != (safe_add_func_uint32_t_u_u(((**l_6499) <= p_55), (safe_lshift_func_uint16_t_u_u(p_55, 11))))) , (*l_6461)))), (*g_1950))), l_6598[2])), l_6527[2])), 248UL)) == 6L) ^ (*g_635)) <= l_6289) , 0x477F08A6L)) , 0x012EL) < l_6624[3][0]), l_6516)))) || (*l_6461)))) <= p_55) > l_6598[7]))) < p_55))), 1UL)), l_6625[0])); + } + l_6647++; + l_6653--; + } + for (g_641 = 0; (g_641 <= 5); g_641 += 1) + { /* block id: 2848 */ + int32_t *l_6668 = &l_6128; + int i; + (*l_6499) = (((((*g_4307) = (((*l_6361) &= (safe_sub_func_uint8_t_u_u(0x2CL, g_2674[g_641]))) > 0x8BE1L)) || (((safe_add_func_uint8_t_u_u(((safe_lshift_func_uint8_t_u_s((p_55 > ((p_55 == ((safe_sub_func_uint32_t_u_u(((safe_rshift_func_uint16_t_u_s((l_6129 = (l_6634 | ((((((*g_635) |= (((*g_6212) = l_6666) == &l_6421[0][7][1])) ^ 0xEAL) , p_55) , p_55) , 4294967292UL))), 12)) < p_55), p_55)) , 0x3AL)) == l_6667)), l_6527[2])) && 0xA933L), (**g_1949))) && l_6505) && 0x7B31L)) && 0x0E1CL) , l_6668); + if (p_55) + continue; + return (*g_2470); + } + } + } + for (g_2611 = 1; (g_2611 <= 5); g_2611 += 1) + { /* block id: 2862 */ + int32_t ****l_6697 = NULL; + int32_t l_6699[5]; + const int8_t *l_6718[5][10] = {{&g_2732,&g_2640,&g_2615,&g_2681,&g_2681,&g_2615,&g_2640,&g_2732,&g_2615,&g_2732},{&g_2681,&g_2601,&g_2670[1],&g_2681,&g_2670[1],&g_2601,&g_2681,&g_2593,&g_2593,&g_2681},{&g_2593,&g_2732,&g_2670[1],&g_2670[1],&g_2732,&g_2593,&g_2601,&g_2732,&g_2601,&g_2593},{&g_2640,&g_2732,&g_2615,&g_2732,&g_2640,&g_2615,&g_2681,&g_2681,&g_2615,&g_2640},{&g_2640,&g_2601,&g_2601,&g_2640,&g_2670[1],&g_2593,&g_2640,&g_2593,&g_2670[1],&g_2640}}; + int i, j; + for (i = 0; i < 5; i++) + l_6699[i] = 0x6DF00E72L; + for (g_463 = 0; (g_463 <= 5); g_463 += 1) + { /* block id: 2865 */ + int16_t l_6673 = 4L; + int32_t l_6698 = 0x7240E08AL; + int32_t l_6700 = 0L; + int32_t l_6701[8][7]; + int32_t *l_6702[10][10][2] = {{{&g_641,&l_6128},{&l_6311,&l_6130},{&l_6153[6][0][2],&l_6128},{NULL,&l_6128},{&l_6153[6][0][2],&l_6130},{&l_6311,&l_6128},{&g_641,&l_6128},{&l_6311,&l_6130},{&l_6153[6][0][2],&l_6128},{NULL,&l_6130}},{{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700}},{{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130}},{{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130}},{{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700}},{{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130}},{{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130}},{{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700}},{{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130}},{{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130},{&g_641,&l_6700},{NULL,&l_6130},{&l_6701[2][5],&l_6130},{NULL,&l_6700},{&g_641,&l_6130},{NULL,&l_6130}}}; + int32_t l_6703 = 1L; + int i, j, k; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 7; j++) + l_6701[i][j] = 1L; + } + (*g_65) = (safe_mul_func_uint16_t_u_u((safe_div_func_int32_t_s_s((-2L), ((l_6673 != ((p_55 < (safe_mod_func_int32_t_s_s((safe_rshift_func_uint16_t_u_u(1UL, 0)), (+(p_55 ^ (((**g_2285) ^= ((safe_mod_func_uint8_t_u_u(((((safe_rshift_func_int16_t_s_s(((!((*g_4307) = (l_6238 && ((safe_div_func_int8_t_s_s(0xCEL, ((*g_635) = (safe_rshift_func_uint16_t_u_u((((((safe_div_func_int32_t_s_s((safe_add_func_uint16_t_u_u(0x85F0L, (safe_lshift_func_int16_t_s_u((((safe_lshift_func_uint8_t_u_s((0x9F930914L && (**g_6319)), 2)) > 1L) , p_55), l_6153[2][2][2])))), p_55)) < 0x9AL) , l_6696) == l_6696) , l_6647), 9))))) == 1L)))) < 6UL), 3)) , (-1L)) , (int32_t****) NULL) == l_6697), l_6311)) > l_6673)) < 1UL)))))) , p_55)) , p_55))), 1UL)); + l_6704--; + l_6707 = ((***g_6080) = &l_6700); + (********g_6313) = ((*g_2442) |= (safe_sub_func_uint8_t_u_u((((*g_1950) = ((safe_div_func_uint32_t_u_u((safe_mul_func_uint16_t_u_u((safe_lshift_func_int8_t_s_s(p_55, 2)), (safe_mul_func_int8_t_s_s((((*l_6707) , (NULL == l_6718[3][4])) > (*l_6707)), (+((safe_add_func_uint8_t_u_u(0x3EL, (safe_add_func_int16_t_s_s(((safe_lshift_func_int8_t_s_s(((((safe_add_func_int16_t_s_s(((p_55 <= (((&g_4618 != l_6728) , p_55) > 1UL)) > p_55), p_55)) , (*g_2286)) && 0L) >= p_55), p_55)) && p_55), (*g_3466))))) , p_55)))))), 4294967291UL)) != (*g_45))) , p_55), p_55))); + } + (*g_2442) &= (*g_65); + if ((****g_6317)) + break; + } + } + for (g_2740 = (-21); (g_2740 == (-5)); g_2740++) + { /* block id: 2883 */ + uint16_t *l_6734[3][3]; + uint16_t *l_6739 = &g_622[0]; + uint16_t ** const l_6738 = &l_6739; + uint16_t ** const *l_6737 = &l_6738; + int32_t l_6741 = 0x929DE3ECL; + int32_t ****l_6748 = &g_6212; + int32_t l_6750 = 4L; + int8_t *l_6752 = &g_2622; + int i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 3; j++) + l_6734[i][j] = &g_48; + } + for (g_2773 = (-18); (g_2773 < (-17)); g_2773 = safe_add_func_uint8_t_u_u(g_2773, 9)) + { /* block id: 2886 */ + int8_t l_6733 = (-5L); + uint16_t *l_6735 = &g_622[0]; + uint16_t ** const **l_6740 = &g_3836; + int32_t *l_6751 = NULL; + (*g_224) = &l_6130; + return (uint32_t*) l_6751; + } + } + return (*g_2470); +} + + +/* ------------------------------------------ */ +/* + * reads : g_224 g_45 g_225 g_2457 g_2458 g_2459 g_2460 g_2286 g_2287 g_46 g_540 g_539 g_4618 g_5311 g_65 g_5637 g_5786 g_1950 g_450 g_2576 g_2727 g_3102 g_622 g_2446 g_643 g_2102 g_1949 g_1859 g_3622 g_1103 g_2285 g_635 g_462 g_4307 g_4308 g_641 g_5857 g_2442 g_621 g_809 g_2115 g_2470 g_5312 g_538 g_262 g_1119 g_6022 g_2662 g_3466 g_3467 g_2690 g_2772 g_6078 g_466 g_3376 g_3377 + * writes: g_46 g_1859 g_810 g_2287 g_262 g_5312 g_641 g_2576 g_2769 g_2727 g_2734 g_622 g_450 g_1103 g_4308 g_621 g_284 g_1950 g_5957 g_2662 g_462 g_5637 g_2690 g_2772 g_6078 g_466 g_3378 + */ +static int16_t func_59(int32_t * const p_60, uint32_t * const p_61, int32_t * p_62, uint32_t p_63, int8_t * p_64) +{ /* block id: 2469 */ + int16_t ***l_5717 = &g_4618; + int32_t l_5720 = 0xDD124FA0L; + uint32_t l_5721 = 0UL; + uint16_t l_5737 = 3UL; + int8_t l_5749 = 0x26L; + int16_t l_5753 = (-1L); + int32_t l_5761 = 0L; + int16_t l_5791 = 0x6558L; + int32_t *l_5833 = NULL; + uint16_t *****l_5855 = &g_3621[0]; + int8_t l_5875 = 0L; + uint32_t * const **l_5902 = &g_2285; + uint32_t * const ***l_5901[4][4] = {{&l_5902,&l_5902,&l_5902,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902}}; + uint32_t l_5903 = 0xF828333FL; + uint32_t *l_5911[2][10][7] = {{{&g_2280,NULL,NULL,&g_2280,NULL,&g_2284,&g_260[6][2][1]},{&g_2284,&g_260[6][2][1],NULL,&g_393,&g_393,&g_2287[0],&g_260[8][1][0]},{&g_260[9][6][1],&g_393,&g_2287[4],&g_260[5][2][1],&g_260[0][1][1],NULL,&g_260[6][2][1]},{&g_2287[3],&g_260[5][0][1],&g_2280,&g_1679,&g_2280,&g_1679,&g_260[9][5][0]},{&g_1335,&g_2287[5],&g_260[0][1][1],&g_1335,NULL,NULL,&g_1335},{NULL,&g_2287[0],&g_393,&g_2280,&g_2284,NULL,&g_1335},{&g_260[6][2][1],&g_2287[0],NULL,NULL,NULL,NULL,&g_1679},{&g_260[9][3][1],&g_2287[5],&g_260[9][3][1],&g_2287[4],&g_2287[4],&g_260[9][3][1],&g_2287[5]},{&g_393,&g_260[5][0][1],NULL,&g_2287[5],&g_393,&g_1335,&g_1335},{NULL,&g_393,&l_5903,&g_260[9][2][1],&g_1335,&g_1679,NULL}},{{&g_260[9][2][1],&g_260[6][2][1],&l_5903,&g_2287[5],&g_260[9][6][1],&g_393,&g_1335},{&g_260[0][1][1],NULL,&g_260[9][6][1],&g_2287[4],&g_1679,&g_2280,NULL},{NULL,&g_2287[3],&g_2287[0],NULL,&g_260[8][1][0],NULL,&g_2280},{&g_2287[5],&g_2284,&g_1679,&g_2280,&g_2284,NULL,&g_260[9][3][1]},{&l_5903,&g_260[8][1][0],&g_260[9][5][0],&g_1335,&g_1335,&g_2280,&g_2280},{&g_393,&g_1679,&g_1679,&g_1679,&g_393,&g_393,&g_2284},{&g_260[5][0][1],&g_260[9][3][1],&g_260[9][2][1],&g_260[5][2][1],NULL,&g_1679,NULL},{&g_2287[4],&g_1335,NULL,&g_393,NULL,&g_1335,NULL},{&g_260[5][0][1],&g_260[5][2][1],NULL,&g_2280,&g_2280,&g_260[9][3][1],NULL},{&g_393,&g_260[9][5][0],&g_2280,NULL,&g_260[5][0][1],NULL,&g_393}}}; + int32_t l_5993 = 0xF7BFF1F3L; + int32_t l_6004 = 0xC3044A40L; + int32_t l_6031 = 0x98B36169L; + int32_t l_6058 = 0x3A95D342L; + int16_t ****l_6063 = NULL; + int16_t *****l_6062 = &l_6063; + int16_t ******l_6061 = &l_6062; + int8_t l_6092 = 0x74L; + int32_t l_6093[8] = {0xC53DCE65L,0xDC54A304L,0xC53DCE65L,0xDC54A304L,0xC53DCE65L,0xDC54A304L,0xC53DCE65L,0xDC54A304L}; + uint8_t l_6096 = 0x94L; + uint8_t ***l_6108 = NULL; + int32_t l_6109 = 0x3B8225F8L; + int i, j, k; + if (((**g_224) = (((p_63 , (&g_4306[3] == l_5717)) & (safe_mod_func_int16_t_s_s((l_5720 = 4L), l_5721))) && p_63))) + { /* block id: 2472 */ + int32_t l_5722 = (-3L); + uint32_t ****l_5738 = &g_4680; + uint32_t ****l_5739 = &g_4680; + int32_t **l_5740 = &g_810[0]; + uint16_t *l_5750 = &g_4962; + int16_t **l_5754 = &g_1119[1]; + int8_t * const l_5755[2][7][2] = {{{&g_2640,&g_2772},{&g_2704[4],&g_2704[4]},{&g_2704[4],&g_2772},{&g_2640,&g_2634},{&g_2772,&g_2634},{&g_2640,&g_2772},{&g_2704[4],&g_2704[4]}},{{&g_2704[4],&g_2772},{&g_2640,&g_2634},{&g_2772,&g_2634},{&g_2640,&g_2772},{&g_2704[4],&g_2704[4]},{&g_2704[4],&g_2772},{&g_2640,&g_2634}}}; + int32_t l_5759 = 0x6AC444A5L; + int32_t l_5760[7]; + uint16_t l_5762 = 0UL; + uint8_t ****l_5776 = NULL; + int32_t **l_5780 = &g_2446; + int32_t **l_5781[5] = {NULL,NULL,NULL,NULL,NULL}; + int32_t l_5986 = 1L; + int8_t l_5994 = 0xE5L; + int16_t l_6003[4][6][9] = {{{0x8983L,2L,0x6774L,0L,0x915EL,0x2FD7L,0xCC1DL,(-1L),(-2L)},{0x6774L,0x66D1L,0x02D1L,0x5F40L,0x6E15L,(-10L),0L,0L,(-1L)},{1L,0xCC1DL,0L,(-3L),0x6E15L,(-2L),0x9C78L,0x02D1L,(-10L)},{0L,(-6L),2L,0x915EL,0x915EL,2L,(-6L),0L,1L},{0x66D1L,0x8983L,0xCE51L,0x1ADEL,0x6774L,(-10L),0L,(-9L),(-6L)},{0L,0x4678L,0x915EL,0L,(-3L),1L,0x7809L,0x1ADEL,1L}},{{(-1L),(-2L),0xA98BL,0x9C78L,0xCE51L,0L,0x1ADEL,0L,(-10L)},{0L,0x6E15L,0x93ADL,0x7591L,0xAF83L,(-6L),(-1L),0x8983L,(-1L)},{0xAF83L,0x4E07L,0L,0x7591L,0x43EFL,9L,1L,(-2L),(-2L)},{(-6L),0x8EBEL,(-10L),0x9C78L,(-10L),0x8EBEL,(-6L),0xBB5DL,0x7591L},{0L,2L,0L,0L,(-1L),0x7591L,0xB9A0L,0xCC58L,(-1L)},{2L,0xCC58L,0x43EFL,0x1ADEL,0x9C78L,(-3L),0x93ADL,0xBB5DL,0x6774L}},{{(-3L),0x6774L,0L,0x915EL,0x2FD7L,0xCC1DL,(-1L),(-2L),1L},{0xA98BL,(-5L),0xB9A0L,(-3L),(-2L),0x93ADL,0L,0x8983L,0L},{0x7809L,0x02D1L,0xB9A0L,0x5F40L,0L,0x0FDEL,0x2FD7L,0L,0x2FD7L},{(-1L),0xBB5DL,0L,0L,0xBB5DL,(-1L),0x4678L,0x1ADEL,0x93ADL},{(-2L),0x7809L,0x43EFL,0x4678L,(-1L),0x02D1L,0x6E15L,(-9L),0L},{0x0FDEL,0L,0L,(-1L),(-1L),0xCC58L,0x4678L,0L,0xCE51L}},{{(-5L),(-9L),(-10L),0xA98BL,0x8EBEL,0L,0x2FD7L,0x02D1L,0x1ADEL},{0x8983L,(-10L),0L,0x0FDEL,0L,0x6774L,0L,0L,0xBB5DL},{(-1L),(-10L),0x93ADL,1L,0x5F40L,0x4678L,(-1L),(-1L),0x4678L},{0L,(-9L),0xA98BL,(-9L),9L,0xBB5DL,0L,0L,0x6774L},{(-2L),9L,0x66D1L,(-9L),1L,0xCC58L,0x0FDEL,1L,0L},{0xCE51L,2L,(-5L),0x7591L,(-6L),0xBB5DL,1L,0x2FD7L,0x93ADL}}}; + int i, j, k; + for (i = 0; i < 7; i++) + l_5760[i] = 0L; + (****g_2457) = p_62; +lbl_5765: + (*l_5740) = (int32_t*) p_61; + if ((safe_sub_func_uint32_t_u_u(((safe_add_func_int16_t_s_s((safe_mod_func_uint32_t_u_u((!(((((((**g_540) = func_77((~l_5749), (*p_62), l_5750, func_77((--(*g_2286)), (p_63 , (**g_224)), &l_5737, func_77(((l_5753 , l_5754) != (l_5721 , l_5754)), (*p_62), &l_5737, l_5755[1][0][0])))) != l_5755[1][0][0]) , l_5754) != (*l_5717)) >= 0xA444L) != 0xE281L)), 0x071FFD3CL)), p_63)) >= 0xC4E6L), 1L))) + { /* block id: 2479 */ + int32_t *l_5756 = &g_642; + int32_t *l_5757 = &g_254; + int32_t *l_5758[3][4] = {{&g_621,&g_621,&g_621,&g_621},{&g_621,&g_621,&g_621,&g_621},{&g_621,&g_621,&g_621,&g_621}}; + int i, j; + l_5762++; + if (p_63) + goto lbl_5765; + } + else + { /* block id: 2482 */ + uint32_t l_5774 = 0x8D39A8A4L; + uint8_t *****l_5777 = &l_5776; + int32_t **l_5779 = &g_2446; + int32_t ***l_5778[7][7] = {{&l_5779,&l_5779,NULL,&l_5779,&l_5779,NULL,&l_5779},{&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779},{&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779},{&l_5779,&l_5779,NULL,&l_5779,&l_5779,NULL,&l_5779},{&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779},{&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779,&l_5779},{&l_5779,&l_5779,NULL,&l_5779,&l_5779,NULL,&l_5779}}; + int32_t l_5808 = 0x99E50EFCL; + int8_t l_5809 = 1L; + const int32_t l_5858 = 4L; + uint8_t l_5874 = 246UL; + const uint16_t *l_5914 = NULL; + uint16_t *l_5955 = NULL; + int16_t l_5980[5][6] = {{1L,1L,1L,1L,1L,1L},{1L,1L,1L,1L,1L,1L},{1L,1L,1L,1L,1L,1L},{1L,1L,1L,1L,1L,1L},{1L,1L,1L,1L,1L,1L}}; + int32_t l_5988 = (-10L); + int32_t l_5991 = 0L; + int32_t l_5996 = 1L; + int32_t l_5999 = (-2L); + int32_t l_6002[6]; + uint32_t l_6005[6][3] = {{18446744073709551615UL,1UL,0xAEEC674DL},{0xCBF2D476L,18446744073709551608UL,0UL},{18446744073709551615UL,18446744073709551615UL,0UL},{18446744073709551608UL,0xCBF2D476L,0xAEEC674DL},{1UL,18446744073709551615UL,1UL},{1UL,18446744073709551608UL,18446744073709551615UL}}; + uint32_t l_6010 = 1UL; + int i, j; + for (i = 0; i < 6; i++) + l_6002[i] = 0x4526D36AL; + (*p_62) |= (safe_add_func_int32_t_s_s((safe_lshift_func_uint8_t_u_u((safe_add_func_int8_t_s_s((safe_rshift_func_int16_t_s_s(((((l_5780 = ((p_63 && (l_5774 >= (+((*g_5637) = ((*g_65) = (((*g_5311) = NULL) != ((*l_5777) = l_5776))))))) , &g_2446)) == l_5781[3]) && ((-9L) >= (safe_rshift_func_int8_t_s_s((-1L), (safe_add_func_uint32_t_u_u(g_5786, 0x145F44E2L)))))) , p_63), 9)), l_5774)), (*g_1950))), 0x2244E91EL)); + for (g_2576 = 0; (g_2576 > 21); ++g_2576) + { /* block id: 2491 */ + uint16_t **l_5834 = &g_5096[8]; + int32_t l_5835 = 0x6F204B7AL; + int32_t l_5836 = 0xD6B95ABCL; + uint32_t l_5856 = 18446744073709551615UL; + int32_t l_5876 = (-8L); + int32_t l_5987 = 0x3128A68BL; + int32_t l_5992 = (-4L); + int32_t l_5995 = (-1L); + int32_t l_5998 = 1L; + int32_t l_6000 = (-4L); + int32_t l_6001 = (-1L); + for (g_2769 = 0; (g_2769 <= 2); g_2769 += 1) + { /* block id: 2494 */ + int32_t l_5810 = 0xF3AE145DL; + int i; + l_5720 = ((*p_62) = ((safe_sub_func_uint8_t_u_u(l_5791, (safe_rshift_func_uint8_t_u_s(p_63, (safe_sub_func_uint16_t_u_u(((NULL != &p_64) | (((safe_add_func_int32_t_s_s((((safe_lshift_func_int8_t_s_s((l_5753 , (((*g_45) ^= (safe_rshift_func_uint16_t_u_s((l_5808 = (0x931ABD91L | ((*g_2286) ^= (safe_mul_func_uint8_t_u_u((p_63 >= (safe_mul_func_int8_t_s_s(((*p_64) = (safe_rshift_func_uint16_t_u_u(0xB34DL, p_63))), 0xC4L))), l_5774))))), 4))) <= (*p_62))), p_63)) != l_5809) ^ l_5810), l_5809)) , (uint8_t****) NULL) != NULL)), l_5810)))))) , 0L)); + for (g_2734 = 0; (g_2734 < 19); ++g_2734) + { /* block id: 2503 */ + (*p_60) = ((safe_mod_func_uint8_t_u_u(l_5810, (*p_64))) & ((*g_3102) |= (l_5808 = 0x8810L))); + (*g_5637) ^= ((((&g_643[6] != ((*g_2446) , (((((((*g_4307) &= (safe_mul_func_uint16_t_u_u(((safe_div_func_uint16_t_u_u(p_63, (safe_add_func_int16_t_s_s(((((safe_add_func_int8_t_s_s((safe_unary_minus_func_uint16_t_u(((*g_3102) ^= (safe_lshift_func_int8_t_s_u((l_5774 ^ ((++(***g_2102)) | (((safe_rshift_func_int8_t_s_s(((*p_64) = ((((safe_lshift_func_int16_t_s_u(((safe_unary_minus_func_int32_t_s((*p_60))) == (*p_64)), (l_5835 = (((**g_2285) = (((***g_2458) != l_5833) , ((((*g_3622) = (*g_3622)) == l_5834) || l_5835))) <= l_5810)))) , (int32_t***) NULL) != NULL) & 0x42L)), (*g_635))) < l_5810) ^ 1UL))), l_5836))))), (-9L))) , l_5774) , (-1L)) & l_5808), p_63)))) <= 0xCDL), l_5809))) > l_5836) , 0x75L) , 0x00CEL) ^ p_63) , p_60))) <= l_5836) < 0x2A98EA71L) | 4294967295UL); + if (l_5809) + break; + (*p_62) ^= l_5809; + } + } + if (((((((safe_lshift_func_uint8_t_u_u(p_63, 4)) , (((*g_635) && p_63) ^ (l_5835 ^= (((((**g_2285) || ((*g_225) = ((*g_5637) = (((safe_lshift_func_int16_t_s_u(((((*p_60) , (safe_div_func_int8_t_s_s(((safe_add_func_int32_t_s_s((**g_224), ((safe_div_func_uint32_t_u_u((**g_2285), (((safe_div_func_uint8_t_u_u((p_63 , ((safe_mul_func_int16_t_s_s(((safe_mod_func_int16_t_s_s(((((safe_mul_func_uint8_t_u_u(((p_63 , p_63) && l_5809), l_5809)) || l_5774) & l_5836) , p_63), p_63)) , l_5836), 0UL)) , (*g_1950))), (*p_64))) , l_5749) , l_5774))) == 0L))) | 4294967287UL), 255UL))) , l_5855) == NULL), 13)) > (*p_64)) & 0x8DEF1404L)))) || 0UL) != l_5856) , (*g_2286))))) & (***g_2102)) | p_63) < g_5857) > l_5858)) + { /* block id: 2522 */ + int32_t l_5873 = 3L; + uint16_t *l_5917 = &g_4962; + (*p_62) = (safe_mod_func_uint8_t_u_u(0x43L, (safe_sub_func_uint8_t_u_u(((safe_add_func_uint8_t_u_u((((safe_mul_func_int8_t_s_s(((*p_60) || (((***g_2102) = ((safe_mod_func_uint32_t_u_u(((((**g_1949) || (*p_64)) == 0x4F84F4C2L) , (((0xFA94L == ((*p_62) , (safe_rshift_func_uint8_t_u_s((NULL == &g_3376), l_5873)))) & (-7L)) == 2L)), (*p_60))) , 2UL)) >= l_5721)), l_5808)) , l_5874) , p_63), l_5875)) == p_63), l_5876)))); + if ((*p_62)) + { /* block id: 2525 */ + if ((*p_62)) + break; + } + else + { /* block id: 2527 */ + const uint8_t l_5886[4][9] = {{0xBBL,0xDEL,254UL,2UL,254UL,0xDEL,0xBBL,0xDEL,254UL},{1UL,5UL,5UL,1UL,5UL,5UL,1UL,5UL,5UL},{0xBBL,0xDEL,254UL,2UL,254UL,0xDEL,0xBBL,0xDEL,254UL},{1UL,5UL,5UL,1UL,5UL,5UL,1UL,5UL,5UL}}; + int i, j; + (*g_2442) |= (safe_mul_func_uint8_t_u_u((((((safe_lshift_func_int16_t_s_u(l_5876, (((safe_mul_func_int16_t_s_s((!(((((*p_64) < 0x48L) & p_63) <= ((((*g_65) == (safe_lshift_func_uint8_t_u_u((9UL >= (((l_5886[3][0] <= ((safe_rshift_func_uint8_t_u_u(p_63, 0)) >= ((safe_sub_func_int32_t_s_s((&p_64 != NULL), (-10L))) || p_63))) || (**g_2285)) , 1UL)), 6))) && l_5836) ^ 0x633AL)) <= (*p_60))), 0x4BF8L)) || (***g_2102)) > p_63))) , p_63) ^ l_5836) > (*p_62)) || 0L), (*g_1950))); + if (l_5886[3][0]) + continue; + (*g_809) = &l_5808; + } + if ((*p_62)) + break; + if ((((safe_add_func_uint16_t_u_u((*g_2115), (-4L))) || (safe_mod_func_int8_t_s_s(((*p_64) = (-10L)), (((*g_5637) >= (safe_rshift_func_int16_t_s_s(p_63, (l_5873 = (safe_rshift_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s((((&g_4680 == l_5901[1][2]) | ((*g_4307) = (l_5903 <= ((safe_add_func_uint8_t_u_u(l_5873, l_5809)) || p_63)))) <= 0x04L), 2)), 12)))))) , (***g_2102))))) == (*g_635))) + { /* block id: 2536 */ + const int16_t l_5910 = 0x7E15L; + (*g_45) &= ((safe_mul_func_uint8_t_u_u(p_63, (p_63 == ((safe_sub_func_uint32_t_u_u(l_5910, (((((l_5911[1][7][0] == ((*g_2470) = func_87((0x1C95L > 4UL), ((*p_64) |= (+(!(*g_1950)))), l_5914, ((safe_sub_func_int32_t_s_s((0xD4C600BAL > l_5873), l_5910)) , l_5876), l_5917))) >= p_63) <= (*g_5637)) , (*g_5311)) == (*g_5311)))) || l_5835)))) , l_5910); + } + else + { /* block id: 2540 */ + int32_t l_5918 = 0x2850C2F6L; + int32_t l_5919 = 1L; + uint16_t l_5925 = 0x0656L; + int32_t l_5926 = 0x277823DCL; + (*p_62) ^= (0xE7L >= ((((((**g_224) = (l_5918 , (*p_60))) & (l_5919 = p_63)) , (((*p_64) > l_5874) <= (~(((*g_1949) = (uint8_t*) p_64) == (uint8_t*) (((((((l_5873 < ((**g_224) = (safe_mul_func_uint8_t_u_u((((((l_5925 = l_5919) ^ (*p_64)) & 0L) , p_63) , 3UL), 0L)))) > (*g_2286)) != l_5873) == (-5L)) , 0xE128L) == l_5808) , p_64))))) <= p_63) ^ l_5876)); + return l_5926; + } + } + else + { /* block id: 2549 */ + uint8_t l_5934 = 0xD1L; + const int8_t **l_5956 = NULL; + int32_t l_5989 = 0x03117E2FL; + int32_t l_5990 = 0xE0DFA269L; + int32_t l_5997[6][10][2] = {{{(-8L),0x31F810ABL},{(-9L),(-1L)},{7L,(-1L)},{(-9L),0x31F810ABL},{(-8L),0x21A4BB94L},{0x66A65965L,(-1L)},{(-8L),(-7L)},{(-9L),0x21A4BB94L},{7L,0x21A4BB94L},{(-9L),(-7L)}},{{(-8L),(-1L)},{(-3L),0x31F810ABL},{7L,(-1L)},{0x66A65965L,(-7L)},{0x8B8337ECL,(-7L)},{0x66A65965L,(-1L)},{7L,0x31F810ABL},{(-3L),(-7L)},{7L,0L},{0x66A65965L,0x31F810ABL}},{{0x8B8337ECL,0x31F810ABL},{0x66A65965L,0L},{7L,(-7L)},{(-3L),0x31F810ABL},{7L,(-1L)},{0x66A65965L,(-7L)},{0x8B8337ECL,(-7L)},{0x66A65965L,(-1L)},{7L,0x31F810ABL},{(-3L),(-7L)}},{{7L,0L},{0x66A65965L,0x31F810ABL},{0x8B8337ECL,0x31F810ABL},{0x66A65965L,0L},{7L,(-7L)},{(-3L),0x31F810ABL},{7L,(-1L)},{0x66A65965L,(-7L)},{0x8B8337ECL,(-7L)},{0x66A65965L,(-1L)}},{{7L,0x31F810ABL},{(-3L),(-7L)},{7L,0L},{0x66A65965L,0x31F810ABL},{0x8B8337ECL,0x31F810ABL},{0x66A65965L,0L},{7L,(-7L)},{(-3L),0x31F810ABL},{7L,(-1L)},{0x66A65965L,(-7L)}},{{0x8B8337ECL,(-7L)},{0x66A65965L,(-1L)},{7L,0x31F810ABL},{(-3L),(-7L)},{7L,0L},{0x66A65965L,0x31F810ABL},{0x8B8337ECL,0x31F810ABL},{0x66A65965L,0L},{7L,(-7L)},{(-3L),0x31F810ABL}}}; + int i, j, k; + if ((safe_div_func_int8_t_s_s(((p_63 && ((!(safe_rshift_func_uint16_t_u_s((safe_add_func_int16_t_s_s((-2L), ((((*p_64) || l_5934) & ((safe_add_func_int16_t_s_s(((safe_mod_func_int32_t_s_s((safe_mul_func_uint8_t_u_u((**g_1949), (+((0x3CBBF44CL || l_5934) , ((((safe_sub_func_uint8_t_u_u((l_5876 ^= 0x7BL), ((safe_sub_func_int8_t_s_s(((((*g_4307) = (((!(((safe_rshift_func_int16_t_s_u((((g_5957 = func_77(((safe_add_func_int8_t_s_s(((safe_rshift_func_int8_t_s_u((safe_add_func_int16_t_s_s(((((*g_2115) , 0xE810L) == p_63) , (*g_4307)), 0xAF41L)), 1)) , 4L), 255UL)) , p_63), l_5774, l_5955, (**g_538))) != (**g_538)) != p_63), 4)) <= p_63) && l_5836)) ^ 1L) < 65535UL)) & 65532UL) , 1L), l_5835)) & 8UL))) & 5L) != (*p_64)) >= 9UL))))), (-1L))) && l_5934), p_63)) <= p_63)) , 0x5FC3L))), p_63))) ^ 6UL)) >= 0L), 0x4FL))) + { /* block id: 2553 */ + int32_t l_5973 = 0x61A45830L; + int32_t l_5974[9] = {0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL,0xE474C26EL}; + int32_t *l_5975 = NULL; + int32_t *l_5976 = &l_5835; + int32_t *l_5977 = NULL; + int32_t *l_5978 = &g_641; + int32_t *l_5979 = &l_5974[0]; + int32_t *l_5981 = &l_5760[1]; + int32_t *l_5982 = &l_5836; + int32_t *l_5983 = &l_5974[0]; + int32_t *l_5984 = &g_641; + int32_t *l_5985[1]; + int i; + for (i = 0; i < 1; i++) + l_5985[i] = &g_641; + (*p_62) ^= (safe_add_func_int8_t_s_s(0xAEL, (p_63 == (p_63 || (safe_add_func_uint32_t_u_u(l_5836, (safe_mul_func_uint16_t_u_u(p_63, ((l_5974[0] = (safe_mul_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s((~((p_63 , (**l_5717)) != NULL)), (((*p_60) ^= ((safe_sub_func_uint32_t_u_u((((safe_mod_func_uint8_t_u_u(((*g_1950) ^= (p_63 || l_5856)), 1L)) < (-9L)) >= 0x0CL), 0xA5932B90L)) && (*p_64))) | (**g_2285)))) | l_5934), l_5973))) && p_63))))))))); + ++l_6005[1][2]; + } + else + { /* block id: 2559 */ + int32_t *l_6008 = NULL; + int32_t *l_6009[6] = {&l_5996,&l_5996,&l_5996,&l_5996,&l_5996,&l_5996}; + int i; + (**g_2459) = ((*g_809) = p_62); + l_6010++; + if ((*p_62)) + continue; + } + if (l_5990) + break; + } + } + } + } + else + { /* block id: 2569 */ + int8_t l_6027 = 3L; + int32_t l_6028 = 1L; + int32_t l_6030 = 0x20C757E8L; + int16_t l_6032[4]; + uint32_t * const ***l_6048[9][4] = {{NULL,&l_5902,&l_5902,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902},{NULL,NULL,&l_5902,&l_5902},{NULL,&l_5902,&l_5902,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902},{NULL,&l_5902,NULL,&l_5902},{&l_5902,&l_5902,&l_5902,&l_5902},{&l_5902,NULL,&l_5902,&l_5902},{NULL,&l_5902,NULL,&l_5902}}; + uint8_t l_6066 = 0x54L; + uint16_t *l_6075 = &g_405; + int8_t ***l_6085 = NULL; + int i, j; + for (i = 0; i < 4; i++) + l_6032[i] = (-4L); + (*g_2442) = ((l_5993 = (0xDC3EL != ((((((safe_unary_minus_func_uint8_t_u(((0xDD5F00A9L != (safe_sub_func_uint32_t_u_u((((*g_65) ^ (**g_224)) || ((safe_add_func_uint8_t_u_u((safe_rshift_func_int8_t_s_u((safe_sub_func_int32_t_s_s((l_5791 || (l_6030 = (g_6022[3][1] , ((safe_add_func_int16_t_s_s((safe_add_func_uint16_t_u_u((l_6028 &= ((*g_3102) = l_6027)), (((safe_unary_minus_func_int8_t_s(0x07L)) >= ((**g_1949) | (***g_2102))) > l_6027))), p_63)) <= l_6027)))), l_6031)), 3)), 1UL)) , l_6027)), (*g_2286)))) || l_5721))) <= (*p_64)) , p_63) > 0xAFC1L) < p_63) , p_63))) < l_6032[2]); + (*g_2442) = (*p_62); + for (g_2662 = 0; (g_2662 > 11); ++g_2662) + { /* block id: 2578 */ + uint16_t ***l_6047 = &g_1103; + int32_t *l_6051 = &g_459; + int32_t l_6052 = 9L; + int16_t *****l_6060 = NULL; + int16_t ***** const *l_6059 = &l_6060; + int32_t l_6076 = 0x2954AD3EL; + int32_t ******l_6077 = &g_3277; + int8_t l_6087 = 0x1FL; + (*p_60) &= l_6031; + if ((safe_mod_func_int16_t_s_s((safe_mod_func_int16_t_s_s((safe_lshift_func_int8_t_s_u((safe_add_func_int8_t_s_s((safe_mul_func_uint16_t_u_u(0xBFB2L, (l_6052 ^= ((safe_mul_func_uint8_t_u_u(255UL, (l_6047 == l_6047))) > ((l_6048[0][2] == NULL) & ((*g_635) = (safe_lshift_func_uint16_t_u_s((&g_459 != l_6051), 13)))))))), (((safe_mod_func_int16_t_s_s((safe_unary_minus_func_int16_t_s((safe_sub_func_int8_t_s_s(((l_6058 , l_6059) == l_6061), (*p_64))))), (*g_3466))) ^ 0xDD76B533L) , (*p_64)))), (**g_1949))), l_6028)), 65535UL))) + { /* block id: 2582 */ + if ((*p_60)) + break; + } + else + { /* block id: 2584 */ + int32_t **l_6064[1][8]; + int32_t **l_6065 = &g_5637; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 8; j++) + l_6064[i][j] = &g_225; + } + (*l_6065) = (int32_t*) p_61; + l_6066--; + for (g_2690 = 9; (g_2690 >= 0); g_2690 -= 1) + { /* block id: 2589 */ + (*g_2442) = 0x35308888L; + } + } + for (g_2772 = 0; (g_2772 >= 22); g_2772 = safe_add_func_uint32_t_u_u(g_2772, 1)) + { /* block id: 2595 */ + int32_t ** const *****l_6081[1][5]; + int16_t l_6084 = (-8L); + uint8_t *l_6086 = &g_466; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 5; j++) + l_6081[i][j] = NULL; + } + (*g_2442) ^= (safe_rshift_func_uint16_t_u_s(((safe_rshift_func_int16_t_s_s(((p_63 , l_6075) != NULL), (((*l_6086) |= ((l_6076 | (l_6077 != (g_6078 = g_6078))) , ((safe_rshift_func_uint16_t_u_s(0x597FL, 5)) , ((((l_6084 , (l_6085 == NULL)) >= 0x5E39DFBEL) || 0x8A879FAFL) , (***g_2102))))) < (*p_64)))) > 0xAC4BL), l_6087)); + } + } + (*p_62) ^= ((safe_mul_func_int16_t_s_s(p_63, p_63)) , (*p_60)); + } + l_6096 |= (safe_sub_func_int16_t_s_s((l_6092 >= l_6093[7]), (safe_rshift_func_uint8_t_u_u((NULL == (**l_5717)), 5)))); + (*p_62) |= (safe_mul_func_uint8_t_u_u((((safe_div_func_int16_t_s_s((((+p_63) > (NULL == &p_63)) | (safe_sub_func_int8_t_s_s((&l_5721 == ((**g_3376) = &p_63)), 0x09L))), (safe_mod_func_int16_t_s_s((l_6108 == NULL), (*g_4307))))) != p_63) ^ p_63), 8UL)); + return l_6109; +} + + +/* ------------------------------------------ */ +/* + * reads : g_635 g_462 g_5312 g_3714 g_225 g_46 g_48 g_2285 g_2286 g_1950 g_4307 g_4308 g_3466 g_3467 g_5637 g_641 g_2470 g_284 + * writes: g_462 g_3714 g_48 g_2287 g_450 g_4308 g_3356 g_641 + */ +static uint32_t * func_66(int32_t * p_67, int16_t p_68, int8_t p_69, int32_t * p_70, uint16_t * p_71) +{ /* block id: 2457 */ + safe_mod_func_int32_t_s_s((*g_5312) == &g_1949, 1); + return (*g_2470); +} + + +/* ------------------------------------------ */ +/* + * reads : g_2683 g_635 g_462 g_2286 g_2102 g_1949 g_1950 g_809 g_810 g_46 g_463 g_450 g_2687 g_644 g_2659 g_3836 g_3170 g_2442 g_4962 g_45 g_2285 g_2287 g_224 g_225 g_3277 g_1352 g_3102 g_622 g_65 g_3466 g_3467 g_4307 g_2760 g_2720 g_206 g_48 g_255 g_2457 g_2458 g_2459 g_2460 g_459 g_2703 g_3377 g_3378 g_2628 g_466 g_621 g_254 g_641 g_5096 g_538 g_539 g_262 g_405 g_1577 g_2719 g_1859 g_2115 g_2595 g_2446 g_5400 g_4961 g_2678 + * writes: g_2683 g_644 g_3621 g_2287 g_450 g_46 g_254 g_641 g_2760 g_463 g_2687 g_621 g_4962 g_567 g_459 g_622 g_4308 g_2720 g_209 g_36 g_224 g_255 g_1859 g_810 g_2628 g_2703 g_1577 g_2595 g_405 g_2719 g_1335 g_2698 g_643 g_462 g_4961 g_2678 + */ +static int32_t * func_73(int32_t p_74) +{ /* block id: 2107 */ + uint16_t ****l_4901 = &g_3622; + int32_t l_4911 = (-1L); + int32_t l_4912 = 0x626B7D53L; + int32_t l_4920 = 0x68664297L; + int32_t l_4921 = 0x0AEDBE31L; + int32_t l_4923 = 1L; + int32_t l_4924 = (-1L); + int32_t l_4925[10] = {0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L,0xD9B33E79L}; + int8_t *l_4965 = &g_2595; + uint16_t l_5010 = 1UL; + const int16_t l_5090 = 0L; + int32_t ** const l_5093 = &g_810[3]; + int32_t **l_5095 = &g_810[0]; + uint16_t *l_5097[4] = {&g_4962,&g_4962,&g_4962,&g_4962}; + int32_t *l_5098 = &g_460[4]; + int32_t *l_5100 = &g_459; + uint16_t l_5105[6] = {0x8023L,0x8023L,0x8023L,0x8023L,0x8023L,0x8023L}; + uint32_t l_5134 = 4294967290UL; + uint16_t l_5137 = 65527UL; + uint32_t l_5140[6]; + uint32_t **l_5167 = &g_3378; + int16_t ** const l_5179 = &g_1119[0]; + int16_t l_5215 = 0xBE17L; + int32_t *l_5225[6] = {NULL,NULL,&l_4925[5],NULL,NULL,&l_4925[5]}; + int16_t ** const *l_5241 = NULL; + int16_t ** const **l_5240 = &l_5241; + int16_t ** const ***l_5239 = &l_5240; + int32_t l_5279 = (-3L); + int32_t l_5287 = 1L; + int32_t l_5309 = 0x3C9A2DE6L; + uint32_t ****l_5335 = NULL; + int8_t l_5336 = 0xD9L; + uint16_t *l_5344 = NULL; + uint32_t l_5352 = 0UL; + int32_t * const * const ****l_5373 = NULL; + int8_t l_5401 = 9L; + int32_t *l_5423 = &l_4925[9]; + uint32_t *** const l_5434 = &g_2470; + uint32_t l_5442 = 18446744073709551615UL; + int8_t l_5461 = 0x82L; + int32_t l_5534[5] = {8L,8L,8L,8L,8L}; + uint16_t l_5613 = 65535UL; + uint8_t l_5665 = 3UL; + const uint8_t l_5686 = 255UL; + const uint8_t l_5687 = 0xF4L; + int i; + for (i = 0; i < 6; i++) + l_5140[i] = 5UL; + for (g_2683 = 2; (g_2683 >= 0); g_2683 -= 1) + { /* block id: 2110 */ + uint16_t ****l_4900 = &g_3622; + int32_t l_4905 = (-3L); + int32_t l_4918 = 0L; + int32_t l_4919 = (-1L); + int32_t l_4922[1]; + uint8_t l_4926 = 1UL; + int8_t *l_4966[1]; + int32_t ***l_5008 = &g_224; + int32_t *l_5049 = &l_4923; + int32_t *******l_5072 = &g_3276; + int32_t ***l_5094[9] = {&g_224,&g_224,&g_224,&g_224,&g_224,&g_224,&g_224,&g_224,&g_224}; + int32_t **l_5099[10] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; + uint16_t *l_5101 = &g_3505[7][1]; + int8_t *l_5102 = &g_2723; + int32_t *l_5143 = &l_4919; + uint16_t ****l_5164 = &g_3622; + int8_t l_5165 = (-8L); + int32_t l_5281 = 1L; + uint32_t l_5304 = 0x6ACF2E70L; + int i; + for (i = 0; i < 1; i++) + l_4922[i] = 0x78A04790L; + for (i = 0; i < 1; i++) + l_4966[i] = &g_2773; + for (g_644 = 0; (g_644 <= 2); g_644 += 1) + { /* block id: 2113 */ + uint8_t *l_4904 = &g_463; + int32_t *l_4913 = &g_46; + int32_t *l_4914 = NULL; + int32_t *l_4915 = NULL; + int32_t *l_4916 = &l_4911; + int32_t *l_4917[7][6][6] = {{{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254},{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254},{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621},{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905},{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621},{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254}},{{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254},{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621},{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905},{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621},{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254},{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254}},{{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621},{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905},{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621},{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254},{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254},{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621}},{{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905},{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621},{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254},{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254},{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621},{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905}},{{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621},{&g_254,&l_4905,&l_4905,&g_254,&l_4912,&g_254},{&g_254,&l_4912,&g_254,&l_4905,&l_4905,&g_254},{&g_254,&g_254,&l_4905,&l_4905,&l_4905,&g_621},{&l_4905,&l_4912,&g_641,&l_4905,&l_4912,&l_4905},{&g_254,&l_4905,&g_641,&l_4905,&g_254,&g_621}},{{&g_254,&l_4905,&g_254,&g_642,&g_254,&l_4905},{&g_642,&g_254,&l_4905,&l_4911,&l_4911,&l_4905},{&l_4912,&l_4912,&g_254,&g_641,&l_4911,&l_4905},{&l_4911,&g_254,&l_4912,&g_641,&g_254,&g_254},{&l_4912,&l_4911,&l_4912,&l_4911,&l_4912,&l_4905},{&g_642,&l_4911,&g_254,&g_642,&g_254,&l_4905}},{{&g_642,&g_254,&l_4905,&l_4911,&l_4911,&l_4905},{&l_4912,&l_4912,&g_254,&g_641,&l_4911,&l_4905},{&l_4911,&g_254,&l_4912,&g_641,&g_254,&g_254},{&l_4912,&l_4911,&l_4912,&l_4911,&l_4912,&l_4905},{&g_642,&l_4911,&g_254,&g_642,&g_254,&l_4905},{&g_642,&g_254,&l_4905,&l_4911,&l_4911,&l_4905}}}; + int8_t l_4954[7][8] = {{0xBCL,0xBCL,(-1L),0xD8L,(-1L),0xBCL,0xBCL,(-1L)},{0x5CL,(-1L),(-1L),0x5CL,6L,0x5CL,(-1L),(-1L)},{(-1L),6L,0xD8L,0xD8L,6L,(-1L),6L,0xD8L},{0x5CL,6L,0x5CL,(-1L),(-1L),0x5CL,6L,0x5CL},{0xBCL,(-1L),0xD8L,(-1L),0xBCL,0xBCL,(-1L),0xD8L},{0xBCL,0xBCL,(-1L),0xD8L,(-1L),0xBCL,0xBCL,(-1L)},{0x5CL,(-1L),(-1L),0x5CL,6L,0x5CL,(-1L),(-1L)}}; + int32_t l_4960 = 0x3053C536L; + int i, j, k; + (**g_809) = (((l_4900 == (g_3621[0] = l_4901)) != (safe_mod_func_uint16_t_u_u((l_4911 = (((*g_635) & ((NULL == l_4904) , ((***g_2102) = (((((*g_2286) = l_4905) < ((safe_mod_func_uint16_t_u_u(p_74, (safe_mul_func_int8_t_s_s(p_74, (((!0xE58CFD38L) ^ l_4905) , l_4911))))) > p_74)) || l_4905) > 65529UL)))) || p_74)), l_4912))) >= p_74); + --l_4926; + for (g_2760 = 2; (g_2760 >= 0); g_2760 -= 1) + { /* block id: 2122 */ + uint32_t *l_4939[9] = {&g_582,&g_4198,&g_582,&g_582,&g_4198,&g_582,&g_582,&g_4198,&g_582}; + uint32_t *l_4944 = &g_1391; + uint16_t l_4945 = 4UL; + int32_t l_4955 = (-1L); + int32_t l_4957[2]; + uint32_t l_4989 = 6UL; + int32_t l_4990 = 4L; + uint32_t l_4991 = 0x78BC052BL; + int i; + for (i = 0; i < 2; i++) + l_4957[i] = (-2L); + if ((safe_lshift_func_uint16_t_u_u(((safe_add_func_uint16_t_u_u(((((*g_2286) = (p_74 == 0x466DL)) == 0xE7538EEAL) ^ (safe_lshift_func_int8_t_s_u(((*l_4913) || 0xF0B7669DL), 6))), (safe_sub_func_uint8_t_u_u(((*l_4904) ^= (safe_lshift_func_uint16_t_u_s(l_4918, 10))), (((((l_4939[7] != (l_4944 = ((0x6887L < (safe_add_func_uint16_t_u_u((safe_lshift_func_uint8_t_u_s((*g_1950), 7)), 0UL))) , (uint32_t*) NULL))) && l_4920) , (**g_1949)) < l_4922[0]) < l_4945))))) >= p_74), l_4945))) + { /* block id: 2126 */ + } + else + { /* block id: 2139 */ + int32_t *l_4959 = &g_254; + return l_4959; + } + ++g_4962; + p_74 = ((*g_45) &= (l_4965 != ((*g_635) , l_4966[0]))); + if ((p_74 , (safe_add_func_int16_t_s_s(((l_4990 &= (!(safe_rshift_func_uint16_t_u_u((((l_4957[0] = (-1L)) <= ((((0xA4L | (--(*l_4904))) || (safe_sub_func_int8_t_s_s((safe_unary_minus_func_uint8_t_u((safe_mod_func_int32_t_s_s(((((safe_lshift_func_int8_t_s_s(p_74, ((l_4955 <= ((safe_div_func_int16_t_s_s((+((**g_224) = ((safe_unary_minus_func_int8_t_s((safe_mod_func_int8_t_s_s(p_74, ((**g_1949) = (((**g_2285) ^ ((0xFA175102L != 0xCDCBD651L) >= l_4925[5])) || p_74)))))) , l_4989))), 0x3582L)) >= 1L)) <= 1UL))) , p_74) >= p_74) & p_74), p_74)))), 0UL))) <= 0x4FEDL) ^ p_74)) == 0x439873AFL), l_4911)))) >= p_74), l_4991)))) + { /* block id: 2150 */ + int32_t ***l_5009 = &g_224; + (**g_809) = ((safe_mod_func_int16_t_s_s(0L, 65530UL)) || (safe_div_func_int8_t_s_s(((((l_4957[1] ^= (safe_lshift_func_uint16_t_u_s((l_4912 &= ((p_74 ^ (safe_sub_func_uint32_t_u_u((*g_2286), (((safe_div_func_int32_t_s_s((safe_mul_func_int16_t_s_s((l_4991 , ((safe_add_func_uint32_t_u_u(((safe_rshift_func_int8_t_s_u(0x3EL, 3)) | (((**g_3277) = l_5008) != l_5009)), (p_74 | (*g_3102)))) != 1L)), (***l_5009))), 4294967295UL)) && l_5010) , (*g_45))))) | 4294967288UL)), p_74))) || 0x60E7L) ^ 0x3D4EL) > 0x56L), 0x13L))); + } + } + } + (*l_5008) = func_150(func_150((l_5095 = l_5093), p_74, (**l_5093), func_77(p_74, (**l_5093), (l_5097[0] = g_5096[8]), func_77(((l_5098 == (l_5100 = l_5098)) < p_74), (*l_5049), l_5101, (**g_538)))), (**g_3377), p_74, l_5102); + } + if ((safe_rshift_func_uint16_t_u_s((p_74 & ((+((**l_5093) = (safe_mul_func_int16_t_s_s(((safe_rshift_func_uint16_t_u_u((((((*g_4307) = ((((safe_mod_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u(((*g_1950) |= (&p_74 != (***g_2458))), (&g_2457 != &g_3277))), p_74)), (safe_rshift_func_int16_t_s_u((((**l_5095) == (safe_mul_func_uint16_t_u_u(((safe_add_func_uint32_t_u_u((((safe_unary_minus_func_int16_t_s((**l_5093))) == 4294967295UL) >= (*g_635)), (-7L))) ^ p_74), (**l_5095)))) , p_74), 11)))) , (uint32_t****) NULL) != l_5335) && 5L)) | 0L) , p_74) , p_74), 6)) & 255UL), 0L)))) == p_74)), l_5336))) + { /* block id: 2315 */ + } + else + { /* block id: 2322 */ + uint8_t l_5356 = 0UL; + int16_t l_5378 = 0L; + int32_t l_5393[8][4] = {{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L},{(-1L),8L,(-1L),8L}}; + const int16_t **l_5398 = &g_3466; + const int16_t ***l_5397 = &l_5398; + const int16_t **** const l_5396 = &l_5397; + uint32_t l_5399 = 1UL; + int32_t l_5402[3][2][7] = {{{(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}},{{(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}},{{(-9L),(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}}}; + int32_t l_5420 = 0x5BB4543EL; + uint16_t l_5421 = 0xD7DBL; + int32_t **l_5433 = &l_5423; + uint32_t l_5552[7]; + int32_t l_5609 = 1L; + int8_t ****l_5620[2]; + int8_t * const l_5627 = &g_5628; + int8_t * const *l_5626 = &l_5627; + int8_t * const **l_5625[8][4][8] = {{{&l_5626,NULL,&l_5626,&l_5626,&l_5626,NULL,&l_5626,&l_5626},{&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL}},{{&l_5626,NULL,&l_5626,NULL,&l_5626,&l_5626,&l_5626,NULL},{&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL}},{{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{NULL,&l_5626,&l_5626,&l_5626,&l_5626,NULL,NULL,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,NULL,NULL,&l_5626,&l_5626,&l_5626}},{{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL,NULL},{&l_5626,NULL,&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,NULL,&l_5626,&l_5626,NULL},{NULL,NULL,&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626}},{{&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626,NULL,&l_5626}},{{NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626},{NULL,&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626}},{{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL,NULL,NULL},{&l_5626,&l_5626,&l_5626,NULL,&l_5626,NULL,NULL,NULL},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL,&l_5626,&l_5626},{&l_5626,NULL,NULL,&l_5626,&l_5626,NULL,&l_5626,&l_5626}},{{&l_5626,&l_5626,NULL,&l_5626,&l_5626,&l_5626,&l_5626,NULL},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,NULL,&l_5626},{&l_5626,&l_5626,&l_5626,NULL,NULL,&l_5626,&l_5626,&l_5626},{&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626,&l_5626}}}; + int8_t * const ***l_5624 = &l_5625[3][2][0]; + const uint16_t **l_5635 = &g_5158; + int32_t l_5657 = (-1L); + int32_t l_5672 = 0x4BAFED2DL; + int i, j, k; + if ((((~((safe_add_func_int8_t_s_s(l_5393[2][1], ((**l_5095) > ((*g_635) = (((*g_2286) &= (((safe_add_func_uint32_t_u_u(l_5393[2][0], (safe_unary_minus_func_uint32_t_u(((l_5420 &= (safe_lshift_func_uint16_t_u_u((((safe_mod_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u((**l_5093), (0xC5L & (l_5378 , (((((+(***g_2102)) , (0UL < ((l_5402[0][0][3] = (safe_add_func_int32_t_s_s(((*g_2442) = ((safe_lshift_func_int8_t_s_s(((*g_1950) && 0x0AL), 4)) , (**l_5093))), 4294967295UL))) == 65535UL))) >= p_74) , 0xA3B24C4FL) , 0UL))))), 0x93L)) >= p_74) || p_74), p_74))) != p_74))))) & p_74) || (*g_635))) | l_5393[2][1]))))) && l_5421)) && l_5356) || 0x035DL)) + { /* block id: 2340 */ + (*l_5093) = &p_74; + } + } + return (*g_224); +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int8_t * func_77(uint32_t p_78, int32_t p_79, uint16_t * p_80, int8_t * const p_81) +{ /* block id: 2104 */ + int8_t *l_4899 = NULL; + return l_4899; +} + + +/* ------------------------------------------ */ +/* + * reads : g_2758 g_809 g_4307 g_2285 g_2286 g_2287 g_46 g_2757 + * writes: g_2758 g_810 g_2657 g_4308 g_2757 + */ +static uint16_t * func_82(uint32_t * p_83, int8_t * p_84, uint16_t p_85, int32_t p_86) +{ /* block id: 2064 */ + int32_t *l_4804 = &g_46; + uint8_t **l_4809 = &g_1950; + int16_t ***l_4817 = &g_1118; + int16_t **** const l_4816 = &l_4817; + uint32_t l_4863 = 0x4BB12DE5L; + uint32_t l_4864 = 0xE9F762AAL; + uint16_t *l_4866[7] = {&g_405,&g_405,&g_405,&g_405,&g_405,&g_405,&g_405}; + int32_t l_4868 = 7L; + int32_t l_4869 = (-1L); + int32_t l_4873 = (-6L); + int32_t l_4876 = 0x16C383ECL; + int32_t l_4877[9][10][2] = {{{(-4L),6L},{(-10L),6L},{(-4L),8L},{0x6B86569AL,6L},{0x87A62FD4L,6L},{0x6B86569AL,8L},{(-4L),6L},{(-10L),6L},{(-4L),8L},{0x6B86569AL,6L}},{{0x87A62FD4L,6L},{0x6B86569AL,8L},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L}},{{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL}},{{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L}},{{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L}},{{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL}},{{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L}},{{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L}},{{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL},{0x87A62FD4L,8L},{5L,8L},{0x87A62FD4L,0xC0FD7FCEL},{(-10L),8L},{1L,8L},{(-10L),0xC0FD7FCEL}}}; + int32_t l_4881 = 0L; + int32_t *l_4892[5] = {&l_4877[4][3][0],&l_4877[4][3][0],&l_4877[4][3][0],&l_4877[4][3][0],&l_4877[4][3][0]}; + int32_t l_4893[6] = {1L,0xCCDC3FCCL,1L,1L,0xCCDC3FCCL,1L}; + int8_t l_4894 = 0L; + uint32_t l_4895 = 0x51401A3DL; + int i, j, k; + for (g_2758 = (-3); (g_2758 == (-15)); g_2758 = safe_sub_func_int32_t_s_s(g_2758, 1)) + { /* block id: 2067 */ + uint8_t **l_4808 = NULL; + int32_t l_4821 = (-1L); + int32_t ** const *****l_4849 = NULL; + int32_t l_4872 = 0L; + int32_t l_4875 = (-1L); + int32_t l_4878 = 0xD7987B0DL; + int32_t l_4880 = 1L; + int32_t l_4882 = 3L; + int32_t l_4883 = 4L; + int32_t l_4884 = 0xAA3ABF38L; + int32_t l_4885[4] = {(-1L),(-1L),(-1L),(-1L)}; + uint32_t l_4887[9][2][5] = {{{0x47214B16L,0x34DF2D55L,0x9C3E0F1DL,0x34DF2D55L,0x47214B16L},{0xAE9B95B8L,0x1D6EC8A8L,0x1DEC670BL,0xB661E58EL,0x41CF67C3L}},{{0x47214B16L,18446744073709551607UL,18446744073709551607UL,0x47214B16L,0x18D51D68L},{18446744073709551615UL,0x6BB52D40L,18446744073709551606UL,0x1D6EC8A8L,0xAE9B95B8L}},{{18446744073709551612UL,18446744073709551607UL,18446744073709551612UL,1UL,18446744073709551607UL},{0xAE9B95B8L,0UL,0x8005D51DL,18446744073709551615UL,0x8005D51DL}},{{1UL,1UL,18446744073709551611UL,18446744073709551607UL,0x18D51D68L},{0xCA977B47L,0xB661E58EL,0x8005D51DL,0xF537A647L,1UL}},{{0x18D51D68L,0x9C3E0F1DL,18446744073709551612UL,0x18D51D68L,1UL},{0x1DEC670BL,0xB661E58EL,0x41CF67C3L,0xB661E58EL,0x1DEC670BL}},{{18446744073709551612UL,1UL,0x9C3E0F1DL,1UL,1UL},{0x1DEC670BL,0UL,18446744073709551606UL,0x46BFD478L,0x8005D51DL}},{{0x18D51D68L,18446744073709551607UL,18446744073709551611UL,1UL,1UL},{0xCA977B47L,0x46BFD478L,0xCA977B47L,0xF537A647L,0x1DEC670BL}},{{1UL,0x9C3E0F1DL,1UL,1UL,1UL},{0xAE9B95B8L,18446744073709551615UL,0x41CF67C3L,0x46BFD478L,1UL}},{{18446744073709551612UL,0x18D51D68L,1UL,1UL,0x18D51D68L},{1UL,0UL,0xCA977B47L,0xB661E58EL,0x8005D51DL}}}; + int i, j, k; + if (p_85) + break; + (*g_809) = l_4804; + for (g_2657 = (-9); (g_2657 == 26); g_2657 = safe_add_func_uint16_t_u_u(g_2657, 1)) + { /* block id: 2072 */ + uint32_t l_4820 = 4294967290UL; + int32_t l_4822 = 0xA5D9292DL; + int16_t ****l_4831 = NULL; + int32_t l_4844 = 9L; + int32_t *l_4867 = NULL; + int32_t *l_4870 = &l_4821; + int32_t *l_4871[8][7][2] = {{{&g_254,&g_621},{&g_254,&l_4821},{&l_4822,&l_4822},{&g_641,&g_254},{&g_621,&g_642},{&g_46,&l_4844},{&g_621,&l_4868}},{{&l_4868,&l_4822},{&g_642,&g_621},{&l_4822,NULL},{&g_254,&g_46},{&g_254,&g_621},{&g_642,&g_621},{&g_642,&l_4868}},{{&g_641,NULL},{&g_641,&l_4844},{&g_642,&l_4844},{&g_641,NULL},{&g_641,&l_4868},{&g_642,&g_621},{&g_642,&g_621}},{{&g_254,&g_46},{&g_254,NULL},{&l_4822,&g_621},{&g_642,&l_4822},{&l_4868,&l_4868},{&g_621,&l_4844},{&g_46,&g_642}},{{&g_621,&g_254},{&g_641,&l_4822},{&l_4822,&l_4821},{&g_254,&g_621},{&g_254,&l_4868},{&g_46,&g_642},{&l_4822,&g_621}},{{&l_4822,&l_4822},{&l_4869,&l_4868},{&g_641,&g_642},{NULL,NULL},{&g_621,NULL},{&l_4868,&l_4822},{NULL,&l_4821}},{{&g_642,NULL},{&g_46,NULL},{&g_46,NULL},{&g_642,&l_4821},{NULL,&l_4822},{&l_4868,NULL},{&g_621,NULL}},{{NULL,&g_642},{&g_641,&l_4868},{&l_4869,&l_4822},{&l_4822,&g_621},{&l_4822,&g_642},{&g_46,&l_4868},{&g_254,&g_621}}}; + int32_t l_4874 = 2L; + int32_t l_4879[2][5] = {{1L,0L,0L,1L,0L},{1L,1L,(-8L),0L,0L}}; + int i, j, k; + l_4822 ^= (safe_unary_minus_func_int16_t_s((((l_4809 = l_4808) != l_4808) || (safe_rshift_func_int8_t_s_u((((safe_rshift_func_int16_t_s_s((p_85 ^ p_85), (0x063B51CCL || (((*g_4307) = ((safe_sub_func_uint16_t_u_u(p_86, (NULL == l_4816))) != (safe_mul_func_int16_t_s_s((l_4820 , l_4821), (-2L))))) <= 0xE250L)))) < 9L) && (**g_2285)), l_4821))))); + p_86 = (p_86 ^ l_4821); + } + p_86 &= (safe_lshift_func_uint8_t_u_s((*l_4804), 1)); + } + ++l_4895; + for (g_2757 = 4; (g_2757 >= 0); g_2757 -= 1) + { /* block id: 2100 */ + uint16_t *l_4898[2]; + int i; + for (i = 0; i < 2; i++) + l_4898[i] = &g_644; + return l_4898[0]; + } + return l_4866[1]; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static uint32_t * func_87(int16_t p_88, int8_t p_89, const uint16_t * p_90, int32_t p_91, uint16_t * p_92) +{ /* block id: 6 */ + int8_t *l_102[9]; + int32_t l_115[1][8][8] = {{{1L,(-1L),1L,1L,(-1L),1L,1L,(-1L)},{(-1L),1L,1L,(-1L),1L,1L,(-1L),1L},{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L),(-1L)},{1L,(-1L),1L,1L,(-1L),1L,1L,(-1L)},{(-1L),1L,1L,(-1L),1L,1L,(-1L),1L},{(-1L),(-1L),(-6L),(-1L),(-1L),(-6L),(-1L),(-1L)},{1L,(-1L),1L,1L,(-1L),1L,1L,(-1L)},{(-1L),1L,1L,(-1L),1L,1L,(-1L),1L}}}; + uint16_t *l_3852 = &g_1961; + uint16_t l_3857[8][4] = {{1UL,0xA2ECL,0xA2ECL,1UL},{0x5E69L,0x6617L,0x9D10L,0xDEABL},{1UL,0x64EDL,0xDEABL,0xE824L},{0xDEABL,0xE824L,0x85A1L,0xE824L},{0xA2ECL,0x64EDL,0x91C0L,0xDEABL},{65530UL,0x6617L,0xE824L,1UL},{0x91C0L,0xA2ECL,65529UL,65529UL},{0x91C0L,0x91C0L,0xE824L,0x5E69L}}; + uint8_t l_3858 = 0xDAL; + int32_t l_4364 = 1L; + uint32_t l_4365 = 4294967287UL; + uint32_t l_4624 = 4294967290UL; + int32_t l_4635 = 0x0EF9A929L; + uint32_t l_4636 = 0x950E1C66L; + uint32_t ***l_4646 = &g_4324[0]; + uint8_t **l_4682 = &g_1950; + uint8_t l_4694 = 0x7EL; + int32_t * const *l_4704 = &g_2446; + int32_t *******l_4719[10]; + uint16_t l_4788 = 1UL; + uint32_t *l_4800 = &g_260[9][3][1]; + int i, j, k; + for (i = 0; i < 9; i++) + l_102[i] = NULL; + for (i = 0; i < 10; i++) + l_4719[i] = &g_3276; + return l_4800; +} + + +/* ------------------------------------------ */ +/* + * reads : g_3276 g_3277 g_4307 g_48 g_1950 g_450 g_3102 g_2607 g_2442 g_621 g_635 g_462 g_540 g_539 g_262 g_263 g_1949 g_2102 g_224 g_45 g_225 g_2616 g_2115 g_622 g_206 g_46 g_642 g_255 g_3356 g_3466 g_3467 g_2286 g_538 g_4424 g_2287 g_1961 g_2602 g_2614 g_2285 g_4308 g_2640 g_2457 g_2458 g_2459 g_2460 g_1352 g_567 g_2742 g_2783 g_405 g_2727 + * writes: g_4308 g_622 g_2607 g_621 g_450 g_2616 g_209 g_36 g_224 g_255 g_2446 g_3356 g_2287 g_2470 g_225 g_1961 g_263 g_2602 g_539 g_2640 g_1859 g_567 g_2742 g_2783 g_4618 g_2727 + */ +static int32_t * func_96(const int32_t p_97, uint16_t * p_98) +{ /* block id: 1875 */ + int32_t l_4366 = 0x49B7859DL; + int32_t l_4369 = 0xD93A1127L; + uint8_t l_4370 = 0UL; + uint32_t l_4371 = 0xA75F49E5L; + int8_t l_4372 = 0x9DL; + const int8_t l_4387[7] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; + int32_t l_4485 = (-1L); + int32_t ** const *l_4564 = NULL; + uint32_t l_4580 = 18446744073709551610UL; + int32_t l_4590 = (-7L); + uint8_t ****l_4598 = &g_2102; + const int16_t **l_4616 = NULL; + const int16_t ***l_4615 = &l_4616; + int16_t ***l_4617[1]; + uint16_t ***l_4620 = NULL; + int32_t *l_4621 = &l_4366; + int i; + for (i = 0; i < 1; i++) + l_4617[i] = &g_1118; + if ((l_4372 = (((NULL != (*g_3276)) , ((*g_3102) = (((((((0x8B480280L != (((l_4366 > ((safe_div_func_uint16_t_u_u((((l_4369 = 4294967295UL) , (((((-4L) && ((*g_4307) = 0xA6F5L)) || l_4369) , &g_4324[1]) == NULL)) , (*p_98)), l_4370)) <= (*g_1950))) >= (*p_98)) , l_4371)) && 0xE9823656L) > p_97) && (*p_98)) > p_97) || l_4371) | l_4371))) , p_97))) + { /* block id: 1880 */ + uint16_t l_4375 = 65535UL; + int32_t *l_4376 = &g_642; + for (g_2607 = 10; (g_2607 == (-18)); g_2607 = safe_sub_func_uint16_t_u_u(g_2607, 9)) + { /* block id: 1883 */ + l_4375 &= 0xBEF833D5L; + } + return l_4376; + } + else + { /* block id: 1887 */ + int16_t l_4388 = 1L; + uint16_t l_4405 = 0x2834L; + int32_t l_4430[1][4][2] = {{{(-8L),0L},{(-8L),0L},{(-8L),0L},{(-8L),0L}}}; + uint16_t l_4434 = 65526UL; + uint32_t ***l_4440 = &g_2470; + int32_t *l_4459 = NULL; + int32_t *****l_4482 = &g_1352; + const uint8_t *l_4495 = &g_4176; + const uint8_t **l_4494 = &l_4495; + int16_t ***l_4587 = &g_1118; + int16_t ****l_4586[1][1][4] = {{{&l_4587,&l_4587,&l_4587,&l_4587}}}; + uint8_t l_4592 = 254UL; + int i, j, k; + if (p_97) + { /* block id: 1888 */ + uint8_t ***l_4385 = &g_1949; + int32_t l_4386 = 0xE863CDE0L; + int32_t l_4389 = 1L; + (*g_2442) |= p_97; + (*g_2442) &= ((l_4366 && ((***g_2102) = ((*g_635) , (safe_sub_func_uint8_t_u_u((((safe_lshift_func_uint16_t_u_s((l_4366 && ((l_4388 = ((0x3267L < ((safe_div_func_int8_t_s_s((safe_rshift_func_int8_t_s_u(p_97, ((p_97 || p_97) > 65535UL))), ((NULL == l_4385) ^ l_4386))) , l_4387[1])) , 0x05972310L)) , 4294967287UL)), 6)) <= (***g_540)) , (**g_1949)), l_4389))))) > (*p_98)); + return (*g_224); + } + else + { /* block id: 1894 */ + int32_t **l_4408 = &g_225; + const int32_t l_4454[8][5] = {{0xF667E23AL,0xEC252021L,0xC97BB676L,0xEC252021L,0xF667E23AL},{2L,0L,2L,2L,0L},{0xF667E23AL,0xC255D1F6L,0L,0xEC252021L,0L},{0L,0L,9L,0L,0L},{0L,0xEC252021L,0L,0xC255D1F6L,0xF667E23AL},{0L,2L,2L,0L,2L},{0xF667E23AL,0xEC252021L,0xC97BB676L,0xEC252021L,0xF667E23AL},{2L,0L,2L,2L,0L}}; + uint32_t ***l_4455 = &g_2470; + int32_t *l_4457[7] = {&l_4430[0][1][1],&l_4430[0][1][1],&l_4430[0][1][1],&l_4430[0][1][1],&l_4430[0][1][1],&l_4430[0][1][1],&l_4430[0][1][1]}; + int16_t ***l_4472 = &g_1118; + int16_t ****l_4471 = &l_4472; + uint8_t l_4479[5] = {255UL,255UL,255UL,255UL,255UL}; + uint32_t l_4487 = 0x97F062D3L; + uint32_t *l_4527 = &g_1577[2][5][3]; + int32_t l_4591 = 0x68E9D719L; + int i, j; + for (g_2616 = (-2); (g_2616 <= 23); g_2616 = safe_add_func_uint8_t_u_u(g_2616, 8)) + { /* block id: 1897 */ + uint8_t ****l_4401[2][6] = {{&g_2102,&g_3714,&g_3714,&g_2102,&g_3714,&g_3714},{&g_2102,&g_3714,&g_3714,&g_2102,&g_3714,&g_3714}}; + uint8_t ****l_4403[2]; + uint8_t *****l_4402 = &l_4403[0]; + int32_t **l_4404 = &g_2446; + int16_t *l_4406 = &g_3356[3]; + int32_t l_4431 = 0x5F13150FL; + int32_t *l_4458 = &l_4369; + int32_t *l_4461 = &l_4366; + int i, j; + for (i = 0; i < 2; i++) + l_4403[i] = &g_2102; + if (((safe_lshift_func_int16_t_s_s(((safe_div_func_uint16_t_u_u(((((*p_98) > ((*l_4406) ^= ((*g_4307) = (safe_div_func_uint16_t_u_u(l_4388, ((!(safe_sub_func_uint8_t_u_u((((((*g_2115) = (*g_2115)) < l_4371) , l_4401[1][0]) == ((*l_4402) = &g_3714)), (***g_2102)))) && ((((&g_460[4] == ((*l_4404) = (int32_t*) func_187(l_4366, p_97))) > (**g_1949)) , p_97) <= l_4405))))))) || (*g_635)) && (*g_635)), p_97)) | l_4370), (*g_3466))) >= p_97)) + { /* block id: 1903 */ + int32_t *l_4407 = &g_641; + return l_4407; + } + else + { /* block id: 1905 */ + int16_t l_4419 = 1L; + int32_t l_4432 = 0x593BAE58L; + int32_t *l_4462 = NULL; + if (((((*g_2286) = l_4388) != ((-5L) > (p_97 || (NULL == l_4408)))) , ((***g_538) && ((safe_sub_func_uint32_t_u_u((safe_mod_func_uint16_t_u_u(((safe_mod_func_int16_t_s_s(((safe_lshift_func_uint16_t_u_s(((safe_mul_func_int8_t_s_s(p_97, 0x7FL)) , (**l_4408)), 11)) ^ p_97), l_4419)) & 8L), (-8L))), 8L)) < 1L)))) + { /* block id: 1907 */ + uint32_t ***l_4427 = &g_2470; + int32_t *l_4433[5] = {&g_642,&g_642,&g_642,&g_642,&g_642}; + int i; + l_4431 = (safe_add_func_int32_t_s_s((((safe_rshift_func_uint16_t_u_s((6L >= g_4424), 13)) ^ (p_97 | (***g_540))) , (**l_4408)), (l_4430[0][0][0] = (l_4366 |= (safe_lshift_func_uint8_t_u_s((0L > (((*l_4427) = &g_284[0][0]) != &g_2286)), (safe_add_func_uint32_t_u_u(4294967294UL, 0xC5E5343CL)))))))); + (*l_4408) = &l_4369; + l_4434--; + } + else + { /* block id: 1914 */ + int32_t *l_4437 = &g_621; + return l_4437; + } + if ((safe_mul_func_uint8_t_u_u((l_4434 ^ ((**l_4408) &= l_4431)), (l_4440 != ((safe_add_func_uint16_t_u_u((safe_lshift_func_int8_t_s_u((((***g_540) < (((*g_2286) ^= ((safe_mul_func_uint8_t_u_u((safe_lshift_func_int16_t_s_s((safe_rshift_func_int16_t_s_s(((p_97 >= p_97) <= (safe_rshift_func_uint16_t_u_s((~p_97), 8))), 15)), p_97)), (*g_1950))) | p_97)) != 4294967295UL)) ^ l_4454[5][4]), 0)), p_97)) , l_4455))))) + { /* block id: 1919 */ + int32_t *l_4456 = &l_4431; + return l_4459; + } + else + { /* block id: 1921 */ + int32_t *l_4460 = &l_4432; + return l_4462; + } + } + } + if ((safe_sub_func_uint8_t_u_u((safe_div_func_int16_t_s_s((((((safe_div_func_uint32_t_u_u((safe_mul_func_int16_t_s_s((*g_3466), ((p_97 || p_97) != (NULL != l_4471)))), (safe_rshift_func_uint16_t_u_u((&g_643[0] != ((((0x66L || (safe_sub_func_uint16_t_u_u(((*g_3102)++), l_4479[0]))) < ((safe_mul_func_uint16_t_u_u((0xB3L && (*g_262)), 0L)) | 0xCCL)) ^ (*p_98)) , (int32_t*) NULL)), 10)))) != (*g_2286)) , l_4482) == (*g_3276)) | 0x1DB88544L), 0x6ED6L)), (**l_4408)))) + { /* block id: 1927 */ + int16_t l_4484[7][5][5] = {{{0x9E62L,4L,0x27CDL,4L,(-1L)},{5L,0L,0x3949L,0L,0L},{(-1L),0x27CDL,0x27CDL,(-1L),(-5L)},{0x30D6L,0xBCD8L,0x629CL,0L,0L},{0xF26FL,(-1L),0xF26FL,(-5L),(-1L)}},{{0L,0x3949L,0L,0L,0L},{(-2L),(-2L),0xF4E9L,(-1L),0xDDAEL},{5L,0x30D6L,0L,0L,0x30D6L},{0xDDAEL,0x27CDL,0xF26FL,0xDDAEL,(-5L)},{0xBCD8L,0x30D6L,0x629CL,0x30D6L,0xBCD8L}},{{0xF26FL,(-2L),0x27CDL,(-5L),(-2L)},{0xBCD8L,0x3949L,0x3949L,0xBCD8L,0L},{0xDDAEL,(-1L),0xF4E9L,(-2L),(-2L)},{5L,0xBCD8L,5L,0L,0xBCD8L},{(-2L),0x27CDL,(-5L),(-2L),(-5L)}},{{0L,0L,0x629CL,0xBCD8L,0x30D6L},{0xF26FL,0xDDAEL,(-5L),(-5L),0xDDAEL},{0x30D6L,0x3949L,5L,0x30D6L,0L},{(-1L),0xDDAEL,0xF4E9L,0xDDAEL,(-1L)},{5L,0L,0x3949L,0L,0L}},{{(-1L),0x27CDL,0x27CDL,(-1L),(-5L)},{0x30D6L,0xBCD8L,0x629CL,0L,0L},{0xF26FL,(-1L),0xF26FL,(-5L),(-1L)},{0L,0x3949L,0L,0L,0L},{(-2L),(-2L),0xF4E9L,(-1L),0xDDAEL}},{{5L,0x30D6L,0L,0L,0x30D6L},{0xDDAEL,0x27CDL,0xF26FL,0xDDAEL,(-5L)},{0xBCD8L,0x30D6L,0x629CL,0x30D6L,0xBCD8L},{0xF26FL,(-2L),0x27CDL,(-5L),(-2L)},{0xBCD8L,0x3949L,0x3949L,0xBCD8L,0L}},{{0xDDAEL,(-1L),0xF4E9L,(-2L),(-2L)},{5L,0xBCD8L,5L,0L,0xBCD8L},{(-2L),0x27CDL,(-5L),(-2L),(-5L)},{0L,0L,0x629CL,0xBCD8L,0x30D6L},{0xF26FL,0xDDAEL,(-5L),(-5L),0xDDAEL}}}; + uint8_t * const * const l_4496[10][5] = {{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,&g_1950,NULL,&g_1950,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{NULL,&g_1950,NULL,NULL,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,&g_1950,&g_1950,&g_1950,&g_1950},{&g_1950,NULL,NULL,&g_1950,NULL}}; + int32_t l_4507 = 4L; + uint32_t l_4521 = 0UL; + uint32_t *l_4528[4][1][2] = {{{&g_1577[2][5][3],&g_582}},{{&g_1577[2][5][3],&g_582}},{{&g_1577[2][5][3],&g_582}},{{&g_1577[2][5][3],&g_582}}}; + uint32_t ** const *l_4539 = &g_4324[1]; + int8_t l_4577[4] = {0xE2L,0xE2L,0xE2L,0xE2L}; + int32_t *l_4583 = &g_46; + int16_t ****l_4589 = &l_4472; + int i, j, k; + for (g_1961 = 2; (g_1961 <= 7); g_1961 += 1) + { /* block id: 1930 */ + int8_t l_4483 = 0x97L; + int32_t l_4486 = 1L; + int8_t l_4508[7][2][6] = {{{0x03L,0L,(-1L),0xE9L,0x66L,0x29L},{0x66L,0x03L,0L,5L,5L,0L}},{{0x66L,0x66L,(-5L),0xE9L,0x0BL,(-8L)},{0x03L,0x66L,0xCAL,0xE6L,5L,(-5L)}},{{0L,0x03L,0xCAL,0L,0x66L,(-8L)},{0xE9L,0L,(-5L),0L,0xE9L,0L}},{{0L,0xE9L,0L,0xE6L,0xE9L,0x29L},{0x03L,0L,(-1L),0xE9L,0x66L,0x29L}},{{0x66L,0x03L,0L,5L,5L,0L},{0x66L,0x66L,(-5L),0xE9L,0x0BL,(-8L)}},{{0x03L,0x66L,0xCAL,0xE6L,5L,(-5L)},{0L,0x03L,0xCAL,0L,0x66L,(-8L)}},{{0xE9L,0L,(-5L),0L,0xE9L,0L},{0L,0xE9L,0L,0xE6L,0xE9L,0x29L}}}; + int16_t l_4522 = 0x8463L; + int i, j, k; + l_4487++; + if ((*g_225)) + continue; + l_4486 = (p_97 , (safe_mul_func_int8_t_s_s(((l_4484[4][0][3] , ((safe_add_func_uint32_t_u_u(((((*g_4307) = (l_4494 != l_4496[8][2])) == ((safe_mul_func_int16_t_s_s(((safe_div_func_int8_t_s_s((safe_mul_func_uint8_t_u_u((safe_unary_minus_func_int8_t_s((*g_635))), ((**g_539) |= (safe_lshift_func_int16_t_s_s(p_97, ((l_4483 & (((((*g_3466) > (safe_unary_minus_func_uint32_t_u(((((*g_2286) & p_97) ^ 0xFFL) > l_4507)))) && p_97) ^ p_97) & p_97)) != p_97)))))), (*g_1950))) && 0x14L), p_97)) >= 0x8CBB9D2AL)) | 0xC54BEBD3L), 0x06281214L)) | l_4507)) && (***g_540)), l_4508[1][1][3]))); + for (g_2602 = 0; (g_2602 <= 1); g_2602 += 1) + { /* block id: 1938 */ + int i, j; + if (g_2614[g_1961][g_1961]) + break; + l_4486 ^= (((*g_4307) = (safe_add_func_int8_t_s_s(0x49L, ((0xB4L <= ((*g_262) &= (((g_2614[(g_2602 + 4)][(g_2602 + 5)] >= (0x9FL >= (***g_2102))) && (+0xC3L)) & 0xDFB1L))) ^ (safe_sub_func_uint8_t_u_u(((((**g_2285) = 4294967294UL) & ((safe_add_func_uint32_t_u_u((+(((safe_mul_func_int8_t_s_s((safe_rshift_func_uint8_t_u_s(((l_4521 , 1L) , 0x13L), 1)), (***g_2102))) > 6UL) , (*g_1950))), 4294967295UL)) && l_4522)) ^ 1L), (**g_1949))))))) == 0xB765L); + } + } + if (((((0xC079FD5DL & ((safe_sub_func_uint16_t_u_u(1UL, (((p_97 && 0x1C5DB56FL) <= (((***g_538) = 0xA0L) != (safe_mul_func_int16_t_s_s((l_4527 == l_4528[2][0][0]), ((l_4366 = (safe_lshift_func_uint8_t_u_s(p_97, 2))) > (safe_mod_func_uint16_t_u_u((*g_2115), 0x087EL))))))) == p_97))) > 6UL)) , 3L) <= 65535UL) || p_97)) + { /* block id: 1948 */ + uint32_t l_4558 = 0UL; + int32_t l_4559 = 0x58498952L; + (*g_2442) = ((247UL & (((safe_mul_func_int16_t_s_s((l_4485 ^= (safe_sub_func_int16_t_s_s(p_97, (safe_div_func_uint32_t_u_u((p_97 | ((l_4507 |= (l_4539 != NULL)) < (safe_add_func_uint16_t_u_u(((safe_sub_func_int8_t_s_s((safe_div_func_int8_t_s_s((((((p_97 != (((*g_262) = (safe_mul_func_int8_t_s_s(((*g_4307) ^ ((safe_div_func_uint8_t_u_u((safe_mod_func_uint8_t_u_u((safe_lshift_func_uint8_t_u_u((((*g_1950) = (((safe_add_func_int8_t_s_s(((1L >= (l_4558 = (safe_lshift_func_int8_t_s_u((***g_538), p_97)))) & (*g_2286)), p_97)) == l_4559) ^ p_97)) > p_97), 4)), (*g_635))), (**l_4408))) > p_97)), p_97))) > 9UL)) >= l_4559) , 6UL) && 0x025A17E4L) , (***g_540)), p_97)), p_97)) <= (*p_98)), (*p_98))))), l_4559))))), l_4387[1])) != l_4372) | p_97)) ^ p_97); + (*g_538) = (*g_538); + for (g_2640 = (-29); (g_2640 > 15); g_2640++) + { /* block id: 1958 */ + if (l_4559) + break; + (****g_2457) = &p_97; + (*g_2442) = ((-1L) && ((**g_1949)--)); + } + (***g_2458) = (int32_t*) func_187((*g_1950), l_4485); + } + else + { /* block id: 1965 */ + (**g_2459) = &p_97; + } + l_4580 &= ((((***g_3276) = (**l_4482)) != l_4564) , ((safe_rshift_func_uint16_t_u_s((safe_lshift_func_int16_t_s_u((safe_rshift_func_uint8_t_u_s((safe_add_func_int8_t_s_s(((safe_lshift_func_int8_t_s_s((-1L), 5)) ^ 0xB954L), (safe_sub_func_uint16_t_u_u((l_4577[2] != 0x0192D7A7L), (safe_div_func_uint16_t_u_u((*p_98), 9L)))))), 0)), 10)), l_4484[0][4][0])) | (*p_98))); + for (g_2742 = 25; (g_2742 <= 24); g_2742--) + { /* block id: 1972 */ + (*g_2460) = l_4583; + for (g_2783 = 0; (g_2783 == 19); g_2783 = safe_add_func_int32_t_s_s(g_2783, 9)) + { /* block id: 1976 */ + int16_t *****l_4588 = &l_4586[0][0][1]; + (*g_2442) = (((*l_4588) = l_4586[0][0][0]) != l_4589); + return (*l_4408); + } + return (*g_224); + } + } + else + { /* block id: 1983 */ + return (*l_4408); + } + --l_4592; + } + l_4430[0][2][0] |= ((((l_4590 = (((*g_2442) ^= (p_97 ^ ((safe_lshift_func_uint16_t_u_u((*p_98), (~(l_4598 == l_4598)))) < ((p_97 == ((p_97 ^ ((**g_2285) = (safe_mod_func_int32_t_s_s((safe_div_func_uint8_t_u_u(((*g_4307) , ((((safe_add_func_int8_t_s_s((safe_div_func_int16_t_s_s(l_4592, (safe_add_func_int16_t_s_s((safe_mul_func_int16_t_s_s(p_97, p_97)), 6L)))), 0x1BL)) | (*g_3102)) < (-4L)) ^ p_97)), p_97)), p_97)))) , (*g_1950))) && p_97)))) < p_97)) >= p_97) , 0x2653L) >= 0x716DL); + } + (*l_4621) = ((safe_rshift_func_int16_t_s_s((safe_div_func_uint8_t_u_u(((((*l_4615) = &g_3466) == (g_4618 = &g_1119[1])) >= 0UL), (safe_unary_minus_func_int16_t_s((l_4620 == l_4620))))), 1)) , ((*g_2442) = 0x57C8A693L)); + return (*g_224); +} + + +/* ------------------------------------------ */ +/* + * reads : g_1961 g_262 g_263 g_3102 g_622 g_1950 g_450 g_635 g_2285 g_2286 g_2287 g_2442 g_621 g_463 g_2606 g_2674 g_3466 g_3467 g_539 g_538 g_2741 g_809 g_2783 g_65 g_46 g_2102 g_1949 g_462 g_224 g_45 g_225 g_2446 g_643 g_206 g_48 g_255 g_2458 g_2459 g_2460 g_2759 g_2630 g_3276 g_3277 g_2115 g_2734 g_2751 g_2618 g_1117 g_1118 g_921 g_393 g_36 g_282 g_283 g_209 g_254 g_3378 g_1577 g_2457 g_2613 g_2594 g_3376 g_810 g_2745 g_4198 g_2615 g_1352 g_2760 g_540 g_642 g_4324 + * writes: g_263 g_462 g_621 g_463 g_2606 g_2287 g_3376 g_2741 g_810 g_2783 g_450 g_921 g_2674 g_643 g_209 g_36 g_224 g_255 g_1859 g_2759 g_1961 g_622 g_3505 g_2734 g_2751 g_2618 g_1118 g_393 g_206 g_254 g_1577 g_2613 g_2594 g_592 g_3377 g_2745 g_1950 g_300 g_2615 g_1352 g_2760 g_2664 g_4304 g_4306 g_642 g_45 g_225 + */ +static int32_t func_107(uint16_t * const p_108, uint16_t * p_109, uint32_t p_110) +{ /* block id: 1643 */ + int32_t l_3868[9][6][4] = {{{1L,1L,0x4AFAF8C2L,1L},{0xBD3041A8L,0x4776EFD0L,0L,2L},{(-9L),0x06993B7AL,0L,0x4F15A40DL},{(-1L),0xC4656CD9L,0L,6L},{(-1L),1L,0L,0xAC73DA63L},{(-9L),6L,0L,0L}},{{0xBD3041A8L,(-9L),0x4AFAF8C2L,0L},{1L,(-5L),(-1L),1L},{0xEE48E7C1L,(-6L),0xAF8B44F7L,0xC9F87727L},{0L,0xAF8B44F7L,1L,(-5L)},{1L,5L,0xC9F87727L,0x31C23674L},{0xBA7263E3L,0x35994EACL,5L,0x1C3A6D85L}},{{0x54C87EA5L,7L,(-3L),0L},{(-3L),(-5L),0x615BB4EDL,0x615BB4EDL},{(-3L),(-3L),1L,7L},{0x4776EFD0L,(-1L),1L,0xD3402BFCL},{0xAF8B44F7L,(-9L),(-8L),7L},{2L,(-9L),(-6L),0x54C87EA5L}},{{(-9L),(-3L),(-1L),0xC5E17E37L},{0xD5BA8838L,0L,6L,2L},{0L,1L,(-3L),6L},{(-1L),0xC5E17E37L,0x1C3A6D85L,(-8L)},{0x35994EACL,0xD5BA8838L,0x615BB4EDL,0xAF8B44F7L},{(-7L),1L,(-10L),1L}},{{(-1L),1L,0x31C23674L,0L},{1L,0xC4656CD9L,5L,(-1L)},{0L,0x1C3A6D85L,0xD5BA8838L,1L},{0x4776EFD0L,0xBD3041A8L,0x4776EFD0L,0L},{0xC4656CD9L,0x35994EACL,0xC5E17E37L,0xBA7263E3L},{7L,0xAC73DA63L,0xEE48E7C1L,0x35994EACL}},{{(-6L),0xC9F87727L,0xEE48E7C1L,(-9L)},{7L,(-1L),0xC5E17E37L,1L},{0xC4656CD9L,0L,0x4776EFD0L,(-10L)},{0x4776EFD0L,(-10L),0xD5BA8838L,1L},{0L,(-8L),5L,6L},{1L,0x4776EFD0L,0x31C23674L,0L}},{{(-1L),0L,(-10L),(-1L)},{(-7L),0x4F15A40DL,0x615BB4EDL,(-5L)},{0x35994EACL,5L,0x1C3A6D85L,0xC9F87727L},{(-1L),1L,(-3L),(-6L)},{0L,6L,6L,0L},{0xD5BA8838L,0x54C87EA5L,(-1L),0x1303A171L}},{{(-9L),0L,(-6L),1L},{2L,0xD3402BFCL,(-8L),1L},{0xAF8B44F7L,0L,7L,0x1303A171L},{0L,0x54C87EA5L,1L,0L},{0L,6L,2L,(-6L)},{0x7D4BD910L,1L,0L,0xC9F87727L}},{{0x615BB4EDL,5L,1L,(-5L)},{0x1303A171L,0x4F15A40DL,0L,(-1L)},{(-1L),0L,0L,0L},{6L,0x4776EFD0L,1L,6L},{6L,(-8L),0x06993B7AL,1L},{0L,(-10L),1L,(-10L)}}}; + uint8_t l_3877 = 0x44L; + uint32_t l_3879 = 0xB05EA3E2L; + int32_t l_3880 = 0xE5D71881L; + int32_t l_3888 = (-1L); + int32_t l_3889[6][2][1] = {{{0xA50AF793L},{0L}},{{0xA50AF793L},{0L}},{{0xA50AF793L},{0L}},{{0xA50AF793L},{0L}},{{0xA50AF793L},{0L}},{{0xA50AF793L},{0L}}}; + const int32_t **l_3910 = NULL; + int8_t *l_4122[2]; + int16_t l_4158 = (-10L); + uint8_t l_4163[4] = {0x48L,0x48L,0x48L,0x48L}; + int32_t **l_4177 = NULL; + uint32_t l_4184 = 0x385F7C91L; + const int32_t **** const *l_4196[1][2][9]; + const int32_t **** const **l_4195 = &l_4196[0][0][8]; + const int32_t **** const ***l_4194 = &l_4195; + const uint32_t *l_4319 = NULL; + const uint32_t **l_4318 = &l_4319; + uint16_t *** const *l_4321 = &g_3622; + uint32_t l_4361[8] = {0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L,0x0EFEDDF2L}; + int16_t l_4363 = 0L; + int i, j, k; + for (i = 0; i < 2; i++) + l_4122[i] = &g_2751[1]; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + { + for (k = 0; k < 9; k++) + l_4196[i][j][k] = &g_2458; + } + } +lbl_4039: + (*g_2442) ^= ((safe_lshift_func_int16_t_s_u(((safe_lshift_func_int16_t_s_s(((~(safe_add_func_int16_t_s_s((0x0E2EA3F7L & (safe_add_func_int16_t_s_s(0L, (*p_109)))), ((*p_109) == (l_3868[7][2][3] <= (((*g_635) = (safe_div_func_int32_t_s_s(((safe_mul_func_int16_t_s_s((safe_add_func_uint32_t_u_u((safe_mod_func_int16_t_s_s((p_110 != ((l_3877 & (l_3880 = ((l_3877 & (((safe_unary_minus_func_int8_t_s(((*g_262) ^= ((p_110 & 0x8EL) != l_3868[7][2][3])))) <= l_3879) | p_110)) >= 0L))) <= (*g_3102))), p_110)), l_3868[3][4][3])), l_3868[7][2][3])) >= (*g_1950)), 4294967295UL))) || p_110)))))) & (-5L)), l_3877)) < (**g_2285)), 11)) != l_3868[7][4][2]); + if ((((0xD6E3L < (safe_mul_func_uint16_t_u_u((*p_109), (safe_rshift_func_uint8_t_u_u(p_110, 2))))) , (+((l_3868[3][5][3] = (l_3868[7][2][3] != (l_3889[2][0][0] = (l_3888 &= ((*g_2442) ^= (l_3880 = (safe_rshift_func_uint16_t_u_s((*p_109), 0)))))))) , (safe_add_func_uint16_t_u_u((~(safe_sub_func_int16_t_s_s(((((safe_add_func_uint16_t_u_u((l_3889[3][1][0] , (safe_sub_func_int16_t_s_s(p_110, (!((safe_lshift_func_uint8_t_u_s(((safe_add_func_int8_t_s_s((safe_mod_func_uint32_t_u_u(((safe_add_func_uint8_t_u_u((safe_div_func_uint16_t_u_u((NULL == l_3910), p_110)), p_110)) < l_3889[1][0][0]), l_3868[2][1][2])), p_110)) || l_3868[5][5][0]), 5)) && 0xD888C1D0L))))), l_3879)) < 3L) && 0x8934L) == p_110), 0UL))), 0xEA76L))))) < p_110)) + { /* block id: 1653 */ + uint32_t l_3911 = 0x444E629DL; + int32_t l_3951 = 0x5D79E21AL; + int32_t l_3963 = 0x5DDE3BD7L; + int32_t l_3964[6] = {0xB6C040BBL,0xB6C040BBL,0xB6C040BBL,0xB6C040BBL,0xB6C040BBL,0xB6C040BBL}; + uint32_t l_4006 = 18446744073709551615UL; + uint32_t l_4025 = 0UL; + uint8_t ****l_4030 = &g_2102; + uint32_t **l_4051 = &g_284[8][0]; + uint32_t *l_4069 = &g_393; + uint32_t l_4074 = 0x94B8BBE1L; + int16_t l_4099 = 0x83D1L; + int32_t **l_4180 = NULL; + int i; +lbl_4060: + if (p_110) + { /* block id: 1654 */ + l_3911 &= p_110; + if (l_3879) + goto lbl_4060; + } + else + { /* block id: 1656 */ + int8_t **l_3914 = &g_262; + uint32_t ** const *l_3926[4] = {&g_3377,&g_3377,&g_3377,&g_3377}; + int32_t l_3927[5][6][2] = {{{0x7FD4B5D8L,0x7FD4B5D8L},{9L,0xF741950EL},{0x0569A126L,9L},{0x0569A126L,(-1L)},{(-1L),0x0569A126L},{9L,6L}},{{9L,0x0569A126L},{(-1L),(-1L)},{0x0569A126L,9L},{6L,9L},{0x0569A126L,(-1L)},{(-1L),0x0569A126L}},{{9L,6L},{9L,0x0569A126L},{(-1L),(-1L)},{0x0569A126L,9L},{6L,9L},{0x0569A126L,(-1L)}},{{(-1L),0x0569A126L},{9L,6L},{9L,0x0569A126L},{(-1L),(-1L)},{0x0569A126L,9L},{6L,9L}},{{0x0569A126L,(-1L)},{(-1L),0x0569A126L},{9L,6L},{9L,0x0569A126L},{(-1L),(-1L)},{0x0569A126L,9L}}}; + uint16_t *l_3944 = &g_3505[1][2]; + int32_t l_3971 = 1L; + uint32_t **l_3979 = &g_284[8][0]; + uint32_t **l_4035 = &g_3378; + uint8_t l_4040 = 1UL; + int i, j, k; + for (g_463 = 0; (g_463 <= 1); g_463 += 1) + { /* block id: 1659 */ + uint32_t ****l_3925[1][1][3]; + int32_t l_3938 = 0xCF138EEEL; + int32_t l_3965 = 0xACC55460L; + uint16_t ***l_3991[10][5][5] = {{{&g_1103,NULL,&g_1103,NULL,&g_1103},{&g_3170,NULL,NULL,&g_1103,&g_3170},{&g_3170,&g_3170,&g_1103,NULL,&g_3170},{&g_1103,&g_3170,&g_1103,&g_1103,&g_3170},{NULL,&g_1103,&g_3170,&g_3170,NULL}},{{&g_1103,&g_3170,&g_1103,&g_1103,&g_1103},{&g_3170,NULL,&g_3170,NULL,&g_3170},{&g_1103,&g_3170,&g_3170,&g_3170,NULL},{&g_3170,&g_3170,&g_3170,&g_1103,&g_3170},{&g_3170,NULL,&g_3170,NULL,&g_1103}},{{NULL,&g_1103,&g_3170,&g_1103,&g_3170},{NULL,&g_1103,&g_1103,&g_3170,NULL},{NULL,&g_1103,&g_3170,&g_3170,&g_1103},{&g_3170,NULL,&g_1103,&g_1103,&g_1103},{NULL,NULL,&g_1103,NULL,&g_1103}},{{&g_3170,&g_3170,NULL,NULL,&g_3170},{&g_3170,NULL,&g_1103,NULL,NULL},{NULL,&g_3170,&g_1103,&g_1103,&g_3170},{NULL,NULL,&g_1103,&g_3170,&g_1103},{&g_3170,&g_3170,&g_3170,&g_1103,&g_3170}},{{&g_3170,&g_3170,&g_3170,NULL,&g_1103},{NULL,&g_3170,&g_1103,&g_3170,&g_1103},{&g_3170,NULL,&g_3170,NULL,&g_3170},{NULL,NULL,&g_1103,NULL,&g_1103},{NULL,&g_3170,&g_3170,NULL,NULL}},{{NULL,&g_1103,&g_3170,NULL,NULL},{&g_3170,&g_3170,&g_3170,&g_3170,&g_1103},{&g_3170,&g_3170,&g_3170,&g_1103,&g_3170},{&g_3170,&g_1103,NULL,&g_3170,&g_3170},{&g_1103,&g_3170,&g_1103,&g_3170,&g_1103}},{{&g_1103,NULL,&g_3170,&g_3170,&g_1103},{&g_3170,NULL,NULL,&g_3170,&g_3170},{&g_1103,NULL,&g_1103,NULL,&g_1103},{NULL,&g_1103,&g_1103,NULL,&g_3170},{NULL,&g_3170,&g_1103,NULL,&g_3170}},{{&g_3170,&g_1103,NULL,&g_1103,&g_3170},{&g_1103,&g_1103,&g_1103,&g_3170,&g_1103},{&g_3170,&g_3170,&g_3170,&g_1103,NULL},{&g_3170,&g_1103,&g_1103,&g_3170,NULL},{&g_1103,NULL,&g_1103,&g_1103,NULL}},{{&g_3170,NULL,NULL,&g_3170,&g_3170},{NULL,NULL,&g_3170,&g_3170,&g_3170},{&g_3170,&g_3170,&g_3170,&g_3170,&g_3170},{&g_1103,&g_1103,&g_1103,&g_3170,&g_3170},{&g_1103,&g_3170,&g_3170,&g_1103,&g_3170}},{{&g_1103,&g_1103,&g_1103,&g_1103,&g_3170},{&g_3170,&g_1103,&g_1103,NULL,&g_3170},{&g_3170,NULL,NULL,&g_3170,&g_3170},{NULL,&g_1103,NULL,&g_1103,&g_3170},{NULL,&g_1103,&g_3170,&g_3170,NULL}}}; + int32_t l_4026 = 0x33B04613L; + uint8_t l_4041 = 1UL; + int i, j, k; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 3; k++) + l_3925[i][j][k] = &g_3376; + } + } + for (g_2606 = 4; (g_2606 >= 0); g_2606 -= 1) + { /* block id: 1662 */ + int i; + return g_2674[(g_463 + 4)]; + } + (*g_2442) = (safe_rshift_func_int8_t_s_s(((((*g_2286) = ((NULL == l_3914) >= (safe_lshift_func_int8_t_s_u(0x7CL, (l_3911 < (l_3880 , (*g_3466))))))) <= (safe_sub_func_int8_t_s_s((*g_262), (l_3888 && ((l_3877 , p_110) , 0x1B8AL))))) != (**g_539)), 3)); + if (((*g_2442) &= ((safe_mul_func_int8_t_s_s(((((safe_sub_func_int32_t_s_s((safe_lshift_func_uint8_t_u_s((l_3927[2][3][0] = ((g_3376 = &g_3377) == l_3926[3])), 7)), p_110)) & ((safe_add_func_int32_t_s_s((((+((safe_mul_func_uint8_t_u_u(9UL, (!(((safe_add_func_int32_t_s_s((safe_sub_func_uint32_t_u_u(0x18F13BA1L, l_3938)), l_3911)) <= 1UL) || p_110)))) <= (*g_3466))) , 0x2E4BL) == p_110), 0x47DE342AL)) | 0xC9BCL)) >= 0x4730L) & l_3911), 255UL)) || l_3938))) + { /* block id: 1670 */ + int8_t **l_3941 = &g_635; + int32_t l_3945[9] = {0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L,0xC75ECA48L}; + uint8_t *l_3989 = &g_921[0]; + uint8_t *l_3990 = &l_3877; + int i; + l_3938 &= (((0x5DA452C5L | (l_3941 == (*g_538))) > (safe_rshift_func_uint16_t_u_s((*p_109), (*g_3466)))) == l_3927[2][3][0]); + for (g_2741 = 0; (g_2741 <= 5); g_2741 += 1) + { /* block id: 1674 */ + uint32_t **l_3946[6][9][4] = {{{&g_284[8][0],&g_284[7][0],&g_284[5][2],&g_284[7][0]},{&g_284[8][0],NULL,NULL,&g_284[7][6]},{&g_284[1][1],&g_284[8][0],NULL,&g_284[0][0]},{NULL,&g_284[2][3],&g_284[2][2],&g_284[9][0]},{NULL,&g_284[8][0],NULL,NULL},{&g_284[1][1],&g_284[9][0],NULL,NULL},{&g_284[8][0],&g_284[2][2],&g_284[5][2],&g_284[1][3]},{&g_284[8][0],&g_284[3][4],&g_284[6][8],&g_284[8][0]},{&g_284[8][0],&g_284[5][4],NULL,&g_284[7][6]}},{{&g_284[7][0],NULL,NULL,NULL},{&g_284[5][4],&g_284[8][0],&g_284[2][2],&g_284[0][5]},{NULL,&g_284[8][0],&g_284[5][4],&g_284[2][5]},{&g_284[0][0],&g_284[9][0],&g_284[3][0],&g_284[3][0]},{&g_284[3][0],&g_284[3][0],&g_284[8][0],&g_284[4][7]},{&g_284[8][0],NULL,&g_284[7][6],&g_284[1][1]},{&g_284[4][0],&g_284[8][0],NULL,&g_284[7][6]},{&g_284[3][4],&g_284[8][0],NULL,&g_284[8][0]},{&g_284[4][7],NULL,NULL,NULL}},{{&g_284[1][3],&g_284[5][7],&g_284[0][5],&g_284[8][0]},{NULL,&g_284[2][5],&g_284[8][0],&g_284[5][2]},{NULL,&g_284[7][7],&g_284[3][0],&g_284[5][8]},{NULL,&g_284[8][0],&g_284[2][2],NULL},{&g_284[7][2],&g_284[9][0],&g_284[8][0],&g_284[8][0]},{NULL,&g_284[8][0],&g_284[4][7],&g_284[8][0]},{&g_284[9][0],NULL,NULL,NULL},{&g_284[6][2],NULL,&g_284[6][2],&g_284[8][0]},{&g_284[8][0],&g_284[2][5],&g_284[5][2],&g_284[6][8]}},{{&g_284[5][6],&g_284[8][0],&g_284[4][0],&g_284[2][5]},{NULL,NULL,&g_284[4][0],&g_284[5][4]},{&g_284[5][6],&g_284[6][2],&g_284[5][2],&g_284[8][0]},{&g_284[8][0],&g_284[9][6],&g_284[6][2],NULL},{&g_284[6][2],NULL,NULL,NULL},{&g_284[9][0],&g_284[5][6],&g_284[4][7],&g_284[8][0]},{NULL,&g_284[2][5],&g_284[8][0],&g_284[7][6]},{&g_284[7][2],NULL,&g_284[2][2],&g_284[8][7]},{NULL,&g_284[5][4],&g_284[3][0],NULL}},{{NULL,&g_284[1][3],&g_284[8][0],&g_284[8][0]},{NULL,&g_284[0][5],&g_284[0][5],NULL},{&g_284[1][3],&g_284[8][0],NULL,&g_284[3][0]},{&g_284[4][7],&g_284[7][2],&g_284[9][6],&g_284[8][0]},{NULL,&g_284[2][5],&g_284[6][8],&g_284[8][0]},{NULL,&g_284[7][2],&g_284[8][0],&g_284[3][0]},{NULL,&g_284[8][0],&g_284[8][0],NULL},{&g_284[5][7],&g_284[0][5],&g_284[8][0],&g_284[8][0]},{&g_284[5][4],&g_284[1][3],&g_284[8][0],NULL}},{{&g_284[0][5],&g_284[5][4],NULL,&g_284[8][7]},{&g_284[8][0],NULL,&g_284[1][3],&g_284[7][6]},{NULL,&g_284[2][5],&g_284[8][0],&g_284[8][0]},{&g_284[8][0],&g_284[5][6],&g_284[1][3],NULL},{NULL,NULL,&g_284[8][0],NULL},{&g_284[7][7],&g_284[9][6],&g_284[7][6],&g_284[8][0]},{&g_284[8][0],&g_284[6][2],&g_284[9][0],&g_284[5][4]},{&g_284[9][6],NULL,NULL,&g_284[2][5]},{&g_284[9][6],&g_284[8][0],&g_284[9][0],&g_284[6][8]}}}; + int i, j, k; + (*g_809) = &l_3945[4]; + } + for (g_2783 = 5; (g_2783 >= 0); g_2783 -= 1) + { /* block id: 1681 */ + int32_t *l_3952 = &l_3880; + int32_t *l_3953 = &l_3927[4][2][1]; + int32_t *l_3954 = &l_3888; + int32_t *l_3955 = &l_3938; + int32_t *l_3956 = NULL; + int32_t *l_3957 = &l_3951; + int32_t *l_3958 = &l_3945[4]; + int32_t *l_3959 = &l_3945[4]; + int32_t *l_3960 = NULL; + int32_t *l_3961 = &g_642; + int32_t *l_3962[5]; + uint16_t l_3966[2][5] = {{0x1329L,0UL,0xAD0EL,0xAD0EL,0UL},{0x1329L,0UL,0xAD0EL,0xAD0EL,0UL}}; + int i, j; + for (i = 0; i < 5; i++) + l_3962[i] = NULL; + ++l_3966[0][0]; + return l_3927[1][1][1]; + } + if ((safe_sub_func_int16_t_s_s((l_3971 |= l_3927[2][3][0]), (safe_mod_func_int8_t_s_s((g_2674[(g_463 + 4)] ^= (((~((*l_3990) = ((safe_sub_func_uint32_t_u_u(0x695C49A6L, (l_3951 |= (safe_sub_func_int8_t_s_s((l_3979 != &g_2286), (((((&l_3938 == &l_3951) && ((safe_div_func_uint8_t_u_u(((*l_3989) = ((***g_2102) = (safe_sub_func_uint32_t_u_u(((safe_add_func_uint16_t_u_u((!((safe_rshift_func_uint16_t_u_s(l_3927[2][3][0], p_110)) , (l_3964[3] = ((((((l_3965 <= (*g_3102)) | 0x7C6EB3B2L) & (*g_3102)) | p_110) < l_3938) > l_3945[3])))), p_110)) || 0xF44DF73DL), (*g_65))))), 0x6DL)) || (***g_2102))) , 65528UL) & l_3927[2][3][0]) , 0xFFL)))))) , 0UL))) == (*g_2286)) > 0L)), l_3963))))) + { /* block id: 1692 */ + return l_3888; + } + else + { /* block id: 1694 */ + uint32_t l_4005 = 0x8ED6DFF7L; + (***g_2458) = (int32_t*) func_187((((*g_2446) &= ((((l_3991[3][3][4] == NULL) ^ ((((safe_sub_func_int16_t_s_s((&p_109 == NULL), (p_110 || ((safe_add_func_uint8_t_u_u((~((*g_2442) |= p_110)), (**g_539))) != (safe_sub_func_int8_t_s_s(((safe_div_func_uint8_t_u_u((safe_rshift_func_uint8_t_u_u((safe_mul_func_int8_t_s_s((((0x9DL > ((*g_65) ^ 0L)) | l_4005) , (*g_635)), 0xC9L)), 6)), (**g_539))) & 1L), 1L)))))) >= (**g_2285)) | l_3911) > p_110)) != l_4006) & (**g_224))) , 0UL), (*g_3466)); + return l_3965; + } + } + else + { /* block id: 1700 */ + int32_t l_4016[2][6][6] = {{{0L,1L,0L,0xECE78375L,0xD59CE102L,0x7E339E85L},{0L,0xECE78375L,(-1L),0xA5AD44DDL,0xBB5326C8L,0xBB5326C8L},{0xA5AD44DDL,0xBB5326C8L,0xBB5326C8L,0xA5AD44DDL,(-1L),0xECE78375L},{0L,0x7E339E85L,0xD59CE102L,0xECE78375L,0L,1L},{0L,(-1L),3L,(-1L),0L,(-10L)},{1L,0x7E339E85L,3L,0xECE78375L,1L,(-1L)}},{{(-1L),0xA5AD44DDL,0xBB5326C8L,0xBB5326C8L,0xA5AD44DDL,(-1L)},{0xECE78375L,(-10L),3L,0x7E339E85L,(-1L),0x7C9A96A3L},{0xA5AD44DDL,0x76CDCC8BL,0L,(-1L),0L,0x76CDCC8BL},{0xA5AD44DDL,0x7C9A96A3L,(-1L),0x7E339E85L,3L,(-10L)},{0xECE78375L,(-1L),0xA5AD44DDL,0xBB5326C8L,0xBB5326C8L,0xA5AD44DDL},{(-1L),(-1L),1L,0xECE78375L,3L,0xBB5326C8L}}}; + uint32_t l_4023 = 0xA08EC9D5L; + int16_t l_4024 = 0x2B2EL; + int i, j, k; + for (g_2759 = 1; (g_2759 >= 0); g_2759 -= 1) + { /* block id: 1703 */ + int32_t l_4009 = 0L; + int32_t l_4013 = 0x186CA311L; + int i, j; + (*g_2442) &= g_2630[g_463][(g_463 + 2)]; + (*g_809) = (int32_t*) func_187(p_110, (l_3868[7][2][3] &= 0xFFB2L)); + l_4026 &= (((l_3964[3] = (((safe_sub_func_uint16_t_u_u(l_3971, ((*p_109) = l_3938))) | (0xCBABL & ((*l_3944) = (l_4025 = (((((*g_2442) = ((l_4009 = l_3938) | (safe_rshift_func_uint16_t_u_u(((+(((*g_3102)--) & (l_4016[0][1][0] >= (4294967295UL & (((((safe_sub_func_uint16_t_u_u(p_110, (safe_add_func_int8_t_s_s(((safe_lshift_func_uint8_t_u_u(p_110, 6)) || l_3938), 0L)))) , l_4023) > l_4024) != (*g_1950)) ^ 255UL))))) < 2UL), p_110)))) , (*g_3276)) != NULL) > p_110))))) ^ l_3964[1])) , l_3938) <= l_3965); + } + (*g_809) = (int32_t*) func_187(l_3938, (~(((safe_mul_func_uint16_t_u_u(((NULL != l_4030) , l_3889[5][1][0]), ((*g_2115) &= (safe_mod_func_int32_t_s_s((safe_div_func_int32_t_s_s((l_3889[2][0][0] < ((((((NULL != l_4035) ^ p_110) >= (safe_unary_minus_func_uint32_t_u((safe_div_func_int8_t_s_s((-1L), 0x4AL))))) , l_3911) , l_3911) , 0xEC782EB4L)), p_110)), l_3927[2][3][0]))))) ^ 1L) & l_4016[1][1][2]))); + } + for (g_2734 = 0; (g_2734 <= 1); g_2734 += 1) + { /* block id: 1721 */ + int i; + if (g_3467) + goto lbl_4039; + if (l_4040) + continue; + l_4041 = 0xA9E7D70FL; + (*g_2442) &= ((p_110 ^ (g_2751[g_463] ^= (l_3965 ^ (*g_635)))) || (safe_div_func_uint8_t_u_u((((2L >= (((~((5L ^ ((0xD046L | (safe_sub_func_uint8_t_u_u(((safe_lshift_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u(l_3927[2][3][0], 0xE0L)), ((((((l_4026 & (*g_3102)) != (*p_109)) , l_4051) == &g_284[8][0]) , l_3963) != p_110))) || 3L), p_110))) , (*g_1950))) < (*g_3466))) | p_110) && 0x71L)) <= (**g_224)) >= l_4026), (-1L)))); + for (g_2618 = 1; (g_2618 <= 4); g_2618 += 1) + { /* block id: 1729 */ + (*g_2442) &= 0x26E669C5L; + } + } + } + (*g_1117) = (*g_1117); + l_3889[0][1][0] &= (safe_div_func_uint8_t_u_u((g_921[1] |= (safe_rshift_func_int16_t_s_s((((***g_2102) ^ (((((NULL != (*g_3276)) , (p_110 , (int32_t**) NULL)) != (((***g_2102) ^ ((safe_rshift_func_uint8_t_u_s((l_3963 < (((!((*g_1950) <= ((*g_635) = (!0x6332L)))) | 5UL) || 8UL)), l_3951)) > 0x807DL)) , &g_2446)) | p_110) || p_110)) | l_4040), p_110))), l_3868[8][4][2])); + } + l_3868[7][2][3] = ((((l_3963 && ((*g_3102)++)) | (l_3888 ^= (l_3877 != (((*g_635) ^ (safe_add_func_int8_t_s_s((safe_mul_func_uint8_t_u_u(((safe_add_func_uint32_t_u_u(((*g_2286) = 0x30CD8744L), ((*g_2442) = l_3868[5][0][1]))) != (++(*l_4069))), (((((6UL & (NULL != &g_643[6])) , (safe_sub_func_uint8_t_u_u(l_3889[4][0][0], p_110))) & l_3911) , 2UL) | l_4074))), 253UL))) && 0L)))) ^ 4294967295UL) & p_110); + if (((safe_lshift_func_int16_t_s_u(((safe_rshift_func_int8_t_s_u((safe_lshift_func_uint16_t_u_u(l_3911, ((l_3951 == ((((p_110 > (4294967295UL ^ (safe_mul_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((safe_mul_func_uint8_t_u_u(((p_110 || (safe_sub_func_int32_t_s_s(((l_3889[5][1][0] = ((((**g_1949) && (p_110 && ((*g_1950)--))) ^ ((((safe_add_func_uint16_t_u_u((l_3963 ^= (*p_109)), (l_3879 <= p_110))) , l_3951) < (**g_539)) || p_110)) , p_110)) != 65534UL), 0xC01EF918L))) , p_110), l_3964[3])) >= 0x63D40AE4L), l_4074)), 0x85L)))) || l_3880) ^ l_4006) >= 0x8F73A598L)) <= l_3868[6][1][1]))), p_110)) > 0xD0CFL), 15)) && p_110)) + { /* block id: 1749 */ + l_3868[7][2][3] = p_110; + } + else + { /* block id: 1751 */ + uint16_t l_4110[2][8]; + int8_t l_4120 = 0L; + int32_t *l_4121 = &l_3963; + const int32_t **l_4123 = NULL; + const int32_t *l_4124 = &g_4125[2][2][0]; + uint32_t *l_4126 = &l_4074; + int32_t l_4134 = 0x3254616BL; + int32_t l_4135 = 0xF3BFFCE4L; + int32_t l_4136 = 0L; + int32_t l_4137 = 0xF5AC75A4L; + uint32_t l_4138 = 1UL; + int32_t l_4157 = 0x9636EC6CL; + int32_t l_4159 = 0xCD55DC8EL; + int32_t l_4160 = 4L; + int32_t l_4161 = 0xCA625ADDL; + int32_t l_4162[10] = {0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL,0x6D43251CL}; + int16_t ***l_4169[10] = {&g_1118,&g_1118,&g_1118,&g_1118,&g_1118,&g_1118,&g_1118,&g_1118,&g_1118,&g_1118}; + int16_t ****l_4168 = &l_4169[7]; + int32_t *l_4182 = &l_3868[2][0][2]; + int32_t *l_4183[4] = {NULL,NULL,NULL,NULL}; + int i, j; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + l_4110[i][j] = 0x6208L; + } + (****g_2457) = func_170(((*g_3378) ^= (safe_sub_func_int8_t_s_s((p_110 < (safe_div_func_int16_t_s_s(p_110, ((((**g_2285) |= (~((~p_110) >= 1UL))) <= ((*l_4069) = l_4099)) ^ ((*l_4126) &= (safe_mul_func_int16_t_s_s(((safe_mod_func_int16_t_s_s(((safe_add_func_int32_t_s_s(((*g_2442) = (((p_110 < (safe_sub_func_uint16_t_u_u((safe_div_func_uint16_t_u_u(((l_3889[2][0][0] = (l_4110[1][1] ^ (((((l_4124 = func_170(((safe_rshift_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s((safe_mul_func_int8_t_s_s((safe_sub_func_int16_t_s_s(l_3964[3], ((+l_4120) , l_3889[0][1][0]))), 251UL)), (***g_538))) | l_3951), p_110)) , 0x46773F3BL), l_4121, p_110, l_4122[1])) == &l_3964[3]) & (**g_1949)) >= 0x769EL) || 0xBAL))) & p_110), 0xA733L)), (*g_2115)))) > p_110) || 0xB5AAA63AL)), (*l_4121))) | p_110), (-1L))) , p_110), 0L))))))), (*g_635)))), &l_3880, l_3888, (**g_538)); + for (g_2613 = 22; (g_2613 > 22); ++g_2613) + { /* block id: 1762 */ + uint16_t l_4129 = 65535UL; + int32_t l_4130[8] = {0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL,0x3E7B5B0BL}; + int32_t *l_4131 = NULL; + int32_t *l_4132 = &g_621; + int32_t *l_4133[8][6][5] = {{{&l_3868[7][2][3],&l_3868[3][4][1],&l_3868[7][2][3],&l_3868[3][4][3],NULL},{&l_3889[2][0][0],NULL,&l_3889[1][1][0],&g_642,&l_3868[7][2][3]},{NULL,&l_3888,NULL,NULL,&l_3888},{&l_3964[5],&l_3868[7][2][3],&l_3889[1][1][0],&l_3868[7][2][3],&l_3951},{&l_3868[3][4][1],&l_3963,&l_3868[7][2][3],NULL,&g_254},{&g_641,&l_3888,&l_3964[0],&g_641,NULL}},{{&l_3951,NULL,&l_3964[3],&l_3951,NULL},{&l_3888,&l_3951,&g_254,NULL,&g_254},{NULL,NULL,&l_3880,&g_46,&l_3951},{&l_3868[7][2][3],&g_642,&g_641,&l_3880,&l_3888},{&l_3889[2][0][0],&g_641,&g_254,NULL,&l_3868[7][2][3]},{&g_46,&g_642,NULL,&l_3889[2][0][0],NULL}},{{&l_3951,NULL,&l_3964[5],NULL,NULL},{&l_3889[2][0][0],&l_3951,&l_3868[7][2][3],&g_642,&l_3889[1][1][0]},{&l_3889[2][0][0],NULL,NULL,&g_642,&l_3889[2][0][0]},{&l_3889[1][1][0],&l_3888,NULL,NULL,&l_3888},{&l_3888,&l_3963,&l_3889[1][1][0],&l_3889[2][0][0],&l_3964[3]},{&l_3868[3][4][1],&l_3868[7][2][3],&l_3963,NULL,&g_621}},{{&l_3880,&l_3888,&l_3964[5],&l_3880,NULL},{&l_3868[3][4][1],NULL,&l_3964[3],&g_46,&g_641},{&l_3888,&l_3868[3][4][1],&l_4130[0],NULL,&g_621},{&l_3889[1][1][0],NULL,&g_641,&l_3951,&l_3951},{&l_3889[2][0][0],&l_3868[3][4][3],&g_641,&g_641,&l_3964[5]},{&l_3889[2][0][0],NULL,&l_4130[0],&l_3951,NULL}},{{&l_3888,&l_3963,&l_4130[0],NULL,&g_641},{&l_3868[3][4][3],&l_3880,&g_642,&l_3964[5],&l_3964[0]},{NULL,&l_3951,NULL,&l_3963,&g_641},{&l_3963,&l_3964[5],&l_3880,&l_3964[3],NULL},{&g_641,&g_642,&l_3964[0],&l_3964[5],&g_642},{&l_3880,&l_3964[3],NULL,NULL,&g_254}},{{&g_46,&l_3964[3],NULL,&l_3964[3],&l_3868[7][2][3]},{&l_3889[1][1][0],&g_642,&g_642,&l_3889[1][1][0],&l_3964[3]},{&l_3951,&l_3964[5],&g_621,&l_3868[3][4][3],&l_3951},{&g_642,&l_3951,&l_3963,&l_3880,&l_3868[7][2][3]},{&g_641,&l_3880,&l_3964[3],&l_3868[3][4][3],&l_4130[0]},{&l_3868[7][2][3],&l_3963,&l_3868[3][4][1],&l_3889[1][1][0],&l_3880}},{{NULL,&l_3951,&l_3963,&l_3964[3],NULL},{&l_3868[3][4][3],&l_3964[3],&l_4130[0],NULL,&l_3880},{&l_3868[3][4][3],&g_641,&g_641,&l_3964[5],&l_3964[5]},{NULL,&l_3951,NULL,&l_3964[3],&g_641},{&l_3868[7][2][3],&l_3964[0],&l_3880,&l_3963,NULL},{&g_641,&l_3880,&l_3888,&l_3964[5],&l_3880}},{{&g_642,&l_3964[3],&l_3880,NULL,&g_254},{&l_3951,NULL,NULL,&l_3951,&l_3963},{&l_3889[1][1][0],&l_3880,&g_641,&l_3889[1][1][0],&l_3951},{&g_46,&l_3964[5],&l_4130[0],&l_3888,&l_3951},{&l_3880,&g_46,&l_3963,&g_641,&l_3963},{&g_641,&g_641,&l_3868[3][4][1],&l_3868[3][4][3],&g_254}}}; + int i, j, k; + l_3868[7][2][3] = l_4129; + if ((*l_4121)) + break; + ++l_4138; + } + if (l_3964[3]) + { /* block id: 1767 */ + int32_t *l_4149 = &g_642; + int32_t *l_4150 = &l_3868[7][2][3]; + int32_t *l_4151 = &g_254; + int32_t *l_4152 = NULL; + int32_t *l_4153 = &l_3951; + int32_t *l_4154 = NULL; + int32_t *l_4155 = &l_3963; + int32_t *l_4156[10][10] = {{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,NULL},{&g_46,&g_46,NULL,&l_3888,NULL,&g_46,&g_46,NULL,&l_3888,&l_3868[7][2][3]},{NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3],NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3]},{NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3],NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3]},{NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3],NULL,NULL,&l_3868[7][2][3],&l_4137,&l_3868[7][2][3]}}; + int i, j; + for (g_2594 = 0; (g_2594 < 1); ++g_2594) + { /* block id: 1770 */ + uint32_t l_4146 = 1UL; + for (g_592 = (-1); (g_592 >= 3); g_592 = safe_add_func_uint8_t_u_u(g_592, 1)) + { /* block id: 1773 */ + uint32_t **l_4145 = NULL; + (*g_2442) = (((*g_3376) = l_4145) != NULL); + if (p_110) + continue; + ++l_4146; + if (p_110) + break; + } + (*g_2460) = ((*g_809) = (*g_809)); + } + l_4163[2]--; + } + else + { /* block id: 1784 */ + const uint8_t *l_4175 = &g_4176; + int32_t **l_4179 = &g_45; + for (g_2745 = 4; (g_2745 >= 14); g_2745++) + { /* block id: 1787 */ + uint16_t l_4171 = 0x535AL; + const uint8_t *l_4173[10][5][2] = {{{&g_4174,NULL},{NULL,&g_4174},{&g_4174,NULL},{&g_4174,NULL},{&g_4174,&g_4174}},{{NULL,NULL},{&g_4174,&g_4174},{&g_4174,NULL},{&g_4174,&g_4174},{NULL,&g_4174}},{{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,NULL},{&g_4174,&g_4174}},{{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,NULL},{&g_4174,&g_4174},{&g_4174,&g_4174}},{{&g_4174,&g_4174},{&g_4174,&g_4174},{NULL,NULL},{&g_4174,NULL},{&g_4174,&g_4174}},{{&g_4174,NULL},{&g_4174,NULL},{NULL,&g_4174},{&g_4174,&g_4174},{&g_4174,&g_4174}},{{&g_4174,&g_4174},{&g_4174,NULL},{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,&g_4174}},{{&g_4174,NULL},{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,&g_4174},{&g_4174,&g_4174}},{{NULL,&g_4174},{&g_4174,NULL},{&g_4174,&g_4174},{&g_4174,NULL},{NULL,&g_4174}},{{&g_4174,NULL},{&g_4174,NULL},{&g_4174,&g_4174},{NULL,NULL},{&g_4174,&g_4174}}}; + const uint8_t **l_4172[6] = {&l_4173[5][4][0],NULL,NULL,&l_4173[5][4][0],NULL,NULL}; + int32_t ***l_4178 = NULL; + uint32_t l_4181[4]; + int i, j, k; + for (i = 0; i < 4; i++) + l_4181[i] = 0x3A31D2E3L; + if (p_110) + break; + (*l_4121) = (&g_1117 == l_4168); + (*g_2442) = (((((~l_4171) < (p_110 ^ ((l_4175 = NULL) != ((***l_4030) = (*g_1949))))) , l_4099) == (0x072DFCF1L & (((l_4179 = l_4177) != l_4180) < p_110))) <= (*p_109)); + if (l_4181[1]) + break; + } + } + ++l_4184; + } + } + else + { /* block id: 1799 */ + uint32_t l_4187 = 0UL; + int32_t l_4199 = 0x5F2262A4L; + int8_t ** const *l_4217 = &g_539; + int8_t ** const **l_4216 = &l_4217; + int16_t *l_4218 = &g_300; + int32_t l_4219 = (-1L); + int32_t *l_4220 = &l_4219; + int16_t l_4239[5]; + int32_t l_4242 = 0x8D7F11EEL; + uint8_t l_4261 = 7UL; + int16_t l_4275[6] = {(-9L),2L,2L,(-9L),2L,2L}; + uint16_t ****l_4323 = &g_3622; + int32_t * const *l_4358 = &g_810[0]; + int32_t * const **l_4357 = &l_4358; + int32_t * const ** const *l_4356 = &l_4357; + int32_t * const ** const **l_4355 = &l_4356; + int16_t l_4360[5][6][7] = {{{0x0CBEL,0x7BB6L,0x0CBEL,0xD1CCL,0x2150L,0x54FEL,0x66B3L},{(-1L),0x37E6L,0x1A48L,0x8B38L,0x1A48L,0x37E6L,(-1L)},{0x190BL,0L,0x66B3L,0x2150L,(-1L),0x54FEL,(-1L)},{0x08DBL,0x22F3L,0x09FBL,0x37E6L,0x9A28L,0x495BL,9L},{0x5851L,0xC7D8L,0x66B3L,0x0CBEL,0x0CBEL,0x66B3L,0xC7D8L},{0x9A28L,(-5L),0x1A48L,(-1L),0x09FBL,0x8B38L,9L}},{{0x54FEL,0x5851L,0x0CBEL,0x5851L,0x54FEL,0x190BL,0xD1CCL},{0x9A28L,0xEF04L,0xA12DL,0x37E6L,0xFE2FL,0x37E6L,0xA12DL},{0xD1CCL,0xD1CCL,(-1L),0L,0x54FEL,0x5851L,0x0CBEL},{0x9A28L,0x37E6L,0x09FBL,0x22F3L,0x08DBL,0x849AL,0xFE2FL},{0x66B3L,(-1L),0x7BB6L,0xC7D8L,0x54FEL,0x54FEL,0xC7D8L},{0xAD07L,0x1F64L,0xAD07L,(-5L),0xFE2FL,5L,0x9A28L}},{{0x7BB6L,(-1L),0x66B3L,0x5851L,0x66B3L,(-1L),0x7BB6L},{0x09FBL,0x37E6L,0x9A28L,0x495BL,9L,5L,9L},{(-1L),0xD1CCL,0xD1CCL,(-1L),0L,0x54FEL,0x5851L},{0xA12DL,0xEF04L,0x9A28L,(-1L),0xAD07L,0x849AL,0x1A48L},{0L,0x7BB6L,0x66B3L,0x190BL,0xD1CCL,0x5851L,0x5851L},{0x4BDBL,0xE475L,0xAD07L,0xE475L,0x4BDBL,0x37E6L,9L}},{{0x0CBEL,0x54FEL,0x7BB6L,0x190BL,0xC7D8L,0x190BL,0x7BB6L},{9L,0x8B38L,0x09FBL,(-1L),0x1A48L,(-5L),0x9A28L},{0x0CBEL,0x190BL,(-1L),(-1L),0x190BL,0x0CBEL,0xC7D8L},{0x4BDBL,0x22F3L,0xA12DL,0x495BL,0x1A48L,0xEF04L,0xFE2FL},{0L,0x2150L,0L,0x5851L,0xC7D8L,0x66B3L,0x0CBEL},{0xA12DL,0x22F3L,0x4BDBL,(-5L),0x4BDBL,0x22F3L,0xA12DL}},{{(-1L),0x190BL,0x0CBEL,0xC7D8L,0xD1CCL,0x66B3L,0xD1CCL},{0x09FBL,0x8B38L,9L,0x22F3L,0xAD07L,0xEF04L,(-1L)},{0x7BB6L,0x54FEL,0x0CBEL,0L,0L,0x0CBEL,0x54FEL},{0xAD07L,0xE475L,0x4BDBL,0x37E6L,9L,(-5L),(-1L)},{0x66B3L,0x7BB6L,0L,0x7BB6L,0x66B3L,0x190BL,0xD1CCL},{0x9A28L,0xEF04L,0xA12DL,0x37E6L,0xFE2FL,0x37E6L,0xA12DL}}}; + int32_t *l_4362 = &g_642; + int i, j, k; + for (i = 0; i < 5; i++) + l_4239[i] = 1L; + l_4199 &= ((((l_4187 > (((((0x6755L < ((safe_div_func_uint32_t_u_u(((((safe_mul_func_int16_t_s_s(l_4187, ((NULL != l_4194) >= (safe_unary_minus_func_int32_t_s((*g_225)))))) == (((((65526UL | p_110) ^ l_4187) | 0x6AL) <= p_110) <= p_110)) > 0x359A2A55L) <= g_4198), l_4187)) < p_110)) , (*g_3102)) , (***g_538)) , &g_1118) == NULL)) ^ p_110) , l_4187) && l_4187); + if ((0x97L > (l_4187 && ((safe_mod_func_uint16_t_u_u(((safe_div_func_uint16_t_u_u(((safe_lshift_func_uint8_t_u_u((0x1F2EL && ((((safe_div_func_int16_t_s_s((safe_sub_func_int32_t_s_s((safe_mul_func_int16_t_s_s(((*l_4218) = (safe_lshift_func_uint8_t_u_u((NULL == l_4216), 5))), (p_110 >= p_110))), ((((*g_2442) = 0x3412475EL) , ((0L == 0x48L) >= p_110)) <= (**g_1949)))), (*g_3102))) != l_4199) != l_4187) != 0L)), p_110)) < l_4219), 1UL)) & 0L), p_110)) >= 0x53L)))) + { /* block id: 1803 */ + l_4220 = l_4220; + } + else + { /* block id: 1805 */ + int32_t l_4237 = (-10L); + int32_t l_4238 = 0x7DA6CDA8L; + int32_t *l_4256 = &l_3889[2][0][0]; + for (l_4187 = (-27); (l_4187 != 7); l_4187 = safe_add_func_uint16_t_u_u(l_4187, 3)) + { /* block id: 1808 */ + uint32_t l_4243 = 0UL; + int32_t l_4253 = (-1L); + uint32_t l_4254 = 0xB1587B1DL; + uint8_t l_4277 = 0x00L; + for (g_2615 = 3; (g_2615 <= (-12)); g_2615 = safe_sub_func_uint32_t_u_u(g_2615, 3)) + { /* block id: 1811 */ + int16_t l_4240 = 1L; + int32_t l_4241 = 0xB40C3977L; + int32_t *l_4273[9] = {&g_460[4],&g_460[4],&g_460[4],&g_460[4],&g_460[4],&g_460[4],&g_460[4],&g_460[4],&g_460[4]}; + int i; + if ((*l_4220)) + { /* block id: 1812 */ + int32_t *l_4225 = &l_3888; + int32_t l_4226 = (-7L); + int32_t *l_4227 = &l_3888; + int32_t *l_4228 = &l_4226; + int32_t *l_4229 = &l_3888; + int32_t *l_4230 = &l_4219; + int32_t *l_4231 = &g_642; + int32_t *l_4232 = &l_4226; + int32_t *l_4233 = NULL; + int32_t *l_4234 = &l_3889[0][1][0]; + int32_t *l_4235 = &l_4219; + int32_t *l_4236[1][2]; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + l_4236[i][j] = &g_254; + } + l_4243++; + if (g_4198) + goto lbl_4039; + } + else + { /* block id: 1815 */ + int32_t ****l_4252 = NULL; + int32_t *****l_4251 = &l_4252; + if (p_110) + break; + (*g_2442) |= (~((((l_4254 ^= ((**g_1949) = (safe_rshift_func_uint8_t_u_s(((p_110 < 255UL) && (*l_4220)), (safe_div_func_uint32_t_u_u((((*l_4251) = ((**g_3276) = (*g_3277))) != (*g_2457)), l_4253)))))) , (p_110 , p_110)) & ((~(**g_2285)) , (*p_109))) <= l_4237)); + if ((*g_45)) + break; + } + } + } + } + for (g_2760 = (-15); (g_2760 <= 3); g_2760 = safe_add_func_uint16_t_u_u(g_2760, 6)) + { /* block id: 1842 */ + uint32_t l_4314 = 0UL; + int16_t l_4315[5]; + int32_t l_4325 = 0xDAAEF9A2L; + int8_t l_4352 = 4L; + int i; + for (i = 0; i < 5; i++) + l_4315[i] = 1L; + (*g_2442) |= 1L; + for (g_2664 = 0; (g_2664 <= 4); ++g_2664) + { /* block id: 1846 */ + const uint8_t l_4298 = 1UL; + int16_t * const **l_4303[1]; + int32_t **l_4313 = &g_810[5]; + const uint32_t ***l_4320 = &l_4318; + uint16_t *** const **l_4322 = &l_4321; + int i; + for (i = 0; i < 1; i++) + l_4303[i] = NULL; + (*l_4220) = ((*g_2442) ^= (safe_add_func_int8_t_s_s((((safe_lshift_func_uint8_t_u_u(((safe_unary_minus_func_int8_t_s(0x55L)) || ((safe_add_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s((((((safe_mod_func_int16_t_s_s(((((((p_110 , l_4298) == (0xB8EBL != (&l_4220 == (((((**g_2285)++) || (*l_4220)) > (safe_rshift_func_int8_t_s_s((((*g_1117) = &l_4218) != (g_4306[4] = (g_4304[0][3][8] = NULL))), ((*g_635) = ((safe_mod_func_uint8_t_u_u((safe_div_func_int32_t_s_s((0L || (***g_540)), 0xEFCD0E45L)), (*g_262))) < (-3L)))))) , l_4313)))) ^ 0L) , l_4314) || l_4314) & p_110), l_4314)) <= (-1L)) && (*g_65)) >= l_4298) & l_4314), (*l_4220))), (*l_4220))) , l_4314)), l_4315[2])) | (*l_4220)) ^ (*l_4220)), (**g_1949)))); + l_4325 &= (p_110 | ((*g_45) , (((*l_4320) = l_4318) != ((*g_3376) = (((*l_4220) = (((*l_4322) = l_4321) == l_4323)) , g_4324[1]))))); + for (g_642 = 0; (g_642 >= 10); g_642 = safe_add_func_uint32_t_u_u(g_642, 3)) + { /* block id: 1861 */ + int32_t * const ** const ***l_4359 = &l_4355; + (*l_4220) = (safe_sub_func_uint16_t_u_u((safe_sub_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_u((0xF760497EL <= ((((safe_lshift_func_uint8_t_u_u(((!0xA8L) >= (safe_mod_func_int8_t_s_s((p_110 , ((***g_540) = ((0x08AEL & ((*p_109) = (((safe_div_func_uint16_t_u_u((--(*g_2115)), (safe_mod_func_int8_t_s_s((((*l_4220) , ((safe_add_func_uint8_t_u_u(((safe_add_func_int16_t_s_s(((~(safe_div_func_uint32_t_u_u(l_4352, (*g_2286)))) , (p_110 || ((**g_2285) = ((safe_mul_func_uint16_t_u_u((((*l_4359) = (p_110 , l_4355)) != (*g_3276)), (*p_109))) == 252UL)))), (*p_109))) <= 253UL), p_110)) <= 0x2CFDL)) && (*p_109)), l_4360[3][1][4])))) , 0UL) , (*p_109)))) , (***g_540)))), 1L))), (***g_2102))) , l_4361[3]) | p_110) < 7UL)), 2)), 1UL)), (-2L))); + } + } + (*g_224) = l_4362; + } + } + return l_4363; +} + + +/* ------------------------------------------ */ +/* + * reads : g_2115 g_3621 g_2286 g_2287 g_538 g_539 g_262 g_1950 g_450 g_809 g_810 g_1949 g_2442 g_2792 g_2459 g_2460 g_2285 g_2102 g_3466 g_3467 g_254 g_641 g_2457 g_2458 g_3376 g_3377 g_3378 g_1577 g_263 g_206 g_36 g_282 g_283 g_209 g_224 g_225 g_46 g_540 g_48 g_45 g_255 g_2736 g_3102 g_622 g_621 g_2786 g_2446 g_643 g_635 g_300 g_462 g_459 g_2731 g_2678 g_65 g_3835 g_2768 + * writes: g_45 g_622 g_263 g_254 g_641 g_621 g_2792 g_2752 g_2748 g_1859 g_206 g_36 g_209 g_224 g_255 g_2736 g_2287 g_3714 g_2786 g_838 g_462 g_450 g_300 g_644 g_810 g_459 g_2731 g_2678 g_2768 + */ +static uint16_t * func_111(int32_t p_112, uint32_t p_113) +{ /* block id: 7 */ + int8_t *l_1540 = &g_36; + int32_t l_1546[5]; + uint8_t **l_3496 = &g_1950; + int32_t *l_3500[3]; + int32_t *****l_3576 = &g_1352; + int8_t l_3592[2]; + uint8_t l_3609 = 1UL; + int32_t l_3623 = 0xE344CDA0L; + uint32_t *l_3625 = &g_2291; + uint32_t l_3683 = 0UL; + uint16_t *l_3717 = &g_644; + const int16_t * const *l_3725 = &g_3466; + const int16_t * const **l_3724 = &l_3725; + const int16_t * const ***l_3723[5] = {&l_3724,&l_3724,&l_3724,&l_3724,&l_3724}; + uint16_t ****l_3749 = &g_3622; + uint32_t l_3760 = 0xDBE6B753L; + int16_t l_3771 = (-3L); + uint16_t l_3772 = 0x1841L; + uint32_t l_3813 = 4294967295UL; + uint16_t ** const **l_3838[10] = {&g_3836,&g_3836,&g_3836,&g_3836,&g_3836,&g_3836,&g_3836,&g_3836,&g_3836,&g_3836}; + uint16_t *l_3851 = NULL; + int i; + for (i = 0; i < 5; i++) + l_1546[i] = 0L; + for (i = 0; i < 3; i++) + l_3500[i] = &l_1546[4]; + for (i = 0; i < 2; i++) + l_3592[i] = 0x59L; + for (p_112 = (-3); (p_112 > 18); p_112 = safe_add_func_int32_t_s_s(p_112, 6)) + { /* block id: 10 */ + int32_t *l_118 = &g_46; + int32_t **l_119[8] = {&l_118,&l_118,&l_118,&l_118,NULL,NULL,&l_118,NULL}; + uint16_t *l_1649 = &g_48; + int16_t * const *l_3495 = &g_1119[1]; + int16_t * const **l_3494[4][2] = {{&l_3495,&l_3495},{&l_3495,&l_3495},{&l_3495,&l_3495},{&l_3495,&l_3495}}; + uint16_t l_3536 = 0x12CDL; + int32_t *****l_3577 = NULL; + int8_t **l_3589 = NULL; + uint16_t ***l_3620 = &g_3170; + uint16_t ****l_3619 = &l_3620; + int32_t l_3624 = (-4L); + int i, j; + g_45 = l_118; + for (p_113 = 0; (p_113 < 30); p_113 = safe_add_func_int32_t_s_s(p_113, 7)) + { /* block id: 14 */ + int8_t l_142 = 0x9EL; + uint16_t *l_149 = &g_48; + int32_t **l_1670[6] = {&l_118,&l_118,&l_118,&l_118,&l_118,&l_118}; + int8_t l_2841 = 0x4BL; + int32_t ******l_3485[6][5] = {{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL}}; + uint32_t *l_3511 = &g_393; + int32_t l_3512 = 0x73473EB7L; + const uint16_t l_3556 = 1UL; + uint8_t l_3568 = 247UL; + uint8_t l_3590 = 255UL; + int i, j; + } + (**g_809) = (safe_sub_func_uint8_t_u_u((((safe_lshift_func_uint8_t_u_u((safe_sub_func_uint16_t_u_u((safe_lshift_func_uint8_t_u_u(((((*g_2115) = p_112) | ((((safe_mod_func_uint8_t_u_u(((safe_lshift_func_uint16_t_u_u((safe_div_func_int16_t_s_s((safe_mod_func_int8_t_s_s(((***g_538) = (((l_3609 &= (p_113 > p_113)) > (0xF893L != (p_112 | (safe_mod_func_uint16_t_u_u((0x9FCBL || (safe_mod_func_uint16_t_u_u((safe_sub_func_uint32_t_u_u(((safe_sub_func_int32_t_s_s((p_113 && (!((l_3619 != g_3621[0]) | p_113))), 1UL)) , p_112), (*g_2286))), 1UL))), 0x7DD1L))))) || 0UL)), (*g_1950))), p_113)), 7)) < 0L), 0x6AL)) , p_113) < l_3623) , l_3624)) <= 0xE52B8F0EL), 2)), p_112)), 6)) , l_3500[0]) == (int32_t*) l_3625), p_113)); + (*g_2442) = ((3UL != 3L) > (**g_1949)); + } + if (((*g_2442) = p_113)) + { /* block id: 1546 */ + int16_t l_3642 = 0xA65AL; + uint8_t **l_3649 = NULL; + int32_t *l_3664[7][9][3] = {{{NULL,&l_3623,&l_3623},{&g_254,NULL,NULL},{NULL,&l_1546[4],NULL},{NULL,&g_254,NULL},{NULL,NULL,&l_3623},{NULL,&g_254,&g_254},{&l_3623,&l_1546[4],NULL},{NULL,NULL,NULL},{NULL,&l_3623,NULL}},{{NULL,NULL,&g_254},{NULL,&l_3623,&l_3623},{&g_254,NULL,NULL},{NULL,&l_1546[4],NULL},{NULL,&g_254,NULL},{NULL,NULL,&l_3623},{NULL,&g_254,&g_254},{&l_3623,&l_1546[4],NULL},{NULL,NULL,NULL}},{{NULL,&l_3623,NULL},{NULL,NULL,&g_254},{NULL,&l_3623,&l_3623},{&g_254,NULL,NULL},{NULL,&l_1546[4],NULL},{NULL,&g_254,NULL},{NULL,NULL,&l_3623},{NULL,&g_254,&g_254},{&l_3623,&l_1546[4],NULL}},{{NULL,NULL,NULL},{NULL,&l_3623,NULL},{NULL,NULL,&g_254},{NULL,&l_3623,&l_3623},{&g_254,NULL,NULL},{NULL,&l_1546[4],NULL},{NULL,&g_254,NULL},{NULL,NULL,&l_3623},{NULL,&g_254,&g_254}},{{&l_3623,&l_1546[4],NULL},{NULL,NULL,NULL},{NULL,&l_3623,NULL},{NULL,NULL,&g_254},{NULL,&l_3623,&l_3623},{&g_254,NULL,NULL},{NULL,&l_1546[4],NULL},{NULL,&g_254,NULL},{NULL,NULL,&l_3623}},{{NULL,&g_254,&g_254},{&l_3623,&l_1546[4],NULL},{NULL,NULL,NULL},{&l_3623,NULL,&l_1546[4]},{&g_254,&g_254,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL},{&g_254,NULL,NULL}},{{&l_3623,&l_3623,NULL},{NULL,NULL,NULL},{NULL,NULL,&l_1546[4]},{NULL,NULL,NULL},{&l_3623,NULL,&l_1546[4]},{&g_254,&g_254,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}}; + int32_t **** const ** const * const l_3672 = NULL; + int32_t *** const l_3673 = &g_224; + uint32_t l_3684 = 0x7B1A0526L; + int i, j, k; + for (g_2792 = 0; (g_2792 != (-30)); g_2792 = safe_sub_func_uint16_t_u_u(g_2792, 1)) + { /* block id: 1549 */ + uint32_t l_3632 = 1UL; + int32_t *l_3636[6] = {&l_3623,&g_254,&l_3623,&l_3623,&g_254,&l_3623}; + uint32_t ** const *l_3662 = NULL; + uint32_t ** const **l_3661 = &l_3662; + int i; + if (p_113) + break; + for (g_2752 = 1; (g_2752 < (-22)); g_2752--) + { /* block id: 1553 */ + int32_t l_3663 = 0xC68DB0C4L; + for (g_2748 = 0; (g_2748 > 13); ++g_2748) + { /* block id: 1556 */ + const int16_t l_3635[4] = {(-1L),(-1L),(-1L),(-1L)}; + int i; + --l_3632; + if (l_3635[3]) + break; + (**g_2459) = l_3636[0]; + } + (**g_809) ^= (safe_unary_minus_func_uint32_t_u((safe_rshift_func_uint8_t_u_s(255UL, (safe_mul_func_int16_t_s_s(((l_3642 >= (safe_add_func_int32_t_s_s((safe_mul_func_int8_t_s_s((safe_sub_func_uint32_t_u_u((NULL != l_3649), (safe_div_func_uint32_t_u_u((safe_add_func_uint8_t_u_u((safe_add_func_int32_t_s_s((l_3642 , (((((safe_mul_func_int8_t_s_s((l_3642 , p_112), ((safe_unary_minus_func_int8_t_s((p_112 ^ (safe_sub_func_int32_t_s_s(((l_3661 != NULL) < 0x2CL), p_113))))) || 0xEAL))) ^ p_112) != 0UL) > 0x0BL) <= (*g_1950))), (**g_2285))), p_113)), 0x0C26F324L)))), (***g_2102))), 0x566ED64CL))) , (*g_3466)), l_3663)))))); + (****g_2457) = &l_3663; + } + } + (**g_2459) = func_170((***g_3376), l_3664[6][3][2], (p_112 , (+((*g_3466) | p_112))), (**g_538)); + (**g_2459) = (int32_t*) func_187(((((safe_sub_func_int16_t_s_s((safe_add_func_int8_t_s_s((safe_rshift_func_uint8_t_u_u((***g_2102), 1)), (NULL != l_3672))), (*g_3466))) != ((*l_1540) = (((((NULL == l_3673) == (safe_mul_func_int16_t_s_s(((((safe_mod_func_uint8_t_u_u(((((((+0x99L) , ((safe_rshift_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_s((p_113 >= p_113), (*g_3466))), (***l_3673))) | 255UL)) , (***g_540)) , (uint32_t*) NULL) != (**g_3376)) < p_113), (*g_1950))) & l_3683) < (*g_1950)) == l_3684), 0x94F0L))) , (**g_1949)) && (*g_1950)) >= (**g_539)))) || 0UL) | (***g_540)), p_113); + } + else + { /* block id: 1568 */ + int16_t l_3693[8][3] = {{2L,0x11B8L,0xEA8AL},{0x11B8L,2L,0xEA8AL},{8L,8L,0xEA8AL},{2L,0x11B8L,0xEA8AL},{0x11B8L,2L,0xEA8AL},{8L,8L,0xEA8AL},{2L,0x11B8L,0xEA8AL},{0x11B8L,2L,0xEA8AL}}; + int32_t l_3712 = (-1L); + uint8_t ***l_3713 = &l_3496; + int i, j; + for (g_2736 = 0; (g_2736 >= (-7)); --g_2736) + { /* block id: 1571 */ + uint32_t l_3687 = 18446744073709551606UL; + int32_t l_3694 = 5L; + int32_t l_3698 = 0x41C46D15L; + uint8_t ***l_3705 = &g_1949; + l_3687--; + (*g_2442) = (safe_rshift_func_uint16_t_u_u(1UL, (((***g_2102) != (~(l_3694 |= ((**g_2285) = (p_113 = l_3693[7][0]))))) == (safe_rshift_func_uint8_t_u_s(0xE7L, ((+((l_3698 == 0x77L) || ((*g_3102)++))) | (safe_add_func_int32_t_s_s(((safe_mod_func_uint8_t_u_u((l_3705 != (g_3714 = (((safe_lshift_func_int16_t_s_u(((safe_mod_func_int16_t_s_s(((!((**g_809) &= (safe_unary_minus_func_uint16_t_u(l_3693[6][2])))) && 0x886AL), l_3712)) ^ l_3693[1][2]), 9)) < 0x91F9L) , l_3713))), p_112)) , (*g_2442)), (**g_224))))))))); + } + } + for (g_2786 = 0; (g_2786 < 19); ++g_2786) + { /* block id: 1584 */ + return l_3717; + } + if (((0x99707A8FL > p_112) > (-4L))) + { /* block id: 1587 */ + uint32_t l_3734[2]; + uint16_t l_3737[2][7][3] = {{{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L}},{{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L},{0UL,0UL,0xCFF7L},{0UL,0UL,0xB609L}}}; + int16_t **l_3746 = &g_1119[1]; + int32_t l_3747 = 1L; + int i, j, k; + for (i = 0; i < 2; i++) + l_3734[i] = 0x40A74B28L; + l_3747 = ((((~(((safe_div_func_uint16_t_u_u(((safe_rshift_func_int8_t_s_u((**g_539), (&g_1117 != l_3723[3]))) , (safe_lshift_func_int16_t_s_s(((safe_div_func_uint16_t_u_u((((safe_mul_func_uint8_t_u_u((safe_rshift_func_int16_t_s_s((l_3734[1] > (safe_rshift_func_int16_t_s_s(((l_3737[1][1][1] = (-10L)) == 0x33136CF0L), p_112))), 4)), ((*l_1540) = (safe_rshift_func_uint16_t_u_s((((*g_2286) = (((safe_rshift_func_int16_t_s_u(p_113, (((safe_mul_func_uint16_t_u_u((safe_mul_func_int8_t_s_s((((((((***g_538) = (**g_539)) < l_3734[1]) , (int16_t**) NULL) == l_3746) == p_113) <= 0UL), l_3734[1])), 0x889AL)) != p_113) == p_113))) && l_3734[1]) != p_113)) <= l_3734[0]), 11))))) != p_113) < l_3734[1]), (*g_3466))) != p_112), 5))), 8L)) & p_113) , p_113)) != 0x20C4L) > p_113) | (***g_2102)); + } + else + { /* block id: 1593 */ + int32_t *l_3748[7][2][6] = {{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_641,NULL,&g_254,&g_46}},{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_641,NULL,&g_254,&g_46}},{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_641,NULL,&g_254,&g_46}},{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_641,NULL,&g_254,&g_46}},{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_641,NULL,&g_254,&g_46}},{{NULL,NULL,&g_641,NULL,NULL,&g_46},{&g_254,NULL,&g_254,&l_3623,&l_1546[2],NULL}},{{&g_46,&l_3623,NULL,&l_3623,&g_46,NULL},{&l_1546[2],&l_3623,&g_254,&l_3623,&l_1546[2],NULL}}}; + int16_t *l_3757 = &g_838[2][0]; + int32_t ** const l_3758 = &l_3748[4][1][0]; + int16_t *l_3759 = &g_300; + uint32_t l_3764 = 0xA00EBEA2L; + uint32_t l_3773 = 9UL; + uint32_t l_3784 = 2UL; + uint8_t **l_3828 = &g_1950; + int16_t l_3845 = 1L; + int i, j, k; + (**g_809) &= (*g_225); + (***g_2458) = ((*g_262) , l_3748[0][0][1]); + if (((&g_3622 != l_3749) >= (safe_sub_func_uint32_t_u_u((((((*l_3717) = (safe_sub_func_uint32_t_u_u(p_112, (((((*l_3759) |= (((***g_2102) &= (safe_mul_func_uint8_t_u_u((((*g_635) = (((*g_3102) &= (((*l_3757) = ((+p_113) >= (*g_3466))) > p_112)) ^ ((*g_2446) , ((((p_113 , (0xB622L > p_112)) , (*g_2459)) != l_3758) > p_112)))) && (*g_262)), 0xAEL))) <= p_112)) || 5L) && 0x971EA8C0L) & 255UL)))) & p_112) & l_3760) == p_112), (**g_2285))))) + { /* block id: 1602 */ + int16_t l_3761 = 0x811DL; + uint16_t ****l_3782 = &g_3622; + int32_t l_3783 = (-1L); + uint32_t l_3790 = 0x43FAB990L; + (**g_809) &= ((p_113 >= l_3761) , (safe_add_func_int16_t_s_s(l_3764, (-3L)))); + l_3783 ^= (((((((*g_635) = ((((((safe_rshift_func_uint8_t_u_u(p_113, 2)) == (((p_113 ^ (safe_add_func_int16_t_s_s((safe_sub_func_int8_t_s_s(l_3771, l_3772)), l_3773))) , (l_3761 == (((*g_3102) = (safe_lshift_func_uint8_t_u_u((p_112 ^ ((safe_sub_func_int16_t_s_s(((safe_div_func_uint8_t_u_u(p_113, (safe_sub_func_int16_t_s_s(6L, p_112)))) , 0x442CL), p_113)) != p_112)), 6))) == (*g_3466)))) || 0xBFL)) , (**g_2285)) < 1L) ^ (*g_3466)) & p_112)) && p_112) , p_113) , &g_3622) != l_3782) , 0x7D905045L); + (*l_3758) = &l_3783; + (*g_809) = (int32_t*) func_187((0x04L || 0xD2L), (((l_3784 && (!(safe_div_func_uint16_t_u_u((safe_lshift_func_uint16_t_u_s((p_113 || p_112), ((*l_3759) = ((((l_3790 = 0x9534L) , p_113) || ((l_3783 = ((safe_lshift_func_uint16_t_u_s((safe_lshift_func_int8_t_s_s((*g_635), (**g_539))), 9)) && (*g_3466))) , 1UL)) & l_3761)))), 1UL)))) , l_3790) > 7UL)); + } + else + { /* block id: 1612 */ + int8_t l_3804[10] = {0x9AL,0L,0x2BL,0L,0x9AL,0x9AL,0L,0x2BL,0L,0x9AL}; + int32_t l_3806 = (-1L); + int32_t l_3808[2]; + uint8_t l_3816 = 252UL; + uint16_t ** const ***l_3837[6][5] = {{&g_3835[0],&g_3835[1],&g_3835[0],&g_3835[2],&g_3835[0]},{&g_3835[0],&g_3835[2],&g_3835[0],&g_3835[2],&g_3835[0]},{&g_3835[0],&g_3835[2],&g_3835[0],&g_3835[1],&g_3835[0]},{&g_3835[0],&g_3835[1],&g_3835[0],&g_3835[2],&g_3835[0]},{&g_3835[0],&g_3835[2],&g_3835[0],&g_3835[2],&g_3835[0]},{&g_3835[0],&g_3835[2],&g_3835[0],&g_3835[1],&g_3835[0]}}; + uint32_t * const *l_3847 = NULL; + uint32_t * const **l_3846[10] = {&l_3847,NULL,&l_3847,NULL,&l_3847,&l_3847,NULL,&l_3847,NULL,&l_3847}; + uint32_t ***l_3848 = &g_3377; + int32_t l_3849 = 0L; + int8_t *l_3850 = &g_2768[3][2]; + int i, j; + for (i = 0; i < 2; i++) + l_3808[i] = 0x380D94AAL; + for (g_459 = (-6); (g_459 != 23); g_459++) + { /* block id: 1615 */ + uint16_t l_3810 = 0xDD87L; + for (g_2731 = 20; (g_2731 < 5); g_2731--) + { /* block id: 1618 */ + int16_t l_3802 = (-6L); + int32_t l_3805 = 0x1D1C9427L; + int32_t l_3809 = 0L; + for (g_2678 = 8; (g_2678 != (-10)); g_2678--) + { /* block id: 1621 */ + int32_t l_3801 = (-5L); + int32_t l_3803 = 0L; + int32_t l_3807 = (-9L); + ++l_3810; + l_3813++; + if (p_113) + break; + } + } + if (l_3816) + break; + } + l_3808[0] |= (safe_lshift_func_int8_t_s_u((((safe_sub_func_int32_t_s_s(2L, 0xAB57DEC6L)) & (safe_mul_func_int16_t_s_s(6L, (safe_rshift_func_int16_t_s_u(((0x80L | (safe_div_func_uint8_t_u_u(252UL, (-1L)))) != ((p_113 <= (((l_3806 || 0xE7873BB2L) < p_112) < 65535UL)) || 9UL)), 9))))) | 0xB6129EB9L), (***g_2102))); + (*g_2442) ^= (((+(((NULL == l_3828) || ((*l_3850) |= (l_3849 &= ((*l_1540) &= (((((*g_262) = (l_3806 = ((safe_div_func_int16_t_s_s((safe_div_func_uint16_t_u_u(((*g_3102)++), ((*l_3757) = ((1L ^ (*g_65)) & ((((l_3838[6] = g_3835[0]) != ((((*g_1950) & ((safe_lshift_func_int8_t_s_s((safe_div_func_int32_t_s_s(((safe_lshift_func_int16_t_s_s(p_112, ((*l_3759) = (1L && (l_3845 <= 0x8EL))))) | 0xF3L), l_3808[1])), (*g_635))) && 0UL)) | (*g_2286)) , (uint16_t****) NULL)) ^ p_112) < 0xA2A1A210L))))), p_112)) && p_113))) , l_3846[0]) == l_3848) | 0xFE23L))))) >= l_3808[0])) , (*g_1950)) || 0x9BL); + } + } + return l_3851; +} + + +/* ------------------------------------------ */ +/* + * reads : g_2775 g_2458 g_2459 g_2460 g_1859 g_2732 g_2670 g_2659 g_48 g_2115 g_622 g_2442 g_225 g_641 g_46 g_2285 g_2286 + * writes: g_2775 g_1859 g_2732 g_2670 g_621 g_2287 g_1103 g_2579 + */ +static int32_t func_122(uint8_t p_123, uint16_t * const p_124, int16_t p_125, uint32_t p_126, int32_t p_127) +{ /* block id: 1139 */ + uint32_t l_2850 = 0UL; + const int8_t **l_2856 = NULL; + int8_t **l_2857 = &g_262; + uint16_t ***l_2858 = &g_1103; + int32_t l_2859 = 0L; + uint32_t l_2861[5][6] = {{5UL,1UL,5UL,5UL,1UL,5UL},{5UL,1UL,5UL,5UL,1UL,5UL},{5UL,1UL,5UL,5UL,1UL,5UL},{5UL,1UL,5UL,5UL,1UL,5UL},{5UL,1UL,5UL,5UL,1UL,5UL}}; + int32_t l_2888 = 6L; + int32_t l_2890 = (-1L); + uint32_t l_2899 = 0x9524A28DL; + int32_t l_2918 = 0xF439E3F6L; + int32_t l_2919 = 0x926347CDL; + int8_t l_2990 = 0x84L; + int32_t l_3126 = 0x1DB01D12L; + int32_t l_3129 = (-1L); + int32_t l_3130 = (-1L); + int32_t l_3131[10][8][3] = {{{(-10L),(-3L),0L},{1L,1L,(-10L)},{(-1L),1L,1L},{(-1L),1L,(-10L)},{0xD04F4FF4L,4L,0L},{0x383A2FB1L,0x2A8E209FL,0xA34BC367L},{1L,0x5D9C04F6L,(-1L)},{(-1L),0x383A2FB1L,0x7FC6860DL}},{{(-8L),0x5D9C04F6L,(-8L)},{1L,0x2A8E209FL,1L},{0xDE1BDE27L,4L,(-1L)},{1L,1L,0x7FC6860DL},{7L,1L,(-8L)},{1L,1L,0xA34BC367L},{0xDE1BDE27L,(-3L),6L},{1L,1L,(-10L)}},{{(-8L),1L,0xD04F4FF4L},{(-1L),(-10L),(-10L)},{1L,4L,6L},{0x383A2FB1L,(-1L),0xA34BC367L},{0xD04F4FF4L,0x5D9C04F6L,(-8L)},{(-1L),0x7E7008B7L,0x7FC6860DL},{(-1L),0x5D9C04F6L,(-1L)},{1L,(-1L),1L}},{{(-10L),4L,(-8L)},{1L,(-10L),0x7FC6860DL},{1L,1L,(-1L)},{1L,1L,0xA34BC367L},{(-10L),(-3L),0L},{1L,1L,(-10L)},{(-1L),1L,1L},{(-1L),0x383A2FB1L,0x7E7008B7L}},{{0x4D709A09L,(-3L),(-8L)},{0L,(-10L),1L},{(-10L),0x1EC0A0ECL,1L},{1L,0L,0xA34BC367L},{7L,0x1EC0A0ECL,7L},{0x383A2FB1L,(-10L),0x3448D447L},{(-1L),(-3L),1L},{8L,0x383A2FB1L,0xA34BC367L}},{{0L,4L,0xD04F4FF4L},{8L,0x3448D447L,1L},{(-1L),0x12A5DED1L,(-1L)},{0x383A2FB1L,8L,0x7E7008B7L},{7L,4L,0x4D709A09L},{1L,0x7E7008B7L,0x7E7008B7L},{(-10L),(-3L),(-1L)},{0L,1L,1L}},{{0x4D709A09L,0x1EC0A0ECL,0xD04F4FF4L},{1L,0x7FC6860DL,0xA34BC367L},{1L,0x1EC0A0ECL,1L},{0x383A2FB1L,1L,0x3448D447L},{(-8L),(-3L),7L},{8L,0x7E7008B7L,0xA34BC367L},{6L,4L,1L},{8L,8L,1L}},{{(-8L),0x12A5DED1L,(-8L)},{0x383A2FB1L,0x3448D447L,0x7E7008B7L},{1L,4L,(-10L)},{1L,0x383A2FB1L,0x7E7008B7L},{0x4D709A09L,(-3L),(-8L)},{0L,(-10L),1L},{(-10L),0x1EC0A0ECL,1L},{1L,0L,0xA34BC367L}},{{7L,0x1EC0A0ECL,7L},{0x383A2FB1L,(-10L),0x3448D447L},{(-1L),(-3L),1L},{8L,0x383A2FB1L,0xA34BC367L},{0L,4L,0xD04F4FF4L},{8L,0x3448D447L,1L},{(-1L),0x12A5DED1L,(-1L)},{0x383A2FB1L,8L,0x7E7008B7L}},{{7L,4L,0x4D709A09L},{1L,0x7E7008B7L,0x7E7008B7L},{(-10L),(-3L),(-1L)},{0L,1L,1L},{0x4D709A09L,0x1EC0A0ECL,0xD04F4FF4L},{1L,0x7FC6860DL,0xA34BC367L},{1L,0x1EC0A0ECL,1L},{0x383A2FB1L,1L,0x3448D447L}}}; + int8_t ****l_3151 = &g_538; + int16_t ** const *l_3164 = &g_1118; + int16_t ** const **l_3163 = &l_3164; + const uint32_t l_3189 = 7UL; + uint16_t l_3210 = 0xE85DL; + uint32_t l_3222 = 0x799F58D1L; + const int16_t *l_3270 = &g_3271; + int32_t l_3283 = 1L; + int32_t ** const ** const **l_3314 = NULL; + int32_t ** const ** const ***l_3313[5]; + uint32_t l_3339[10] = {0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L,0x0A8BB978L}; + uint32_t ***l_3379 = &g_3377; + int32_t l_3427 = 4L; + uint8_t * const *l_3458 = &g_1950; + int i, j, k; + for (i = 0; i < 5; i++) + l_3313[i] = &l_3314; + for (g_2775 = 18; (g_2775 == 21); ++g_2775) + { /* block id: 1142 */ + uint32_t l_2844 = 0x33C6001BL; + int16_t ** const l_2849 = &g_1119[0]; + int16_t *l_2851 = &g_838[4][4]; + uint16_t l_2860 = 0UL; + int32_t l_2880 = 0x50E478B0L; + int32_t l_2906 = 0xF47733F4L; + int32_t *l_2966 = &l_2906; + int32_t *** const *l_3060 = &g_567; + const int32_t l_3078 = 0L; + uint32_t ** const *l_3096 = NULL; + int32_t l_3127 = (-1L); + int32_t l_3128[5]; + int i; + for (i = 0; i < 5; i++) + l_3128[i] = 0L; + (**g_2459) = (***g_2458); + if (l_2861[3][5]) + continue; + for (g_2732 = 0; (g_2732 <= 1); g_2732 += 1) + { /* block id: 1150 */ + int32_t **l_2883 = &g_810[3]; + int32_t l_2910 = 0x061E384FL; + int32_t l_2911 = 9L; + int32_t l_2912 = 0xC005C314L; + int32_t l_2913 = 0x701E65F4L; + int32_t l_2917 = 0L; + int32_t l_2920[8] = {0L,0L,0x9F4EE447L,0L,0L,0x9F4EE447L,0L,0L}; + int8_t ***l_2926 = &g_539; + int8_t ***l_2927 = &g_539; + int16_t * const *l_3040 = &g_1119[3]; + uint8_t ***l_3062 = &g_1949; + int8_t l_3122 = 0x59L; + int32_t l_3123 = (-7L); + int i, j; + l_2880 ^= (safe_mod_func_uint32_t_u_u((((g_2670[(g_2732 + 1)] || (safe_sub_func_uint32_t_u_u(4294967295UL, (((*g_2442) = (safe_mul_func_uint8_t_u_u((safe_sub_func_uint16_t_u_u(((g_2659[g_2732][g_2732] , (((safe_add_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_s((((0xCDL >= (g_2670[(g_2732 + 2)] = g_2659[g_2732][(g_2732 + 6)])) || (*p_124)) , (safe_mul_func_uint16_t_u_u((*g_2115), 9UL))), ((safe_unary_minus_func_uint16_t_u((((safe_mod_func_int16_t_s_s(((~(p_123 && (-6L))) && p_123), p_125)) <= p_125) | p_126))) < l_2860))), 0x0031L)) && 65532UL) > 0UL)) <= 0x2DL), p_127)), g_2659[g_2732][g_2732]))) , (*g_225))))) == p_127) <= l_2861[3][5]), 0xA2F9D2B5L)); + } + } + if ((safe_add_func_uint16_t_u_u((safe_lshift_func_int16_t_s_u(((safe_mod_func_int8_t_s_s(((p_125 | p_126) != (((safe_lshift_func_int16_t_s_s((l_2859 || 3L), ((safe_mod_func_uint16_t_u_u((safe_sub_func_uint16_t_u_u((0xB1E9L & (p_127 <= (l_2899 ^ p_123))), (((((**g_2285) = l_2859) , 1UL) >= 0xF1L) >= l_2990))), 0x0854L)) , p_127))) | l_2918) || 0x73L)), 0x11L)) ^ l_2859), (*p_124))), 1UL))) + { /* block id: 1271 */ + l_3130 = (safe_rshift_func_int16_t_s_s((&g_540 == (((7L ^ (l_3131[6][4][0] < p_126)) < 0x0EC221ADL) , l_3151)), 1)); + (*l_2858) = &g_2115; + } + else + { /* block id: 1274 */ + int32_t l_3160 = (-10L); + int16_t ***l_3162 = &g_1118; + int16_t ****l_3161 = &l_3162; + int8_t *l_3173 = &g_2655[7][3]; + uint8_t l_3174 = 0x3AL; + uint32_t l_3195 = 5UL; + uint8_t ****l_3221 = &g_2102; + const int32_t ******l_3279 = NULL; + uint32_t **l_3324 = NULL; + int32_t l_3337 = 0xDAB16DEDL; + uint16_t l_3396 = 65535UL; + uint32_t l_3404 = 4294967286UL; + const uint16_t *l_3447 = NULL; + const uint16_t **l_3446 = &l_3447; + const uint16_t ***l_3445 = &l_3446; + const uint16_t ****l_3448 = &l_3445; + for (g_2579 = 6; (g_2579 <= (-2)); g_2579--) + { /* block id: 1277 */ + (***g_2458) = &p_127; + } + } + return p_125; +} + + +/* ------------------------------------------ */ +/* + * reads : g_538 g_539 g_262 g_263 g_463 g_1679 g_1577 g_462 g_1950 g_450 + * writes: g_463 g_393 g_416 + */ +static uint8_t func_128(int32_t p_129, const int8_t p_130, int32_t p_131, int8_t p_132, int32_t ** p_133) +{ /* block id: 693 */ + int16_t l_1677 = 0xED90L; + uint8_t *l_1678 = &g_463; + int32_t l_1687[2]; + int8_t ** const *l_1698 = &g_539; + uint32_t *l_1706[7][9] = {{NULL,&g_393,&g_260[6][1][1],&g_260[4][4][1],&g_1679,&g_393,&g_1335,&g_1335,NULL},{&g_260[0][4][0],&g_260[6][1][1],&g_1679,&g_393,&g_260[5][0][0],NULL,&g_1679,&g_393,NULL},{&g_260[5][3][0],&g_393,&g_260[9][3][1],&g_1679,&g_1335,&g_260[9][3][1],&g_260[9][3][1],&g_1335,&g_1679},{NULL,&g_1335,NULL,&g_260[5][0][0],&g_260[9][3][1],NULL,&g_260[4][4][1],&g_1335,&g_260[6][1][1]},{&g_393,NULL,&g_260[9][3][1],&g_1335,&g_1679,&g_1679,&g_260[9][3][1],&g_393,&g_260[0][4][0]},{&g_393,NULL,&g_393,&g_260[5][0][0],&g_260[5][3][0],&g_1335,&g_1679,&g_1679,&g_1335},{&g_260[5][3][0],&g_260[9][3][1],&g_1335,&g_260[9][3][1],&g_260[5][3][0],&g_1679,&g_260[0][4][0],&g_260[9][3][1],NULL}}; + int32_t *l_1747 = NULL; + uint32_t l_1756 = 0UL; + int32_t l_1805 = 0xDBE20048L; + int8_t ***l_1811 = &g_539; + int16_t **l_1854 = NULL; + uint32_t l_1959 = 0x37BD8DF4L; + uint8_t l_2023 = 0xF2L; + uint32_t ***l_2074 = NULL; + uint8_t * const **l_2100 = NULL; + uint8_t * const ***l_2101 = &l_2100; + uint16_t *l_2111[6] = {&g_644,&g_644,&g_644,&g_644,&g_644,&g_644}; + uint16_t **l_2112 = &l_2111[5]; + uint16_t *l_2114[2][5][10] = {{{&g_644,&g_1961,&g_1844,&g_1961,&g_1961,&g_1844,&g_1961,&g_644,&g_48,&g_622[0]},{&g_644,&g_644,&g_1844,&g_644,&g_48,&g_1961,&g_48,NULL,NULL,&g_1961},{&g_48,&g_48,&g_1844,&g_48,&g_1961,NULL,&g_1961,&g_644,&g_644,&g_622[0]},{&g_48,&g_1844,&g_1844,&g_622[0],&g_1961,&g_1844,&g_405,&g_1961,&g_405,&g_1844},{&g_644,&g_1844,NULL,&g_1844,&g_644,&g_48,&g_622[0],&g_622[0],&g_644,&g_1961}},{{&g_622[0],&g_644,&g_644,&g_644,NULL,&g_1961,&g_644,&g_405,&g_1961,&g_1961},{&g_405,&g_644,&g_1961,&g_405,&g_644,&g_48,NULL,&g_622[0],&g_405,&g_1844},{&g_1961,&g_622[0],&g_622[0],&g_1961,&g_1961,&g_644,&g_644,&g_1961,&g_1961,&g_622[0]},{&g_1844,&g_1844,&g_622[0],NULL,&g_1961,&g_405,&g_644,&g_644,&g_644,&g_1961},{&g_644,&g_48,&g_405,&g_405,&g_48,&g_644,&g_644,NULL,&g_622[0],&g_622[0]}}}; + uint16_t **l_2113 = &l_2114[1][0][3]; + int16_t *l_2195[3]; + uint32_t l_2232 = 2UL; + int32_t l_2288 = 1L; + int8_t l_2334 = (-1L); + uint32_t l_2400 = 0x3A3F7F4FL; + int8_t * const *l_2495[7]; + int32_t l_2504 = 1L; + uint8_t l_2510 = 0UL; + int32_t **** const *l_2522 = &g_1352; + int32_t **** const **l_2521 = &l_2522; + int32_t l_2538[6] = {0x02D52FDEL,0x02D52FDEL,0x02D52FDEL,0x02D52FDEL,0x02D52FDEL,0x02D52FDEL}; + int32_t l_2541 = (-3L); + const uint16_t ** const l_2836 = NULL; + uint32_t l_2838 = 0x9C03FCF0L; + uint32_t l_2840 = 0UL; + int i, j, k; + for (i = 0; i < 2; i++) + l_1687[i] = 0x48A44953L; + for (i = 0; i < 3; i++) + l_2195[i] = &g_209; + for (i = 0; i < 7; i++) + l_2495[i] = &g_635; + if ((safe_lshift_func_uint8_t_u_s(p_129, (safe_mod_func_uint32_t_u_u(((((((safe_rshift_func_uint16_t_u_s(((l_1677 ^ (((*l_1678) ^= ((l_1677 | (***g_538)) > 0xAFFCL)) | l_1677)) , g_1679), 15)) && (p_129 | g_1577[6][1][1])) , 0x494AL) && l_1677) <= l_1677) < 249UL), 0x1659965EL))))) + { /* block id: 695 */ + return l_1677; + } + else + { /* block id: 697 */ + uint8_t *l_1686 = &g_466; + int32_t l_1688 = 7L; + uint32_t *l_1691 = NULL; + uint32_t *l_1693 = &g_260[9][5][0]; + uint16_t *l_1729 = &g_48; + int8_t *l_1746[4][6][10] = {{{&g_462,&g_36,&g_36,NULL,NULL,&g_462,&g_36,&g_462,NULL,NULL},{&g_263,&g_263,&g_263,&g_282,&g_282,&g_36,&g_462,NULL,&g_36,&g_462},{&g_36,&g_462,&g_462,&g_263,&g_36,NULL,&g_282,NULL,NULL,&g_282},{&g_282,NULL,&g_263,&g_36,&g_36,&g_263,&g_263,&g_462,&g_462,NULL},{NULL,&g_282,NULL,&g_462,&g_36,&g_36,&g_462,NULL,&g_36,&g_263},{&g_36,&g_36,&g_282,&g_282,&g_462,NULL,&g_263,NULL,&g_263,NULL}},{{&g_263,&g_36,&g_36,&g_36,&g_462,&g_462,NULL,&g_282,&g_282,&g_263},{&g_462,&g_263,&g_263,&g_462,&g_36,&g_36,&g_263,&g_263,NULL,&g_263},{&g_282,&g_282,&g_462,&g_36,&g_462,&g_282,&g_282,&g_36,&g_462,&g_462},{NULL,&g_282,NULL,&g_263,&g_263,&g_263,NULL,&g_263,&g_462,&g_36},{&g_36,&g_282,&g_462,&g_36,&g_36,&g_282,&g_282,&g_462,NULL,NULL},{&g_36,&g_282,&g_263,&g_36,&g_462,&g_263,&g_263,&g_263,&g_263,&g_462}},{{&g_282,&g_263,&g_263,&g_282,&g_462,&g_263,NULL,&g_263,NULL,&g_462},{&g_282,&g_36,NULL,&g_263,NULL,&g_462,&g_263,NULL,NULL,&g_263},{&g_36,&g_36,&g_462,&g_282,&g_263,&g_462,&g_462,&g_263,&g_263,NULL},{NULL,&g_36,NULL,&g_36,&g_282,&g_263,&g_282,&g_36,NULL,&g_36},{&g_263,&g_263,&g_282,&g_36,&g_282,NULL,&g_282,&g_462,&g_462,&g_263},{NULL,&g_36,&g_36,&g_263,&g_263,NULL,&g_36,&g_36,&g_462,&g_282}},{{&g_263,&g_282,&g_263,&g_36,&g_36,&g_263,&g_263,&g_282,NULL,NULL},{NULL,&g_462,&g_462,&g_462,&g_462,&g_462,&g_462,NULL,&g_282,&g_462},{&g_36,NULL,&g_263,&g_36,&g_282,&g_462,&g_282,&g_263,&g_263,&g_462},{&g_282,NULL,&g_263,&g_282,&g_282,&g_263,&g_263,NULL,&g_36,NULL},{&g_282,&g_263,&g_462,&g_462,&g_263,&g_263,NULL,&g_282,NULL,&g_263},{&g_36,&g_263,&g_263,NULL,&g_263,&g_462,&g_263,&g_282,&g_282,NULL}}}; + int32_t l_1806[9] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; + const int32_t *l_1822 = &l_1688; + const int32_t **l_1821 = &l_1822; + const int32_t ***l_1820 = &l_1821; + const int32_t ****l_1819 = &l_1820; + int8_t ****l_1851[5] = {&g_538,&g_538,&g_538,&g_538,&g_538}; + int8_t l_1888 = (-1L); + uint8_t l_1912 = 0xCBL; + uint32_t l_1915 = 0x6F8F7167L; + uint8_t l_1992 = 1UL; + int32_t l_2011 = 0x2805DE16L; + uint8_t l_2038 = 2UL; + int i, j, k; + for (g_393 = 1; (g_393 == 4); g_393 = safe_add_func_uint16_t_u_u(g_393, 9)) + { /* block id: 700 */ + uint8_t *l_1684 = &g_466; + uint8_t **l_1685[4] = {&l_1678,&l_1678,&l_1678,&l_1678}; + uint32_t **l_1692[9] = {&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0],&g_284[8][0]}; + int32_t l_1699 = (-1L); + int i; + l_1688 = (safe_sub_func_int16_t_s_s((p_131 , p_131), (l_1687[1] = (l_1684 != (l_1686 = l_1684))))); + l_1687[0] = ((~((p_130 < (safe_unary_minus_func_int32_t_s((l_1677 | ((l_1691 = l_1691) == (l_1693 = NULL)))))) >= (((safe_mul_func_int16_t_s_s(0x9BCCL, ((safe_lshift_func_uint8_t_u_u((l_1698 == &g_539), 4)) > ((l_1699 & (safe_div_func_int16_t_s_s(l_1688, l_1699))) && 0UL)))) >= g_462) > l_1699))) <= 0xB3L); + } + l_1687[0] = (safe_sub_func_int32_t_s_s(p_130, 4294967286UL)); + for (g_416 = 0; (g_416 < 41); ++g_416) + { /* block id: 711 */ + int32_t l_1710[10][1][5] = {{{0xE7E438BDL,0xE7E438BDL,0xD1397609L,0xE7E438BDL,0xE7E438BDL}},{{0x69C7049AL,0x96AD28F5L,0x69C7049AL,0x69C7049AL,0x96AD28F5L}},{{0xE7E438BDL,0x18136ED2L,0x18136ED2L,0xE7E438BDL,0x18136ED2L}},{{0x96AD28F5L,0x96AD28F5L,0x6075A271L,0x96AD28F5L,0x96AD28F5L}},{{0x18136ED2L,0xE7E438BDL,0x18136ED2L,0x18136ED2L,0xE7E438BDL}},{{0x96AD28F5L,0x69C7049AL,0x69C7049AL,0x96AD28F5L,0x69C7049AL}},{{0xE7E438BDL,0xE7E438BDL,0xD1397609L,0xE7E438BDL,0xE7E438BDL}},{{0x69C7049AL,0x96AD28F5L,0x69C7049AL,0x69C7049AL,0x96AD28F5L}},{{0xE7E438BDL,0x18136ED2L,0x18136ED2L,0xE7E438BDL,0x18136ED2L}},{{0x96AD28F5L,0x96AD28F5L,0x6075A271L,0x96AD28F5L,0x96AD28F5L}}}; + uint8_t *l_1745 = NULL; + int32_t l_1782[2][2] = {{0x865D5707L,0x865D5707L},{0x865D5707L,0x865D5707L}}; + int32_t **l_1845[1][10][9] = {{{&g_45,NULL,NULL,&l_1747,&g_45,NULL,&g_45,&l_1747,NULL},{&l_1747,&g_225,&g_810[2],NULL,&g_810[2],&g_225,&g_225,&g_810[2],NULL},{&g_810[4],NULL,&g_810[4],NULL,&g_45,&g_810[0],NULL,&g_810[0],&g_45},{&g_45,&g_810[2],&g_810[2],NULL,&g_810[0],&g_45,&g_810[2],&g_810[2],&g_45},{&g_810[0],NULL,NULL,NULL,&g_810[0],&g_45,&g_45,&l_1747,&g_45},{&g_810[2],&g_810[0],&g_45,NULL,&g_810[0],&g_810[2],&g_810[0],NULL,NULL},{&g_810[5],&g_45,&g_45,&l_1747,&g_45,&g_45,&g_810[5],NULL,&g_810[3]},{&g_45,&g_810[0],NULL,&g_810[2],&g_810[2],&g_45,&g_810[0],NULL,&g_810[2]},{&g_810[0],NULL,&g_45,&g_810[0],&g_45,&g_810[0],&g_45,NULL,&g_810[0]},{&l_1747,&g_810[2],&g_45,&g_810[2],&l_1747,&g_225,&g_810[2],NULL,&g_810[2]}}}; + uint32_t l_1855 = 18446744073709551615UL; + uint16_t l_1867[2][9] = {{0x7F26L,65529UL,0UL,65529UL,0x7F26L,0UL,65535UL,65535UL,0UL},{0x7F26L,65529UL,0UL,0UL,0xF60FL,65535UL,65535UL,65535UL,65535UL}}; + uint16_t l_1900[5] = {0xE13CL,0xE13CL,0xE13CL,0xE13CL,0xE13CL}; + uint16_t l_1918 = 65535UL; + int32_t l_1980 = (-5L); + int8_t l_1985 = 0xE1L; + int32_t l_1986[10] = {0L,(-1L),0L,0L,(-1L),0L,0L,(-1L),0L,0L}; + uint32_t l_2006 = 0x91CE7599L; + int i, j, k; + } + } + return (*g_1950); +} + + +/* ------------------------------------------ */ +/* + * reads : g_538 g_539 g_262 g_263 + * writes: + */ +static int8_t func_134(uint32_t p_135, int32_t p_136) +{ /* block id: 690 */ + int32_t *l_1666[10]; + uint32_t l_1667 = 0x2B32AE45L; + int i; + for (i = 0; i < 10; i++) + l_1666[i] = &g_621; + ++l_1667; + return (***g_538); +} + + +/* ------------------------------------------ */ +/* + * reads : g_1665 + * writes: + */ +static uint32_t func_137(int32_t p_138, int8_t p_139, int16_t p_140, uint16_t * p_141) +{ /* block id: 687 */ + int8_t l_1650 = 0x45L; + int32_t *l_1651 = &g_642; + int32_t *l_1652 = &g_642; + int32_t l_1653[6]; + int32_t *l_1654 = &g_621; + int32_t *l_1655 = NULL; + int32_t *l_1656 = NULL; + int32_t *l_1657 = &l_1653[1]; + int32_t *l_1658 = &l_1653[2]; + int32_t *l_1659[7][7] = {{&g_254,&g_254,&g_254,&g_254,&g_254,&g_254,&g_254},{&g_621,NULL,&g_621,NULL,&g_621,NULL,&g_621},{&g_254,&g_254,&g_254,&g_254,&g_254,&g_254,&g_254},{&g_621,NULL,&g_621,NULL,&g_621,NULL,&g_621},{&g_254,&g_254,&g_254,&g_254,&g_254,&g_254,&g_254},{&g_621,NULL,&g_621,NULL,&g_621,NULL,&g_621},{&g_254,&g_254,&g_254,&g_254,&g_254,&g_254,&g_254}}; + int32_t l_1660 = 0L; + int32_t l_1661[6] = {(-9L),(-9L),(-9L),(-9L),(-9L),(-9L)}; + uint32_t l_1662[4][10] = {{0x5A45017FL,4294967294UL,0x5A45017FL,0x0E501CF0L,0x5A45017FL,4294967294UL,0x5A45017FL,0x0E501CF0L,0x5A45017FL,4294967294UL},{4294967289UL,0x0E501CF0L,4294967288UL,0x0E501CF0L,4294967289UL,0x0E501CF0L,4294967288UL,0x0E501CF0L,4294967289UL,0x0E501CF0L},{0x5A45017FL,0x0E501CF0L,0x5A45017FL,4294967294UL,0x5A45017FL,0x0E501CF0L,0x5A45017FL,4294967294UL,0x5A45017FL,0x0E501CF0L},{4294967289UL,4294967294UL,4294967288UL,4294967294UL,4294967289UL,4294967294UL,4294967288UL,4294967294UL,4294967289UL,4294967294UL}}; + int i, j; + for (i = 0; i < 6; i++) + l_1653[i] = 0L; + l_1662[0][7]++; + return g_1665; +} + + +/* ------------------------------------------ */ +/* + * reads : g_48 g_405 g_622 g_282 g_921 g_838 g_1577 g_463 g_45 g_641 g_46 g_1335 g_635 g_462 g_539 g_262 g_263 g_65 g_621 g_224 g_225 g_447 + * writes: g_405 g_622 g_838 g_1335 g_450 g_460 g_45 + */ +static const uint16_t func_143(uint16_t * p_144, int32_t ** p_145, int8_t * p_146, int8_t p_147, uint32_t p_148) +{ /* block id: 645 */ + uint32_t l_1547[5]; + uint16_t *l_1555 = &g_405; + int32_t l_1559[6][8][1] = {{{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L}},{{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL}},{{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L}},{{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L}},{{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL}},{{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L},{0x82512BFAL},{0xE0989908L},{0xE0989908L}}}; + uint16_t *l_1562 = NULL; + uint16_t *l_1563 = &g_622[0]; + int16_t *l_1576 = &g_838[4][4]; + int32_t l_1593 = 0x875D55F5L; + int32_t l_1600 = 0L; + int16_t l_1603 = 0x7FCAL; + int8_t *l_1604 = &g_462; + int i, j, k; + for (i = 0; i < 5; i++) + l_1547[i] = 0x341E1F62L; + if ((l_1547[3] & (~((safe_mul_func_int16_t_s_s((((safe_add_func_uint8_t_u_u(((safe_lshift_func_int16_t_s_u(l_1547[3], 11)) == (l_1547[0] <= (((*l_1555) = (*p_144)) , (!((safe_add_func_int16_t_s_s(((l_1559[0][6][0] &= l_1547[2]) >= (((*l_1555)--) >= (((--(*l_1563)) , (((*l_1576) ^= ((safe_mul_func_uint16_t_u_u((safe_div_func_uint8_t_u_u(0x90L, (((safe_rshift_func_int16_t_s_s(0x9D25L, 11)) & (p_147 >= (safe_rshift_func_uint16_t_u_u(((safe_add_func_uint8_t_u_u(g_282, (*p_146))) && l_1547[0]), (*p_144))))) , g_921[0]))), l_1547[3])) > 1L)) == l_1547[0])) | p_147))), 0x67DFL)) > l_1547[3]))))), l_1547[3])) , l_1559[0][6][0]) == g_1577[2][5][3]), l_1547[3])) <= 5UL)))) + { /* block id: 651 */ + return g_463; + } + else + { /* block id: 653 */ + const uint16_t l_1602 = 0x0BD5L; + int16_t **l_1621[3]; + int i; + for (i = 0; i < 3; i++) + l_1621[i] = &g_1119[0]; + if ((**p_145)) + { /* block id: 654 */ + int8_t *l_1582 = &g_36; + uint32_t *l_1594 = &g_1335; + int32_t l_1601[7]; + uint16_t *l_1618[10] = {&g_405,&g_644,&g_48,&g_644,&g_405,&g_405,&g_644,&g_48,&g_644,&g_405}; + int16_t **l_1620 = &g_1119[0]; + int32_t l_1648 = 0xA8F35809L; + int i; + for (i = 0; i < 7; i++) + l_1601[i] = (-1L); + if ((safe_rshift_func_uint16_t_u_u(((safe_add_func_uint16_t_u_u((l_1582 != ((g_450 = (safe_add_func_uint8_t_u_u(((l_1603 = ((((safe_add_func_uint32_t_u_u(((((safe_rshift_func_uint16_t_u_s((*p_144), (l_1559[0][6][0] ^ (safe_mul_func_int16_t_s_s(p_148, (((((NULL == p_145) , ((((**p_145) != 4294967295UL) > (safe_add_func_uint8_t_u_u(((++(*l_1594)) == ((safe_unary_minus_func_uint8_t_u(((l_1600 |= (((safe_lshift_func_uint8_t_u_s(0xDCL, (*g_635))) >= 0xC5826FFDL) >= 250UL)) > (*p_144)))) < (**g_539))), g_622[0]))) | l_1559[1][3][0])) , l_1601[4]) && l_1602) == p_148)))))) , 0x68EBC9DBL) , 0xC7L) < (*p_146)), 0xE5288FC1L)) & (*g_65)) , (-10L)) , p_147)) ^ p_148), l_1602))) , l_1604)), l_1602)) && l_1601[4]), 7))) + { /* block id: 659 */ + int32_t *l_1613 = &g_460[3]; + uint16_t **l_1619 = &l_1555; + int32_t l_1622[2]; + uint16_t l_1623 = 0xD9BBL; + int8_t l_1624 = (-1L); + int i; + for (i = 0; i < 2; i++) + l_1622[i] = 0xD4A647F9L; + l_1593 ^= (((l_1622[0] = (safe_div_func_uint8_t_u_u((0xB729F183L || (((*l_1563) = (safe_add_func_uint16_t_u_u((safe_mod_func_int16_t_s_s(((((*l_1613) = (l_1601[2] > 2L)) , (((((((safe_sub_func_uint8_t_u_u((safe_lshift_func_int16_t_s_s(l_1559[1][0][0], ((*l_1576) &= (-7L)))), ((((((*l_1594) ^= (0xC8L && (((*l_1619) = l_1618[4]) != p_144))) >= l_1601[3]) , l_1620) != l_1621[1]) < l_1622[0]))) == l_1623) != (*g_65)) <= 1UL) >= l_1622[0]) , 0xBC5E6139L) && l_1624)) ^ (-1L)), 0x0F17L)), g_621))) == p_147)), 0x97L))) || 65527UL) , (**p_145)); + } + else + { /* block id: 667 */ + int32_t *l_1634 = &g_643[6]; + int32_t l_1643 = 1L; + const int32_t l_1644 = 0xB57F3039L; + l_1593 ^= ((safe_div_func_int16_t_s_s(((((*p_144) && (+(safe_mul_func_uint16_t_u_u((2L != ((safe_lshift_func_int16_t_s_s(((safe_add_func_int8_t_s_s(((l_1594 == (uint32_t*) l_1634) & (safe_sub_func_int8_t_s_s((((safe_mul_func_int8_t_s_s((safe_mod_func_uint16_t_u_u(((&g_1217 != NULL) <= (((l_1643 = (0x62L || (l_1602 && (safe_lshift_func_int8_t_s_s((0x34A0716BL > 0xE2B80B0EL), 5))))) || 9L) < p_147)), p_148)), 0x86L)) , p_148) , 1L), 0x96L))), (-8L))) != l_1644), 15)) ^ p_147)), l_1601[4])))) , (-9L)) >= p_148), 0xFEAEL)) <= 0x667B55EDL); + for (l_1603 = 0; (l_1603 <= 2); l_1603 += 1) + { /* block id: 672 */ + uint32_t l_1645 = 0x84A1A74EL; + for (l_1593 = 0; (l_1593 <= 0); l_1593 += 1) + { /* block id: 675 */ + l_1645 = (-4L); + } + } + (*p_145) = (*p_145); + l_1648 |= (safe_lshift_func_uint16_t_u_u(l_1601[3], 1)); + } + } + else + { /* block id: 682 */ + (*p_145) = (*g_224); + } + } + return g_447; +} + + +/* ------------------------------------------ */ +/* + * reads : g_405 + * writes: g_405 + */ +static int32_t ** func_150(int32_t ** const p_151, uint32_t p_152, uint16_t p_153, int8_t * p_154) +{ /* block id: 641 */ + uint16_t *l_1541[1]; + int32_t l_1544 = 0xAD6399A3L; + int32_t **l_1545 = &g_45; + int i; + for (i = 0; i < 1; i++) + l_1541[i] = &g_644; + l_1544 = (1L >= (g_405++)); + return l_1545; +} + + +/* ------------------------------------------ */ +/* + * reads : g_254 g_641 g_224 g_809 g_45 g_46 g_592 g_921 g_642 g_255 g_643 g_48 g_765 g_539 g_262 g_263 g_282 g_260 g_206 g_36 g_283 g_209 g_225 g_438 g_582 g_540 g_459 g_538 g_1335 g_621 g_65 g_620 g_462 g_447 g_405 g_463 g_466 g_622 g_635 g_1117 g_1118 g_644 + * writes: g_254 g_641 g_765 g_643 g_644 g_255 g_463 g_45 g_225 g_592 g_810 g_393 g_921 g_642 g_450 g_622 g_405 g_263 g_282 g_582 g_206 g_36 g_1352 g_1335 g_260 g_620 g_462 + */ +static int32_t func_155(int32_t * p_156) +{ /* block id: 471 */ + int16_t l_1221 = 0xFF83L; + int32_t l_1233 = 0L; + int32_t l_1244 = 0xAEEE4535L; + int32_t l_1247 = 2L; + int32_t l_1249 = (-10L); + int32_t l_1253[7][8] = {{0x473F3F52L,0x473F3F52L,0x1E7ECF7CL,0x473F3F52L,0x473F3F52L,0x1E7ECF7CL,0x473F3F52L,0x473F3F52L},{0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L,0x473F3F52L},{0x473F3F52L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL},{0x75316F55L,0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L},{0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L},{0x75316F55L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL,0x1E7ECF7CL,0x75316F55L,0x1E7ECF7CL},{0x75316F55L,0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L,0x473F3F52L,0x75316F55L,0x75316F55L}}; + uint32_t l_1276 = 0xC372F178L; + uint16_t l_1283[3]; + int16_t * const *l_1299[7]; + int16_t * const **l_1298 = &l_1299[1]; + uint32_t * const l_1334 = &g_1335; + uint32_t * const *l_1333 = &l_1334; + uint8_t l_1345 = 253UL; + int32_t **l_1359 = &g_225; + int32_t *** const * const l_1373 = &g_567; + uint32_t l_1434 = 0xD360A5A7L; + uint32_t l_1484 = 0UL; + int i, j; + for (i = 0; i < 3; i++) + l_1283[i] = 3UL; + for (i = 0; i < 7; i++) + l_1299[i] = &g_1119[3]; + (*p_156) ^= (((l_1221 | l_1221) ^ l_1221) & l_1221); +lbl_1527: + for (g_765 = 0; g_765 < 7; g_765 += 1) + { + g_643[g_765] = 8L; + } + for (g_644 = 0; (g_644 > 2); g_644 = safe_add_func_uint8_t_u_u(g_644, 8)) + { /* block id: 476 */ + int16_t l_1242 = 0x0F31L; + int32_t l_1245[4][10] = {{0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L,0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L},{0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L,0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L},{0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L,0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L},{0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L,0x577A8AB1L,(-1L),(-1L),0x577A8AB1L,8L}}; + uint16_t l_1284 = 6UL; + int8_t *l_1295 = &g_36; + int8_t ****l_1329 = &g_540; + uint32_t * const *l_1331 = &g_284[1][2]; + uint8_t l_1336[7][8][4] = {{{0xE0L,0xB7L,255UL,0x84L},{0x94L,1UL,0xADL,0x63L},{0xAAL,0xEDL,255UL,255UL},{0xB7L,6UL,252UL,255UL},{0x90L,0xD7L,0x3BL,1UL},{0x1EL,0UL,0x7DL,0xCBL},{255UL,0xD0L,1UL,1UL},{253UL,9UL,0x86L,255UL}},{{253UL,0x86L,0xE0L,1UL},{1UL,0UL,0x95L,0UL},{255UL,248UL,255UL,0UL},{0UL,0x5DL,2UL,0x95L},{0x42L,7UL,247UL,0x5DL},{0x42L,3UL,247UL,0xD7L},{0x42L,0x6CL,2UL,0xEDL},{0UL,250UL,255UL,4UL}},{{255UL,4UL,0x95L,0x1EL},{1UL,0xF7L,0xE0L,253UL},{253UL,0x06L,0x86L,0x6EL},{253UL,255UL,1UL,0x7DL},{255UL,0x62L,0x7DL,0x31L},{0x1EL,255UL,0x3BL,255UL},{0x90L,0xE0L,252UL,1UL},{0xB7L,0xD4L,255UL,0xD0L}},{{0xAAL,0x1EL,0xADL,255UL},{0x94L,1UL,255UL,6UL},{0xE0L,255UL,1UL,252UL},{0x5DL,0xA0L,0x63L,0x6CL},{0UL,0xB9L,0xB9L,0UL},{8UL,255UL,0x84L,0x42L},{1UL,0xD7L,0x95L,0x94L},{6UL,255UL,1UL,0x94L}},{{0x63L,0xD7L,1UL,0x42L},{0x86L,255UL,0xD0L,0UL},{0x42L,0xB9L,253UL,0x6EL},{254UL,255UL,6UL,248UL},{1UL,0x06L,255UL,0xFCL},{0x62L,255UL,255UL,255UL},{1UL,0xADL,0x63L,0x84L},{255UL,0UL,1UL,0UL}},{{0UL,4UL,0xB7L,0x95L},{250UL,255UL,0x6EL,8UL},{253UL,0UL,1UL,0x3EL},{0xB9L,7UL,0UL,0x90L},{0x6EL,253UL,254UL,0UL},{0x42L,0x62L,8UL,0xADL},{0xF7L,253UL,0xFCL,253UL},{0x7DL,0x5DL,0xE0L,1UL}},{{0UL,0x6EL,252UL,0x6CL},{0xEDL,1UL,253UL,0xAAL},{0xEDL,255UL,252UL,255UL},{0UL,0xAAL,0xE0L,0xEDL},{0x7DL,1UL,0xFCL,0xB9L},{0xF7L,0x7DL,8UL,0xCBL},{0x42L,0xA0L,254UL,1UL},{0x6EL,2UL,0UL,0xD7L}}}; + int32_t ****l_1350 = &g_567; + int8_t l_1360 = 0x92L; + uint8_t *l_1472 = &l_1345; + uint8_t **l_1471 = &l_1472; + uint32_t l_1479 = 0UL; + int32_t l_1504[4] = {0x2D5846A3L,0x2D5846A3L,0x2D5846A3L,0x2D5846A3L}; + int16_t l_1506[5]; + uint16_t l_1508 = 4UL; + int i, j, k; + for (i = 0; i < 5; i++) + l_1506[i] = (-5L); + for (g_255 = 1; (g_255 <= 6); g_255 += 1) + { /* block id: 479 */ + int32_t *l_1224 = &g_641; + int32_t l_1227 = 1L; + int32_t l_1239 = 0xEF79A0DEL; + int32_t l_1241 = 0L; + int32_t l_1246 = (-1L); + int16_t l_1250 = 0xFBE9L; + int32_t l_1254 = 0xEBEF4182L; + int32_t l_1255 = 0x3EE980E1L; + int32_t l_1256 = 0xF4FF95C0L; + int32_t l_1257 = 0xC1AFF195L; + uint32_t l_1258[5]; + uint32_t l_1279 = 0x35373F25L; + uint16_t *l_1280[5][2] = {{&g_622[0],&g_622[0]},{&g_622[0],&g_622[0]},{&g_622[0],&g_622[0]},{&g_622[0],&g_622[0]},{&g_622[0],&g_622[0]}}; + int8_t *l_1304 = NULL; + int32_t ****l_1353 = &g_567; + int i, j; + for (i = 0; i < 5; i++) + l_1258[i] = 0xBAB4F137L; + for (g_463 = 1; (g_463 <= 6); g_463 += 1) + { /* block id: 482 */ + int8_t l_1234 = 1L; + int32_t l_1243 = 0xA6BB9479L; + int32_t l_1248 = 1L; + int32_t l_1252 = (-6L); + (*g_224) = l_1224; + for (l_1221 = 6; (l_1221 >= 0); l_1221 -= 1) + { /* block id: 486 */ + int32_t *l_1225 = &g_641; + int32_t l_1251[10] = {0x6F49165AL,0xD4031358L,0xD4031358L,0x6F49165AL,0xD4031358L,0xD4031358L,0x6F49165AL,0xD4031358L,0xD4031358L,0x6F49165AL}; + int i; + for (g_592 = 0; (g_592 <= 5); g_592 += 1) + { /* block id: 489 */ + int i; + (*g_809) = (l_1225 = NULL); + if ((*g_45)) + break; + } + for (g_393 = 0; (g_393 <= 6); g_393 += 1) + { /* block id: 496 */ + uint32_t l_1226 = 1UL; + uint8_t *l_1230 = NULL; + uint8_t *l_1231[4] = {&g_466,&g_466,&g_466,&g_466}; + int32_t *l_1232 = &g_642; + int i; + if (l_1226) + break; + p_156 = ((l_1227 != ((safe_add_func_uint8_t_u_u((g_921[2] |= g_592), 2UL)) <= (*l_1224))) , l_1232); + (*l_1224) = (NULL != &g_808[5]); + } + for (g_592 = 2; (g_592 <= 6); g_592 += 1) + { /* block id: 504 */ + int32_t *l_1235 = &g_642; + int32_t *l_1236 = &g_642; + int32_t *l_1237 = &l_1233; + int32_t *l_1238 = &g_642; + int32_t *l_1240[9][8] = {{&g_642,&g_642,&l_1233,&g_641,&g_46,&l_1233,&g_46,&g_641},{&l_1233,&g_641,&l_1233,NULL,&g_641,&l_1239,&l_1239,&g_641},{&g_641,&l_1239,&l_1239,&g_641,NULL,&l_1233,&g_641,&l_1233},{&g_641,&g_46,&l_1233,&g_46,&g_641,&l_1233,&g_642,&g_642},{&l_1233,&g_46,NULL,NULL,&g_46,&l_1233,&l_1239,&g_46},{&g_642,&l_1239,NULL,&g_642,NULL,&l_1239,&g_642,&l_1233},{&g_46,&g_641,&g_642,&l_1233,&l_1233,&g_642,&l_1239,NULL},{NULL,&l_1233,&l_1233,&g_641,&l_1233,&g_641,&l_1233,&l_1233},{NULL,&l_1233,NULL,NULL,&g_641,&g_641,NULL,NULL}}; + int i, j; + l_1258[4]++; + (*l_1224) ^= 1L; + (*l_1236) = (*p_156); + } + } + } + l_1284 ^= ((((g_450 = (*l_1224)) == ((safe_lshift_func_int8_t_s_s((((*l_1224) ^ (*l_1224)) >= (safe_unary_minus_func_uint8_t_u((safe_rshift_func_int16_t_s_s((((((**g_539) = ((((((g_405 = (safe_add_func_uint8_t_u_u((l_1245[1][1] , (((safe_mod_func_uint16_t_u_u((safe_mod_func_uint32_t_u_u((safe_rshift_func_uint16_t_u_u(((((l_1253[6][7] ^= (safe_div_func_uint16_t_u_u(l_1276, l_1242))) & (safe_add_func_uint16_t_u_u(((l_1245[1][5] = (g_643[g_255] |= l_1242)) , (((g_622[0] = l_1279) , (safe_sub_func_uint8_t_u_u((NULL != l_1280[1][0]), g_48))) ^ 65535UL)), g_765))) , (-1L)) <= 0x7524L), g_255)), (*p_156))), (*l_1224))) || l_1245[1][5]) || 1L)), 8L))) , &g_447) != NULL) <= (*l_1224)) != (*p_156)) , (**g_539))) && l_1242) < 0x3DL) <= 0xAAL), l_1283[0]))))), l_1242)) && (*l_1224))) && l_1245[3][1]) >= 1L); + if ((*p_156)) + continue; + (*g_809) = &l_1253[0][6]; + for (g_282 = 1; (g_282 >= 0); g_282 -= 1) + { /* block id: 523 */ + int8_t ****l_1328 = &g_540; + int32_t *l_1338 = &l_1246; + int32_t *l_1339 = &l_1239; + int32_t *l_1340 = NULL; + int32_t *l_1341 = &l_1246; + int32_t *l_1342 = &l_1257; + int32_t *l_1343 = &g_621; + int32_t *l_1344[9][10][1] = {{{NULL},{&l_1249},{NULL},{NULL},{&l_1233},{&g_641},{&l_1255},{&l_1255},{&g_641},{&l_1233}},{{NULL},{NULL},{&l_1249},{NULL},{&l_1239},{NULL},{&l_1255},{NULL},{NULL},{&l_1249}},{{&g_641},{&l_1249},{&l_1254},{&g_641},{&g_46},{NULL},{NULL},{&l_1254},{NULL},{&l_1239}},{{NULL},{&l_1254},{NULL},{NULL},{&g_46},{&g_641},{&l_1254},{&l_1249},{&g_641},{&l_1249}},{{NULL},{NULL},{&l_1255},{NULL},{&l_1239},{NULL},{&l_1249},{NULL},{NULL},{&l_1233}},{{&g_641},{&l_1255},{&l_1255},{&g_641},{&l_1233},{NULL},{NULL},{&l_1249},{NULL},{&l_1239}},{{NULL},{&l_1255},{NULL},{NULL},{&l_1249},{&g_641},{&l_1249},{&l_1254},{&g_641},{&g_46}},{{NULL},{NULL},{&l_1254},{NULL},{&l_1239},{NULL},{&l_1254},{NULL},{NULL},{&g_46}},{{&g_641},{&l_1254},{&l_1249},{&g_641},{&l_1249},{NULL},{NULL},{&l_1255},{NULL},{&l_1239}}}; + int32_t **l_1357 = &l_1340; + int32_t ***l_1370 = &g_224; + uint8_t *l_1401 = &l_1345; + uint8_t *l_1423 = &l_1336[2][2][1]; + int i, j, k; + if ((safe_sub_func_int16_t_s_s((-1L), (safe_lshift_func_int8_t_s_s(g_260[(g_255 + 1)][(g_282 + 5)][g_282], (g_260[(g_255 + 2)][(g_282 + 4)][g_282] != 0L)))))) + { /* block id: 524 */ + for (g_582 = 10; (g_582 <= 41); g_582++) + { /* block id: 527 */ + uint32_t l_1294 = 0xCCC628CFL; + const int32_t *l_1297 = &g_641; + const int32_t **l_1296 = &l_1297; + (*l_1296) = func_170(g_255, &l_1253[2][2], (l_1294 = (safe_unary_minus_func_uint32_t_u(0x639133E1L))), l_1295); + } + if ((*p_156)) + break; + (*p_156) |= (NULL == l_1298); + } + else + { /* block id: 533 */ + uint8_t *l_1321 = NULL; + uint8_t *l_1322 = NULL; + uint8_t *l_1323[2]; + const int32_t l_1330 = 0xCA926C7CL; + uint32_t * const **l_1332[4][9] = {{NULL,&l_1331,NULL,&l_1331,&l_1331,&l_1331,&l_1331,&l_1331,&l_1331},{&l_1331,NULL,NULL,NULL,&l_1331,&l_1331,&l_1331,&l_1331,&l_1331},{NULL,&l_1331,&l_1331,&l_1331,&l_1331,&l_1331,NULL,&l_1331,&l_1331},{&l_1331,&l_1331,NULL,&l_1331,&l_1331,&l_1331,NULL,&l_1331,&l_1331}}; + int32_t *l_1337 = &l_1233; + int i, j; + for (i = 0; i < 2; i++) + l_1323[i] = &g_466; + l_1336[2][2][1] ^= (((((*l_1224) && (safe_add_func_int32_t_s_s((*l_1224), (l_1233 = ((safe_div_func_int32_t_s_s((((l_1233 == ((l_1333 = (((l_1304 != ((safe_add_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((safe_sub_func_uint32_t_u_u((*l_1224), (((****l_1328) = ((safe_sub_func_int32_t_s_s((safe_mul_func_int16_t_s_s(((((safe_add_func_int8_t_s_s((safe_div_func_uint16_t_u_u((safe_lshift_func_uint8_t_u_u(g_438, ((l_1245[2][0] = (g_450 = 0xCCL)) != (**g_539)))), (safe_div_func_uint32_t_u_u(((safe_mul_func_int16_t_s_s(l_1284, l_1284)) || g_582), l_1283[0])))), l_1283[2])) , 0x5E504C16L) , l_1328) != l_1329), l_1242)), (*p_156))) , 1L)) == (-4L)))) , g_254), 0UL)), 1L)) , (***l_1328))) , l_1330) , l_1331)) != &g_284[8][0])) && (*p_156)) , (*p_156)), (*l_1224))) & l_1284))))) >= l_1284) , 0UL) , (*p_156)); + (*l_1337) &= (g_459 , ((***g_538) , (*p_156))); + } + l_1345--; + for (g_582 = (-10); (g_582 == 27); ++g_582) + { /* block id: 545 */ + int32_t *****l_1351[6] = {&l_1350,&l_1350,&l_1350,&l_1350,&l_1350,&l_1350}; + uint32_t l_1371 = 0x763FCA33L; + uint16_t l_1424 = 0UL; + const int32_t *l_1425[2]; + int i; + for (i = 0; i < 2; i++) + l_1425[i] = &g_621; + (*l_1342) = ((g_1352 = l_1350) == (l_1353 = NULL)); + for (l_1345 = 29; (l_1345 != 34); l_1345 = safe_add_func_int32_t_s_s(l_1345, 3)) + { /* block id: 551 */ + int32_t **l_1358 = &l_1340; + const int32_t l_1369 = 0xEB4575E8L; + uint32_t *l_1372 = &g_260[(g_255 + 2)][(g_282 + 4)][g_282]; + uint8_t *l_1374 = &g_463; + (*l_1358) = ((~((((*l_1334) |= ((l_1357 = &p_156) == (l_1359 = l_1358))) < ((*l_1372) = ((((l_1360 , ((((safe_add_func_int8_t_s_s(((((*p_156) > ((safe_sub_func_uint16_t_u_u(((((safe_add_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_s(((l_1253[2][2] = (*l_1341)) != ((0L & (l_1242 ^ l_1283[2])) && (l_1369 && 0xA50BL))), 7)), 1L)) , 0UL) & 0UL) != 0x7C5EL), l_1247)) , l_1253[2][2])) , (int32_t***) NULL) != l_1370), 0UL)) != (***g_540)) & 1L) != l_1283[0])) < (*l_1343)) || 0L) , l_1371))) <= l_1276)) , p_156); + if ((*g_65)) + break; + p_156 = (((*l_1374) = ((l_1336[1][7][2] , l_1373) != &g_808[4])) , p_156); + (**l_1357) = (*p_156); + } + for (l_1255 = 22; (l_1255 == (-16)); l_1255 = safe_sub_func_int32_t_s_s(l_1255, 7)) + { /* block id: 565 */ + int32_t l_1385 = 0xC54C3EE5L; + int32_t l_1390 = 0x024543CCL; + int32_t l_1392 = 0x87533C1FL; + uint8_t **l_1402 = &l_1401; + uint32_t *l_1421 = &l_1276; + uint32_t *l_1422[6] = {&l_1371,&l_1371,&g_260[(g_255 + 2)][(g_282 + 4)][g_282],&l_1371,&l_1371,&g_260[(g_255 + 2)][(g_282 + 4)][g_282]}; + int i; + } + } + } + } + for (l_1284 = 0; (l_1284 == 44); l_1284++) + { /* block id: 585 */ + uint32_t l_1430 = 0UL; + int32_t l_1452 = 9L; + uint16_t *l_1453 = &g_622[0]; + int16_t *l_1483[10] = {&g_209,&g_209,NULL,&l_1242,NULL,&g_209,&g_209,NULL,&l_1242,NULL}; + int i; + for (g_620 = 0; (g_620 >= 16); ++g_620) + { /* block id: 588 */ + uint32_t l_1433[7][5] = {{0xFDACC836L,4294967287UL,4294967287UL,0xFDACC836L,4294967287UL},{0xFDACC836L,0xFDACC836L,4294967294UL,0xFDACC836L,0xFDACC836L},{4294967287UL,0xFDACC836L,4294967287UL,4294967287UL,0xFDACC836L},{0xFDACC836L,4294967287UL,4294967287UL,0xFDACC836L,4294967287UL},{0xFDACC836L,4294967287UL,0xFDACC836L,4294967287UL,4294967287UL},{4294967294UL,4294967287UL,4294967294UL,4294967294UL,4294967287UL},{4294967287UL,4294967294UL,4294967294UL,4294967287UL,4294967294UL}}; + int i, j; + for (g_462 = 5; (g_462 >= 2); g_462 -= 1) + { /* block id: 591 */ + l_1430--; + } + if (l_1433[1][4]) + break; + } + if ((*p_156)) + break; + if (((((((0x4431D583L ^ l_1434) | 246UL) < (safe_mul_func_int8_t_s_s((l_1430 > ((+l_1430) == (safe_add_func_uint8_t_u_u(g_582, ((safe_lshift_func_uint16_t_u_s(l_1242, (safe_div_func_uint16_t_u_u((((safe_div_func_uint16_t_u_u(7UL, ((((*l_1453) = ((safe_div_func_uint8_t_u_u((l_1452 ^= (safe_sub_func_uint8_t_u_u(g_447, l_1430))), 1UL)) >= 0x6D05L)) | 1UL) , l_1336[2][2][1]))) >= l_1336[4][4][1]) , l_1430), l_1430)))) < 4294967288UL))))), 3L))) != 0xB1D5L) , 0x05L) < g_405)) + { /* block id: 599 */ + if ((**g_224)) + break; + } + else + { /* block id: 601 */ + int8_t l_1456 = 1L; + int32_t l_1481 = 0x4CF7E1B6L; + int32_t l_1485 = 0x2013DBEBL; + int8_t l_1526 = 4L; + for (g_36 = 25; (g_36 <= 0); g_36--) + { /* block id: 604 */ + int32_t l_1476 = 0L; + uint8_t **l_1482 = NULL; + uint32_t l_1486 = 1UL; + int32_t l_1509 = 7L; + int32_t l_1510 = 0L; + if (l_1456) + { /* block id: 605 */ + int16_t l_1475 = 0xADD0L; + int32_t l_1477 = (-2L); + int32_t l_1478 = 8L; + int32_t *l_1480[3][8] = {{&g_641,&g_641,&l_1245[1][7],&g_621,&l_1245[1][7],&g_641,&g_641,&l_1245[1][7]},{&l_1244,&l_1245[1][7],&l_1245[1][7],&l_1244,&l_1253[2][2],&l_1244,&l_1245[1][7],&l_1245[1][7]},{&l_1245[1][7],&l_1253[2][2],&g_621,&g_621,&l_1253[2][2],&l_1245[1][7],&l_1253[2][2],&g_621}}; + uint16_t *l_1505 = &g_644; + uint32_t *l_1507 = &g_582; + int i, j; + (*g_809) = (g_463 , ((g_466 && (((((((((0L < (safe_mod_func_int32_t_s_s(((safe_add_func_uint32_t_u_u(((*l_1334) ^= (safe_div_func_int8_t_s_s(1L, (((*p_156) | ((((safe_sub_func_int16_t_s_s((l_1484 = (safe_mod_func_uint16_t_u_u(((++(*l_1453)) && (((l_1452 >= (safe_add_func_int16_t_s_s((l_1471 != (((l_1481 = (((*l_1453) = (safe_mod_func_uint8_t_u_u(l_1475, ((l_1478 = (l_1477 |= (l_1456 == l_1476))) , l_1476)))) & l_1479)) | l_1456) , l_1482)), l_1456))) , &l_1242) != l_1483[4])), l_1452))), g_921[0])) ^ l_1476) , (int32_t**) NULL) != &p_156)) , (*g_635))))), 8UL)) != (*p_156)), l_1485))) , 0xD2D0L) | l_1486) , 0xBCDFL) && l_1452) >= 0x438AL) ^ 4294967291UL) || l_1486) || l_1456)) , (int32_t*) NULL)); + l_1510 &= (((*p_156) = ((safe_lshift_func_int16_t_s_s((safe_lshift_func_int16_t_s_u((safe_mod_func_int8_t_s_s(((safe_add_func_uint32_t_u_u((safe_unary_minus_func_int32_t_s((safe_lshift_func_uint16_t_u_s(((safe_rshift_func_uint8_t_u_s(((*p_156) != l_1476), 3)) && (((l_1452 != (((safe_mod_func_uint32_t_u_u(0x1E26F9A9L, (((((*l_1507) = (safe_sub_func_int32_t_s_s((l_1504[3] , (0xC65BL & ((((l_1506[2] = (l_1476 = (l_1476 || ((&g_644 == l_1505) | l_1486)))) & l_1486) <= 1L) == l_1485))), l_1430))) , (*g_540)) == (*g_540)) , l_1481))) , 1L) , (*p_156))) == l_1485) , l_1481)), l_1485)))), l_1508)) , l_1509), l_1509)), l_1456)), 5)) && l_1486)) ^ (-6L)); + } + else + { /* block id: 619 */ + int32_t l_1513 = 0xA8FE3C4EL; + int16_t * const **l_1522 = &l_1299[2]; + l_1481 = (g_1335 || (l_1510 && (((((*g_1117) != (*g_1117)) >= ((~(safe_unary_minus_func_int32_t_s(((*p_156) = ((((***g_540) &= l_1513) < g_447) , ((safe_mul_func_uint16_t_u_u(((~((((safe_add_func_int8_t_s_s((((~(((safe_sub_func_uint8_t_u_u(((NULL != l_1522) < (!(safe_lshift_func_uint16_t_u_u(((*l_1453) = 1UL), 4)))), l_1513)) | l_1510) ^ l_1486)) , (*g_65)) > 0x2A22655AL), 0x54L)) , 1L) == l_1509) || l_1526)) & (*g_225)), l_1513)) > l_1452)))))) != l_1430)) | l_1513) <= l_1513))); + if (l_1430) + continue; + if (l_1485) + goto lbl_1527; + } + if ((*p_156)) + break; + } + l_1485 ^= (safe_mul_func_int8_t_s_s(1L, g_642)); + for (g_282 = 0; (g_282 <= 6); g_282 += 1) + { /* block id: 632 */ + uint32_t l_1536 = 18446744073709551615UL; + int32_t l_1539 = 0x3950725BL; + (*p_156) = ((safe_rshift_func_uint8_t_u_u(((safe_mod_func_uint32_t_u_u((0xE0L || ((safe_div_func_int32_t_s_s((g_466 < l_1452), l_1536)) == l_1485)), (*p_156))) ^ (safe_lshift_func_int8_t_s_u((((NULL == &l_1508) > (l_1539 |= l_1430)) != 0x2EL), 6))), 3)) | (*p_156)); + return l_1481; + } + } + } + } + return (*p_156); +} + + +/* ------------------------------------------ */ +/* + * reads : g_538 g_539 g_262 g_263 g_592 g_260 g_809 g_810 g_1103 g_65 g_46 g_447 g_643 g_225 g_642 g_540 g_635 g_462 g_224 g_45 g_48 g_206 g_36 g_282 g_283 g_209 g_254 + * writes: g_263 g_260 g_254 g_641 g_642 g_450 g_447 g_622 g_644 g_466 g_462 g_393 g_206 g_36 + */ +static int32_t * func_157(uint16_t * p_158, int16_t p_159, int32_t p_160) +{ /* block id: 453 */ + uint32_t l_1158 = 0xA8847F5CL; + int32_t l_1167 = 5L; + uint32_t *l_1168 = &g_260[9][3][1]; + uint16_t *l_1184 = &g_622[0]; + uint16_t **l_1183 = &l_1184; + int32_t *l_1185 = NULL; + int32_t *l_1186 = &g_642; + uint8_t *l_1191 = &g_450; + int32_t ****l_1194 = NULL; + uint16_t *l_1195 = NULL; + uint16_t *l_1196 = &g_644; + const uint8_t l_1208 = 0xD2L; + uint32_t *l_1209 = NULL; + uint32_t *l_1210 = NULL; + uint32_t *l_1211 = &g_393; + const int32_t *l_1213 = &l_1167; + const int32_t **l_1212 = &l_1213; + int32_t *l_1214 = &g_642; + int32_t *l_1215 = &g_621; + int32_t *l_1216[4]; + uint32_t l_1218 = 0x71E07AEBL; + int i; + for (i = 0; i < 4; i++) + l_1216[i] = &g_642; + (*l_1186) = (safe_mod_func_uint16_t_u_u(((safe_mul_func_int8_t_s_s((safe_mul_func_uint8_t_u_u((safe_rshift_func_int16_t_s_s(l_1158, 6)), (((***g_538) &= (~0x5E96B9CEL)) != ((safe_rshift_func_uint16_t_u_s(g_592, 5)) , (+(safe_lshift_func_uint16_t_u_u((safe_sub_func_uint32_t_u_u(((*l_1168)++), (safe_div_func_uint16_t_u_u((+(l_1158 < (safe_mod_func_int32_t_s_s(((**g_809) = p_159), (safe_mul_func_int16_t_s_s(6L, (safe_mul_func_int8_t_s_s(((safe_add_func_int16_t_s_s((!(g_1103 == l_1183)), (p_160 | p_159))) <= l_1158), l_1167)))))))), 0xBB7EL)))), 7))))))), p_160)) , 1UL), l_1167)); + (*l_1186) = (((safe_mul_func_uint8_t_u_u((g_466 = (safe_rshift_func_uint16_t_u_s(((*g_65) && ((**g_809) = ((g_447 &= ((*l_1191) = p_159)) > (safe_lshift_func_int16_t_s_u(((&g_808[8] != l_1194) & p_159), 14))))), (((NULL == l_1194) , (((*l_1196) = ((**l_1183) = 8UL)) < (p_160 >= 9L))) , 0x2802L)))), g_643[6])) && 0x5D69525AL) <= (*g_225)); + (*l_1212) = func_170((((*l_1168) = p_159) > (((g_592 , ((*g_635) |= (safe_lshift_func_uint16_t_u_u(((*l_1186) >= (***g_540)), 5)))) == (~(safe_mod_func_int32_t_s_s((((safe_rshift_func_uint16_t_u_s(((safe_add_func_uint32_t_u_u(0x9A153D1DL, p_159)) & ((safe_sub_func_int32_t_s_s((**g_224), ((*l_1211) = (((l_1208 < 0x39L) == (*l_1186)) && 0xEB56L)))) , p_159)), p_159)) | 0xC7CFL) ^ g_48), 1L)))) >= (*l_1186))), (*g_224), (*l_1186), (*g_539)); + l_1218--; + return (*g_809); +} + + +/* ------------------------------------------ */ +/* + * reads : g_466 g_566 g_567 g_644 g_540 g_539 g_262 g_263 g_592 g_643 g_282 g_838 g_635 g_462 g_209 g_450 g_463 g_809 g_810 g_254 g_641 g_45 g_46 g_921 g_65 g_405 g_622 g_14 g_621 g_460 g_459 g_225 g_300 g_620 g_206 g_36 g_283 g_224 g_260 g_1103 g_1117 + * writes: g_466 g_260 g_209 g_450 g_463 g_254 g_641 g_642 g_263 g_921 g_622 g_592 g_206 g_644 g_36 g_255 g_300 g_643 + */ +static uint16_t * func_161(uint8_t p_162) +{ /* block id: 312 */ + uint32_t *l_834 = &g_260[9][3][1]; + int32_t l_836 = 0xA7A5AD61L; + int32_t l_837 = 0xF6733D8EL; + const int32_t *l_867 = NULL; + const int32_t **l_866 = &l_867; + const uint8_t *l_873 = NULL; + uint32_t l_876 = 4294967295UL; + uint16_t *l_880 = &g_644; + uint16_t *l_881[9][9] = {{NULL,NULL,&g_405,&g_644,&g_644,&g_405,NULL,NULL,&g_644},{NULL,&g_644,&g_644,NULL,NULL,&g_405,&g_644,&g_644,&g_405},{&g_622[0],&g_644,&g_622[0],&g_644,&g_622[0],&g_622[0],&g_644,&g_48,&g_644},{&g_644,NULL,&g_622[0],&g_48,NULL,&g_644,NULL,&g_48,&g_622[0]},{&g_622[0],&g_622[0],&g_644,&g_48,&g_644,&g_622[0],&g_622[0],&g_644,&g_622[0]},{NULL,NULL,&g_405,&g_644,&g_644,&g_405,NULL,NULL,&g_644},{NULL,&g_644,&g_644,NULL,NULL,&g_405,&g_644,&g_644,&g_405},{&g_622[0],&g_644,&g_622[0],&g_644,&g_622[0],&g_622[0],&g_644,&g_48,&g_644},{&g_644,NULL,&g_622[0],&g_48,NULL,&g_644,NULL,&g_48,&g_622[0]}}; + uint32_t l_917[5][1][1]; + int32_t l_1017 = (-4L); + int32_t l_1021[3][9] = {{(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L},{(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L},{(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L,(-8L),(-8L),0x6609F756L}}; + uint32_t *l_1076 = &g_260[9][3][1]; + uint16_t l_1077 = 0xF6A3L; + int32_t *** const **l_1086 = &g_566; + uint32_t l_1095 = 0x1899CF0EL; + uint32_t l_1130 = 0x88B63BFEL; + int32_t l_1149 = (-3L); + int i, j, k; + for (i = 0; i < 5; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 1; k++) + l_917[i][j][k] = 0xE507901EL; + } + } + for (g_466 = 0; (g_466 > 56); g_466 = safe_add_func_uint8_t_u_u(g_466, 6)) + { /* block id: 315 */ + int8_t * const *l_823 = &g_262; + int8_t * const **l_822 = &l_823; + int32_t l_835 = (-2L); + int16_t *l_848 = NULL; + int16_t **l_847 = &l_848; + uint32_t *l_854 = NULL; + int8_t l_869 = 0x0EL; + uint32_t l_877 = 0x3BEFACACL; + int8_t l_886 = 0x27L; + int32_t l_918 = 0xA358E148L; + int32_t l_1023 = 0x620E8F94L; + int32_t l_1025[3]; + uint32_t l_1035 = 18446744073709551615UL; + uint16_t **l_1102 = &l_881[6][0]; + const int32_t l_1148 = 0x6204F998L; + int i; + for (i = 0; i < 3; i++) + l_1025[i] = 0x439E718BL; + if (((NULL != (*g_566)) || (((-1L) || ((((NULL == l_822) & ((safe_add_func_uint16_t_u_u((((safe_sub_func_uint16_t_u_u(0UL, ((safe_div_func_uint32_t_u_u(((*l_834) = (safe_sub_func_int8_t_s_s(((((((((g_644 & 0x88L) == (safe_rshift_func_uint8_t_u_s((l_834 == NULL), 6))) <= p_162) != 0x8D50L) && l_835) ^ 0xF750L) && l_836) , (***g_540)), (*g_262)))), l_837)) , g_592))) < l_835) , g_643[6]), 0x8E44L)) , g_282)) && l_835) , g_838[4][4])) == p_162))) + { /* block id: 317 */ + uint32_t l_853 = 0UL; + l_835 = (+((safe_unary_minus_func_uint32_t_u(((*l_834) = (safe_mod_func_uint16_t_u_u(((-9L) == p_162), (safe_sub_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(0xDAL, (*g_635))), 0L))))))) , ((((((NULL == l_847) < (((safe_mul_func_int8_t_s_s((safe_add_func_uint32_t_u_u(l_853, (p_162 > l_835))), l_837)) , (uint32_t*) NULL) == l_854)) > 0xFDC7472DL) <= p_162) , 9L) > 0x093BL))); + if (l_835) + continue; + l_835 = ((g_263 == (&g_538 != &g_538)) , l_853); + } + else + { /* block id: 322 */ + uint8_t l_855 = 3UL; + int32_t **l_868 = &g_810[4]; + uint8_t *l_870[6]; + int i; + for (i = 0; i < 6; i++) + l_870[i] = &g_206; + l_855--; + (**g_809) ^= (safe_sub_func_uint16_t_u_u((safe_lshift_func_int8_t_s_u((((g_209 &= (safe_add_func_uint16_t_u_u(l_855, (safe_mul_func_int16_t_s_s(p_162, (l_866 != l_868)))))) & 0x5F74L) == ((l_869 & (g_463 &= (g_450--))) >= ((l_869 <= (NULL == l_873)) , p_162))), 7)), 0x7B55L)); + for (g_642 = 1; (g_642 <= 6); g_642 += 1) + { /* block id: 330 */ + (**l_868) ^= p_162; + } + l_877 |= ((safe_rshift_func_uint8_t_u_s(l_876, 0)) < (*g_45)); + } + if ((7UL | ((safe_mod_func_uint32_t_u_u(((l_880 = (uint16_t*) l_848) == l_881[2][3]), p_162)) != 0xA1FAL))) + { /* block id: 336 */ + int16_t *l_899 = &g_209; + uint32_t l_900 = 0x1A67D4BAL; + int32_t l_905 = 4L; + uint8_t *l_906 = &g_450; + uint8_t l_908 = 255UL; + int8_t l_938[2]; + int16_t ** const *l_971 = &l_847; + int8_t *** const l_987 = NULL; + int8_t *** const *l_986 = &l_987; + int32_t l_1019 = 1L; + int32_t l_1024 = 0x69901F8FL; + int32_t l_1027[10] = {0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L,0x8C596373L}; + int i; + for (i = 0; i < 2; i++) + l_938[i] = 0x84L; + if ((safe_add_func_uint32_t_u_u((safe_rshift_func_int16_t_s_u(l_886, (safe_mul_func_uint8_t_u_u((&l_847 == NULL), ((((*l_906) = (((safe_add_func_int32_t_s_s((safe_add_func_int8_t_s_s(((safe_lshift_func_uint16_t_u_s(((0x01DC69ECL && p_162) ^ (safe_add_func_uint8_t_u_u(l_886, (safe_sub_func_uint8_t_u_u(((((*l_899) = p_162) & l_900) <= (((((safe_lshift_func_int16_t_s_s((l_905 |= (safe_rshift_func_uint16_t_u_s(p_162, 1))), p_162)) && l_900) , 0xB9E2C173L) | p_162) > 0x814FL)), 1UL))))), 5)) , 5L), l_877)), l_886)) < g_462) == (-5L))) & g_643[3]) && l_900))))), p_162))) + { /* block id: 340 */ + int16_t l_907 = 0x34EBL; + uint32_t l_935[9][9][3] = {{{4294967291UL,0UL,0UL},{1UL,4294967291UL,0x81E62F9BL},{0x5FEA8DF6L,0x66CD0AE8L,0x9923B626L},{0UL,4294967291UL,1UL},{1UL,0UL,0x7AADED00L},{0x9923B626L,0x9923B626L,4294967291UL},{0x9923B626L,0UL,0UL},{1UL,0x5FD7212AL,1UL},{0UL,1UL,1UL}},{{0x5FEA8DF6L,1UL,1UL},{1UL,4294967287UL,0UL},{4294967291UL,1UL,4294967289UL},{0x5FD7212AL,1UL,4294967291UL},{4294967291UL,0x66CD0AE8L,1UL},{1UL,0UL,0x5FEA8DF6L},{0UL,1UL,0UL},{1UL,0UL,1UL},{4294967291UL,0x9923B626L,0x9923B626L}},{{0x5FD7212AL,0x5FEA8DF6L,0x9923B626L},{4294967289UL,0UL,1UL},{0x81E62F9BL,4294967289UL,0UL},{0x5AE5AB59L,1UL,0x5FEA8DF6L},{0x7AADED00L,4294967289UL,1UL},{0UL,0UL,4294967291UL},{0x5FEA8DF6L,0x5FEA8DF6L,4294967289UL},{0x5FEA8DF6L,0x9923B626L,0x7AADED00L},{0UL,0UL,0x4455EE3CL}},{{0x7AADED00L,1UL,0UL},{0x5AE5AB59L,0UL,0x4455EE3CL},{0x81E62F9BL,0x66CD0AE8L,0x7AADED00L},{4294967289UL,1UL,4294967289UL},{0x5FD7212AL,1UL,4294967291UL},{4294967291UL,0x66CD0AE8L,1UL},{1UL,0UL,0x5FEA8DF6L},{0UL,1UL,0UL},{1UL,0UL,1UL}},{{4294967291UL,0x9923B626L,0x9923B626L},{0x5FD7212AL,0x5FEA8DF6L,0x9923B626L},{4294967289UL,0UL,1UL},{0x81E62F9BL,4294967289UL,0UL},{0x5AE5AB59L,1UL,0x5FEA8DF6L},{0x7AADED00L,4294967289UL,1UL},{0UL,0UL,4294967291UL},{0x5FEA8DF6L,0x5FEA8DF6L,4294967289UL},{0x5FEA8DF6L,0x9923B626L,0x7AADED00L}},{{0UL,0UL,0x4455EE3CL},{0x7AADED00L,1UL,0UL},{0x5AE5AB59L,0UL,0x4455EE3CL},{0x81E62F9BL,0x66CD0AE8L,0x7AADED00L},{4294967289UL,1UL,4294967289UL},{0x5FD7212AL,1UL,4294967291UL},{4294967291UL,0x66CD0AE8L,1UL},{1UL,0UL,0x5FEA8DF6L},{0UL,1UL,0UL}},{{1UL,0UL,1UL},{4294967291UL,0x9923B626L,0x9923B626L},{0x5FD7212AL,0x5FEA8DF6L,0x9923B626L},{4294967289UL,0UL,1UL},{0x81E62F9BL,4294967289UL,0UL},{0x5AE5AB59L,1UL,0x5FEA8DF6L},{0x7AADED00L,4294967289UL,1UL},{0UL,0UL,4294967291UL},{0x5FEA8DF6L,0x5FEA8DF6L,4294967289UL}},{{0x5FEA8DF6L,0x9923B626L,0x7AADED00L},{0UL,0UL,0x4455EE3CL},{0x7AADED00L,1UL,0UL},{0x5AE5AB59L,0UL,0x4455EE3CL},{0x81E62F9BL,0x66CD0AE8L,0x7AADED00L},{4294967289UL,1UL,4294967289UL},{0x5FD7212AL,1UL,4294967291UL},{4294967291UL,0x66CD0AE8L,1UL},{1UL,0UL,0x5FEA8DF6L}},{{0UL,1UL,0UL},{1UL,0UL,1UL},{4294967291UL,0x9923B626L,0x9923B626L},{0UL,0x5AE5AB59L,0x5FEA8DF6L},{0x5FD7212AL,0x9923B626L,0UL},{0UL,0x5FD7212AL,0x7AADED00L},{4294967287UL,0x4455EE3CL,0x5AE5AB59L},{4294967291UL,0x5FD7212AL,0x81E62F9BL},{0UL,0x9923B626L,4294967289UL}}}; + uint16_t *l_967 = &g_622[0]; + int8_t *** const *l_985 = &g_538; + int32_t l_1012 = (-5L); + int32_t l_1013 = 0x19DAECC8L; + int32_t l_1014 = 0x6596FA3EL; + int32_t l_1015 = 0x8669AD91L; + int32_t l_1016 = (-1L); + int32_t l_1022 = 0x5E5C2789L; + int32_t l_1026[4][7][9] = {{{0x36E6C654L,0x36E6C654L,0L,0x5D96AEA7L,0xEF04FE43L,0x8CB38074L,6L,0x5D12D1E8L,2L},{0xD217057AL,(-9L),0xE2C9ECC7L,0x74CE580DL,2L,0x4AF11CEEL,0x4AF11CEEL,2L,0x74CE580DL},{0L,0x8CB38074L,0L,7L,(-7L),(-9L),3L,2L,0xEF04FE43L},{0x8CB38074L,0xE2C9ECC7L,0x36E6C654L,0xEF04FE43L,3L,0x5D12D1E8L,0x74CE580DL,0x5D12D1E8L,3L},{7L,0x74CE580DL,0x74CE580DL,7L,0xE2C9ECC7L,1L,0x5D12D1E8L,0xE13915CFL,3L},{0xE13915CFL,0L,6L,0x74CE580DL,0x4AF11CEEL,0xEF04FE43L,(-7L),(-7L),0xEF04FE43L},{0xE2C9ECC7L,0x5D96AEA7L,7L,0x5D96AEA7L,0xE2C9ECC7L,0xE13915CFL,0L,6L,0x74CE580DL}},{{0xE2C9ECC7L,1L,0x5D12D1E8L,0xE13915CFL,3L,0L,2L,(-9L),2L},{0xE13915CFL,(-7L),0xD217057AL,0xD217057AL,(-7L),0xE13915CFL,0x8CB38074L,0xE2C9ECC7L,0x36E6C654L},{7L,(-7L),(-9L),3L,2L,0xEF04FE43L,0xD217057AL,0x5D96AEA7L,0x5D96AEA7L},{0x8CB38074L,1L,0xEF04FE43L,6L,0xEF04FE43L,1L,0x8CB38074L,0xD217057AL,(-9L)},{0L,0x5D96AEA7L,0xEF04FE43L,0x8CB38074L,6L,0x5D12D1E8L,2L,1L,0xE13915CFL},{0xD217057AL,0L,(-9L),1L,1L,(-9L),0L,0xD217057AL,0x4AF11CEEL},{0x36E6C654L,0x74CE580DL,0xD217057AL,1L,7L,0x4AF11CEEL,(-7L),0x5D96AEA7L,0x5D12D1E8L}},{{0x4AF11CEEL,0xE2C9ECC7L,0x5D12D1E8L,0x8CB38074L,0x36E6C654L,0x8CB38074L,0x5D12D1E8L,0xE2C9ECC7L,0x4AF11CEEL},{2L,0x8CB38074L,7L,6L,0x36E6C654L,(-7L),0x74CE580DL,(-9L),0xE13915CFL},{0x5D96AEA7L,(-9L),6L,3L,7L,7L,3L,6L,(-9L)},{2L,0x36E6C654L,0x74CE580DL,0xD217057AL,1L,7L,0x4AF11CEEL,(-7L),0x5D96AEA7L},{0x4AF11CEEL,3L,0x36E6C654L,0xE13915CFL,6L,(-7L),6L,0xE13915CFL,0x36E6C654L},{0x36E6C654L,0x4AF11CEEL,2L,0x74CE580DL,0xE2C9ECC7L,(-9L),0xD217057AL,0x8CB38074L,1L},{7L,0xE13915CFL,0x5D96AEA7L,0x36E6C654L,1L,0L,0L,1L,0x36E6C654L}},{{2L,(-9L),2L,0L,3L,0xE13915CFL,0x5D12D1E8L,1L,0xE2C9ECC7L},{(-9L),0x5D96AEA7L,0x4AF11CEEL,0xE2C9ECC7L,0x5D12D1E8L,0x8CB38074L,0x36E6C654L,0x8CB38074L,0x5D12D1E8L},{0L,0x36E6C654L,0x36E6C654L,0L,0x5D96AEA7L,0xEF04FE43L,0x8CB38074L,6L,0x5D12D1E8L},{6L,2L,0xD217057AL,0x36E6C654L,0L,0xE2C9ECC7L,3L,3L,0xE2C9ECC7L},{0x5D96AEA7L,0x74CE580DL,0L,0x74CE580DL,0x5D96AEA7L,6L,2L,0xD217057AL,0x36E6C654L},{0x5D96AEA7L,0xEF04FE43L,0x8CB38074L,6L,0x5D12D1E8L,2L,1L,0xE13915CFL,1L},{6L,3L,7L,7L,3L,6L,(-9L),0x5D96AEA7L,0x4AF11CEEL}}}; + int i, j, k; + if (((l_908++) > (safe_add_func_int8_t_s_s(p_162, (safe_mul_func_uint8_t_u_u((--(*l_906)), ((l_917[4][0][0] , p_162) ^ (l_837 = ((0xA0L & g_209) == (l_918 = p_162)))))))))) + { /* block id: 345 */ + for (g_263 = (-7); (g_263 != 24); g_263 = safe_add_func_int8_t_s_s(g_263, 9)) + { /* block id: 348 */ + g_921[0]++; + if ((*g_65)) + break; + } + } + else + { /* block id: 352 */ + int32_t *l_924 = &g_621; + int32_t *l_925 = &l_905; + int32_t *l_926 = NULL; + int32_t *l_927 = &g_621; + int32_t *l_928 = &l_918; + int32_t *l_929 = &l_918; + int32_t *l_930 = &l_835; + int32_t *l_931 = &l_836; + int32_t *l_932 = &g_641; + int32_t *l_933 = NULL; + int32_t *l_934[4][9][1] = {{{&g_642},{&l_835},{&g_642},{&g_621},{&l_918},{&g_46},{&l_836},{&l_835},{NULL}},{{&l_836},{&l_918},{&l_836},{NULL},{&l_835},{&l_836},{&g_46},{&l_918},{&g_621}},{{&g_642},{&l_835},{&g_642},{&g_621},{&l_918},{&g_46},{&l_836},{&l_835},{NULL}},{{&l_836},{&l_918},{&l_836},{NULL},{&l_835},{&l_836},{&g_46},{&l_918},{&g_621}}}; + int i, j, k; + ++l_935[8][0][2]; + if (l_938[1]) + continue; + for (g_463 = (-25); (g_463 < 35); ++g_463) + { /* block id: 357 */ + return &g_48; + } + } + for (g_263 = (-18); (g_263 > 9); g_263 = safe_add_func_uint8_t_u_u(g_263, 3)) + { /* block id: 363 */ + int16_t l_966 = 1L; + uint16_t *l_997[1]; + int i; + for (i = 0; i < 1; i++) + l_997[i] = &g_644; + if (((safe_rshift_func_int8_t_s_s((((p_162 && (++(*l_906))) , (~(((p_162 <= (safe_mul_func_int8_t_s_s(((*g_45) , (safe_lshift_func_int8_t_s_s(((safe_lshift_func_int16_t_s_s(l_835, ((safe_div_func_uint8_t_u_u(l_886, ((safe_add_func_int16_t_s_s((safe_rshift_func_uint8_t_u_s(7UL, 1)), ((*l_899) = (((*l_906) = (0L | (safe_unary_minus_func_uint16_t_u((~(safe_rshift_func_int16_t_s_u(0xF9E6L, (safe_mul_func_uint16_t_u_u(l_966, l_908))))))))) > 0x46L)))) || (-3L)))) | (*g_262)))) | 0x4B1B37DDL), 1))), p_162))) & l_869) < g_405))) == l_886), 1)) , l_966)) + { /* block id: 367 */ + return l_967; + } + else + { /* block id: 369 */ + int8_t ****l_984 = &g_540; + int32_t l_994 = 0L; + (**g_809) = ((safe_sub_func_int16_t_s_s(0xDE45L, 0x948BL)) , (l_835 ^= (~(((*l_899) = ((((l_971 == ((safe_add_func_int8_t_s_s((((safe_mul_func_uint16_t_u_u((l_836 = (safe_lshift_func_int16_t_s_s(p_162, 6))), (safe_mul_func_int16_t_s_s((safe_sub_func_int16_t_s_s(((safe_lshift_func_uint16_t_u_u((l_984 == (l_986 = l_985)), ((safe_sub_func_uint32_t_u_u(p_162, ((safe_sub_func_int32_t_s_s((((((++g_622[0]) < l_994) & ((safe_mul_func_int16_t_s_s(l_935[8][3][0], 0xB471L)) < l_994)) , l_907) | l_938[1]), p_162)) < g_209))) >= g_46))) ^ (**g_809)), g_641)), p_162)))) >= p_162) , 0xDFL), l_935[7][2][2])) , (int16_t***) NULL)) ^ p_162) == g_592) , g_14)) <= l_907)))); + return l_997[0]; + } + } + for (g_592 = (-23); (g_592 > 52); g_592 = safe_add_func_int32_t_s_s(g_592, 1)) + { /* block id: 381 */ + int16_t l_1018 = 0x1709L; + int32_t l_1020[7]; + int32_t *l_1031 = &l_1025[0]; + int i; + for (i = 0; i < 7; i++) + l_1020[i] = 1L; + } + for (g_206 = 0; (g_206 <= 2); g_206 += 1) + { /* block id: 396 */ + uint8_t l_1040 = 0x2CL; + if (l_900) + break; + for (l_836 = 2; (l_836 >= 0); l_836 -= 1) + { /* block id: 400 */ + int32_t *l_1038 = &l_1026[2][0][5]; + int32_t *l_1039[10]; + int i; + for (i = 0; i < 10; i++) + l_1039[i] = NULL; + ++l_1040; + return (uint16_t*) l_848; + } + } + } + else + { /* block id: 405 */ + int8_t l_1043[1]; + int8_t ** const l_1074 = &g_635; + int i; + for (i = 0; i < 1; i++) + l_1043[i] = 0xEBL; + if ((l_1043[0] = l_1024)) + { /* block id: 407 */ + for (l_1035 = 0; (l_1035 > 45); ++l_1035) + { /* block id: 410 */ + if (p_162) + break; + } + if ((**g_809)) + continue; + } + else + { /* block id: 414 */ + uint32_t *l_1075 = &g_393; + for (g_644 = (-11); (g_644 == 21); g_644 = safe_add_func_uint32_t_u_u(g_644, 3)) + { /* block id: 417 */ + uint16_t *l_1048 = &g_622[0]; + return l_1048; + } + (**g_809) |= (safe_div_func_uint8_t_u_u((((0L ^ p_162) < ((((((safe_mul_func_int16_t_s_s((safe_add_func_int16_t_s_s(((safe_mod_func_int16_t_s_s((~l_1043[0]), p_162)) <= (NULL == &l_823)), (safe_div_func_uint8_t_u_u((safe_div_func_int8_t_s_s((safe_mul_func_int8_t_s_s((safe_rshift_func_int16_t_s_u((-10L), (((safe_rshift_func_int16_t_s_s(((safe_lshift_func_uint8_t_u_s((((((((((safe_lshift_func_uint16_t_u_s((NULL == l_1074), p_162)) ^ l_877) | 0x8B493F93L) ^ p_162) | g_622[0]) , l_1075) == l_1076) <= p_162) > l_1043[0]), 5)) , 0xBC0DL), 13)) == l_1077) ^ 0x37AA6D77L))), g_621)), p_162)), l_886)))), (-1L))) <= 0x8FA6L) , g_460[4]) , p_162) || p_162) > g_459)) >= p_162), p_162)); + } + (*l_866) = func_170((((((***g_540) , (safe_add_func_uint8_t_u_u(p_162, 5L))) , (safe_sub_func_uint16_t_u_u(((safe_sub_func_uint16_t_u_u((((**g_809) = (*g_225)) ^ (*g_45)), (safe_lshift_func_int16_t_s_u((l_1086 == NULL), 8)))) <= g_300), ((safe_sub_func_uint8_t_u_u(g_620, g_921[2])) && g_838[4][4])))) >= 0x4A34A224L) & 4294967291UL), (*g_809), p_162, &l_869); + } + } + else + { /* block id: 425 */ + uint8_t l_1091 = 246UL; + uint8_t *l_1092[7][5][4] = {{{&g_206,NULL,NULL,&g_206},{&g_450,&g_921[0],&g_450,&g_447},{&g_463,&g_921[2],&g_463,&g_463},{&l_1091,NULL,&g_450,&g_463},{NULL,&g_921[2],&g_921[1],&g_447}},{{NULL,&g_921[0],NULL,&g_206},{NULL,NULL,&g_463,&g_463},{&g_921[2],&g_447,&g_447,&g_450},{NULL,&g_450,&g_447,&l_1091},{&g_466,&g_463,&g_447,&g_466}},{{NULL,&g_463,&g_447,&g_450},{NULL,&g_447,&g_463,&g_206},{&g_206,&l_1091,&g_206,NULL},{&g_450,NULL,&g_463,&l_1091},{&g_921[1],&g_463,&l_1091,NULL}},{{&l_1091,&g_921[1],&l_1091,NULL},{&g_921[1],&g_450,&g_463,NULL},{&g_450,&g_921[0],&g_206,NULL},{&g_206,NULL,&g_921[0],&g_450},{&g_463,&g_463,&g_921[0],&g_466}},{{&g_450,&g_921[0],&g_921[1],&g_447},{&g_450,&g_466,&g_921[0],&g_447},{&g_921[2],NULL,NULL,&l_1091},{&g_447,&g_450,&g_463,&g_463},{NULL,NULL,&l_1091,&g_921[0]}},{{NULL,&g_447,NULL,&g_466},{&g_447,&g_463,&g_206,NULL},{&g_463,&g_463,&g_447,&g_466},{&g_463,&g_447,&g_447,&g_921[0]},{&g_447,NULL,&g_450,&g_463}},{{&g_463,&g_450,&g_447,&l_1091},{&g_466,NULL,&g_450,&g_447},{NULL,&g_466,&g_447,&g_447},{&g_447,&g_921[0],&g_463,&g_466},{&l_1091,&g_463,NULL,&g_450}}}; + int32_t l_1106 = (-8L); + int8_t ** const *l_1122[8][6][5] = {{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539}},{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539}},{{&g_539,NULL,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,NULL,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539}},{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539}},{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,NULL,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539},{&g_539,&g_539,&g_539,NULL,&g_539},{&g_539,&g_539,&g_539,&g_539,NULL}},{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,NULL,NULL},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,NULL,&g_539}},{{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,NULL,&g_539},{&g_539,&g_539,NULL,&g_539,&g_539}},{{&g_539,&g_539,&g_539,NULL,&g_539},{&g_539,&g_539,&g_539,&g_539,NULL},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,&g_539,&g_539,&g_539},{&g_539,&g_539,NULL,NULL,NULL}}}; + int8_t * const **l_1124 = &l_823; + int32_t ****l_1128 = &g_567; + int32_t ***** const l_1127 = &l_1128; + int i, j, k; + if ((safe_add_func_int8_t_s_s((g_46 == (l_1091 ^ (--p_162))), (0xEB7EL ^ g_260[2][5][0])))) + { /* block id: 427 */ + return (uint16_t*) l_848; + } + else + { /* block id: 429 */ + int16_t *l_1104 = NULL; + int16_t *l_1105 = &g_300; + int16_t l_1111 = 0x4F50L; + uint32_t l_1112 = 0UL; + int32_t l_1113 = (-1L); + int8_t ** const **l_1123 = &l_1122[2][2][4]; + int32_t ****l_1126 = &g_567; + int32_t *****l_1125[2][6] = {{NULL,NULL,&l_1126,NULL,NULL,&l_1126},{NULL,NULL,&l_1126,NULL,NULL,&l_1126}}; + int16_t ***l_1129 = &l_847; + int i, j; + for (g_255 = 0; (g_255 <= 2); g_255 += 1) + { /* block id: 432 */ + return &g_405; + } + if (l_1095) + break; + l_1113 = (safe_lshift_func_int8_t_s_s(((**g_539) = (safe_div_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_s(0x865CL, (l_1112 = (p_162 ^ (((p_162 & (l_1102 != g_1103)) , (l_1106 = ((*l_1105) = g_460[4]))) , ((**g_809) |= (safe_rshift_func_int8_t_s_s(((safe_div_func_uint8_t_u_u((((***g_540) >= (((NULL != (*l_1086)) , 0x8F72L) | p_162)) >= l_1111), 0x73L)) , p_162), 5)))))))), p_162))), l_1091)); + l_835 = (p_162 , (((safe_mod_func_int16_t_s_s((safe_unary_minus_func_int32_t_s((((l_1112 , g_1117) == ((g_643[5] = ((((((safe_add_func_uint16_t_u_u((((-1L) || 255UL) , p_162), (l_1113 = (((*l_1123) = l_1122[5][3][3]) == l_1124)))) || p_162) , l_1125[1][4]) != l_1127) , g_643[1]) & (*g_262))) , l_1129)) , (*g_225)))), 5UL)) && p_162) > l_1130)); + } + } + l_1149 = (safe_add_func_uint32_t_u_u((0xEEF3L >= l_886), (((safe_add_func_uint16_t_u_u((g_644 = (safe_add_func_int16_t_s_s(((l_886 != (((safe_rshift_func_uint8_t_u_s(((((((safe_add_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u(((*g_65) >= (((+((0x3236L && ((NULL != (*l_822)) , (p_162 && (safe_div_func_int8_t_s_s(((((*l_1076) = (((safe_add_func_uint8_t_u_u((g_641 , 1UL), l_877)) >= 253UL) , p_162)) <= 4294967295UL) < p_162), l_1035))))) == (*g_225))) && l_1023) , 0x48153ED3L)), p_162)), 1UL)) | 0x9636L) && p_162) || 0x1C3AL) , 0L) && (-1L)), (*g_262))) , (*g_262)) & (***g_540))) > l_1023), 0x19A3L))), l_1148)) && 0L) < l_918))); + } + return &g_405; +} + + +/* ------------------------------------------ */ +/* + * reads : g_36 g_65 g_46 g_14 g_45 g_206 g_209 g_48 g_225 g_224 g_255 g_262 g_263 g_282 g_283 g_254 g_641 + * writes: g_36 g_206 g_209 g_224 g_255 g_254 + */ +static uint8_t func_163(uint32_t p_164) +{ /* block id: 15 */ + int8_t l_195 = 7L; + uint8_t *l_205 = &g_206; + int16_t *l_207 = NULL; + int16_t *l_208 = &g_209; + uint32_t *l_259[5][6][2] = {{{NULL,NULL},{&g_260[9][3][1],NULL},{&g_260[9][3][1],&g_260[0][3][1]},{&g_260[0][3][1],&g_260[0][0][1]},{NULL,&g_260[0][0][1]},{&g_260[0][3][1],&g_260[0][3][1]}},{{&g_260[9][3][1],NULL},{&g_260[9][3][1],NULL},{NULL,&g_260[7][4][1]},{&g_260[0][0][1],NULL},{&g_260[4][6][0],&g_260[9][3][1]},{&g_260[4][6][0],NULL}},{{&g_260[0][0][1],&g_260[7][4][1]},{NULL,NULL},{&g_260[9][3][1],NULL},{&g_260[9][3][1],&g_260[0][3][1]},{&g_260[0][3][1],&g_260[0][0][1]},{NULL,&g_260[0][0][1]}},{{&g_260[0][3][1],&g_260[0][3][1]},{&g_260[9][3][1],NULL},{&g_260[9][3][1],NULL},{NULL,&g_260[7][4][1]},{&g_260[0][0][1],NULL},{&g_260[4][6][0],&g_260[9][3][1]}},{{&g_260[4][6][0],NULL},{&g_260[0][0][1],&g_260[7][4][1]},{NULL,NULL},{&g_260[9][3][1],NULL},{&g_260[9][3][1],&g_260[0][3][1]},{&g_260[0][3][1],&g_260[0][0][1]}}}; + uint32_t **l_258 = &l_259[4][4][0]; + int32_t *l_261[2][8] = {{NULL,&g_46,NULL,&g_46,NULL,&g_46,&g_254,&g_46},{NULL,&g_46,&g_254,&g_46,NULL,&g_46,&g_46,NULL}}; + const int32_t *l_584 = &g_46; + const int32_t **l_583 = &l_584; + int32_t *****l_588 = NULL; + int16_t l_691 = 0x5E02L; + int8_t l_768 = 0xB2L; + int32_t ***l_811 = &g_224; + int i, j, k; + for (g_36 = 0; (g_36 != 23); ++g_36) + { /* block id: 18 */ + for (p_164 = 0; (p_164 == 14); p_164 = safe_add_func_int8_t_s_s(p_164, 8)) + { /* block id: 21 */ + uint8_t l_169 = 0x80L; + l_169 &= 0x8566A4DCL; + } + } + (*l_583) = func_170(((safe_div_func_int16_t_s_s((safe_sub_func_int32_t_s_s((~(safe_div_func_int32_t_s_s((*g_65), ((((safe_rshift_func_uint16_t_u_u(g_14, 9)) == 4L) , (p_164 < (+(((0x6CD2L <= (((safe_div_func_int16_t_s_s((g_45 == (int32_t*) ((*l_258) = func_187(p_164, func_190(l_195, (g_36 = func_196((safe_mul_func_int16_t_s_s(((*l_208) = (((+((((*l_205) = 255UL) | (-1L)) < g_14)) & 0x0BL) ^ (-1L))), g_14)), p_164, l_195, p_164, &g_48)), g_14, l_195)))), 0x3EC7L)) > p_164) < g_48)) > 65535UL) == p_164)))) , 0xBB944C1BL)))), p_164)), 65535UL)) ^ 3UL), l_261[0][0], p_164, g_262); + for (g_36 = 6; (g_36 >= 0); g_36 -= 1) + { /* block id: 203 */ + uint32_t l_585[3]; + int32_t l_586 = 0L; + int8_t l_587 = 0L; + int32_t l_589[9] = {0x57BACD34L,(-7L),(-7L),0x57BACD34L,(-7L),(-7L),0x57BACD34L,(-7L),(-7L)}; + int32_t *l_590 = NULL; + int16_t l_591 = 0x31B6L; + int8_t ****l_617 = &g_538; + int32_t l_636 = 0L; + uint16_t l_638 = 65534UL; + const int32_t *l_729 = &g_621; + uint32_t **l_787 = &g_284[8][0]; + const int32_t l_818 = 1L; + int16_t l_819 = (-1L); + int i; + for (i = 0; i < 3; i++) + l_585[i] = 0xF43C1102L; + } + return p_164; +} + + +/* ------------------------------------------ */ +/* + * reads : g_262 g_263 g_206 g_36 g_282 g_283 g_209 g_254 g_224 g_45 g_225 + * writes: g_206 g_36 g_254 + */ +static const int32_t * func_170(uint32_t p_171, int32_t * p_172, uint32_t p_173, int8_t * p_174) +{ /* block id: 76 */ + int32_t l_269 = (-10L); + uint8_t *l_270 = &g_206; + uint16_t l_281 = 1UL; + int8_t *l_285 = &g_36; + int8_t l_315 = 0x76L; + uint32_t l_316 = 0xAA83F591L; + int32_t l_324 = 0xE27A70E2L; + uint16_t l_377 = 4UL; + int32_t *l_419 = &g_254; + int32_t l_461 = 0x3924C3FCL; + int32_t ***l_474 = &g_224; + uint8_t l_537 = 0UL; + g_254 &= (safe_lshift_func_int16_t_s_u(((*g_262) > (safe_div_func_uint8_t_u_u(((p_173 ^ (safe_unary_minus_func_uint8_t_u((++(*l_270))))) == ((*l_285) = ((safe_mod_func_uint16_t_u_u(((((safe_mul_func_uint8_t_u_u((((1UL < (safe_sub_func_int32_t_s_s(1L, (((safe_rshift_func_uint16_t_u_u(((0x25639F12L | ((((l_270 == NULL) < l_281) , &g_224) == &g_224)) == p_173), 2)) , g_36) ^ g_36)))) >= g_282) == 0x00L), l_269)) , g_283[0][0][0]) == &g_284[8][0]) && p_171), g_209)) ^ 4294967295UL))), l_269))), g_209)); + for (l_269 = 0; (l_269 <= 8); l_269 += 1) + { /* block id: 82 */ + const int16_t *l_287 = &g_209; + const int16_t **l_286 = &l_287; + const int16_t ***l_288 = &l_286; + uint16_t *l_298 = NULL; + uint16_t *l_299[2][8][9] = {{{NULL,&l_281,NULL,&g_48,&g_48,&l_281,&g_48,NULL,&g_48},{&l_281,&l_281,&g_48,&g_48,&l_281,&g_48,&l_281,&g_48,&l_281},{&l_281,NULL,NULL,&l_281,NULL,&l_281,&l_281,&g_48,&l_281},{&g_48,&g_48,&l_281,&l_281,NULL,&g_48,NULL,&l_281,&l_281},{&g_48,NULL,&l_281,&l_281,NULL,&g_48,NULL,&l_281,&l_281},{NULL,NULL,&g_48,&g_48,&l_281,&g_48,&g_48,&g_48,&g_48},{&l_281,&l_281,&l_281,&l_281,&g_48,&l_281,&l_281,&l_281,NULL},{&l_281,NULL,&g_48,&g_48,&g_48,&g_48,&g_48,NULL,&l_281}},{{&g_48,NULL,&l_281,&l_281,&l_281,&g_48,NULL,&l_281,&g_48},{&g_48,&l_281,&l_281,&g_48,&l_281,&g_48,&g_48,&g_48,&g_48},{&g_48,&l_281,NULL,&l_281,NULL,&l_281,&g_48,&l_281,&l_281},{&l_281,&l_281,&g_48,NULL,&g_48,&g_48,&l_281,&g_48,&g_48},{&l_281,&l_281,NULL,&l_281,NULL,&l_281,&l_281,&l_281,&l_281},{NULL,&l_281,&g_48,&l_281,NULL,&g_48,&l_281,&g_48,NULL},{&g_48,&l_281,&g_48,&g_48,&l_281,&g_48,NULL,&l_281,&l_281},{&g_48,NULL,&g_48,NULL,NULL,&g_48,&g_48,NULL,NULL}}}; + int32_t l_314[6]; + int32_t **l_317 = &g_225; + uint32_t l_343 = 0x451EC3E9L; + int8_t *l_348 = &g_36; + uint8_t l_489 = 0x6CL; + int i, j, k; + for (i = 0; i < 6; i++) + l_314[i] = 1L; + (*l_288) = l_286; + } + return (**l_474); +} + + +/* ------------------------------------------ */ +/* + * reads : g_209 g_206 g_48 g_46 g_225 g_224 g_45 g_255 g_641 l_1546 g_642 + * writes: g_209 g_36 g_224 g_255 + */ +static uint32_t * func_187(uint8_t p_188, int16_t p_189) +{ /* block id: 38 */ + int32_t *l_214 = &g_46; + int32_t **l_215 = &l_214; + int8_t *l_229 = NULL; + int32_t l_244 = (-1L); + int32_t *l_253[3][6][6] = {{{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL}},{{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL}},{{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL,NULL}}}; + int i, j, k; + (*l_215) = l_214; + for (g_209 = 0; (g_209 <= (-16)); g_209--) + { /* block id: 42 */ + int16_t l_218 = (-7L); + int32_t **l_228 = &l_214; + int32_t l_234[2][2]; + int8_t **l_237 = &l_229; + int16_t l_239 = 9L; + int i, j; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + l_234[i][j] = 0x28A2DDD9L; + } + (*l_215) = (*l_215); + l_218 |= 0x8B3ED55EL; + for (g_36 = 0; (g_36 > (-18)); g_36 = safe_sub_func_int8_t_s_s(g_36, 6)) + { /* block id: 47 */ + int32_t ***l_223 = NULL; + int32_t ***l_226 = NULL; + int32_t ***l_227[2][9][7] = {{{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215}},{{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215},{&l_215,&l_215,&l_215,&l_215,&l_215,&l_215,&l_215}}}; + const int16_t *l_252[3]; + int i, j, k; + for (i = 0; i < 3; i++) + l_252[i] = NULL; + l_234[0][1] = ((safe_mul_func_int16_t_s_s((252UL != (((((g_224 = &g_45) == (l_228 = &g_45)) ^ g_206) , (NULL == l_229)) , (safe_mod_func_uint16_t_u_u(0xFAF2L, g_48)))), (safe_lshift_func_uint8_t_u_s((*l_214), (**l_215))))) && 0UL); + for (p_188 = 0; (p_188 == 39); p_188 = safe_add_func_int32_t_s_s(p_188, 6)) + { /* block id: 53 */ + int8_t ***l_238 = &l_237; + (*l_238) = l_237; + if (l_239) + break; + for (p_189 = 24; (p_189 <= (-15)); p_189 = safe_sub_func_uint32_t_u_u(p_189, 1)) + { /* block id: 58 */ + const int32_t * const l_249 = NULL; + const int32_t *l_251 = NULL; + const int32_t **l_250 = &l_251; + for (l_218 = 1; (l_218 < (-23)); l_218 = safe_sub_func_uint32_t_u_u(l_218, 1)) + { /* block id: 61 */ + uint32_t l_245 = 0x37213558L; + uint32_t *l_248 = NULL; + if ((*g_225)) + break; + (*l_215) = (*g_224); + l_245--; + return l_248; + } + (*l_250) = l_249; + l_234[0][1] ^= (l_252[1] != &g_209); + } + } + } + } + g_255++; + return (uint32_t*) l_214; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int16_t func_190(int16_t p_191, int8_t p_192, uint32_t p_193, int32_t p_194) +{ /* block id: 36 */ + return p_193; +} + + +/* ------------------------------------------ */ +/* + * reads : g_206 + * writes: g_206 + */ +static int8_t func_196(int8_t p_197, const uint32_t p_198, uint32_t p_199, uint32_t p_200, uint16_t * p_201) +{ /* block id: 27 */ + int32_t l_210[3]; + int32_t *l_212 = NULL; + int32_t **l_211 = &l_212; + int32_t l_213 = 0L; + int i; + for (i = 0; i < 3; i++) + l_210[i] = 0x015C768AL; + for (g_206 = 0; (g_206 <= 2); g_206 += 1) + { /* block id: 30 */ + int i; + return l_210[g_206]; + } + (*l_211) = &l_210[2]; + return l_213; +} + + + + +/* ---------------------------------------- */ +int main (int argc, char* argv[]) +{ + int i, j, k; + int print_hash_value = 0; + if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; + platform_main_begin(); + crc32_gentab(); + func_1(); + transparent_crc(g_9, "g_9", print_hash_value); + transparent_crc(g_14, "g_14", print_hash_value); + transparent_crc(g_18, "g_18", print_hash_value); + transparent_crc(g_36, "g_36", print_hash_value); + transparent_crc(g_46, "g_46", print_hash_value); + transparent_crc(g_48, "g_48", print_hash_value); + transparent_crc(g_206, "g_206", print_hash_value); + transparent_crc(g_209, "g_209", print_hash_value); + transparent_crc(g_254, "g_254", print_hash_value); + transparent_crc(g_255, "g_255", print_hash_value); + for (i = 0; i < 10; i++) + { + for (j = 0; j < 7; j++) + { + for (k = 0; k < 2; k++) + { + transparent_crc(g_260[i][j][k], "g_260[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_263, "g_263", print_hash_value); + transparent_crc(g_282, "g_282", print_hash_value); + transparent_crc(g_300, "g_300", print_hash_value); + transparent_crc(g_393, "g_393", print_hash_value); + transparent_crc(g_405, "g_405", print_hash_value); + transparent_crc(g_416, "g_416", print_hash_value); + transparent_crc(g_438, "g_438", print_hash_value); + transparent_crc(g_447, "g_447", print_hash_value); + transparent_crc(g_450, "g_450", print_hash_value); + transparent_crc(g_459, "g_459", print_hash_value); + for (i = 0; i < 7; i++) + { + transparent_crc(g_460[i], "g_460[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_462, "g_462", print_hash_value); + transparent_crc(g_463, "g_463", print_hash_value); + transparent_crc(g_466, "g_466", print_hash_value); + transparent_crc(g_582, "g_582", print_hash_value); + transparent_crc(g_592, "g_592", print_hash_value); + transparent_crc(g_620, "g_620", print_hash_value); + transparent_crc(g_621, "g_621", print_hash_value); + for (i = 0; i < 1; i++) + { + transparent_crc(g_622[i], "g_622[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_641, "g_641", print_hash_value); + transparent_crc(g_642, "g_642", print_hash_value); + for (i = 0; i < 7; i++) + { + transparent_crc(g_643[i], "g_643[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_644, "g_644", print_hash_value); + transparent_crc(g_765, "g_765", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 10; j++) + { + transparent_crc(g_838[i][j], "g_838[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + for (i = 0; i < 3; i++) + { + transparent_crc(g_921[i], "g_921[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_1217, "g_1217", print_hash_value); + transparent_crc(g_1335, "g_1335", print_hash_value); + transparent_crc(g_1391, "g_1391", print_hash_value); + for (i = 0; i < 7; i++) + { + for (j = 0; j < 6; j++) + { + for (k = 0; k < 4; k++) + { + transparent_crc(g_1577[i][j][k], "g_1577[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_1665, "g_1665", print_hash_value); + transparent_crc(g_1679, "g_1679", print_hash_value); + transparent_crc(g_1760, "g_1760", print_hash_value); + transparent_crc(g_1844, "g_1844", print_hash_value); + transparent_crc(g_1961, "g_1961", print_hash_value); + transparent_crc(g_2280, "g_2280", print_hash_value); + transparent_crc(g_2284, "g_2284", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_2287[i], "g_2287[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2291, "g_2291", print_hash_value); + transparent_crc(g_2490, "g_2490", print_hash_value); + transparent_crc(g_2576, "g_2576", print_hash_value); + transparent_crc(g_2579, "g_2579", print_hash_value); + transparent_crc(g_2582, "g_2582", print_hash_value); + for (i = 0; i < 10; i++) + { + for (j = 0; j < 7; j++) + { + transparent_crc(g_2586[i][j], "g_2586[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2588, "g_2588", print_hash_value); + transparent_crc(g_2591, "g_2591", print_hash_value); + transparent_crc(g_2593, "g_2593", print_hash_value); + transparent_crc(g_2594, "g_2594", print_hash_value); + transparent_crc(g_2595, "g_2595", print_hash_value); + transparent_crc(g_2596, "g_2596", print_hash_value); + transparent_crc(g_2597, "g_2597", print_hash_value); + transparent_crc(g_2598, "g_2598", print_hash_value); + transparent_crc(g_2599, "g_2599", print_hash_value); + for (i = 0; i < 1; i++) + { + transparent_crc(g_2600[i], "g_2600[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2601, "g_2601", print_hash_value); + transparent_crc(g_2602, "g_2602", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + transparent_crc(g_2603[i][j], "g_2603[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2604, "g_2604", print_hash_value); + transparent_crc(g_2605, "g_2605", print_hash_value); + transparent_crc(g_2606, "g_2606", print_hash_value); + transparent_crc(g_2607, "g_2607", print_hash_value); + transparent_crc(g_2608, "g_2608", print_hash_value); + transparent_crc(g_2609, "g_2609", print_hash_value); + transparent_crc(g_2610, "g_2610", print_hash_value); + transparent_crc(g_2611, "g_2611", print_hash_value); + for (i = 0; i < 5; i++) + { + transparent_crc(g_2612[i], "g_2612[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2613, "g_2613", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 9; j++) + { + transparent_crc(g_2614[i][j], "g_2614[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2615, "g_2615", print_hash_value); + transparent_crc(g_2616, "g_2616", print_hash_value); + transparent_crc(g_2617, "g_2617", print_hash_value); + transparent_crc(g_2618, "g_2618", print_hash_value); + transparent_crc(g_2619, "g_2619", print_hash_value); + transparent_crc(g_2620, "g_2620", print_hash_value); + transparent_crc(g_2622, "g_2622", print_hash_value); + transparent_crc(g_2624, "g_2624", print_hash_value); + transparent_crc(g_2626, "g_2626", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_2628[i][j][k], "g_2628[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2629, "g_2629", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 7; j++) + { + transparent_crc(g_2630[i][j], "g_2630[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + for (i = 0; i < 9; i++) + { + transparent_crc(g_2632[i], "g_2632[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2634, "g_2634", print_hash_value); + transparent_crc(g_2636, "g_2636", print_hash_value); + transparent_crc(g_2638, "g_2638", print_hash_value); + transparent_crc(g_2640, "g_2640", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 10; j++) + { + for (k = 0; k < 4; k++) + { + transparent_crc(g_2642[i][j][k], "g_2642[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2644, "g_2644", print_hash_value); + transparent_crc(g_2646, "g_2646", print_hash_value); + transparent_crc(g_2648, "g_2648", print_hash_value); + transparent_crc(g_2650, "g_2650", print_hash_value); + transparent_crc(g_2652, "g_2652", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + transparent_crc(g_2655[i][j], "g_2655[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2657, "g_2657", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + transparent_crc(g_2659[i][j], "g_2659[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2661, "g_2661", print_hash_value); + transparent_crc(g_2662, "g_2662", print_hash_value); + transparent_crc(g_2664, "g_2664", print_hash_value); + transparent_crc(g_2668, "g_2668", print_hash_value); + for (i = 0; i < 4; i++) + { + transparent_crc(g_2670[i], "g_2670[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2672, "g_2672", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_2674[i], "g_2674[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2676, "g_2676", print_hash_value); + transparent_crc(g_2678, "g_2678", print_hash_value); + for (i = 0; i < 2; i++) + { + transparent_crc(g_2679[i], "g_2679[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2681, "g_2681", print_hash_value); + transparent_crc(g_2683, "g_2683", print_hash_value); + for (i = 0; i < 1; i++) + { + for (j = 0; j < 8; j++) + { + transparent_crc(g_2684[i][j], "g_2684[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + for (i = 0; i < 8; i++) + { + transparent_crc(g_2685[i], "g_2685[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2686, "g_2686", print_hash_value); + transparent_crc(g_2687, "g_2687", print_hash_value); + transparent_crc(g_2688, "g_2688", print_hash_value); + transparent_crc(g_2689, "g_2689", print_hash_value); + transparent_crc(g_2690, "g_2690", print_hash_value); + transparent_crc(g_2692, "g_2692", print_hash_value); + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) + { + transparent_crc(g_2694[i][j], "g_2694[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2696, "g_2696", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_2698[i], "g_2698[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2700, "g_2700", print_hash_value); + transparent_crc(g_2702, "g_2702", print_hash_value); + transparent_crc(g_2703, "g_2703", print_hash_value); + for (i = 0; i < 7; i++) + { + transparent_crc(g_2704[i], "g_2704[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2705, "g_2705", print_hash_value); + transparent_crc(g_2706, "g_2706", print_hash_value); + transparent_crc(g_2707, "g_2707", print_hash_value); + transparent_crc(g_2708, "g_2708", print_hash_value); + transparent_crc(g_2709, "g_2709", print_hash_value); + transparent_crc(g_2710, "g_2710", print_hash_value); + transparent_crc(g_2711, "g_2711", print_hash_value); + transparent_crc(g_2712, "g_2712", print_hash_value); + transparent_crc(g_2713, "g_2713", print_hash_value); + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + transparent_crc(g_2714[i][j], "g_2714[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2715, "g_2715", print_hash_value); + transparent_crc(g_2716, "g_2716", print_hash_value); + transparent_crc(g_2717, "g_2717", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 2; j++) + { + for (k = 0; k < 9; k++) + { + transparent_crc(g_2718[i][j][k], "g_2718[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2719, "g_2719", print_hash_value); + for (i = 0; i < 3; i++) + { + for (j = 0; j < 6; j++) + { + transparent_crc(g_2720[i][j], "g_2720[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2721, "g_2721", print_hash_value); + for (i = 0; i < 3; i++) + { + transparent_crc(g_2722[i], "g_2722[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2723, "g_2723", print_hash_value); + transparent_crc(g_2724, "g_2724", print_hash_value); + transparent_crc(g_2725, "g_2725", print_hash_value); + transparent_crc(g_2726, "g_2726", print_hash_value); + transparent_crc(g_2727, "g_2727", print_hash_value); + transparent_crc(g_2728, "g_2728", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 10; j++) + { + transparent_crc(g_2729[i][j], "g_2729[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2730, "g_2730", print_hash_value); + transparent_crc(g_2731, "g_2731", print_hash_value); + transparent_crc(g_2732, "g_2732", print_hash_value); + transparent_crc(g_2733, "g_2733", print_hash_value); + transparent_crc(g_2734, "g_2734", print_hash_value); + transparent_crc(g_2735, "g_2735", print_hash_value); + transparent_crc(g_2736, "g_2736", print_hash_value); + transparent_crc(g_2737, "g_2737", print_hash_value); + transparent_crc(g_2738, "g_2738", print_hash_value); + transparent_crc(g_2739, "g_2739", print_hash_value); + transparent_crc(g_2740, "g_2740", print_hash_value); + transparent_crc(g_2741, "g_2741", print_hash_value); + transparent_crc(g_2742, "g_2742", print_hash_value); + for (i = 0; i < 4; i++) + { + transparent_crc(g_2743[i], "g_2743[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2744, "g_2744", print_hash_value); + transparent_crc(g_2745, "g_2745", print_hash_value); + transparent_crc(g_2746, "g_2746", print_hash_value); + transparent_crc(g_2747, "g_2747", print_hash_value); + transparent_crc(g_2748, "g_2748", print_hash_value); + for (i = 0; i < 7; i++) + { + for (j = 0; j < 10; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_2749[i][j][k], "g_2749[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2750, "g_2750", print_hash_value); + for (i = 0; i < 2; i++) + { + transparent_crc(g_2751[i], "g_2751[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2752, "g_2752", print_hash_value); + for (i = 0; i < 9; i++) + { + transparent_crc(g_2753[i], "g_2753[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 6; i++) + { + transparent_crc(g_2754[i], "g_2754[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 7; i++) + { + for (j = 0; j < 7; j++) + { + transparent_crc(g_2755[i][j], "g_2755[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2756, "g_2756", print_hash_value); + transparent_crc(g_2757, "g_2757", print_hash_value); + transparent_crc(g_2758, "g_2758", print_hash_value); + transparent_crc(g_2759, "g_2759", print_hash_value); + transparent_crc(g_2760, "g_2760", print_hash_value); + transparent_crc(g_2761, "g_2761", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 1; j++) + { + transparent_crc(g_2762[i][j], "g_2762[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2763, "g_2763", print_hash_value); + transparent_crc(g_2764, "g_2764", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 5; j++) + { + transparent_crc(g_2765[i][j], "g_2765[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2766, "g_2766", print_hash_value); + for (i = 0; i < 4; i++) + { + transparent_crc(g_2767[i], "g_2767[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 4; i++) + { + for (j = 0; j < 6; j++) + { + transparent_crc(g_2768[i][j], "g_2768[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_2769, "g_2769", print_hash_value); + transparent_crc(g_2770, "g_2770", print_hash_value); + for (i = 0; i < 1; i++) + { + transparent_crc(g_2771[i], "g_2771[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2772, "g_2772", print_hash_value); + transparent_crc(g_2773, "g_2773", print_hash_value); + transparent_crc(g_2775, "g_2775", print_hash_value); + transparent_crc(g_2777, "g_2777", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_2779[i], "g_2779[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 5; i++) + { + for (j = 0; j < 7; j++) + { + for (k = 0; k < 7; k++) + { + transparent_crc(g_2781[i][j][k], "g_2781[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2783, "g_2783", print_hash_value); + transparent_crc(g_2786, "g_2786", print_hash_value); + transparent_crc(g_2788, "g_2788", print_hash_value); + transparent_crc(g_2790, "g_2790", print_hash_value); + transparent_crc(g_2792, "g_2792", print_hash_value); + transparent_crc(g_2794, "g_2794", print_hash_value); + transparent_crc(g_2796, "g_2796", print_hash_value); + transparent_crc(g_2798, "g_2798", print_hash_value); + transparent_crc(g_2800, "g_2800", print_hash_value); + transparent_crc(g_2802, "g_2802", print_hash_value); + transparent_crc(g_3269, "g_3269", print_hash_value); + transparent_crc(g_3271, "g_3271", print_hash_value); + for (i = 0; i < 9; i++) + { + transparent_crc(g_3292[i], "g_3292[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 4; i++) + { + transparent_crc(g_3356[i], "g_3356[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 8; i++) + { + transparent_crc(g_3412[i], "g_3412[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_3459, "g_3459", print_hash_value); + transparent_crc(g_3467, "g_3467", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 9; j++) + { + transparent_crc(g_3505[i][j], "g_3505[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + for (i = 0; i < 5; i++) + { + for (j = 0; j < 7; j++) + { + for (k = 0; k < 7; k++) + { + transparent_crc(g_4125[i][j][k], "g_4125[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_4174, "g_4174", print_hash_value); + transparent_crc(g_4176, "g_4176", print_hash_value); + transparent_crc(g_4198, "g_4198", print_hash_value); + transparent_crc(g_4308, "g_4308", print_hash_value); + transparent_crc(g_4424, "g_4424", print_hash_value); + transparent_crc(g_4663, "g_4663", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 3; j++) + { + transparent_crc(g_4770[i][j], "g_4770[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_4886, "g_4886", print_hash_value); + transparent_crc(g_4961, "g_4961", print_hash_value); + transparent_crc(g_4962, "g_4962", print_hash_value); + transparent_crc(g_5310, "g_5310", print_hash_value); + transparent_crc(g_5400, "g_5400", print_hash_value); + transparent_crc(g_5464, "g_5464", print_hash_value); + transparent_crc(g_5628, "g_5628", print_hash_value); + transparent_crc(g_5786, "g_5786", print_hash_value); + transparent_crc(g_5857, "g_5857", print_hash_value); + for (i = 0; i < 7; i++) + { + for (j = 0; j < 9; j++) + { + transparent_crc(g_6022[i][j], "g_6022[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_6166, "g_6166", print_hash_value); + transparent_crc(g_6188, "g_6188", print_hash_value); + transparent_crc(g_6191, "g_6191", print_hash_value); + transparent_crc(g_6438, "g_6438", print_hash_value); + for (i = 0; i < 10; i++) + { + transparent_crc(g_6794[i], "g_6794[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_6812, "g_6812", print_hash_value); + transparent_crc(g_6897, "g_6897", print_hash_value); + transparent_crc(g_6899, "g_6899", print_hash_value); + transparent_crc(g_6997, "g_6997", print_hash_value); + transparent_crc(g_7110, "g_7110", print_hash_value); + transparent_crc(g_7279, "g_7279", print_hash_value); + transparent_crc(g_7380, "g_7380", print_hash_value); + transparent_crc(g_7382, "g_7382", print_hash_value); + transparent_crc(g_7589, "g_7589", print_hash_value); + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 0 +breakdown: + depth: 0, occurrence: 1894 +XXX total union variables: 0 + +XXX max expression depth: 47 +breakdown: + depth: 1, occurrence: 705 + depth: 2, occurrence: 176 + depth: 3, occurrence: 16 + depth: 4, occurrence: 9 + depth: 5, occurrence: 4 + depth: 6, occurrence: 6 + depth: 7, occurrence: 4 + depth: 8, occurrence: 1 + depth: 9, occurrence: 2 + depth: 10, occurrence: 3 + depth: 11, occurrence: 1 + depth: 12, occurrence: 1 + depth: 13, occurrence: 5 + depth: 14, occurrence: 6 + depth: 15, occurrence: 2 + depth: 16, occurrence: 5 + depth: 17, occurrence: 4 + depth: 18, occurrence: 10 + depth: 19, occurrence: 5 + depth: 20, occurrence: 3 + depth: 21, occurrence: 9 + depth: 22, occurrence: 10 + depth: 23, occurrence: 6 + depth: 24, occurrence: 9 + depth: 25, occurrence: 12 + depth: 26, occurrence: 5 + depth: 27, occurrence: 8 + depth: 28, occurrence: 9 + depth: 29, occurrence: 6 + depth: 30, occurrence: 4 + depth: 31, occurrence: 4 + depth: 32, occurrence: 3 + depth: 33, occurrence: 6 + depth: 34, occurrence: 5 + depth: 36, occurrence: 7 + depth: 37, occurrence: 4 + depth: 38, occurrence: 2 + depth: 39, occurrence: 3 + depth: 40, occurrence: 1 + depth: 41, occurrence: 4 + depth: 42, occurrence: 2 + depth: 43, occurrence: 1 + depth: 45, occurrence: 1 + depth: 47, occurrence: 1 + +XXX total number of pointers: 1350 + +XXX times a variable address is taken: 3323 +XXX times a pointer is dereferenced on RHS: 1101 +breakdown: + depth: 1, occurrence: 746 + depth: 2, occurrence: 222 + depth: 3, occurrence: 125 + depth: 4, occurrence: 3 + depth: 5, occurrence: 3 + depth: 6, occurrence: 0 + depth: 7, occurrence: 1 + depth: 8, occurrence: 1 +XXX times a pointer is dereferenced on LHS: 1028 +breakdown: + depth: 1, occurrence: 798 + depth: 2, occurrence: 140 + depth: 3, occurrence: 59 + depth: 4, occurrence: 22 + depth: 5, occurrence: 4 + depth: 6, occurrence: 2 + depth: 7, occurrence: 0 + depth: 8, occurrence: 3 +XXX times a pointer is compared with null: 173 +XXX times a pointer is compared with address of another variable: 41 +XXX times a pointer is compared with another pointer: 48 +XXX times a pointer is qualified to be dereferenced: 25837 + +XXX max dereference level: 8 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 4384 + level: 2, occurrence: 1642 + level: 3, occurrence: 905 + level: 4, occurrence: 662 + level: 5, occurrence: 292 + level: 6, occurrence: 173 + level: 7, occurrence: 79 + level: 8, occurrence: 32 +XXX number of pointers point to pointers: 617 +XXX number of pointers point to scalars: 733 +XXX number of pointers point to structs: 0 +XXX percent of pointers has null in alias set: 29.6 +XXX average alias set size: 1.73 + +XXX times a non-volatile is read: 7045 +XXX times a non-volatile is write: 3404 +XXX times a volatile is read: 0 +XXX times read thru a pointer: 0 +XXX times a volatile is write: 0 +XXX times written thru a pointer: 0 +XXX times a volatile is available for access: 0 +XXX percentage of non-volatile access: 100 + +XXX forward jumps: 2 +XXX backward jumps: 21 + +XXX stmts: 733 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 82 + depth: 1, occurrence: 94 + depth: 2, occurrence: 113 + depth: 3, occurrence: 107 + depth: 4, occurrence: 162 + depth: 5, occurrence: 175 + +XXX percentage a fresh-made variable is used: 14.9 +XXX percentage an existing variable is used: 85.1 +********************* end of statistics **********************/ + + +// /usr/bin/python /media/alon/2f9a30d7-6124-42d9-87c5-3c80cb70ec54/home/alon/Dev/emscripten/emcc -O3 --llvm-opts 3 newfail_11275_1.cpp -I /home/alon/Dev/csmith/runtime -s ALLOW_MEMORY_GROWTH=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_WHITELIST='["_main"]' + diff --git a/tests/fuzz/24.cpp.txt b/tests/fuzz/24.cpp.txt new file mode 100644 index 0000000000000..9fe43a69d3a78 --- /dev/null +++ b/tests/fuzz/24.cpp.txt @@ -0,0 +1 @@ +checksum = 1A282BA8 diff --git a/tests/hello_world_gles_shell.html b/tests/hello_world_gles_shell.html index 22ecee7bcf6ac..8884ac2e0fdfc 100644 --- a/tests/hello_world_gles_shell.html +++ b/tests/hello_world_gles_shell.html @@ -44,7 +44,7 @@ setTimeout(function() { var secondImage = Module.canvas.toDataURL(); reportResult(firstImage != secondImage); - }, 0); + }, 500); } Module.postRun = doTest; diff --git a/tests/module/test_stdin.c b/tests/module/test_stdin.c index 2772fcf0b5477..c64403ab4e55d 100644 --- a/tests/module/test_stdin.c +++ b/tests/module/test_stdin.c @@ -25,8 +25,9 @@ void main_loop() if (ret > 0) puts(str); } + int err = ferror(stdin); if (ferror(stdin) && errno != EAGAIN) { - puts("error"); + printf("error %d\n", err); exit(EXIT_FAILURE); } diff --git a/tests/optimizer/safeLabelSetting-output.js b/tests/optimizer/safeLabelSetting-output.js new file mode 100644 index 0000000000000..b1accfe51d23a --- /dev/null +++ b/tests/optimizer/safeLabelSetting-output.js @@ -0,0 +1,18 @@ +function z1() { + var i = 0, j = 0; + print(i); +} +function z2() { + var i = 0, label = 0; + label = 0; + print(i); +} +function z3() { + var i = 0, label = 0; +} +function z4() { + var label = 0; + label = 0; + print(0); +} + diff --git a/tests/optimizer/safeLabelSetting.js b/tests/optimizer/safeLabelSetting.js new file mode 100644 index 0000000000000..d3c30153706a5 --- /dev/null +++ b/tests/optimizer/safeLabelSetting.js @@ -0,0 +1,17 @@ +function z1() { + var i = 0, j = 0; + print(i); +} +function z2() { + var i = 0, label = 0; + print(i); +} +function z3() { + var i = 0, label = 0; +} +function z4() { + var label = 0; + print(0); +} +// EMSCRIPTEN_GENERATED_FUNCTIONS: ["z1", "z2", "z3", "z4"] + diff --git a/tests/optimizer/test-js-optimizer-pointerMask-output.js b/tests/optimizer/test-js-optimizer-pointerMask-output.js index 7f8445a55ec0f..63400e8dbc8f0 100644 --- a/tests/optimizer/test-js-optimizer-pointerMask-output.js +++ b/tests/optimizer/test-js-optimizer-pointerMask-output.js @@ -1,72 +1,72 @@ function f() { - HEAP8[x >> 0]; + HEAP8[(x & MASK0) >> 0]; HEAP8[(x & MASK0) + 1 >> 0]; HEAP8[(x & MASK0) + 2 >> 0]; - HEAP8[(x + 1 & MASK0) + 2 >> 0]; - HEAP8[(x + 2 & MASK0) + 2 >> 0]; - HEAP8[(x + 1 + y & MASK0) + 2 >> 0]; - HEAP8[(x + 2 + y & MASK0) + 2 >> 0]; + HEAP8[(x & MASK0) + 3 >> 0]; + HEAP8[(x & MASK0) + 4 >> 0]; + HEAP8[(x + y & MASK0) + 3 >> 0]; + HEAP8[(x + y & MASK0) + 4 >> 0]; x(); - HEAP16[x >> 1]; - HEAP16[x + 1 >> 1]; + HEAP16[(x & MASK1) >> 1]; + HEAP16[(x + 1 & MASK1) >> 1]; HEAP16[(x & MASK1) + 2 >> 1]; HEAP16[(x + 1 & MASK1) + 2 >> 1]; - HEAP16[(x + 2 & MASK1) + 2 >> 1]; + HEAP16[(x & MASK1) + 4 >> 1]; HEAP16[(x + 1 + y & MASK1) + 2 >> 1]; - HEAP16[(x + 2 + y & MASK1) + 2 >> 1]; + HEAP16[(x + y & MASK1) + 4 >> 1]; HEAP16[(x + 1 + y & MASK1) + 4 >> 1]; - HEAP16[(x + 2 + y & MASK1) + 4 >> 1]; + HEAP16[(x + y & MASK1) + 6 >> 1]; HEAP16[(x + 1 + y & MASK1) + 4 >> 1]; - HEAP16[(x + 4 + y & MASK1) + 2 >> 1]; + HEAP16[(x + y & MASK1) + 6 >> 1]; x(); - HEAP32[x >> 2]; - HEAP32[x + 1 >> 2]; - HEAP32[x + 2 >> 2]; - HEAP32[x + 3 >> 2]; + HEAP32[(x & MASK2) >> 2]; + HEAP32[(x + 1 & MASK2) >> 2]; + HEAP32[(x + 2 & MASK2) >> 2]; + HEAP32[(x + 3 & MASK2) >> 2]; HEAP32[(x & MASK2) + 4 >> 2]; HEAP32[(x + 1 & MASK2) + 4 >> 2]; - HEAP32[(x + 4 & MASK2) + 4 >> 2]; + HEAP32[(x & MASK2) + 8 >> 2]; HEAP32[(x + 1 + y & MASK2) + 4 >> 2]; - HEAP32[(x + 4 + y & MASK2) + 4 >> 2]; + HEAP32[(x + y & MASK2) + 8 >> 2]; HEAP32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAP32[(x + 4 + y & MASK2) + 8 >> 2]; + HEAP32[(x + y & MASK2) + 12 >> 2]; HEAP32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAP32[(x + 8 + y & MASK2) + 4 >> 2]; + HEAP32[(x + y & MASK2) + 12 >> 2]; x(); - HEAPU32[x >> 2]; - HEAPU32[x + 1 >> 2]; + HEAPU32[(x & MASK2) >> 2]; + HEAPU32[(x + 1 & MASK2) >> 2]; HEAPU32[(x & MASK2) + 4 >> 2]; HEAPU32[(x + 1 & MASK2) + 4 >> 2]; - HEAPU32[(x + 4 & MASK2) + 4 >> 2]; + HEAPU32[(x & MASK2) + 8 >> 2]; HEAPU32[(x + 1 + y & MASK2) + 4 >> 2]; - HEAPU32[(x + 4 + y & MASK2) + 4 >> 2]; + HEAPU32[(x + y & MASK2) + 8 >> 2]; HEAPU32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAPU32[(x + 4 + y & MASK2) + 8 >> 2]; + HEAPU32[(x + y & MASK2) + 12 >> 2]; HEAPU32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAPU32[(x + 8 + y & MASK2) + 4 >> 2]; + HEAPU32[(x + y & MASK2) + 12 >> 2]; x(); - HEAPF32[x >> 2]; - HEAPF32[x + 1 >> 2]; + HEAPF32[(x & MASK2) >> 2]; + HEAPF32[(x + 1 & MASK2) >> 2]; HEAPF32[(x & MASK2) + 4 >> 2]; HEAPF32[(x + 1 & MASK2) + 4 >> 2]; - HEAPF32[(x + 4 & MASK2) + 4 >> 2]; + HEAPF32[(x & MASK2) + 8 >> 2]; HEAPF32[(x + 1 + y & MASK2) + 4 >> 2]; - HEAPF32[(x + 4 + y & MASK2) + 4 >> 2]; + HEAPF32[(x + y & MASK2) + 8 >> 2]; HEAPF32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAPF32[(x + 4 + y & MASK2) + 8 >> 2]; + HEAPF32[(x + y & MASK2) + 12 >> 2]; HEAPF32[(x + 1 + y & MASK2) + 8 >> 2]; - HEAPF32[(x + 8 + y & MASK2) + 4 >> 2]; + HEAPF32[(x + y & MASK2) + 12 >> 2]; x(); - HEAPF64[x >> 3]; - HEAPF64[x + 1 >> 3]; + HEAPF64[(x & MASK3) >> 3]; + HEAPF64[(x + 1 & MASK3) >> 3]; HEAPF64[(x & MASK3) + 8 >> 3]; HEAPF64[(x + 1 & MASK3) + 8 >> 3]; - HEAPF64[(x + 8 & MASK3) + 8 >> 3]; + HEAPF64[(x & MASK3) + 16 >> 3]; HEAPF64[(x + 1 + y & MASK3) + 8 >> 3]; - HEAPF64[(x + 8 + y & MASK3) + 8 >> 3]; + HEAPF64[(x + y & MASK3) + 16 >> 3]; HEAPF64[(x + 1 + y & MASK3) + 16 >> 3]; - HEAPF64[(x + 8 + y & MASK3) + 16 >> 3]; + HEAPF64[(x + y & MASK3) + 24 >> 3]; HEAPF64[(x + 1 + y & MASK3) + 16 >> 3]; - HEAPF64[(x + 16 + y & MASK3) + 8 >> 3]; + HEAPF64[(x + y & MASK3) + 24 >> 3]; } diff --git a/tests/parallel_test_core.py b/tests/parallel_test_core.py index 87b77ebf91d9f..b53b8fef81f64 100755 --- a/tests/parallel_test_core.py +++ b/tests/parallel_test_core.py @@ -1,21 +1,56 @@ #!/usr/bin/env python2 # This Python file uses the following encoding: utf-8 -import os, sys, subprocess, multiprocessing +import os, sys, subprocess, multiprocessing, threading, time from runner import test_modes, PYTHON, path_from_root # run slower ones first, to optimize total time optimal_order = ['asm3i', 'asm1i', 'asm2nn', 'asm3', 'asm2', 'asm2g', 'asm2f', 'asm1', 'default'] - assert set(optimal_order) == set(test_modes), 'need to update the list of slowest modes' +# clean up previous output +for mode in optimal_order: + if os.path.exists(mode + '.err'): + os.unlink(mode + '.err') + +# set up a background thread to report progress +class Watcher(threading.Thread): + stop = False + + def run(self): + last = -1 + while not Watcher.stop: + total = 0 + for mode in optimal_order: + if os.path.exists(mode + '.err'): + total += os.stat(mode + '.err').st_size + if total != last: + last = total + print >> sys.stderr, '[parallel_test_copy.py watcher] total output: %d' % total + time.sleep(1) + +watcher = Watcher() +watcher.start() + +# run tests for one mode def run_mode(mode): print '<< running %s >>' % mode proc = subprocess.Popen([PYTHON, path_from_root('tests', 'runner.py'), mode], stdout=open(mode + '.out', 'w'), stderr=open(mode + '.err', 'w')) proc.communicate() print '<< %s finished >>' % mode +# run all modes cores = int(os.environ.get('EMCC_CORES') or multiprocessing.cpu_count()) pool = multiprocessing.Pool(processes=cores) filenames = pool.map(run_mode, optimal_order, chunksize=1) +# quit watcher +Watcher.stop = True + +# emit all outputs +for mode in optimal_order: + print >> sys.stderr, '=== %s ===' % mode + if os.path.exists(mode + '.err'): + print >> sys.stderr, open(mode + '.err').read() + print >> sys.stderr + diff --git a/tests/runner.py b/tests/runner.py index 3407f392896f6..188e89542cbb1 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -772,7 +772,9 @@ def get_bullet_library(runner_core, use_cmake): os.path.join('src', 'LinearMath', 'libLinearMath.a')] else: configure_commands = ['sh', './configure'] - configure_args = ['--disable-demos','--disable-dependency-tracking'] + # Force a nondefault --host= so that the configure script will interpret that we are doing cross-compilation + # and skip attempting to run the generated executable with './a.out', which would fail since we are building a .js file. + configure_args = ['--host=i686-pc-linux-gnu', '--disable-demos','--disable-dependency-tracking'] generated_libs = [os.path.join('src', '.libs', 'libBulletDynamics.a'), os.path.join('src', '.libs', 'libBulletCollision.a'), os.path.join('src', '.libs', 'libLinearMath.a')] diff --git a/tests/sdl_togglefullscreen.c b/tests/sdl_togglefullscreen.c new file mode 100644 index 0000000000000..6816c5e756bbc --- /dev/null +++ b/tests/sdl_togglefullscreen.c @@ -0,0 +1,142 @@ +#include +#include +#include +#include + +static enum { + STATE_INITIAL, /* Initial state, click needed to enter full screen */ + STATE_FS_REQ, /* After click, expecting to enter full screen */ + STATE_FS, /* Should remain in full screen */ + STATE_FS_QUIT_REQ, /* Second click, expecting to leave full screen */ + STATE_FS_QUIT, /* Left full screen */ + STATE_SUCCESS, /* Reported success, test finished */ + STATE_ERROR /* Something went wrong, and an error was reported */ +} state = STATE_INITIAL; + +int result = 0; + +#if SDL_VERSION_ATLEAST(2,0,0) +SDL_Window *window = 0; +SDL_Renderer *renderer = 0; +#else +SDL_Surface *screen = 0; +#endif + +static void fail(const char *msg) { + printf("%s Test failed.\n", msg); + state = STATE_ERROR; + result = 0; +} + +static EM_BOOL mouseup(int eventType, + const EmscriptenMouseEvent *keyEvent, void *userData) { + if (eventType == EMSCRIPTEN_EVENT_MOUSEUP) { + switch (state) { + case STATE_INITIAL: +#if SDL_VERSION_ATLEAST(2,0,0) + SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN); +#else + SDL_WM_ToggleFullScreen(screen); +#endif + state = STATE_FS_REQ; + break; + case STATE_FS: +#if SDL_VERSION_ATLEAST(2,0,0) + SDL_SetWindowFullscreen(window, 0); +#else + SDL_WM_ToggleFullScreen(screen); +#endif + state = STATE_FS_QUIT_REQ; + break; + case STATE_FS_QUIT: + case STATE_SUCCESS: + case STATE_ERROR: + break; + default: + fail("Unexpected click."); + break; + } + } + + return 0; +} + +static void render() { +#if SDL_VERSION_ATLEAST(2,0,0) + SDL_SetRenderDrawColor(renderer, 255, 255, 0, 255); + SDL_RenderClear(renderer); + SDL_RenderPresent(renderer); +#else + int width, height, isfs; + emscripten_get_canvas_size(&width, &height, &isfs); + SDL_Rect rect = { 0, 0, width, height }; + SDL_FillRect(screen, &rect, 0xff00ffff); +#endif +} + +static void mainloop() { + render(); + int isInFullscreen = EM_ASM_INT_V(return !!(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement)); + + switch (state) { + case STATE_INITIAL: + if (isInFullscreen) fail("Unexpected full screen."); + break; + case STATE_FS_REQ: + if (isInFullscreen) { + state = STATE_FS; + printf("Successfully transitioned to fullscreen mode.\n"); + } + break; + case STATE_FS: + if (!isInFullscreen) fail("Unexpectedly left full screen."); + break; + case STATE_FS_QUIT_REQ: + if (!isInFullscreen) { + state = STATE_FS_QUIT; + /* One more render() call is needed to make sure canvas is yellow, + * so don't quit yet. + */ + } + break; + case STATE_FS_QUIT: + if (isInFullscreen) fail("Unexpected full screen."); + state = STATE_SUCCESS; + printf("Exited fullscreen. Test succeeded.\n"); + result = 1; + break; + case STATE_ERROR: + case STATE_SUCCESS: +#ifdef REPORT_RESULT + { + REPORT_RESULT(); + } +#endif + emscripten_cancel_main_loop(); + break; + } +} + +int main() { + SDL_Init(SDL_INIT_VIDEO); +#if SDL_VERSION_ATLEAST(2,0,0) + window = SDL_CreateWindow(NULL, 0, 0, 600, 450, SDL_WINDOW_SHOWN); + renderer = SDL_CreateRenderer(window, -1, 0); +#else + screen = SDL_SetVideoMode(600, 450, 32, SDL_HWSURFACE); +#endif + + /* SDL 1 limits which events can be used here. + * Click and mouseup don't work. + */ + if (emscripten_set_mouseup_callback(NULL, NULL, 1, mouseup) != EMSCRIPTEN_RESULT_SUCCESS) { + printf("Couldn't to set mouse callback. Test failed.\n"); + } + + printf("You should see a yellow canvas.\n"); + printf("Click on the canvas to enter full screen, and then click on the canvas again to finish the test.\n"); + printf("When in full screen, you should see the whole screen filled yellow.\n"); + printf("After exiting, the yellow canvas should be restored in the window.\n"); + emscripten_set_main_loop(mainloop, 0, 0); + return 0; +} diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index efbb2ce91060b..8ae3d23b4eabc 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -136,6 +136,7 @@ def run(self, args): #NativeBenchmarker(default_native_name, os.path.join(default_native, 'clang'), os.path.join(default_native, 'clang++')), #NativeBenchmarker('clang', CLANG_CC, CLANG), #NativeBenchmarker('clang-3.6', os.path.join(LLVM_3_6, 'clang'), os.path.join(LLVM_3_6, 'clang++')), + #NativeBenchmarker(default_native_name, os.path.join(default_native, 'clang'), os.path.join(default_native, 'clang++')), #NativeBenchmarker('clang-3.2-O3', os.path.join(default_native, 'clang'), os.path.join(default_native, 'clang++'), ['-O3']), #NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')), #NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')), diff --git a/tests/test_browser.py b/tests/test_browser.py index 52a921b3f3d89..b755e4fe641bc 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -9,6 +9,8 @@ cmd = shlex.split(emscripten_browser) def run_in_other_browser(url): Popen(cmd + [url]) + if EM_BUILD_VERBOSE_LEVEL >= 3: + print >> sys.stderr, "using Emscripten browser: " + str(cmd) webbrowser.open_new = run_in_other_browser def test_chunked_synchronous_xhr_server(support_byte_ranges, chunkSize, data, checksum): @@ -1936,6 +1938,10 @@ def test_worker_api_3(self): Popen([PYTHON, EMCC, path_from_root('tests', 'worker_api_3_worker.cpp'), '-o', 'worker.js', '-s', 'BUILD_AS_WORKER=1', '-s', 'EXPORTED_FUNCTIONS=["_one"]']).communicate() self.btest('worker_api_3_main.cpp', expected='5') + def test_worker_api_sleep(self): + Popen([PYTHON, EMCC, path_from_root('tests', 'worker_api_worker_sleep.cpp'), '-o', 'worker.js', '-s', 'BUILD_AS_WORKER=1', '-s', 'EXPORTED_FUNCTIONS=["_one"]', '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1']).communicate() + self.btest('worker_api_main.cpp', expected='566') + def test_emscripten_async_wget2(self): self.btest('http.cpp', expected='0', args=['-I' + path_from_root('tests')]) @@ -1967,9 +1973,10 @@ def test_emrun(self): # and the browser will not close as part of the test, pinning down the cwd on Windows and it wouldn't be possible to delete it. Therefore switch away from that directory # before launching. os.chdir(path_from_root()) - args = [PYTHON, path_from_root('emrun'), '--timeout', '30', '--verbose', '--log_stdout', os.path.join(outdir, 'stdout.txt'), '--log_stderr', os.path.join(outdir, 'stderr.txt'), os.path.join(outdir, 'hello_world.html'), '1', '2', '--3'] + args = [PYTHON, path_from_root('emrun'), '--timeout', '30', '--verbose', '--log_stdout', os.path.join(outdir, 'stdout.txt'), '--log_stderr', os.path.join(outdir, 'stderr.txt')] if emscripten_browser is not None: args += ['--browser', emscripten_browser] + args += [os.path.join(outdir, 'hello_world.html'), '1', '2', '--3'] process = subprocess.Popen(args) process.communicate() stdout = open(os.path.join(outdir, 'stdout.txt'), 'r').read() @@ -2033,6 +2040,11 @@ def test_html5_webgl_create_context(self): print opts self.btest(path_from_root('tests', 'webgl_create_context.cpp'), args=opts, expected='0') + def test_html5_webgl_destroy_context(self): + for opts in [[], ['-O2', '-g1'], ['-s', 'FULL_ES2=1']]: + print opts + self.btest(path_from_root('tests', 'webgl_destroy_context.cpp'), args=opts + ['--shell-file', path_from_root('tests/webgl_destroy_context_shell.html'), '-s', 'NO_EXIT_RUNTIME=1'], expected='0') + def test_sdl_touch(self): for opts in [[], ['-O2', '-g1', '--closure', '1']]: print opts @@ -2163,8 +2175,11 @@ def test_asm_swapping(self): Popen([PYTHON, path_from_root('tools', 'distill_asm.py'), 'a.out.js', 'second.js', 'swap-in']).communicate() assert os.path.exists('second.js') - out = run_js('second.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE, full_output=True, assert_returncode=None) - self.validate_asmjs(out) + if isinstance(SPIDERMONKEY_ENGINE, list) and len(SPIDERMONKEY_ENGINE[0]) != 0: + out = run_js('second.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE, full_output=True, assert_returncode=None) + self.validate_asmjs(out) + else: + print 'Skipping asm validation check, spidermonkey is not configured' self.btest(path_from_root('tests', 'asm_swap.cpp'), args=['-s', 'SWAPPABLE_ASM_MODULE=1', '-s', 'NO_EXIT_RUNTIME=1', '--pre-js', 'run.js'] + opts, expected='999') @@ -2573,3 +2588,12 @@ def test_modularize(self): ''' % code) self.run_browser('a.html', '...', '/report_result?0') + def test_webidl(self): + # see original in test_core.py + output = Popen([PYTHON, path_from_root('tools', 'webidl_binder.py'), + path_from_root('tests', 'webidl', 'test.idl'), + 'glue']).communicate()[0] + assert os.path.exists('glue.cpp') + assert os.path.exists('glue.js') + self.btest(os.path.join('webidl', 'test.cpp'), '1', args=['--post-js', 'glue.js', '-I' + path_from_root('tests', 'webidl'), '-DBROWSER']) + diff --git a/tests/test_core.py b/tests/test_core.py index 45a64c06fe504..6537561044fc2 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4794,6 +4794,22 @@ def test_unistd_links(self): Building.COMPILER_TEST_OPTS = orig_compiler_opts + ['-D' + fs] self.do_run(src, expected, js_engines=[NODE_JS]) + def test_unistd_symlink_on_nodefs(self): + self.clear() + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') + orig_compiler_opts = Building.COMPILER_TEST_OPTS[:] + for fs in ['NODEFS']: + if WINDOWS and fs == 'NODEFS': + print >> sys.stderr, 'Skipping NODEFS part of this test for test_unistd_symlink_on_nodefs on Windows, since it would require administrative privileges.' + # Also, other detected discrepancies if you do end up running this test on NODEFS: + # test expects /, but Windows gives \ as path slashes. + # Calling readlink() on a non-link gives error 22 EINVAL on Unix, but simply error 0 OK on Windows. + continue + src = open(path_from_root('tests', 'unistd', 'symlink_on_nodefs.c'), 'r').read() + expected = open(path_from_root('tests', 'unistd', 'symlink_on_nodefs.out'), 'r').read() + Building.COMPILER_TEST_OPTS = orig_compiler_opts + ['-D' + fs] + self.do_run(src, expected, js_engines=[NODE_JS]) + def test_unistd_sleep(self): src = open(path_from_root('tests', 'unistd', 'sleep.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'sleep.out'), 'r').read() @@ -5523,7 +5539,6 @@ def test_sqlite(self): Settings.CORRECT_ROUNDINGS = 0 if self.emcc_args is None: Settings.SAFE_HEAP = 0 # uses time.h to set random bytes, other stuff Settings.DISABLE_EXCEPTION_CATCHING = 1 - Settings.FAST_MEMORY = 4*1024*1024 Settings.EXPORTED_FUNCTIONS += ['_sqlite3_open', '_sqlite3_close', '_sqlite3_exec', '_sqlite3_free', '_callback']; if Settings.ASM_JS == 1 and '-g' in self.emcc_args: print "disabling inlining" # without registerize (which -g disables), we generate huge amounts of code @@ -5554,10 +5569,18 @@ def test_zlib(self): Settings.CORRECT_SIGNS = 1 + use_cmake_configure = WINDOWS + if use_cmake_configure: + make_args = [] + configure = [PYTHON, path_from_root('emcmake'), 'cmake', '.', '-DBUILD_SHARED_LIBS=OFF'] + else: + make_args = ['libz.a'] + configure = ['sh', './configure'] + self.do_run(open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(), open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(), - libraries=self.get_library('zlib', os.path.join('libz.a'), make_args=['libz.a']), - includes=[path_from_root('tests', 'zlib')], + libraries=self.get_library('zlib', os.path.join('libz.a'), make_args=make_args, configure=configure), + includes=[path_from_root('tests', 'zlib'), os.path.join(self.get_dir(), 'building', 'zlib')], force_c=True) def test_the_bullet(self): # Called thus so it runs late in the alphabetical cycle... it is long @@ -6350,21 +6373,20 @@ def test_embind_2(self): if self.run_name == 'slow2asm': return self.skip('embind/asm.js requires fastcomp') Building.COMPILER_TEST_OPTS += ['--bind', '--post-js', 'post.js'] open('post.js', 'w').write(''' - Module.print('lerp ' + Module.lerp(1, 2, 0.66) + '.'); + Module.print('lerp ' + Module.lerp(100, 200, 66) + '.'); ''') src = r''' #include - #include #include using namespace emscripten; - float lerp(float a, float b, float t) { - return (1 - t) * a + t * b; + int lerp(int a, int b, int t) { + return (100 - t) * a + t * b; } EMSCRIPTEN_BINDINGS(my_module) { function("lerp", &lerp); } ''' - self.do_run(src, 'lerp 1.66'); + self.do_run(src, 'lerp 166'); def test_scriptaclass(self): if self.emcc_args is None: return self.skip('requires emcc') @@ -7368,15 +7390,16 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0, TT = type(fullname, (T,), dict(run_name = fullname, env = env)) def tearDown(self): - super(TT, self).tearDown() - - for k, v in self.env.iteritems(): - del os.environ[k] + try: + super(TT, self).tearDown() + finally: + for k, v in self.env.iteritems(): + del os.environ[k] - # clear global changes to Building - Building.COMPILER_TEST_OPTS = [] - Building.COMPILER = CLANG - Building.LLVM_OPTS = 0 + # clear global changes to Building + Building.COMPILER_TEST_OPTS = [] + Building.COMPILER = CLANG + Building.LLVM_OPTS = 0 TT.tearDown = tearDown diff --git a/tests/test_interactive.py b/tests/test_interactive.py index a9d2ba7073061..83422e9e86d99 100644 --- a/tests/test_interactive.py +++ b/tests/test_interactive.py @@ -9,6 +9,8 @@ cmd = shlex.split(emscripten_browser) def run_in_other_browser(url): Popen(cmd + [url]) + if EM_BUILD_VERBOSE_LEVEL >= 3: + print >> sys.stderr, "using Emscripten browser: " + str(cmd) webbrowser.open_new = run_in_other_browser class interactive(BrowserCore): @@ -34,6 +36,9 @@ def test_sdl_touch(self): def test_sdl_wm_togglefullscreen(self): self.btest('sdl_wm_togglefullscreen.c', expected='1', args=['-s', 'NO_EXIT_RUNTIME=1']) + def test_sdl2_togglefullscreen(self): + self.btest('sdl_togglefullscreen.c', expected='1', args=['-s', 'USE_SDL=2', '-s', 'NO_EXIT_RUNTIME=1']) + def test_sdl_audio(self): shutil.copyfile(path_from_root('tests', 'sounds', 'alarmvictory_1.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) shutil.copyfile(path_from_root('tests', 'sounds', 'alarmcreatemiltaryfoot_1.wav'), os.path.join(self.get_dir(), 'sound2.wav')) diff --git a/tests/test_other.py b/tests/test_other.py index 0571ea9b30d86..7bff0e576657f 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -276,6 +276,29 @@ def test_emcc(self): # TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link! # TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py. + def test_emcc_nonfastcomp_fails(self): + open(os.path.join(self.get_dir(), 'test.c'), 'w').write(r''' + int main() { + return 0; + } + ''') + def check_errors(command): + process = Popen(command, stdout=PIPE, stderr=PIPE) + stdout, stderr = process.communicate() + self.assertEqual(stdout, '') + self.assertIn('Non-fastcomp compiler is no longer available', stderr) + self.assertEqual(process.returncode, 1) + def check_success(command): + process = Popen(command, stdout=PIPE, stderr=PIPE) + stdout, stderr = process.communicate() + self.assertEqual(stderr, '') + self.assertEqual(process.returncode, 0) + nonfastcomp(lambda: check_success([PYTHON, EMCC, '--version'])) + nonfastcomp(lambda: check_success([PYTHON, EMCC, '--help'])) + nonfastcomp(lambda: check_errors([PYTHON, EMCC, '-v'])) + nonfastcomp(lambda: check_errors([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.c')])) + self.assertFalse(os.path.exists('a.out.js')) + def test_emcc_nonfastcomp(self): return self.skip('non-fastcomp is deprecated and fails in 3.5') nonfastcomp(self.test_emcc) @@ -395,18 +418,18 @@ def check_makefile(configuration, dirname): try: os.chdir(tempdirname) - verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 - # Run Cmake if invoke_method == 'cmake': # Test invoking cmake directly. cmd = ['cmake', '-DCMAKE_TOOLCHAIN_FILE='+path_from_root('cmake', 'Modules', 'Platform', 'Emscripten.cmake'), '-DCMAKE_BUILD_TYPE=' + configuration, cmake_arguments[i], '-G', generator, cmakelistsdir] + env = tools.shared.Building.remove_sh_exe_from_path(os.environ) else: # Test invoking via 'emconfigure cmake' cmd = [emconfigure, 'cmake', '-DCMAKE_BUILD_TYPE=' + configuration, cmake_arguments[i], '-G', generator, cmakelistsdir] - - ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE, stderr=None if verbose_level >= 1 else PIPE).communicate() + env = os.environ.copy() + + ret = Popen(cmd, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else PIPE, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else PIPE, env=env).communicate() if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. if len(ret) > 1 and ret[1] != None and 'error' in ret[1].lower(): @@ -419,9 +442,9 @@ def check_makefile(configuration, dirname): # Build cmd = make - if verbose_level >= 3 and 'Ninja' not in generator: + if EM_BUILD_VERBOSE_LEVEL >= 3 and 'Ninja' not in generator: cmd += ['VERBOSE=1'] - ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE).communicate() + ret = Popen(cmd, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else PIPE).communicate() if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. if len(ret) > 0 and ret[0] != None and 'error' in ret[0].lower() and not '0 error(s)' in ret[0].lower(): @@ -1224,12 +1247,13 @@ def test_stdin(self): for engine in JS_ENGINES: if engine == V8_ENGINE: continue # no stdin support in v8 shell + engine[0] = os.path.normpath(engine[0]) print >> sys.stderr, engine # work around a bug in python's subprocess module # (we'd use run_js() normally) try_delete('out.txt') if os.name == 'nt': # windows - os.system('type "in.txt" | {} >out.txt'.format(' '.join(make_js_command(exe, engine)))) + os.system('type "in.txt" | {} >out.txt'.format(' '.join(make_js_command(os.path.normpath(exe), engine)))) else: # posix os.system('cat in.txt | {} > out.txt'.format(' '.join(make_js_command(exe, engine)))) self.assertContained('abcdef\nghijkl\neof', open('out.txt').read()) @@ -1993,6 +2017,8 @@ def test_js_optimizer(self): ['asm', 'eliminate', 'registerize', 'asmLastOpts', 'last']), (path_from_root('tests', 'optimizer', 'simd.js'), open(path_from_root('tests', 'optimizer', 'simd-output.js')).read(), ['asm', 'eliminate']), # eliminate, just enough to trigger asm normalization/denormalization + (path_from_root('tests', 'optimizer', 'safeLabelSetting.js'), open(path_from_root('tests', 'optimizer', 'safeLabelSetting-output.js')).read(), + ['asm', 'safeLabelSetting']), # eliminate, just enough to trigger asm normalization/denormalization ]: print input, passes @@ -2964,12 +2990,13 @@ def test(src, nums): [['--profiling', '-g2'], nums[2]] ]: print opts, ifs + if type(ifs) == int: ifs = [ifs] try_delete('a.out.js') Popen([PYTHON, EMCC, 'src.c', '-O2'] + opts, stdout=PIPE).communicate() src = open('a.out.js').read() main = src[src.find('function _main'):src.find('\n}', src.find('function _main'))] actual_ifs = main.count('if (') - assert ifs == actual_ifs, main + ' : ' + str([ifs, actual_ifs]) + assert actual_ifs in ifs, main + ' : ' + str([ifs, actual_ifs]) #print main test(r''' @@ -3028,7 +3055,7 @@ def test(src, nums): printf("and that's that\n"); return 0; } - ''', [2, 1, 1]) + ''', [[3,2], 1, 1]) test(r''' #include @@ -3041,7 +3068,7 @@ def test(src, nums): printf("and that's that\n"); return 0; } - ''', [2, 1, 1]) + ''', [[3,2], 1, 1]) def test_symbol_map(self): for m in [0, 1]: @@ -4563,7 +4590,7 @@ def do_log_test(source, expected, func): print ' seen', seen, ', expected ', expected, type(seen), type(expected) assert expected == seen or seen in expected, ['expect', expected, 'but see', seen] - do_log_test(path_from_root('tests', 'primes.cpp'), 86, 'main') + do_log_test(path_from_root('tests', 'primes.cpp'), 87, 'main') do_log_test(path_from_root('tests', 'fannkuch.cpp'), 230, 'fannkuch_worker') # test non-native as well, registerizeHarder can be a little more efficient here @@ -4581,6 +4608,13 @@ def test_emterpreter_advise(self): out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'emterpreter_advise_funcptr.cpp'), '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1', '-s', 'EMTERPRETIFY_ADVISE=1'], stdout=PIPE).communicate() self.assertContained('-s EMTERPRETIFY_WHITELIST=\'["__Z4posti", "__Z5post2i", "__Z6middlev", "__Z7sleeperv", "__Z8recurserv", "_main"]\'', out) + self.assertNotContained('EMTERPRETIFY_YIELDLIST', out); + + out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'emterpreter_advise_funcptr.cpp'), '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1', '-s', 'EMTERPRETIFY_ADVISE=1', '-s', 'EMTERPRETIFY_YIELDLIST=["__Z6middlev"]'], stdout=PIPE).communicate() + self.assertContained('-s EMTERPRETIFY_YIELDLIST=\'["__Z6middlev", "__Z7siblingii", "__Z7sleeperv", "__Z8recurserv", "_printf"]\'', out) + + out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'emterpreter_advise_funcptr.cpp'), '-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1', '-s', 'EMTERPRETIFY_ADVISE=1', '-s', 'EMTERPRETIFY_YIELDLIST=["__Z3pref"]'], stdout=PIPE).communicate() + self.assertContained('-s EMTERPRETIFY_YIELDLIST=\'["__Z3pref", "__Z7siblingii", "_printf"]\'', out) def test_link_with_a_static(self): for args in [[], ['-O2']]: @@ -4892,3 +4926,58 @@ def test(opts, expected): test(['-Os'], 1) test(['-Oz'], 1) + def test_massive_alloc(self): + if SPIDERMONKEY_ENGINE not in JS_ENGINES: return self.skip('cannot run without spidermonkey, node cannnot alloc huge arrays') + + open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' +#include +#include + +int main() { + return (int)malloc(1024*1024*1400); +} + ''') + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-s', 'ALLOW_MEMORY_GROWTH=1']).communicate()[1] + assert os.path.exists('a.out.js') + output = run_js('a.out.js', stderr=PIPE, full_output=True, engine=SPIDERMONKEY_ENGINE, assert_returncode=None) + # just care about message regarding allocating over 1GB of memory + self.assertContained('''Warning: Enlarging memory arrays, this is not fast! 16777216,1543503872\n''', output) + + def test_failing_alloc(self): + open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' +#include +#include +#include +#include + +#define CHUNK_SIZE (10*1024*1024) + +int main() { + std::vector allocs; + bool has = false; + while (1) { + printf("trying an allocation\n"); + void* curr = malloc(CHUNK_SIZE); + if (!curr) break; + has = true; + printf("allocated another chunk, %d so far\n", allocs.size()); + allocs.push_back(curr); + } + assert(has); + printf("an allocation failed!\n"); + while (1) { + void *curr = allocs.back(); + allocs.pop_back(); + free(curr); + printf("freed one\n"); + if (malloc(CHUNK_SIZE)) break; + } + printf("managed another malloc!\n"); +} + ''') + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-s', 'ALLOW_MEMORY_GROWTH=1']).communicate()[1] + assert os.path.exists('a.out.js') + output = run_js('a.out.js', stderr=PIPE, full_output=True, assert_returncode=None) + # just care about message regarding allocating over 1GB of memory + self.assertContained('''managed another malloc!\n''', output) + diff --git a/tests/unistd/links.out b/tests/unistd/links.out index f2a7aed660918..b0fea4f9f998a 100644 --- a/tests/unistd/links.out +++ b/tests/unistd/links.out @@ -1,17 +1,17 @@ readlink(link) -ret: 17 +ret: 7 errno: 0 -result: ../test/../there! +result: /there! readlink(file) ret: -1 errno: 22 -result: ../test/../there! +result: /there! readlink(folder) ret: -1 errno: 22 -result: ../test/../there! +result: /there! symlink/overwrite ret: -1 @@ -21,11 +21,11 @@ symlink/normal ret: 0 errno: 0 readlink(created link) -ret: 20 +ret: 36 errno: 0 -result: new-nonexistent-path +result: /working/folder/new-nonexistent-path readlink(short buffer) ret: 3 errno: 0 -result: ../-nonexistent-path +result: /thrking/folder/new-nonexistent-path diff --git a/tests/unistd/symlink_on_nodefs.c b/tests/unistd/symlink_on_nodefs.c new file mode 100644 index 0000000000000..006e87c08a9f5 --- /dev/null +++ b/tests/unistd/symlink_on_nodefs.c @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int main() { + EM_ASM( + fs.mkdirSync('./new-directory', '0777'); + fs.writeFileSync('./new-directory/test', 'Link it'); + fs.symlinkSync(fs.realpathSync('./new-directory'), './symlink'); + + FS.mkdir('working'); + FS.mount(NODEFS, { root: '.' }, 'working'); + + FS.mkdir('direct-link'); + FS.mount(NODEFS, { root: './symlink' }, 'direct-link'); + ); + + { + char* path = "/working/symlink/test"; + printf("reading %s\n", path); + + FILE* fd = fopen(path, "r"); + if (fd == NULL) { + printf("failed to open file %s\n", path); + } + else { + char buffer[8]; + fread(buffer, 1, 7, fd); + printf("buffer is %s\n", buffer); + fclose(fd); + } + } + + printf("\n"); + + { + char* path = "/direct-link/test"; + printf("reading %s\n", path); + + FILE* fd = fopen(path, "r"); + if (fd != NULL) { + // This should not happen, it resolves to ../new-directory which is not mounted + printf("opened file %s\n", path); + fclose(fd); + } + else { + printf("failed to open file %s\n", path); + } + } + + return 0; +} diff --git a/tests/unistd/symlink_on_nodefs.out b/tests/unistd/symlink_on_nodefs.out new file mode 100644 index 0000000000000..e8903b3727613 --- /dev/null +++ b/tests/unistd/symlink_on_nodefs.out @@ -0,0 +1,5 @@ +reading /working/symlink/test +buffer is Link it + +reading /direct-link/test +failed to open file /direct-link/test diff --git a/tests/webgl_destroy_context.cpp b/tests/webgl_destroy_context.cpp new file mode 100644 index 0000000000000..7226eb9501bfb --- /dev/null +++ b/tests/webgl_destroy_context.cpp @@ -0,0 +1,60 @@ +#include +#include + +#include +#include +#include +#include +#include + +int result = 0; +void report_result() +{ + printf("Test finished with result %d\n", result); +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif +} + +void finish(void*) +{ + report_result(); +} + +EM_BOOL context_lost(int eventType, const void *reserved, void *userData) +{ + printf("C code received a signal for WebGL context lost! This should not happen!\n"); + result = 1; + report_result(); + return 0; +} + +EM_BOOL context_restored(int eventType, const void *reserved, void *userData) +{ + printf("C code received a signal for WebGL context restored! This should not happen!\n"); + result = 1; + report_result(); + return 0; +} + +int main() +{ + EmscriptenWebGLContextAttributes attrs; + emscripten_webgl_init_context_attributes(&attrs); + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(0, &attrs); + emscripten_set_webglcontextlost_callback(0, 0, 0, context_lost); + emscripten_set_webglcontextrestored_callback(0, 0, 0, context_restored); + // When we force a context loss, we should get an event, i.e. context_lost_desired() should get called. + EM_ASM_INT({ + // The GL object is accessed here in a closure unsafe manner, so this test should not be run with closure enabled. + Module['firstGLContextExt'] = GL.contexts[$0].GLctx.getExtension('WEBGL_lose_context'); + }, context); + + emscripten_webgl_destroy_context(context); + + EM_ASM_INT({ + Module['firstGLContextExt'].loseContext(); + }, context); + + emscripten_async_call(finish, 0, 3000); +} diff --git a/tests/webgl_destroy_context_shell.html b/tests/webgl_destroy_context_shell.html new file mode 100644 index 0000000000000..cc4604ac87cbb --- /dev/null +++ b/tests/webgl_destroy_context_shell.html @@ -0,0 +1,145 @@ + + + + + + Emscripten-Generated Code + + + +
+
emscripten
+
Downloading...
+
+ +
+
+ +
+
+
+ Resize canvas + Lock/hide mouse pointer +     + +
+ +
+ +
+ + {{{ SCRIPT }}} + + diff --git a/tests/webidl/test.cpp b/tests/webidl/test.cpp index 65166f8d59bf2..8719ec1f3682b 100644 --- a/tests/webidl/test.cpp +++ b/tests/webidl/test.cpp @@ -9,3 +9,11 @@ typedef EnumNamespace::EnumInNamespace EnumNamespace_EnumInNamespace; #include "glue.cpp" +#ifdef BROWSER +int main() { + printf("main().\n"); + int result = 1; + REPORT_RESULT(); +} +#endif + diff --git a/tests/worker_api_worker_sleep.cpp b/tests/worker_api_worker_sleep.cpp new file mode 100644 index 0000000000000..96dae26f6060b --- /dev/null +++ b/tests/worker_api_worker_sleep.cpp @@ -0,0 +1,17 @@ +#include +#include + +extern "C" { + +void one(char *data, int size) { + int *x = (int*)data; + int num = size/sizeof(int); + for (int i = 0; i < num; i++) { + x[i] += 1234; + } + emscripten_sleep(1000); + emscripten_worker_respond(data, size); +} + +} + diff --git a/tools/emterpretify.py b/tools/emterpretify.py index 48267fae727f2..364311909b545 100755 --- a/tools/emterpretify.py +++ b/tools/emterpretify.py @@ -221,7 +221,7 @@ def handle_arg(arg): 'SWITCH', # [lx, ly, lz] switch (lx) { .. }. followed by a jump table for values in range [ly..ly+lz), after which is the default (which might be empty) 'RET', # [l, 0, 0] return l (depending on which emterpreter_x we are in, has the right type) - 'FUNC', # [num params, total locals (low 8 bits), total locals (high 8 bits)] [which emterpreter (0 = normal, 1 = zero), 0, last zeroinit = num params + num zero-inits (low 8), (high 8)] function with n locals (each taking 64 bits), of which the first are params + 'FUNC', # [num params, total locals (low 8 bits), total locals (high 8 bits)] [which emterpreter (0 = normal, 1 = zero), 0, 0, 0] function with n locals (each taking 64 bits), of which the first are params # this is read in the emterpreter prelude, and also in intcalls # slow locals support - copying from/to slow locals @@ -679,12 +679,6 @@ def process(code): assert(((HEAPU8[pc>>0]>>>0) == %d)|0); lx = HEAPU16[pc + 2 >> 1] | 0; // num locals %s - ly = HEAPU8[pc + 1 >> 0] | 0; // first zeroinit (after params) - lz = HEAPU16[pc + 6 >> 1] | 0; // offset of last zeroinit - while ((ly | 0) < (lz | 0)) { // clear the zeroinits - %s = +0; - ly = ly + 1 | 0; - } %s //print('enter func ' + [pc, HEAPU8[pc + 0],HEAPU8[pc + 1],HEAPU8[pc + 2],HEAPU8[pc + 3],HEAPU8[pc + 4],HEAPU8[pc + 5],HEAPU8[pc + 6],HEAPU8[pc + 7]].join(', ')); //var first = true; @@ -702,7 +696,6 @@ def process(code): ROPCODES['FUNC'], (''' EMTSTACKTOP = EMTSTACKTOP + (lx ''' + (' + 1 ' if ASYNC else '') + '''<< 3) | 0; assert(((EMTSTACKTOP|0) <= (EMT_STACK_MAX|0))|0);\n''' + (' if ((asyncState|0) != 2) {' if ASYNC else '')) if not zero else '', - get_access('ly', s='d'), ' } else { pc = (HEAP32[sp - 4 >> 2] | 0) - 8 | 0; }' if ASYNC else '', main_loop, )) @@ -713,6 +706,8 @@ def process(code): outfile = sys.argv[2] force_memfile = sys.argv[3] if len(sys.argv) >= 4 else None + original_yieldlist = YIELDLIST + extra_blacklist = [] if len(sys.argv) >= 5: temp = sys.argv[4] @@ -782,6 +777,23 @@ def process(code): print "Suggested list of functions to run in the emterpreter:" print " -s EMTERPRETIFY_WHITELIST='" + str(sorted(list(advised))).replace("'", '"') + "'" print "(%d%% out of %d functions)" % (int((100.0*len(advised))/len(can_call)), len(can_call)) + if len(YIELDLIST) > len(original_yieldlist): + # advise on the yield list as well. Anything a yield function can reach, likely needs to also be a yield function + YIELD_IGNORE = set(['abort']) + to_check = list(YIELDLIST) + advised = set([str(f) for f in YIELDLIST]) + while len(to_check) > 0: + curr = to_check.pop() + if curr not in can_call: continue + for next in can_call[curr]: + if next not in advised: + advised.add(str(next)) + to_check.append(next) + advised = [next for next in advised if not is_dyn_call(next) and not is_function_table(next) and not next in original_yieldlist and next not in SYNC_FUNCS and next not in YIELD_IGNORE and next[0] == '_'] + print + print "Suggested list of yield functions for the emterpreter:" + print " -s EMTERPRETIFY_YIELDLIST='" + str(sorted(list(advised))).replace("'", '"') + "'" + print "(%d%% out of %d functions)" % (int((100.0*len(advised))/len(can_call)), len(can_call)) sys.exit(0) BLACKLIST = set(list(BLACKLIST) + extra_blacklist) diff --git a/tools/gen_struct_info.py b/tools/gen_struct_info.py index 690008d4fb2e4..f956478c03acc 100644 --- a/tools/gen_struct_info.py +++ b/tools/gen_struct_info.py @@ -374,7 +374,7 @@ def inspect_code(headers, cpp_opts, structs, defines): try: # Compile the program. show('Compiling generated code...') - subprocess.check_call([shared.EMCC] + cpp_opts + ['-o', js_file[1], src_file[1], '-s', 'BOOTSTRAPPING_STRUCT_INFO=1', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0', '-Oz', '--js-opts', '0', '--memory-init-file', '0']) # -Oz optimizes enough to avoid warnings on code size/num locals + subprocess.check_call([shared.PYTHON, shared.EMCC] + cpp_opts + ['-o', js_file[1], src_file[1], '-s', 'BOOTSTRAPPING_STRUCT_INFO=1', '-s', 'WARN_ON_UNDEFINED_SYMBOLS=0', '-Oz', '--js-opts', '0', '--memory-init-file', '0']) # -Oz optimizes enough to avoid warnings on code size/num locals # Run the compiled program. show('Calling generated program...') info = shared.run_js(js_file[1]).splitlines() diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index def32e089b972..306f1b4fed34e 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1,3 +1,6 @@ +// -*- Mode: javascript; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 ; js-indent-level : 2 ; js-curly-indent-offset: 0 -*- +// vim: set ts=2 et sw=2 tw=80: + //============================================================================== // Optimizer tool. This is meant to be run after the emscripten compiler has // finished generating code. These optimizations are done on the generated @@ -9,9 +12,6 @@ // TODO: Share EMPTY_NODE instead of emptyNode that constructs? //============================================================================== -if (!Math.log2) Math.log2 = function log2(x) { - return Math.log(x) / Math.LN2; -}; if (!Math.fround) { var froundBuffer = new Float32Array(1); Math.fround = function(x) { froundBuffer[0] = x; return froundBuffer[0] }; @@ -1078,6 +1078,30 @@ function localCSE(ast) { }); } +function safeLabelSetting(ast) { + // Add an assign to label, if it exists, so that even after we minify/registerize variable names, we can tell if any vars use the asm init value of 0 - none will, so it's easy to tell + assert(asm); + traverseGeneratedFunctions(ast, function(func) { + var asmData = normalizeAsm(func); + if ('label' in asmData.vars) { + var stats = getStatements(func); + var seenVar = false; + for (var i = 0; i < stats.length; i++) { + var curr = stats[i]; + if (curr[0] === 'stat') curr = curr[1]; + if (curr[0] === 'var') { + seenVar = true; + } else if (seenVar && curr[0] !== 'var') { + // first location after the vars + stats.splice(i, 0, ['stat', ['assign', true, ['name', 'label'], ['num', 0]]]); + break; + } + } + } + denormalizeAsm(func, asmData); + }); +} + function simplifyIfs(ast) { traverseGeneratedFunctions(ast, function(func) { var simplifiedAnElse = false; @@ -6050,46 +6074,63 @@ function optimizeFrounds(ast) { traverseChildren(ast, fix); } -// Optimize heap expressions into HEAP32[(x&m)+c>>2] where c is a small aligned constant, and m guarantees the pointer is without range+aligned +// Optimize heap expressions into HEAP32[(x&m)+c>>2] where c is an aligned +// constant, and m guarantees the pointer is within bounds and aligned. function pointerMasking(ast) { - var MAX_SMALL_OFFSET = 32; + var parseHeapTemp = makeTempParseHeap(); traverse(ast, function(node, type) { if (type === 'sub' && node[1][0] === 'name' && node[1][1][0] === 'H' && node[2][0] === 'binary' && node[2][1] === '>>' && node[2][3][0] === 'num') { - var addee = node[2][2]; - if (!(addee[0] === 'binary' && addee[1] === '+')) return; var shifts = node[2][3][1]; - if (!parseHeap(node[1][1])) return; - if (parseHeapTemp.bits !== 8*Math.pow(2, shifts)) return; - // this is an HEAP[U]N[x + y >> n] expression. gather up all the top-level added items, seek a small constant amongst them + var addee = node[2][2]; + + if (!parseHeap(node[1][1], parseHeapTemp)) return; + if (parseHeapTemp.bits !== 8 * Math.pow(2, shifts)) return; + + // Don't mask a shifted constant index. It will be folded later, + // and it is assumed that they are within bounds. + if (addee[0] === 'num') return; + + if (!(addee[0] === 'binary' && addee[1] === '+')) { + node[2][2] = ['binary', '&', addee, ['name', 'MASK' + shifts]]; + return; + } + + // This is a HEAP[U]N[x + y >> n] expression. Gather up all the top-level + // added items, summing constants amongst them. + var addedConstants = 0; var addedElements = []; function addElements(node) { if (node[0] === 'binary' && node[1] === '+') { addElements(node[2]); addElements(node[3]); + } else if (node[0] === 'num') { + var c = node[1]; + // Check that it is aligned. + if (((c >> shifts) << shifts) === c) { + addedConstants += c; + } else { + addedElements.push(node); + } } else { addedElements.push(node); } } addElements(addee); - assert(addedElements.length >= 2); - for (var i = 0; i < addedElements.length; i++) { - var element = addedElements[i]; - if (element[0] === 'num') { - var c = element[1]; - if (c < MAX_SMALL_OFFSET && ((c >> shifts) << shifts) === c) { - // this is a small aligned offset, we are good to go. gather the others, and finalize - addedElements.splice(i, 1); - var others = addedElements[0]; - for (var j = 1; j < addedElements.length; j++) { - others = ['binary', '+', others, addedElements[j]]; - } - others = ['binary', '&', others, ['name', 'MASK' + shifts]]; - node[2][2] = ['binary', '+', others, element]; - return; - } + if (addedElements.length > 0) { + var others = addedElements[0]; + for (var j = 1; j < addedElements.length; j++) { + others = ['binary', '+', others, addedElements[j]]; } + others = ['binary', '&', others, ['name', 'MASK' + shifts]]; + if (addedConstants != 0) { + others = ['binary', '+', others, ['num' , addedConstants]]; + } + node[2][2] = others; + return; } + + node[2][2] = ['num' , addedConstants]; } }); } @@ -6152,6 +6193,15 @@ function trample(x, y) { // x = y, by trampling it x.length = y.length; } +function ilog2(x) { + x = Math.round(x); + if (x === 1) return 0; + if (x === 2) return 1; + if (x === 4) return 2; + if (x === 8) return 3; + throw 'ilog2 is not smart enough for ' + x; +} + // Converts functions into binary format to be run by an emterpreter function emterpretify(ast) { emitAst = false; @@ -6320,7 +6370,7 @@ function emterpretify(ast) { } case 'var': case 'toplevel': { - assert(dropIt); + assert(dropIt || isEmptyNode(node)); return [-1, []]; // empty node } case 'stat': return getReg(node[1], dropIt); @@ -6416,7 +6466,7 @@ function emterpretify(ast) { } else { assert(target[2][0] === 'num'); // HEAP32[8] or such var address = target[2][1]; - var shifts = Math.log2(temp.bits/8); + var shifts = ilog2(temp.bits/8); assert(address === ((address << shifts) >> shifts)); var x = makeNum(address << shifts, ASM_INT); var y = getReg(value); @@ -6699,7 +6749,7 @@ function emterpretify(ast) { } else { assert(node[2][0] === 'num'); // HEAP32[8] or such var address = node[2][1]; - var shifts = Math.log2(temp.bits/8); + var shifts = ilog2(temp.bits/8); assert(address === ((address << shifts) >> shifts)); var ret = makeNum(address << shifts, ASM_INT); var out = assignTo >= 0 ? assignTo : getFree(ret[0]); @@ -7223,7 +7273,7 @@ function emterpretify(ast) { stats.forEach(function(stat) { var before = freeLocals.length; var raw = getReg(stat, true); - //printErr('raw: ' + JSON.stringify(raw)); + //printErr('raw: ' + JSON.stringify(stat)); releaseIfFree(raw[0]); if (freeLocals.length !== before) assert(0, [before, freeLocals.length] + ' due to ' + astToSrc(stat)); // the statement is done - nothing should still be held on to var curr = raw[1]; @@ -7580,23 +7630,9 @@ function emterpretify(ast) { } assert(numLocals < FAST_LOCALS, 'way too many params!'); assert(FAST_LOCALS < 256); - var zeroInits; - if (numVars < FAST_LOCALS*2) { - zeroInits = findUninitializedVars(func, asmData); - } else { - zeroInits = copy(asmData.vars); // give up - tons of vars, this will be slow anyhow, and findUninitializedVars is non-linear so can be very slow on massive function - } - for (var zero in zeroInits) { - locals[zero] = numLocals++; - if (numLocals === FAST_LOCALS) numLocals = 256; // jump over the temps, remaining locals are slow locals - } - var lastZeroInit = func[2].length + numLocals; // may be higher than func[2].length + numZeroInits, due to jumping over temps - // this means if we have very many zeroinits, we end up zeroing out the temps, oh well for (var i in asmData.vars) { - if (!(i in zeroInits)) { - locals[i] = numLocals++; // TODO: sort by frequency of appearance, so common ones are fast, rare are slow - if (numLocals === FAST_LOCALS) numLocals = 256; // jump over the temps, remaining locals are slow locals - } + locals[i] = numLocals++; // TODO: sort by frequency of appearance, so common ones are fast, rare are slow + if (numLocals === FAST_LOCALS) numLocals = 256; // jump over the temps, remaining locals are slow locals } var withSlowLocals = numLocals; numLocals = Math.min(numLocals, FAST_LOCALS); // ignore the slow locals @@ -7620,7 +7656,7 @@ function emterpretify(ast) { // calculate final count of local variables, and emit func header var finalLocals = Math.max(numLocals, maxLocal+1, withSlowLocals); assert(finalLocals < 65535, 'too many locals ' + [maxLocal, numLocals, withSlowLocals]); - code = ['FUNC', func[2].length, finalLocals & 255, finalLocals >>> 8, 0, 0, lastZeroInit & 255, lastZeroInit >>> 8].concat(constants).concat(code); + code = ['FUNC', func[2].length, finalLocals & 255, finalLocals >>> 8, 0, 0, 0, 0].concat(constants).concat(code); verifyCode(code); finalizeJumps(code); @@ -7889,6 +7925,7 @@ var passes = { optimizeShiftsConservative: optimizeShiftsConservative, optimizeShiftsAggressive: optimizeShiftsAggressive, localCSE: localCSE, + safeLabelSetting: safeLabelSetting, simplifyIfs: simplifyIfs, hoistMultiples: hoistMultiples, loopOptimizer: loopOptimizer, diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py index 2a4ce138d36de..915cfbc32da04 100644 --- a/tools/js_optimizer.py +++ b/tools/js_optimizer.py @@ -1,5 +1,5 @@ -import os, sys, subprocess, multiprocessing, re, string, json, shutil +import os, sys, subprocess, multiprocessing, re, string, json, shutil, logging import shared configuration = shared.configuration @@ -62,7 +62,9 @@ def find_msbuild(sln_file, make_env): return [None, make_env] def get_native_optimizer(): - if os.environ.get('EMCC_FAST_COMPILER') == '0': return None # need fastcomp for native optimizer + if os.environ.get('EMCC_FAST_COMPILER') == '0': + logging.critical('Non-fastcomp compiler is no longer available, please use fastcomp or an older version of emscripten') + sys.exit(1) # Allow users to override the location of the optimizer executable by setting an environment variable EMSCRIPTEN_NATIVE_OPTIMIZER=/path/to/optimizer(.exe) if os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER') and len(os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER')) > 0: return os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER') @@ -261,8 +263,7 @@ def run_on_chunk(command): while os.path.exists(saved): saved = 'input' + str(int(saved.replace('input', '').replace('.txt', ''))+1) + '.txt' print >> sys.stderr, 'running js optimizer command', ' '.join(map(lambda c: c if c != filename else saved, command)) shutil.copyfile(filename, os.path.join('/tmp/emscripten_temp', saved)) - verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 - if verbose_level >= 3: print >> sys.stderr, str(command) + if shared.EM_BUILD_VERBOSE_LEVEL >= 3: print >> sys.stderr, 'run_on_chunk: ' + str(command) proc = subprocess.Popen(command, stdout=subprocess.PIPE) output = proc.communicate()[0] assert proc.returncode == 0, 'Error in optimizer: ' + output diff --git a/tools/optimizer/optimizer.cpp b/tools/optimizer/optimizer.cpp index 46b553bd46908..6e63ac9b9524a 100644 --- a/tools/optimizer/optimizer.cpp +++ b/tools/optimizer/optimizer.cpp @@ -1761,7 +1761,7 @@ void simplifyExpressions(Ref ast) { input[2][0] == BINARY && input[2][1] == LSHIFT && input[2][3][0] == NUM && input[3][0] == NUM && input[2][3][1]->getInteger() == input[3][1]->getInteger() && - (~(-1u >> input[3][1]->getInteger()) & jsD2I(amount)) == 0) { + (~(0xFFFFFFFFu >> input[3][1]->getInteger()) & jsD2I(amount)) == 0) { // x << 24 >> 24 & 255 => x & 255 return safeCopy(node, make3(BINARY, AND, input[2][2], node[3])); } diff --git a/tools/optimizer/simple_ast.cpp b/tools/optimizer/simple_ast.cpp index 61abdc99159af..9455efb330741 100644 --- a/tools/optimizer/simple_ast.cpp +++ b/tools/optimizer/simple_ast.cpp @@ -93,7 +93,9 @@ struct StackedStack { // a stack, on the stack memcpy(storage, old, sizeof(T)*used); alloced = true; } else { - storage = (T*)realloc(storage, sizeof(T)*available); + T *newStorage = (T*)realloc(storage, sizeof(T)*available); + assert(newStorage); + storage = newStorage; } } assert(used < available); diff --git a/tools/ports/sdl.py b/tools/ports/sdl.py index 4595d4e64a76c..4ed5d376f51e8 100644 --- a/tools/ports/sdl.py +++ b/tools/ports/sdl.py @@ -1,6 +1,6 @@ import os, shutil, logging -TAG = 'version_5' +TAG = 'version_6' def get_with_configure(ports, settings, shared): # not currently used; no real need for configure on emscripten users' machines! if settings.USE_SDL == 2: diff --git a/tools/shared.py b/tools/shared.py index a38a37392132d..459e3ef6623c6 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -297,6 +297,13 @@ def fix_js_engine(old, new): logging.debug('Installing Popen workaround handler to avoid bug http://bugs.python.org/issue3905') Popen = WindowsPopen +# Verbosity level control for any intermediate subprocess spawns from the compiler. Useful for internal debugging. +# 0: disabled. +# 1: Log stderr of subprocess spawns. +# 2: Log stdout and stderr of subprocess spawns. Print out subprocess commands that were executed. +# 3: Log stdout and stderr, and pass VERBOSE=1 to CMake configure steps. +EM_BUILD_VERBOSE_LEVEL = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 + # Expectations EXPECTED_LLVM_VERSION = (3,5) @@ -459,8 +466,12 @@ def check_sanity(force=False): # some warning, mostly not fatal checks - do them even if EM_IGNORE_SANITY is on check_llvm_version() check_node_version() - if os.environ.get('EMCC_FAST_COMPILER') != '0': - fastcomp_ok = check_fastcomp() + + if os.environ.get('EMCC_FAST_COMPILER') == '0': + logging.critical('Non-fastcomp compiler is no longer available, please use fastcomp or an older version of emscripten') + sys.exit(1) + + fastcomp_ok = check_fastcomp() if os.environ.get('EM_IGNORE_SANITY'): logging.info('EM_IGNORE_SANITY set, ignoring sanity checks') @@ -570,6 +581,9 @@ def get_clang_native_args(): sdk_path = osx_find_native_sdk_path() if sdk_path: CACHED_CLANG_NATIVE_ARGS = ['-isysroot', osx_find_native_sdk_path()] + elif os.name == 'nt': + CACHED_CLANG_NATIVE_ARGS = ['-DWIN32'] + # TODO: If Windows.h et al. are needed, will need to add something like '-isystemC:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Include'. return CACHED_CLANG_NATIVE_ARGS CLANG_CC=os.path.expanduser(build_clang_tool_path('clang')) @@ -711,9 +725,7 @@ def set_logging(): # Target choice. Must be synced with src/settings.js (TARGET_*) def get_llvm_target(): if os.environ.get('EMCC_FAST_COMPILER') == '0': - if not os.environ.get('EMCC_LLVM_TARGET'): - os.environ['EMCC_LLVM_TARGET'] = 'le32-unknown-nacl' - return os.environ.get('EMCC_LLVM_TARGET') + return 'unavailable-non-fastcomp' return os.environ.get('EMCC_LLVM_TARGET') or 'asmjs-unknown-emscripten' LLVM_TARGET = get_llvm_target() @@ -1063,6 +1075,17 @@ def is_exe(fpath): return None + # Returns a clone of the given environment with all directories that contain sh.exe removed from the PATH. + # Used to work around CMake limitation with MinGW Makefiles, where sh.exe is not allowed to be present. + @staticmethod + def remove_sh_exe_from_path(env): + env = env.copy() + if not WINDOWS: return env + path = env['PATH'].split(';') + path = filter(lambda p: not os.path.exists(os.path.join(p, 'sh.exe')), path) + env['PATH'] = ';'.join(path) + return env + @staticmethod def handle_CMake_toolchain(args, env): @@ -1080,8 +1103,13 @@ def has_substr(array, substr): # pulling in a native Visual Studio, or Unix Makefiles. if WINDOWS and not '-G' in args and Building.which('mingw32-make'): args += ['-G', 'MinGW Makefiles'] - - return args + + # CMake has a requirement that it wants sh.exe off PATH if MinGW Makefiles is being used. This happens quite often, + # so do this automatically on behalf of the user. See http://www.cmake.org/Wiki/CMake_MinGW_Compiler_Issues + if WINDOWS and 'MinGW Makefiles' in args: + env = Building.remove_sh_exe_from_path(env) + + return (args, env) @staticmethod def configure(args, stdout=None, stderr=None, env=None): @@ -1092,13 +1120,14 @@ def configure(args, stdout=None, stderr=None, env=None): if 'cmake' in args[0]: # Note: EMMAKEN_JUST_CONFIGURE shall not be enabled when configuring with CMake. This is because CMake # does expect to be able to do config-time builds with emcc. - args = Building.handle_CMake_toolchain(args, env) + args, env = Building.handle_CMake_toolchain(args, env) else: # When we configure via a ./configure script, don't do config-time compilation with emcc, but instead # do builds natively with Clang. This is a heuristic emulation that may or may not work. env['EMMAKEN_JUST_CONFIGURE'] = '1' try: - process = Popen(args, stdout=stdout, stderr=stderr, env=env) + if EM_BUILD_VERBOSE_LEVEL >= 3: print >> sys.stderr, 'configure: ' + str(args) + process = Popen(args, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else stdout, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else stderr, env=env) process.communicate() except Exception, e: logging.error('Exception thrown when invoking Popen in configure with args: "%s"!' % ' '.join(args)) @@ -1118,13 +1147,19 @@ def make(args, stdout=None, stderr=None, env=None): #args += ['VERBOSE=1'] # On Windows prefer building with mingw32-make instead of make, if it exists. - if WINDOWS and args[0] == 'make': - mingw32_make = Building.which('mingw32-make') - if mingw32_make: - args[0] = mingw32_make + if WINDOWS: + if args[0] == 'make': + mingw32_make = Building.which('mingw32-make') + if mingw32_make: + args[0] = mingw32_make + + if 'mingw32-make' in args[0]: + env = Building.remove_sh_exe_from_path(env) try: - process = Popen(args, stdout=stdout, stderr=stderr, env=env) + # On Windows, run the execution through shell to get PATH expansion and executable extension lookup, e.g. 'sdl2-config' will match with 'sdl2-config.bat' in PATH. + if EM_BUILD_VERBOSE_LEVEL >= 3: print >> sys.stderr, 'make: ' + str(args) + process = Popen(args, stdout=None if EM_BUILD_VERBOSE_LEVEL >= 2 else stdout, stderr=None if EM_BUILD_VERBOSE_LEVEL >= 1 else stderr, env=env, shell=WINDOWS) process.communicate() except Exception, e: logging.error('Exception thrown when invoking Popen in make with args: "%s"!' % ' '.join(args)) @@ -1165,13 +1200,12 @@ def build_library(name, build_dir, output_dir, generated_libs, configure=['sh', # except: # pass env = Building.get_building_env(native) - verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 for k, v in env_init.iteritems(): env[k] = v if configure: # Useful in debugging sometimes to comment this out (and the lines below up to and including the |link| call) try: - Building.configure(configure + configure_args, env=env, stdout=open(os.path.join(project_dir, 'configure_'), 'w') if verbose_level < 2 else None, - stderr=open(os.path.join(project_dir, 'configure_err'), 'w') if verbose_level < 1 else None) + Building.configure(configure + configure_args, env=env, stdout=open(os.path.join(project_dir, 'configure_'), 'w') if EM_BUILD_VERBOSE_LEVEL < 2 else None, + stderr=open(os.path.join(project_dir, 'configure_err'), 'w') if EM_BUILD_VERBOSE_LEVEL < 1 else None) except subprocess.CalledProcessError, e: pass # Ignore exit code != 0 def open_make_out(i, mode='r'): @@ -1180,15 +1214,15 @@ def open_make_out(i, mode='r'): def open_make_err(i, mode='r'): return open(os.path.join(project_dir, 'make_err' + str(i)), mode) - if verbose_level >= 3: + if EM_BUILD_VERBOSE_LEVEL >= 3: make_args += ['VERBOSE=1'] for i in range(2): # FIXME: Sad workaround for some build systems that need to be run twice to succeed (e.g. poppler) with open_make_out(i, 'w') as make_out: with open_make_err(i, 'w') as make_err: try: - Building.make(make + make_args, stdout=make_out if verbose_level < 2 else None, - stderr=make_err if verbose_level < 1 else None, env=env) + Building.make(make + make_args, stdout=make_out if EM_BUILD_VERBOSE_LEVEL < 2 else None, + stderr=make_err if EM_BUILD_VERBOSE_LEVEL < 1 else None, env=env) except subprocess.CalledProcessError, e: pass # Ignore exit code != 0 try: @@ -1200,7 +1234,7 @@ def open_make_err(i, mode='r'): break except Exception, e: if i > 0: - if verbose_level == 0: + if EM_BUILD_VERBOSE_LEVEL == 0: # Due to the ugly hack above our best guess is to output the first run with open_make_err(0) as ferr: for line in ferr: diff --git a/tools/webidl_binder.py b/tools/webidl_binder.py index e2369502ad969..df1d591724d6f 100644 --- a/tools/webidl_binder.py +++ b/tools/webidl_binder.py @@ -257,7 +257,7 @@ def render_function(class_name, func_name, sigs, return_type, non_pointer, copy, body += ' ' + cache + '\n' mid_js += [r'''function%s(%s) { %s -}''' % ((' ' + func_name) if constructor else '', ', '.join(args), body[:-1])] +};''' % ((' ' + func_name) if constructor else '', ', '.join(args), body[:-1])] # C @@ -474,9 +474,11 @@ class %s : public %s { }; ''' % (name, type_to_c(js_impl, non_pointing=True), '\n'.join(js_impl_methods))] +deferred_js = [] + for name, enum in enums.iteritems(): mid_c += ['\n// ' + name + '\n'] - mid_js += ['\n// ' + name + '\n'] + deferred_js += ['\n', '// ' + name + '\n'] for value in enum.values(): function_id = "%s_%s" % (name, value.split('::')[-1]) mid_c += [r'''%s EMSCRIPTEN_KEEPALIVE emscripten_enum_%s() { @@ -486,21 +488,29 @@ class %s : public %s { symbols = value.split('::') if len(symbols) == 1: identifier = symbols[0] - mid_js += ["Module['%s'] = _emscripten_enum_%s();\n" % (identifier, function_id)] + deferred_js += ["Module['%s'] = _emscripten_enum_%s();\n" % (identifier, function_id)] elif len(symbols) == 2: [namespace, identifier] = symbols if namespace in interfaces: # namespace is a class - mid_js += ["Module['%s']['%s'] = _emscripten_enum_%s();\n" % \ + deferred_js += ["Module['%s']['%s'] = _emscripten_enum_%s();\n" % \ (namespace, identifier, function_id)] else: # namespace is a namespace, so the enums get collapsed into the top level namespace. - mid_js += ["Module['%s'] = _emscripten_enum_%s();\n" % (identifier, function_id)] + deferred_js += ["Module['%s'] = _emscripten_enum_%s();\n" % (identifier, function_id)] else: throw ("Illegal enum value %s" % value) mid_c += ['\n}\n\n'] -mid_js += ['\n'] +mid_js += [''' +(function() { + function setupEnums() { + %s + } + if (Module['calledRun']) setupEnums(); + else addOnPreMain(setupEnums); +})(); +''' % '\n '.join(deferred_js)] # Write