diff options
34 files changed, 4086 insertions, 164 deletions
@@ -181,16 +181,18 @@ Options that are modified or new in %s include: tools/shared.py and also src/settings.js.) Note: Optimizations are only done when compiling to JavaScript, not to intermediate - bitcode. + bitcode, *unless* you build with + EMCC_OPTIMIZE_NORMALLY=1 (not recommended + unless you know what you are doing!) -O2 As -O1, plus the relooper (loop recreation), plus LLVM -O2 optimizations -O3 As -O2, plus dangerous optimizations that may break the generated code! This adds - -s INLINING_LIMIT=0 -s DOUBLE_MODE=0 -s PRECISE_I64_MATH=0 --closure 1 + --llvm-lto 1 This is not recommended at all. A better idea is to try each of these separately on top of @@ -233,8 +235,8 @@ Options that are modified or new in %s include: 2: -O2 LLVM optimizations 3: -O3 LLVM optimizations (default in -O2+) - --llvm-lto <level> 0: No LLVM LTO (default in -O0) - 1: LLVM LTO (default in -O1+) + --llvm-lto <level> 0: No LLVM LTO (default in -O2 and below) + 1: LLVM LTO (default in -O3) Note: If LLVM optimizations are not run (see --llvm-opts), setting this to 1 has no effect. @@ -400,6 +402,25 @@ Options that are modified or new in %s include: for a later incremental build (where you also enable it) to be sped up. + Caching works separately on 4 parts of compilation: + 'pre' which is types and global variables; that + information is then fed into 'funcs' which are + the functions (which we parallelize), and then + 'post' which adds final information based on + the functions (e.g., do we need long64 support + code). Finally, 'jsfuncs' are JavaScript-level + optimizations. Each of the 4 parts can be cached + separately, but note that they can affect each + other: If you recompile a single C++ file that + changes a global variable - e.g., adds, removes + or modifies a global variable, say by adding + a printf or by adding a compile-time timestamp, + then 'pre' cannot be loaded from the cache. And + since 'pre's output is sent to 'funcs' and 'post', + they will get invalidated as well, and only + 'jsfuncs' will be cached. So avoid modifying + globals to let caching work fully. + --clear-cache Manually clears the cache of compiled emscripten system libraries (libc++, libc++abi, libc). This is normally @@ -795,7 +816,7 @@ try: newargs = newargs + [default_cxx_std] if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level] - if llvm_lto is None: llvm_lto = llvm_opts > 0 + if llvm_lto is None: llvm_lto = opt_level >= 3 if opt_level <= 0: keep_llvm_debug = keep_js_debug = True # always keep debug in -O0 if opt_level > 0: keep_llvm_debug = False # JS optimizer wipes out llvm debug info from being visible if closure is None and opt_level == 3: closure = True @@ -990,7 +1011,15 @@ try: # If we were just asked to generate bitcode, stop there if final_suffix not in JS_CONTAINING_SUFFIXES: if llvm_opts > 0: - print >> sys.stderr, 'emcc: warning: -Ox flags ignored, since not generating JavaScript' + if not os.environ.get('EMCC_OPTIMIZE_NORMALLY'): + print >> sys.stderr, 'emcc: warning: -Ox flags ignored, since not generating JavaScript' + else: + for input_file in input_files: + if input_file.endswith(SOURCE_SUFFIXES): + if DEBUG: print >> sys.stderr, 'emcc: optimizing %s with -O%d since EMCC_OPTIMIZE_NORMALLY defined' % (input_file, llvm_opts) + shared.Building.llvm_opt(in_temp(unsuffixed(uniquename(input_file)) + '.o'), llvm_opts) + else: + if DEBUG: print >> sys.stderr, 'emcc: not optimizing %s despite EMCC_OPTIMIZE_NORMALLY since not source code' % (input_file) if not specified_target: for input_file in input_files: shutil.move(in_temp(unsuffixed(uniquename(input_file)) + '.o'), unsuffixed_basename(input_file) + '.' + final_suffix) @@ -1155,9 +1184,12 @@ try: if not LEAVE_INPUTS_RAW: link_opts = [] if keep_llvm_debug else ['-strip-debug'] # remove LLVM debug info in -O1+, since the optimizer removes it anyhow if llvm_opts > 0: - shared.Building.llvm_opt(in_temp(target_basename + '.bc'), llvm_opts) - if DEBUG: save_intermediate('opt', 'bc') - # Do LTO in a separate pass to work around LLVM bug XXX (see failure e.g. in cubescript) + if not os.environ.get('EMCC_OPTIMIZE_NORMALLY'): + shared.Building.llvm_opt(in_temp(target_basename + '.bc'), llvm_opts) + if DEBUG: save_intermediate('opt', 'bc') + # Do LTO in a separate pass to work around LLVM bug XXX (see failure e.g. in cubescript) + else: + if DEBUG: print >> sys.stderr, 'emcc: not running opt because EMCC_OPTIMIZE_NORMALLY was specified, opt should have been run before' if shared.Building.can_build_standalone(): # If we can LTO, do it before dce, since it opens up dce opportunities if llvm_lto and shared.Building.can_use_unsafe_opts(): diff --git a/emscripten.py b/emscripten.py index 704e2b25..8bd1b58a 100755 --- a/emscripten.py +++ b/emscripten.py @@ -242,6 +242,8 @@ def emscript(infile, settings, outfile, libraries=[]): if jcache: outputs += cached_outputs # TODO: preserve order outputs = [output.split('//FORWARDED_DATA:') for output in outputs] + for output in outputs: + assert len(output) == 2, 'Did not receive forwarded data in an output - process failed? We only got: ' + output[1] if DEBUG: print >> sys.stderr, ' emscript: phase 2 took %s seconds' % (time.time() - t) if DEBUG: t = time.time() @@ -310,7 +312,7 @@ def emscript(infile, settings, outfile, libraries=[]): post_file = temp_files.get('.post.ll').name open(post_file, 'w').write('\n') # no input, just processing of forwarded data out = shared.run_js(compiler, shared.COMPILER_ENGINE, [settings_file, post_file, 'post', forwarded_file] + libraries, stdout=subprocess.PIPE, cwd=path_from_root('src')) - post, last_forwarded_data = out.split('//FORWARDED_DATA:') + post, last_forwarded_data = out.split('//FORWARDED_DATA:') # if this fails, perhaps the process failed prior to printing forwarded data? last_forwarded_json = json.loads(last_forwarded_data) if settings.get('ASM_JS'): @@ -345,6 +347,7 @@ def emscript(infile, settings, outfile, libraries=[]): asm_setup += '\n'.join(['var %s = %s;' % (f.replace('.', '_'), f) for f in math_envs]) basic_funcs = ['abort', 'assert', 'asmPrintInt', 'asmPrintFloat', 'copyTempDouble', 'copyTempFloat'] + [m.replace('.', '_') for m in math_envs] if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE', 'SAFE_HEAP_CLEAR'] + if settings['CHECK_HEAP_ALIGN']: basic_funcs += ['CHECK_ALIGN_2', 'CHECK_ALIGN_4', 'CHECK_ALIGN_8'] basic_vars = ['STACKTOP', 'STACK_MAX', 'tempDoublePtr', 'ABORT'] basic_float_vars = ['NaN', 'Infinity'] if forwarded_json['Types']['preciseI64MathUsed']: diff --git a/src/analyzer.js b/src/analyzer.js index c930231f..f9b0c5af 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -18,6 +18,7 @@ function recomputeLines(func) { // Handy sets var BRANCH_INVOKE = set('branch', 'invoke'); +var LABEL_ENDERS = set('branch', 'return'); var SIDE_EFFECT_CAUSERS = set('call', 'invoke', 'atomic'); var UNUNFOLDABLE = set('value', 'structvalue', 'type', 'phiparam'); @@ -88,7 +89,7 @@ function analyzer(data, sidePass) { // Internal line if (!currLabelFinished) { item.functions.slice(-1)[0].labels.slice(-1)[0].lines.push(subItem); // If this line fails, perhaps missing a label? - if (subItem.intertype === 'branch') { + if (subItem.intertype in LABEL_ENDERS) { currLabelFinished = true; } } else { diff --git a/src/compiler.js b/src/compiler.js index 0b43842e..14816f1e 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -185,7 +185,7 @@ if (phase == 'pre') { print('// Note: For maximum-speed code, see "Optimizing Code" on the Emscripten wiki, https://github.com/kripken/emscripten/wiki/Optimizing-Code'); } - if (DOUBLE_MODE || CORRECT_SIGNS || CORRECT_OVERFLOWS || CORRECT_ROUNDINGS) { + if (DOUBLE_MODE || CORRECT_SIGNS || CORRECT_OVERFLOWS || CORRECT_ROUNDINGS || CHECK_HEAP_ALIGN) { print('// Note: Some Emscripten settings may limit the speed of the generated code.'); } } diff --git a/src/jsifier.js b/src/jsifier.js index cb234061..7066f8c5 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -375,6 +375,7 @@ function JSify(data, functionsOnly, givenFunctions) { var ret = [item]; item.JS = 'var ' + item.ident + ';'; // Set the actual value in a postset, since it may be a global variable. We also order by dependencies there + Variables.globals[item.ident].targetIdent = item.value.ident; var value = Variables.globals[item.ident].resolvedAlias = finalizeLLVMParameter(item.value); var fix = ''; if (BUILD_AS_SHARED_LIB == 2 && !item.private_) { @@ -913,7 +914,11 @@ function JSify(data, functionsOnly, givenFunctions) { case VAR_NATIVIZED: if (isNumber(item.ident)) { // Direct write to a memory address; this may be an intentional segfault, if not, it is a bug in the source - return 'throw "fault on write to ' + item.ident + '";'; + if (ASM_JS) { + return 'abort(' + item.ident + ')'; + } else { + return 'throw "fault on write to ' + item.ident + '";'; + } } return item.ident + '=' + value + ';'; // We have the actual value here break; @@ -1221,6 +1226,15 @@ function JSify(data, functionsOnly, givenFunctions) { var impl = item.ident ? getVarImpl(item.funcData, item.ident) : VAR_EMULATED; switch (impl) { case VAR_NATIVIZED: { + if (isNumber(item.ident)) { + item.assignTo = null; + // Direct read from a memory address; this may be an intentional segfault, if not, it is a bug in the source + if (ASM_JS) { + return 'abort(' + item.ident + ')'; + } else { + return 'throw "fault on read from ' + item.ident + '";'; + } + } return value; // We have the actual value here } case VAR_EMULATED: return makeGetValue(value, 0, item.type, 0, item.unsigned, 0, item.align); @@ -1244,7 +1258,7 @@ function JSify(data, functionsOnly, givenFunctions) { makeFuncLineActor('insertvalue', function(item) { assert(item.indexes.length == 1); // TODO: see extractvalue var ret = '(', ident; - if (item.ident === 'undef') { + if (item.ident === '0') { item.ident = 'tempValue'; ret += item.ident + ' = [' + makeEmptyStruct(item.type) + '], '; } @@ -1284,6 +1298,7 @@ function JSify(data, functionsOnly, givenFunctions) { // We cannot compile assembly. See comment in intertyper.js:'Call' assert(ident != 'asm', 'Inline assembly cannot be compiled to JavaScript!'); + ident = Variables.resolveAliasToIdent(ident); var shortident = ident.slice(1); var callIdent = LibraryManager.getRootIdent(shortident); if (callIdent) { diff --git a/src/library.js b/src/library.js index 83e1b115..7f177441 100644 --- a/src/library.js +++ b/src/library.js @@ -6702,6 +6702,9 @@ LibraryManager.library = { pthread_mutexattr_destroy: function() {}, pthread_mutex_lock: function() {}, pthread_mutex_unlock: function() {}, + pthread_mutex_trylock: function() { + return 0; + }, pthread_cond_init: function() {}, pthread_cond_destroy: function() {}, pthread_cond_broadcast: function() {}, @@ -6756,6 +6759,15 @@ LibraryManager.library = { _pthread_key_create.keys[key] = value; }, + pthread_key_delete: ['$ERRNO_CODES'], + pthread_key_delete: function(key) { + if (_pthread_key_create.keys[key]) { + delete _pthread_key_create.keys[key]; + return 0; + } + return ERRNO_CODES.EINVAL; + }, + pthread_cleanup_push: function(routine, arg) { __ATEXIT__.push({ func: function() { Runtime.dynCall('vi', routine, [arg]) } }) _pthread_cleanup_push.level = __ATEXIT__.length; diff --git a/src/library_gc.js b/src/library_gc.js index 083019ca..f6db74d8 100644 --- a/src/library_gc.js +++ b/src/library_gc.js @@ -4,7 +4,7 @@ if (GC_SUPPORT) { EXPORTED_FUNCTIONS['_realloc'] = 1; var LibraryGC = { - $GC__deps: ['sbrk', 'realloc'], + $GC__deps: ['sbrk', 'realloc', 'calloc'], $GC: { ALLOCATIONS_TO_GC: 1*1024*1024, diff --git a/src/library_gl.js b/src/library_gl.js index 995f2358..b0bf9650 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -19,6 +19,28 @@ var LibraryGL = { uniforms: [], shaders: [], +#if FULL_ES2 + clientBuffers: [], + enabledClientBuffers: [], +#endif + currArrayBuffer: 0, + currElementArrayBuffer: 0, + + byteSizeByTypeRoot: 0x1400, // GL_BYTE + byteSizeByType: [ + 1, // GL_BYTE + 1, // GL_UNSIGNED_BYTE + 2, // GL_SHORT + 2, // GL_UNSIGNED_SHORT + 4, // GL_INT + 4, // GL_UNSIGNED_INT + 4, // GL_FLOAT + 2, // GL_2_BYTES + 3, // GL_3_BYTES + 4, // GL_4_BYTES + 8 // GL_DOUBLE + ], + uniformTable: {}, // name => uniform ID. the uID must be identical until relinking, cannot create a new uID each call to glGetUniformLocation packAlignment: 4, // default alignment is 4 bytes @@ -176,12 +198,48 @@ var LibraryGL = { } }, +#if FULL_ES2 + calcBufLength: function(size, type, stride, count) { + if (stride > 0) { + return count * stride; // XXXvlad this is not exactly correct I don't think + } + var typeSize = GL.byteSizeByType[type - GL.byteSizeByTypeRoot]; + return size * typeSize * count; + }, + + preDrawHandleClientVertexAttribBindings: function(count) { + GL.resetBufferBinding = false; + for (var i = 0; i < GL.maxVertexAttribs; ++i) { + if (!GL.enabledClientBuffers[i] || !GL.clientBuffers[i]) continue; + + GL.resetBufferBinding = true; + + var cb = GL.clientBuffers[i]; + + var buf = Module.ctx.createBuffer(); + Module.ctx.bindBuffer(Module.ctx.ARRAY_BUFFER, buf); + Module.ctx.bufferData(Module.ctx.ARRAY_BUFFER, + HEAPU8.subarray(cb.ptr, cb.ptr + GL.calcBufLength(cb.size, cb.type, cb.stride, count)), + Module.ctx.DYNAMIC_DRAW); + Module.ctx.vertexAttribPointer(i, cb.size, cb.type, cb.normalized, cb.stride, 0); + } + }, + + postDrawHandleClientVertexAttribBindings: function() { + if (GL.resetBufferBinding) { + Module.ctx.bindBuffer(Module.ctx.ARRAY_BUFFER, GL.buffers[GL.currArrayBuffer]); + } + }, +#endif + initExtensions: function() { if (GL.initExtensions.done) return; GL.initExtensions.done = true; if (!Module.useWebGL) return; // an app might link both gl and 2d backends + GL.maxVertexAttribs = Module.ctx.getParameter(Module.ctx.MAX_VERTEX_ATTRIBS); + GL.compressionExt = Module.ctx.getExtension('WEBGL_compressed_texture_s3tc') || Module.ctx.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || Module.ctx.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc'); @@ -456,6 +514,9 @@ var LibraryGL = { var id = {{{ makeGetValue('buffers', 'i*4', 'i32') }}}; Module.ctx.deleteBuffer(GL.buffers[id]); GL.buffers[id] = null; + + if (id == GL.currArrayBuffer) GL.currArrayBuffer = 0; + if (id == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0; } }, @@ -474,11 +535,9 @@ var LibraryGL = { }, glIsBuffer: function(buffer) { - var fb = GL.buffers[buffer]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isBuffer(fb); + var b = GL.buffers[buffer]; + if (!b) return 0; + return Module.ctx.isBuffer(b); }, glGenRenderbuffers__sig: 'vii', @@ -509,11 +568,9 @@ var LibraryGL = { }, glIsRenderbuffer: function(renderbuffer) { - var fb = GL.renderbuffers[renderbuffer]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isRenderbuffer(fb); + var rb = GL.renderbuffers[renderbuffer]; + if (!rb) return 0; + return Module.ctx.isRenderbuffer(rb); }, glGetUniformfv: function(program, location, params) { @@ -554,6 +611,11 @@ var LibraryGL = { }, glGetVertexAttribfv: function(index, pname, params) { +#if FULL_ES2 + if (GL.clientBuffers[index]) { + Module.printErr("glGetVertexAttribfv on client-side array: not supported, bad data returned"); + } +#endif var data = Module.ctx.getVertexAttrib(index, pname); if (typeof data == 'number') { {{{ makeSetValue('params', '0', 'data', 'float') }}}; @@ -565,6 +627,11 @@ var LibraryGL = { }, glGetVertexAttribiv: function(index, pname, params) { +#if FULL_ES2 + if (GL.clientBuffers[index]) { + Module.printErr("glGetVertexAttribiv on client-side array: not supported, bad data returned"); + } +#endif var data = Module.ctx.getVertexAttrib(index, pname); if (typeof data == 'number' || typeof data == 'boolean') { {{{ makeSetValue('params', '0', 'data', 'i32') }}}; @@ -576,6 +643,11 @@ var LibraryGL = { }, glGetVertexAttribPointerv: function(index, pname, pointer) { +#if FULL_ES2 + if (GL.clientBuffers[index]) { + Module.printErr("glGetVertexAttribPointer on client-side array: not supported, bad data returned"); + } +#endif {{{ makeSetValue('pointer', '0', 'Module.ctx.getVertexAttribOffset(index, pname)', 'i32') }}}; }, @@ -731,6 +803,12 @@ var LibraryGL = { glBindBuffer__sig: 'vii', glBindBuffer: function(target, buffer) { + if (target == Module.ctx.ARRAY_BUFFER) { + GL.currArrayBuffer = buffer; + } else if (target == Module.ctx.ELEMENT_ARRAY_BUFFER) { + GL.currElementArrayBuffer = buffer; + } + Module.ctx.bindBuffer(target, buffer ? GL.buffers[buffer] : null); }, @@ -858,11 +936,9 @@ var LibraryGL = { }, glIsShader: function(shader) { - var fb = GL.shaders[shader]; - if (typeof(fb) == 'undefined') { - return 0; - } - return Module.ctx.isShader(fb); + var s = GL.shaders[shader]; + if (!s) return 0; + return Module.ctx.isShader(s); }, glCreateProgram__sig: 'i', @@ -975,9 +1051,7 @@ var LibraryGL = { glIsFramebuffer__sig: 'ii', glIsFramebuffer: function(framebuffer) { var fb = GL.framebuffers[framebuffer]; - if (typeof(fb) == 'undefined') { - return 0; - } + if (!fb) return 0; return Module.ctx.isFramebuffer(fb); }, @@ -1348,27 +1422,15 @@ var LibraryGL = { _glBindBuffer = function(target, buffer) { glBindBuffer(target, buffer); if (target == Module.ctx.ARRAY_BUFFER) { - GL.currArrayBuffer = buffer; if (GLEmulation.currentVao) { assert(GLEmulation.currentVao.arrayBuffer == buffer || GLEmulation.currentVao.arrayBuffer == 0 || buffer == 0, 'TODO: support for multiple array buffers in vao'); GLEmulation.currentVao.arrayBuffer = buffer; } } else if (target == Module.ctx.ELEMENT_ARRAY_BUFFER) { - GL.currElementArrayBuffer = buffer; if (GLEmulation.currentVao) GLEmulation.currentVao.elementArrayBuffer = buffer; } }; - var glDeleteBuffers = _glDeleteBuffers; - _glDeleteBuffers = function(n, buffers) { - glDeleteBuffers(n, buffers); - for (var i = 0; i < n; i++) { - var buffer = {{{ makeGetValue('buffers', 'i*4', 'i32') }}}; - if (buffer == GL.currArrayBuffer) GL.currArrayBuffer = 0; - if (buffer == GL.currElementArrayBuffer) GL.currElementArrayBuffer = 0; - } - }; - var glGetFloatv = _glGetFloatv; _glGetFloatv = function(pname, params) { if (pname == 0x0BA6) { // GL_MODELVIEW_MATRIX @@ -1621,17 +1683,6 @@ var LibraryGL = { clientActiveTexture: 0, clientColor: null, - byteSizeByTypeRoot: 0x1400, // GL_BYTE - byteSizeByType: [ - 1, // GL_BYTE - 1, // GL_UNSIGNED_BYTE - 2, // GL_SHORT - 2, // GL_UNSIGNED_SHORT - 4, // GL_INT - 4, // GL_UNSIGNED_INT - 4 // GL_FLOAT - ], - setClientAttribute: function(name, size, type, stride, pointer) { var attrib = this.clientAttributes[name]; attrib.name = name; @@ -1707,7 +1758,7 @@ var LibraryGL = { #endif this.enabledClientAttributes[name] = true; this.setClientAttribute(name, size, type, 0, this.rendererComponentPointer); - this.rendererComponentPointer += size * this.byteSizeByType[type - this.byteSizeByTypeRoot]; + this.rendererComponentPointer += size * GL.byteSizeByType[type - GL.byteSizeByTypeRoot]; } else { this.rendererComponents[name]++; } @@ -1731,7 +1782,7 @@ var LibraryGL = { cacheItem = temp ? temp : (cacheItem[attribute.name] = GL.immediate.rendererCacheItemTemplate.slice()); temp = cacheItem[attribute.size]; cacheItem = temp ? temp : (cacheItem[attribute.size] = GL.immediate.rendererCacheItemTemplate.slice()); - var typeIndex = attribute.type - GL.immediate.byteSizeByTypeRoot; // ensure it starts at 0 to keep the cache items dense + var typeIndex = attribute.type - GL.byteSizeByTypeRoot; // ensure it starts at 0 to keep the cache items dense temp = cacheItem[typeIndex]; cacheItem = temp ? temp : (cacheItem[typeIndex] = GL.immediate.rendererCacheItemTemplate.slice()); } @@ -2167,7 +2218,7 @@ var LibraryGL = { for (var i = 0; i < attributes.length; i++) { var attribute = attributes[i]; if (!attribute) break; - var size = attribute.size * GL.immediate.byteSizeByType[attribute.type - GL.immediate.byteSizeByTypeRoot]; + var size = attribute.size * GL.byteSizeByType[attribute.type - GL.byteSizeByTypeRoot]; if (size % 4 != 0) size += 4 - (size % 4); // align everything attribute.offset = bytes; bytes += size; @@ -2179,7 +2230,7 @@ var LibraryGL = { for (var i = 0; i < attributes.length; i++) { var attribute = attributes[i]; if (!attribute) break; - var size4 = Math.floor((attribute.size * GL.immediate.byteSizeByType[attribute.type - GL.immediate.byteSizeByTypeRoot])/4); + var size4 = Math.floor((attribute.size * GL.byteSizeByType[attribute.type - GL.byteSizeByTypeRoot])/4); for (var j = 0; j < count; j++) { for (var k = 0; k < size4; k++) { // copy in chunks of 4 bytes, our alignment makes this possible HEAP32[((start + attribute.offset + bytes*j)>>2) + k] = HEAP32[(attribute.pointer>>2) + j*size4 + k]; @@ -2197,7 +2248,7 @@ var LibraryGL = { assert((attribute.offset - bytes)%4 == 0); // XXX assuming 4-alignment bytes += attribute.offset - bytes; } - bytes += attribute.size * GL.immediate.byteSizeByType[attribute.type - GL.immediate.byteSizeByTypeRoot]; + bytes += attribute.size * GL.byteSizeByType[attribute.type - GL.byteSizeByTypeRoot]; if (bytes % 4 != 0) bytes += 4 - (bytes % 4); // XXX assuming 4-alignment } assert(beginEnd || bytes <= stride); // if not begin-end, explicit stride should make sense with total byte size @@ -2332,8 +2383,10 @@ var LibraryGL = { glVertex2fv: function(p) { _glVertex3f({{{ makeGetValue('p', '0', 'float') }}}, {{{ makeGetValue('p', '4', 'float') }}}, 0); }, + + glVertex3i: 'glVertex3f', - glVertex2i: function() { throw 'glVertex2i: TODO' }, + glVertex2i: 'glVertex3f', glTexCoord2i: function(u, v) { #if ASSERTIONS @@ -2794,11 +2847,81 @@ var LibraryGL = { glTexCoord3f: function() { throw 'glTexCoord3f: TODO' }, glGetTexLevelParameteriv: function() { throw 'glGetTexLevelParameteriv: TODO' }, - // signatures of simple pass-through functions, see later - glActiveTexture__sig: 'vi', + glShadeModel: function() { Runtime.warnOnce('TODO: glShadeModel') }, + + glVertexAttribPointer__sig: 'viiiiii', + glVertexAttribPointer: function(index, size, type, normalized, stride, ptr) { +#if FULL_ES2 + if (!GL.currArrayBuffer) { + GL.clientBuffers[index] = { size: size, type: type, normalized: normalized, stride: stride, ptr: ptr }; + return; + } + + GL.clientBuffers[index] = null; +#endif + Module.ctx.vertexAttribPointer(index, size, type, normalized, stride, ptr); + }, + glEnableVertexAttribArray__sig: 'vi', + glEnableVertexAttribArray: function(index) { +#if FULL_ES2 + GL.enabledClientBuffers[index] = true; +#endif + Module.ctx.enableVertexAttribArray(index); + }, + glDisableVertexAttribArray__sig: 'vi', - glVertexAttribPointer__sig: 'viiiiii', + glDisableVertexAttribArray: function(index) { +#if FULL_ES2 + GL.enabledClientBuffers[index] = false; +#endif + Module.ctx.disableVertexAttribArray(index); + }, + + glDrawArrays: function(mode, first, count) { +#if FULL_ES2 + // bind any client-side buffers + GL.preDrawHandleClientVertexAttribBindings(count); +#endif + + Module.ctx.drawArrays(mode, first, count); + +#if FULL_ES2 + GL.postDrawHandleClientVertexAttribBindings(); +#endif + }, + + glDrawElements: function(mode, count, type, indices) { +#if FULL_ES2 + var buf; + if (!GL.currElementArrayBuffer) { + buf = Module.ctx.createBuffer(); + Module.ctx.bindBuffer(Module.ctx.ELEMENT_ARRAY_BUFFER, buf); + Module.ctx.bufferData(Module.ctx.ELEMENT_ARRAY_BUFFER, + HEAPU8.subarray(indices, indices + GL.calcBufLength(1, type, 0, count)), + Module.ctx.DYNAMIC_DRAW); + // the index is now 0 + indices = 0; + } + + // bind any client-side buffers + GL.preDrawHandleClientVertexAttribBindings(count); +#endif + + Module.ctx.drawElements(mode, count, type, indices); + +#if FULL_ES2 + GL.postDrawHandleClientVertexAttribBindings(count); + + if (!GL.currElementArrayBuffer) { + Module.ctx.bindBuffer(Module.ctx.ELEMENT_ARRAY_BUFFER, null); + Module.ctx.deleteBuffer(buf); + } +#endif + }, + + // signatures of simple pass-through functions, see later + glActiveTexture__sig: 'vi', glCheckFramebufferStatus__sig: 'ii', glRenderbufferStorage__sig: 'viiii', @@ -2820,19 +2943,18 @@ var LibraryGL = { }; // Simple pass-through functions. Starred ones have return values. [X] ones have X in the C name but not in the JS name -[[0, 'shadeModel getError* finish flush'], - [1, 'clearDepth clearDepth[f] depthFunc enable disable frontFace cullFace clear enableVertexAttribArray disableVertexAttribArray lineWidth clearStencil depthMask stencilMask checkFramebufferStatus* generateMipmap activeTexture blendEquation sampleCoverage isEnabled*'], +[[0, 'getError* finish flush'], + [1, 'clearDepth clearDepth[f] depthFunc enable disable frontFace cullFace clear lineWidth clearStencil depthMask stencilMask checkFramebufferStatus* generateMipmap activeTexture blendEquation sampleCoverage isEnabled*'], [2, 'blendFunc blendEquationSeparate depthRange depthRange[f] stencilMaskSeparate hint polygonOffset'], - [3, 'texParameteri texParameterf drawArrays vertexAttrib2f stencilFunc stencilOp'], - [4, 'viewport clearColor scissor vertexAttrib3f colorMask drawElements renderbufferStorage blendFuncSeparate blendColor stencilFuncSeparate stencilOpSeparate'], + [3, 'texParameteri texParameterf vertexAttrib2f stencilFunc stencilOp'], + [4, 'viewport clearColor scissor vertexAttrib3f colorMask renderbufferStorage blendFuncSeparate blendColor stencilFuncSeparate stencilOpSeparate'], [5, 'vertexAttrib4f'], - [6, 'vertexAttribPointer'], [8, 'copyTexImage2D copyTexSubImage2D']].forEach(function(data) { var num = data[0]; var names = data[1]; var args = range(num).map(function(i) { return 'x' + i }).join(', '); - var plainStub = '(function(' + args + ') { ' + (num > 0 ? 'Module.ctx.NAME(' + args + ')' : '') + ' })'; - var returnStub = '(function(' + args + ') { ' + (num > 0 ? 'return Module.ctx.NAME(' + args + ')' : '') + ' })'; + var plainStub = '(function(' + args + ') { Module.ctx.NAME(' + args + ') })'; + var returnStub = '(function(' + args + ') { return Module.ctx.NAME(' + args + ') })'; names.split(' ').forEach(function(name) { var stub = plainStub; if (name[name.length-1] == '*') { @@ -2865,5 +2987,10 @@ LibraryGL.$GLEmulation__deps.push(function() { for (var func in Functions.getIndex.tentative) Functions.getIndex(func); }); +if (FORCE_GL_EMULATION) { + LibraryGL.glDrawElements__deps = LibraryGL.glDrawElements__deps.concat('$GLEmulation'); + LibraryGL.glDrawArrays__deps = LibraryGL.glDrawArrays__deps.concat('$GLEmulation'); +} + mergeInto(LibraryManager.library, LibraryGL); diff --git a/src/library_sdl.js b/src/library_sdl.js index 3b412daa..96ae6fa2 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -44,6 +44,8 @@ var LibrarySDL = { ctrlKey: false, altKey: false, + textInput: false, + startTime: null, mouseX: 0, mouseY: 0, @@ -173,6 +175,11 @@ var LibrarySDL = { ['i16', 'mod'], ['i32', 'unicode'] ]), + TextInputEvent: Runtime.generateStructInfo([ + ['i32', 'type'], + ['i32', 'windowID'], + ['b256', 'text'], + ]), MouseMotionEvent: Runtime.generateStructInfo([ ['i32', 'type'], ['i32', 'windowID'], @@ -373,7 +380,7 @@ var LibrarySDL = { } } // fall through - case 'keydown': case 'keyup': case 'mousedown': case 'mouseup': case 'DOMMouseScroll': case 'mousewheel': + case 'keydown': case 'keyup': case 'keypress': case 'mousedown': case 'mouseup': case 'DOMMouseScroll': case 'mousewheel': if (event.type == 'DOMMouseScroll' || event.type == 'mousewheel') { var button = (event.type == 'DOMMouseScroll' ? event.detail : -event.wheelDelta) > 0 ? 4 : 3; var event2 = { @@ -397,6 +404,10 @@ var LibrarySDL = { SDL.DOMButtons[event.button] = 0; } + if (event.type == 'keypress' && !SDL.textInput) { + break; + } + SDL.events.push(event); if (SDL.events.length >= 10000) { Module.printErr('SDL event queue full, dropping earliest event'); @@ -476,6 +487,15 @@ var LibrarySDL = { break; } + case 'keypress': { + {{{ makeSetValue('ptr', 'SDL.structs.TextInputEvent.type', 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}} + // Not filling in windowID for now + var cStr = intArrayFromString(String.fromCharCode(event.charCode)); + for (var i = 0; i < cStr.length; ++i) { + {{{ makeSetValue('ptr', 'SDL.structs.TextInputEvent.text + i', 'cStr[i]', 'i8') }}}; + } + break; + } case 'mousedown': case 'mouseup': if (event.type == 'mousedown') { // SDL_BUTTON(x) is defined as (1 << ((x)-1)). SDL buttons are 1-3, @@ -618,6 +638,7 @@ var LibrarySDL = { // Initialize this structure carefully for closure SDL.DOMEventToSDLEvent['keydown'] = 0x300 /* SDL_KEYDOWN */; SDL.DOMEventToSDLEvent['keyup'] = 0x301 /* SDL_KEYUP */; + SDL.DOMEventToSDLEvent['keypress'] = 0x303 /* SDL_TEXTINPUT */; SDL.DOMEventToSDLEvent['mousedown'] = 0x401 /* SDL_MOUSEBUTTONDOWN */; SDL.DOMEventToSDLEvent['mouseup'] = 0x402 /* SDL_MOUSEBUTTONUP */; SDL.DOMEventToSDLEvent['mousemove'] = 0x400 /* SDL_MOUSEMOTION */; @@ -1175,8 +1196,12 @@ var LibrarySDL = { SDL_CondWait: function() {}, SDL_DestroyCond: function() {}, - SDL_StartTextInput: function() {}, // TODO - SDL_StopTextInput: function() {}, // TODO + SDL_StartTextInput: function() { + SDL.textInput = true; + }, + SDL_StopTextInput: function() { + SDL.textInput = false; + }, // SDL Mixer @@ -1290,6 +1315,8 @@ var LibrarySDL = { // the browser has already preloaded the audio file. var channelInfo = SDL.channels[channel]; channelInfo.audio = audio = audio.cloneNode(true); + audio.numChannels = info.audio.numChannels; + audio.frequency = info.audio.frequency; if (SDL.channelFinished) { audio['onended'] = function() { // TODO: cache these Runtime.getFuncWrapper(SDL.channelFinished, 'vi')(channel); diff --git a/src/modules.js b/src/modules.js index 712d8a78..afdbc21e 100644 --- a/src/modules.js +++ b/src/modules.js @@ -179,7 +179,16 @@ var Variables = { globals: {}, indexedGlobals: {}, // for indexed globals, ident ==> index // Used in calculation of indexed globals - nextIndexedOffset: 0 + nextIndexedOffset: 0, + + resolveAliasToIdent: function(ident) { + while (1) { + var varData = Variables.globals[ident]; + if (!(varData && varData.targetIdent)) break; + ident = varData.targetIdent; // might need to eval to turn (6) into 6 + } + return ident; + }, }; var Types = { diff --git a/src/parseTools.js b/src/parseTools.js index 6e0d6e32..6a2089ad 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -78,6 +78,7 @@ function toNiceIdent(ident) { assert(ident); if (parseFloat(ident) == ident) return ident; if (ident == 'null') return '0'; // see parseNumerical + if (ident == 'undef') return '0'; return ident.replace('%', '$').replace(/["&\\ \.@:<>,\*\[\]\(\)-]/g, '_'); } @@ -984,18 +985,24 @@ function checkSafeHeap() { function getHeapOffset(offset, type, forceAsm) { if (USE_TYPED_ARRAYS !== 2) { return offset; - } else { - if (Runtime.getNativeFieldSize(type) > 4) { - type = 'i32'; // XXX we emulate 64-bit values as 32 - } - var shifts = Math.log(Runtime.getNativeTypeSize(type))/Math.LN2; - offset = '(' + offset + ')'; - if (shifts != 0) { - return '(' + offset + '>>' + shifts + ')'; + } + + if (Runtime.getNativeFieldSize(type) > 4) { + type = 'i32'; // XXX we emulate 64-bit values as 32 + } + + var sz = Runtime.getNativeTypeSize(type); + var shifts = Math.log(sz)/Math.LN2; + offset = '(' + offset + ')'; + if (shifts != 0) { + if (CHECK_HEAP_ALIGN) { + return '(CHECK_ALIGN_' + sz + '(' + offset + ')>>' + shifts + ')'; } else { - // we need to guard against overflows here, HEAP[U]8 expects a guaranteed int - return isJSVar(offset) ? offset : '(' + offset + '|0)'; + return '(' + offset + '>>' + shifts + ')'; } + } else { + // we need to guard against overflows here, HEAP[U]8 expects a guaranteed int + return isJSVar(offset) ? offset : '(' + offset + '|0)'; } } @@ -1364,11 +1371,15 @@ var TWO_TWENTY = Math.pow(2, 20); function getFastValue(a, op, b, type) { a = a.toString(); b = b.toString(); + a = a == 'true' ? '1' : (a == 'false' ? '0' : a); + b = b == 'true' ? '1' : (b == 'false' ? '0' : b); if (isNumber(a) && isNumber(b)) { if (op == 'pow') { return Math.pow(a, b).toString(); } else { - return eval(a + op + '(' + b + ')').toString(); // parens protect us from "5 - -12" being seen as "5--12" which is "(5--)12" + var value = eval(a + op + '(' + b + ')'); // parens protect us from "5 - -12" being seen as "5--12" which is "(5--)12" + if (op == '/' && type in Runtime.INT_TYPES) value = value|0; // avoid emitting floats + return value.toString(); } } if (op == 'pow') { @@ -1829,9 +1840,10 @@ function makeSignOp(value, type, op, force, ignore) { if (!CHECK_SIGNS || ignore) { if (bits === 32) { if (op === 're') { - return '((' + value + ')|0)'; + return '(' + getFastValue(value, '|', '0') + ')'; } else { - return '((' + value + ')>>>0)'; + + return '(' + getFastValue(value, '>>>', '0') + ')'; // Alternatively, we can consider the lengthier // return makeInlineCalculation('VALUE >= 0 ? VALUE : ' + Math.pow(2, bits) + ' + VALUE', value, 'tempBigInt'); // which does not always turn us into a 32-bit *un*signed value @@ -1840,7 +1852,7 @@ function makeSignOp(value, type, op, force, ignore) { if (op === 're') { return makeInlineCalculation('(VALUE << ' + (32-bits) + ') >> ' + (32-bits), value, 'tempInt'); } else { - return '((' + value + ')&' + (Math.pow(2, bits)-1) + ')'; + return '(' + getFastValue(value, '&', Math.pow(2, bits)-1) + ')'; } } else { // bits > 32 if (op === 're') { diff --git a/src/preamble.js b/src/preamble.js index 6f4b49de..8bde7284 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -150,6 +150,25 @@ function SAFE_HEAP_COPY_HISTORY(dest, src) { //========================================== #endif +#if CHECK_HEAP_ALIGN +//======================================== +// Debugging tools - alignment check +//======================================== +function CHECK_ALIGN_8(addr) { + assert((addr & 7) == 0, "address must be 8-byte aligned, is " + addr + "!"); + return addr; +} +function CHECK_ALIGN_4(addr) { + assert((addr & 3) == 0, "address must be 4-byte aligned, is " + addr + "!"); + return addr; +} +function CHECK_ALIGN_2(addr) { + assert((addr & 1) == 0, "address must be 2-byte aligned!"); + return addr; +} +#endif + + #if CHECK_OVERFLOWS //======================================== // Debugging tools - Mathop overflows @@ -251,11 +270,9 @@ Module["ccall"] = ccall; // Returns the C function with a specified identifier (for C++, you need to do manual name mangling) function getCFunc(ident) { try { - var func = eval('_' + ident); + var func = globalScope['Module']['_' + ident]; // closure exported function + if (!func) func = eval('_' + ident); // explicit lookup } catch(e) { - try { - func = globalScope['Module']['_' + ident]; // closure exported function - } catch(e) {} } assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)'); return func; @@ -549,6 +566,7 @@ function enlargeMemory() { while (TOTAL_MEMORY <= STATICTOP) { // Simple heuristic. Override enlargeMemory() if your program has something more optimal for it TOTAL_MEMORY = alignMemoryPage(2*TOTAL_MEMORY); } + 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 USE_TYPED_ARRAYS == 1 var oldIHEAP = IHEAP; Module['HEAP'] = Module['IHEAP'] = HEAP = IHEAP = new Int32Array(TOTAL_MEMORY); diff --git a/src/settings.js b/src/settings.js index 308afddc..3fd31326 100644 --- a/src/settings.js +++ b/src/settings.js @@ -107,10 +107,11 @@ var SKIP_STACK_IN_SMALL = 1; // When enabled, does not push/pop the stack at all // In particular, be careful with the autodebugger! (We do turn // this off automatically in that case, though.) var INLINE_LIBRARY_FUNCS = 1; // Will inline library functions that have __inline defined -var INLINING_LIMIT = 50; // A limit on inlining. If 0, we will inline normally in LLVM and +var INLINING_LIMIT = 0; // A limit on inlining. If 0, we will inline normally in LLVM and // closure. If greater than 0, we will *not* inline in LLVM, and // we will prevent inlining of functions of this size or larger - // in closure. + // in closure. 50 is a reasonable setting if you do not want + // inlining var CATCH_EXIT_CODE = 0; // If set, causes exit() to throw an exception object which is caught // in a try..catch block and results in the exit status being // returned from run(). If zero (the default), the program is just @@ -128,6 +129,9 @@ var SAFE_HEAP = 0; // Check each write to the heap, for example, this will give // that 3 is the option you usually want here. var SAFE_HEAP_LOG = 0; // Log out all SAFE_HEAP operations +var CHECK_HEAP_ALIGN = 0; // Check heap accesses for alignment, but don't do as + // near extensive (or slow) checks as SAFE_HEAP. + var SAFE_DYNCALLS = 0; // Show stack traces on missing function pointer/virtual method calls var ASM_HEAP_LOG = 0; // Simple heap logging, like SAFE_HEAP_LOG but cheaper, and in asm.js @@ -163,6 +167,8 @@ var GL_DEBUG = 0; // Print out all calls into WebGL. As with LIBRARY_DEBUG, you var GL_TESTING = 0; // When enabled, sets preserveDrawingBuffer in the context, to allow tests to work (but adds overhead) var GL_MAX_TEMP_BUFFER_SIZE = 2097152; // How large GL emulation temp buffers are var GL_UNSAFE_OPTS = 1; // Enables some potentially-unsafe optimizations in GL emulation code +var FULL_ES2 = 0; // Forces support for all GLES2 features, not just the WebGL-friendly subset. +var FORCE_GL_EMULATION = 0; // Forces inclusion of full GL emulation code. var DISABLE_EXCEPTION_CATCHING = 0; // Disables generating code to actually catch exceptions. If the code you // are compiling does not actually rely on catching exceptions (but the diff --git a/src/shell.html b/src/shell.html index 3a0171de..4f39b26a 100644 --- a/src/shell.html +++ b/src/shell.html @@ -32,6 +32,7 @@ var element = document.getElementById('output'); element.value = ''; // clear browser cache return function(text) { + text = Array.prototype.slice.call(arguments).join(' '); // These replacements are necessary if you render to raw HTML //text = text.replace(/&/g, "&"); //text = text.replace(/</g, "<"); @@ -42,6 +43,7 @@ }; })(), printErr: function(text) { + text = Array.prototype.slice.call(arguments).join(' '); if (0) { // XXX disabled for safety typeof dump == 'function') { dump(text + '\n'); // fast, straight to the real console } else { diff --git a/tests/aniso.c b/tests/aniso.c index e673e228..e02c20ac 100644 --- a/tests/aniso.c +++ b/tests/aniso.c @@ -145,6 +145,11 @@ int main(int argc, char *argv[]) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso); } + { + assert(!glGetError()); + glBindFramebuffer(GL_RENDERBUFFER, 0); + assert(glGetError()); + } // Prepare and Render diff --git a/tests/bullet/output3.txt b/tests/bullet/output3.txt new file mode 100644 index 00000000..78f27f9f --- /dev/null +++ b/tests/bullet/output3.txt @@ -0,0 +1,270 @@ +world pos = 2.00,10.00,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.99,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.98,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.97,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.96,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.94,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.92,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.90,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.88,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.85,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.82,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.78,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.75,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.71,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.67,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.62,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.57,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.52,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.47,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.42,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.36,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.30,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.23,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.17,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.10,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,9.02,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.95,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.87,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.79,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.71,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.62,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.53,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.44,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.35,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.25,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.15,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,8.05,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.94,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.83,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.72,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.61,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.49,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.37,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.25,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.13,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,7.00,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.87,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.73,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.60,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.46,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.32,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.17,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,6.03,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.88,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.72,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.57,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.41,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.25,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,5.08,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.92,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.75,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.58,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.40,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.22,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,4.04,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,3.86,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,3.67,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,3.48,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,3.29,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,3.10,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,2.90,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,2.70,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,2.50,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,2.29,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,2.08,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,1.87,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,1.66,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,1.44,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,1.22,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,1.00,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,0.77,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,0.55,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,0.32,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,0.08,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-0.15,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-0.39,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-0.63,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-0.88,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-1.13,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-1.38,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-1.63,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-1.88,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-2.14,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-2.40,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-2.67,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-2.93,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-3.20,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-3.48,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-3.75,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.03,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.31,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.59,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.88,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.17,0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.13,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.10,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.08,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.05,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.03,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.01,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.99,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.98,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.97,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.96,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.95,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.95,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.95,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.95,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.96,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.97,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.98,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-4.99,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 +world pos = 2.00,-5.00,-0.00 +world pos = 0.00,-56.00,0.00 diff --git a/tests/cases/breakinthemiddle2.ll b/tests/cases/breakinthemiddle2.ll new file mode 100644 index 00000000..318b49dc --- /dev/null +++ b/tests/cases/breakinthemiddle2.ll @@ -0,0 +1,35 @@ +@.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1] + +define linkonce_odr i32 @main() align 2 { + %333 = call i32 @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %199 = trunc i8 1 to i1 ; [#uses=1] + br i1 %199, label %label555, label %label569 + +label555: ; preds = %0 + br label %label569 ; branch should ignore all code after it in the block + ; No predecessors! + %a472 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup + %a473 = extractvalue { i8*, i32 } %a472, 0 + %a474 = extractvalue { i8*, i32 } %a472, 1 + br label %label569 + +label569: ; preds = %0 + br i1 %199, label %label990, label %label999 + +label990: + ret i32 0 ; ret should ignore all code after it in the block + ; No predecessors! + %a472 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup + %a473 = extractvalue { i8*, i32 } %a472, 0 + %a474 = extractvalue { i8*, i32 } %a472, 1 + br label %label569 + +label999: ; preds = %555 + ret i32 0 +} + +declare i32 @printf(i8*) +declare i32 @__gxx_personality_v0(...) + diff --git a/tests/cases/callalias.ll b/tests/cases/callalias.ll new file mode 100644 index 00000000..9bc1ffd0 --- /dev/null +++ b/tests/cases/callalias.ll @@ -0,0 +1,21 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" +target triple = "i386-pc-linux-gnu" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +@othername = alias internal void ()* @doit + +define internal void @doit() unnamed_addr nounwind align 2 { + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32] + ret void +} + +define i32 @main() { +entry: + tail call void ()* @othername() nounwind + ret i32 1 +} + +declare i32 @printf(i8*, ...) + diff --git a/tests/cases/callalias2.ll b/tests/cases/callalias2.ll new file mode 100644 index 00000000..abdbe4e6 --- /dev/null +++ b/tests/cases/callalias2.ll @@ -0,0 +1,22 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" +target triple = "i386-pc-linux-gnu" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +@othername = alias internal void ()* @doit +@othername2 = alias internal void ()* @othername + +define internal void @doit() unnamed_addr nounwind align 2 { + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32] + ret void +} + +define i32 @main() { +entry: + tail call void ()* @othername2() nounwind + ret i32 1 +} + +declare i32 @printf(i8*, ...) + diff --git a/tests/cases/inttoptrfloat.ll b/tests/cases/inttoptrfloat.ll new file mode 100644 index 00000000..607539fe --- /dev/null +++ b/tests/cases/inttoptrfloat.ll @@ -0,0 +1,19 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" +target triple = "i386-pc-linux-gnu" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +; [#uses=0] +define i32 @main() { +entry: + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), float %b) ; [#uses=0 type=i32] + %ff = alloca float, align 4 + %a = load float* inttoptr (i32 4 to float*), align 4 + store float %a, float* %ff, align 4 + %b = load float* %ff, align 4 + ret i32 1 +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/cases/udiv.ll b/tests/cases/udiv.ll new file mode 100644 index 00000000..a809db5a --- /dev/null +++ b/tests/cases/udiv.ll @@ -0,0 +1,19 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" +target triple = "i386-pc-linux-gnu" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +; [#uses=0] +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + %waka = udiv i32 -1806866064, 5 + %waka2 = add i32 2247483648, 2247483648 + store i32 0, i32* %retval + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 %waka, i32 %waka2) ; [#uses=0 type=i32] + ret i32 1 +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/fuzz/2.c b/tests/fuzz/2.c new file mode 100644 index 00000000..2063b2d1 --- /dev/null +++ b/tests/fuzz/2.c @@ -0,0 +1,2006 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.2.0 + * Git version: 2751ded + * Options: --no-volatiles --no-math64 + * Seed: 2601498443 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +#pragma pack(push) +#pragma pack(1) +struct S0 { + uint32_t f0; + int16_t f1; + const uint16_t f2; + uint16_t f3; + uint8_t f4; +}; +#pragma pack(pop) + +struct S1 { + unsigned f0 : 4; + signed f1 : 23; + unsigned f2 : 21; + const unsigned f3 : 16; + unsigned f4 : 22; + signed f5 : 11; + signed f6 : 25; + unsigned f7 : 15; + unsigned f8 : 13; + uint32_t f9; +}; + +/* --- GLOBAL VARIABLES --- */ +static int32_t g_2 = 0xBD6C3F0BL; +static uint8_t g_5 = 0xC4L; +static struct S0 g_18 = {18446744073709551615UL,5L,0x0498L,0x20B5L,0xF6L}; +static int8_t g_36[8] = {0x09L,0x65L,0x09L,0x09L,0x65L,0x09L,0x09L,0x65L}; +static int32_t g_39 = 5L; +static int8_t g_40 = 9L; +static uint16_t g_71 = 0x2B10L; +static uint16_t g_79 = 0UL; +static struct S0 g_82 = {0xF60EFD82L,2L,0x24F1L,65530UL,7UL}; +static uint8_t g_119 = 4UL; +static uint32_t g_195 = 0x6554C541L; +static int32_t *g_199 = (void*)0; +static int16_t g_208 = 0L; +static uint32_t g_209 = 0UL; +static int32_t **g_220 = &g_199; +static uint16_t g_222 = 9UL; +static int32_t g_237 = 0x16D0E17FL; +static int32_t g_238 = (-6L); +static int32_t g_240 = 5L; +static uint32_t g_241 = 0x4C8054E4L; +static uint32_t g_251 = 0x944D6970L; +static uint8_t **g_254 = (void*)0; +static int8_t g_279 = 0x60L; +static int8_t g_280 = 1L; +static int32_t g_281 = 0x4E1FA7EEL; +static uint16_t g_282 = 1UL; +static int16_t *g_313[9][9][3] = {{{&g_208,&g_82.f1,(void*)0},{&g_82.f1,(void*)0,&g_208},{&g_208,&g_18.f1,(void*)0},{&g_82.f1,(void*)0,(void*)0},{&g_18.f1,&g_208,&g_82.f1},{&g_82.f1,&g_82.f1,&g_18.f1},{&g_208,&g_208,&g_18.f1},{&g_82.f1,&g_208,(void*)0},{&g_208,(void*)0,&g_18.f1}},{{&g_82.f1,&g_208,&g_18.f1},{&g_82.f1,&g_208,&g_208},{(void*)0,(void*)0,&g_82.f1},{&g_208,&g_208,&g_208},{&g_208,&g_18.f1,&g_208},{(void*)0,&g_208,&g_208},{(void*)0,(void*)0,&g_208},{&g_82.f1,(void*)0,&g_208},{&g_208,(void*)0,&g_208}},{{&g_18.f1,&g_208,&g_208},{&g_82.f1,&g_208,&g_18.f1},{&g_208,&g_18.f1,&g_82.f1},{&g_18.f1,&g_18.f1,&g_208},{&g_18.f1,&g_18.f1,&g_18.f1},{&g_208,(void*)0,(void*)0},{&g_82.f1,&g_18.f1,&g_82.f1},{&g_18.f1,(void*)0,&g_82.f1},{&g_208,&g_18.f1,&g_18.f1}},{{&g_82.f1,&g_18.f1,&g_208},{(void*)0,&g_18.f1,(void*)0},{(void*)0,(void*)0,&g_82.f1},{&g_208,&g_18.f1,(void*)0},{&g_208,(void*)0,&g_82.f1},{&g_18.f1,&g_18.f1,&g_208},{(void*)0,&g_18.f1,&g_208},{(void*)0,&g_18.f1,&g_82.f1},{(void*)0,&g_208,(void*)0}},{{&g_18.f1,&g_208,&g_82.f1},{&g_82.f1,(void*)0,(void*)0},{(void*)0,(void*)0,&g_208},{&g_82.f1,(void*)0,&g_18.f1},{(void*)0,&g_208,&g_82.f1},{&g_82.f1,&g_18.f1,&g_82.f1},{&g_18.f1,(void*)0,(void*)0},{(void*)0,&g_208,&g_18.f1},{(void*)0,&g_208,&g_18.f1}},{{&g_18.f1,&g_208,&g_18.f1},{(void*)0,&g_82.f1,&g_18.f1},{&g_208,&g_82.f1,&g_82.f1},{&g_18.f1,&g_208,(void*)0},{&g_82.f1,&g_208,&g_18.f1},{&g_208,&g_208,&g_208},{(void*)0,&g_82.f1,&g_18.f1},{&g_208,&g_208,(void*)0},{&g_18.f1,&g_82.f1,&g_82.f1}},{{&g_18.f1,&g_208,&g_18.f1},{&g_18.f1,(void*)0,&g_18.f1},{&g_208,&g_18.f1,&g_18.f1},{&g_208,&g_18.f1,&g_18.f1},{&g_18.f1,&g_82.f1,&g_82.f1},{&g_18.f1,&g_208,&g_18.f1},{&g_18.f1,&g_208,(void*)0},{&g_208,&g_18.f1,&g_18.f1},{(void*)0,(void*)0,(void*)0}},{{&g_208,&g_18.f1,&g_82.f1},{&g_82.f1,&g_208,&g_82.f1},{&g_18.f1,&g_208,(void*)0},{&g_208,&g_82.f1,&g_18.f1},{(void*)0,&g_18.f1,&g_82.f1},{&g_18.f1,&g_18.f1,&g_82.f1},{(void*)0,(void*)0,&g_18.f1},{&g_208,&g_208,(void*)0},{&g_208,&g_82.f1,&g_82.f1}},{{(void*)0,&g_208,&g_82.f1},{&g_18.f1,&g_82.f1,(void*)0},{&g_208,&g_208,&g_18.f1},{&g_18.f1,&g_208,(void*)0},{(void*)0,&g_82.f1,&g_208},{&g_18.f1,&g_82.f1,&g_208},{(void*)0,&g_82.f1,(void*)0},{(void*)0,&g_208,&g_82.f1},{&g_82.f1,&g_208,&g_82.f1}}}; +static uint32_t g_347 = 0xC4FCF803L; +static int32_t *g_366 = &g_240; +static int32_t **g_365 = &g_366; +static struct S1 g_391 = {1,2228,1279,15,579,-29,789,104,13,4294967287UL}; +static struct S1 *g_390 = &g_391; +static uint32_t g_408 = 0xCF847D91L; +static int32_t g_433 = 0x55EDE5F7L; +static int32_t g_434 = 0xB4C5C7AAL; +static int32_t g_499[3][1] = {{0x2CC689D6L},{0x2CC689D6L},{0x2CC689D6L}}; +static int32_t g_500 = 8L; +static uint32_t g_501 = 7UL; +static struct S0 g_508[9][4][7] = {{{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL}},{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL}}},{{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL}},{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL}}},{{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0x1A9DC0E9L,0x3641L,65527UL,0xD3FCL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL}},{{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x1A87F5EEL,0xD3E2L,0xED27L,65535UL,255UL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL}},{{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}}},{{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}},{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}}},{{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}},{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}}},{{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}},{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL}},{{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{18446744073709551615UL,1L,0x9E3EL,0xDB7DL,1UL},{6UL,-1L,7UL,3UL,0xB7L},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{18446744073709551615UL,0x582EL,8UL,0x124DL,1UL},{6UL,-1L,7UL,3UL,0xB7L}}},{{{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0x2EB9A52EL,0x9EFDL,0x49E1L,0xB224L,0x6FL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{1UL,-9L,0x4EAEL,0x67B1L,0x62L},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}},{{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{5UL,0x69A3L,0x0436L,0x936DL,0xAAL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}}},{{{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{5UL,0x69A3L,0x0436L,0x936DL,0xAAL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}},{{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{5UL,0x69A3L,0x0436L,0x936DL,0xAAL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}}},{{{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{5UL,0x69A3L,0x0436L,0x936DL,0xAAL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}},{{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0xDD780AAAL,0L,65532UL,0x908CL,0xFDL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{5UL,0x69A3L,0x0436L,0x936DL,0xAAL},{0xCB5D2F36L,5L,0xAAE3L,4UL,0x1FL},{0x66A29370L,1L,65533UL,0x58A9L,0xE0L}},{{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{18446744073709551612UL,-1L,1UL,0x787BL,0UL},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL},{6UL,-1L,7UL,3UL,0xB7L},{0UL,0x1B92L,0UL,0x6816L,0x23L},{6UL,-1L,7UL,3UL,0xB7L},{0xD58F413CL,0xF25BL,65531UL,0xB870L,0UL}}}}; +static int8_t *g_512 = (void*)0; +static int8_t **g_511 = &g_512; +static int8_t g_537[3] = {(-4L),(-4L),(-4L)}; +static int32_t g_540 = 0xE36F71D3L; +static int32_t g_541 = (-4L); +static uint32_t g_542 = 1UL; +static int32_t g_553 = 0x2FE5E350L; +static uint8_t g_555[1][2] = {{0x6EL,0x6EL}}; +static const int32_t g_564 = 0x25327763L; +static uint16_t *g_601 = (void*)0; +static const int32_t *g_628 = &g_499[2][0]; +static const int32_t **g_627[6][9][4] = {{{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}},{{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}},{{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{&g_628,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}},{{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}},{{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}},{{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,&g_628,&g_628},{(void*)0,&g_628,(void*)0,&g_628},{(void*)0,&g_628,(void*)0,&g_628}}}; +static int32_t *g_672[8] = {&g_434,&g_2,&g_434,&g_2,&g_434,&g_2,&g_434,&g_2}; +static uint16_t g_802 = 1UL; +static int8_t g_809[5][1][8] = {{{(-1L),1L,(-1L),7L,0L,0x60L,0xEDL,0L}},{{0xA3L,(-1L),0xCFL,0x87L,0x50L,0L,0L,0L}},{{0xA3L,0L,0xA4L,0xA4L,0L,0xA3L,1L,7L}},{{(-1L),(-1L),0L,1L,0xCFL,(-6L),0L,0xEEL}},{{0x50L,7L,(-6L),1L,(-1L),1L,(-6L),7L}}}; +static uint32_t *g_825[3][2][1] = {{{&g_391.f9},{&g_391.f9}},{{&g_391.f9},{&g_391.f9}},{{&g_391.f9},{&g_391.f9}}}; +static int32_t g_876 = 0x2FE494ACL; +static const int8_t g_910 = 0x63L; +static uint16_t *** const g_962 = (void*)0; +static int16_t g_1052 = 0xF859L; +static uint16_t g_1105[9] = {0UL,0UL,0UL,0UL,0UL,0UL,0UL,0UL,0UL}; +static int32_t g_1109 = (-8L); +static struct S1 g_1113 = {2,990,1094,87,364,-7,-4072,0,16,0x351C817AL}; +static uint32_t *g_1142[1][6][3] = {{{&g_241,&g_18.f0,&g_408},{&g_209,&g_209,&g_408},{&g_18.f0,&g_241,&g_18.f0},{&g_195,&g_209,&g_195},{&g_195,&g_18.f0,&g_209},{&g_18.f0,&g_195,&g_195}}}; +static uint32_t **g_1141 = &g_1142[0][1][1]; +static struct S0 g_1169 = {8UL,0x2BA0L,1UL,65530UL,0x66L}; +static struct S0 *g_1168 = &g_1169; +static uint16_t g_1192[1][8] = {{0x03F8L,0x03F8L,0x03F8L,0x03F8L,0x03F8L,0x03F8L,0x03F8L,0x03F8L}}; +static int8_t g_1233[8] = {4L,0x9CL,4L,4L,0x9CL,4L,4L,0x9CL}; +static uint32_t g_1263 = 4294967287UL; +static int16_t **g_1272[8] = {&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2],&g_313[1][2][2]}; +static int16_t ***g_1271[10] = {&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1],&g_1272[1]}; +static int16_t ****g_1270 = &g_1271[3]; +static int16_t g_1389 = 0xD9C6L; +static int8_t *g_1544[6] = {&g_40,&g_40,&g_40,&g_40,&g_40,&g_40}; + + +/* --- FORWARD DECLARATIONS --- */ +static uint16_t func_1(void); +static int32_t * func_6(int8_t p_7, int32_t * p_8); +static struct S0 func_9(int32_t * p_10, int32_t * p_11, int32_t * p_12); +static int32_t * func_13(const int16_t p_14, int32_t * p_15, int32_t * p_16); +static int32_t * func_19(int32_t * p_20, int32_t * p_21, struct S1 p_22); +static struct S1 func_24(uint8_t p_25, int8_t p_26, int32_t * p_27, int32_t p_28); +static uint32_t func_41(int32_t p_42, uint16_t * p_43, int32_t p_44, uint16_t p_45, int8_t * p_46); +static const uint16_t func_52(const int8_t * p_53, struct S0 p_54, uint16_t * p_55); +static const int8_t * func_56(int32_t * p_57, int16_t p_58, uint16_t * p_59, int8_t * p_60); +static uint32_t func_87(uint32_t p_88); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_2 g_18 g_5 g_39 g_40 g_71 g_36 g_82 g_119 g_79 g_195 g_209 g_222 g_220 g_199 g_208 g_241 g_240 g_254 g_282 g_237 g_280 g_347 g_238 g_365 g_390 g_408 g_391.f4 g_391.f9 g_391 g_501 g_508.f0 g_541 g_508.f4 g_511 g_512 g_542 g_434 g_601 g_537 g_499 g_508.f2 g_627 g_251 g_508.f1 g_553 g_628 g_555 g_433 g_802 g_809 g_876 g_500 g_366 g_279 g_1105 g_1109 g_1192 g_1142 g_1389 g_1169.f1 g_508 g_1168 g_1169 g_1544 + * writes: g_2 g_5 g_18.f3 g_36 g_39 g_40 g_71 g_18.f4 g_82.f1 g_119 g_82.f4 g_79 g_195 g_199 g_209 g_82.f3 g_220 g_222 g_241 g_251 g_282 g_280 g_313 g_237 g_347 g_238 g_365 g_390 g_366 g_408 g_208 g_501 g_500 g_542 g_18.f1 g_434 g_254 g_541 g_672 g_433 g_279 g_825 g_809 g_876 g_540 g_537 g_802 g_555 g_1105 g_1109 g_18.f0 g_1113.f9 g_1141 g_82.f0 g_1168 g_1169.f3 g_1192 g_1389 g_601 g_1169.f1 g_240 + */ +static uint16_t func_1(void) +{ /* block id: 0 */ + const int32_t l_17 = 0x3AC9D73DL; + int32_t *l_23 = &g_2; + struct S1 l_33 = {2,-1611,502,54,563,-32,-5497,142,81,0xEA418246L}; + uint16_t *l_34 = &g_18.f3; + int8_t *l_35[4][3][10] = {{{&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],(void*)0,&g_36[3],&g_36[7],&g_36[0],&g_36[7]},{&g_36[3],(void*)0,&g_36[3],&g_36[7],&g_36[3],(void*)0,&g_36[3],&g_36[3],&g_36[0],&g_36[6]},{&g_36[3],(void*)0,&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],(void*)0,&g_36[3]}},{{&g_36[3],(void*)0,&g_36[0],&g_36[3],&g_36[7],&g_36[6],&g_36[3],&g_36[6],&g_36[7],&g_36[3]},{&g_36[3],(void*)0,&g_36[3],(void*)0,&g_36[7],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3]},{&g_36[7],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[7],&g_36[3],&g_36[3],&g_36[0],&g_36[3]}},{{&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3]},{&g_36[3],(void*)0,&g_36[7],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[7]},{&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[7],(void*)0,&g_36[3],(void*)0,&g_36[3],(void*)0}},{{&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[0],&g_36[0]},{&g_36[3],&g_36[3],&g_36[6],(void*)0,(void*)0,&g_36[6],&g_36[3],&g_36[3],&g_36[3],&g_36[0]},{(void*)0,(void*)0,&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],&g_36[3],(void*)0}}}; + int32_t *l_1108 = &g_1109; + int32_t *l_1545 = &g_238; + uint16_t l_1556 = 0x4844L; + int32_t *l_1557 = &g_433; + struct S0 *l_1560 = &g_1169; + int i, j, k; + for (g_2 = 0; (g_2 == 11); g_2++) + { /* block id: 3 */ + g_5 = g_2; + } + l_1545 = func_6(((func_9(func_13(l_17, (g_18 , func_19(l_23, l_23, func_24((*l_23), (0x2DC8L <= (g_18.f4 <= (safe_mod_func_int16_t_s_s(((((g_36[3] = ((safe_mul_func_int8_t_s_s((l_33 , (((*l_34) = (&g_2 == &l_17)) ^ g_2)), (*l_23))) >= (*l_23))) != 0x58L) != 0UL) , g_5), 3L)))), &g_2, g_5))), l_1108), g_1142[0][2][2], g_1142[0][1][1]) , (*l_1108)) & g_508[3][3][4].f2), l_1108); + (*l_1108) = ((*g_390) , ((safe_mod_func_int32_t_s_s(0xE4015B19L, ((*l_1557) |= ((safe_mul_func_int16_t_s_s((*l_1545), (*l_1545))) == ((safe_add_func_int16_t_s_s((safe_mul_func_int8_t_s_s((safe_div_func_uint16_t_u_u((*l_1108), (*l_23))), 0xE0L)), 0x3E3DL)) && 0x0202L))))) < (*l_23))); + for (g_240 = 0; (g_240 < (-25)); g_240 = safe_sub_func_int32_t_s_s(g_240, 6)) + { /* block id: 1024 */ + struct S0 **l_1561 = &g_1168; + (*l_1561) = l_1560; + } + return (*l_23); +} + + +/* ------------------------------------------ */ +/* + * reads : g_82.f4 g_628 g_499 g_2 g_1109 g_220 g_1544 + * writes: g_82.f4 g_82.f1 g_500 g_1109 g_2 g_199 + */ +static int32_t * func_6(int8_t p_7, int32_t * p_8) +{ /* block id: 996 */ + int32_t l_1514 = (-7L); + int32_t l_1517[10][3][7] = {{{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL},{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L}},{{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L},{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL}},{{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L},{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L},{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L}},{{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL},{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L},{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L}},{{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL},{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L}},{{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L},{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL}},{{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L},{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L},{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L}},{{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL},{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L},{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L}},{{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL},{0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L}},{{0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L,(-1L),0xD643F3D2L},{0x6027BB7EL,0xECF50607L,0xECF50607L,0x6027BB7EL,0x6027BB7EL,0xECF50607L,0xECF50607L},{0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL,(-1L),0x2C43085FL}}}; + uint16_t *l_1521 = (void*)0; + int8_t *l_1522 = &g_537[0]; + const struct S1 l_1523 = {2,-1323,441,77,102,35,-3984,6,78,0UL}; + int32_t l_1526 = 0x2465F014L; + int16_t l_1533 = 0x3A98L; + int16_t l_1535 = (-5L); + int i, j, k; + for (g_82.f4 = 21; (g_82.f4 > 18); g_82.f4--) + { /* block id: 999 */ + int8_t l_1518 = 1L; + int16_t l_1524 = (-3L); + uint32_t *l_1525 = (void*)0; + (*p_8) = (safe_add_func_int32_t_s_s((func_41((((l_1526 ^= ((((*p_8) = ((((l_1514 == (p_7 ^ (0xEEC6D689L == (safe_lshift_func_int8_t_s_s(((l_1517[8][1][6] |= p_7) != (l_1518 ^ ((~(l_1518 != ((((-3L) < (safe_mul_func_uint16_t_u_u(func_41(p_7, l_1521, p_7, l_1518, l_1522), (-1L)))) , l_1523) , p_7))) || 0xB339L))), l_1518))))) || 0UL) && l_1518) & 4294967295UL)) , l_1524) == 65532UL)) , p_7) , p_7), l_1521, (*g_628), p_7, &l_1518) || 4294967292UL), 1UL)); + } + for (g_2 = 0; (g_2 > 27); g_2++) + { /* block id: 1007 */ + int32_t *l_1529 = &l_1514; + int32_t *l_1530 = &g_434; + int32_t *l_1531 = &g_237; + int32_t *l_1532[7][5] = {{&g_434,&g_2,&g_434,(void*)0,(void*)0},{&g_434,&g_2,&g_434,(void*)0,(void*)0},{&g_434,&g_2,(void*)0,&l_1514,&l_1514},{(void*)0,&l_1517[4][0][6],(void*)0,&l_1514,&l_1514},{(void*)0,&l_1517[4][0][6],(void*)0,&l_1514,&l_1514},{(void*)0,&l_1517[4][0][6],(void*)0,&l_1514,&l_1514},{(void*)0,&l_1517[4][0][6],(void*)0,&l_1514,&l_1514}}; + int8_t l_1534 = (-1L); + uint8_t l_1536[1][7][7] = {{{0xD3L,0UL,7UL,0UL,0UL,7UL,0UL},{0UL,255UL,0x9EL,0UL,255UL,0x1AL,0UL},{248UL,0UL,0x1AL,248UL,0UL,248UL,0x1AL},{8UL,8UL,0x0EL,0UL,0UL,255UL,8UL},{8UL,0x1AL,0x9EL,0UL,0x74L,0x74L,0UL},{248UL,0UL,248UL,0x1AL,0UL,248UL,255UL},{0UL,0UL,0xE9L,0UL,0UL,0x0EL,0UL}}}; + int i, j, k; + if ((*p_8)) + break; + ++l_1536[0][2][1]; + } + if ((*p_8)) + { /* block id: 1011 */ + (*g_220) = p_8; + } + else + { /* block id: 1013 */ + struct S1 *l_1539 = &g_391; + struct S1 **l_1540 = (void*)0; + struct S1 **l_1541 = &l_1539; + uint16_t *l_1542 = &g_82.f3; + int32_t l_1543 = 0x3FE0E73CL; + (*l_1541) = l_1539; + (*p_8) &= func_41(p_7, l_1542, l_1526, l_1543, g_1544[5]); + } + l_1514 = (*p_8); + return p_8; +} + + +/* ------------------------------------------ */ +/* + * reads : g_209 g_1192 g_408 g_18.f0 g_195 g_241 g_511 g_512 g_1105 g_82.f2 g_555 g_1389 g_40 g_628 g_499 g_18.f4 g_82.f1 g_1169.f1 g_508 g_220 g_1168 g_1169 + * writes: g_209 g_1169.f3 g_1192 g_408 g_18.f0 g_195 g_241 g_82.f1 g_500 g_555 g_1389 g_40 g_601 g_18.f4 g_1169.f1 g_199 g_390 + */ +static struct S0 func_9(int32_t * p_10, int32_t * p_11, int32_t * p_12) +{ /* block id: 895 */ + uint32_t l_1289 = 3UL; + uint8_t ** const *l_1291 = &g_254; + uint8_t ** const ** const l_1290 = &l_1291; + int32_t l_1335 = 1L; + int32_t l_1342 = 0x122D1585L; + int32_t l_1344[2]; + uint16_t l_1391 = 0x4F32L; + uint32_t *l_1400[6] = {&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9}; + int8_t l_1402 = (-1L); + const struct S0 *l_1417 = &g_508[3][3][4]; + uint32_t *l_1424 = &l_1289; + uint32_t **l_1427 = &g_1142[0][5][2]; + uint32_t l_1429 = 0x32A2A297L; + int8_t *l_1447 = &g_279; + int32_t l_1460 = 1L; + const int16_t l_1468 = 1L; + int32_t l_1498 = 8L; + int i; + for (i = 0; i < 2; i++) + l_1344[i] = 0xC9F0AD98L; + if ((l_1289 && (l_1290 != &l_1291))) + { /* block id: 896 */ + uint8_t l_1292[1]; + int32_t l_1327 = 0x2CA2ED02L; + int32_t l_1336[5][6] = {{0L,(-6L),0x2325E39FL,0xAF70E644L,0x06C4E62EL,(-1L)},{0xDD12AB3AL,0x1CD1E72DL,(-1L),0x06C4E62EL,(-1L),0x1CD1E72DL},{0xDD12AB3AL,(-1L),0x06C4E62EL,0xAF70E644L,0x2325E39FL,(-6L)},{0xDFD6990FL,(-1L),(-1L),(-6L),(-6L),(-1L)},{(-1L),(-1L),0x738CE679L,0xDFD6990FL,0x06C4E62EL,(-6L)}}; + uint16_t *l_1360 = (void*)0; + uint32_t l_1368 = 0x88AF1839L; + int8_t *l_1382[10][3][7] = {{{&g_809[0][0][0],(void*)0,(void*)0,&g_809[4][0][6],&g_279,&g_809[0][0][0],&g_809[4][0][6]},{&g_36[0],&g_36[7],&g_537[0],&g_537[1],&g_537[2],(void*)0,(void*)0},{&g_537[2],&g_809[0][0][0],&g_1233[1],&g_809[0][0][0],&g_537[2],&g_809[0][0][0],&g_36[4]}},{{&g_1233[0],(void*)0,&g_537[1],&g_36[4],&g_279,(void*)0,&g_1233[0]},{&g_537[0],&g_1233[0],(void*)0,&g_279,&g_36[4],&g_537[1],(void*)0},{&g_1233[0],&g_36[4],&g_809[0][0][0],&g_537[2],&g_809[0][0][0],&g_1233[1],&g_809[0][0][0]}},{{&g_537[2],(void*)0,(void*)0,&g_537[2],&g_537[1],&g_537[0],&g_36[7]},{&g_36[0],&g_809[4][0][6],&g_809[0][0][0],&g_279,&g_809[4][0][6],(void*)0,(void*)0},{&g_809[0][0][0],&g_809[0][0][0],&g_1233[1],&g_36[4],&g_1233[1],&g_1233[1],&g_36[7]}},{{&g_809[0][0][0],(void*)0,&g_36[0],&g_809[0][0][0],&g_279,&g_279,&g_809[0][0][0]},{&g_36[0],&g_537[2],&g_36[0],&g_537[1],&g_809[0][0][0],&g_279,(void*)0},{&g_809[0][0][0],&g_809[0][0][0],&g_1233[1],&g_809[4][0][6],&g_36[7],&g_809[0][0][0],&g_279}},{{(void*)0,&g_809[4][0][5],(void*)0,(void*)0,(void*)0,&g_280,(void*)0},{&g_809[0][0][0],(void*)0,&g_809[4][0][5],(void*)0,&g_279,(void*)0,&g_809[4][0][5]},{(void*)0,(void*)0,&g_537[2],&g_537[1],&g_537[0],&g_36[7],&g_36[0]}},{{&g_809[0][0][0],&g_809[4][0][5],&g_36[3],&g_809[0][0][0],&g_280,&g_36[3],&g_537[1]},{&g_1233[1],&g_537[0],&g_280,(void*)0,&g_537[0],&g_809[0][0][0],&g_36[3]},{&g_36[0],&g_279,&g_36[7],&g_279,&g_279,&g_36[7],&g_279}},{{&g_36[0],&g_36[3],&g_809[0][0][0],&g_537[0],(void*)0,&g_280,&g_537[0]},{&g_1233[1],&g_537[1],&g_36[3],&g_280,&g_809[0][0][0],&g_36[3],&g_809[4][0][5]},{&g_809[0][0][0],&g_36[0],&g_36[7],&g_537[0],&g_537[1],&g_537[2],(void*)0}},{{(void*)0,&g_809[4][0][5],(void*)0,&g_279,(void*)0,&g_809[4][0][5],(void*)0},{&g_809[0][0][0],(void*)0,&g_280,(void*)0,(void*)0,(void*)0,&g_809[4][0][5]},{(void*)0,&g_279,&g_537[2],&g_809[0][0][0],&g_36[0],&g_36[7],&g_537[0]}},{{&g_537[1],&g_809[4][0][5],&g_280,&g_537[1],&g_280,&g_1233[1],&g_279},{&g_1233[1],(void*)0,(void*)0,&g_280,&g_809[0][0][0],(void*)0,&g_1233[1]},{&g_537[1],(void*)0,&g_36[4],(void*)0,&g_36[0],&g_36[4],(void*)0}},{{&g_809[0][0][0],&g_1233[1],(void*)0,&g_279,&g_280,&g_36[3],&g_279},{(void*)0,(void*)0,&g_280,&g_809[4][0][5],&g_279,&g_36[3],&g_36[3]},{&g_279,&g_809[0][0][0],&g_36[4],&g_809[0][0][0],&g_279,&g_1233[0],&g_36[0]}}}; + int32_t l_1401 = (-9L); + int i, j, k; + for (i = 0; i < 1; i++) + l_1292[i] = 1UL; + ++l_1292[0]; + for (g_209 = 22; (g_209 > 44); g_209 = safe_add_func_uint16_t_u_u(g_209, 7)) + { /* block id: 900 */ + uint8_t l_1302 = 250UL; + int32_t l_1322 = 0x6B975B0CL; + int32_t l_1343[7][3] = {{0L,0L,(-2L)},{0xB97A3A68L,0x0944A5F0L,0x2461D461L},{0L,0L,0x2461D461L},{0x0944A5F0L,0xB97A3A68L,(-2L)},{0L,0L,0L},{0L,0x0944A5F0L,0L},{0x0944A5F0L,0L,0L}}; + int16_t l_1346[7][1][10] = {{{1L,8L,8L,1L,0x36ECL,0x3A6CL,6L,0xE8B3L,1L,1L}},{{0xE8B3L,0x691FL,6L,0x36ECL,6L,0xB5D7L,8L,6L,1L,0x3A6CL}},{{(-1L),1L,0x7EDEL,1L,0x72E8L,0x7AB0L,0x72E8L,1L,0x7EDEL,1L}},{{0L,0xB5D7L,0x3A6CL,0x3EA9L,(-10L),0x36ECL,0x3EA9L,0xE8B3L,0x29FAL,0L}},{{0x3A6CL,(-1L),0xB5D7L,0x8336L,0xB5D7L,(-7L),0xE7DBL,0x29FAL,0x1158L,0x1158L}},{{0xE8B3L,(-10L),6L,0x29FAL,0x29FAL,6L,(-10L),0xE8B3L,0x691FL,6L}},{{0x29FAL,0xE7DBL,(-7L),0xB5D7L,0x8336L,1L,0x29FAL,0x7EDEL,0x7AB0L,0x29FAL}}}; + uint16_t *l_1358 = (void*)0; + int8_t *l_1390 = &g_280; + int32_t l_1403 = 2L; + int i, j, k; + } + } + else + { /* block id: 946 */ + uint16_t *l_1425 = (void*)0; + uint16_t *l_1426 = &g_1169.f3; + int32_t l_1428 = 0x895941A3L; + uint16_t *l_1430 = &g_1192[0][7]; + int32_t l_1431 = (-7L); + int32_t *l_1436[8][2][2] = {{{&l_1335,&l_1335},{&l_1335,&l_1431}},{{&g_39,&g_238},{&l_1431,&g_238}},{{&g_39,&l_1431},{&l_1335,&l_1335}},{{&l_1335,&l_1431},{&g_39,&g_238}},{{&l_1431,&g_238},{&g_39,&l_1431}},{{&l_1335,&l_1335},{&l_1335,&l_1431}},{{&g_39,&g_238},{&l_1431,&g_238}},{{&g_39,&l_1431},{&l_1335,&l_1335}}}; + struct S0 l_1477 = {1UL,1L,0x5EBBL,0xA03BL,0x3FL}; + int i, j, k; + (*p_12) = ((((*l_1426) = (p_11 == (l_1424 = p_11))) | (l_1427 != &g_1142[0][0][2])) > ((l_1428 , l_1429) != ((((l_1431 = ((l_1428 >= (((l_1344[1] , (((*l_1430) ^= l_1344[1]) < 0x71D3L)) <= l_1289) < 1L)) , 249UL)) | l_1344[1]) | 0x92L) , l_1344[1]))); + (*p_11) = (safe_mod_func_int16_t_s_s(l_1431, (--(*l_1430)))); + l_1436[7][1][0] = (((l_1428 ^ 0xAFL) & ((*p_12) && l_1431)) , &l_1431); + if (((*p_12) = (safe_lshift_func_int8_t_s_u((((safe_sub_func_int8_t_s_s(func_41((safe_lshift_func_uint16_t_u_s((((((&l_1417 == ((0xF7A9L > (l_1335 == (*p_11))) , (void*)0)) <= func_41((safe_mul_func_uint16_t_u_u(l_1289, l_1429)), &g_1192[0][2], (safe_mod_func_uint8_t_u_u((l_1402 && l_1335), l_1429)), l_1344[1], (*g_511))) , l_1289) > l_1402) , l_1344[1]), 14)), &g_222, l_1391, l_1335, l_1447), g_1105[8])) | l_1289) && 0L), 4)))) + { /* block id: 956 */ + uint32_t l_1452 = 0x19EBA21BL; + int32_t l_1457 = 5L; + uint8_t *l_1465 = &g_555[0][0]; + const uint16_t **l_1478[2]; + uint16_t l_1481 = 0xF23DL; + int i; + for (i = 0; i < 2; i++) + l_1478[i] = (void*)0; + (*p_12) = ((safe_add_func_int8_t_s_s((safe_add_func_int8_t_s_s(l_1452, l_1402)), (safe_mod_func_int16_t_s_s((safe_rshift_func_uint8_t_u_u((l_1457 &= g_82.f2), (((safe_lshift_func_uint8_t_u_u(l_1342, 2)) , func_41((((l_1460 || ((safe_mul_func_uint16_t_u_u(((safe_div_func_int8_t_s_s(((~(++(*l_1465))) == func_41(l_1452, l_1430, l_1452, l_1452, l_1465)), l_1452)) && l_1391), 0x642EL)) & 0x6C9408A5L)) & l_1468) == 0x97L), &l_1391, l_1335, l_1452, (*g_511))) == 3L))), l_1468)))) , (*p_12)); + for (g_1389 = 0; (g_1389 < (-25)); g_1389--) + { /* block id: 962 */ + uint16_t *l_1476 = (void*)0; + const int32_t l_1479[9] = {0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL,0x7870A31CL}; + int32_t l_1480 = 0xBD654D60L; + int i; + for (g_40 = 0; (g_40 <= 2); g_40 += 1) + { /* block id: 965 */ + uint16_t l_1475 = 1UL; + if ((*p_11)) + break; + l_1480 = (safe_mod_func_int32_t_s_s((safe_rshift_func_int8_t_s_s(((((func_41(l_1475, (l_1452 , (g_601 = l_1476)), (*g_628), (&g_1142[0][1][1] == &g_1142[0][1][1]), (l_1477 , (*g_511))) > 0xEAA0L) , &g_601) == l_1478[0]) , l_1479[0]), 3)), 1UL)); + --l_1481; + } + } + } + else + { /* block id: 972 */ + int32_t l_1490 = 0xBC1D070AL; + int32_t l_1495 = 0x55B4B91BL; + int32_t l_1496 = 0L; + int32_t l_1497[1][1][5] = {{{5L,5L,5L,5L,5L}}}; + uint16_t l_1506 = 0x8821L; + struct S1 **l_1509[2]; + int i, j, k; + for (i = 0; i < 2; i++) + l_1509[i] = &g_390; + for (g_18.f4 = 0; (g_18.f4 < 54); g_18.f4 = safe_add_func_uint8_t_u_u(g_18.f4, 5)) + { /* block id: 975 */ + for (g_82.f1 = 6; (g_82.f1 > 20); g_82.f1 = safe_add_func_uint32_t_u_u(g_82.f1, 1)) + { /* block id: 978 */ + for (g_1169.f1 = (-2); (g_1169.f1 != (-22)); g_1169.f1 = safe_sub_func_uint16_t_u_u(g_1169.f1, 3)) + { /* block id: 981 */ + return (*l_1417); + } + } + } + if ((l_1490 ^ (safe_div_func_uint16_t_u_u(l_1342, l_1490)))) + { /* block id: 986 */ + (*p_12) = (*p_12); + } + else + { /* block id: 988 */ + int32_t l_1493[3][3] = {{(-4L),(-4L),(-1L)},{(-4L),(-4L),(-1L)},{(-4L),(-4L),(-1L)}}; + int32_t l_1494 = 0xF56B557AL; + int32_t l_1499 = 0L; + int32_t l_1500 = 0x64A61DCEL; + int32_t l_1501 = 0x18BA8B7FL; + int32_t l_1502 = 0xFD7B4B2BL; + int32_t l_1503 = 0x1CDE3638L; + int32_t l_1504 = 1L; + int32_t l_1505 = (-1L); + int i, j; + ++l_1506; + } + (*g_220) = p_12; + g_390 = &g_391; + } + } + return (*g_1168); +} + + +/* ------------------------------------------ */ +/* + * reads : g_2 g_1109 g_82 g_802 g_220 g_390 g_391 g_18 g_542 g_555 g_119 g_1105 g_199 g_279 g_501 g_499 g_5 g_1192 g_251 + * writes: g_1109 g_18.f0 g_2 g_802 g_1113.f9 g_1141 g_279 g_199 g_82.f4 g_82.f0 g_542 g_555 g_119 g_1105 g_390 g_501 g_1168 g_5 g_251 g_82.f3 + */ +static int32_t * func_13(const int16_t p_14, int32_t * p_15, int32_t * p_16) +{ /* block id: 748 */ + uint32_t l_1116[9][10] = {{0x90628E09L,0xB05BB543L,0xB05BB543L,0x90628E09L,6UL,0x7AA97B2BL,0x2750F53DL,0UL,0x5A6596A4L,0UL},{0xB05BB543L,4294967294UL,0x0D9C2F16L,0x0D9C2F16L,6UL,0xCA63206FL,0x2ADE30DFL,4294967294UL,0UL,0x90628E09L},{4294967294UL,0xB05BB543L,0x2750F53DL,0x5A6596A4L,0x2ADE30DFL,0x2ADE30DFL,0x5A6596A4L,0x2750F53DL,0xB05BB543L,4294967294UL},{0x71DF7270L,0xB05BB543L,0UL,4294967293UL,0x0D9C2F16L,0x90628E09L,0x2ADE30DFL,0x90628E09L,0x0D9C2F16L,4294967293UL},{4294967293UL,0xCA63206FL,4294967293UL,0xB05BB543L,0x0D9C2F16L,0x7AA97B2BL,4294967294UL,6UL,6UL,4294967294UL},{0x0D9C2F16L,0x2ADE30DFL,0x7AA97B2BL,0x7AA97B2BL,0x2ADE30DFL,0x0D9C2F16L,0x71DF7270L,6UL,0x5A6596A4L,0x90628E09L},{0xCA63206FL,0x90628E09L,4294967293UL,0x2750F53DL,6UL,0x2750F53DL,4294967293UL,0x90628E09L,0xCA63206FL,0x0D9C2F16L},{0xCA63206FL,0x7AA97B2BL,0UL,0x71DF7270L,0x2750F53DL,0x0D9C2F16L,0x0D9C2F16L,0x2750F53DL,0x71DF7270L,0UL},{0x0D9C2F16L,0x0D9C2F16L,0x2750F53DL,0x71DF7270L,0UL,0x7AA97B2BL,0xCA63206FL,4294967294UL,0xCA63206FL,0x7AA97B2BL}}; + int8_t *l_1119 = &g_537[0]; + int32_t l_1122 = (-1L); + int32_t l_1126 = (-1L); + struct S1 **l_1130 = &g_390; + struct S1 ***l_1129 = &l_1130; + int32_t l_1178 = 0x6946CE07L; + int32_t l_1180[2]; + int8_t l_1196[3][10][5] = {{{(-5L),(-1L),0xEDL,(-1L),(-5L)},{0L,4L,0x17L,0xFCL,0x93L},{0x89L,0x46L,0x5DL,(-1L),(-1L)},{0xFCL,1L,0xFCL,(-1L),0xE8L},{5L,(-1L),0xEDL,0x5DL,0x89L},{0xE8L,0x89L,4L,4L,0x89L},{0x43L,9L,0xEDL,0x89L,0x46L},{0xFCL,0xF4L,0L,0xBFL,0xC4L},{0x0FL,0x43L,0x43L,0x0FL,0L},{0xFCL,4L,0x93L,0x42L,0xBFL}},{{0x43L,(-5L),(-1L),0xEDL,(-1L)},{0xE8L,0xE8L,0xBFL,0x42L,0x93L},{5L,0x5DL,0L,0x0FL,0x43L},{0L,0xBFL,0xC4L,0xBFL,0L},{(-1L),0x5DL,0x46L,0x89L,0xEDL},{0x42L,0xE8L,0x89L,4L,4L},{0x89L,(-5L),0x89L,0x5DL,0xEDL},{1L,4L,0xE8L,(-1L),0L},{0xEDL,0x43L,(-1L),(-1L),0x43L},{0x89L,0xF4L,0xE8L,0L,0x93L}},{{(-5L),9L,0x89L,0L,(-1L)},{0x17L,0x89L,0x89L,0x17L,0xBFL},{(-5L),(-1L),0x46L,(-1L),5L},{0xF4L,0L,0xBFL,0xC4L,0xBFL},{(-1L),(-1L),5L,(-1L),0xEDL},{0xFCL,0x89L,1L,0x93L,0xF4L},{(-1L),5L,0L,5L,(-1L)},{4L,0x89L,0xE8L,0x42L,0xC4L},{(-1L),(-1L),9L,0x5DL,0x5DL},{0x42L,0L,0x42L,0x89L,0xC4L}}}; + int8_t l_1197 = (-1L); + uint32_t *l_1205 = &g_251; + uint8_t *l_1210 = &g_119; + int16_t *l_1215[2][10][4] = {{{&g_18.f1,&g_18.f1,&g_18.f1,(void*)0},{&g_18.f1,(void*)0,(void*)0,&g_18.f1},{&g_1052,(void*)0,(void*)0,(void*)0},{&g_18.f1,&g_18.f1,&g_18.f1,&g_18.f1},{&g_18.f1,(void*)0,&g_1052,&g_18.f1},{&g_1052,&g_18.f1,(void*)0,(void*)0},{(void*)0,(void*)0,&g_18.f1,&g_18.f1},{(void*)0,(void*)0,(void*)0,(void*)0},{&g_1052,&g_18.f1,&g_1052,(void*)0},{&g_18.f1,&g_18.f1,&g_18.f1,(void*)0}},{{&g_18.f1,(void*)0,(void*)0,&g_18.f1},{&g_1052,(void*)0,(void*)0,(void*)0},{&g_18.f1,&g_18.f1,&g_18.f1,&g_18.f1},{&g_18.f1,(void*)0,&g_1052,&g_18.f1},{&g_1052,&g_18.f1,(void*)0,&g_18.f1},{(void*)0,(void*)0,&g_18.f1,(void*)0},{(void*)0,&g_508[3][3][4].f1,&g_18.f1,(void*)0},{&g_18.f1,(void*)0,&g_18.f1,&g_18.f1},{&g_1052,(void*)0,&g_18.f1,(void*)0},{(void*)0,&g_508[3][3][4].f1,&g_508[3][3][4].f1,(void*)0}}}; + int16_t l_1216 = (-4L); + int32_t l_1250 = (-5L); + int8_t l_1260 = (-10L); + int32_t l_1261 = 5L; + int32_t *l_1280[8][10] = {{&g_39,&g_39,&l_1126,&g_238,(void*)0,&g_39,&g_876,&l_1126,(void*)0,(void*)0},{&g_39,&g_876,&l_1126,(void*)0,(void*)0,&g_876,&g_876,(void*)0,(void*)0,&l_1126},{&g_39,&g_39,&l_1126,&g_238,(void*)0,&g_39,&g_876,&l_1126,(void*)0,(void*)0},{&g_39,&g_876,&l_1126,(void*)0,(void*)0,&g_876,&g_876,(void*)0,(void*)0,&l_1126},{&g_39,&g_39,&l_1126,&g_238,(void*)0,&g_39,&g_876,&l_1126,(void*)0,(void*)0},{&g_39,&g_876,&l_1126,(void*)0,(void*)0,&g_876,&g_876,(void*)0,(void*)0,&l_1126},{&g_39,&g_39,&l_1126,&g_238,(void*)0,&g_39,&g_876,&l_1126,(void*)0,(void*)0},{&g_39,&g_876,&l_1126,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,&g_39,&g_238}}; + struct S0 **l_1283 = &g_1168; + int32_t *l_1287 = (void*)0; + int32_t *l_1288 = &l_1178; + int i, j, k; + for (i = 0; i < 2; i++) + l_1180[i] = 0x8AE8E413L; + if ((*p_15)) + { /* block id: 749 */ + struct S1 *l_1110 = &g_391; + struct S1 **l_1111[8][5][5] = {{{&l_1110,(void*)0,&g_390,&g_390,&g_390},{&l_1110,&l_1110,&l_1110,&l_1110,&l_1110},{&l_1110,&g_390,&g_390,&l_1110,&g_390},{&l_1110,&g_390,&g_390,&g_390,&g_390},{&l_1110,&g_390,&l_1110,&l_1110,&g_390}},{{(void*)0,&l_1110,&g_390,&l_1110,&l_1110},{&g_390,(void*)0,&g_390,&l_1110,&g_390},{&g_390,&g_390,&l_1110,&g_390,&g_390},{&l_1110,&l_1110,&g_390,&l_1110,&l_1110},{&l_1110,&g_390,&g_390,&l_1110,&g_390}},{{&g_390,&l_1110,&l_1110,&g_390,&g_390},{(void*)0,&g_390,&g_390,&l_1110,&g_390},{&g_390,(void*)0,&g_390,&g_390,&g_390},{&l_1110,&l_1110,&l_1110,&l_1110,&g_390},{&l_1110,&g_390,&g_390,&l_1110,&g_390}},{{&g_390,&g_390,&g_390,&l_1110,&g_390},{&g_390,&g_390,&l_1110,&g_390,&l_1110},{(void*)0,&l_1110,&g_390,&l_1110,&g_390},{&l_1110,(void*)0,&l_1110,&l_1110,&g_390},{&l_1110,(void*)0,&l_1110,&g_390,&l_1110}},{{(void*)0,&l_1110,&l_1110,(void*)0,(void*)0},{&l_1110,&l_1110,&g_390,&g_390,&l_1110},{&l_1110,&g_390,&g_390,&l_1110,(void*)0},{(void*)0,&l_1110,(void*)0,(void*)0,&l_1110},{&l_1110,(void*)0,&g_390,&l_1110,&g_390}},{{&l_1110,&l_1110,&l_1110,&g_390,(void*)0},{(void*)0,&l_1110,&g_390,(void*)0,&l_1110},{(void*)0,&l_1110,(void*)0,&g_390,&l_1110},{&g_390,&l_1110,&g_390,&l_1110,&l_1110},{(void*)0,&l_1110,&g_390,(void*)0,&g_390}},{{&g_390,(void*)0,&l_1110,&l_1110,&g_390},{(void*)0,&l_1110,&l_1110,&l_1110,&g_390},{(void*)0,&g_390,&l_1110,(void*)0,&l_1110},{&l_1110,&l_1110,&l_1110,&l_1110,&l_1110},{&l_1110,&l_1110,&g_390,&l_1110,&l_1110}},{{(void*)0,(void*)0,&l_1110,(void*)0,(void*)0},{&l_1110,(void*)0,&l_1110,&l_1110,&g_390},{&g_390,&g_390,(void*)0,&l_1110,&l_1110},{&l_1110,&g_390,(void*)0,(void*)0,&l_1110},{&g_390,&l_1110,&l_1110,&l_1110,&l_1110}}}; + struct S1 *l_1112 = &g_1113; + uint8_t ***l_1118[9][9] = {{(void*)0,&g_254,(void*)0,&g_254,&g_254,(void*)0,&g_254,(void*)0,&g_254},{&g_254,(void*)0,(void*)0,&g_254,&g_254,(void*)0,&g_254,&g_254,&g_254},{&g_254,&g_254,(void*)0,&g_254,&g_254,(void*)0,(void*)0,&g_254,&g_254},{(void*)0,&g_254,(void*)0,&g_254,&g_254,(void*)0,&g_254,(void*)0,&g_254},{&g_254,(void*)0,(void*)0,&g_254,&g_254,(void*)0,&g_254,&g_254,&g_254},{&g_254,&g_254,(void*)0,&g_254,&g_254,(void*)0,(void*)0,&g_254,&g_254},{(void*)0,&g_254,(void*)0,&g_254,&g_254,(void*)0,&g_254,(void*)0,&g_254},{&g_254,(void*)0,(void*)0,&g_254,&g_254,(void*)0,&g_254,&g_254,&g_254},{&g_254,&g_254,(void*)0,&g_254,&g_254,(void*)0,(void*)0,&g_254,&g_254}}; + uint8_t ****l_1117 = &l_1118[0][8]; + const int8_t *l_1120 = &g_279; + int16_t *l_1121[8][2] = {{(void*)0,&g_82.f1},{&g_1052,&g_82.f1},{(void*)0,&g_82.f1},{&g_1052,&g_82.f1},{(void*)0,&g_82.f1},{&g_1052,&g_82.f1},{(void*)0,&g_82.f1},{&g_1052,&g_82.f1}}; + uint32_t *l_1123 = &g_18.f0; + int32_t l_1124 = 0xEDBDFF21L; + uint32_t l_1125 = 0UL; + int32_t l_1181 = 0L; + int32_t l_1183 = 0xF8FD7B68L; + int i, j, k; + l_1112 = l_1110; + (*p_16) ^= 0x92C5D770L; + if ((safe_add_func_int32_t_s_s(((l_1116[4][0] = 0UL) , (((l_1126 &= ((((((*l_1123) = (((((&g_254 != ((*l_1117) = &g_254)) , l_1119) == l_1119) , (l_1122 ^= l_1116[1][6])) ^ 0xEF73L)) , (-9L)) <= l_1124) && 0xDAL) , l_1125)) <= 0x1610ADAAL) && 65535UL)), p_14))) + { /* block id: 757 */ +lbl_1158: + (*p_15) = (0x3E96A966L < (*p_16)); + } + else + { /* block id: 759 */ + struct S1 ****l_1131 = &l_1129; + int32_t l_1147 = 0xF6AFA3B1L; + int32_t l_1150 = 0xA4754866L; + int32_t l_1177 = 0L; + int32_t l_1179 = (-4L); + int32_t l_1182[9] = {1L,1L,1L,1L,1L,1L,1L,1L,1L}; + int16_t l_1185 = 0x36BEL; + int i; + if ((safe_lshift_func_int8_t_s_s(p_14, (((*l_1131) = l_1129) == (g_82 , &l_1130))))) + { /* block id: 761 */ + uint32_t l_1135 = 0xD5BBD21CL; + for (g_1109 = 15; (g_1109 > (-10)); g_1109--) + { /* block id: 764 */ + int32_t *l_1134[1][3]; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 3; j++) + l_1134[i][j] = &l_1124; + } + for (g_2 = 0; (g_2 <= 0); g_2 += 1) + { /* block id: 767 */ + return p_16; + } + l_1135--; + } + for (g_802 = 2; (g_802 <= 8); g_802 += 1) + { /* block id: 774 */ + for (g_1113.f9 = 0; (g_1113.f9 <= 2); g_1113.f9 += 1) + { /* block id: 777 */ + uint32_t ***l_1138 = (void*)0; + uint32_t **l_1140 = (void*)0; + uint32_t ***l_1139[7]; + int i; + for (i = 0; i < 7; i++) + l_1139[i] = &l_1140; + g_1141 = &l_1123; + } + for (g_279 = 0; (g_279 <= 8); g_279 += 1) + { /* block id: 782 */ + (*g_220) = p_16; + } + } + for (g_82.f4 = 0; (g_82.f4 == 25); g_82.f4++) + { /* block id: 788 */ + for (g_82.f0 = 0; (g_82.f0 <= 0); g_82.f0 += 1) + { /* block id: 791 */ + int i; + (*g_220) = func_19(p_15, p_15, (*g_390)); + (*g_220) = func_19((*g_220), p_16, (*g_390)); + } + } + } + else + { /* block id: 796 */ + uint32_t **l_1145 = &l_1123; + int32_t l_1146 = (-6L); + int8_t *l_1163[3][5] = {{&g_809[0][0][0],&g_36[3],&g_809[0][0][0],&g_809[0][0][0],&g_36[0]},{&g_279,&g_537[0],&g_36[0],&g_537[0],&g_279},{&g_809[0][0][0],&g_537[0],&g_36[3],&g_279,&g_36[3]}}; + int32_t l_1176[3][1]; + int i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + l_1176[i][j] = 0x96B5594EL; + } + (**l_1129) = (**l_1129); + for (g_279 = 8; (g_279 >= 3); g_279 -= 1) + { /* block id: 800 */ + uint8_t l_1155 = 255UL; + (*p_16) = (((void*)0 != l_1145) | l_1146); + for (g_501 = 0; (g_501 <= 2); g_501 += 1) + { /* block id: 804 */ + int32_t *l_1148 = &g_1109; + int32_t *l_1149 = &g_433; + int32_t *l_1151 = &g_500; + int32_t *l_1152 = &g_238; + int32_t *l_1153 = &g_434; + int32_t *l_1154[9] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int i; + (*p_16) &= (*p_15); + if (l_1147) + break; + --l_1155; + } + } + for (g_18.f0 = 0; (g_18.f0 <= 0); g_18.f0 += 1) + { /* block id: 812 */ + int32_t *l_1171 = &l_1146; + int32_t *l_1172 = &g_434; + int32_t *l_1173 = (void*)0; + int32_t *l_1174 = (void*)0; + int32_t *l_1175[9][1][2] = {{{&l_1124,&g_238}},{{&l_1147,&g_238}},{{&l_1124,&g_39}},{{&g_39,&l_1124}},{{&g_238,&l_1147}},{{&g_238,&l_1124}},{{&g_39,&g_39}},{{&l_1124,&g_238}},{{&l_1147,&g_238}}}; + int32_t l_1184 = 0xC96082DDL; + uint32_t l_1186[10][9][2] = {{{0x6E9628BBL,18446744073709551615UL},{18446744073709551615UL,0x2C2C3B62L},{18446744073709551608UL,4UL},{2UL,18446744073709551612UL},{0x2C2C3B62L,0x2C2C3B62L},{0UL,1UL},{0x6E9628BBL,18446744073709551607UL},{0x886E6C5AL,0xFCF6436BL},{18446744073709551612UL,0x886E6C5AL}},{{18446744073709551613UL,18446744073709551609UL},{18446744073709551613UL,0x886E6C5AL},{18446744073709551612UL,0xFCF6436BL},{0x886E6C5AL,18446744073709551607UL},{0x6E9628BBL,1UL},{18446744073709551607UL,18446744073709551615UL},{18446744073709551615UL,0x02BC55E2L},{18446744073709551606UL,0xFCF6436BL},{0xFFBA7176L,18446744073709551615UL}},{{0x8232C893L,18446744073709551612UL},{0x886E6C5AL,1UL},{1UL,2UL},{0xFCF6436BL,1UL},{18446744073709551615UL,0x6E9628BBL},{0UL,18446744073709551613UL},{0xFCF6436BL,4UL},{18446744073709551613UL,1UL},{18446744073709551606UL,4UL}},{{0x8232C893L,0xFFBA7176L},{18446744073709551615UL,0xFCF6436BL},{0xDCED0008L,0xFCF6436BL},{18446744073709551615UL,0xFFBA7176L},{0x8232C893L,4UL},{18446744073709551606UL,1UL},{18446744073709551613UL,4UL},{0xFCF6436BL,18446744073709551613UL},{0UL,0x6E9628BBL}},{{18446744073709551615UL,1UL},{0xFCF6436BL,2UL},{1UL,1UL},{0x886E6C5AL,18446744073709551612UL},{0x8232C893L,18446744073709551615UL},{0xFFBA7176L,0xFCF6436BL},{18446744073709551606UL,0x02BC55E2L},{18446744073709551615UL,18446744073709551615UL},{18446744073709551607UL,4UL}},{{0x886E6C5AL,18446744073709551615UL},{18446744073709551613UL,2UL},{0x02BC55E2L,18446744073709551613UL},{18446744073709551615UL,0xB081ED74L},{18446744073709551615UL,18446744073709551613UL},{0x02BC55E2L,2UL},{18446744073709551613UL,18446744073709551615UL},{0x886E6C5AL,4UL},{18446744073709551607UL,18446744073709551615UL}},{{18446744073709551615UL,0x02BC55E2L},{18446744073709551606UL,0xFCF6436BL},{0xFFBA7176L,18446744073709551615UL},{0x8232C893L,18446744073709551612UL},{0x886E6C5AL,1UL},{1UL,2UL},{0xFCF6436BL,1UL},{18446744073709551615UL,18446744073709551606UL},{0xFA7C8EF7L,0UL}},{{4UL,1UL},{0UL,18446744073709551612UL},{18446744073709551608UL,0x02BC55E2L},{18446744073709551615UL,0x9A98F82CL},{18446744073709551609UL,4UL},{18446744073709551609UL,4UL},{18446744073709551609UL,0x9A98F82CL},{18446744073709551615UL,0x02BC55E2L},{18446744073709551608UL,18446744073709551612UL}},{{0UL,1UL},{4UL,0UL},{0xFA7C8EF7L,18446744073709551606UL},{18446744073709551607UL,3UL},{4UL,0xDCED0008L},{3UL,18446744073709551612UL},{1UL,0xA6DAAE01L},{18446744073709551615UL,18446744073709551609UL},{0x9A98F82CL,4UL}},{{18446744073709551608UL,0x6D14230FL},{18446744073709551609UL,18446744073709551609UL},{0x4F5E8A69L,0x02BC55E2L},{1UL,5UL},{0UL,0xDCED0008L},{0x6D14230FL,0UL},{18446744073709551607UL,3UL},{18446744073709551607UL,0UL},{0x6D14230FL,0xDCED0008L}}}; + int i, j, k; + if ((*p_15)) + break; + if (g_391.f5) + goto lbl_1158; + for (g_2 = 0; (g_2 <= 0); g_2 += 1) + { /* block id: 817 */ + struct S0 *l_1170[8] = {&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4],&g_508[3][3][4]}; + int i, j; + (*p_16) &= (safe_sub_func_uint32_t_u_u(g_499[g_18.f0][g_2], (l_1116[(g_18.f0 + 6)][(g_2 + 6)] , ((p_14 > (l_1120 != l_1163[2][4])) & (safe_sub_func_uint32_t_u_u((safe_div_func_int32_t_s_s(0x03DEC767L, p_14)), (((g_1168 = &g_508[3][3][4]) != l_1170[4]) , 0x42A71327L))))))); + (*p_16) = (p_14 < 0L); + } + l_1186[1][3][0]++; + for (g_5 = 0; (g_5 <= 0); g_5 += 1) + { /* block id: 825 */ + uint16_t l_1189[4] = {0xF7CAL,0xF7CAL,0xF7CAL,0xF7CAL}; + int i; + --l_1189[3]; + } + } + (*p_15) ^= (((*p_16) = l_1178) , g_1192[0][6]); + } + } + } + else + { /* block id: 833 */ + int32_t *l_1193 = (void*)0; + int32_t *l_1194 = &g_876; + int32_t *l_1195[10][4] = {{&g_237,&l_1180[0],&l_1180[0],&l_1180[0]},{&g_237,&l_1180[0],&g_237,&g_238},{&l_1180[0],&l_1180[0],&g_238,&g_238},{&l_1180[0],&l_1180[0],&l_1178,&l_1180[0]},{&l_1180[0],&l_1180[0],&l_1178,&l_1180[0]},{&l_1180[0],&g_237,&g_238,&l_1178},{&l_1180[0],&g_237,&g_237,&g_238},{&l_1180[0],&g_238,&l_1178,&g_237},{&l_1180[0],&l_1178,&l_1180[0],&l_1180[0]},{&g_238,&g_237,&l_1180[0],&l_1180[0]}}; + uint8_t l_1198 = 0UL; + int i, j; + l_1198++; + } + (*p_15) ^= (safe_lshift_func_int16_t_s_s((safe_div_func_uint32_t_u_u(((*l_1205)++), l_1196[2][6][1])), (l_1180[0] = (((+(safe_lshift_func_uint8_t_u_u(((*l_1210)++), ((safe_lshift_func_int16_t_s_s(l_1116[4][0], 6)) , 1UL)))) == 1L) , p_14)))); + if (l_1216) + { /* block id: 840 */ + return p_15; + } + else + { /* block id: 842 */ + uint16_t l_1221[2][9][6] = {{{1UL,0xA6E1L,8UL,65535UL,1UL,0UL},{0UL,65535UL,0UL,1UL,1UL,0UL},{0xA6E1L,0xA6E1L,0xB9C0L,8UL,1UL,0UL},{0xA6E1L,8UL,65535UL,1UL,0UL,0xB9C0L},{0UL,0xA6E1L,65535UL,65535UL,0xA6E1L,0UL},{1UL,65535UL,0xB9C0L,1UL,0xA6E1L,0UL},{1UL,0xA6E1L,0UL,8UL,0UL,0UL},{1UL,8UL,8UL,1UL,1UL,0xB9C0L},{1UL,0xA6E1L,8UL,65535UL,1UL,0UL}},{{0UL,65535UL,0UL,1UL,1UL,0UL},{0xA6E1L,0xA6E1L,0xB9C0L,8UL,1UL,0UL},{0xA6E1L,8UL,65535UL,1UL,0UL,0xB9C0L},{0UL,0xA6E1L,65535UL,65535UL,0xA6E1L,0UL},{1UL,65535UL,0xB9C0L,1UL,0xA6E1L,0UL},{1UL,0xA6E1L,0UL,8UL,0UL,0UL},{1UL,8UL,8UL,1UL,1UL,0xB9C0L},{1UL,0xA6E1L,8UL,65535UL,1UL,0UL},{0UL,65535UL,0UL,1UL,1UL,0UL}}}; + int32_t *l_1234 = (void*)0; + int32_t l_1237 = 0xDB5C3602L; + int32_t l_1242 = 0L; + int32_t l_1247 = 0xF2CC364AL; + int32_t l_1249 = 0xF1E7180FL; + int32_t l_1251 = 0xA149DBF1L; + int32_t l_1252 = 0xFBB6885AL; + int32_t l_1253[5][9][5] = {{{0L,0x84665002L,2L,(-7L),0xBD32F491L},{0xA6FBD2E6L,0L,0xC28A2745L,0xBD32F491L,(-10L)},{(-1L),0L,3L,0L,0L},{0L,0x0ACB57C3L,1L,0xBB327930L,(-9L)},{0xD71E7DEDL,0xA08123F0L,5L,0L,0L},{0x267D6E1AL,0x32F668E8L,0x3E8D01CAL,0xA6FBD2E6L,0x32F668E8L},{(-3L),0x32F668E8L,2L,0L,0xA7E3B020L},{7L,0xA08123F0L,0L,0xF657A079L,0x51757FC2L},{0x98382590L,0x0ACB57C3L,0L,0xD71E7DEDL,0x09C94484L}},{{1L,0L,0xBB327930L,0xF602B128L,0L},{(-9L),0L,0L,(-9L),2L},{0x267D6E1AL,0x84665002L,0x16EEF47BL,7L,0x09C94484L},{(-8L),7L,(-10L),5L,9L},{0xF657A079L,0L,0xA08123F0L,7L,1L},{0L,0x84665002L,0xEDF5817DL,0L,0x267D6E1AL},{0xA08123F0L,0x83309CD8L,0xF602B128L,0L,(-1L)},{(-1L),(-3L),(-10L),0xA7E3B020L,2L},{0xD71E7DEDL,0xA6FBD2E6L,(-6L),0xBD32F491L,(-1L)}},{{0xBB327930L,(-9L),0x770F047CL,1L,0L},{0x09C94484L,0xA08123F0L,(-7L),0x83309CD8L,1L},{0x09C94484L,0x84665002L,0x78A1D5A5L,(-1L),0x83309CD8L},{0xBB327930L,(-1L),0xAED3E08DL,(-8L),0xBD32F491L},{0xD71E7DEDL,0xAED3E08DL,0L,0x84665002L,0xA08123F0L},{(-1L),0xD71E7DEDL,0xAAF60F01L,0x09C94484L,0x09C94484L},{0xA08123F0L,0xBD32F491L,0xA08123F0L,1L,0L},{0L,0x770F047CL,(-3L),0x84665002L,1L},{0xBD32F491L,0L,0x3E8D01CAL,0xD71E7DEDL,0L}},{{0x32DA8A12L,0x0ACB57C3L,(-3L),1L,(-1L)},{(-1L),0xF602B128L,0xA08123F0L,0x83309CD8L,0xF602B128L},{0L,0x267D6E1AL,0xAAF60F01L,0L,7L},{0xAED3E08DL,0x0ACB57C3L,0L,(-7L),0L},{(-9L),0L,0xAED3E08DL,0xA7E3B020L,0x51757FC2L},{0x32F668E8L,(-10L),0x78A1D5A5L,(-1L),0x84665002L},{(-5L),0L,0x074F165CL,(-5L),0L},{0xC28A2745L,0xBFC76879L,(-1L),0L,0xD0F8360AL},{1L,0L,0x32F668E8L,1L,2L}},{{0x074F165CL,0xF602B128L,0L,0L,0x51757FC2L},{0xA08123F0L,7L,0x1C985263L,0x770F047CL,0x1C985263L},{0x32DA8A12L,0x32DA8A12L,(-1L),0xC28A2745L,0xF602B128L},{0xAAF60F01L,1L,0L,1L,0x770F047CL},{(-7L),0x78A1D5A5L,(-10L),0L,0xAAF60F01L},{0L,1L,0x0ACB57C3L,0xA08123F0L,0xAED3E08DL},{3L,0x32DA8A12L,0x074F165CL,0x748F8E4EL,5L},{5L,7L,0xBFC76879L,0xBB327930L,0x748F8E4EL},{0L,0xF602B128L,0L,(-7L),0L}}}; + int8_t *l_1284 = &g_809[1][0][5]; + int i, j, k; + (*p_16) = (!(safe_sub_func_int32_t_s_s((safe_mod_func_uint16_t_u_u((l_1180[1] |= p_14), 1L)), ((l_1196[2][4][3] < (-1L)) >= (&g_365 != ((++l_1221[0][4][4]) , &g_365)))))); +lbl_1285: + for (g_82.f3 = (-28); (g_82.f3 == 18); g_82.f3 = safe_add_func_int8_t_s_s(g_82.f3, 3)) + { /* block id: 848 */ + int16_t l_1235 = (-2L); + int32_t l_1238 = 1L; + int8_t l_1239 = 0x39L; + int32_t l_1241[3][10][2] = {{{0x0F2A4A28L,0L},{0xE6C9B04AL,1L},{0xD502F28DL,(-1L)},{0L,0x674EC8C3L},{0x674EC8C3L,0x674EC8C3L},{0L,(-1L)},{0xD502F28DL,1L},{0xE6C9B04AL,0L},{0x0F2A4A28L,0xE6C9B04AL},{0x9CBF4857L,0xC8A66176L}},{{0x9CBF4857L,0xE6C9B04AL},{0x0F2A4A28L,0L},{0xE6C9B04AL,1L},{0xD502F28DL,(-1L)},{0L,0x674EC8C3L},{0x674EC8C3L,0x674EC8C3L},{0L,(-1L)},{0xD502F28DL,0x9CBF4857L},{1L,0xE6C9B04AL},{(-1L),1L}},{{0x674EC8C3L,0x0F2A4A28L},{0x674EC8C3L,1L},{(-1L),0xE6C9B04AL},{1L,0x9CBF4857L},{0L,0x1D6C64F6L},{0xE6C9B04AL,0xC8A66176L},{0xC8A66176L,0xC8A66176L},{0xE6C9B04AL,0x1D6C64F6L},{0L,0x9CBF4857L},{1L,0xE6C9B04AL}}}; + int32_t l_1259 = 0x4D187B5CL; + int32_t l_1262 = 0x2EE8D66DL; + struct S1 l_1266 = {2,2376,563,217,1949,19,665,112,9,0x0FC184AEL}; + int i, j, k; + } + if ((safe_unary_minus_func_uint32_t_u((p_14 != p_14)))) + { /* block id: 885 */ + int32_t *l_1286 = &l_1247; + if (g_391.f3) + goto lbl_1285; + return p_16; + } + else + { /* block id: 888 */ + (*p_15) = (~((*p_16) = 0L)); + } + } + (*g_220) = l_1287; + return (*g_220); +} + + +/* ------------------------------------------ */ +/* + * reads : g_18 g_542 g_555 g_119 g_1105 + * writes: g_2 g_542 g_555 g_119 g_1105 g_1109 + */ +static int32_t * func_19(int32_t * p_20, int32_t * p_21, struct S1 p_22) +{ /* block id: 736 */ + uint16_t l_1090 = 1UL; + struct S0 l_1091 = {0UL,-9L,65535UL,0xE985L,0xC8L}; + uint32_t *l_1092 = &g_542; + uint32_t *l_1093[1]; + int32_t l_1094 = 0x39EBFE2DL; + uint16_t **l_1095 = &g_601; + int32_t l_1096 = 0x616926E9L; + uint8_t *l_1097 = &g_555[0][0]; + uint8_t *l_1100 = &g_119; + int32_t *l_1101[9][2] = {{(void*)0,&g_433},{&g_434,&g_434},{&g_434,&g_433},{(void*)0,&g_238},{&g_433,&g_238},{(void*)0,&g_433},{&g_434,&g_434},{&g_434,&g_433},{(void*)0,&g_238}}; + uint8_t l_1102[1]; + int i, j; + for (i = 0; i < 1; i++) + l_1093[i] = &g_347; + for (i = 0; i < 1; i++) + l_1102[i] = 255UL; + (*p_20) = (safe_rshift_func_int8_t_s_s(((safe_add_func_uint16_t_u_u(p_22.f0, l_1090)) , p_22.f5), 4)); + (*p_20) = ((l_1091.f1 , p_22.f6) ^ ((*l_1100) ^= (((g_18 , ((p_22.f7 |= (l_1094 = ((*l_1092) &= l_1091.f4))) & ((l_1096 = (l_1095 == l_1095)) && (++(*l_1097))))) || 7UL) != 0xF44BF0BDL))); + l_1102[0]--; + g_1105[8]--; + return p_20; +} + + +/* ------------------------------------------ */ +/* + * reads : g_18.f1 g_2 g_39 g_40 g_18.f3 g_71 g_36 g_82 g_5 g_18.f4 g_18.f0 g_119 g_79 g_195 g_209 g_18.f2 g_222 g_220 g_199 g_208 g_241 g_240 g_254 g_282 g_237 g_280 g_347 g_238 g_365 g_390 g_408 g_391.f4 g_391.f9 g_391 g_501 g_508.f0 g_541 g_508.f4 g_511 g_512 g_434 g_601 g_537 g_499 g_508.f2 g_627 g_251 g_508.f1 g_553 g_628 g_542 g_555 g_433 g_802 g_809 g_876 g_500 g_366 g_279 g_18 + * writes: g_39 g_40 g_71 g_18.f3 g_18.f4 g_36 g_82.f1 g_119 g_82.f4 g_2 g_79 g_195 g_199 g_209 g_5 g_82.f3 g_220 g_222 g_241 g_251 g_282 g_280 g_313 g_237 g_347 g_238 g_365 g_390 g_366 g_408 g_208 g_501 g_500 g_542 g_18.f1 g_434 g_254 g_541 g_672 g_433 g_279 g_825 g_809 g_876 g_540 g_537 g_802 + */ +static struct S1 func_24(uint8_t p_25, int8_t p_26, int32_t * p_27, int32_t p_28) +{ /* block id: 8 */ + uint16_t *l_47 = &g_18.f3; + int16_t l_72 = 0xAD7DL; + int32_t l_74 = 0x16071ECCL; + int32_t l_575[6][3]; + struct S1 l_592 = {0,-1419,958,232,442,9,-5643,122,57,4294967290UL}; + uint16_t **l_700 = &g_601; + int32_t *l_782 = &g_433; + uint32_t l_827 = 4294967295UL; + int32_t l_938 = (-6L); + uint32_t l_957 = 0xD9715F58L; + int8_t *l_1012 = (void*)0; + uint32_t l_1070[1]; + uint32_t l_1081 = 1UL; + int32_t *l_1084 = &l_74; + int i, j; + for (i = 0; i < 6; i++) + { + for (j = 0; j < 3; j++) + l_575[i][j] = 0L; + } + for (i = 0; i < 1; i++) + l_1070[i] = 0xE68764B7L; + if (g_18.f1) + { /* block id: 9 */ + int32_t *l_37 = (void*)0; + int32_t *l_38[4][4][10] = {{{(void*)0,&g_2,&g_2,&g_2,(void*)0,(void*)0,&g_39,&g_39,&g_2,&g_2},{(void*)0,&g_2,&g_2,&g_2,(void*)0,(void*)0,&g_2,(void*)0,&g_39,&g_39},{(void*)0,&g_2,&g_2,(void*)0,&g_39,&g_39,&g_39,&g_2,&g_39,&g_39},{&g_39,&g_2,&g_39,&g_2,&g_2,&g_39,&g_2,&g_39,&g_39,&g_39}},{{&g_2,&g_39,&g_39,&g_2,&g_2,&g_2,&g_39,&g_2,&g_2,&g_2},{&g_39,(void*)0,&g_39,&g_39,&g_2,&g_2,&g_39,&g_2,&g_2,&g_39},{&g_39,&g_39,&g_39,&g_2,&g_39,&g_39,&g_2,&g_2,&g_2,&g_39},{(void*)0,&g_39,&g_2,&g_39,(void*)0,&g_39,&g_39,&g_2,(void*)0,&g_39}},{{&g_2,&g_2,(void*)0,&g_2,(void*)0,&g_39,&g_2,&g_2,&g_39,&g_39},{&g_2,&g_2,&g_2,&g_39,(void*)0,(void*)0,&g_2,&g_2,&g_2,&g_39},{&g_2,&g_39,&g_39,(void*)0,&g_39,(void*)0,(void*)0,&g_39,(void*)0,&g_39},{&g_39,&g_39,&g_39,(void*)0,&g_2,&g_2,&g_2,&g_39,(void*)0,(void*)0}},{{(void*)0,&g_39,&g_2,&g_2,&g_39,&g_2,&g_2,&g_2,&g_39,&g_2},{&g_2,&g_39,&g_39,&g_2,(void*)0,&g_2,(void*)0,(void*)0,&g_39,&g_2},{&g_2,&g_39,&g_2,&g_39,&g_2,&g_39,&g_2,&g_39,(void*)0,(void*)0},{&g_39,(void*)0,&g_39,&g_39,&g_2,(void*)0,&g_39,&g_39,&g_39,&g_39}}}; + int32_t *l_61[2][1]; + uint16_t *l_70 = &g_71; + uint8_t *l_73[2]; + int16_t *l_75 = (void*)0; + int16_t *l_76 = (void*)0; + int16_t *l_77 = &l_72; + uint16_t *l_78 = &g_79; + struct S1 l_603 = {3,-2739,1333,112,1230,-2,4967,47,47,0xB711FC9EL}; + uint8_t **l_675 = &l_73[0]; + int32_t l_695 = 7L; + uint16_t l_749[7][10][3] = {{{0UL,65529UL,0xC0C0L},{65535UL,65529UL,0x94E8L},{0x61EEL,0x8649L,9UL},{0xEF64L,65535UL,0x0753L},{65535UL,0x8FD1L,0x62BAL},{0xDD08L,0x8DCEL,0x4F98L},{65526UL,1UL,65535UL},{0xE257L,0x0394L,0xE257L},{0x0394L,65535UL,65535UL},{0xCE6DL,65535UL,0x05EEL}},{{1UL,0x4888L,1UL},{1UL,0xE257L,1UL},{1UL,1UL,65529UL},{0xCE6DL,1UL,0xE143L},{0x0394L,0x05EEL,65528UL},{0xE257L,0xBEEBL,0xF789L},{65526UL,0x55B4L,65531UL},{0xDD08L,1UL,0xBB19L},{65535UL,0xBB19L,65535UL},{0xEF64L,0xCE6DL,0x9B57L}},{{0x61EEL,65535UL,0x105EL},{65535UL,0xABD0L,0x105EL},{0UL,65526UL,0x9B57L},{0x0C0CL,1UL,65535UL},{0xF789L,0x94E8L,0xBB19L},{0x4F98L,0x0753L,65531UL},{65535UL,0xFC46L,0xF789L},{0xE143L,65528UL,65535UL},{0xBEEBL,1UL,0x0C0CL},{0xBB19L,0x4888L,1UL}},{{1UL,9UL,1UL},{65535UL,65529UL,0xDF24L},{0x55B4L,9UL,65531UL},{0x1339L,0x4888L,1UL},{65535UL,1UL,0x33CFL},{65531UL,65535UL,9UL},{65526UL,0x105EL,65535UL},{0xDF24L,65529UL,0xBEEBL},{0xFC46L,0x4979L,65529UL},{1UL,1UL,0xEF64L}},{{1UL,0xE143L,0x4979L},{1UL,0x94E8L,0x61EEL},{1UL,0xEB09L,1UL},{1UL,0x2E04L,0x62BAL},{1UL,65535UL,0x8649L},{0xFC46L,1UL,0x105EL},{0xDF24L,65535UL,0x1339L},{65526UL,0xCE6DL,1UL},{65531UL,65531UL,65535UL},{65535UL,0xCBF3L,1UL}},{{0x1339L,0x8DCEL,0x1123L},{0x55B4L,0x33CFL,65535UL},{65535UL,0x1339L,0x1123L},{1UL,65535UL,1UL},{0xBB19L,5UL,65535UL},{0xBEEBL,0x9B57L,1UL},{0x0C0CL,0xFC46L,0x1339L},{0xEB09L,1UL,0x105EL},{65535UL,0UL,0x8649L},{0x4888L,0x8DCEL,65535UL}},{{0xDD08L,65535UL,1UL},{0x4F98L,65535UL,0x55B4L},{65529UL,65535UL,0x62BAL},{65535UL,65535UL,0xFC46L},{0x105EL,0x8DCEL,0UL},{65526UL,9UL,65528UL},{0UL,1UL,0x05EEL},{65535UL,0xCBF3L,1UL},{0x8649L,65535UL,0x8649L},{65535UL,65531UL,0xCE6DL}}}; + int32_t ** const *l_786[2][8][5] = {{{(void*)0,(void*)0,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,(void*)0,&g_365,(void*)0},{&g_365,&g_365,&g_365,&g_365,(void*)0},{&g_365,(void*)0,(void*)0,&g_365,(void*)0},{(void*)0,&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,&g_365,(void*)0,&g_365}},{{&g_365,&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,(void*)0,&g_365},{(void*)0,&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365,(void*)0}}}; + struct S1 **l_818 = &g_390; + int32_t l_860 = 8L; + int32_t l_892 = 0x202F9FF8L; + int i, j, k; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 1; j++) + l_61[i][j] = &g_39; + } + for (i = 0; i < 2; i++) + l_73[i] = &g_18.f4; +lbl_673: + g_40 ^= (g_39 &= (*p_27)); + if ((func_41(g_18.f1, l_47, (safe_sub_func_int32_t_s_s((safe_mul_func_uint8_t_u_u((func_52(func_56(l_61[1][0], ((*l_77) = ((safe_sub_func_uint32_t_u_u(0xF8A1C32FL, ((l_74 |= (safe_mul_func_uint16_t_u_u(((*l_47) = (safe_sub_func_int16_t_s_s((g_40 , (safe_rshift_func_int8_t_s_s((g_18.f3 , ((*p_27) <= (*p_27))), 5))), (((*l_70) |= 65535UL) || p_25)))), l_72))) || p_25))) , (-2L))), l_78, &g_36[2]), g_82, l_77) && g_541), g_508[3][3][4].f4)), l_575[0][0])), g_391.f9, (*g_511)) != p_25)) + { /* block id: 367 */ + int32_t l_587 = 0xAFFEE3ACL; + uint8_t l_588 = 0xFBL; + int32_t l_602 = 0xF8DD99D7L; + if ((g_391.f1 == (*p_27))) + { /* block id: 368 */ + uint16_t l_584 = 65535UL; + struct S1 l_591[9] = {{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L},{3,2063,1226,210,751,33,2362,168,69,0x04BFF210L}}; + int i; + for (g_542 = 0; (g_542 <= 2); g_542 += 1) + { /* block id: 371 */ + uint16_t l_581 = 0UL; + l_581++; + l_584--; + } + for (g_18.f1 = 0; (g_18.f1 <= 7); g_18.f1 += 1) + { /* block id: 377 */ + l_588--; + } + for (g_238 = 0; (g_238 <= 2); g_238 += 1) + { /* block id: 382 */ + for (g_82.f1 = 0; (g_82.f1 <= 1); g_82.f1 += 1) + { /* block id: 385 */ + return l_591[3]; + } + for (g_434 = 0; (g_434 <= 2); g_434 += 1) + { /* block id: 390 */ + uint16_t **l_593 = (void*)0; + uint16_t **l_594 = &l_70; + struct S1 l_595 = {2,-2250,1129,1,2028,29,5333,169,16,6UL}; + int i, j; + l_575[g_434][g_434] = (((*l_594) = (l_575[(g_434 + 2)][g_238] , (l_592 , &g_71))) == (void*)0); + return l_595; + } + } + } + else + { /* block id: 396 */ + int32_t *l_596 = (void*)0; + l_602 |= func_41((((((void*)0 == l_596) , (safe_mod_func_int16_t_s_s((l_588 , (((((*l_78) = p_26) , l_47) != l_47) <= func_41((safe_add_func_uint32_t_u_u(func_41(p_26, g_601, l_587, l_72, (*g_511)), (*p_27))), &g_282, l_588, p_28, (*g_511)))), p_28))) , 0xADL) , g_434), l_75, p_26, l_592.f2, (*g_511)); + } + } + else + { /* block id: 400 */ + struct S0 *l_604 = (void*)0; + if ((*p_27)) + { /* block id: 401 */ + return l_603; + } + else + { /* block id: 403 */ + struct S0 **l_605 = &l_604; + (*l_605) = l_604; + return l_603; + } + } + if ((l_575[2][2] |= func_87(l_72))) + { /* block id: 409 */ + uint16_t l_631[6]; + uint32_t l_637 = 0x181F7B27L; + int32_t l_670 = 0xD9A9CC58L; + uint32_t l_676[1]; + struct S1 l_679[7][10][2] = {{{{2,-1595,443,51,912,38,-5277,33,28,1UL},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}},{{3,413,618,36,589,4,634,43,83,0xAF2EF906L},{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L}},{{0,-523,834,104,710,-13,-2819,22,16,0UL},{3,-384,30,246,951,38,-5520,66,28,0UL}},{{0,2383,255,170,10,-40,4091,149,35,4294967295UL},{3,30,1123,48,463,-38,-3243,95,17,0x1E3FA1E9L}},{{0,-1550,67,243,803,1,3103,136,36,0x608032FFL},{0,-2441,1229,9,874,-6,2068,127,59,0xAFA15E54L}},{{0,184,615,146,238,40,-4905,150,1,0x5702A702L},{0,-2441,1229,9,874,-6,2068,127,59,0xAFA15E54L}},{{0,-1550,67,243,803,1,3103,136,36,0x608032FFL},{3,30,1123,48,463,-38,-3243,95,17,0x1E3FA1E9L}},{{0,2383,255,170,10,-40,4091,149,35,4294967295UL},{3,-384,30,246,951,38,-5520,66,28,0UL}},{{0,-523,834,104,710,-13,-2819,22,16,0UL},{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L}},{{3,413,618,36,589,4,634,43,83,0xAF2EF906L},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}}},{{{2,-1595,443,51,912,38,-5277,33,28,1UL},{1,50,448,210,1100,13,348,78,35,0x1D982557L}},{{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL},{0,-1550,67,243,803,1,3103,136,36,0x608032FFL}},{{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL},{0,-1153,207,214,16,-29,-1669,166,73,0xB9229B32L}},{{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L},{0,184,615,146,238,40,-4905,150,1,0x5702A702L}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL}},{{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L},{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L}},{{3,-806,807,85,912,-19,-4175,66,12,4294967295UL},{0,-2387,643,32,290,-16,1613,1,33,4294967295UL}},{{1,50,448,210,1100,13,348,78,35,0x1D982557L},{2,-737,1062,60,555,-8,-4603,152,31,0x138A5C71L}},{{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL},{1,37,162,116,1092,11,530,45,61,1UL}},{{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL},{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL}}},{{{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL},{0,101,1325,216,1687,-7,3065,171,67,4294967293UL}},{{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL},{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL}},{{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL},{1,37,162,116,1092,11,530,45,61,1UL}},{{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL},{2,-737,1062,60,555,-8,-4603,152,31,0x138A5C71L}},{{1,50,448,210,1100,13,348,78,35,0x1D982557L},{0,-2387,643,32,290,-16,1613,1,33,4294967295UL}},{{3,-806,807,85,912,-19,-4175,66,12,4294967295UL},{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L}},{{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L},{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{0,184,615,146,238,40,-4905,150,1,0x5702A702L}},{{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L},{0,-1153,207,214,16,-29,-1669,166,73,0xB9229B32L}},{{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL},{0,-1550,67,243,803,1,3103,136,36,0x608032FFL}}},{{{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL},{1,50,448,210,1100,13,348,78,35,0x1D982557L}},{{2,-1595,443,51,912,38,-5277,33,28,1UL},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}},{{3,413,618,36,589,4,634,43,83,0xAF2EF906L},{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L}},{{0,-523,834,104,710,-13,-2819,22,16,0UL},{3,-384,30,246,951,38,-5520,66,28,0UL}},{{0,2383,255,170,10,-40,4091,149,35,4294967295UL},{3,30,1123,48,463,-38,-3243,95,17,0x1E3FA1E9L}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL}},{{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL},{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}},{{2,-737,1062,60,555,-8,-4603,152,31,0x138A5C71L},{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL}},{{3,-384,30,246,951,38,-5520,66,28,0UL},{1,50,448,210,1100,13,348,78,35,0x1D982557L}}},{{{3,-2429,38,9,1431,32,2622,125,11,0x26C6F8C5L},{3,-806,807,85,912,-19,-4175,66,12,4294967295UL}},{{0,2253,916,153,1215,-7,3059,88,8,4294967294UL},{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L}},{{3,30,1123,48,463,-38,-3243,95,17,0x1E3FA1E9L},{0,-1469,733,249,1993,-41,-3293,72,22,0UL}},{{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL},{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L}},{{1,50,448,210,1100,13,348,78,35,0x1D982557L},{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL}},{{3,2284,1046,224,1326,26,5594,127,73,1UL},{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL}},{{2,-1595,443,51,912,38,-5277,33,28,1UL},{2,-1595,443,51,912,38,-5277,33,28,1UL}},{{0,-1153,207,214,16,-29,-1669,166,73,0xB9229B32L},{3,413,618,36,589,4,634,43,83,0xAF2EF906L}},{{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L},{0,-523,834,104,710,-13,-2819,22,16,0UL}},{{0,-1550,67,243,803,1,3103,136,36,0x608032FFL},{0,2383,255,170,10,-40,4091,149,35,4294967295UL}}},{{{3,-806,807,85,912,-19,-4175,66,12,4294967295UL},{0,-1550,67,243,803,1,3103,136,36,0x608032FFL}},{{2,2884,1172,138,389,39,-2135,34,51,4294967293UL},{0,184,615,146,238,40,-4905,150,1,0x5702A702L}},{{2,2884,1172,138,389,39,-2135,34,51,4294967293UL},{0,-1550,67,243,803,1,3103,136,36,0x608032FFL}},{{3,-806,807,85,912,-19,-4175,66,12,4294967295UL},{0,2383,255,170,10,-40,4091,149,35,4294967295UL}},{{0,-1550,67,243,803,1,3103,136,36,0x608032FFL},{0,-523,834,104,710,-13,-2819,22,16,0UL}},{{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L},{3,413,618,36,589,4,634,43,83,0xAF2EF906L}},{{0,-1153,207,214,16,-29,-1669,166,73,0xB9229B32L},{2,-1595,443,51,912,38,-5277,33,28,1UL}},{{2,-1595,443,51,912,38,-5277,33,28,1UL},{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL}},{{3,2284,1046,224,1326,26,5594,127,73,1UL},{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL}},{{1,50,448,210,1100,13,348,78,35,0x1D982557L},{1,-988,1433,245,1849,41,1390,72,82,0xE0E5DFA6L}}},{{{1,-2592,900,153,1735,-9,5150,41,17,0x0C603FAEL},{0,-1469,733,249,1993,-41,-3293,72,22,0UL}},{{3,30,1123,48,463,-38,-3243,95,17,0x1E3FA1E9L},{1,269,1195,186,100,-25,5627,56,53,0x7B86FED5L}},{{0,2253,916,153,1215,-7,3059,88,8,4294967294UL},{3,-806,807,85,912,-19,-4175,66,12,4294967295UL}},{{3,-2429,38,9,1431,32,2622,125,11,0x26C6F8C5L},{1,50,448,210,1100,13,348,78,35,0x1D982557L}},{{3,-384,30,246,951,38,-5520,66,28,0UL},{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL}},{{2,-737,1062,60,555,-8,-4603,152,31,0x138A5C71L},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL}},{{0,575,770,106,328,22,-2648,35,12,0x609DEBEDL},{2,-134,1348,152,1332,-22,-3446,85,60,0x6EEEC6EFL}},{{0,-1469,733,249,1993,-41,-3293,72,22,0UL},{2,1593,542,200,804,28,4679,20,13,0x3BD0E54FL}},{{2,-737,1062,60,555,-8,-4603,152,31,0x138A5C71L},{2,-1165,326,103,1319,-1,1999,128,11,0xA99088DAL}}}}; + uint32_t l_708 = 0x1807D42BL; + int8_t *l_717 = &g_537[0]; + const int16_t l_725 = 0x512FL; + int32_t **l_738 = &g_199; + int i, j, k; + for (i = 0; i < 6; i++) + l_631[i] = 65526UL; + for (i = 0; i < 1; i++) + l_676[i] = 0x17292FF8L; + for (p_28 = 0; (p_28 > (-30)); p_28--) + { /* block id: 412 */ + int32_t * const l_624 = &g_541; + int32_t * const *l_623 = &l_624; + int32_t l_630 = 1L; + if ((*p_27)) + { /* block id: 413 */ + int8_t l_626 = 0x9FL; + for (p_26 = 0; (p_26 >= 0); p_26 -= 1) + { /* block id: 416 */ + int32_t * const **l_625 = &l_623; + uint32_t *l_629 = &g_347; + uint8_t ***l_634 = &g_254; + int i; + (*p_27) = ((l_575[0][0] &= ((safe_rshift_func_uint16_t_u_s(g_537[p_26], 14)) != (safe_div_func_int8_t_s_s((l_592.f4 || (((safe_unary_minus_func_uint8_t_u(255UL)) && ((safe_mod_func_uint32_t_u_u(((*l_629) = (func_87(((safe_lshift_func_uint8_t_u_u(((safe_add_func_uint8_t_u_u(l_592.f9, (g_499[2][0] != ((safe_mul_func_uint16_t_u_u(((func_87(g_537[p_26]) & ((((*l_625) = l_623) != ((g_508[3][3][4].f2 && l_626) , g_627[3][7][1])) <= 5L)) <= 0x6DC3L), p_28)) <= 0x75C34126L)))) <= g_82.f0), p_25)) ^ 0UL)) , g_251)), g_537[p_26])) != p_26)) < 0xC6L)), g_391.f7)))) & 3L); + if (l_630) + break; + ++l_631[5]; + (*l_634) = &l_73[1]; + } + for (g_82.f3 = (-4); (g_82.f3 <= 2); ++g_82.f3) + { /* block id: 427 */ + uint32_t *l_658 = (void*)0; + uint32_t *l_659 = &l_592.f9; + uint32_t *l_662 = &g_251; + int32_t l_667 = (-8L); + int8_t *l_668 = &g_36[3]; + int16_t l_669 = (-1L); + int32_t **l_671 = (void*)0; + if (l_637) + break; + g_237 |= ((l_626 , (safe_rshift_func_int16_t_s_s(((((safe_mul_func_uint16_t_u_u((safe_add_func_uint32_t_u_u((p_26 ^ p_25), (l_630 = ((l_670 = (safe_rshift_func_uint8_t_u_s(((((*p_27) = (safe_add_func_int32_t_s_s(l_630, (l_592.f1 |= (safe_rshift_func_int16_t_s_s((0x8601L & ((safe_mod_func_uint8_t_u_u(g_508[3][3][4].f1, ((*l_668) = ((((*l_662) = ((safe_mul_func_uint16_t_u_u((((*l_77) = (g_82 , (func_41(((*l_624) = (safe_rshift_func_int8_t_s_u((safe_mod_func_uint32_t_u_u(((*l_662) = (--(*l_659))), (((*p_27) = (safe_rshift_func_int8_t_s_u((((safe_rshift_func_int16_t_s_s(p_26, 0)) && p_26) | p_28), p_26))) || g_222))), p_26))), l_70, l_667, p_25, (*g_511)) ^ p_25))) | l_575[0][0]), 0UL)) <= 0x419FL)) | l_631[5]) & l_592.f8)))) , l_669)), l_592.f7)))))) ^ (-1L)) != 0x087E7087L), 2))) < 8L)))), p_26)) , l_626) | 0x01F99D9AL) >= 4294967289UL), 15))) | p_28); + g_672[3] = ((*g_220) = (*g_220)); + } + (*g_220) = &l_575[2][0]; + for (g_433 = 0; (g_433 <= 0); g_433 += 1) + { /* block id: 447 */ + int i, j; + if (g_18.f4) + goto lbl_673; + if ((*p_27)) + break; + (*g_199) &= l_626; + } + } + else + { /* block id: 452 */ + uint8_t ***l_674[8] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int i; + l_675 = g_254; + for (g_82.f1 = 5; (g_82.f1 >= 1); g_82.f1 -= 1) + { /* block id: 456 */ + --l_676[0]; + } + (*g_220) = (*g_220); + (*p_27) &= 0L; + } + if (l_676[0]) + continue; + for (g_251 = 0; (g_251 <= 1); g_251 += 1) + { /* block id: 465 */ + return (*g_390); + } + return l_679[5][2][1]; + } + (*g_220) = (*g_220); + (*g_220) = (void*)0; + if (l_592.f6) + { /* block id: 472 */ + uint32_t l_689 = 0xD04695A0L; + int32_t l_692 = (-1L); + int32_t l_718 = (-2L); + struct S1 **l_728 = &g_390; + struct S1 ***l_729 = &l_728; + int8_t ** const l_734 = &g_512; + for (g_282 = (-24); (g_282 <= 29); g_282 = safe_add_func_int8_t_s_s(g_282, 7)) + { /* block id: 475 */ + const int32_t * const l_682 = &g_238; + const int32_t **l_683 = (void*)0; + const int32_t **l_684 = (void*)0; + const int32_t *l_686 = &g_238; + const int32_t **l_685 = &l_686; + int32_t l_701 = (-1L); + uint32_t *l_711 = &g_347; + (*l_685) = l_682; + if ((safe_mod_func_uint8_t_u_u(l_689, g_119))) + { /* block id: 477 */ + uint16_t l_702[6][8][5] = {{{0x7923L,8UL,0xC85DL,1UL,0x092FL},{65535UL,0x6D71L,65528UL,0x0282L,0x79AEL},{0x2CD4L,1UL,65535UL,0xE226L,0x6CCCL},{0x7923L,0x2CD4L,65535UL,1UL,0xBFC3L},{9UL,0x7590L,6UL,65535UL,7UL},{65528UL,65535UL,65535UL,0xBFC3L,0x299FL},{2UL,1UL,8UL,0x6CCCL,1UL},{65526UL,0xBE31L,65535UL,0x54AEL,1UL}},{{0x0282L,0xEE59L,65530UL,65531UL,0x299FL},{65535UL,65531UL,65532UL,65535UL,7UL},{0x584BL,0xAED2L,65532UL,6UL,0xBFC3L},{0x6CCCL,65527UL,0x7074L,0x295DL,6UL},{0UL,0x0282L,0xD366L,0xB7C5L,1UL},{0x7074L,0xBE31L,0xC85DL,0xC85DL,0xBE31L},{7UL,6UL,1UL,0x295DL,65532UL},{0x820AL,1UL,9UL,1UL,0xB7C5L}},{{0x299FL,0x7590L,0x81A7L,65532UL,0x820AL},{0x820AL,0x9253L,0x54AEL,65531UL,0x77B6L},{7UL,65535UL,65535UL,2UL,0x295DL},{0x7074L,0x6CCCL,65530UL,65532UL,0x7590L},{0UL,0x348CL,0x54AEL,0xBFC3L,0xEE59L},{0x6CCCL,0x12C3L,1UL,8UL,65528UL},{0x584BL,0x820AL,65526UL,65535UL,0x3B03L},{0xAED2L,65535UL,0x54AEL,0x3B03L,3UL}},{{0x3B03L,0x0282L,9UL,0xBFC3L,0x6CCCL},{65530UL,0x0282L,0xEE59L,65530UL,65531UL},{65535UL,65535UL,3UL,0xAED2L,0xC85DL},{0UL,0xB7C5L,1UL,0x820AL,0xB585L},{65535UL,1UL,65532UL,1UL,0x12C3L},{0x0282L,65535UL,65531UL,65528UL,0x9253L},{7UL,0x12C3L,65535UL,0xBFC3L,0xBFC3L},{0x5DE7L,8UL,0x5DE7L,0x81A7L,65535UL}},{{0x0282L,0x5DE7L,0x43CAL,8UL,0x77B6L},{0xBFC3L,65535UL,0x2CD4L,65535UL,1UL},{65531UL,0x7590L,0x43CAL,0x77B6L,0xBE31L},{65535UL,0x299FL,0x5DE7L,0x12C3L,0x7074L},{65528UL,9UL,65535UL,65535UL,0x7590L},{0x81A7L,0x3B03L,65531UL,65534UL,0xBE31L},{0xAED2L,65534UL,65532UL,0x0282L,0x348CL},{1UL,2UL,1UL,65535UL,0x9DBCL}},{{0x584BL,0x295DL,3UL,65532UL,65535UL},{1UL,0x81A7L,0xEE59L,65531UL,0x6D71L},{0x54AEL,0x348CL,0UL,65531UL,0x348CL},{65535UL,0x9253L,0x79AEL,0x092FL,0x299FL},{65530UL,0x7923L,65527UL,0x9253L,7UL},{0x5DE7L,0x54AEL,0x9DBCL,9UL,65530UL},{65535UL,65535UL,1UL,1UL,65532UL},{65535UL,1UL,0xBEBFL,0x81A7L,0x092FL}}}; + int32_t l_707 = 0x15AB18EFL; + int i, j, k; + (*p_27) &= l_592.f9; + l_702[2][2][1] = (l_692 = ((*p_27) = ((safe_lshift_func_int16_t_s_u((((--(*l_70)) , (l_695 || ((*l_47) = g_36[7]))) != ((safe_lshift_func_int16_t_s_u((safe_add_func_uint16_t_u_u(l_631[5], 0x6158L)), 11)) & ((l_700 = &l_70) == (void*)0))), g_553)) , (l_701 &= (*p_27))))); + l_679[5][2][1].f1 = ((((safe_mul_func_uint8_t_u_u(g_241, l_670)) , ((*g_390) , (((l_702[2][2][1] > (!((((safe_mul_func_int16_t_s_s((l_679[5][2][1].f0 , p_25), l_702[2][2][1])) | func_41(((void*)0 != &l_692), &l_631[5], l_707, l_708, (*g_511))) , 2UL) ^ 0x3BL))) , g_238) == p_25))) ^ (-7L)) && 0x63B1L); + } + else + { /* block id: 487 */ + struct S1 l_709 = {2,-2303,1271,97,843,34,-1511,148,89,8UL}; + uint8_t ***l_710 = &l_675; + p_27 = (l_709 , (void*)0); + (*l_710) = g_254; + l_692 = (l_689 < (0x6EC1D1A8L < ((void*)0 == l_711))); + return l_709; + } + for (p_26 = 8; (p_26 <= 15); p_26 = safe_add_func_uint16_t_u_u(p_26, 9)) + { /* block id: 495 */ + uint16_t l_716 = 65531UL; + l_718 ^= (((l_637 || ((((safe_rshift_func_uint8_t_u_u((0UL ^ (((*l_711) |= func_41((*g_628), &g_79, l_716, l_692, l_717)) < (p_25 ^ p_25))), p_25)) <= p_28) ^ (*l_682)) < p_28)) & p_28) && l_689); + if (l_592.f4) + goto lbl_1085; + (*p_27) = (safe_mul_func_int8_t_s_s(((*g_390) , (p_26 , ((p_25 <= (g_542 < ((safe_add_func_uint16_t_u_u(((*l_70)--), p_26)) ^ (l_701 = (*p_27))))) , (((l_725 == ((((*p_27) ^ (safe_sub_func_int8_t_s_s(l_692, l_670))) <= l_679[5][2][1].f5) != l_631[5])) < g_5) ^ l_689)))), 0xD5L)); + if (l_670) + continue; + } + } + (*l_729) = l_728; + (*p_27) = (((*l_77) = (safe_sub_func_int16_t_s_s((safe_mod_func_int8_t_s_s((p_28 >= (l_734 != &g_512)), p_28)), (0x7C6050E9L ^ l_592.f5)))) | 65535UL); + } + else + { /* block id: 507 */ + int32_t ***l_737[4][1][1] = {{{&g_220}},{{(void*)0}},{{&g_220}},{{(void*)0}}}; + int i, j, k; + (*p_27) = ((*p_27) , (p_28 != ((*p_27) , ((l_738 = &p_27) == (void*)0)))); + } + } + else + { /* block id: 511 */ + int16_t l_743 = 1L; + uint16_t **l_746 = (void*)0; + uint16_t ***l_747 = &l_700; + int32_t l_748[10] = {0xB2FC27D5L,3L,3L,0xB2FC27D5L,3L,3L,0xB2FC27D5L,3L,3L,0xB2FC27D5L}; + int32_t *l_761 = (void*)0; + int32_t ***l_785 = (void*)0; + struct S0 l_826 = {0x59DC1ED7L,0x78C5L,1UL,0x2F09L,1UL}; + uint32_t l_833[9] = {18446744073709551614UL,0x2696DEC0L,18446744073709551614UL,18446744073709551614UL,0x2696DEC0L,18446744073709551614UL,18446744073709551614UL,0x2696DEC0L,18446744073709551614UL}; + int i; + (*g_220) = (l_592 , (*g_220)); + if (((*p_27) | (safe_mul_func_int16_t_s_s((safe_sub_func_int16_t_s_s(((l_743 == 0x9BDFL) , p_26), (((safe_sub_func_uint16_t_u_u((p_25 >= l_592.f5), ((*l_47) |= g_282))) , &l_78) != ((*l_747) = l_746)))), 0x5BEBL)))) + { /* block id: 515 */ + int8_t *l_778 = &g_36[3]; + ++l_749[1][8][2]; + (*g_220) = (p_28 , (*g_220)); + for (g_280 = (-17); (g_280 == (-28)); g_280 = safe_sub_func_uint8_t_u_u(g_280, 9)) + { /* block id: 520 */ + return (*g_390); + } + for (l_592.f9 = 0; (l_592.f9 < 58); l_592.f9 = safe_add_func_int8_t_s_s(l_592.f9, 8)) + { /* block id: 525 */ + uint8_t l_777 = 1UL; + int32_t * const l_779 = (void*)0; + int32_t **l_780 = (void*)0; + int32_t **l_781 = &l_38[3][2][7]; + for (g_82.f4 = 0; (g_82.f4 != 34); ++g_82.f4) + { /* block id: 528 */ + uint8_t l_758 = 0x64L; + uint32_t *l_776[6] = {&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9,&g_391.f9}; + int i; + --l_758; + l_761 = p_27; + (*p_27) = func_41(p_26, &l_749[1][8][2], p_28, ((safe_rshift_func_int8_t_s_s((safe_div_func_uint32_t_u_u((safe_add_func_int8_t_s_s(func_41((l_592.f3 == 2UL), &g_71, (g_555[0][0] , (safe_mod_func_int16_t_s_s(((((((((safe_mod_func_uint32_t_u_u((safe_mod_func_uint16_t_u_u(((*l_70) = ((*l_761) == ((safe_lshift_func_int16_t_s_s(((l_74 ^= g_391.f9) > g_408), 2)) , g_433))), p_28)), (*p_27))) | 0L) < p_26) , p_25) == p_26) , l_758) == 248UL) != 0x274DL), l_777))), p_28, (*g_511)), 0x6DL)), 0x4355FD78L)), l_758)) & l_592.f4), l_778); + } + (*l_781) = l_779; + } + } + else + { /* block id: 537 */ + uint32_t l_793[5]; + uint8_t l_817[8]; + int32_t l_830 = 7L; + int32_t l_831 = 0L; + int32_t l_894 = 0xF408C4C0L; + uint16_t l_895 = 0UL; + int i; + for (i = 0; i < 5; i++) + l_793[i] = 0x154D16D8L; + for (i = 0; i < 8; i++) + l_817[i] = 9UL; + l_782 = p_27; + if ((g_508[3][3][4].f4 >= (safe_lshift_func_int8_t_s_s((l_785 != l_786[0][1][4]), 2)))) + { /* block id: 539 */ + uint8_t l_789 = 0x62L; + int32_t l_792[9][3][3] = {{{0x1206CF87L,0xD4342978L,0x56D0F252L},{0x1206CF87L,0L,1L},{0xB6B593C1L,0xE970D550L,0L}},{{1L,0xFA8A9F6DL,1L},{0x05365D73L,(-4L),0x56D0F252L},{0xD7896F25L,(-4L),0x47F85DFFL}},{{0L,0xFA8A9F6DL,1L},{0x9D5E6CF8L,0xE970D550L,0L},{0L,0L,0xB6B593C1L}},{{0xD7896F25L,0xD4342978L,0xB6B593C1L},{0x05365D73L,1L,0L},{1L,(-3L),0x47F85DFFL}},{{1L,(-1L),0xD7896F25L},{1L,(-4L),0xB6B593C1L},{1L,0xD48DE2AFL,0x05365D73L}},{{1L,0L,0x66D72F6FL},{0x05365D73L,0L,0x05365D73L},{0L,0xE970D550L,0xB6B593C1L}},{{0x1206CF87L,0xE970D550L,0xD7896F25L},{9L,0L,0x47F85DFFL},{0x56D0F252L,0L,9L}},{{9L,0xD48DE2AFL,1L},{0x1206CF87L,(-4L),1L},{0L,(-1L),9L}},{{0x05365D73L,(-3L),0x47F85DFFL},{1L,(-1L),0xD7896F25L},{1L,(-4L),0xB6B593C1L}}}; + int i, j, k; + l_792[2][1][1] &= ((((safe_sub_func_int8_t_s_s(func_87((((l_789 >= ((*l_77) = (0x3740392DL < (p_25 < (*l_782))))) | (safe_mod_func_int16_t_s_s(p_28, l_789))) , (0xEDL != 255UL))), p_25)) >= p_25) & p_26) || 0x647CL); + for (g_501 = 0; (g_501 <= 0); g_501 += 1) + { /* block id: 544 */ + int8_t *l_816 = &g_279; + l_793[1] |= (*p_27); + (*l_782) = ((safe_rshift_func_int16_t_s_s(func_41(((safe_lshift_func_int8_t_s_s(0L, 7)) , (((safe_sub_func_int16_t_s_s(((*l_77) = (safe_rshift_func_int8_t_s_s(0x05L, 6))), (p_27 != p_27))) ^ ((((!(((g_802 > (+0xAA05L)) & ((safe_mul_func_int8_t_s_s(((*l_816) = ((((safe_mul_func_int8_t_s_s((safe_rshift_func_uint16_t_u_u(g_809[0][0][0], 5)), 0x85L)) , (((safe_lshift_func_int16_t_s_s((safe_add_func_uint16_t_u_u(((safe_mod_func_uint8_t_u_u((0x08L != g_391.f0), g_241)) <= 0x1BL), 0x0014L)), p_25)) != g_408) , g_82.f0)) < (*p_27)) > p_25)), l_817[1])) , p_28)) == g_508[3][3][4].f1)) , l_818) != (void*)0) <= p_26)) || 0L)), &g_802, l_817[5], p_26, (*g_511)), 2)) && 253UL); + } + (*l_818) = (*l_818); + } + else + { /* block id: 551 */ + int32_t l_832 = 0L; + int8_t *l_838 = &g_809[0][0][7]; + int16_t l_849 = 0x28ACL; + for (g_18.f3 = 0; (g_18.f3 <= 0); g_18.f3 += 1) + { /* block id: 554 */ + int16_t l_828 = 0x7066L; + int32_t l_829 = 1L; + if ((*p_27)) + break; + (*l_782) = (safe_mul_func_uint8_t_u_u(g_240, (((safe_mul_func_int16_t_s_s((safe_mul_func_int8_t_s_s((*l_782), ((*l_782) <= p_25))), (0x2E7EL < ((g_825[1][1][0] = p_27) == p_27)))) <= g_508[3][3][4].f0) > ((*l_70) = (((l_826 , l_827) , &l_700) != &l_700))))); + ++l_833[0]; + } + l_831 &= (safe_mod_func_int8_t_s_s((func_87(p_25) , ((((p_28 != ((*l_838) ^= 0x4BL)) || p_26) <= (safe_lshift_func_uint16_t_u_u(p_28, 15))) && (safe_rshift_func_uint16_t_u_u((safe_mul_func_int8_t_s_s(((safe_rshift_func_uint16_t_u_u((safe_lshift_func_uint16_t_u_u(g_282, (*l_782))), 11)) && (((&g_628 != (void*)0) >= (*l_782)) != l_849)), 255UL)), 10)))), l_592.f6)); + if ((*p_27)) + { /* block id: 563 */ + uint32_t *l_859 = &l_793[1]; + (*g_220) = ((p_25 || 255UL) , (((safe_mod_func_uint16_t_u_u((safe_unary_minus_func_uint16_t_u((*l_782))), func_41((safe_div_func_uint32_t_u_u((safe_mod_func_uint16_t_u_u(l_817[1], p_28)), ((*l_859) |= (safe_rshift_func_uint16_t_u_u(65526UL, 1))))), &l_749[1][7][0], p_28, ((*l_78) ^= 0xA894L), (*g_511)))) , 0UL) , (*g_220))); + (*l_782) &= (l_748[4] = l_830); + } + else + { /* block id: 569 */ + uint16_t l_877 = 1UL; + uint32_t *l_878 = &g_347; + (*p_27) &= l_860; + l_830 |= ((safe_rshift_func_uint16_t_u_s(0UL, (safe_sub_func_uint16_t_u_u(l_849, ((safe_mul_func_uint16_t_u_u(0UL, ((((safe_lshift_func_uint8_t_u_u((safe_lshift_func_int8_t_s_u((safe_mod_func_int32_t_s_s(((safe_unary_minus_func_int32_t_s(0x03A43780L)) ^ ((safe_div_func_uint32_t_u_u((g_876 , l_877), l_877)) >= (p_26 = (((((*l_782) = (*p_27)) && ((*l_878) = (p_25 && g_391.f4))) , 4294967295UL) || l_817[1])))), l_877)), 7)), 1)) , g_553) || l_817[1]) , 1L))) >= p_28))))) >= 0x766AL); + } + } + for (l_743 = 2; (l_743 >= 0); l_743 -= 1) + { /* block id: 579 */ + int16_t * const *l_879 = (void*)0; + int16_t * const **l_880 = (void*)0; + int16_t * const **l_881 = &l_879; + int32_t l_884 = 1L; + int32_t l_889[3][4] = {{0xEE9CF121L,0x412F2CC4L,0x412F2CC4L,0xEE9CF121L},{1L,0x412F2CC4L,0L,0x412F2CC4L},{0x412F2CC4L,(-1L),0L,0L}}; + struct S0 * const l_900 = &g_508[3][3][4]; + int i, j; + for (l_592.f9 = 0; (l_592.f9 <= 0); l_592.f9 += 1) + { /* block id: 582 */ + if (g_391.f5) + goto lbl_673; + } + (*l_881) = l_879; + for (g_241 = 1; (g_241 <= 9); g_241 += 1) + { /* block id: 588 */ + int32_t l_882 = 0x18650A18L; + int32_t l_883 = 0x4796B007L; + int32_t l_885 = 0xB890EDFAL; + int32_t l_886 = 0xC2F30DA4L; + int32_t l_887 = 5L; + int32_t l_888 = 1L; + int32_t l_890 = (-9L); + int32_t l_891 = 0L; + int32_t l_893[4]; + int i, j; + for (i = 0; i < 4; i++) + l_893[i] = (-1L); + --l_895; + return (*g_390); + } + for (g_434 = 2; (g_434 >= 0); g_434 -= 1) + { /* block id: 594 */ + int32_t **l_898 = (void*)0; + int32_t **l_899 = &l_37; + struct S0 *l_902 = &g_508[2][2][3]; + struct S0 **l_901 = &l_902; + int i, j; + l_575[(g_434 + 1)][g_434] = l_575[(l_743 + 1)][g_434]; + (*l_899) = ((*g_220) = &l_575[(l_743 + 1)][g_434]); + (*g_220) = p_27; + (*l_901) = l_900; + } + } + } + } + } + else + { /* block id: 604 */ + struct S1 * const l_903 = &g_391; + const int8_t *l_909 = &g_910; + int32_t l_922 = 0xD6581181L; + uint32_t l_936 = 4294967291UL; + uint16_t l_937 = 65526UL; + int8_t *l_939 = &g_537[0]; + int8_t l_949 = 0xBCL; + struct S1 * const *l_993 = &g_390; + struct S0 *l_1040 = &g_82; + int32_t l_1080[8][9][1] = {{{0x02266532L},{1L},{(-7L)},{0x5385CC6DL},{(-7L)},{1L},{0x02266532L},{1L},{(-7L)}},{{0x5385CC6DL},{(-7L)},{1L},{0x02266532L},{1L},{(-7L)},{0x5385CC6DL},{(-7L)},{1L}},{{0x02266532L},{1L},{(-7L)},{0x5385CC6DL},{(-7L)},{1L},{0x02266532L},{1L},{(-7L)}},{{0x5385CC6DL},{(-7L)},{1L},{0x02266532L},{1L},{(-7L)},{0x5385CC6DL},{(-7L)},{1L}},{{0x02266532L},{0x5385CC6DL},{0x02266532L},{1L},{0x02266532L},{0x5385CC6DL},{(-1L)},{0x5385CC6DL},{0x02266532L}},{{1L},{0x02266532L},{0x5385CC6DL},{(-1L)},{0x5385CC6DL},{0x02266532L},{1L},{0x02266532L},{0x5385CC6DL}},{{(-1L)},{0x5385CC6DL},{0x02266532L},{1L},{0x02266532L},{0x5385CC6DL},{(-1L)},{0x5385CC6DL},{0x02266532L}},{{1L},{0x02266532L},{0x5385CC6DL},{(-1L)},{0x5385CC6DL},{0x02266532L},{1L},{0x02266532L},{0x5385CC6DL}}}; + int i, j, k; + (*g_220) = &l_575[0][0]; +lbl_921: + (*g_220) = (void*)0; + if ((&g_391 == (((*l_47) &= g_500) , l_903))) + { /* block id: 608 */ + uint32_t l_908[1][9][2] = {{{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL},{0UL,0UL}}}; + uint16_t *l_912 = (void*)0; + struct S0 **l_942 = (void*)0; + int32_t l_950[5] = {0xB5B7BEC4L,0xB5B7BEC4L,0xB5B7BEC4L,0xB5B7BEC4L,0xB5B7BEC4L}; + struct S1 *l_985 = &l_592; + int i, j, k; + for (g_18.f1 = (-19); (g_18.f1 < (-30)); g_18.f1 = safe_sub_func_uint32_t_u_u(g_18.f1, 4)) + { /* block id: 611 */ + struct S0 *l_919[2]; + int32_t l_920 = 0xECCA13D5L; + uint8_t *l_925[2]; + int16_t *l_953 = &g_508[3][3][4].f1; + int16_t *l_954 = (void*)0; + int16_t *l_955 = (void*)0; + int16_t *l_956 = &l_72; + struct S0 l_968 = {0xE448F1C2L,0x4F3DL,65534UL,1UL,0x56L}; + int16_t l_971 = 5L; + int32_t l_977 = 0x9EC177B0L; + int32_t l_979 = 0L; + int32_t l_981 = 0x3404FE79L; + int i; + for (i = 0; i < 2; i++) + l_919[i] = &g_18; + for (i = 0; i < 2; i++) + l_925[i] = (void*)0; + if ((safe_div_func_uint32_t_u_u((p_28 , 4294967295UL), (*p_27)))) + { /* block id: 612 */ + if (l_908[0][8][0]) + break; + } + else + { /* block id: 614 */ + struct S0 l_911 = {0xF5429923L,-10L,0UL,65535UL,0x2EL}; + int16_t *l_913[4][1][10] = {{{&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1,&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1}},{{&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1,&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1}},{{&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1,&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1}},{{&l_72,&l_72,&l_911.f1,(void*)0,&l_911.f1,&l_72,&l_72,(void*)0,&l_72,(void*)0}}}; + int32_t l_914 = (-5L); + int32_t l_915 = 1L; + struct S1 **l_918 = &g_390; + int i, j, k; + (*l_782) &= (l_908[0][8][1] != (((l_915 = (l_914 = l_908[0][8][0])) != ((((safe_add_func_uint32_t_u_u((0x7C33L || (l_918 != (((((void*)0 != l_919[0]) , g_555[0][1]) , p_25) , &g_390))), l_911.f3)) || p_28) & 0xACDCL) < 0xC0L)) < l_920)); + if (g_391.f2) + goto lbl_921; + } + } + } + else + { /* block id: 664 */ + uint32_t l_1000 = 0x0E49DC54L; + int32_t l_1051 = 8L; + int32_t l_1053 = 0x7C5178F1L; + int8_t **l_1061 = &g_512; + for (g_876 = 17; (g_876 < 20); ++g_876) + { /* block id: 667 */ + for (l_922 = 0; (l_922 != 2); l_922 = safe_add_func_uint32_t_u_u(l_922, 9)) + { /* block id: 670 */ + struct S1 * const *l_992 = &l_903; + struct S1 * const **l_991[10] = {&l_992,&l_992,&l_992,&l_992,&l_992,&l_992,&l_992,&l_992,&l_992,&l_992}; + int32_t l_994 = 0xFEEF50B1L; + int i; + l_993 = &l_903; + for (g_222 = 0; (g_222 <= 0); g_222 += 1) + { /* block id: 674 */ + int32_t *l_995 = (void*)0; + int32_t *l_996 = &g_238; + int32_t *l_997 = &g_434; + int32_t *l_998 = &l_994; + int32_t *l_999 = &g_433; + struct S1 **l_1003 = &g_390; + (*g_220) = (*g_220); + l_1000--; + (*l_1003) = &g_391; + } + } + } + if ((l_1000 , ((p_25 , l_949) || ((*l_782) = (safe_mod_func_uint32_t_u_u((safe_mod_func_uint8_t_u_u(func_41(p_25, &l_937, l_922, (safe_sub_func_uint16_t_u_u((safe_rshift_func_int8_t_s_u(g_5, 7)), (func_41(func_41((**g_365), &l_937, p_25, l_922, l_1012), &l_937, l_1000, p_25, (*g_511)) , (*l_782)))), (*g_511)), p_25)), p_25)))))) + { /* block id: 682 */ + int32_t l_1013 = 0x9ACA0752L; + int32_t l_1014 = (-5L); + l_1014 ^= (l_1013 <= p_28); + return (**l_993); + } + else + { /* block id: 685 */ + (*p_27) = (*p_27); + } + for (g_279 = 0; (g_279 > 29); g_279 = safe_add_func_uint32_t_u_u(g_279, 8)) + { /* block id: 690 */ + uint16_t l_1029 = 0x98C6L; + int16_t **l_1035 = &g_313[1][2][2]; + int16_t ***l_1034[9][1][1] = {{{&l_1035}},{{(void*)0}},{{&l_1035}},{{(void*)0}},{{&l_1035}},{{(void*)0}},{{&l_1035}},{{(void*)0}},{{&l_1035}}}; + int32_t l_1036 = 0L; + uint32_t l_1054[1]; + int16_t l_1072[8] = {1L,1L,1L,1L,1L,1L,1L,1L}; + int i, j, k; + for (i = 0; i < 1; i++) + l_1054[i] = 1UL; + for (g_209 = 16; (g_209 >= 50); ++g_209) + { /* block id: 693 */ + int8_t *l_1027[6][6][5] = {{{(void*)0,(void*)0,&g_280,(void*)0,(void*)0},{&g_809[0][0][0],&g_36[5],&g_279,&g_36[0],&g_280},{(void*)0,(void*)0,&g_537[0],(void*)0,(void*)0},{&g_280,&g_36[0],&g_279,&g_36[5],&g_809[0][0][0]},{(void*)0,(void*)0,&g_280,(void*)0,(void*)0},{&g_809[0][0][0],&g_36[0],(void*)0,&g_36[0],&g_809[0][0][0]}},{{(void*)0,(void*)0,&g_280,(void*)0,(void*)0},{&g_809[0][0][0],&g_36[5],&g_279,&g_36[0],&g_280},{(void*)0,(void*)0,&g_537[0],(void*)0,(void*)0},{&g_280,&g_36[0],&g_279,&g_36[5],&g_809[0][0][0]},{(void*)0,(void*)0,&g_280,(void*)0,(void*)0},{&g_809[0][0][0],&g_36[0],(void*)0,&g_36[0],&g_809[0][0][0]}},{{(void*)0,(void*)0,&g_280,(void*)0,(void*)0},{&l_949,(void*)0,&g_280,&g_809[2][0][2],&g_809[0][0][0]},{&g_40,(void*)0,(void*)0,(void*)0,&g_40},{&g_809[0][0][0],&g_809[2][0][2],&g_280,(void*)0,&l_949},{&g_40,&l_949,&g_809[4][0][4],(void*)0,&g_36[3]},{&l_949,&g_809[2][0][2],&g_279,&g_809[2][0][2],&l_949}},{{&g_36[3],(void*)0,&g_809[4][0][4],&l_949,&g_40},{&l_949,(void*)0,&g_280,&g_809[2][0][2],&g_809[0][0][0]},{&g_40,(void*)0,(void*)0,(void*)0,&g_40},{&g_809[0][0][0],&g_809[2][0][2],&g_280,(void*)0,&l_949},{&g_40,&l_949,&g_809[4][0][4],(void*)0,&g_36[3]},{&l_949,&g_809[2][0][2],&g_279,&g_809[2][0][2],&l_949}},{{&g_36[3],(void*)0,&g_809[4][0][4],&l_949,&g_40},{&l_949,(void*)0,&g_280,&g_809[2][0][2],&g_809[0][0][0]},{&g_40,(void*)0,(void*)0,(void*)0,&g_40},{&g_809[0][0][0],&g_809[2][0][2],&g_280,(void*)0,&l_949},{&g_40,&l_949,&g_809[4][0][4],(void*)0,&g_36[3]},{&l_949,&g_809[2][0][2],&g_279,&g_809[2][0][2],&l_949}},{{&g_36[3],(void*)0,&g_809[4][0][4],&l_949,&g_40},{&l_949,(void*)0,&g_280,&g_809[2][0][2],&g_809[0][0][0]},{&g_40,&g_40,&g_36[3],&g_40,(void*)0},{&g_40,&g_279,&g_809[0][0][0],&g_40,&g_279},{(void*)0,&g_809[4][0][4],&g_36[3],&g_40,&g_537[1]},{&g_279,&g_279,&g_36[3],&g_279,&g_279}}}; + int32_t l_1028[6]; + struct S0 **l_1041 = &l_1040; + int i, j, k; + for (i = 0; i < 6; i++) + l_1028[i] = 0x27D0BFBFL; + } + for (g_540 = 0; (g_540 <= (-29)); g_540 = safe_sub_func_uint8_t_u_u(g_540, 1)) + { /* block id: 716 */ + int8_t **l_1062 = &l_1012; + int8_t ***l_1063 = (void*)0; + int8_t ***l_1064 = &l_1062; + int32_t l_1067 = 7L; + uint8_t *l_1071 = &g_18.f4; + int32_t *l_1073 = &l_1067; + int32_t *l_1074 = &l_1051; + int32_t *l_1075 = &g_39; + int32_t *l_1076 = &l_1067; + int32_t *l_1077 = &g_238; + int32_t *l_1078 = &g_876; + int32_t *l_1079[2][3][4] = {{{&g_500,&g_876,&g_433,&g_876},{&g_876,&g_876,&g_433,&g_433},{&g_500,&g_500,&g_876,&g_433}},{{&g_876,&g_876,&g_876,&g_876},{&g_876,&g_876,&g_876,&g_876},{&g_500,&g_876,&g_433,&g_876}}}; + int i, j, k; + (*g_220) = p_27; + l_1072[2] ^= (((*l_939) |= l_1029) , (((*l_1071) = (((*l_782) &= (g_18 , (*p_27))) & (l_922 |= ((1L < ((l_1054[0] && (l_1061 != ((*l_1064) = l_1062))) , ((g_802 = (safe_mod_func_uint16_t_u_u(((l_1067 | (safe_sub_func_uint8_t_u_u((l_937 && p_25), 0xAEL))) >= 0x51EFA7E7L), 0xE701L))) <= l_1070[0]))) <= (**g_220))))) , l_1067)); + ++l_1081; + } + if (l_1072[7]) + continue; + return (*g_390); + } + } + } +lbl_1085: + (*l_1084) &= (*l_782); + (*g_220) = p_27; + return (*g_390); +} + + +/* ------------------------------------------ */ +/* + * reads : g_82.f1 + * writes: g_82.f1 g_500 + */ +static uint32_t func_41(int32_t p_42, uint16_t * p_43, int32_t p_44, uint16_t p_45, int8_t * p_46) +{ /* block id: 359 */ + int32_t l_580 = 4L; + for (g_82.f1 = (-1); (g_82.f1 < 7); g_82.f1++) + { /* block id: 362 */ + int8_t l_578 = 0x96L; + int32_t *l_579 = &g_500; + (*l_579) = l_578; + l_580 &= (~p_42); + } + return l_580; +} + + +/* ------------------------------------------ */ +/* + * reads : g_18.f1 g_82 g_36 g_5 g_18.f4 g_71 g_18.f0 g_39 g_119 g_79 g_18.f3 g_2 g_195 g_209 g_18.f2 g_222 g_40 g_220 g_199 g_208 g_241 g_240 g_254 g_282 g_237 g_280 g_347 g_238 g_365 g_390 g_408 g_391.f4 g_391.f9 g_391 g_501 g_508.f0 + * writes: g_36 g_39 g_82.f1 g_119 g_82.f4 g_2 g_79 g_195 g_199 g_209 g_18.f3 g_5 g_82.f3 g_220 g_222 g_241 g_251 g_40 g_282 g_280 g_313 g_237 g_347 g_71 g_238 g_365 g_18.f4 g_390 g_366 g_408 g_208 g_501 + */ +static const uint16_t func_52(const int8_t * p_53, struct S0 p_54, uint16_t * p_55) +{ /* block id: 23 */ + int8_t *l_91 = &g_36[3]; + int8_t *l_92[5]; + int32_t l_574 = 0L; + int i; + for (i = 0; i < 5; i++) + l_92[i] = (void*)0; + l_574 = ((((*p_55) || (((p_54.f4 = g_18.f1) , (safe_lshift_func_int16_t_s_u(((p_54.f1 & (safe_mod_func_uint32_t_u_u(func_87((safe_mul_func_int16_t_s_s((((*p_55) > (g_82 , (*p_55))) >= (((*l_91) = (*p_53)) ^ p_54.f3)), ((l_92[1] = l_91) == (void*)0)))), l_574))) | 0xF0L), g_82.f2))) > p_54.f3)) ^ (*p_55)) != 0x7A4DDB26L); + return (*p_55); +} + + +/* ------------------------------------------ */ +/* + * reads : g_18.f4 g_36 g_39 g_209 g_408 g_18.f0 g_195 g_241 + * writes: g_18.f4 g_39 g_209 g_408 g_18.f0 g_195 g_241 + */ +static const int8_t * func_56(int32_t * p_57, int16_t p_58, uint16_t * p_59, int8_t * p_60) +{ /* block id: 16 */ + for (g_18.f4 = 27; (g_18.f4 >= 55); g_18.f4++) + { /* block id: 19 */ + (*p_57) ^= g_36[3]; + } + return p_60; +} + + +/* ------------------------------------------ */ +/* + * reads : g_5 g_18.f4 g_71 g_18.f0 g_39 g_82.f0 g_82.f1 g_36 g_119 g_82.f3 g_82.f4 g_79 g_18.f3 g_2 g_195 g_209 g_18.f2 g_222 g_40 g_220 g_199 g_208 g_241 g_240 g_254 g_282 g_82.f2 g_237 g_280 g_347 g_238 g_365 g_390 g_408 g_391.f4 g_391.f9 g_18.f1 g_391 g_501 g_508.f0 + * writes: g_39 g_82.f1 g_119 g_36 g_82.f4 g_2 g_79 g_195 g_199 g_209 g_18.f3 g_5 g_82.f3 g_220 g_222 g_241 g_251 g_40 g_282 g_280 g_313 g_237 g_347 g_71 g_238 g_365 g_18.f4 g_390 g_366 g_408 g_208 g_501 + */ +static uint32_t func_87(uint32_t p_88) +{ /* block id: 27 */ + int16_t l_99 = (-3L); + uint16_t *l_100 = &g_79; + uint16_t *l_101 = &g_79; + int16_t l_102 = 0x2A7AL; + uint32_t l_109 = 0x8BEEE5F8L; + struct S0 l_124[7][3] = {{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}},{{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL},{0xAE64750AL,-1L,65528UL,0UL,4UL}}}; + int32_t l_163 = 0x4B2EDB8FL; + int8_t l_177[7]; + uint32_t l_229 = 18446744073709551615UL; + int32_t l_233 = (-1L); + int32_t l_235 = 0xD2773083L; + int32_t l_236 = 0x58A2F2A6L; + int32_t l_246 = (-1L); + uint8_t *l_269 = (void*)0; + uint8_t **l_268 = &l_269; + int8_t *l_298 = &g_36[6]; + int8_t **l_297[9] = {&l_298,&l_298,&l_298,&l_298,&l_298,&l_298,&l_298,&l_298,&l_298}; + struct S1 l_311 = {3,-2389,162,110,1321,-10,-1534,54,17,1UL}; + uint32_t l_386 = 18446744073709551611UL; + int8_t l_407 = (-9L); + uint32_t l_435 = 0x04C585D8L; + uint32_t l_454 = 0x06D19C9CL; + int32_t l_482 = 8L; + int16_t l_493 = 0x7372L; + struct S0 *l_507[1]; + int i, j; + for (i = 0; i < 7; i++) + l_177[i] = 0x47L; + for (i = 0; i < 1; i++) + l_507[i] = &g_508[3][3][4]; + if ((!(((safe_add_func_uint32_t_u_u(g_5, (4L && (safe_div_func_int8_t_s_s(g_18.f4, g_71))))) == ((safe_rshift_func_int16_t_s_s(p_88, 3)) , (((((((p_88 , ((l_99 , (void*)0) != (l_101 = l_100))) & 0x42C135D3L) ^ l_99) | p_88) <= l_99) , (void*)0) == &g_5))) > l_102))) + { /* block id: 29 */ + const int32_t l_104 = 1L; + int32_t l_111 = 0L; + uint8_t *l_154 = &g_5; + uint32_t l_184 = 1UL; + int32_t *l_203 = &g_39; + int32_t *l_204 = (void*)0; + int32_t *l_205 = &l_111; + int32_t *l_206 = (void*)0; + int32_t *l_207[6][5][8] = {{{&g_39,&l_163,&g_2,(void*)0,&l_111,&g_2,&g_2,&l_163},{&l_111,&l_111,&g_39,&g_39,&g_39,&g_2,&g_2,&l_163},{&l_163,&g_39,&g_2,(void*)0,&g_2,&g_39,&l_163,&l_163},{&l_111,&l_163,&g_2,&l_163,&g_2,&g_2,&g_39,&g_39},{(void*)0,&g_2,&g_39,&g_2,&g_39,&l_111,&l_111,(void*)0}},{{&l_163,(void*)0,&l_163,&g_39,(void*)0,&l_111,&l_163,&l_163},{(void*)0,&l_163,&g_2,(void*)0,&g_2,&g_2,&g_2,&g_39},{&g_2,&g_39,&g_39,&g_39,&l_163,&g_2,&g_2,&l_111},{&g_2,&g_2,(void*)0,&g_39,(void*)0,(void*)0,&g_2,&g_39},{&g_2,&g_2,&g_39,&g_39,&g_2,&g_2,&l_163,&g_39}},{{&l_163,&g_2,&l_111,&g_2,&g_39,&g_2,&g_39,(void*)0},{&g_2,&g_39,&l_163,(void*)0,(void*)0,&l_163,&g_39,&g_2},{&g_2,(void*)0,&g_2,&l_111,&g_39,&l_111,&l_163,(void*)0},{&l_163,&g_39,&g_39,&g_2,&l_111,&l_111,(void*)0,(void*)0},{&g_39,(void*)0,&g_2,&g_2,&g_39,&g_2,(void*)0,&l_111}},{{&l_111,&l_111,&l_163,&g_39,&g_39,(void*)0,&g_2,&l_111},{(void*)0,&g_2,&l_163,&g_2,&g_39,&g_39,&l_111,(void*)0},{&g_39,&l_163,&l_111,&g_39,&g_39,&g_39,&l_163,&l_163},{&l_111,(void*)0,&g_2,&l_111,(void*)0,&l_163,&g_39,&g_2},{&g_39,(void*)0,(void*)0,&g_2,&l_111,&g_2,&g_39,&g_2}},{{&g_39,&l_111,&g_39,&g_39,&g_2,&l_111,&l_111,&g_2},{&l_163,&g_2,&g_2,(void*)0,(void*)0,&g_39,&g_2,&g_2},{&l_163,&g_39,&l_111,&g_39,&g_2,(void*)0,&g_39,&g_2},{&g_2,&g_2,(void*)0,&l_111,&g_39,&l_163,&g_39,&l_111},{&l_163,&l_111,&g_2,&g_39,&l_111,&g_39,&l_111,&g_39}},{{&g_39,&g_2,&g_39,&g_2,&g_39,&g_2,&l_163,&g_39},{(void*)0,&g_39,&g_39,&g_2,&g_2,&g_2,&g_2,&g_2},{&l_111,&g_2,(void*)0,&g_39,&g_2,(void*)0,&l_111,(void*)0},{&g_2,&l_163,&l_163,(void*)0,&g_39,(void*)0,&g_2,&g_2},{&g_39,&l_163,&g_39,&l_111,&l_163,&g_2,&l_163,&g_2}}}; + int i, j, k; + if ((0UL >= g_18.f0)) + { /* block id: 30 */ + int32_t *l_103 = &g_39; + int32_t **l_108 = &l_103; + (*l_103) ^= p_88; + if (l_104) + { /* block id: 32 */ + (*l_103) |= g_82.f0; + } + else + { /* block id: 34 */ + int8_t * const l_107 = &g_40; + int8_t * const *l_106 = &l_107; + int8_t * const **l_105 = &l_106; + (*l_105) = (void*)0; + } + (*l_108) = &g_39; + } + else + { /* block id: 38 */ + uint32_t l_112 = 0UL; + int32_t l_118[9] = {0x14109486L,0x33D78BCCL,0x14109486L,0x14109486L,0x33D78BCCL,0x14109486L,0x14109486L,0x33D78BCCL,0x14109486L}; + uint8_t *l_155 = &l_124[4][2].f4; + int i; + if (((l_109 || l_104) == l_102)) + { /* block id: 39 */ + int32_t *l_110[3]; + int i; + for (i = 0; i < 3; i++) + l_110[i] = &g_2; + l_112 ^= (l_111 |= 1L); + } + else + { /* block id: 42 */ + uint32_t l_113 = 1UL; + int32_t l_117 = 0xE729AE47L; + int32_t l_192 = (-2L); + int32_t l_193 = 0x9EB32EB6L; + int32_t l_194 = (-3L); + for (g_82.f1 = 0; (g_82.f1 <= 7); g_82.f1 += 1) + { /* block id: 45 */ + int32_t *l_164 = &l_111; + int i; + if ((g_36[g_82.f1] , 9L)) + { /* block id: 46 */ + int32_t *l_116[6] = {(void*)0,&g_2,(void*)0,(void*)0,&g_2,(void*)0}; + int i; + ++l_113; + l_117 = g_36[g_82.f1]; + --g_119; + } + else + { /* block id: 50 */ + int32_t *l_122 = &l_111; + int32_t *l_123 = &l_117; + int8_t *l_129[5]; + uint8_t *l_130 = &g_82.f4; + int i; + for (i = 0; i < 5; i++) + l_129[i] = &g_36[g_82.f1]; + (*l_123) = ((*l_122) ^= g_36[g_82.f1]); + (*l_123) ^= ((l_124[4][2] , ((g_36[g_82.f1] , (p_88 && (safe_sub_func_int8_t_s_s((safe_add_func_int8_t_s_s(g_82.f3, ((((g_36[3] = g_18.f4) != ((*l_130)++)) && (safe_lshift_func_uint16_t_u_s((safe_mul_func_uint16_t_u_u((safe_rshift_func_int8_t_s_u((safe_lshift_func_int8_t_s_s((~((safe_rshift_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u(g_5, (((*l_122) ^= (((safe_sub_func_int16_t_s_s(0xF46BL, ((((((g_18.f0 >= (safe_mod_func_uint16_t_u_u(p_88, l_124[4][2].f1))) || 65535UL) >= l_113) < p_88) < 0xB794862DL) && g_82.f0))) , 0UL) && 0UL)) , g_36[3]))), 13)) ^ p_88)), l_113)), 3)), p_88)), g_18.f0))) & 3L))), p_88)))) && g_36[g_82.f1])) | p_88); + if ((*l_123)) + break; + } + if (g_39) + goto lbl_198; + for (g_119 = 0; (g_119 == 12); g_119++) + { /* block id: 61 */ + int32_t *l_151 = &g_2; + uint8_t **l_156 = &l_155; + (*l_151) = (l_117 = 0x6B1119ABL); + (*l_151) = (p_88 == ((1UL > (l_154 != ((*l_156) = l_155))) | (((safe_mod_func_uint16_t_u_u(g_36[g_82.f1], (((*l_101) |= (safe_mod_func_uint16_t_u_u(p_88, 0x0427L))) || 0xE7B8L))) || (safe_sub_func_uint32_t_u_u(p_88, 0x82777045L))) != l_112))); + } + (*l_164) = (l_163 |= ((l_113 > 1L) >= ((-1L) | ((g_36[3] != 0x27924F71L) , l_104)))); + for (p_88 = 0; (p_88 <= 7); p_88 += 1) + { /* block id: 72 */ + uint32_t *l_178 = &l_112; + int32_t *l_179 = (void*)0; + int32_t l_180 = 0x58832062L; + int32_t *l_181 = &l_118[p_88]; + int32_t *l_182 = (void*)0; + int32_t *l_183 = &l_118[6]; + int i; + if (g_36[g_82.f1]) + break; + l_180 = (safe_add_func_uint32_t_u_u(g_18.f3, ((*l_164) = (safe_rshift_func_int8_t_s_s((((safe_rshift_func_uint16_t_u_s(((*l_101)--), 5)) < 1L) == (l_117 | ((*l_178) = (((g_18.f0 || (l_118[p_88] = p_88)) ^ l_124[4][2].f1) < (safe_sub_func_int8_t_s_s(((((l_112 == ((l_163 = (((void*)0 == &g_71) == l_177[0])) >= l_104)) > l_113) & 252UL) & 0xC0L), 0x89L)))))), g_2))))); + l_184--; + (*l_183) = (*l_164); + } + } +lbl_198: + for (l_112 = 0; (l_112 < 24); l_112++) + { /* block id: 86 */ + int32_t *l_189 = (void*)0; + int32_t *l_190 = &l_111; + int32_t *l_191[9][7] = {{(void*)0,&l_118[8],&l_163,&l_163,&l_118[8],(void*)0,&l_118[0]},{(void*)0,&l_118[0],&l_163,&l_118[0],&g_39,&l_118[0],&l_118[8]},{&l_118[0],&l_117,(void*)0,(void*)0,&g_2,&l_118[8],&g_2},{&g_39,&l_118[0],&l_118[0],&g_39,&l_163,&l_118[0],(void*)0},{&g_39,&l_118[8],&l_118[0],&l_117,&g_39,&l_117,&l_163},{&l_118[0],&l_163,(void*)0,&l_118[0],(void*)0,&l_118[0],(void*)0},{(void*)0,(void*)0,&l_117,&l_117,&l_117,&l_118[0],&g_2},{(void*)0,&l_117,&g_2,&l_118[0],&l_163,&g_39,&l_118[0]},{&l_117,&l_163,&g_39,(void*)0,&g_39,&l_163,&l_117}}; + int i, j; + ++g_195; + } + if (g_18.f4) + { /* block id: 90 */ + g_199 = &g_2; + } + else + { /* block id: 92 */ + const int32_t *l_201 = (void*)0; + const int32_t **l_200 = &l_201; + int32_t *l_202 = &l_192; + (*l_200) = (void*)0; + (*l_202) ^= (-2L); + } + l_193 = (((p_88 , ((void*)0 == &l_192)) ^ ((*l_101) = 0x9C0BL)) ^ 0x22F9L); + } + } + g_209++; + for (g_82.f4 = 2; (g_82.f4 <= 7); g_82.f4 += 1) + { /* block id: 103 */ + uint16_t l_216 = 1UL; + int32_t l_232 = 5L; + int32_t l_239 = (-1L); + int8_t ***l_270 = (void*)0; + for (g_18.f3 = 0; (g_18.f3 <= 4); g_18.f3 += 1) + { /* block id: 106 */ + uint32_t *l_217 = &l_184; + int32_t l_221 = (-9L); + int32_t l_234[5][5][8] = {{{0xB9C36536L,1L,0x3C2C6411L,0L,(-2L),0x63EE46ABL,5L,0xA1254473L},{0L,0x337FFAD2L,1L,0L,0x83C53249L,0xA1254473L,(-1L),0xD57E7891L},{0x540E818FL,0x559AB983L,0xA1254473L,0x5C0450BFL,0xA1254473L,0x559AB983L,0x540E818FL,(-1L)},{0xCA09B53EL,(-1L),1L,5L,(-7L),1L,0xA3AA631CL,0x99F47FE8L},{0x559AB983L,0xB1993FB8L,0x23F3548BL,0xA3AA631CL,(-7L),0xD57E7891L,0xF18445C7L,0x5C0450BFL}},{{0xCA09B53EL,0x5A902683L,0L,0x99F47FE8L,0xA1254473L,0x23F3548BL,(-1L),0x83C53249L},{0x540E818FL,0xCA09B53EL,0xB9C36536L,0x5A902683L,0x83C53249L,0x5C0450BFL,0xEE774041L,0L},{0L,1L,0xCA09B53EL,(-2L),(-2L),0xCA09B53EL,1L,0L},{0xB9C36536L,(-5L),1L,0xCA09B53EL,1L,0L,0x3C2C6411L,(-1L)},{0x3C2C6411L,0L,0x83C53249L,2L,0xCA09B53EL,0L,0x337FFAD2L,0x5A902683L}},{{0L,(-5L),0L,1L,5L,0L,0xCA09B53EL,0x3C2C6411L},{1L,0L,1L,1L,2L,0L,0L,0L},{0xB1993FB8L,0L,1L,0x5C0450BFL,1L,0x5C0450BFL,1L,0L},{(-5L),1L,1L,0L,0xA1254473L,5L,0x63EE46ABL,(-2L)},{(-7L),0x23F3548BL,(-1L),3L,(-5L),0xA3AA631CL,0x63EE46ABL,0xA1254473L}},{{0L,3L,1L,5L,0x337FFAD2L,0x99F47FE8L,1L,0L},{0x337FFAD2L,0x99F47FE8L,1L,0L,1L,0x5A902683L,0L,0x559AB983L},{0L,0L,1L,0xCA09B53EL,(-2L),(-2L),0xCA09B53EL,1L},{(-1L),(-1L),0xF18445C7L,1L,0x23F3548BL,0xCA09B53EL,0L,0x99F47FE8L},{0xA1254473L,0x540E818FL,(-7L),1L,0x559AB983L,2L,0xD57E7891L,0x99F47FE8L}},{{0x540E818FL,0x3C2C6411L,0xA3AA631CL,1L,1L,1L,0L,1L},{1L,0x89557B5DL,0L,0xCA09B53EL,0x3C2C6411L,(-1L),0x540E818FL,0x559AB983L},{0L,1L,0xEE774041L,0L,0xF18445C7L,0x99F47FE8L,0xF18445C7L,0x63EE46ABL},{0xEE774041L,0xCA09B53EL,0xEE774041L,1L,0x559AB983L,3L,2L,1L},{0x5A902683L,0x63EE46ABL,1L,0x5C0450BFL,0L,0x23F3548BL,0x559AB983L,0x89557B5DL}}}; + const uint8_t *l_267 = &g_5; + int i, j, k; + if (((((((safe_add_func_int8_t_s_s(g_36[g_82.f4], (p_88 == (safe_mul_func_int8_t_s_s((((l_216 ^ ((void*)0 != &l_111)) == (((((*l_217) = (((*l_154) &= p_88) > g_18.f2)) >= ((-1L) > (safe_lshift_func_uint16_t_u_s((l_102 | l_99), l_124[4][2].f1)))) <= g_36[g_82.f4]) >= g_36[g_82.f4])) & 0x73132987L), p_88))))) || 0xDFED307DL) == g_39) || 0xB2D16ADBL) , 0x85EAL) <= 0x6F1BL)) + { /* block id: 109 */ + for (g_82.f3 = 0; (g_82.f3 <= 7); g_82.f3 += 1) + { /* block id: 112 */ + int i; + return l_177[(g_18.f3 + 1)]; + } + g_220 = &g_199; + (*l_203) = p_88; + if (((*l_205) &= l_177[4])) + { /* block id: 118 */ + g_222++; + if (p_88) + break; + (*l_203) &= (g_2 = ((p_88 <= (safe_lshift_func_int16_t_s_s((l_221 != (g_82.f1 && g_40)), ((g_79++) >= g_18.f4)))) , p_88)); + } + else + { /* block id: 124 */ + (*g_220) = (void*)0; + } + } + else + { /* block id: 127 */ + (*g_220) = (*g_220); + for (g_195 = 0; (g_195 <= 7); g_195 += 1) + { /* block id: 131 */ + int i, j, k; + l_207[(g_18.f3 + 1)][g_18.f3][g_82.f4] = (void*)0; + l_229 ^= (l_207[g_18.f3][g_18.f3][(g_18.f3 + 1)] == l_207[g_18.f3][g_18.f3][g_195]); + l_163 = (safe_sub_func_int8_t_s_s(g_208, g_5)); + } + l_232 ^= ((*l_205) = p_88); + } + g_241++; + if ((safe_mod_func_uint32_t_u_u((g_251 = ((p_88 , l_246) || ((safe_lshift_func_uint16_t_u_u((safe_rshift_func_int8_t_s_u(g_82.f4, (g_18.f4 > g_240))), l_216)) > (p_88 ^ (*l_203))))), l_234[4][4][1]))) + { /* block id: 141 */ + for (g_40 = 5; (g_40 >= 1); g_40 -= 1) + { /* block id: 144 */ + return p_88; + } + for (l_239 = 4; (l_239 >= 0); l_239 -= 1) + { /* block id: 149 */ + uint8_t * const *l_255 = (void*)0; + int32_t *l_256[7] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int i, j, k; + (*l_203) ^= (l_207[(g_18.f3 + 1)][l_239][(g_18.f3 + 2)] == &g_251); + (*l_205) = (g_36[g_82.f4] , (safe_mod_func_uint32_t_u_u(((*l_217) = (g_254 == l_255)), g_36[l_239]))); + (*l_205) = (l_99 != ((l_235 = 0x5B3381A5L) , (safe_mod_func_int16_t_s_s(0x7712L, (safe_div_func_uint16_t_u_u((safe_div_func_uint16_t_u_u((((*l_203) = (((safe_rshift_func_int16_t_s_s(p_88, (safe_mul_func_uint8_t_u_u(((l_154 != l_267) >= (g_254 == l_268)), (!0xA9L))))) , (void*)0) != l_270)) >= g_222), l_124[4][2].f2)), p_88)))))); + } + (*l_203) ^= (g_71 <= 0L); + } + else + { /* block id: 158 */ + (*l_205) = ((((l_221 == p_88) <= ((safe_mod_func_uint8_t_u_u(5UL, 1UL)) && (safe_add_func_uint16_t_u_u(((&l_239 == &l_111) ^ (safe_mod_func_uint8_t_u_u((g_79 == (safe_sub_func_uint32_t_u_u((((*l_203) > 0x1999272AL) & p_88), 0L))), 0xFEL))), p_88)))) || (*l_205)) && 2L); + } + g_282--; + } + (*g_220) = (*g_220); + if ((*l_203)) + break; + } + } + else + { /* block id: 166 */ + uint8_t l_285 = 0x4CL; + int32_t l_299 = 0x89F5BDD3L; + int32_t l_306 = 0x5BC425B6L; + int32_t l_340 = (-4L); + int32_t l_341 = (-1L); + int32_t l_344 = 0xE829D8AAL; + int32_t l_346[7][8] = {{(-1L),(-1L),0xF04E8ED3L,0L,(-1L),0x3E5B3455L,(-1L),0L},{(-8L),(-1L),(-8L),0x3E5B3455L,(-1L),0x7B4FA158L,(-1L),0x7B4FA158L},{0x2880767BL,0x3E5B3455L,0xF04E8ED3L,0x3E5B3455L,0x2880767BL,0xF936D604L,(-1L),0L},{0x2880767BL,0xF936D604L,(-1L),0L,(-1L),0xF936D604L,0x2880767BL,0x3E5B3455L},{(-8L),0x3E5B3455L,(-1L),0x7B4FA158L,(-1L),0x7B4FA158L,(-1L),0x3E5B3455L},{(-1L),(-1L),0xF04E8ED3L,0L,(-1L),0x3E5B3455L,(-1L),0L},{(-8L),(-1L),(-8L),0x3E5B3455L,(-1L),0x7B4FA158L,(-1L),0x7B4FA158L}}; + int32_t l_377 = 0x828E5972L; + struct S1 *l_404 = &g_391; + int32_t l_427 = 0x3D04868CL; + int16_t l_439 = 0L; + const uint8_t l_449 = 0x21L; + struct S0 *l_506 = &g_82; + struct S0 **l_505[2]; + int32_t l_554 = 1L; + int i, j; + for (i = 0; i < 2; i++) + l_505[i] = &l_506; +lbl_504: + if (l_285) + { /* block id: 167 */ + for (l_99 = (-24); (l_99 != 2); l_99 = safe_add_func_int8_t_s_s(l_99, 6)) + { /* block id: 170 */ + uint32_t l_288 = 0xFD1AB546L; + return l_288; + } + } + else + { /* block id: 173 */ + int32_t l_320[4][1][9] = {{{0L,0x194BB3C6L,0x8BCB9031L,0xB986918BL,0xB986918BL,0x8BCB9031L,0x194BB3C6L,0L,7L}},{{(-10L),0xB986918BL,3L,0L,0x67FAAF16L,7L,7L,0x67FAAF16L,0xB986918BL}},{{0L,0x039CAC54L,0L,0x8BCB9031L,7L,7L,(-10L),0x83995F0FL,0x83995F0FL}},{{0L,0x039CAC54L,0x83995F0FL,7L,0x83995F0FL,0x039CAC54L,0L,(-10L),0x194BB3C6L}}}; + int32_t l_329 = (-1L); + int32_t l_342 = (-10L); + int32_t l_343 = 1L; + int32_t l_345 = (-1L); + int i, j, k; + for (g_5 = 0; (g_5 <= 20); ++g_5) + { /* block id: 176 */ + (*g_220) = (*g_220); + l_299 ^= (0x6735L > (((g_82.f2 & (l_285 == (safe_mul_func_int16_t_s_s((-6L), (safe_mul_func_int8_t_s_s((((safe_mod_func_uint32_t_u_u((((void*)0 == l_297[4]) <= g_237), p_88)) , 3UL) ^ g_119), l_285)))))) == 4294967295UL) >= p_88)); + } + if ((safe_lshift_func_int8_t_s_u(g_82.f2, (safe_lshift_func_uint8_t_u_u(l_233, l_177[0]))))) + { /* block id: 180 */ + uint16_t l_323 = 1UL; + for (g_280 = 23; (g_280 <= (-26)); g_280 = safe_sub_func_uint8_t_u_u(g_280, 3)) + { /* block id: 183 */ + uint32_t l_328 = 0x04263EA8L; + if (l_306) + { /* block id: 184 */ + uint8_t *l_310 = &g_119; + int16_t *l_312 = (void*)0; + int32_t *l_321 = (void*)0; + int32_t *l_322 = &l_233; + l_320[3][0][0] = ((safe_mul_func_int16_t_s_s(((safe_unary_minus_func_uint8_t_u(((*l_310) &= p_88))) <= ((g_313[1][2][2] = (l_311 , l_312)) != (void*)0)), g_237)) == (((l_311 , (safe_rshift_func_uint16_t_u_u(((&g_282 == ((safe_mul_func_int16_t_s_s((safe_mul_func_uint16_t_u_u(g_5, g_82.f4)), 0x1FCCL)) , &g_71)) & 0xE3CFL), 6))) ^ p_88) , 0x06L)); + (*l_322) = p_88; + l_235 ^= l_311.f5; + if (p_88) + continue; + } + else + { /* block id: 191 */ + int16_t *l_324 = &l_124[4][2].f1; + int32_t *l_325 = &l_235; + int32_t l_326[6][8][5] = {{{(-1L),0L,0x77968830L,(-3L),0xF69D3694L},{0x80481311L,(-8L),0x6EE43BC7L,3L,0xF69D3694L},{9L,0xA3F52DB4L,0x332D84DCL,0x6EE43BC7L,2L},{0xB9E29AD6L,0x6EE43BC7L,8L,1L,0L},{0xD4BE4A73L,(-1L),0L,0x34B194B4L,1L},{0x332D84DCL,9L,0L,0L,9L},{0L,2L,0xC6B43B59L,1L,0xD4BE4A73L},{(-1L),8L,0xA5022890L,1L,(-1L)}},{{1L,0xB9E29AD6L,0xFF1388ADL,0x5D62FFCCL,(-4L)},{(-1L),0xA96E957DL,1L,0xC06D5091L,6L},{0L,0x075FB35CL,1L,8L,0x332D84DCL},{0x332D84DCL,0L,0xD4BE4A73L,0xA3F52DB4L,(-7L)},{0xD4BE4A73L,4L,(-1L),0x9E963DA1L,0x346217EBL},{0xB9E29AD6L,0xC3EFD975L,0x7C2A98AAL,0xAB407981L,0xC06D5091L},{9L,0x4A7388A2L,0xF9C56E4CL,(-7L),0x57D97B32L},{(-7L),0x3E1D9BA4L,0x093B7A13L,0x075FB35CL,(-4L)}},{{1L,0xAAC8C820L,2L,0x5D62FFCCL,0xA3F52DB4L},{1L,9L,0x5D62FFCCL,0xDAE7BCCAL,1L},{0xA96E957DL,(-4L),8L,0L,0L},{(-2L),0x4A7388A2L,(-2L),0xF69D3694L,0x9E963DA1L},{0xCA74A0EEL,1L,(-8L),1L,0L},{(-8L),0xA3F52DB4L,0x3E1D9BA4L,0x63D06EA8L,0x346217EBL},{(-4L),1L,(-8L),0L,(-1L)},{0L,(-3L),(-2L),(-1L),0x075FB35CL}},{{(-3L),0xF69D3694L,8L,1L,0x80481311L},{(-1L),9L,0x5D62FFCCL,(-1L),0x3E1D9BA4L},{9L,(-1L),2L,0x4A7388A2L,0xA96E957DL},{9L,0xC3EFD975L,0x093B7A13L,0x6EE43BC7L,1L},{0xA5022890L,0L,0xF9C56E4CL,0x6EE43BC7L,0xC3EFD975L},{1L,8L,0xA314B29BL,0x4A7388A2L,9L},{0L,0xAAA1835EL,1L,(-1L),0xAAC8C820L},{0x9E963DA1L,(-2L),(-1L),1L,0xB9E29AD6L}},{{(-3L),(-1L),0x34B194B4L,(-1L),(-3L)},{0xAAA1835EL,1L,4L,0xA314B29BL,3L},{0xAAA1835EL,0xDAE7BCCAL,0x57D97B32L,8L,0xAAC8C820L},{2L,(-1L),9L,0xF69D3694L,3L},{0xF553E666L,8L,0x075FB35CL,0xAAA1835EL,9L},{3L,0xD4BE4A73L,(-2L),(-3L),9L},{0xB9E29AD6L,0L,1L,0x9E963DA1L,0x6EE43BC7L},{1L,0xF553E666L,(-3L),0L,0xCA74A0EEL}},{{(-8L),(-1L),0xA3F52DB4L,1L,(-1L)},{0xA96E957DL,0L,1L,0xA5022890L,0x57D97B32L},{0xA96E957DL,1L,0xFF1388ADL,9L,(-7L)},{(-8L),(-1L),1L,9L,0x5D62FFCCL},{1L,0xA5022890L,8L,(-1L),1L},{0xB9E29AD6L,0L,1L,(-3L),1L},{3L,3L,(-1L),0L,(-4L)},{0xF553E666L,0x3E1D9BA4L,0xC3EFD975L,(-4L),1L}}}; + int32_t *l_327[3][8][3] = {{{&l_236,(void*)0,&l_233},{&l_299,&l_299,&g_39},{(void*)0,&l_163,(void*)0},{&g_39,&l_236,&l_163},{&l_236,&g_2,&l_299},{&g_39,&l_299,&l_233},{&g_39,&g_39,&g_39},{&l_236,&l_233,(void*)0}},{{&g_238,&l_236,&l_299},{&l_299,&l_233,&l_236},{&l_233,(void*)0,&l_299},{&g_238,&l_233,(void*)0},{&g_238,&l_236,&g_39},{&g_39,&g_2,&l_236},{&l_236,&g_238,&g_39},{&g_238,&l_236,&g_39}},{{&l_236,&l_236,&l_236},{&l_233,&g_237,&g_39},{&g_238,&l_163,(void*)0},{(void*)0,&g_238,&l_299},{&l_299,&g_238,&l_236},{(void*)0,(void*)0,&l_299},{&g_238,&g_2,(void*)0},{&l_233,&l_236,&g_238}}}; + int i, j, k; + l_311.f5 = p_88; + g_237 |= (((0xABB76B37L & ((0xAA467251L && l_323) | ((*l_325) = ((l_323 , ((*l_324) = p_88)) ^ p_88)))) < l_306) , (l_311.f6 = (l_326[5][3][0] &= ((*l_325) ^= p_88)))); + return g_280; + } + l_328 |= (~l_323); + } + } + else + { /* block id: 203 */ + int32_t l_330 = (-1L); + int32_t *l_331 = &l_235; + int32_t *l_332 = &g_39; + int32_t *l_333 = &g_238; + int32_t *l_334 = (void*)0; + int32_t *l_335 = &l_235; + int32_t *l_336 = &l_235; + int32_t *l_337 = &l_236; + int32_t *l_338 = &l_329; + int32_t *l_339[9]; + int i; + for (i = 0; i < 9; i++) + l_339[i] = &g_237; + ++g_347; + } + } + for (l_236 = (-7); (l_236 < (-27)); l_236 = safe_sub_func_int16_t_s_s(l_236, 6)) + { /* block id: 209 */ + int32_t l_368 = 0xAE9026B3L; + uint32_t l_369 = 0xF0C741AFL; + uint8_t *l_370 = &l_285; + int32_t l_397 = 0L; + struct S1 l_398 = {3,768,1037,163,753,24,-442,139,64,9UL}; + uint16_t l_411 = 65534UL; + uint16_t l_438 = 65528UL; + uint32_t l_486 = 0xC4A867A1L; + for (g_347 = 0; (g_347 > 19); g_347 = safe_add_func_uint8_t_u_u(g_347, 1)) + { /* block id: 212 */ + int16_t l_359 = 0xF62AL; + int32_t l_360[5][9][5] = {{{0x9DF86A6FL,0x95036420L,0x166F187FL,0x696BFCAAL,0x696BFCAAL},{1L,(-1L),1L,0x27CAFC2EL,1L},{0x94B78765L,0x9DF86A6FL,0x4426EC2FL,0x4E8F0221L,7L},{0xD0B67DE8L,0xEF7070EBL,1L,0L,0xF0132B51L},{0x9AFEC63DL,0x166F187FL,0x4426EC2FL,7L,(-9L)},{0L,1L,1L,1L,0L},{0xBC3A7848L,0x6A9B86FFL,0x166F187FL,0xF529EB06L,0x166F187FL},{0x27CAFC2EL,0x27CAFC2EL,(-3L),0x47BB2F77L,(-1L)},{0xDC3195D9L,(-1L),1L,0x94B78765L,(-1L)}},{{7L,0L,1L,0xC021C2B8L,0x47BB2F77L},{0x86921A87L,0x95036420L,(-1L),0x29DEC1BEL,0x6A9B86FFL},{0xEF7070EBL,0xD0B67DE8L,(-1L),(-3L),0x845B019AL},{(-1L),(-1L),0x9AFEC63DL,0x9AFEC63DL,(-1L)},{0L,0xC021C2B8L,0L,7L,1L},{0xBC3A7848L,0xDC3195D9L,0x8D604015L,0x6A9B86FFL,0x9AFEC63DL},{1L,(-1L),(-9L),(-1L),0xFFED5E11L},{0xBC3A7848L,0x4E8F0221L,8L,0x95036420L,1L},{0L,0L,0xF0132B51L,0x27CAFC2EL,7L}},{{(-1L),0x86921A87L,(-1L),0x86921A87L,(-1L)},{0xEF7070EBL,(-1L),0x27CAFC2EL,0x47BB2F77L,0xD0B67DE8L},{0x86921A87L,(-9L),7L,0x4426EC2FL,0x166F187FL},{(-1L),0xFFED5E11L,1L,(-1L),0xD0B67DE8L},{0xF529EB06L,0x4426EC2FL,0x94B78765L,0x696BFCAAL,(-1L)},{0xD0B67DE8L,(-1L),(-3L),0x845B019AL,7L},{0x8D604015L,0xA1B0B983L,0xA1B0B983L,0x8D604015L,1L},{0x27CAFC2EL,0xEBE5C5FEL,(-1L),0L,0xFFED5E11L},{0x166F187FL,0xBC3A7848L,0x86921A87L,6L,0x9AFEC63DL}},{{0x845B019AL,(-1L),7L,0L,1L},{0xA1B0B983L,0x4426EC2FL,(-9L),0x166F187FL,0x4E8F0221L},{0L,(-1L),(-1L),0x47BB2F77L,0x47BB2F77L},{0xA595A854L,6L,0xA595A854L,7L,0x9DF86A6FL},{0xD0B67DE8L,0L,0xFFED5E11L,0xEBE5C5FEL,0L},{(-1L),0xF529EB06L,0x9DF86A6FL,(-1L),0xC03EEE59L},{0xEF7070EBL,(-1L),0xFFED5E11L,0L,0xF0132B51L},{0xA1B0B983L,0x9DF86A6FL,0xA595A854L,(-9L),(-1L)},{0L,(-1L),(-1L),(-1L),(-1L)}},{{7L,7L,(-9L),0x29DEC1BEL,(-1L)},{0L,7L,1L,0xD0B67DE8L,(-1L)},{0x6A9B86FFL,8L,(-9L),0x9DF86A6FL,1L},{(-1L),7L,0L,1L,1L},{0xDC3195D9L,7L,0x696BFCAAL,0x8D604015L,(-1L)},{0L,(-1L),1L,1L,(-1L)},{0xC03EEE59L,0x9DF86A6FL,8L,0x86921A87L,(-9L)},{(-3L),(-1L),0L,1L,1L},{(-1L),0xF529EB06L,0x256ADFB4L,0x696BFCAAL,0x9AFEC63DL}}}; + struct S0 l_364 = {0UL,3L,0xA013L,0UL,6UL}; + int i, j, k; + for (l_235 = 0; (l_235 == (-7)); l_235--) + { /* block id: 215 */ + uint8_t l_361 = 0x8AL; + for (g_71 = 18; (g_71 >= 25); g_71 = safe_add_func_int32_t_s_s(g_71, 4)) + { /* block id: 218 */ + int32_t *l_358[9] = {&l_340,&l_340,&l_340,&l_340,&l_340,&l_340,&l_340,&l_340,&l_340}; + int32_t ***l_367[10][6][4] = {{{&g_365,&g_365,&g_365,(void*)0},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,&g_365},{&g_365,(void*)0,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,(void*)0}},{{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,(void*)0,&g_365,(void*)0},{&g_365,&g_365,&g_365,&g_365},{&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365}},{{(void*)0,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,(void*)0,(void*)0,&g_365},{&g_365,&g_365,&g_365,(void*)0},{&g_365,(void*)0,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365}},{{&g_365,&g_365,&g_365,(void*)0},{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,(void*)0,&g_365},{&g_365,(void*)0,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,(void*)0}},{{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,(void*)0},{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365}},{{(void*)0,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365},{&g_365,(void*)0,(void*)0,&g_365}},{{&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365}},{{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365}},{{&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{(void*)0,&g_365,&g_365,&g_365}},{{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,(void*)0,(void*)0},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365},{&g_365,&g_365,&g_365,&g_365}}}; + int i, j, k; + g_238 |= p_88; + ++l_361; + g_365 = (l_364 , g_365); + } + } + for (g_241 = 0; (g_241 <= 6); g_241 += 1) + { /* block id: 226 */ + for (l_102 = 0; (l_102 <= 6); l_102 += 1) + { /* block id: 229 */ + int i, j; + if (g_36[(l_102 + 1)]) + break; + l_368 &= l_346[l_102][g_241]; + if (l_346[l_102][g_241]) + continue; + } + } + } + if (((((((((*l_370) = (l_369 = l_285)) > (l_311.f1 = ((++(*l_101)) , 255UL))) && (safe_rshift_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s(0x57L, l_377)) != l_341), p_88))) >= ((safe_sub_func_int8_t_s_s((safe_div_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u((g_282++), p_88)), 0x055CL)), (((((l_344 != p_88) , 1UL) , p_88) == g_82.f4) == g_18.f2))) && 0L)) && l_386) != (-4L)) , p_88)) + { /* block id: 241 */ + struct S0 *l_387 = &g_82; + int32_t *l_394 = &g_281; + int32_t l_399 = 0x4D4B183AL; + struct S1 **l_405 = &g_390; + for (g_18.f4 = 0; (g_18.f4 <= 6); g_18.f4 += 1) + { /* block id: 244 */ + struct S0 **l_388 = (void*)0; + struct S0 **l_389 = &l_387; + int i, j; + (*l_389) = l_387; + g_390 = g_390; + if (l_346[g_18.f4][g_18.f4]) + break; + } + for (l_109 = 0; (l_109 <= 7); l_109 += 1) + { /* block id: 251 */ + int16_t *l_400 = (void*)0; + int16_t *l_401 = &l_102; + int32_t *l_402 = &g_237; + int32_t *l_403 = &l_235; + int i; + for (g_39 = 8; (g_39 >= 3); g_39 -= 1) + { /* block id: 254 */ + int i; + return g_36[l_109]; + } + (*l_403) = ((*l_402) = ((g_36[l_109] && (g_36[l_109] ^ (g_240 > ((((*l_401) = (((safe_mod_func_uint32_t_u_u((((((*g_365) = &l_306) != l_394) || (safe_sub_func_int8_t_s_s((l_397 | (l_398 , (p_88 != p_88))), l_399))) <= 0x84L), 4294967295UL)) >= p_88) , l_369)) > 65529UL) < p_88)))) , p_88)); + } + (*l_405) = l_404; + } + else + { /* block id: 263 */ + int32_t *l_406[1][5][7] = {{{&l_368,&l_299,&l_299,&l_368,&l_299,&l_299,&l_368},{&l_299,&l_368,&l_299,&l_299,&l_368,&l_299,&l_299},{&l_368,&l_368,&l_368,&l_368,&l_368,&l_368,&l_368},{&l_368,&l_299,&l_299,&l_368,&l_299,&l_299,&l_368},{&l_299,&l_368,&l_299,&l_299,&l_368,&l_299,&l_299}}}; + struct S0 l_468 = {0x0EDE6D6DL,0L,65528UL,0x4463L,0x0FL}; + int i, j, k; + g_408--; + --l_411; + if ((safe_rshift_func_int8_t_s_s(0xF8L, l_340))) + { /* block id: 266 */ + uint32_t l_426[4][9] = {{0x88400371L,0UL,1UL,3UL,4294967295UL,3UL,1UL,0UL,0x88400371L},{0x470FF04AL,0x74C575B2L,0xEF5E38AEL,1UL,0x457E5FE2L,0x08800094L,0UL,0x08800094L,4294967295UL},{0xEF5E38AEL,0UL,0UL,0xEF5E38AEL,0x03ED131BL,0x9A6CC948L,0x88400371L,4294967295UL,0x457E5FE2L},{0UL,4294967295UL,0UL,0x74C575B2L,0x74C575B2L,0UL,4294967295UL,0UL,3UL}}; + int32_t l_431[6]; + int i, j; + for (i = 0; i < 6; i++) + l_431[i] = 0x9A6743CEL; + (*g_220) = ((p_88 , p_88) , (*g_220)); + if (p_88) + { /* block id: 268 */ + int32_t l_430 = 0x675E34E6L; + int32_t l_432 = 0xD3699B92L; + l_430 &= (4294967295UL || (l_235 = (safe_add_func_int16_t_s_s(((safe_div_func_int32_t_s_s(((((safe_mod_func_uint16_t_u_u((safe_add_func_uint32_t_u_u(0x4C38B039L, p_88)), ((*l_101) |= g_391.f4))) < g_18.f4) || (safe_rshift_func_uint8_t_u_s(((*l_370) |= l_426[1][2]), l_427))) && p_88), (safe_mul_func_int16_t_s_s(l_311.f7, l_344)))) <= g_391.f9), 0xE822L)))); + --l_435; + g_238 = l_346[6][7]; + } + else + { /* block id: 275 */ + (*g_220) = (void*)0; + } + g_39 = (p_88 == (l_438 <= (l_398.f8 & l_439))); + if (l_377) + break; + } + else + { /* block id: 280 */ + uint8_t l_459 = 0x18L; + const int32_t l_469 = 0x91247D0DL; + int32_t l_483 = 0x6A87FF15L; + int32_t l_496 = 0xDE6CCBD7L; + int32_t l_497 = 0xDBFCC0BBL; + int32_t l_498 = 1L; + for (g_222 = 0; (g_222 != 11); g_222++) + { /* block id: 283 */ + int8_t l_446 = 0x78L; + int32_t l_455 = 0x838E2474L; + l_455 |= (safe_sub_func_uint16_t_u_u(g_18.f1, (l_446 > (((safe_mod_func_int32_t_s_s(l_449, (l_427 = ((safe_lshift_func_int16_t_s_s(((l_235 = (-9L)) | 0x39081B19L), 2)) , (safe_lshift_func_int16_t_s_u(l_454, 13)))))) , &l_449) != ((*l_268) = ((*l_404) , l_370)))))); + return p_88; + } + if (l_398.f4) + { /* block id: 290 */ + struct S0 *l_457 = &l_124[6][0]; + struct S0 **l_456 = &l_457; + int32_t l_458 = 0x418B64C8L; + (*l_456) = &g_18; + if (l_346[6][6]) + continue; + ++l_459; + } + else + { /* block id: 294 */ + int16_t l_472 = (-3L); + uint32_t *l_475 = &g_347; + l_483 = ((safe_lshift_func_uint8_t_u_u((safe_rshift_func_uint16_t_u_u(l_459, (p_88 || ((safe_rshift_func_uint8_t_u_s((l_468 , l_469), 6)) >= p_88)))), (safe_rshift_func_int8_t_s_u((((l_472 != (safe_div_func_uint32_t_u_u(((*l_475)--), (0x0376L && (g_71 = (safe_rshift_func_int8_t_s_s((safe_mod_func_int16_t_s_s(l_340, (l_341 = 2L))), 6))))))) & l_482) , (-1L)), 4)))) >= 0x7FL); + if (p_88) + break; + return p_88; + } + for (g_208 = (-24); (g_208 != 13); g_208 = safe_add_func_int32_t_s_s(g_208, 6)) + { /* block id: 304 */ + int32_t l_494[6][4] = {{0x899E298AL,(-3L),1L,0x5B286B25L},{0x899E298AL,1L,0x899E298AL,0xFE2F18EAL},{(-3L),0x5B286B25L,0xFE2F18EAL,0xFE2F18EAL},{1L,1L,2L,0x5B286B25L},{0x5B286B25L,(-3L),2L,(-3L)},{1L,0x899E298AL,0xFE2F18EAL,2L}}; + int32_t l_495[9] = {0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL,0x708011CBL}; + int i, j; + g_238 = (p_88 > ((p_88 ^ (l_346[0][4] | (l_449 || ((l_486 , (safe_add_func_int32_t_s_s(p_88, (((safe_div_func_uint32_t_u_u(0x786AA2D0L, ((safe_add_func_int8_t_s_s((&g_251 == (void*)0), p_88)) & 1L))) , l_483) < 4294967292UL)))) , l_493)))) < l_469)); + ++g_501; + } + if (l_398.f8) + goto lbl_504; + } + l_346[0][2] = (g_119 ^ 4294967295UL); + } + } + l_507[0] = &g_18; + for (g_2 = 0; (g_2 >= (-22)); g_2 = safe_sub_func_int16_t_s_s(g_2, 1)) + { /* block id: 316 */ + uint32_t l_518[6] = {0UL,0UL,0UL,0UL,0UL,0UL}; + int32_t l_527 = (-10L); + int32_t l_538 = (-3L); + int32_t l_539 = (-3L); + int32_t l_552[7][7][5] = {{{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)},{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L},{0L,(-4L),1L,1L,(-4L)},{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L},{(-4L),1L,1L,(-4L),0L},{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L}},{{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)},{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L},{0L,(-4L),1L,1L,(-4L)},{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L},{(-4L),1L,1L,(-4L),0L}},{{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L},{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)},{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L},{0L,(-4L),1L,1L,(-4L)},{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L}},{{(-4L),1L,1L,(-4L),0L},{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L},{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)},{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L},{0L,(-4L),1L,1L,(-4L)}},{{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L},{(-4L),1L,1L,(-4L),0L},{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L},{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)},{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L}},{{0L,(-4L),1L,1L,(-4L)},{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L},{(-4L),1L,1L,(-4L),0L},{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L},{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L},{0L,1L,0x4F27EFA9L,(-4L),(-4L)}},{{0x3ECFA0B6L,8L,0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L},{0L,(-4L),1L,1L,(-4L)},{0xDD201F80L,0x023C9910L,0xEBE46D86L,0x023C9910L,0xDD201F80L},{(-4L),1L,1L,(-4L),0L},{0x3ECFA0B6L,0x023C9910L,0x3ECFA0B6L,8L,0x3ECFA0B6L},{(-4L),(-4L),0x4F27EFA9L,1L,0L},{0xDD201F80L,8L,0xEBE46D86L,8L,0xDD201F80L}}}; + int i, j, k; + } + } + return g_508[3][3][4].f0; +} + + + + +/* ---------------------------------------- */ +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_2, "g_2", print_hash_value); + transparent_crc(g_5, "g_5", print_hash_value); + transparent_crc(g_18.f0, "g_18.f0", print_hash_value); + transparent_crc(g_18.f1, "g_18.f1", print_hash_value); + transparent_crc(g_18.f2, "g_18.f2", print_hash_value); + transparent_crc(g_18.f3, "g_18.f3", print_hash_value); + transparent_crc(g_18.f4, "g_18.f4", print_hash_value); + for (i = 0; i < 8; i++) + { + transparent_crc(g_36[i], "g_36[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_39, "g_39", print_hash_value); + transparent_crc(g_40, "g_40", print_hash_value); + transparent_crc(g_71, "g_71", print_hash_value); + transparent_crc(g_79, "g_79", print_hash_value); + transparent_crc(g_82.f0, "g_82.f0", print_hash_value); + transparent_crc(g_82.f1, "g_82.f1", print_hash_value); + transparent_crc(g_82.f2, "g_82.f2", print_hash_value); + transparent_crc(g_82.f3, "g_82.f3", print_hash_value); + transparent_crc(g_82.f4, "g_82.f4", print_hash_value); + transparent_crc(g_119, "g_119", print_hash_value); + transparent_crc(g_195, "g_195", print_hash_value); + transparent_crc(g_208, "g_208", print_hash_value); + transparent_crc(g_209, "g_209", print_hash_value); + transparent_crc(g_222, "g_222", print_hash_value); + transparent_crc(g_237, "g_237", print_hash_value); + transparent_crc(g_238, "g_238", print_hash_value); + transparent_crc(g_240, "g_240", print_hash_value); + transparent_crc(g_241, "g_241", print_hash_value); + transparent_crc(g_251, "g_251", print_hash_value); + transparent_crc(g_279, "g_279", print_hash_value); + transparent_crc(g_280, "g_280", print_hash_value); + transparent_crc(g_281, "g_281", print_hash_value); + transparent_crc(g_282, "g_282", print_hash_value); + transparent_crc(g_347, "g_347", print_hash_value); + transparent_crc(g_391.f0, "g_391.f0", print_hash_value); + transparent_crc(g_391.f1, "g_391.f1", print_hash_value); + transparent_crc(g_391.f2, "g_391.f2", print_hash_value); + transparent_crc(g_391.f3, "g_391.f3", print_hash_value); + transparent_crc(g_391.f4, "g_391.f4", print_hash_value); + transparent_crc(g_391.f5, "g_391.f5", print_hash_value); + transparent_crc(g_391.f6, "g_391.f6", print_hash_value); + transparent_crc(g_391.f7, "g_391.f7", print_hash_value); + transparent_crc(g_391.f8, "g_391.f8", print_hash_value); + transparent_crc(g_391.f9, "g_391.f9", print_hash_value); + transparent_crc(g_408, "g_408", print_hash_value); + transparent_crc(g_433, "g_433", print_hash_value); + transparent_crc(g_434, "g_434", print_hash_value); + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + { + transparent_crc(g_499[i][j], "g_499[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_500, "g_500", print_hash_value); + transparent_crc(g_501, "g_501", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 7; k++) + { + transparent_crc(g_508[i][j][k].f0, "g_508[i][j][k].f0", print_hash_value); + transparent_crc(g_508[i][j][k].f1, "g_508[i][j][k].f1", print_hash_value); + transparent_crc(g_508[i][j][k].f2, "g_508[i][j][k].f2", print_hash_value); + transparent_crc(g_508[i][j][k].f3, "g_508[i][j][k].f3", print_hash_value); + transparent_crc(g_508[i][j][k].f4, "g_508[i][j][k].f4", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + for (i = 0; i < 3; i++) + { + transparent_crc(g_537[i], "g_537[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_540, "g_540", print_hash_value); + transparent_crc(g_541, "g_541", print_hash_value); + transparent_crc(g_542, "g_542", print_hash_value); + transparent_crc(g_553, "g_553", print_hash_value); + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + { + transparent_crc(g_555[i][j], "g_555[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_564, "g_564", print_hash_value); + transparent_crc(g_802, "g_802", print_hash_value); + for (i = 0; i < 5; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 8; k++) + { + transparent_crc(g_809[i][j][k], "g_809[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_876, "g_876", print_hash_value); + transparent_crc(g_910, "g_910", print_hash_value); + transparent_crc(g_1052, "g_1052", print_hash_value); + for (i = 0; i < 9; i++) + { + transparent_crc(g_1105[i], "g_1105[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_1109, "g_1109", print_hash_value); + transparent_crc(g_1113.f0, "g_1113.f0", print_hash_value); + transparent_crc(g_1113.f1, "g_1113.f1", print_hash_value); + transparent_crc(g_1113.f2, "g_1113.f2", print_hash_value); + transparent_crc(g_1113.f3, "g_1113.f3", print_hash_value); + transparent_crc(g_1113.f4, "g_1113.f4", print_hash_value); + transparent_crc(g_1113.f5, "g_1113.f5", print_hash_value); + transparent_crc(g_1113.f6, "g_1113.f6", print_hash_value); + transparent_crc(g_1113.f7, "g_1113.f7", print_hash_value); + transparent_crc(g_1113.f8, "g_1113.f8", print_hash_value); + transparent_crc(g_1113.f9, "g_1113.f9", print_hash_value); + transparent_crc(g_1169.f0, "g_1169.f0", print_hash_value); + transparent_crc(g_1169.f1, "g_1169.f1", print_hash_value); + transparent_crc(g_1169.f2, "g_1169.f2", print_hash_value); + transparent_crc(g_1169.f3, "g_1169.f3", print_hash_value); + transparent_crc(g_1169.f4, "g_1169.f4", print_hash_value); + for (i = 0; i < 1; i++) + { + for (j = 0; j < 8; j++) + { + transparent_crc(g_1192[i][j], "g_1192[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_1233[i], "g_1233[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_1263, "g_1263", print_hash_value); + transparent_crc(g_1389, "g_1389", print_hash_value); + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 1 +breakdown: + depth: 0, occurrence: 476 + depth: 1, occurrence: 23 +XXX total union variables: 0 + +XXX non-zero bitfields defined in structs: 9 +XXX zero bitfields defined in structs: 0 +XXX const bitfields defined in structs: 1 +XXX volatile bitfields defined in structs: 0 +XXX structs with bitfields in the program: 26 +breakdown: + indirect level: 0, occurrence: 12 + indirect level: 1, occurrence: 9 + indirect level: 2, occurrence: 4 + indirect level: 3, occurrence: 1 +XXX full-bitfields structs in the program: 0 +breakdown: +XXX times a bitfields struct's address is taken: 22 +XXX times a bitfields struct on LHS: 0 +XXX times a bitfields struct on RHS: 19 +XXX times a single bitfield on LHS: 7 +XXX times a single bitfield on RHS: 26 + +XXX max expression depth: 49 +breakdown: + depth: 1, occurrence: 388 + depth: 2, occurrence: 107 + depth: 3, occurrence: 10 + depth: 4, occurrence: 7 + depth: 5, occurrence: 4 + depth: 6, occurrence: 3 + depth: 7, occurrence: 1 + depth: 8, occurrence: 1 + depth: 9, occurrence: 2 + depth: 10, occurrence: 1 + depth: 11, occurrence: 3 + depth: 12, occurrence: 1 + depth: 13, occurrence: 3 + depth: 14, occurrence: 3 + depth: 15, occurrence: 4 + depth: 16, occurrence: 5 + depth: 17, occurrence: 2 + depth: 18, occurrence: 3 + depth: 19, occurrence: 2 + depth: 20, occurrence: 4 + depth: 22, occurrence: 2 + depth: 23, occurrence: 2 + depth: 25, occurrence: 2 + depth: 27, occurrence: 1 + depth: 28, occurrence: 1 + depth: 29, occurrence: 2 + depth: 31, occurrence: 1 + depth: 32, occurrence: 2 + depth: 33, occurrence: 1 + depth: 35, occurrence: 1 + depth: 37, occurrence: 1 + depth: 49, occurrence: 1 + +XXX total number of pointers: 386 + +XXX times a variable address is taken: 972 +XXX times a pointer is dereferenced on RHS: 166 +breakdown: + depth: 1, occurrence: 159 + depth: 2, occurrence: 7 +XXX times a pointer is dereferenced on LHS: 233 +breakdown: + depth: 1, occurrence: 230 + depth: 2, occurrence: 3 +XXX times a pointer is compared with null: 15 +XXX times a pointer is compared with address of another variable: 6 +XXX times a pointer is compared with another pointer: 15 +XXX times a pointer is qualified to be dereferenced: 7549 + +XXX max dereference level: 4 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 2327 + level: 2, occurrence: 127 + level: 3, occurrence: 3 + level: 4, occurrence: 4 +XXX number of pointers point to pointers: 107 +XXX number of pointers point to scalars: 257 +XXX number of pointers point to structs: 22 +XXX percent of pointers has null in alias set: 32.4 +XXX average alias set size: 1.65 + +XXX times a non-volatile is read: 1305 +XXX times a non-volatile is write: 763 +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: 8 + +XXX stmts: 376 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 34 + depth: 1, occurrence: 38 + depth: 2, occurrence: 35 + depth: 3, occurrence: 67 + depth: 4, occurrence: 91 + depth: 5, occurrence: 111 + +XXX percentage a fresh-made variable is used: 17.1 +XXX percentage an existing variable is used: 82.9 +FYI: the random generator makes assumptions about the integer size. See platform.info for more details. +********************* end of statistics **********************/ + diff --git a/tests/fuzz/2.c.txt b/tests/fuzz/2.c.txt new file mode 100644 index 00000000..8ca5593f --- /dev/null +++ b/tests/fuzz/2.c.txt @@ -0,0 +1 @@ +checksum = E09CCEB0 diff --git a/tests/fuzz/3.c b/tests/fuzz/3.c new file mode 100644 index 00000000..b2dcac2e --- /dev/null +++ b/tests/fuzz/3.c @@ -0,0 +1,1043 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.2.0 + * Git version: 2751ded + * Options: --no-volatiles --no-math64 + * Seed: 1532285979 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +union U0 { + int8_t f0; + const uint8_t f1; +}; + +union U1 { + int8_t * f0; +}; + +union U2 { + int32_t f0; + uint32_t f1; + uint8_t f2; + uint32_t f3; + int8_t * f4; +}; + +/* --- GLOBAL VARIABLES --- */ +static uint8_t g_23 = 0x67L; +static int32_t g_25 = 1L; +static uint16_t g_34 = 0x451DL; +static union U2 g_42 = {-1L}; +static int32_t g_61[8][6][4] = {{{0xE281B1D0L,8L,9L,0xC90ACEFCL},{0xC369029EL,8L,0x63978472L,0x55BBB785L},{0x23D12EF6L,(-1L),0x23D12EF6L,8L},{0x55BBB785L,0xE4FCD58FL,0L,1L},{0xDD4F9520L,0xBF567D71L,0x9117A540L,0xE4FCD58FL},{4L,0L,0x9117A540L,9L}},{{0xDD4F9520L,(-1L),0L,0L},{0x55BBB785L,(-1L),0x23D12EF6L,0xDD4F9520L},{0x23D12EF6L,0xDD4F9520L,0x63978472L,0L},{0xC369029EL,9L,9L,0xC369029EL},{0xE281B1D0L,6L,0x55BBB785L,0x70A6219FL},{0L,0x63978472L,0xE281B1D0L,8L}},{{4L,9L,(-1L),8L},{0x63978472L,1L,0xC90ACEFCL,(-1L)},{0x9117A540L,(-1L),0x63978472L,0xE281B1D0L},{0L,0x9117A540L,0xC35C241EL,0x55F5DDA3L},{0x3A29ADD9L,(-1L),0x5DD88BA5L,(-1L)},{0xE4FCD58FL,8L,9L,0xBF567D71L}},{{0x55BBB785L,0xDD4F9520L,0xBF567D71L,0x9117A540L},{0x55F5DDA3L,0x3A29ADD9L,8L,1L},{0x55F5DDA3L,4L,0xBF567D71L,0x55BBB785L},{0x55BBB785L,1L,9L,0L},{0xE4FCD58FL,0L,0x5DD88BA5L,8L},{0x3A29ADD9L,0x5DD88BA5L,0xC35C241EL,0xC35C241EL}},{{0L,0L,0x63978472L,0xDD4F9520L},{0x9117A540L,6L,0xC90ACEFCL,(-1L)},{0x63978472L,0xC369029EL,(-1L),0xC90ACEFCL},{4L,0xC369029EL,0xE281B1D0L,(-1L)},{0xC369029EL,6L,8L,0xDD4F9520L},{0L,0L,0x9117A540L,0xC35C241EL}},{{0xE281B1D0L,0x5DD88BA5L,1L,8L},{6L,0L,6L,0L},{8L,1L,0x3A29ADD9L,0x55BBB785L},{(-1L),4L,0x70A6219FL,1L},{0x23D12EF6L,0x3A29ADD9L,0x70A6219FL,0x9117A540L},{(-1L),0xBF567D71L,0x55BBB785L,(-1L)}},{{0x9117A540L,0x23D12EF6L,0xE4FCD58FL,4L},{0xE4FCD58FL,4L,0x3A29ADD9L,(-1L)},{0x63978472L,0L,0L,0x63978472L},{1L,1L,0x9117A540L,0L},{0xC35C241EL,0x3A29ADD9L,0x63978472L,0x23D12EF6L},{8L,8L,4L,0x23D12EF6L}},{{0L,0x3A29ADD9L,0xC369029EL,0L},{0L,1L,0L,0x63978472L},{0x70A6219FL,0L,0xE281B1D0L,(-1L)},{0x55BBB785L,4L,6L,4L},{(-1L),0x23D12EF6L,8L,(-1L)},{9L,0xBF567D71L,(-1L),0L}}}; +static int32_t *g_60 = &g_61[3][1][1]; +static int8_t g_70 = 1L; +static int8_t *g_69 = &g_70; +static int32_t g_78 = 1L; +static union U1 g_84 = {0}; +static int32_t **g_95 = &g_60; +static int32_t ***g_94[1] = {&g_95}; +static int8_t g_117 = 7L; +static union U0 g_163 = {0xE2L}; +static uint16_t g_165[7] = {0xB953L,0xB953L,0xB953L,0xB953L,0xB953L,0xB953L,0xB953L}; +static const uint8_t g_171[4][8][3] = {{{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL}},{{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL}},{{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL}},{{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL},{8UL,8UL,8UL},{1UL,1UL,1UL}}}; +static const uint8_t *g_170 = &g_171[2][3][0]; +static uint8_t g_218 = 0xB9L; +static int16_t g_234 = 1L; +static int16_t g_246 = 0x3B2BL; +static int16_t *g_248 = &g_246; +static int16_t *g_249 = &g_246; +static int32_t g_255 = (-8L); +static int16_t g_380 = 0L; +static int16_t g_387 = 1L; +static union U2 *g_397 = &g_42; +static union U2 **g_396 = &g_397; +static const int32_t *g_404 = &g_25; +static union U0 g_405[4][1] = {{{0xD5L}},{{0xD5L}},{{0xD5L}},{{0xD5L}}}; +static int8_t g_471 = (-2L); +static uint16_t **g_505 = (void*)0; +static const int32_t g_555 = 0x72195204L; +static uint16_t g_556[9] = {8UL,0x32E2L,8UL,8UL,0x32E2L,8UL,8UL,0x32E2L,8UL}; +static int32_t *g_588 = &g_61[3][1][2]; +static uint8_t *g_616 = &g_42.f2; +static union U1 *g_644 = &g_84; +static union U1 **g_643 = &g_644; + + +/* --- FORWARD DECLARATIONS --- */ +static int32_t func_1(void); +static uint8_t func_4(int8_t * p_5, uint16_t p_6, int8_t * p_7); +static int8_t * func_8(uint8_t p_9, const uint32_t p_10, const int8_t * p_11, union U0 p_12); +static const int8_t func_16(union U0 p_17, uint8_t p_18, int8_t * p_19, int8_t * p_20); +static union U0 func_21(uint32_t p_22); +static int8_t func_27(uint16_t p_28, int32_t * p_29, union U2 p_30, int32_t * const p_31, int32_t p_32); +static int32_t * func_37(const uint16_t p_38, union U2 p_39, int32_t * p_40, int32_t p_41); +static int32_t * func_43(uint8_t p_44, int8_t p_45, int8_t * p_46); +static uint16_t func_50(int32_t * p_51, uint16_t p_52, int8_t p_53, int32_t * p_54, union U2 p_55); +static int32_t * func_56(int8_t * p_57, int32_t * p_58); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_23 g_34 g_42 g_60 g_61 g_42.f3 g_69 g_70 g_42.f2 g_78 g_94 g_117 g_95 g_163 g_163.f0 g_42.f1 g_218 g_170 g_171 g_163.f1 g_84 g_248 g_246 g_234 g_249 g_405 g_255 g_387 g_25 g_396 g_397 g_380 g_471 g_165 g_404 g_505 g_588 g_643 + * writes: g_25 g_34 g_60 g_78 g_61 g_117 g_170 g_70 g_163.f0 g_218 g_165 g_234 g_42.f1 g_404 g_255 g_387 g_396 g_471 g_42.f2 g_616 + */ +static int32_t func_1(void) +{ /* block id: 0 */ + int32_t l_13[8] = {1L,1L,1L,1L,1L,1L,1L,1L}; + uint16_t *l_33 = &g_34; + uint32_t l_47 = 0xF844BA92L; + int8_t *l_59 = (void*)0; + union U2 l_64 = {-8L}; + int32_t l_175[3][5] = {{0xEB591F11L,0xEB591F11L,(-9L),4L,0xE9867546L},{(-1L),1L,1L,(-1L),0xEB591F11L},{(-1L),4L,0L,0L,4L}}; + int32_t l_509[9][6] = {{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L},{0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L,0xDF92247FL,0x59DF3EF6L,0x59DF3EF6L}}; + uint32_t l_528 = 6UL; + uint8_t *l_576[8] = {&g_23,&g_23,&g_23,&g_23,&g_23,&g_23,&g_23,&g_23}; + int32_t l_635 = 0x6AE51A9FL; + int i, j; + if (((safe_add_func_uint16_t_u_u((l_509[1][5] ^= (func_4(func_8(l_13[7], (((safe_mul_func_uint8_t_u_u((func_16(func_21(g_23), (((*g_69) = func_27((++(*l_33)), func_37(l_13[7], g_42, func_43(l_47, (safe_div_func_uint8_t_u_u((func_50(func_56(l_59, g_60), g_61[6][5][1], l_13[2], &g_61[3][1][1], l_64) <= l_64.f1), g_42.f3)), g_69), l_47), l_64, &l_13[1], l_175[0][2])) < l_13[7]), l_59, g_69) >= g_171[1][6][2]), 0x43L)) < l_64.f2) != 5UL), g_69, g_405[3][0]), l_64.f0, l_59) >= l_64.f1)), l_64.f3)) > 0x66CCL)) + { /* block id: 365 */ + int32_t l_524 = (-9L); + union U2 l_580 = {0xF3A458B5L}; + int8_t *l_581 = (void*)0; + int32_t l_589 = 0x34F78B18L; + uint32_t l_605 = 0xE76FF136L; + for (g_234 = (-16); (g_234 >= 13); g_234 = safe_add_func_int32_t_s_s(g_234, 6)) + { /* block id: 368 */ + union U2 l_520 = {0x03E6CC5CL}; + int32_t l_529 = (-7L); + int32_t *l_566 = &l_175[0][0]; + const uint8_t *l_577 = &g_171[2][4][1]; + uint32_t *l_584 = &l_580.f1; + uint8_t l_587 = 0x74L; + if (l_64.f1) + { /* block id: 369 */ + uint32_t l_516 = 0UL; + uint8_t *l_519 = &g_42.f2; + union U2 *l_521 = &l_64; + int32_t *l_525 = (void*)0; + int32_t *l_526 = &g_61[3][1][1]; + int32_t *l_527[7][2] = {{&l_13[4],&l_13[4]},{(void*)0,&l_13[4]},{&l_13[4],(void*)0},{&l_13[4],&l_13[4]},{(void*)0,&l_13[4]},{&l_13[4],(void*)0},{&l_13[4],&l_13[4]}}; + int16_t l_554 = 0xB066L; + uint16_t *l_571 = &g_165[6]; + int i, j; + l_529 = (safe_div_func_int16_t_s_s((safe_rshift_func_uint16_t_u_s(l_516, (safe_rshift_func_int8_t_s_u(l_516, ((*l_519) = 0x47L))))), (((*l_521) = l_520) , ((l_528 = ((*l_526) = (safe_lshift_func_uint16_t_u_s((func_16(g_163, l_524, l_519, &g_70) && 1L), 8)))) | l_520.f0)))); + if ((*l_526)) + break; + for (g_34 = 0; (g_34 <= 5); g_34 = safe_add_func_int16_t_s_s(g_34, 5)) + { /* block id: 378 */ + uint32_t l_534 = 0x9C38BE8CL; + int8_t **l_537 = &g_69; + int32_t *l_565 = &l_13[0]; + } + } + else + { /* block id: 394 */ + return l_175[0][1]; + } + l_589 = ((*g_588) = (safe_mod_func_uint16_t_u_u(((((l_576[2] = &g_218) == l_577) && (~(safe_mul_func_uint8_t_u_u((l_13[5] >= (l_580 , g_165[5])), (*l_566))))) > 0x0256L), l_47))); + (*g_588) ^= (*l_566); + } + for (g_117 = (-29); (g_117 != (-7)); g_117 = safe_add_func_int8_t_s_s(g_117, 5)) + { /* block id: 407 */ + int32_t *l_592 = &l_13[7]; + int32_t *l_593 = &l_13[0]; + int32_t *l_594 = &l_175[0][2]; + int32_t *l_595 = &l_509[1][5]; + int32_t *l_596 = &l_175[0][2]; + int32_t *l_597 = &l_509[1][5]; + int32_t *l_598 = &l_175[1][2]; + int32_t *l_599 = (void*)0; + int32_t *l_600 = &g_255; + int32_t *l_601 = &g_25; + int32_t *l_602 = &g_255; + int32_t l_603 = 0x83DE74D8L; + int32_t *l_604[5][7] = {{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&l_175[0][2],&g_61[3][1][0],&l_509[3][2],&g_61[3][1][0],&l_175[0][2],(void*)0,&l_175[0][2]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,&g_255,(void*)0},{&l_509[3][2],&g_255,&l_509[3][2],(void*)0,&l_509[8][3],(void*)0,&l_509[3][2]},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}; + int i, j; + ++l_605; + } + } + else + { /* block id: 410 */ + int32_t *l_608[10] = {&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2],&l_175[0][2]}; + uint8_t *l_612 = (void*)0; + uint8_t **l_613 = (void*)0; + uint8_t **l_614 = &l_612; + uint8_t **l_615[10] = {&l_576[5],&l_576[2],&l_576[5],&l_576[2],&l_576[5],&l_576[2],&l_576[5],&l_576[2],&l_576[5],&l_576[2]}; + uint32_t l_617 = 0xA732A71CL; + const int8_t *l_618 = &g_70; + int32_t *l_622 = (void*)0; + union U1 l_641 = {0}; + int i; + if (func_50(func_56(&g_70, l_608[8]), (safe_lshift_func_uint8_t_u_s(l_13[7], 7)), (((safe_unary_minus_func_int8_t_s(((*g_69) = ((*g_248) ^ (l_175[0][3] > ((g_616 = ((*l_614) = l_612)) != (l_576[4] = &g_23))))))) | l_64.f1) && g_165[4]), &l_175[0][0], (**g_396))) + { /* block id: 415 */ + return l_528; + } + else + { /* block id: 417 */ + int8_t l_619 = 0xF5L; + const int32_t *l_627[7][2] = {{&g_42.f0,&g_42.f0},{&g_42.f0,&g_42.f0},{&g_42.f0,&g_42.f0},{&l_64.f0,&l_64.f0},{&l_64.f0,&g_42.f0},{&g_42.f0,&g_42.f0},{&g_42.f0,&g_42.f0}}; + const int32_t **l_626 = &l_627[3][0]; + int32_t l_628[6] = {0xF3CEC250L,0xF3CEC250L,0xF3CEC250L,0xF3CEC250L,0xF3CEC250L,0xF3CEC250L}; + int16_t l_636 = 0xA7CDL; + uint8_t l_637 = 0x6EL; + int i, j; + for (g_387 = 7; (g_387 >= 0); g_387 -= 1) + { /* block id: 420 */ + int8_t *l_620[4][4][9] = {{{&g_163.f0,&l_619,(void*)0,&g_163.f0,&g_163.f0,(void*)0,&l_619,&g_163.f0,&g_405[3][0].f0},{&g_70,&g_471,(void*)0,&g_70,&l_619,&g_70,(void*)0,&g_117,&g_471},{&g_405[3][0].f0,&l_619,&g_163.f0,&g_471,(void*)0,&g_471,&g_163.f0,&l_619,&g_405[3][0].f0},{&g_163.f0,&g_471,&l_619,&g_70,&g_70,(void*)0,&g_471,(void*)0,&g_405[3][0].f0}},{{&g_163.f0,(void*)0,(void*)0,&g_163.f0,(void*)0,(void*)0,(void*)0,&g_163.f0,&g_163.f0},{&g_70,&g_405[3][0].f0,&g_70,&g_471,(void*)0,(void*)0,(void*)0,&g_471,&g_163.f0},{&l_619,(void*)0,&g_471,&g_163.f0,&g_163.f0,&g_117,&g_163.f0,&g_163.f0,&g_471},{&g_405[3][0].f0,&g_405[3][0].f0,&g_405[3][0].f0,&g_163.f0,&l_619,&g_117,&g_471,&g_70,&g_70}},{{&g_471,&g_163.f0,&l_619,&g_163.f0,(void*)0,&l_619,&l_619,(void*)0,&g_163.f0},{&g_405[3][0].f0,&g_117,&g_405[3][0].f0,(void*)0,&g_471,(void*)0,&g_70,&g_70,&l_619},{&g_117,&l_619,&g_471,&g_163.f0,(void*)0,&g_405[3][0].f0,&g_163.f0,&g_405[3][0].f0,(void*)0},{(void*)0,&g_70,&g_70,(void*)0,&g_117,(void*)0,&g_70,&l_619,&g_70}},{{&g_163.f0,&g_117,&g_163.f0,&g_163.f0,&l_619,&g_163.f0,&g_117,&g_117,&g_163.f0},{&g_117,&g_163.f0,(void*)0,&g_163.f0,&g_117,&l_619,&g_405[3][0].f0,&g_471,&g_70},{&l_619,&g_163.f0,&g_405[3][0].f0,&g_163.f0,(void*)0,&g_117,(void*)0,&g_163.f0,(void*)0},{&g_70,&l_619,&l_619,&l_619,&l_619,&g_70,(void*)0,&g_117,&g_70}}}; + int32_t l_629 = 0x94DF55BDL; + int32_t l_630 = 0x78F2A151L; + int32_t l_631 = 0x108DD9F6L; + int32_t l_632 = 1L; + int32_t l_633 = 0x9920FA05L; + int32_t l_634 = 8L; + int32_t *l_650 = &g_255; + int i, j, k; + for (g_163.f0 = 0; (g_163.f0 <= 3); g_163.f0 += 1) + { /* block id: 423 */ + int32_t *l_621[7][7] = {{&l_175[0][2],&g_61[3][4][2],&l_509[1][5],&l_175[0][2],&l_13[7],&l_175[0][2],&l_509[1][5]},{&g_255,&g_255,&l_13[7],&l_509[1][5],&g_61[3][4][2],(void*)0,&g_255},{&g_255,&l_509[1][5],&l_509[1][5],&g_61[3][4][2],&g_255,&g_255,&g_61[3][4][2]},{&l_175[0][2],&l_13[7],&l_175[0][2],&l_509[1][5],&g_61[3][4][2],&l_175[0][2],&l_175[0][2]},{&g_61[3][4][2],&l_13[7],&l_509[1][5],&l_509[1][5],&l_13[7],&l_13[7],&l_13[7]},{(void*)0,&l_509[1][5],&l_509[1][5],(void*)0,&l_175[0][2],&l_175[0][2],&g_61[3][4][2]},{&g_255,&g_255,&l_509[1][5],&l_509[1][5],&g_61[3][4][2],&g_255,&g_255}}; + const int32_t *l_624 = &g_78; + const int32_t **l_623[5]; + int i, j; + for (i = 0; i < 5; i++) + l_623[i] = &l_624; + for (g_78 = 3; (g_78 >= 0); g_78 -= 1) + { /* block id: 426 */ + int i, j, k; + g_61[(g_78 + 1)][(g_163.f0 + 1)][g_163.f0] ^= l_619; + (*g_95) = func_56(l_620[0][2][7], l_621[0][2]); + (*g_95) = (*g_95); + l_622 = l_621[0][2]; + } + for (l_619 = 1; (l_619 <= 7); l_619 += 1) + { /* block id: 434 */ + const int32_t ***l_625[2]; + int i; + for (i = 0; i < 2; i++) + l_625[i] = &l_623[1]; + l_626 = l_623[4]; + } + } + --l_637; + for (l_47 = 0; (l_47 <= 3); l_47 += 1) + { /* block id: 441 */ + int32_t l_640 = 0xEDD92DAAL; + int32_t *l_642 = (void*)0; + int8_t *l_649 = (void*)0; + (*g_588) |= (((g_165[2] = l_640) >= l_640) | ((((l_641 , (*g_170)) | (l_628[0] = (l_13[2] >= (func_50(l_642, (func_50(&l_628[2], (((g_643 == ((safe_rshift_func_uint8_t_u_s(l_628[2], 6)) , &g_644)) == 0x572EL) & 0L), l_634, l_608[7], (**g_396)) ^ 9UL), (*g_69), l_608[0], (*g_397)) || 0x10DDA243L)))) < l_13[7]) > l_13[g_387])); + for (l_636 = 0; (l_636 <= 3); l_636 += 1) + { /* block id: 447 */ + int32_t *l_651 = &l_628[2]; + l_650 = &l_628[2]; + (*g_95) = l_651; + if ((**g_95)) + break; + } + for (g_163.f0 = 5; (g_163.f0 >= 2); g_163.f0 -= 1) + { /* block id: 455 */ + int i, j, k; + g_61[g_387][l_47][l_47] = (safe_unary_minus_func_int16_t_s(l_509[(l_47 + 4)][l_47])); + l_509[3][0] ^= (*l_650); + return (*g_588); + } + for (l_528 = 2; (l_528 <= 7); l_528 += 1) + { /* block id: 462 */ + return (*g_404); + } + } + } + for (l_637 = 0; (l_637 == 3); l_637++) + { /* block id: 469 */ + uint32_t l_655[6]; + int i; + for (i = 0; i < 6; i++) + l_655[i] = 0x4CE808BAL; + (*g_95) = l_622; + if (l_655[4]) + continue; + } + } + } + for (g_218 = 3; (g_218 == 24); g_218++) + { /* block id: 477 */ + for (l_635 = 24; (l_635 <= 1); l_635 = safe_sub_func_int32_t_s_s(l_635, 2)) + { /* block id: 480 */ + (*g_588) = ((&g_78 == &g_78) ^ 0x108FL); + } + } + return (*g_588); +} + + +/* ------------------------------------------ */ +/* + * reads : g_387 g_95 g_84 g_61 g_170 g_171 g_163.f1 g_25 g_396 g_397 g_42 g_42.f3 g_117 g_248 g_246 g_255 g_380 g_471 g_249 g_165 g_163 g_69 g_70 g_42.f1 g_218 g_404 g_505 + * writes: g_387 g_60 g_404 g_218 g_25 g_117 g_396 g_255 g_61 g_471 g_170 g_34 + */ +static uint8_t func_4(int8_t * p_5, uint16_t p_6, int8_t * p_7) +{ /* block id: 299 */ + int32_t *l_430[6][9] = {{&g_61[3][1][1],&g_61[3][1][1],(void*)0,&g_61[1][1][0],&g_25,(void*)0,&g_25,&g_61[1][1][0],(void*)0},{&g_25,&g_25,&g_61[3][5][3],(void*)0,&g_61[5][0][1],&g_61[3][5][3],&g_61[5][0][1],(void*)0,&g_61[3][5][3]},{&g_61[3][1][1],&g_61[3][1][1],(void*)0,&g_61[1][1][0],&g_25,(void*)0,&g_25,&g_61[1][1][0],(void*)0},{&g_25,&g_25,&g_61[3][5][3],(void*)0,&g_61[5][0][1],&g_61[3][5][3],&g_61[5][0][1],(void*)0,&g_61[3][5][3]},{&g_61[3][1][1],&g_61[3][1][1],(void*)0,&g_61[3][1][1],&g_61[1][1][0],(void*)0,&g_61[1][1][0],&g_61[3][1][1],(void*)0},{&g_61[5][0][1],&g_61[5][0][1],&g_25,&g_25,(void*)0,&g_25,(void*)0,&g_25,&g_25}}; + uint32_t l_437[7][6] = {{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL},{0x73C76190L,0x73C76190L,1UL,0x73C76190L,0x73C76190L,1UL}}; + union U0 l_439 = {0x5BL}; + union U2 l_464 = {0x013712E9L}; + int8_t *l_468 = (void*)0; + union U2 l_470 = {0xFCE83381L}; + const union U1 l_504 = {0}; + int i, j; + for (g_387 = 10; (g_387 > (-15)); g_387--) + { /* block id: 302 */ + union U0 l_438[9][10] = {{{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L},{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L}},{{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L},{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L}},{{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L},{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L}},{{0x4FL},{0x2CL},{0x2CL},{0x4FL},{-6L},{0x4FL},{0x2CL},{0x6AL},{0x2CL},{-5L}},{{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L},{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L}},{{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L},{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L}},{{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L},{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L}},{{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L},{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L}},{{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L},{0x2CL},{0x6AL},{0x6AL},{0x2CL},{-5L}}}; + int8_t *l_444 = &l_438[8][2].f0; + uint8_t *l_445 = (void*)0; + uint8_t *l_446 = (void*)0; + uint8_t *l_447 = (void*)0; + int32_t *l_448 = &g_25; + int i, j; + (*l_448) = func_50(((*g_95) = l_430[0][6]), (safe_lshift_func_uint8_t_u_u((safe_mod_func_int32_t_s_s((safe_mul_func_int16_t_s_s((l_437[5][3] , ((g_218 = func_16(l_438[8][2], func_16(l_439, (g_84 , func_16(l_439, (safe_rshift_func_uint8_t_u_s(0x01L, (safe_rshift_func_int16_t_s_s(0xFC91L, 13)))), p_7, l_444)), p_7, p_7), p_7, l_444)) ^ (*g_170))), g_387)), g_25)), 3)), l_438[8][2].f1, l_448, (**g_396)); + (*l_448) &= 9L; + if (p_6) + break; + } + for (g_117 = (-26); (g_117 < 23); g_117++) + { /* block id: 311 */ + int16_t l_469 = (-9L); + uint32_t *l_486 = &l_470.f1; + uint32_t **l_485[4] = {&l_486,&l_486,&l_486,&l_486}; + int8_t l_497 = 0L; + int32_t l_501 = 1L; + uint16_t l_508 = 0x4BC4L; + int i; + if (p_6) + { /* block id: 312 */ + int32_t *l_451[8] = {&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}; + int32_t *l_452 = (void*)0; + const union U1 l_472 = {0}; + union U0 l_479 = {0xB8L}; + int i; + for (l_439.f0 = 3; (l_439.f0 >= 0); l_439.f0 -= 1) + { /* block id: 315 */ + union U2 ***l_453 = &g_396; + int32_t l_465 = 0xAF964579L; + uint16_t *l_482 = &g_165[0]; + l_452 = ((*g_95) = func_56(p_5, l_451[0])); + (*l_453) = &g_397; + for (g_387 = 5; (g_387 >= 0); g_387 -= 1) + { /* block id: 321 */ + union U0 l_454 = {8L}; + int i, j, k; + if (g_61[l_439.f0][g_387][l_439.f0]) + { /* block id: 322 */ + int32_t *l_463 = &g_255; + uint16_t l_466[9] = {0xBF85L,0xBF85L,0x789FL,0xBF85L,0xBF85L,0x789FL,0xBF85L,0xBF85L,0x789FL}; + uint16_t *l_467[1]; + int i, j, k; + for (i = 0; i < 1; i++) + l_467[i] = &g_165[4]; + g_61[(l_439.f0 + 3)][g_387][l_439.f0] = (func_16(l_454, (safe_rshift_func_uint16_t_u_u(((*l_463) ^= ((safe_sub_func_int16_t_s_s(((safe_sub_func_uint16_t_u_u(l_437[(l_439.f0 + 3)][(l_439.f0 + 2)], (l_466[1] = (func_16(l_454, (func_16(func_21(((*p_5) != (safe_sub_func_uint8_t_u_u((func_50(l_463, g_387, (*p_5), l_463, ((255UL == 0xC5L) , l_464)) || p_6), 1L)))), l_465, p_5, &g_70) == 0xC5F1L), p_5, p_5) ^ 0x5022C929L)))) != (-9L)), (*g_248))) ^ 0x01E9L)), g_380)), l_468, l_468) >= l_469); + } + else + { /* block id: 326 */ + (*l_452) ^= (-1L); + } + (*l_452) = ((g_84 , (((l_470 , (*g_170)) == g_471) ^ ((((func_50(&g_61[l_439.f0][g_387][l_439.f0], p_6, (g_61[l_439.f0][g_387][l_439.f0] = 0L), (l_472 , l_452), l_464) != 0UL) | 0x92L) | (*g_249)) > (*g_170)))) != (*g_249)); + } + for (g_471 = 0; (g_471 <= 3); g_471 += 1) + { /* block id: 334 */ + uint16_t *l_480 = (void*)0; + int32_t l_484 = 0x0E90AE7DL; + for (g_387 = 0; (g_387 <= 6); g_387 += 1) + { /* block id: 337 */ + uint16_t **l_481 = &l_480; + union U2 l_483 = {4L}; + int i, j, k; + (*g_95) = func_37((safe_rshift_func_int8_t_s_u(0xCBL, g_61[(l_439.f0 + 3)][(l_439.f0 + 1)][g_471])), (***l_453), &g_61[(l_439.f0 + 3)][(l_439.f0 + 1)][g_471], ((l_439 , ((safe_mod_func_uint32_t_u_u(((((*l_481) = (((safe_sub_func_int32_t_s_s(g_165[g_471], p_6)) , l_479) , l_480)) == l_482) & (*g_170)), p_6)) , l_483)) , l_484)); + } + for (l_465 = 3; (l_465 >= 0); l_465 -= 1) + { /* block id: 343 */ + int i, j, k; + return g_61[(g_471 + 1)][(l_439.f0 + 2)][l_465]; + } + } + } + return (*g_170); + } + else + { /* block id: 349 */ + uint32_t ***l_487 = (void*)0; + uint32_t ***l_488 = &l_485[3]; + int32_t l_495[9][9][2] = {{{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L}},{{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L}},{{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L}},{{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L}},{{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L}},{{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L},{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x40CE7CD7L},{0xADA7BC83L,0x50ED6328L}},{{0L,0x40CE7CD7L},{1L,0x40CE7CD7L},{0L,0x50ED6328L},{0xADA7BC83L,0x40CE7CD7L},{0L,0x50ED6328L},{1L,0xD0A14D25L},{0L,0x50ED6328L},{(-9L),0x50ED6328L},{0L,0xD0A14D25L}},{{1L,0x50ED6328L},{0x1F85E5ACL,0x50ED6328L},{1L,0xD0A14D25L},{0L,0x50ED6328L},{(-9L),0x50ED6328L},{0L,0xD0A14D25L},{1L,0x50ED6328L},{0x1F85E5ACL,0x50ED6328L},{1L,0xD0A14D25L}},{{0L,0x50ED6328L},{(-9L),0x50ED6328L},{0L,0xD0A14D25L},{1L,0x50ED6328L},{0x1F85E5ACL,0x50ED6328L},{1L,0xD0A14D25L},{0L,0x50ED6328L},{(-9L),0x50ED6328L},{0L,0xD0A14D25L}}}; + uint16_t *l_496 = &g_34; + int i, j, k; + (*l_488) = l_485[1]; + (*g_95) = func_37((p_6 ^ 0xE2F4L), (**g_396), l_430[0][6], ((safe_sub_func_uint32_t_u_u((safe_lshift_func_uint16_t_u_u(((*l_496) = (safe_mul_func_uint8_t_u_u(func_16(l_439, l_495[1][7][1], p_5, &g_70), 0UL))), g_25)), g_42.f1)) <= l_469)); + for (g_218 = 0; (g_218 <= 5); g_218 += 1) + { /* block id: 355 */ + uint32_t l_498[10][6][2] = {{{0UL,0x4710D315L},{0xC89510DFL,18446744073709551614UL},{18446744073709551615UL,0x32FB2497L},{18446744073709551615UL,0UL},{1UL,0xA19F4CA6L},{18446744073709551614UL,1UL}},{{0UL,1UL},{0x243448FFL,0x243448FFL},{18446744073709551615UL,18446744073709551614UL},{0x0D81DB8EL,0x78E1239EL},{1UL,0x4710D315L},{1UL,1UL}},{{0x32FB2497L,18446744073709551615UL},{0x32FB2497L,1UL},{1UL,0x4710D315L},{1UL,0x78E1239EL},{0x0D81DB8EL,18446744073709551614UL},{18446744073709551615UL,0x243448FFL}},{{0x243448FFL,1UL},{0UL,1UL},{18446744073709551614UL,0xA19F4CA6L},{1UL,0UL},{18446744073709551615UL,0x32FB2497L},{18446744073709551615UL,18446744073709551614UL}},{{0xC89510DFL,0x4710D315L},{0xFF073B46L,18446744073709551614UL},{0UL,1UL},{18446744073709551615UL,0UL},{0xF99EA8BEL,0xFF073B46L},{0x78E1239EL,18446744073709551615UL}},{{1UL,18446744073709551615UL},{0x78E1239EL,0xFF073B46L},{0xF99EA8BEL,0UL},{18446744073709551615UL,1UL},{0UL,18446744073709551614UL},{0xFF073B46L,0x53B970BDL}},{{0x78E1239EL,18446744073709551610UL},{0xC89510DFL,18446744073709551615UL},{0UL,0xFF073B46L},{0x76FB5125L,18446744073709551614UL},{18446744073709551610UL,1UL},{0UL,18446744073709551612UL}},{{0xF99EA8BEL,0xF99EA8BEL},{0UL,18446744073709551610UL},{0xA19F4CA6L,18446744073709551615UL},{18446744073709551612UL,0x53B970BDL},{0x76FB5125L,18446744073709551612UL},{18446744073709551615UL,0xC89510DFL}},{{18446744073709551615UL,18446744073709551612UL},{0x76FB5125L,0x53B970BDL},{18446744073709551612UL,18446744073709551615UL},{0xA19F4CA6L,18446744073709551610UL},{0UL,0xF99EA8BEL},{0xF99EA8BEL,18446744073709551612UL}},{{0UL,1UL},{18446744073709551610UL,18446744073709551614UL},{0x76FB5125L,0xFF073B46L},{0UL,18446744073709551615UL},{0xC89510DFL,18446744073709551610UL},{0x78E1239EL,0x53B970BDL}}}; + int i, j, k; + if ((*g_404)) + break; + l_498[0][0][0]--; + l_501 = l_498[0][0][0]; + } + } + l_501 &= (func_21((((~p_6) , (safe_div_func_int32_t_s_s(p_6, ((l_504 , 0L) | ((void*)0 == g_505))))) , (safe_rshift_func_int8_t_s_u(0x75L, l_508)))) , p_6); + } + return (*g_170); +} + + +/* ------------------------------------------ */ +/* + * reads : g_95 g_60 g_234 g_249 g_246 g_61 g_69 g_70 g_42.f3 g_42.f1 g_218 g_170 g_171 g_163.f1 g_34 g_163.f0 g_42 g_84 g_248 g_255 + * writes: g_60 g_70 g_78 g_34 g_163.f0 g_61 g_218 g_165 g_234 g_117 g_42.f1 g_255 + */ +static int8_t * func_8(uint8_t p_9, const uint32_t p_10, const int8_t * p_11, union U0 p_12) +{ /* block id: 293 */ + int8_t l_406[2][8] = {{0x4CL,0x4CL,(-6L),0x4CL,0x4CL,(-6L),0x4CL,0x4CL},{0x31L,0x4CL,0x31L,0x31L,0x4CL,0x31L,0x31L,0x4CL}}; + int32_t *l_407 = &g_61[1][3][0]; + int32_t *l_408 = (void*)0; + int32_t *l_409 = &g_61[3][1][1]; + int32_t *l_410 = &g_25; + int32_t *l_411 = (void*)0; + int32_t *l_412 = &g_25; + int32_t *l_413 = &g_61[3][1][1]; + int32_t *l_414 = &g_255; + int32_t *l_415 = &g_61[3][1][1]; + int32_t *l_416 = (void*)0; + int32_t l_417[3][4][5]; + int32_t *l_418[6][10][1] = {{{(void*)0},{(void*)0},{(void*)0},{&g_61[1][4][2]},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_61[1][4][2]},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_25},{&g_25},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{(void*)0},{&g_25},{&g_25},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{(void*)0},{&g_25},{&g_25},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{(void*)0},{&g_25},{&g_25},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0}},{{&g_25},{&g_25},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{(void*)0},{&g_25}}}; + int16_t l_419 = 0x46F3L; + int32_t l_420 = 0xEFAEA218L; + int32_t l_421 = 0xF0C3CF87L; + int32_t l_422 = 0xF5496424L; + int8_t l_423 = (-7L); + uint32_t l_424 = 0xBE103C84L; + union U2 l_427 = {0x21442813L}; + int i, j, k; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 5; k++) + l_417[i][j][k] = 0xF85FD576L; + } + } + l_406[1][3] ^= p_9; + (*g_95) = l_407; + l_424--; + (*l_414) &= func_27(p_9, (*g_95), l_427, (*g_95), ((&g_387 == (l_427 , &g_380)) != ((((p_12.f1 <= (0x201B5C96L > p_9)) >= g_234) ^ (*g_249)) , 0x9438L))); + return &g_117; +} + + +/* ------------------------------------------ */ +/* + * reads : g_61 + * writes: g_404 + */ +static const int8_t func_16(union U0 p_17, uint8_t p_18, int8_t * p_19, int8_t * p_20) +{ /* block id: 197 */ + uint16_t l_302[6][3] = {{1UL,1UL,1UL},{0UL,0UL,0UL},{1UL,1UL,1UL},{0UL,0UL,0UL},{1UL,1UL,1UL},{0UL,0UL,0UL}}; + int32_t *l_342[5][7][4] = {{{&g_255,&g_61[3][1][1],&g_61[2][3][3],&g_25},{&g_61[3][1][1],&g_25,&g_255,&g_255},{&g_255,&g_255,&g_255,&g_255},{&g_255,&g_255,&g_255,&g_255},{&g_255,&g_25,&g_61[3][1][1],&g_25},{&g_61[2][3][3],&g_61[3][1][1],&g_255,&g_61[3][1][1]},{&g_61[2][3][3],&g_255,&g_61[3][1][1],(void*)0}},{{&g_61[5][4][3],&g_255,&g_61[4][5][1],&g_25},{&g_255,(void*)0,&g_255,&g_25},{&g_61[4][5][1],&g_255,&g_61[5][4][3],(void*)0},{&g_61[2][3][3],&g_25,&g_255,&g_255},{&g_25,(void*)0,&g_255,&g_61[3][1][1]},{&g_61[2][3][3],&g_25,&g_61[5][4][3],&g_25},{&g_61[4][5][1],&g_25,&g_255,&g_25}},{{&g_255,&g_25,&g_61[4][5][1],&g_25},{&g_61[5][4][3],&g_25,&g_61[2][3][3],&g_61[3][1][1]},{&g_255,(void*)0,&g_25,&g_255},{&g_255,&g_25,&g_61[2][3][3],(void*)0},{&g_61[5][4][3],&g_255,&g_61[4][5][1],&g_25},{&g_255,(void*)0,&g_255,&g_25},{&g_61[4][5][1],&g_255,&g_61[5][4][3],(void*)0}},{{&g_61[2][3][3],&g_25,&g_255,&g_255},{&g_25,(void*)0,&g_255,&g_61[3][1][1]},{&g_61[2][3][3],&g_25,&g_61[5][4][3],&g_25},{&g_61[4][5][1],&g_25,&g_255,&g_25},{&g_255,&g_25,&g_61[4][5][1],&g_25},{&g_61[5][4][3],&g_25,&g_61[2][3][3],&g_61[3][1][1]},{&g_255,(void*)0,&g_25,&g_255}},{{&g_255,&g_25,&g_61[2][3][3],(void*)0},{&g_61[5][4][3],&g_255,&g_61[4][5][1],&g_25},{&g_255,(void*)0,&g_61[4][5][1],&g_255},{&g_61[3][1][1],&g_61[3][1][1],&g_25,&g_25},{&g_255,&g_61[3][1][1],&g_255,&g_61[3][1][1]},{&g_61[5][1][3],&g_25,&g_255,&g_255},{&g_255,(void*)0,&g_25,&g_61[3][1][1]}}}; + const union U2 *l_352 = &g_42; + uint16_t *l_377 = &g_165[1]; + uint16_t **l_376[4][4] = {{&l_377,(void*)0,&l_377,(void*)0},{&l_377,(void*)0,&l_377,(void*)0},{&l_377,(void*)0,&l_377,(void*)0},{&l_377,(void*)0,&l_377,(void*)0}}; + uint32_t l_393 = 4294967290UL; + const uint8_t *l_398 = &g_42.f2; + int8_t **l_401 = &g_69; + int8_t ***l_402 = &l_401; + const int32_t *l_403 = &g_61[3][1][1]; + int i, j, k; + for (p_18 = 25; (p_18 < 17); p_18 = safe_sub_func_uint32_t_u_u(p_18, 5)) + { /* block id: 200 */ + int32_t l_308 = 0xDC603431L; + int32_t l_309 = 0x1C33B4EEL; + union U1 *l_336 = &g_84; + int32_t l_388 = 4L; + uint8_t * const l_399 = &g_42.f2; + int8_t **l_400 = &g_69; + } + (*l_402) = l_401; + g_404 = (p_17.f1 , l_403); + return (*l_403); +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: g_25 + */ +static union U0 func_21(uint32_t p_22) +{ /* block id: 1 */ + int32_t *l_24 = &g_25; + union U0 l_26 = {-3L}; + (*l_24) = p_22; + return l_26; +} + + +/* ------------------------------------------ */ +/* + * reads : g_61 g_69 g_70 g_42.f3 g_42.f1 g_218 g_170 g_171 g_163.f1 g_95 g_34 g_163.f0 g_42 g_84 g_248 g_246 g_234 g_249 g_78 g_117 + * writes: g_70 g_78 g_34 g_163.f0 g_61 g_60 g_218 g_165 g_234 g_117 g_42.f1 + */ +static int8_t func_27(uint16_t p_28, int32_t * p_29, union U2 p_30, int32_t * const p_31, int32_t p_32) +{ /* block id: 106 */ + union U1 *l_177 = &g_84; + union U1 **l_176 = &l_177; + int32_t *l_178 = &g_61[3][1][1]; + int8_t *l_181[8] = {&g_163.f0,&g_163.f0,&g_163.f0,&g_163.f0,&g_163.f0,&g_163.f0,&g_163.f0,&g_163.f0}; + int32_t *l_182 = &g_61[3][1][1]; + union U2 l_252 = {8L}; + int32_t l_275 = 0x343AA78CL; + int32_t l_277 = 0xE7E876F0L; + int32_t l_289 = 0x3867B030L; + int32_t l_290 = 0x04B24578L; + int32_t l_291 = (-6L); + int32_t l_292 = 0xE153FDD8L; + int i; +lbl_256: + if (((+0x7E10L) ^ ((l_176 != (((*g_69) &= (*l_182)) , &l_177)) || (*l_178)))) + { /* block id: 108 */ + uint32_t l_193 = 18446744073709551606UL; + int32_t l_194 = 3L; + for (g_78 = 0; (g_78 <= (-16)); g_78 = safe_sub_func_int32_t_s_s(g_78, 2)) + { /* block id: 111 */ + int8_t l_192 = 0L; + for (g_34 = 0; (g_34 <= 7); g_34 += 1) + { /* block id: 114 */ + return (*l_178); + } + for (p_32 = 25; (p_32 == (-30)); p_32 = safe_sub_func_int32_t_s_s(p_32, 2)) + { /* block id: 119 */ + for (g_163.f0 = 0; (g_163.f0 != (-23)); g_163.f0 = safe_sub_func_int16_t_s_s(g_163.f0, 4)) + { /* block id: 122 */ + int8_t l_189 = (-3L); + for (g_34 = 0; (g_34 <= 3); g_34 += 1) + { /* block id: 125 */ + (*l_176) = &g_84; + } + if (l_189) + break; + } + if ((*l_178)) + break; + } + (*l_178) = (*p_31); + for (g_70 = 0; (g_70 < 3); ++g_70) + { /* block id: 135 */ + l_192 = 0x42813DB6L; + } + } + for (p_32 = 7; (p_32 >= 0); p_32 -= 1) + { /* block id: 141 */ + return p_30.f0; + } + l_194 = (~l_193); + return l_194; + } + else + { /* block id: 146 */ + int8_t l_197[10] = {1L,0x3CL,1L,(-1L),(-1L),1L,0x3CL,1L,(-1L),(-1L)}; + int32_t *l_198 = &g_61[3][1][1]; + union U0 l_199[1] = {{0xDFL}}; + int32_t *l_200 = (void*)0; + union U2 l_201[10] = {{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L},{0x8373BB44L}}; + uint16_t *l_224 = &g_34; + uint8_t *l_232 = (void*)0; + uint8_t ** const l_231 = &l_232; + union U1 l_240 = {0}; + int i; + if (((*l_178) = (safe_mul_func_uint16_t_u_u(((l_197[9] && func_50(l_198, (*l_182), (l_199[0] , p_30.f2), l_200, l_201[2])) >= (safe_mul_func_int8_t_s_s((*l_178), 0x2EL))), (*l_198))))) + { /* block id: 148 */ + return (*l_198); + } + else + { /* block id: 150 */ + uint8_t l_204 = 0xA3L; + uint32_t *l_217[3]; + union U2 l_223 = {0x3A80E33CL}; + uint16_t **l_225 = &l_224; + int i; + for (i = 0; i < 3; i++) + l_217[i] = &l_201[2].f1; +lbl_226: + l_204--; + if (g_42.f3) + goto lbl_256; + if (((*l_178) = (safe_sub_func_uint8_t_u_u((safe_add_func_uint16_t_u_u(g_42.f1, (g_165[6] = ((*l_198) >= ((safe_add_func_int32_t_s_s(0xBBEC7243L, (safe_lshift_func_int8_t_s_u(((((safe_mul_func_uint16_t_u_u(1UL, (*l_198))) < (++g_218)) && ((*g_170) ^ ((*g_69) = (safe_add_func_uint8_t_u_u(0UL, (l_223 , (((*l_225) = l_224) == &g_34))))))) == 0UL), (*g_170))))) , 0xACD3L))))), (*l_198))))) + { /* block id: 157 */ + return (*l_182); + } + else + { /* block id: 159 */ + int16_t *l_233 = &g_234; + int32_t l_235 = (-9L); + if (g_218) + goto lbl_226; + (*l_198) = (func_50(((*g_95) = l_217[0]), g_61[0][4][3], ((((safe_add_func_uint32_t_u_u(g_42.f3, (p_30 , (((*l_224) ^= (*l_182)) ^ g_163.f0)))) , (((*l_198) | ((((*l_233) = ((safe_add_func_uint16_t_u_u((((l_231 == &g_170) && 1L) != p_28), 0x6AFEL)) , p_30.f3)) , (*g_69)) > (*l_178))) ^ 0xE3L)) == (*g_69)) > l_235), l_178, g_42) , 0x23B8671DL); + } + } + for (g_117 = (-4); (g_117 <= 25); ++g_117) + { /* block id: 169 */ + int16_t *l_245 = &g_246; + int16_t **l_247[2]; + int32_t *l_250 = &g_61[3][1][1]; + int32_t l_253[6] = {0x4B38AC99L,0x4B38AC99L,0x12668D6FL,0x4B38AC99L,0x4B38AC99L,0x12668D6FL}; + int32_t *l_254 = &g_255; + int i; + for (i = 0; i < 2; i++) + l_247[i] = &l_245; + } + } + for (p_32 = 0; (p_32 > (-13)); p_32 = safe_sub_func_int32_t_s_s(p_32, 5)) + { /* block id: 181 */ + uint8_t l_264 = 0x45L; + int32_t l_272 = (-8L); + int32_t l_287[1][4] = {{0L,0L,0L,0L}}; + int16_t l_288 = (-1L); + uint32_t l_293 = 0xA6770327L; + int i, j; + for (p_28 = 1; (p_28 <= 7); p_28 += 1) + { /* block id: 184 */ + const union U1 *l_263[9] = {&g_84,&g_84,&g_84,&g_84,&g_84,&g_84,&g_84,&g_84,&g_84}; + int32_t l_265 = 0x3B5E6BF7L; + uint32_t *l_268 = &l_252.f1; + int16_t *l_271 = &g_234; + int32_t l_273 = 0x7167734CL; + int32_t *l_274 = (void*)0; + int32_t *l_276 = &g_255; + int32_t *l_278 = &l_273; + int32_t *l_279 = &g_255; + int32_t *l_280 = (void*)0; + int32_t *l_281 = &g_61[4][3][1]; + int32_t *l_282 = &l_275; + int32_t *l_283 = &l_265; + int32_t *l_284 = &l_275; + int32_t *l_285 = &l_277; + int32_t *l_286[9][2] = {{&l_275,&g_255},{&g_61[3][1][1],&g_61[3][1][1]},{&g_255,&l_275},{&g_61[4][1][1],&l_275},{&g_255,&g_61[3][1][1]},{&g_61[3][1][1],&g_255},{&l_275,&g_255},{&l_265,&l_275},{&g_255,&g_255}}; + int i, j; + l_273 |= ((p_32 ^ (p_32 != (safe_lshift_func_uint16_t_u_u(((safe_rshift_func_uint16_t_u_s((((void*)0 != l_263[4]) != ((*l_177) , (l_264 = ((g_42.f1 = p_28) | (*p_31))))), 14)) | l_265), ((safe_add_func_uint16_t_u_u(((++(*l_268)) , (((*l_271) ^= (*g_248)) <= l_272)), (*g_249))) || l_272))))) || 0x9B2CL); + if ((*l_182)) + continue; + l_293++; + (*l_182) |= l_272; + } + } + return (*l_182); +} + + +/* ------------------------------------------ */ +/* + * reads : g_117 g_163 g_61 g_69 g_70 g_42 g_42.f3 + * writes: g_170 g_61 g_60 + */ +static int32_t * func_37(const uint16_t p_38, union U2 p_39, int32_t * p_40, int32_t p_41) +{ /* block id: 101 */ + int32_t ***l_159 = &g_95; + int32_t l_160 = 0x1B0D62F1L; + uint16_t *l_164 = &g_165[4]; + const uint8_t *l_168 = &g_163.f1; + const uint8_t **l_169[5]; + const uint8_t l_172[4] = {0x82L,0x82L,0x82L,0x82L}; + int32_t *l_173 = &g_61[3][1][1]; + uint32_t l_174 = 18446744073709551614UL; + int i; + for (i = 0; i < 5; i++) + l_169[i] = &l_168; + (*l_173) = ((safe_div_func_uint8_t_u_u(p_39.f3, (safe_lshift_func_int16_t_s_u(g_117, ((((void*)0 != l_159) <= l_160) == (safe_lshift_func_int16_t_s_u((((g_163 , l_164) == &p_38) && (safe_lshift_func_uint16_t_u_s(((g_170 = l_168) != (void*)0), 0))), 6))))))) >= l_172[3]); + (*l_173) = ((*l_173) & ((func_50(p_40, ((*g_69) , l_174), (*g_69), &l_160, g_42) != (g_61[7][0][3] , p_39.f2)) <= 0xEEL)); + return p_40; +} + + +/* ------------------------------------------ */ +/* + * reads : g_69 g_70 g_61 g_60 g_42.f3 g_42.f2 g_78 g_94 g_23 g_117 g_95 + * writes: g_78 g_61 g_60 g_117 + */ +static int32_t * func_43(uint8_t p_44, int8_t p_45, int8_t * p_46) +{ /* block id: 15 */ + int32_t *l_71 = &g_61[3][1][1]; + int32_t *l_72 = (void*)0; + int32_t *l_73[9][8] = {{&g_61[3][1][1],(void*)0,(void*)0,&g_61[1][4][3],&g_61[0][3][1],&g_61[4][3][1],&g_61[6][4][2],&g_61[4][2][0]},{&g_61[2][4][2],(void*)0,(void*)0,&g_61[0][3][1],&g_61[0][3][1],(void*)0,(void*)0,&g_61[2][4][2]},{&g_61[3][1][1],&g_61[2][4][2],&g_61[3][1][2],&g_61[4][2][0],(void*)0,(void*)0,(void*)0,&g_61[1][2][0]},{(void*)0,(void*)0,(void*)0,(void*)0,&g_61[4][2][0],(void*)0,(void*)0,(void*)0},{&g_61[4][3][1],&g_61[2][4][2],&g_61[1][2][0],&g_61[3][0][0],&g_61[3][1][1],(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,&g_61[0][3][1],(void*)0,&g_61[4][3][1],&g_61[4][3][1],(void*)0,&g_61[0][3][1]},{(void*)0,(void*)0,&g_61[1][2][0],(void*)0,&g_61[1][4][3],&g_61[3][1][2],(void*)0,(void*)0},{&g_61[1][4][3],&g_61[3][1][2],(void*)0,(void*)0,(void*)0,&g_61[0][3][1],(void*)0,(void*)0},{&g_61[3][1][2],&g_61[1][2][0],&g_61[3][1][2],(void*)0,&g_61[6][4][2],(void*)0,(void*)0,&g_61[0][3][1]}}; + uint32_t l_74 = 0xFA7F9CD9L; + int32_t *l_77 = &g_78; + int32_t l_79 = 1L; + union U1 *l_86[5]; + int32_t ***l_96 = &g_95; + int8_t l_106 = 8L; + int8_t l_119[6] = {9L,0L,9L,9L,0L,9L}; + union U2 l_120 = {-5L}; + int32_t *l_134 = &g_61[3][1][1]; + int i, j; + for (i = 0; i < 5; i++) + l_86[i] = &g_84; +lbl_87: + l_74--; + l_79 ^= (((*l_77) = ((*g_69) || ((*l_71) < 0x14A1L))) , (*g_60)); + if ((g_42.f3 <= (1UL & (0xF049L <= g_42.f2)))) + { /* block id: 19 */ + union U1 *l_83 = &g_84; + int32_t l_90 = 0L; + for (p_45 = 0; (p_45 < (-22)); p_45--) + { /* block id: 22 */ + int32_t *l_88 = &g_61[3][1][1]; + for (l_79 = 6; (l_79 >= 0); l_79 -= 1) + { /* block id: 25 */ + int i, j; + l_73[(l_79 + 1)][l_79] = l_73[l_79][(l_79 + 1)]; + if (p_45) + { /* block id: 27 */ + const int16_t l_82 = (-10L); + for (g_78 = 7; (g_78 >= 0); g_78 -= 1) + { /* block id: 30 */ + union U1 **l_85[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; + int i; + (*g_60) = l_82; + l_86[4] = ((p_45 <= g_70) , l_83); + } + if (g_42.f3) + goto lbl_87; + return l_88; + } + else + { /* block id: 36 */ + int32_t l_89 = 1L; + int i, j; + l_73[(l_79 + 1)][(l_79 + 1)] = (l_89 , l_73[l_79][(l_79 + 1)]); + if (p_44) + break; + } + } + if (l_90) + break; + (*l_71) |= (safe_lshift_func_int8_t_s_s(l_90, 2)); + } + } + else + { /* block id: 44 */ + int32_t l_93 = 0x63BE35A8L; + int32_t l_98 = (-9L); + int32_t l_99 = 0xE0221BC3L; + int32_t l_100 = 0xE0F627EEL; + int32_t l_103 = 7L; + int32_t l_104 = 0xBAAC5CA8L; + int32_t l_105 = 0xA126CF24L; + union U2 l_115 = {4L}; + int32_t *l_128 = &l_93; + int32_t *l_133 = &l_100; + if ((((l_93 , g_94[0]) != l_96) <= 5L)) + { /* block id: 45 */ + int32_t l_97 = 0xA0849DA6L; + int32_t l_101 = 1L; + int32_t l_102[5] = {(-1L),(-1L),(-1L),(-1L),(-1L)}; + uint8_t l_107 = 8UL; + int32_t *l_112 = &l_99; + uint8_t *l_116[10][4][4] = {{{&l_107,&l_107,&g_23,&l_115.f2},{&g_42.f2,&g_23,(void*)0,&l_107},{&g_42.f2,(void*)0,&g_23,&g_42.f2},{&l_107,&l_115.f2,(void*)0,&l_115.f2}},{{(void*)0,&l_115.f2,(void*)0,&g_42.f2},{&l_107,(void*)0,(void*)0,&l_107},{&l_107,&g_23,(void*)0,&l_115.f2},{&l_107,&l_107,(void*)0,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0},{&l_107,&l_107,&g_23,&l_115.f2},{&g_42.f2,&g_23,(void*)0,&l_107},{&g_42.f2,(void*)0,&g_23,&g_42.f2}},{{&l_107,&l_115.f2,(void*)0,&l_115.f2},{(void*)0,&l_115.f2,(void*)0,&g_42.f2},{&l_107,(void*)0,(void*)0,&l_107},{&l_107,&g_23,(void*)0,&l_115.f2}},{{&l_107,&l_107,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_107,&l_107,&g_23,&l_115.f2},{&g_42.f2,&g_23,(void*)0,&l_107}},{{&g_42.f2,(void*)0,&g_23,&g_42.f2},{&l_107,&l_115.f2,(void*)0,&l_115.f2},{(void*)0,&l_115.f2,(void*)0,&g_42.f2},{&l_107,(void*)0,(void*)0,&g_42.f2}},{{&l_115.f2,&l_107,(void*)0,&g_23},{&g_42.f2,&l_115.f2,&l_107,&l_107},{&l_107,(void*)0,&g_23,&l_107},{&l_115.f2,&l_115.f2,(void*)0,&g_23}},{{(void*)0,&l_107,&l_107,&g_42.f2},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_115.f2,&g_23,&g_23,&g_23},{&l_107,&g_23,&l_107,(void*)0}},{{&g_42.f2,(void*)0,(void*)0,&g_42.f2},{&l_115.f2,&l_107,(void*)0,&g_23},{&g_42.f2,&l_115.f2,&l_107,&l_107},{&l_107,(void*)0,&g_23,&l_107}},{{&l_115.f2,&l_115.f2,(void*)0,&g_23},{(void*)0,&l_107,&l_107,&g_42.f2},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_115.f2,&g_23,&g_23,&g_23}}}; + int8_t *l_118 = &l_106; + union U2 l_121 = {0xF3683EEDL}; + uint32_t l_123 = 0x382ABCCDL; + int32_t *l_131 = &l_104; + int i, j, k; + l_107--; + l_101 &= ((safe_mod_func_int8_t_s_s((*p_46), (-1L))) == func_50(l_112, l_99, (safe_sub_func_int16_t_s_s(((0xD7L ^ (func_50(&l_99, g_42.f3, (((*l_118) = ((((g_117 |= (func_50(&l_102[2], (g_78 , g_23), (*g_69), &l_100, l_115) > g_42.f2)) , p_45) || 0x8DL) <= (-1L))) , l_119[2]), &l_101, l_120) , l_115.f2)) && 65535UL), 0x1D2AL)), &l_93, l_121)); + if (p_44) + { /* block id: 50 */ + int8_t l_122 = 1L; + union U2 *l_127[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + union U2 **l_126 = &l_127[3]; + int32_t *l_129 = &l_102[2]; + int32_t *l_130 = &l_104; + int32_t *l_132 = &l_101; + int i; + l_123--; + (*l_126) = &g_42; + return l_134; + } + else + { /* block id: 54 */ + uint16_t l_135 = 65535UL; + int32_t l_138 = (-1L); + if ((0L == 1L)) + { /* block id: 55 */ + for (l_98 = 5; (l_98 >= 1); l_98 -= 1) + { /* block id: 58 */ + int i; + if (l_119[l_98]) + break; + } + ++l_135; + } + else + { /* block id: 62 */ + int8_t l_142[10][6][4] = {{{0x71L,(-2L),0xA5L,0x84L},{(-9L),(-2L),0x0DL,1L},{0x80L,0L,0x3EL,5L},{0x71L,1L,9L,1L},{0x97L,(-4L),0x4CL,0x5CL},{0x45L,0x38L,0x71L,0xF5L}},{{0xA5L,0xA5L,1L,1L},{0L,0L,0x97L,(-1L)},{0x85L,0xBBL,0xE4L,0x3EL},{6L,0L,1L,0xE4L},{(-8L),0L,5L,0x3EL},{0L,0xBBL,(-1L),(-1L)}},{{0x4CL,0L,(-1L),1L},{0x84L,0xA5L,(-2L),0x71L},{(-1L),0x6FL,6L,8L},{1L,0x9DL,0x83L,0xFBL},{0L,0xDAL,(-2L),0L},{0x85L,0xF9L,1L,0xDAL}},{{0x18L,7L,0x4CL,0x83L},{0x78L,0x16L,(-2L),0x3EL},{0L,0x6DL,0x72L,0L},{1L,1L,(-1L),(-1L)},{0L,0x97L,(-2L),(-8L)},{0xA4L,(-1L),0x18L,0xA4L}},{{0x4CL,0xA5L,0x25L,0x97L},{1L,0xDAL,5L,0x31L},{9L,1L,0x83L,0x38L},{6L,0x84L,0x0DL,0x97L},{0x78L,1L,0x97L,0xDAL},{7L,(-1L),0x6FL,(-1L)}},{{0x1CL,(-8L),0x34L,0xB9L},{0x3EL,0x16L,1L,0x16L},{7L,0x34L,(-1L),0x31L},{0x8BL,(-1L),0x6FL,(-1L)},{(-1L),0x9DL,(-3L),1L},{(-1L),0L,0x6FL,0x78L}},{{0x8BL,1L,(-1L),9L},{7L,0L,1L,0x71L},{0x3EL,0x0DL,0x34L,0x85L},{1L,8L,0x0DL,0x6DL},{0x3EL,1L,(-7L),7L},{0x84L,1L,0x8BL,0x31L}},{{(-1L),0x16L,(-1L),0xBBL},{0L,0x97L,0x15L,0x38L},{0x97L,1L,0x6FL,0L},{0xE4L,0x3EL,0L,0x6DL},{0L,0x38L,0x5CL,0x78L},{0L,0x0DL,0L,0x03L}},{{0L,0x39L,0x18L,9L},{0x3EL,0L,(-9L),0xF8L},{0x84L,0L,0xE4L,0L},{0L,1L,0x6DL,(-1L)},{0xA4L,(-8L),(-9L),0x38L},{0xA5L,0x34L,(-1L),0x97L}},{{0x15L,1L,(-7L),0x1CL},{0L,(-1L),9L,0L},{(-1L),0x80L,0x80L,(-1L)},{1L,0x4CL,0x0BL,(-4L)},{1L,0L,0x85L,0xE4L},{(-1L),0x4FL,0x15L,0xE4L}}}; + int i, j, k; + if (((*g_60) = (**g_95))) + { /* block id: 64 */ + (*l_134) = (p_44 , func_50((**l_96), (*l_133), l_135, (**l_96), l_120)); + l_138 = ((l_133 != (void*)0) & p_45); + } + else + { /* block id: 67 */ + int32_t *l_141[6] = {&l_102[1],&l_102[1],&l_102[1],&l_102[1],&l_102[1],&l_102[1]}; + int i; + (*l_131) &= (*l_134); + (***l_96) = ((safe_rshift_func_uint8_t_u_s((p_44 = (((void*)0 == l_141[2]) , (l_142[0][3][1] = (*l_112)))), (*g_69))) || (-8L)); + (*l_134) |= p_44; + } + } + for (l_107 = 0; (l_107 <= 37); l_107++) + { /* block id: 77 */ + (**g_95) = (((p_44++) , (&g_95 == (void*)0)) & (*g_69)); + for (l_93 = 0; l_93 < 6; l_93 += 1) + { + l_119[l_93] = 0xC6L; + } + } + for (l_100 = 4; (l_100 >= 0); l_100 -= 1) + { /* block id: 84 */ + int32_t *l_147 = &l_104; + int32_t *l_148 = (void*)0; + return l_148; + } + (*g_95) = (**l_96); + } + for (g_117 = 0; (g_117 != (-14)); g_117--) + { /* block id: 91 */ + uint32_t l_151 = 0x6CEBD2D5L; + int32_t l_154 = 0x9DA40672L; + ++l_151; + l_154 = (p_45 >= (*l_133)); + } + } + else + { /* block id: 95 */ + return (*g_95); + } + } + (*l_71) |= (-1L); + return l_73[2][6]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_42.f3 + * writes: g_60 + */ +static uint16_t func_50(int32_t * p_51, uint16_t p_52, int8_t p_53, int32_t * p_54, union U2 p_55) +{ /* block id: 8 */ + for (p_53 = 0; (p_53 < (-11)); p_53 = safe_sub_func_uint8_t_u_u(p_53, 9)) + { /* block id: 11 */ + int32_t **l_67 = (void*)0; + int32_t **l_68 = &g_60; + (*l_68) = p_54; + } + return g_42.f3; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int32_t * func_56(int8_t * p_57, int32_t * p_58) +{ /* block id: 5 */ + int32_t **l_62 = (void*)0; + int32_t ***l_63 = &l_62; + (*l_63) = l_62; + return p_58; +} + + + + +/* ---------------------------------------- */ +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_23, "g_23", print_hash_value); + transparent_crc(g_25, "g_25", print_hash_value); + transparent_crc(g_34, "g_34", print_hash_value); + transparent_crc(g_42.f2, "g_42.f2", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 6; j++) + { + for (k = 0; k < 4; k++) + { + transparent_crc(g_61[i][j][k], "g_61[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_70, "g_70", print_hash_value); + transparent_crc(g_78, "g_78", print_hash_value); + transparent_crc(g_117, "g_117", print_hash_value); + transparent_crc(g_163.f0, "g_163.f0", print_hash_value); + transparent_crc(g_163.f1, "g_163.f1", print_hash_value); + for (i = 0; i < 7; i++) + { + transparent_crc(g_165[i], "g_165[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 4; i++) + { + for (j = 0; j < 8; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_171[i][j][k], "g_171[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_218, "g_218", print_hash_value); + transparent_crc(g_234, "g_234", print_hash_value); + transparent_crc(g_246, "g_246", print_hash_value); + transparent_crc(g_255, "g_255", print_hash_value); + transparent_crc(g_380, "g_380", print_hash_value); + transparent_crc(g_387, "g_387", print_hash_value); + for (i = 0; i < 4; i++) + { + for (j = 0; j < 1; j++) + { + transparent_crc(g_405[i][j].f0, "g_405[i][j].f0", print_hash_value); + transparent_crc(g_405[i][j].f1, "g_405[i][j].f1", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_471, "g_471", print_hash_value); + transparent_crc(g_555, "g_555", print_hash_value); + for (i = 0; i < 9; i++) + { + transparent_crc(g_556[i], "g_556[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 0 +breakdown: + depth: 0, occurrence: 231 +XXX total union variables: 28 + +XXX non-zero bitfields defined in structs: 0 +XXX zero bitfields defined in structs: 0 +XXX const bitfields defined in structs: 0 +XXX volatile bitfields defined in structs: 0 +XXX structs with bitfields in the program: 0 +breakdown: +XXX full-bitfields structs in the program: 0 +breakdown: +XXX times a bitfields struct's address is taken: 0 +XXX times a bitfields struct on LHS: 0 +XXX times a bitfields struct on RHS: 0 +XXX times a single bitfield on LHS: 0 +XXX times a single bitfield on RHS: 0 + +XXX max expression depth: 45 +breakdown: + depth: 1, occurrence: 161 + depth: 2, occurrence: 47 + depth: 3, occurrence: 4 + depth: 4, occurrence: 3 + depth: 5, occurrence: 2 + depth: 6, occurrence: 1 + depth: 7, occurrence: 2 + depth: 10, occurrence: 2 + depth: 11, occurrence: 1 + depth: 12, occurrence: 1 + depth: 14, occurrence: 2 + depth: 15, occurrence: 1 + depth: 16, occurrence: 2 + depth: 17, occurrence: 1 + depth: 18, occurrence: 1 + depth: 19, occurrence: 1 + depth: 20, occurrence: 1 + depth: 25, occurrence: 1 + depth: 27, occurrence: 1 + depth: 28, occurrence: 1 + depth: 30, occurrence: 1 + depth: 34, occurrence: 1 + depth: 45, occurrence: 1 + +XXX total number of pointers: 222 + +XXX times a variable address is taken: 413 +XXX times a pointer is dereferenced on RHS: 116 +breakdown: + depth: 1, occurrence: 105 + depth: 2, occurrence: 10 + depth: 3, occurrence: 1 +XXX times a pointer is dereferenced on LHS: 91 +breakdown: + depth: 1, occurrence: 89 + depth: 2, occurrence: 1 + depth: 3, occurrence: 1 +XXX times a pointer is compared with null: 9 +XXX times a pointer is compared with address of another variable: 1 +XXX times a pointer is compared with another pointer: 3 +XXX times a pointer is qualified to be dereferenced: 2461 + +XXX max dereference level: 3 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 541 + level: 2, occurrence: 44 + level: 3, occurrence: 6 +XXX number of pointers point to pointers: 37 +XXX number of pointers point to scalars: 174 +XXX number of pointers point to structs: 0 +XXX percent of pointers has null in alias set: 30.2 +XXX average alias set size: 1.65 + +XXX times a non-volatile is read: 686 +XXX times a non-volatile is write: 318 +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: 1 +XXX backward jumps: 2 + +XXX stmts: 167 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 32 + depth: 1, occurrence: 19 + depth: 2, occurrence: 34 + depth: 3, occurrence: 34 + depth: 4, occurrence: 23 + depth: 5, occurrence: 25 + +XXX percentage a fresh-made variable is used: 17.7 +XXX percentage an existing variable is used: 82.3 +********************* end of statistics **********************/ + diff --git a/tests/fuzz/3.c.txt b/tests/fuzz/3.c.txt new file mode 100644 index 00000000..ab401bb1 --- /dev/null +++ b/tests/fuzz/3.c.txt @@ -0,0 +1 @@ +checksum = EE4B2FFC diff --git a/tests/fuzz/csmith_driver.py b/tests/fuzz/csmith_driver.py index 1cb85451..404324a2 100755 --- a/tests/fuzz/csmith_driver.py +++ b/tests/fuzz/csmith_driver.py @@ -4,7 +4,7 @@ Runs csmith, a C fuzzer, and looks for bugs ''' -import os, sys, difflib +import os, sys, difflib, shutil from subprocess import Popen, PIPE, STDOUT sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'tools')] @@ -30,15 +30,22 @@ while 1: print 'Tried %d, notes: %s' % (tried, notes) tried += 1 print '1) Generate C' - shared.execute([CSMITH, '--no-volatiles', '--no-math64'], stdout=open(filename + '.c', 'w')) + shared.execute([CSMITH, '--no-volatiles', '--no-math64', '--no-packed-struct'] + + ['--max-block-depth', '2', '--max-block-size', '2', '--max-expr-complexity', '2', '--max-funcs', '2'], + stdout=open(filename + '.c', 'w')) print '2) Compile natively' shared.try_delete(filename) - shared.execute([shared.CLANG_CC, '-O2', filename + '.c', '-o', filename] + CSMITH_CFLAGS, stderr=PIPE) - assert os.path.exists(filename) + shared.execute([shared.CLANG_CC, '-O2', filename + '.c', '-o', filename + '1'] + CSMITH_CFLAGS, stderr=PIPE) # + shared.EMSDK_OPTS + shared.execute([shared.CLANG_CC, '-O2', '-emit-llvm', '-c', '-Xclang', '-triple=i386-pc-linux-gnu', filename + '.c', '-o', filename + '.bc'] + CSMITH_CFLAGS + shared.EMSDK_OPTS, stderr=PIPE) + shared.execute([shared.path_from_root('tools', 'nativize_llvm.py'), filename + '.bc'], stdout=PIPE, stderr=PIPE) + shutil.move(filename + '.bc.run', filename + '2') print '3) Run natively' try: - correct = shared.timeout_run(Popen([filename], stdout=PIPE, stderr=PIPE), 3) + correct1 = shared.timeout_run(Popen([filename + '1'], stdout=PIPE, stderr=PIPE), 3) + if 'Segmentation fault' in correct1 or len(correct1) < 10: raise Exception('segfault') + correct2 = shared.timeout_run(Popen([filename + '2'], stdout=PIPE, stderr=PIPE), 3) + if 'Segmentation fault' in correct2 or len(correct2) < 10: raise Exception('segfault') except Exception, e: print 'Failed or infinite looping in native, skipping', e notes['invalid'] += 1 @@ -48,10 +55,12 @@ while 1: def try_js(args): shared.try_delete(filename + '.js') - shared.execute([shared.EMCC, '-O2', '-s', 'ASM_JS=1', '-s', 'PRECISE_I64_MATH=1', '-s', 'PRECISE_I32_MUL=1', filename + '.c', '-o', filename + '.js'] + CSMITH_CFLAGS + args, stderr=PIPE) + print '(compile)' + shared.execute([shared.EMCC, '-O2', '-s', 'ASM_JS=1', filename + '.c', '-o', filename + '.js'] + CSMITH_CFLAGS + args, stderr=PIPE) assert os.path.exists(filename + '.js') + print '(run)' js = shared.run_js(filename + '.js', stderr=PIPE, engine=engine1, check_timeout=True) - assert correct == js, ''.join([a.rstrip()+'\n' for a in difflib.unified_diff(correct.split('\n'), js.split('\n'), fromfile='expected', tofile='actual')]) + assert correct1 == js or correct2 == js, ''.join([a.rstrip()+'\n' for a in difflib.unified_diff(correct1.split('\n'), js.split('\n'), fromfile='expected', tofile='actual')]) # Try normally, then try unaligned because csmith does generate nonportable code that requires x86 alignment ok = False @@ -69,7 +78,7 @@ while 1: if not ok: print "EMSCRIPTEN BUG" notes['embug'] += 1 - continue #break + break #if not ok: # try: # finally, try with safe heap. if that is triggered, this is nonportable code almost certainly # try_js(['-s', 'SAFE_HEAP=1']) @@ -94,7 +103,6 @@ while 1: assert 'warning: Successfully compiled asm.js code' in js2, 'must validate' js2 = js2.replace('\nwarning: Successfully compiled asm.js code\n', '') - assert js2 == correct, ''.join([a.rstrip()+'\n' for a in difflib.unified_diff(correct.split('\n'), js2.split('\n'), fromfile='expected', tofile='actual')]) + 'ODIN FAIL' + assert js2 == correct1 or js2 == correct2, ''.join([a.rstrip()+'\n' for a in difflib.unified_diff(correct1.split('\n'), js2.split('\n'), fromfile='expected', tofile='actual')]) + 'ODIN FAIL' print 'odin ok' - diff --git a/tests/glbook/Chapter_13/ParticleSystem/ParticleSystem_orig.c b/tests/glbook/Chapter_13/ParticleSystem/ParticleSystem_orig.c index 378d05a7..02fddd9c 100644 --- a/tests/glbook/Chapter_13/ParticleSystem/ParticleSystem_orig.c +++ b/tests/glbook/Chapter_13/ParticleSystem/ParticleSystem_orig.c @@ -17,9 +17,16 @@ #include <math.h>
#include "esUtil.h"
-#define NUM_PARTICLES 1000
+#define NUM_PARTICLES 2000
#define PARTICLE_SIZE 7
+int randomTemp = 8765;
+float myrandom() {
+ int curr = randomTemp;
+ randomTemp = (1140671485 * randomTemp + 12820163) % 4294967296;
+ return ((float)curr) / 4294967296;
+}
+
typedef struct
{
// Handle to a program object
@@ -145,17 +152,17 @@ int Init ( ESContext *esContext ) float *particleData = &userData->particleData[i * PARTICLE_SIZE];
// Lifetime of particle
- (*particleData++) = ( (float)(rand() % 10000) / 10000.0f );
+ (*particleData++) = myrandom();
// End position of particle
- (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
- (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
- (*particleData++) = ( (float)(rand() % 10000) / 5000.0f ) - 1.0f;
+ (*particleData++) = myrandom() * 2 - 1.0f;
+ (*particleData++) = myrandom() * 2 - 1.0f;
+ (*particleData++) = myrandom() * 2 - 1.0f;
// Start position of particle
- (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
- (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
- (*particleData++) = ( (float)(rand() % 10000) / 40000.0f ) - 0.125f;
+ (*particleData++) = myrandom() * 0.25 - 0.125f;
+ (*particleData++) = myrandom() * 0.25 - 0.125f;
+ (*particleData++) = myrandom() * 0.25 - 0.125f;
}
@@ -188,17 +195,17 @@ void Update ( ESContext *esContext, float deltaTime ) userData->time = 0.0f;
// Pick a new start location and color
- centerPos[0] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
- centerPos[1] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
- centerPos[2] = ( (float)(rand() % 10000) / 10000.0f ) - 0.5f;
+ centerPos[0] = myrandom() - 0.5f;
+ centerPos[1] = myrandom() - 0.5f;
+ centerPos[2] = myrandom() - 0.5f;
glUniform3fv ( userData->centerPositionLoc, 1, ¢erPos[0] );
// Random color
- color[0] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
- color[1] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
- color[2] = ( (float)(rand() % 10000) / 20000.0f ) + 0.5f;
- color[3] = 0.5;
+ color[0] = myrandom() * 0.5 + 0.5f;
+ color[1] = myrandom() * 0.5 + 0.5f;
+ color[2] = myrandom() * 0.5 + 0.5f;
+ color[3] = 1.0;
glUniform4fv ( userData->colorLoc, 1, &color[0] );
}
@@ -252,6 +259,8 @@ void Draw ( ESContext *esContext ) // Set the sampler texture unit to 0
glUniform1i ( userData->samplerLoc, 0 );
+ Update ( esContext, 133 * 0.001125 );
+
glDrawArrays( GL_POINTS, 0, NUM_PARTICLES );
eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
@@ -280,15 +289,18 @@ int main ( int argc, char *argv[] ) esInitContext ( &esContext );
esContext.userData = &userData;
- esCreateWindow ( &esContext, "ParticleSystem", 640, 480, ES_WINDOW_RGB );
+ esCreateWindow ( &esContext, "ParticleSystem", 320, 240, ES_WINDOW_RGB );
if ( !Init ( &esContext ) )
return 0;
esRegisterDrawFunc ( &esContext, Draw );
- esRegisterUpdateFunc ( &esContext, Update );
+ //esRegisterUpdateFunc ( &esContext, Update );
- esMainLoop ( &esContext );
+ Draw (&esContext);
+ Draw (&esContext);
+
+ //esMainLoop ( &esContext );
ShutDown ( &esContext );
}
diff --git a/tests/glbook/Chapter_2/Hello_Triangle/Hello_Triangle_orig.c b/tests/glbook/Chapter_2/Hello_Triangle/Hello_Triangle_orig.c index fd4c506a..cc25a559 100644 --- a/tests/glbook/Chapter_2/Hello_Triangle/Hello_Triangle_orig.c +++ b/tests/glbook/Chapter_2/Hello_Triangle/Hello_Triangle_orig.c @@ -171,7 +171,7 @@ void Draw ( ESContext *esContext ) glVertexAttribPointer ( 0, 3, GL_FLOAT, GL_FALSE, 0, vVertices ); glEnableVertexAttribArray ( 0 ); - glDrawArrays ( GL_TRIANGLES, 0, 3 ); + glDrawArrays ( GL_TRIANGLES, 0, 3 ); // TODO: need glDrawElements! } int main ( int argc, char *argv[] ) diff --git a/tests/glbook/Chapter_9/TextureWrap/TextureWrap_orig.c b/tests/glbook/Chapter_9/TextureWrap/TextureWrap_orig.c index fe22282f..e3531f04 100644 --- a/tests/glbook/Chapter_9/TextureWrap/TextureWrap_orig.c +++ b/tests/glbook/Chapter_9/TextureWrap/TextureWrap_orig.c @@ -243,7 +243,7 @@ int main ( int argc, char *argv[] ) esInitContext ( &esContext ); esContext.userData = &userData; - esCreateWindow ( &esContext, "MipMap 2D", 640, 480, ES_WINDOW_RGB ); + esCreateWindow ( &esContext, "MipMap 2D", 320, 240, ES_WINDOW_RGB ); if ( !Init ( &esContext ) ) return 0; diff --git a/tests/runner.py b/tests/runner.py index 342fdb9e..8b6e54af 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -1820,6 +1820,8 @@ Succeeded! generated = open('src.cpp.o.js', 'r').read() def test_stack(self): + Settings.INLINING_LIMIT = 50 + src = ''' #include <stdio.h> int test(int i) { @@ -2470,12 +2472,15 @@ Exception execution path of first function! 1 ''' Settings.DISABLE_EXCEPTION_CATCHING = 0 + if '-O2' in self.emcc_args: + self.emcc_args.pop() ; self.emcc_args.pop() # disable closure to work around a closure bug self.do_run(src, 'Throw...Construct...Catched...Destruct...Throw...Construct...Copy...Catched...Destruct...Destruct...') def test_white_list_exception(self): if Settings.ASM_JS: return self.skip('no exceptions support in asm') Settings.DISABLE_EXCEPTION_CATCHING = 2 Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"] + Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified src = ''' #include <stdio.h> @@ -2508,8 +2513,6 @@ Exception execution path of first function! 1 def test_uncaught_exception(self): if Settings.ASM_JS: return self.skip('no exceptions support in asm') if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc') - if '-O2' in self.emcc_args: - self.emcc_args += ['--closure', '1'] # Use closure here for some additional coverage Settings.DISABLE_EXCEPTION_CATCHING = 0 @@ -2622,6 +2625,7 @@ Exiting setjmp function, level: 0, prev_jmp: -1 if self.emcc_args is None: return self.skip('requires emcc') if Settings.ASM_JS: return self.skip('uses report_stack without exporting') + Settings.INLINING_LIMIT = 50 Settings.CATCH_EXIT_CODE = 1 src = r''' @@ -3069,6 +3073,8 @@ Exiting setjmp function, level: 0, prev_jmp: -1 def test_stack_varargs(self): if self.emcc_args is None: return # too slow in other modes + Settings.INLINING_LIMIT = 50 + # We should not blow up the stack with numerous varargs src = r''' #include <stdio.h> @@ -3089,6 +3095,8 @@ Exiting setjmp function, level: 0, prev_jmp: -1 self.do_run(src, 'ok!') def test_stack_void(self): + Settings.INLINING_LIMIT = 50 + src = r''' #include <stdio.h> @@ -4040,7 +4048,6 @@ The current type of b is: 9 self.do_run(src, 'time: ') # compilation check, mainly def test_intentional_fault(self): - if Settings.ASM_JS: return self.skip('no throw support in asm') # Some programs intentionally segfault themselves, we should compile that into a throw src = r''' int main () { @@ -4048,7 +4055,7 @@ The current type of b is: 9 return 0; } ''' - self.do_run(src, 'fault on write to 0') + self.do_run(src, 'fault on write to 0' if not Settings.ASM_JS else 'Assertion: 0') def test_trickystring(self): src = r''' @@ -6968,6 +6975,7 @@ def process(filename): # gcc -O3 -I/home/alon/Dev/emscripten/tests/sqlite -ldl src.c if self.emcc_args is None: return self.skip('Very slow without ta2, and we would also need to include dlmalloc manually without emcc') if Settings.QUANTUM_SIZE == 1: return self.skip('TODO FIXME') + self.banned_js_engines = [NODE_JS] # OOM in older node Settings.CORRECT_SIGNS = 1 Settings.CORRECT_OVERFLOWS = 0 @@ -7013,7 +7021,8 @@ def process(filename): self.do_run(open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(), [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings - open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read()], + open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(), + open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()], libraries=self.get_library('bullet', [os.path.join('src', '.libs', 'libBulletDynamics.a'), os.path.join('src', '.libs', 'libBulletCollision.a'), os.path.join('src', '.libs', 'libLinearMath.a')], @@ -7261,10 +7270,18 @@ def process(filename): Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('tests', 'fuzz')] - for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')): - print name - self.do_run(open(path_from_root('tests', 'fuzz', name)).read(), - open(path_from_root('tests', 'fuzz', name + '.txt')).read(), force_c=True) + def run_all(x): + print x + for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')): + print name + self.do_run(open(path_from_root('tests', 'fuzz', name)).read(), + open(path_from_root('tests', 'fuzz', name + '.txt')).read(), force_c=True) + + run_all('normal') + + self.emcc_args += ['--llvm-lto', '1'] + + run_all('lto') # Autodebug the code def do_autodebug(self, filename): @@ -8537,12 +8554,13 @@ Options that are modified or new in %s include: assert re.search('HEAP8\[\$?\w+ \+ \(+\$?\w+ ', generated) or re.search('HEAP8\[HEAP32\[', generated), 'eliminator should create compound expressions, and fewer one-time vars' # also in -O1, but easier to test in -O2 assert ('_puts(' in generated) == (opt_level >= 1), 'with opt >= 1, llvm opts are run and they should optimize printf to puts' assert 'function _main() {' in generated, 'Should be unminified, including whitespace' - assert ('-O3' in (params+(bc_params or []))) or'function _dump' in generated, 'No inlining by default' # emcc -s RELOOP=1 src.cpp ==> should pass -s to emscripten.py. --typed-arrays is a convenient alias for -s USE_TYPED_ARRAYS for params, test, text in [ + (['-s', 'ASM_JS=1', '-O2'], lambda generated: 'var i1 = 0' in generated, 'registerize is run by default in -O2'), + (['-s', 'ASM_JS=1', '-O2', '-g'], lambda generated: 'var i1 = 0' not in generated, 'registerize is cancelled by -g'), (['-s', 'INLINING_LIMIT=0'], lambda generated: 'function _dump' in generated, 'no inlining without opts'), - (['-O1', '-s', 'INLINING_LIMIT=0'], lambda generated: 'function _dump' not in generated, 'inlining'), + (['-O3', '-s', 'INLINING_LIMIT=0', '--closure', '0'], lambda generated: 'function _dump' not in generated, 'lto/inlining'), (['-s', 'USE_TYPED_ARRAYS=0'], lambda generated: 'new Int32Array' not in generated, 'disable typed arrays'), (['-s', 'USE_TYPED_ARRAYS=1'], lambda generated: 'IHEAPU = ' in generated, 'typed arrays 1 selected'), ([], lambda generated: 'Module["_dump"]' not in generated, 'dump is not exported by default'), @@ -8672,7 +8690,7 @@ f.close() # Run through node, if CMake produced a .js file. if cmake_outputs[i].endswith('.js'): - ret = Popen([NODE_JS, tempdirname + '/' + cmake_outputs[i]], stdout=PIPE).communicate()[0] + ret = Popen(listify(NODE_JS) + [tempdirname + '/' + cmake_outputs[i]], stdout=PIPE).communicate()[0] assert 'hello, world!' in ret, 'Running cmake-based .js application failed!' finally: os.chdir(path_from_root('tests')) # Move away from the directory we are about to remove. @@ -9479,7 +9497,7 @@ f.close() (path_from_root('tools', 'test-js-optimizer-asm-last.js'), open(path_from_root('tools', 'test-js-optimizer-asm-last-output.js')).read(), ['asm', 'last']), ]: - output = Popen([NODE_JS, path_from_root('tools', 'js-optimizer.js'), input] + passes, stdin=PIPE, stdout=PIPE).communicate()[0] + output = Popen(listify(NODE_JS) + [path_from_root('tools', 'js-optimizer.js'), input] + passes, stdin=PIPE, stdout=PIPE).communicate()[0] self.assertIdentical(expected, output.replace('\r\n', '\n').replace('\n\n', '\n')) def test_m_mm(self): @@ -9495,8 +9513,8 @@ f.close() try: os.environ['EMCC_DEBUG'] = '1' for asm, linkable, chunks, js_chunks in [ - (0, 0, 2, 2), (0, 1, 4, 4), - (1, 0, 2, 2), (1, 1, 4, 5) + (0, 0, 3, 2), (0, 1, 4, 4), + (1, 0, 3, 2), (1, 1, 4, 5) ]: print asm, linkable, chunks, js_chunks output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm], stdout=PIPE, stderr=PIPE).communicate() @@ -9675,6 +9693,64 @@ seeked= file. code = open('a.out.js').read() assert 'SAFE_HEAP' in code, 'valid -s option had an effect' + def test_optimize_normally(self): + assert not os.environ.get('EMCC_OPTIMIZE_NORMALLY') + assert not os.environ.get('EMCC_DEBUG') + + for optimize_normally in [0, 1]: + print optimize_normally + try: + if optimize_normally: os.environ['EMCC_OPTIMIZE_NORMALLY'] = '1' + os.environ['EMCC_DEBUG'] = '1' + + open(self.in_dir('main.cpp'), 'w').write(r''' + extern "C" { + void something(); + } + + int main() { + something(); + return 0; + } + ''') + open(self.in_dir('supp.cpp'), 'w').write(r''' + #include <stdio.h> + + extern "C" { + void something() { + printf("yello\n"); + } + } + ''') + out, err = Popen([PYTHON, EMCC, self.in_dir('main.cpp'), '-O2', '-o', 'main.o'], stdout=PIPE, stderr=PIPE).communicate() + assert ("emcc: LLVM opts: ['-O3']" in err) == optimize_normally + assert (' with -O3 since EMCC_OPTIMIZE_NORMALLY defined' in err) == optimize_normally + + out, err = Popen([PYTHON, EMCC, self.in_dir('supp.cpp'), '-O2', '-o', 'supp.o'], stdout=PIPE, stderr=PIPE).communicate() + assert ("emcc: LLVM opts: ['-O3']" in err) == optimize_normally + assert (' with -O3 since EMCC_OPTIMIZE_NORMALLY defined' in err) == optimize_normally + + out, err = Popen([PYTHON, EMCC, self.in_dir('main.o'), self.in_dir('supp.o'), '-O2', '-o', 'both.o'], stdout=PIPE, stderr=PIPE).communicate() + assert "emcc: LLVM opts: ['-O3']" not in err + assert ' with -O3 since EMCC_OPTIMIZE_NORMALLY defined' not in err + assert ('despite EMCC_OPTIMIZE_NORMALLY since not source code' in err) == optimize_normally + + out, err = Popen([PYTHON, EMCC, self.in_dir('main.cpp'), self.in_dir('supp.cpp'), '-O2', '-o', 'both2.o'], stdout=PIPE, stderr=PIPE).communicate() + assert ("emcc: LLVM opts: ['-O3']" in err) == optimize_normally + assert (' with -O3 since EMCC_OPTIMIZE_NORMALLY defined' in err) == optimize_normally + + for last in ['both.o', 'both2.o']: + out, err = Popen([PYTHON, EMCC, self.in_dir('both.o'), '-O2', '-o', last + '.js'], stdout=PIPE, stderr=PIPE).communicate() + assert ("emcc: LLVM opts: ['-O3']" not in err) == optimize_normally + assert ' with -O3 since EMCC_OPTIMIZE_NORMALLY defined' not in err + output = run_js(last + '.js') + assert 'yello' in output, 'code works' + assert open('both.o.js').read() == open('both2.o.js').read() + + finally: + if optimize_normally: del os.environ['EMCC_OPTIMIZE_NORMALLY'] + del os.environ['EMCC_DEBUG'] + def test_conftest_s_flag_passing(self): open(os.path.join(self.get_dir(), 'conftest.c'), 'w').write(r''' int main() { @@ -10328,6 +10404,28 @@ elif 'browser' in str(sys.argv): Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'sdl_key.c'), '-o', 'page.html', '--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']''']).communicate() self.run_browser('page.html', '', '/report_result?510510') + def test_sdl_text(self): + open(os.path.join(self.get_dir(), 'pre.js'), 'w').write(''' + Module.postRun = function() { + function doOne() { + Module._one(); + setTimeout(doOne, 1000/60); + } + setTimeout(doOne, 1000/60); + } + + function simulateKeyEvent(charCode) { + var event = document.createEvent("KeyboardEvent"); + event.initKeyEvent("keypress", true, true, window, + 0, 0, 0, 0, 0, charCode); + document.body.dispatchEvent(event); + } + ''') + open(os.path.join(self.get_dir(), 'sdl_text.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_text.c')).read())) + + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'sdl_text.c'), '-o', 'page.html', '--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']''']).communicate() + self.run_browser('page.html', '', '/report_result?1') + def test_sdl_mouse(self): open(os.path.join(self.get_dir(), 'pre.js'), 'w').write(''' function simulateMouseEvent(x, y, button) { @@ -10583,10 +10681,14 @@ elif 'browser' in str(sys.argv): self.run_browser('something.html', 'You should see animating gears.', '/report_result?0') def test_glgears_animation(self): - Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_gles.c'), '-o', 'something.html', - '-DHAVE_BUILTIN_SINCOS', '-s', 'GL_TESTING=1', - '--shell-file', path_from_root('tests', 'hello_world_gles_shell.html')]).communicate() - self.run_browser('something.html', 'You should see animating gears.', '/report_gl_result?true') + for emulation in [0, 1]: + print emulation + Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_gles.c'), '-o', 'something.html', + '-DHAVE_BUILTIN_SINCOS', '-s', 'GL_TESTING=1', + '--shell-file', path_from_root('tests', 'hello_world_gles_shell.html')] + + (['-s', 'FORCE_GL_EMULATION=1'] if emulation else [])).communicate() + self.run_browser('something.html', 'You should see animating gears.', '/report_gl_result?true') + assert ('var GLEmulation' in open(self.in_dir('something.html')).read()) == emulation, "emulation code should be added when asked for" def test_glgears_bad(self): # Make sure that OpenGL ES is not available if typed arrays are not used @@ -10642,13 +10744,38 @@ elif 'browser' in str(sys.argv): open(os.path.join(self.get_dir(), filename), 'w').write(self.with_report_result(src)) else: expected = [str(i) for i in range(0, reference_slack+1)] - shutil.copyfile(path_from_root('tests', filename), os.path.join(self.get_dir(), filename)) + shutil.copyfile(path_from_root('tests', filename), os.path.join(self.get_dir(), os.path.basename(filename))) self.reftest(path_from_root('tests', reference)) args = args + ['--pre-js', 'reftest.js', '-s', 'GL_TESTING=1'] - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), filename), '-o', 'test.html'] + args).communicate() + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), os.path.basename(filename)), '-o', 'test.html'] + args).communicate() if type(expected) is str: expected = [expected] self.run_browser('test.html', '.', ['/report_result?' + e for e in expected]) + def test_gles2_emulation(self): + shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'basemap.tga'), self.in_dir('basemap.tga')) + shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_10', 'MultiTexture', 'lightmap.tga'), self.in_dir('lightmap.tga')) + shutil.copyfile(path_from_root('tests', 'glbook', 'Chapter_13', 'ParticleSystem', 'smoke.tga'), self.in_dir('smoke.tga')) + + for source, reference in [ + (os.path.join('glbook', 'Chapter_2', 'Hello_Triangle', 'Hello_Triangle_orig.c'), path_from_root('tests', 'glbook', 'CH02_HelloTriangle.png')), + #(os.path.join('glbook', 'Chapter_8', 'Simple_VertexShader', 'Simple_VertexShader_orig.c'), path_from_root('tests', 'glbook', 'CH08_SimpleVertexShader.png')), # XXX needs INT extension in WebGL + (os.path.join('glbook', 'Chapter_9', 'TextureWrap', 'TextureWrap_orig.c'), path_from_root('tests', 'glbook', 'CH09_TextureWrap.png')), + #(os.path.join('glbook', 'Chapter_9', 'Simple_TextureCubemap', 'Simple_TextureCubemap_orig.c'), path_from_root('tests', 'glbook', 'CH09_TextureCubemap.png')), # XXX needs INT extension in WebGL + (os.path.join('glbook', 'Chapter_9', 'Simple_Texture2D', 'Simple_Texture2D_orig.c'), path_from_root('tests', 'glbook', 'CH09_SimpleTexture2D.png')), + (os.path.join('glbook', 'Chapter_10', 'MultiTexture', 'MultiTexture_orig.c'), path_from_root('tests', 'glbook', 'CH10_MultiTexture.png')), + (os.path.join('glbook', 'Chapter_13', 'ParticleSystem', 'ParticleSystem_orig.c'), path_from_root('tests', 'glbook', 'CH13_ParticleSystem.png')), + ]: + print source + self.btest(source, + reference=reference, + args=['-I' + path_from_root('tests', 'glbook', 'Common'), + path_from_root('tests', 'glbook', 'Common', 'esUtil.c'), + path_from_root('tests', 'glbook', 'Common', 'esShader.c'), + path_from_root('tests', 'glbook', 'Common', 'esShapes.c'), + path_from_root('tests', 'glbook', 'Common', 'esTransform.c'), + '-s', 'FULL_ES2=1', + '--preload-file', 'basemap.tga', '--preload-file', 'lightmap.tga', '--preload-file', 'smoke.tga']) + def test_emscripten_api(self): self.btest('emscripten_api_browser.cpp', '1', args=['-s', '''EXPORTED_FUNCTIONS=['_main', '_third']''']) @@ -11837,6 +11964,8 @@ fi try: os.environ['EMCC_DEBUG'] = '1' + os.environ['EMCC_JSOPT_MIN_CHUNK_SIZE'] = str(1024*512) + self.working_dir = os.path.join(TEMP_DIR, 'emscripten_temp') if not os.path.exists(self.working_dir): os.makedirs(self.working_dir) @@ -11863,7 +11992,7 @@ fi (['--jcache'], 'hello_malloc.cpp', False, True, False, True, False, True, []), ([], 'hello_malloc.cpp', False, False, False, False, False, False, []), # new, huge file - ([], 'hello_libcxx.cpp', False, False, False, False, False, False, ('2 chunks', '3 chunks')), + ([], 'hello_libcxx.cpp', False, False, False, False, False, False, ('3 chunks',)), (['--jcache'], 'hello_libcxx.cpp', True, False, True, False, True, False, []), (['--jcache'], 'hello_libcxx.cpp', False, True, False, True, False, True, []), ([], 'hello_libcxx.cpp', False, False, False, False, False, False, []), @@ -11887,8 +12016,8 @@ fi if input_file not in srcs: srcs[input_file] = curr else: - open('/home/alon/Dev/emscripten/a', 'w').write(srcs[input_file]) - open('/home/alon/Dev/emscripten/b', 'w').write(curr) + #open('/home/alon/Dev/emscripten/a', 'w').write(srcs[input_file]) + #open('/home/alon/Dev/emscripten/b', 'w').write(curr) assert abs(len(curr)/float(len(srcs[input_file]))-1)<0.01, 'contents may shift in order, but must remain the same size %d vs %d' % (len(curr), len(srcs[input_file])) + '\n' + errtail used_jcache = used_jcache or ('--jcache' in args) assert used_jcache == os.path.exists(JCache.get_cachename('emscript_files')) @@ -11896,6 +12025,7 @@ fi finally: del os.environ['EMCC_DEBUG'] + del os.environ['EMCC_JSOPT_MIN_CHUNK_SIZE'] else: raise Exception('Test runner is confused: ' + str(sys.argv)) diff --git a/tests/sdl_text.c b/tests/sdl_text.c new file mode 100644 index 00000000..6bcb0d61 --- /dev/null +++ b/tests/sdl_text.c @@ -0,0 +1,40 @@ +#include <SDL/SDL.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include <emscripten.h> + +int result = 0; + +void one() { + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch (event.type) { + case SDL_TEXTEDITING: assert(0); break; + case SDL_TEXTINPUT: + printf("Received %s\n", event.text.text); + if (!strcmp("a", event.text.text)) { + result = 1; + } else if (!strcmp("A", event.text.text)) { + REPORT_RESULT(); + emscripten_run_script("throw 'done'"); + } + break; + default: /* Report an unhandled event */ + printf("I don't know what this event is!\n"); + } + } +} + +int main() { + SDL_Init(SDL_INIT_VIDEO); + SDL_SetVideoMode(600, 450, 32, SDL_HWSURFACE); + SDL_StartTextInput(); + + emscripten_run_script("simulateKeyEvent('a'.charCodeAt(0))"); // a + emscripten_run_script("simulateKeyEvent('A'.charCodeAt(0))"); // A + + one(); + + return 0; +} diff --git a/tools/autodebugger_c.py b/tools/autodebugger_c.py index 5d41faf0..54a4d691 100644 --- a/tools/autodebugger_c.py +++ b/tools/autodebugger_c.py @@ -21,9 +21,13 @@ for filename in filenames: if m and (' if ' not in lines[i-1] or '{' in lines[i-1]) and \ (' if ' not in lines[i+1] or '{' in lines[i+1]) and \ (' else' not in lines[i-1] or '{' in lines[i-1]) and \ - (' else' not in lines[i+1] or '{' in lines[i+1]): - var = m.groups(1)[0].rstrip().split(' ')[-1] - lines[i] += ''' printf("%s:%d:%s=%%d\\n", %s);''' % (filename, i+1, var, var) + (' else' not in lines[i+1] or '{' in lines[i+1]) and \ + (' for' not in lines[i-1]) and \ + ('struct' not in lines[i]): + raw = m.groups(1)[0].rstrip() + var = raw.split(' ')[-1] + if ' ' in raw and '[' in var: continue + lines[i] += ''' printf("%s:%d:%s=%%d\\n", (int)%s);''' % (filename, i+1, var, var) f = open(filename, 'w') f.write('\n'.join(lines)) diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py index 52cae6e5..231c6257 100644 --- a/tools/js_optimizer.py +++ b/tools/js_optimizer.py @@ -11,7 +11,7 @@ def path_from_root(*pathelems): JS_OPTIMIZER = path_from_root('tools', 'js-optimizer.js') NUM_CHUNKS_PER_CORE = 1.5 -MIN_CHUNK_SIZE = 1024*1024 +MIN_CHUNK_SIZE = int(os.environ.get('EMCC_JSOPT_MIN_CHUNK_SIZE') or 1024*1024) # configuring this is just for debugging purposes MAX_CHUNK_SIZE = 20*1024*1024 WINDOWS = sys.platform.startswith('win') @@ -139,7 +139,7 @@ def run_on_js(filename, passes, js_engine, jcache): if len(filenames) > 0: # XXX Use '--nocrankshaft' to disable crankshaft to work around v8 bug 1895, needed for older v8/node (node 0.6.8+ should be ok) - commands = map(lambda filename: [js_engine, JS_OPTIMIZER, filename, 'noPrintMetadata'] + passes, filenames) + commands = map(lambda filename: js_engine + [JS_OPTIMIZER, filename, 'noPrintMetadata'] + passes, filenames) #print [' '.join(command) for command in commands] cores = min(cores, filenames) diff --git a/tools/shared.py b/tools/shared.py index 6f97737e..aca0677d 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -2,6 +2,10 @@ import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess, h from subprocess import Popen, PIPE, STDOUT from tempfile import mkstemp +def listify(x): + if type(x) is not list: return [x] + return x + # On Windows python suffers from a particularly nasty bug if python is spawning new processes while python itself is spawned from some other non-console process. # Use a custom replacement for Popen on Windows to avoid the "WindowsError: [Error 6] The handle is invalid" errors when emcc is driven through cmake or mingw32-make. # See http://bugs.python.org/issue3905 @@ -28,7 +32,10 @@ class WindowsPopen: self.stderr_ = PIPE # Call the process with fixed streams. - self.process = subprocess.Popen(args, bufsize, executable, self.stdin_, self.stdout_, self.stderr_, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags) + try: + self.process = subprocess.Popen(args, bufsize, executable, self.stdin_, self.stdout_, self.stderr_, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags) + except Exception, e: + print >> sys.stderr, 'subprocess.Popen(args=%s) failed! Exception %s' % (' '.join(args), str(e)) def communicate(self, input=None): output = self.process.communicate(input) @@ -155,7 +162,8 @@ EXPECTED_NODE_VERSION = (0,6,8) def check_node_version(): try: - actual = Popen([NODE_JS, '--version'], stdout=PIPE).communicate()[0].strip() + node = listify(NODE_JS) + actual = Popen(node + ['--version'], stdout=PIPE).communicate()[0].strip() version = tuple(map(int, actual.replace('v', '').split('.'))) if version >= EXPECTED_NODE_VERSION: return True @@ -380,6 +388,9 @@ if USE_EMSDK: else: EMSDK_OPTS = [] +#print >> sys.stderr, 'SDK opts', ' '.join(EMSDK_OPTS) +#print >> sys.stderr, 'Compiler opts', ' '.join(COMPILER_OPTS) + # Engine tweaks try: @@ -465,7 +476,8 @@ def timeout_run(proc, timeout, note='unnamed process', full_output=False): def run_js(filename, engine=None, args=[], check_timeout=False, stdout=PIPE, stderr=None, cwd=None, full_output=False): if engine is None: engine = JS_ENGINES[0] - if type(engine) is not list: engine = [engine] + engine = listify(engine) + #if not WINDOWS: 'd8' in engine[0] or 'node' in engine[0]: engine += ['--stack_size=8192'] # needed for some big projects command = engine + [filename] + (['--'] if 'd8' in engine[0] else []) + args return timeout_run(Popen(command, stdout=stdout, stderr=stderr, cwd=cwd), 15*60 if check_timeout else None, 'Execution', full_output=full_output) @@ -571,8 +583,7 @@ class Settings: if opt_level >= 2: Settings.RELOOP = 1 if opt_level >= 3: - # Aside from these, -O3 also runs closure compiler - Settings.INLINING_LIMIT = 0 + # Aside from these, -O3 also runs closure compiler and llvm lto Settings.DOUBLE_MODE = 0 Settings.PRECISE_I64_MATH = 0 if noisy: print >> sys.stderr, 'Warning: Applying some potentially unsafe optimizations! (Use -O2 if this fails.)' @@ -822,14 +833,25 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e # 8k is a bit of an arbitrary limit, but a reasonable one # for max command line size before we use a respose file response_file = None - if len(' '.join(link_cmd)) > 8192: + if WINDOWS and len(' '.join(link_cmd)) > 8192: if DEBUG: print >>sys.stderr, 'using response file for llvm-link' [response_fd, response_file] = mkstemp(suffix='.response', dir=TEMP_DIR) + + link_cmd = [LLVM_LINK, "@" + response_file] + response_fh = os.fdopen(response_fd, 'w') for arg in actual_files: - response_fh.write(arg + "\n") + # we can't put things with spaces in the response file + if " " in arg: + link_cmd.append(arg) + else: + response_fh.write(arg + "\n") response_fh.close() - link_cmd = [LLVM_LINK, "@" + response_file, '-o', target] + link_cmd.append("-o") + link_cmd.append(target) + + if len(' '.join(link_cmd)) > 8192: + print >>sys.stderr, 'emcc: warning: link command line is very long, even with response file -- use paths with no spaces' output = Popen(link_cmd, stdout=PIPE).communicate()[0] @@ -1078,7 +1100,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e @staticmethod def js_optimizer(filename, passes, jcache): - return js_optimizer.run(filename, passes, NODE_JS, jcache) + return js_optimizer.run(filename, passes, listify(NODE_JS), jcache) @staticmethod def closure_compiler(filename): |