summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS12
-rw-r--r--CONTRIBUTING.md (renamed from CONTRIBUTING.markdown)3
-rw-r--r--ChangeLog224
-rw-r--r--LICENSE6
-rw-r--r--README.markdown14
-rw-r--r--README.md26
-rw-r--r--cmake/Platform/Emscripten.cmake10
-rw-r--r--docs/emscripten_powered_by_logo.svg1547
-rwxr-xr-xemcc899
-rwxr-xr-x[-rw-r--r--]emlink.py0
-rw-r--r--emscripten-version.txt2
-rwxr-xr-xemscripten.py146
-rw-r--r--media/switch_logo.eps (renamed from docs/emscripten_switch_logo.eps)bin1114650 -> 1114650 bytes
-rw-r--r--media/switch_logo.jpeg (renamed from docs/emscripten_switch_logo.jpg)bin35951 -> 35951 bytes
-rw-r--r--media/switch_logo.svg (renamed from docs/emscripten_switch_logo.svg)0
-rw-r--r--package.json2
-rw-r--r--patches/README4
-rw-r--r--patches/series2
-rwxr-xr-xscons-tools/emscripten.py7
-rw-r--r--src/compiler.js3
-rw-r--r--src/deps_info.json7
-rw-r--r--src/embind/emval.js36
-rw-r--r--src/headless.js12
-rw-r--r--src/headlessCanvas.js6
-rw-r--r--src/intertyper.js10
-rw-r--r--src/jsifier.js83
-rw-r--r--src/library.js945
-rw-r--r--src/library_browser.js153
-rw-r--r--src/library_egl.js18
-rw-r--r--src/library_fs.js221
-rw-r--r--src/library_gc.js2
-rw-r--r--src/library_gl.js478
-rw-r--r--src/library_glfw.js8
-rw-r--r--src/library_glut.js2
-rw-r--r--src/library_html5.js1280
-rw-r--r--src/library_idbfs.js324
-rw-r--r--src/library_memfs.js5
-rw-r--r--src/library_openal.js505
-rw-r--r--src/library_sdl.js216
-rw-r--r--src/library_sockfs.js2
-rw-r--r--src/modules.js17
-rw-r--r--src/parseTools.js73
-rw-r--r--src/postamble.js24
-rw-r--r--src/preamble.js322
-rw-r--r--src/proxyClient.js54
-rw-r--r--src/proxyWorker.js12
-rw-r--r--src/relooper/README.markdown14
-rw-r--r--src/relooper/README.md12
-rw-r--r--src/relooper/Relooper.cpp59
-rw-r--r--src/relooper/Relooper.h4
-rw-r--r--src/relooper/test.txt4
-rw-r--r--src/runtime.js50
-rw-r--r--src/settings.js33
-rw-r--r--src/shell.html1219
-rw-r--r--src/shell.js12
-rw-r--r--src/shell_minimal.html132
-rw-r--r--src/struct_info.json193
-rw-r--r--src/utility.js6
-rw-r--r--system/include/EGL/eglplatform.h2
-rw-r--r--system/include/GL/glew.h4
-rw-r--r--system/include/SDL/SDL_config_minimal.h2
-rw-r--r--system/include/SDL/SDL_stdinc.h2
-rw-r--r--system/include/X11/XKBlib.h1149
-rw-r--r--system/include/X11/Xfuncs.h69
-rw-r--r--system/include/X11/XlibConf.h38
-rw-r--r--system/include/X11/Xlibint.h1387
-rw-r--r--system/include/X11/Xmd.h185
-rw-r--r--system/include/X11/Xproto.h2157
-rw-r--r--system/include/X11/Xprotostr.h77
-rw-r--r--system/include/X11/cursorfont.h111
-rw-r--r--system/include/X11/extensions/XKB.h786
-rw-r--r--system/include/X11/extensions/XKBstr.h613
-rw-r--r--system/include/X11/extensions/XShm.h135
-rw-r--r--system/include/X11/extensions/Xext.h53
-rw-r--r--system/include/X11/extensions/extutil.h190
-rw-r--r--system/include/X11/extensions/shm.h44
-rw-r--r--system/include/emscripten/bind.h54
-rw-r--r--system/include/emscripten/emscripten.h78
-rw-r--r--system/include/emscripten/html5.h635
-rw-r--r--system/include/emscripten/val.h55
-rw-r--r--system/include/emscripten/wire.h32
-rw-r--r--system/include/execinfo.h44
-rw-r--r--system/include/gc.h2
-rw-r--r--system/include/jansson.h2
-rw-r--r--system/include/libc/unistd.h6
-rw-r--r--system/include/libcxx/exception4
-rw-r--r--system/include/unwind.h154
-rw-r--r--system/lib/compiler-rt/int_endianness.h2
-rw-r--r--system/lib/dlmalloc.c2
-rw-r--r--system/lib/gl.c1731
-rw-r--r--system/lib/gl.symbols1
-rw-r--r--system/lib/libc.symbols9
-rw-r--r--system/lib/libc/musl/src/locale/strcoll.c15
-rw-r--r--system/lib/libc/musl/src/regex/fnmatch.c299
-rw-r--r--system/lib/libc/musl/src/string/memcmp.c8
-rw-r--r--system/lib/libc/musl/src/string/strcasecmp.c9
-rw-r--r--system/lib/libc/musl/src/string/strcmp.c7
-rw-r--r--system/lib/libc/musl/src/string/strncasecmp.c10
-rw-r--r--system/lib/libc/musl/src/string/strncmp.c9
-rw-r--r--system/lib/libcextra.symbols1
-rw-r--r--system/lib/sdl.cpp13
-rw-r--r--system/lib/sdl.symbols1
-rw-r--r--tests/799.cpp2
-rw-r--r--tests/aniso.c2
-rw-r--r--tests/asmjs-unknown-emscripten.c98
-rw-r--r--tests/box2d/Benchmark.cpp79
-rw-r--r--tests/cases/2xi40.ll4
-rw-r--r--tests/cases/514_ta2.ll4
-rw-r--r--tests/cases/aliasbitcast.ll4
-rw-r--r--tests/cases/aliasbitcast2_noasm.ll2
-rw-r--r--tests/cases/aliasbitcast3_noasm.ll4
-rw-r--r--tests/cases/aliasbitcastdollar_noasm.ll2
-rw-r--r--tests/cases/atomicrmw.ll4
-rw-r--r--tests/cases/atomicrmw_dec.ll21
-rw-r--r--tests/cases/atomicrmw_dec.txt1
-rw-r--r--tests/cases/atomicrmw_unaligned.ll4
-rw-r--r--tests/cases/bigdouble.ll17
-rw-r--r--tests/cases/bigdouble.txt1
-rw-r--r--tests/cases/boolret_fastcomp.ll31
-rw-r--r--tests/cases/boolret_fastcomp.txt2
-rw-r--r--tests/cases/breakinthemiddle.ll4
-rw-r--r--tests/cases/breakinthemiddle2.ll4
-rw-r--r--tests/cases/caall.ll4
-rw-r--r--tests/cases/callwithstructural64_ta2.ll4
-rw-r--r--tests/cases/callwithstructural_ta2.ll4
-rw-r--r--tests/cases/complexphi.ll4
-rw-r--r--tests/cases/ctors_cast.ll4
-rw-r--r--tests/cases/dash.ll4
-rw-r--r--tests/cases/dollar.ll22
-rw-r--r--tests/cases/emptyalloca.ll4
-rw-r--r--tests/cases/emptyasm_aue.ll (renamed from tests/cases/emptyasm_le32.ll)4
-rw-r--r--tests/cases/emptystruct.ll2
-rw-r--r--tests/cases/entry3.ll4
-rw-r--r--tests/cases/extendedprecision.ll4
-rw-r--r--tests/cases/fptosi.ll28
-rw-r--r--tests/cases/fptosi.txt6
-rw-r--r--tests/cases/funcptr.ll4
-rw-r--r--tests/cases/fuzz6_ta2.ll3306
-rw-r--r--tests/cases/fuzz6_ta2.txt1
-rw-r--r--tests/cases/gepaddoverflow.ll4
-rw-r--r--tests/cases/i24_mem_ta2.ll4
-rw-r--r--tests/cases/i96_ashr_ta2.ll35
-rw-r--r--tests/cases/i96_ashr_ta2.txt3
-rw-r--r--tests/cases/i96shiftnon32_ta2.ll44
-rw-r--r--tests/cases/i96shiftnon32_ta2.txt1
-rw-r--r--tests/cases/inttoptr.ll4
-rw-r--r--tests/cases/invokebitcast.ll13
-rw-r--r--tests/cases/invokeundef.ll4
-rw-r--r--tests/cases/legalizer_b_ta2.ll179
-rw-r--r--tests/cases/legalizer_b_ta2.txt20
-rw-r--r--tests/cases/legalizer_ta2.ll4
-rw-r--r--tests/cases/loadbitcastgep.ll4
-rw-r--r--tests/cases/longjmp_tiny_invoke.ll6
-rw-r--r--tests/cases/longjmp_tiny_invoke_phi.ll4
-rw-r--r--tests/cases/longjmp_tiny_keepem.ll40
-rw-r--r--tests/cases/longjmp_tiny_keepem.txt3
-rw-r--r--tests/cases/longjmp_tiny_keepem_cond.ll41
-rw-r--r--tests/cases/longjmp_tiny_keepem_cond.txt3
-rw-r--r--tests/cases/longjmp_tiny_phi.ll2
-rw-r--r--tests/cases/longjmp_tiny_phi2.ll2
-rw-r--r--tests/cases/muli33_ta2.ll4
-rw-r--r--tests/cases/oob_ta2.ll4
-rw-r--r--tests/cases/phi24_ta2.ll4
-rw-r--r--tests/cases/phicubed.ll4
-rw-r--r--tests/cases/phientryimplicit.ll10
-rw-r--r--tests/cases/phientryimplicitmix.ll4
-rw-r--r--tests/cases/phientryimplicitmoar.ll4
-rw-r--r--tests/cases/philoop_ta2.ll4
-rw-r--r--tests/cases/phinonexist.ll11
-rw-r--r--tests/cases/phinonreachable64.ll26
-rw-r--r--tests/cases/phiptrtoint.ll4
-rw-r--r--tests/cases/phiself.ll4
-rw-r--r--tests/cases/ptrtoi64.ll4
-rw-r--r--tests/cases/ptrtoint_blockaddr.ll14
-rw-r--r--tests/cases/quotedlabel.ll2
-rw-r--r--tests/cases/sillybitcast.ll10
-rw-r--r--tests/cases/sillybitcast2.ll4
-rw-r--r--tests/cases/sillyfuncast.ll4
-rw-r--r--tests/cases/storebigfloat.ll4
-rw-r--r--tests/cases/storestruct.ll4
-rw-r--r--tests/cases/structinparam.ll4
-rw-r--r--tests/cases/structparam.ll2
-rw-r--r--tests/cases/structphiparam.ll4
-rw-r--r--tests/cases/sub_11_0.ll4
-rw-r--r--tests/cases/switch64_ta2.ll4
-rw-r--r--tests/cases/switch64b_ta2.ll4
-rw-r--r--tests/cases/uadd_overflow_ta2.ll4
-rw-r--r--tests/cases/zeroembedded.ll4
-rw-r--r--tests/cases/zeroextarg.ll4
-rw-r--r--tests/codemods.cpp21
-rw-r--r--tests/core/emscripten_get_compiler_setting.c11
-rw-r--r--tests/core/emscripten_get_compiler_setting.out2
-rw-r--r--tests/core/fnmatch.c79
-rw-r--r--tests/core/fnmatch.out23
-rw-r--r--tests/core/test_alloca.in13
-rw-r--r--tests/core/test_exceptions_2.in (renamed from tests/core/test_exception_2.in)0
-rw-r--r--tests/core/test_exceptions_2.out (renamed from tests/core/test_exception_2.out)0
-rw-r--r--tests/core/test_exceptions_alias.c15
-rw-r--r--tests/core/test_exceptions_alias.out2
-rw-r--r--tests/core/test_exceptions_multi.in (renamed from tests/core/test_multiexception.in)6
-rw-r--r--tests/core/test_exceptions_multi.out (renamed from tests/core/test_multiexception.out)0
-rw-r--r--tests/core/test_exceptions_std.in (renamed from tests/core/test_std_exception.in)1
-rw-r--r--tests/core/test_exceptions_std.out2
-rw-r--r--tests/core/test_exceptions_typed.in (renamed from tests/exceptions/typed.cpp)0
-rw-r--r--tests/core/test_exceptions_typed.out (renamed from tests/exceptions/output.txt)0
-rw-r--r--tests/core/test_exceptions_white_list.in (renamed from tests/core/test_white_list_exception.in)0
-rw-r--r--tests/core/test_exceptions_white_list.out (renamed from tests/core/test_white_list_exception.out)0
-rw-r--r--tests/core/test_exceptions_white_list_2.c27
-rw-r--r--tests/core/test_exceptions_white_list_2.out1
-rw-r--r--tests/core/test_inlinejs3.in6
-rw-r--r--tests/core/test_inlinejs3.out1
-rw-r--r--tests/core/test_longjmp_throw.cpp38
-rw-r--r--tests/core/test_longjmp_throw.out4
-rw-r--r--tests/core/test_memcpy3.c51
-rw-r--r--tests/core/test_memcpy3.out81
-rw-r--r--tests/core/test_memset.c51
-rw-r--r--tests/core/test_memset.out81
-rw-r--r--tests/core/test_nl_types.in8
-rw-r--r--tests/core/test_nl_types.out1
-rw-r--r--tests/core/test_sscanf.in1
-rw-r--r--tests/core/test_sscanf_6.in14
-rw-r--r--tests/core/test_sscanf_6.out1
-rw-r--r--tests/core/test_sscanf_other_whitespace.in4
-rw-r--r--tests/core/test_std_exception.out1
-rw-r--r--tests/core/test_strcmp_uni.out6
-rw-r--r--tests/cube_explosion.c4
-rw-r--r--tests/cubegeom.c4
-rw-r--r--tests/cubegeom_color.c6
-rw-r--r--tests/cubegeom_color2.c4
-rw-r--r--tests/cubegeom_fog.c4
-rw-r--r--tests/cubegeom_glew.c2
-rw-r--r--tests/cubegeom_mt.c4
-rw-r--r--tests/cubegeom_normal.c4
-rw-r--r--tests/cubegeom_normal_dap.c4
-rw-r--r--tests/cubegeom_normal_dap_far.c4
-rw-r--r--tests/cubegeom_normal_dap_far_glda.c4
-rw-r--r--tests/cubegeom_normal_dap_far_glda_quad.c4
-rw-r--r--tests/cubegeom_normal_dap_far_range.c4
-rw-r--r--tests/cubegeom_pre.c4
-rw-r--r--tests/cubegeom_pre2.c4
-rw-r--r--tests/cubegeom_pre2_vao.c4
-rw-r--r--tests/cubegeom_pre2_vao2.c4
-rw-r--r--tests/cubegeom_pre3.c4
-rw-r--r--tests/cubegeom_pre_vao.c4
-rw-r--r--tests/cubegeom_proc.c331
-rw-r--r--tests/cubegeom_texturematrix.c4
-rw-r--r--tests/embind/build_benchmark2
-rw-r--r--tests/embind/embind.test.js72
-rw-r--r--tests/embind/embind_test.cpp61
-rw-r--r--tests/emscripten_api_browser.cpp16
-rw-r--r--tests/emscripten_log/emscripten_log.cpp16
-rw-r--r--tests/fs/test_mount.c60
-rw-r--r--tests/fuzz/11.c1570
-rw-r--r--tests/fuzz/11.c.txt1
-rw-r--r--tests/fuzz/15.c1581
-rw-r--r--tests/fuzz/15.c.txt1
-rw-r--r--tests/fuzz/18.cpp1125
-rw-r--r--tests/fuzz/18.cpp.txt1
-rw-r--r--tests/fuzz/6.c1313
-rw-r--r--tests/fuzz/6.c.txt1
-rw-r--r--tests/fuzz/9.c1296
-rw-r--r--tests/fuzz/9.c.txt1
-rwxr-xr-xtests/fuzz/creduce_tester.py2
-rwxr-xr-xtests/fuzz/csmith_driver.py55
-rwxr-xr-xtests/fuzz/test.sh32
-rwxr-xr-xtests/fuzz/testpp.sh51
-rw-r--r--tests/gl_matrix_identity.c6
-rw-r--r--tests/gl_ps.c6
-rw-r--r--tests/gl_ps_packed.c6
-rw-r--r--tests/gl_ps_strides.c6
-rw-r--r--tests/gl_renderers.c6
-rw-r--r--tests/gl_stride.c6
-rw-r--r--tests/gl_vertex_buffer.c6
-rw-r--r--tests/gl_vertex_buffer_pre.c6
-rw-r--r--tests/glbegin_points.c2
-rw-r--r--tests/glgettexenv.c71
-rw-r--r--tests/hello_world.ll4
-rw-r--r--tests/hello_world_gles_deriv.c1
-rw-r--r--tests/module/test_stdin.c12
-rw-r--r--tests/nbody-java/native_java_lang_String.c4
-rw-r--r--tests/nbody-java/native_java_lang_System.c2
-rw-r--r--tests/nbody-java/xmlvm.c4
-rw-r--r--tests/nbody-java/xmlvm.h2
-rw-r--r--tests/netinet/in.cpp14
-rw-r--r--tests/netinet/in.out1
-rw-r--r--tests/openal_buffers.c8
-rw-r--r--tests/openal_playback.cpp44
-rw-r--r--tests/perspective.c6
-rw-r--r--tests/poppler/utils/pdftoppm.cc5
-rw-r--r--tests/printf/output.txt1
-rw-r--r--tests/printf/test.c1
-rw-r--r--tests/python/python.asmjs-unknown-emscripten.bc (renamed from tests/python/python.le32.bc)bin7810608 -> 7814552 bytes
-rwxr-xr-xtests/runner.py38
-rw-r--r--tests/s3tc.c2
-rw-r--r--tests/s3tc_crunch.c2
-rw-r--r--tests/sdl_alloctext.c2
-rw-r--r--tests/sdl_audio_beep.cpp8
-rw-r--r--tests/sdl_audio_mix_channels.c2
-rw-r--r--tests/sdl_canvas.c2
-rw-r--r--tests/sdl_canvas_size.c6
-rw-r--r--tests/sdl_canvas_twice.c2
-rw-r--r--tests/sdl_fog_density.c2
-rw-r--r--tests/sdl_fog_exp2.c2
-rw-r--r--tests/sdl_fog_linear.c2
-rw-r--r--tests/sdl_fog_negative.c2
-rw-r--r--tests/sdl_fog_simple.c2
-rw-r--r--tests/sdl_gfx_primitives.c4
-rw-r--r--tests/sdl_headless.c2
-rw-r--r--tests/sdl_ogl.c2
-rw-r--r--tests/sdl_ogl_defaultMatrixMode.c2
-rw-r--r--tests/sdl_ogl_p.c2
-rw-r--r--tests/sdl_ogl_proc_alias.c2
-rw-r--r--tests/sdl_rotozoom.c4
-rw-r--r--tests/sdl_swsurface.c22
-rw-r--r--tests/sdlglshader.c7
-rw-r--r--tests/sockets/test_enet_client.c10
-rw-r--r--tests/sockets/test_enet_server.c8
-rw-r--r--tests/sockets/test_getaddrinfo.c2
-rw-r--r--tests/sockets/test_gethostbyname.c2
-rw-r--r--tests/sockets/test_getnameinfo.c4
-rw-r--r--tests/sockets/test_sockets_echo_client.c35
-rw-r--r--tests/sockets/test_sockets_echo_server.c34
-rw-r--r--tests/sockets/test_sockets_partial_client.c10
-rw-r--r--tests/sockets/test_sockets_partial_server.c8
-rw-r--r--tests/sockets/test_sockets_select_server_closes_connection_client_rw.c10
-rw-r--r--tests/sockets/test_sockets_select_server_down_client.c10
-rw-r--r--tests/sockets/test_sockets_select_server_down_server.c8
-rw-r--r--tests/sockets/webrtc_host.c12
-rw-r--r--tests/sockets/webrtc_peer.c10
-rw-r--r--tests/sqlite/benchmark.c40
-rw-r--r--tests/sqlite/sqlite3.c18
-rw-r--r--tests/stat/test_mknod.c2
-rw-r--r--tests/stat/test_stat.c12
-rw-r--r--tests/test_benchmark.py15
-rw-r--r--tests/test_browser.py519
-rw-r--r--tests/test_core.py668
-rw-r--r--tests/test_egl.c5
-rw-r--r--tests/test_float_literals.cpp92
-rw-r--r--tests/test_float_literals.out22
-rw-r--r--tests/test_html5.c474
-rw-r--r--tests/test_html5_fullscreen.c107
-rw-r--r--tests/test_locale.c24
-rw-r--r--tests/test_locale.out12
-rw-r--r--tests/test_minmax.c89
-rw-r--r--tests/test_other.py997
-rw-r--r--tests/test_sanity.py204
-rw-r--r--tests/test_sockets.py1
-rw-r--r--tests/tex_nonbyte.c6
-rw-r--r--tests/unistd/unlink.c4
-rw-r--r--tests/utf32.cpp20
-rw-r--r--tests/uuid/test.c2
-rw-r--r--tools/asm_module.py3
-rw-r--r--tools/eliminator/asm-eliminator-test-output.js506
-rw-r--r--tools/eliminator/asm-eliminator-test.js651
-rw-r--r--tools/file_packager.py37
-rw-r--r--tools/find_bigis.py2
-rw-r--r--tools/js-optimizer.js1500
-rw-r--r--tools/js_optimizer.py13
-rw-r--r--tools/make_minigzip.py2
-rwxr-xr-xtools/nativize_llvm.py8
-rw-r--r--tools/parse_unaligned.py17
-rw-r--r--tools/shared.py170
-rwxr-xr-xtools/source-maps/sourcemapper.js2
-rw-r--r--tools/stubify_ll.py28
-rw-r--r--tools/system_libs.py397
-rw-r--r--tools/test-js-optimizer-asm-last-output.js2
-rw-r--r--tools/test-js-optimizer-asm-outline1-output.js48
-rw-r--r--tools/test-js-optimizer-asm-outline1.js37
-rw-r--r--tools/test-js-optimizer-asm-outline2-output.js1
-rw-r--r--tools/test-js-optimizer-asm-pre-f32.js17
-rw-r--r--tools/test-js-optimizer-asm-pre-output-f32.js17
-rw-r--r--tools/test-js-optimizer-asm-pre-output.js19
-rw-r--r--tools/test-js-optimizer-asm-pre.js22
-rw-r--r--tools/test-js-optimizer-asm-regs-harder-output.js132
-rw-r--r--tools/test-js-optimizer-asm-regs-harder.js153
-rw-r--r--tools/test-js-optimizer-asm-regs-min-output.js5
-rw-r--r--tools/test-js-optimizer-asm-regs-min.js5
377 files changed, 36023 insertions, 3767 deletions
diff --git a/AUTHORS b/AUTHORS
index f2b6651d..076ce1cb 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -118,4 +118,16 @@ a license to everyone to use it as detailed in LICENSE.)
* Alexandre Perrot <alexandre.perrot@gmail.com>
* Emerson José Silveira da Costa <emerson.costa@gmail.com>
* Jari Vetoniemi <mailroxas@gmail.com>
+* Sindre Sorhus <sindresorhus@gmail.com>
+* James S Urquhart <jamesu@gmail.com>
+* Boris Gjenero <boris.gjenero@gmail.com>
+* jonas echterhoff <jonas@unity3d.com>
+* Sami Vaarala <sami.vaarala@iki.fi>
+* Jack A. Arrington <jack@epicpineapple.com>
+* Richard Janicek <r@janicek.co>
+* Joel Croteau <jcroteau@gmail.com>
+* Haneef Mubarak <haneef503@gmail.com>
+* Nicolas Peri <nicox@shivaengine.com> (copyright owned by ShiVa Technologies, SAS)
+* Bernhard Fey <e-male@web.de>
* Dave Nicponski <dave.nicponski@gmail.com>
+
diff --git a/CONTRIBUTING.markdown b/CONTRIBUTING.md
index ceea8735..c068eb7f 100644
--- a/CONTRIBUTING.markdown
+++ b/CONTRIBUTING.md
@@ -1,5 +1,6 @@
+Contributing
+============
See our wiki for information about contributing to Emscripten:
[Contribution section on wiki](https://github.com/kripken/emscripten/wiki#contributing)
-
diff --git a/ChangeLog b/ChangeLog
index 8749f02f..fea67ddd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,14 +10,232 @@ Not all changes are documented here. In particular, new features, user-oriented
Current trunk code
------------------
- To see a list of commits in the active development branch 'incoming', which have not yet been packaged in a release, see
- https://github.com/kripken/emscripten/compare/1.8.2...incoming
+ https://github.com/kripken/emscripten/compare/1.12.3...incoming
+
+v1.12.3: 2/27/2014
+------------------
+ - Fixed alcOpenDevice on Safari.
+ - Improved the warning message on missing symbols to not show false positives (#2154).
+ - Improved EmscriptenFullscreenChangeEvent HTML5 API structure to return information about HTML element and screen sizes for convenience.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.12.2...1.12.3
+
+v1.12.2: 2/25/2014
+------------------
+ - Added better warning message if Emscripten, LLVM and Clang versions don't match.
+ - Introduced the asmjs-unknown-emscripten target triple that allows specializing LLVM codegen for Emscripten purposes.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.12.1...1.12.2
+
+v1.12.1: 2/25/2014
+------------------
+ - TURNED ON FASTCOMP BY DEFAULT. This means that you will need to migrate to fastcomp-clang build. Either use an Emscripten SDK distribution, or to build manually, see https://github.com/kripken/emscripten/wiki/LLVM-Backend for info.
+ - Migrate to requiring Clang 3.3 instead of Clang 3.2. The fastcomp-clang repository by Emscripten is based on Clang 3.3.
+ - Deprecated old Emscripten libgc implementation.
+ - asm.js will now be always enabled, even in -O0 builds in fastcomp.
+ - Remove support for -s RUNTIME_TYPE_INFO, which is unsupported in fastcomp.
+ - Added a new "powered by Emscripten" logo.
+ - Updated default shell.html graphical layout.
+ - Added new macro EM_ASM_, which allows sending values to JS without returning anything.
+ - Deprecated the jcache compiler option. It should not be needed anymore.
+ - Added support for fetching callstack column information in Firefox 30 in emscripten_get_callstack.
+ - Fix issues with missing exceptions-related symbols in fastcomp.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.12.0...1.12.1
+
+v1.12.0: 2/22/2014
+------------------
+ - Improved the runtime abort error message when calling an invalid function pointer if compiled with -s ASSERTIONS=1 and 2. This allows the developer to better deduce errors with bad function pointers or function pointers casted and invoked via a wrong signature.
+ - Added a new api function emscripten_set_main_loop_arg, which allows passing a userData pointer that will be carried via the function call, useful for object-oriented encapsulation purposes (#2114).
+ - Fixed CMake MinSizeRel configuration type to actually optimize for minimal size with -Os.
+ - Added support for GLES2 VAO extension OES_vertex_array_object for browsers that support it.
+ - Fix issues with emscripten/html5.f when compiled with the SAFE_HEAP option.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.11.1...1.12.0
+
+v1.11.1: 2/19/2014
+------------------
+ - Improved eglSwapBuffers to be spec-conformant.
+ - Fixed an issue with asm.js validation and va_args (#2120).
+ - Fixed asm.js validation issues found with fuzzing.
+ - Added new link-time compiler flag -s RETAIN_COMPILER_SETTINGS=1, which enables a runtime API for querying which Emscripten settings were used to compile the file.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.11.0...1.11.1
-v1.8.2: 1/4/2013
+v1.11.0: 2/14/2014
+------------------
+ - Implemented some new SDL library functions.
+ - Renamed standard file descriptors to have handles 0, 1 and 2 rather than 1, 2 and 3 to coincide with unix numbering.
+ - Improved embind support with smart pointers and mixins.
+ - Improved the registerization -O3 optimization pass around switch-case constructs.
+ - Upper-case files with suffix .C are now also recognized (#2109).
+ - Fixed an issue with glGetTexParameter (#2112).
+ - Improved exceptions support in fastcomp.
+ - Added new linker option -s NO_EXIT_RUNTIME=1, which can be used to set a default value for the Module["noExitRuntime"] parameter at compile-time.
+ - Improved SDL audio buffer queueing when the sample rate matches the native web audio graph sample rate.
+ - Added an optimization that removes redundant Math.frounds in -O3.
+ - Improved the default shell.html file.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.10.4...1.11.0
+
+v1.10.4: 2/10/2014
+------------------
+ - Added support for legacy GL emulation in fastcomp.
+ - Deprecated the --split-js compiler option. This is not supported in fastcomp.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.10.3...1.10.4
+
+v1.10.3: 2/9/2014
+------------------
+ - Work on supporting GL/EGL GetProcAddress.
+ - Fixed issues with shared lib linking support.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.10.2...1.10.3
+
+v1.10.2: 2/7/2014
+------------------
+ - Added basic FS unmount support.
+ - Improved screen orientation lock API to return a success code.
+ - Added PRECISE_F32 support to fastcomp.
+ - Fixed issues in fastcomp related to special floating point literal serialization.
+ - Improved SDL audio buffer queueing.
+ - Added new link-time option -s WARN_UNALIGNED=1 to fastcomp to report compiler warnings about generated unaligned memory accesses, which can hurt performance.
+ - Optimized libc strcmp and memcmp with the implementations from musl libc.
+ - Optimized libc memcpy and memset to back to native code for large buffer sizes.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.10.1...1.10.2
+
+v1.10.1: 1/31/2014
+------------------
+ - Improve srand() and rand() to be seedable and use a Linear Congruential Generator (LCG) for the rng generation for performance.
+ - Improved OpenAL library support.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.10.0...1.10.1
+
+v1.10.0: 1/29/2014
+------------------
+ - Improved C++ exception handling.
+ - Improved OpenAL library support.
+ - Fixed an issue where loading side modules could try to allocate from sealed heap (#2060).
+ - Fixed safe heap issues (2068).
+ - Added new EM_ASM variants that return a value but do not receive any inputs (#2070).
+ - Add support for simultaneously using setjmp and C++ exceptions in fastcomp.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.5...1.10.0
+
+v1.9.5: 1/25/2014
+------------------
+ - Added a spinner logo to default html shell.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.4...1.9.5
+
+v1.9.4: 1/24/2014
+------------------
+ - Add support for Ninja and Eclipse+Ninja builds with Emscripten+CMake.
+ - Fixed regressions with GL emulation.
+ - Added support for #if !X in .js library preprocessor.
+ - Make the syntax EM_ASM("code"); not silently fail. Note that the proper form is EM_ASM(code); without double-quotes.
+ - Optimize generated code size by minifying loop labels as well.
+ - Revised the -O3 optimization level to mean "safe, but very slow optimizations on top of -O2", instead of the old meaning "unsafe optimizations". Using -O3 will now only do safe optimizations, but can be very slow compared to -O2.
+ - Implemented a new registerization optimization pass that does extra variable elimination in -O3 and later to reduce the number of local variables in functions.
+ - Implemented a new emscripten/html5.h interface that exposes common HTML5 APIs directly to C code without having to handwrite JS wrappers.
+ - Improved error messages reported on user-written .js libraries containing syntax errors (#2033).
+ - Fixed glBufferData() function call signature with null data pointer.
+ - Added new option Module['filePackagePrefixURL'] that allows customizing the URL where the VFS package is loaded from.
+ - Implemented glGetTexEnviv and glGetTexEnvfv in GL emulation mode.
+ - Optimized the size of large memory initializer sections.
+ - Fixed issues with the safe heap compilation option.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.3...1.9.4
+
+v1.9.3: 1/17/2014
+------------------
+ - re-merge split blocks in multiples
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.2...1.9.3
+
+v1.9.2: 1/16/2014
+------------------
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.1...1.9.2
+
+v1.9.1: 1/16/2014
+------------------
+ - Optimize desktop GL fixed function pipeline emulation texture load instruction counts when GL_COMBINE is used.
+ - fix Math_floor coercion in unrecommended codegen modes
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.9.0...1.9.1
+
+v1.9.0: 1/16/2014
+------------------
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.14...1.9.0
+
+v1.8.14: 1/15/2014
+------------------
+ - add musl fputws and fix vswprintf.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.13...1.8.14
+
+v1.8.13: 1/15/2014
+------------------
+ - remove musl use of fwritex
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.12...1.8.13
+
+v1.8.12: 1/15/2014
+------------------
+ - Added new GLEW 1.10.0 emulation support.
+ - Fixed an issue where the runtime could start more than once when run in a browser (#1992)
+ - Fix a regression in wprintf.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.11...1.8.12
+
+v1.8.11: 1/15/2014
+------------------
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.10...1.8.11
+
+v1.8.10: 1/14/2014
+------------------
+ - Update libc implementation from musl libc.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.9...1.8.10
+
+v1.8.9: 1/14/2014
+------------------
+ - add fputwc, which enables wprintf.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.8...1.8.9
+
+v1.8.8: 1/14/2014
+------------------
+ - Update to latest libcxx and libcxxabi libraries.
+ - Fix handling of floating point negative zero (#1898)
+ - Fixed a memory leak in relooper in previous release.
+ - Fixed an issue in previous release with VBO handling in GL optimizations.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.7...1.8.8
+
+v1.8.7: 1/13/2014
+------------------
+ - Added support to numpad keycodes in glut support library.
+ - Fix SIMD support with fastcomp.
+ - Fixed a compiler error 'ran out of names' that could occur with too many minified symbol names.
+ - Work around webkit imul bug https://bugs.webkit.org/show_bug.cgi?id=126345 (#1991)
+ - Optimized desktop GL fixed function pipeline emulation path for better performance.
+ - Added support for exceptions when building with fastcomp.
+ - Fix and issue where the run() function could be called multiple times at startup (#1992)
+ - Removed a relooper limitation with fixed buffer size.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.6...1.8.7
+
+v1.8.6: 1/8/2014
+------------------
+ - Added support for the libuuid library, see http://linux.die.net/man/3/libuuid.
+ - Fixed .js file preprocessor to preprocess recursively (#1984).
+ - Fixed a compiler codegen issue related to overflow arithmetic (#1975)
+ - Added new link-time optimization flag -s AGGRESSIVE_VARIABLE_ELIMINATION=1 that enables the aggressiveVariableElimination js optimizer pass, which tries to remove temporary variables in generated JS code at the expense of code size.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.5...1.8.6
+
+v1.8.5: 1/7/2014
+------------------
+ - Fixed compiler issues when used with LLVM 3.4.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.4...1.8.5
+
+v1.8.4: 1/6/2014
+------------------
+ - Added support to Return and Backspace keys to glut
+ - Fixed compiler issues when used with LLVM 3.4.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.3...1.8.4
+
+v1.8.3: 1/5/2014
+------------------
+ - Improved SDL and page scroll pos handling support for IE10 and IE11.
+ - Optimized SDL_UnlockSurface performance.
+ - Full list of changes: https://github.com/kripken/emscripten/compare/1.8.2...1.8.3
+
+v1.8.2: 1/4/2014
------------------
- Fixed glGetFramebufferAttachmentParameteriv and an issue with glGetXXX when the returned value was null.
- Full list of changes: https://github.com/kripken/emscripten/compare/1.8.1...1.8.2
-v1.8.1: 1/3/2013
+v1.8.1: 1/3/2014
------------------
- Added support for WebGL hardware instancing extension.
- Improved fastcomp native LLVM backend support.
diff --git a/LICENSE b/LICENSE
index f742692e..447ddba1 100644
--- a/LICENSE
+++ b/LICENSE
@@ -13,7 +13,7 @@ The full text of both licenses follows.
==============================================================================
-Copyright (c) 2010-2011 Emscripten authors, see AUTHORS file.
+Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -35,7 +35,7 @@ THE SOFTWARE.
==============================================================================
-Copyright (c) 2010-2011 Emscripten authors, see AUTHORS file.
+Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
@@ -91,4 +91,4 @@ in accordance with the terms of the MIT license. Node's license follows:
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
- """ \ No newline at end of file
+ """
diff --git a/README.markdown b/README.markdown
deleted file mode 100644
index 81a95141..00000000
--- a/README.markdown
+++ /dev/null
@@ -1,14 +0,0 @@
-
-![logo](http://dl.dropbox.com/u/80664946/emscripten_logo.jpg)
-
-Emscripten
-==========
-
-Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM - and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).
-
-Links to **demos**, **tutorial**, **FAQ**, etc: <https://github.com/kripken/emscripten/wiki>
-
-Main project page: <http://emscripten.org>
-
-Emscripten is MIT licensed, see LICENSE.txt.
-
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..6b4778bf
--- /dev/null
+++ b/README.md
@@ -0,0 +1,26 @@
+![emscripten logo](media/switch_logo.jpeg)
+
+Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated
+from C/C++, using `llvm-gcc` (DragonEgg) or `clang`, or any other language that can be
+converted into LLVM - and compiles that into JavaScript, which can be run on the web (or
+anywhere else JavaScript can run).
+
+Links to **demos**, **tutorial**, **FAQ**, etc: <https://github.com/kripken/emscripten/wiki>
+
+Main project page: <http://emscripten.org>
+
+License
+-------
+
+Emscripten is available under 2 licenses, the MIT license and the
+University of Illinois/NCSA Open Source License.
+
+Both are permissive open source licenses, with little if any
+practical difference between them.
+
+The reason for offering both is that (1) the MIT license is
+well-known, while (2) the University of Illinois/NCSA Open Source
+License allows Emscripten's code to be integrated upstream into
+LLVM, which uses that license, should the opportunity arise.
+
+See `LICENSE` for the full content of the licenses.
diff --git a/cmake/Platform/Emscripten.cmake b/cmake/Platform/Emscripten.cmake
index 4f434d14..7d86c467 100644
--- a/cmake/Platform/Emscripten.cmake
+++ b/cmake/Platform/Emscripten.cmake
@@ -125,20 +125,20 @@ set(CMAKE_C_SIZEOF_DATA_PTR 4)
set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2" CACHE STRING "Emscripten-overridden CMAKE_C_FLAGS_RELEASE")
-set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -O2" CACHE STRING "Emscripten-overridden CMAKE_C_FLAGS_MINSIZEREL")
+set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os" CACHE STRING "Emscripten-overridden CMAKE_C_FLAGS_MINSIZEREL")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "Emscripten-overridden CMAKE_C_FLAGS_RELWITHDEBINFO")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2" CACHE STRING "Emscripten-overridden CMAKE_CXX_FLAGS_RELEASE")
-set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -O2" CACHE STRING "Emscripten-overridden CMAKE_CXX_FLAGS_MINSIZEREL")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os" CACHE STRING "Emscripten-overridden CMAKE_CXX_FLAGS_MINSIZEREL")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "Emscripten-overridden CMAKE_CXX_FLAGS_RELWITHDEBINFO")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O2" CACHE STRING "Emscripten-overridden CMAKE_EXE_LINKER_FLAGS_RELEASE")
-set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-O2" CACHE STRING "Emscripten-overridden CMAKE_EXE_LINKER_FLAGS_MINSIZEREL")
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "-Os" CACHE STRING "Emscripten-overridden CMAKE_EXE_LINKER_FLAGS_MINSIZEREL")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Emscripten-overridden CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-O2" CACHE STRING "Emscripten-overridden CMAKE_SHARED_LINKER_FLAGS_RELEASE")
-set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "-O2" CACHE STRING "Emscripten-overridden CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL")
+set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "-Os" CACHE STRING "Emscripten-overridden CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Emscripten-overridden CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "-O2" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_RELEASE")
-set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "-O2" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL")
+set(CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL "-Os" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL")
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING "Emscripten-overridden CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO")
function(em_validate_asmjs_after_build target)
diff --git a/docs/emscripten_powered_by_logo.svg b/docs/emscripten_powered_by_logo.svg
new file mode 100644
index 00000000..f39123c1
--- /dev/null
+++ b/docs/emscripten_powered_by_logo.svg
@@ -0,0 +1,1547 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="900px"
+ height="400px"
+ viewBox="0 0 900 400"
+ enable-background="new 0 0 900 400"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="emscripten_powered_by_logo.svg"><metadata
+ id="metadata345"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs343"><linearGradient
+ y2="247.6265"
+ x2="225.1929"
+ y1="152.499"
+ x1="225.1929"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5104">
+ <stop
+ id="stop5106"
+ style="stop-color:#C1D72F"
+ offset="0.3227531" />
+ <stop
+ id="stop5108"
+ style="stop-color:#BCD631"
+ offset="0.45119295" />
+ <stop
+ id="stop5110"
+ style="stop-color:#AFD136"
+ offset="0.64491969" />
+ <stop
+ id="stop5112"
+ style="stop-color:#ABD037"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#C1D72F"
+ offset="0.0123" />
+ <a:midPointStop
+ style="stop-color:#C1D72F"
+ offset="0.3086" />
+ <a:midPointStop
+ style="stop-color:#ABD037"
+ offset="1" />
+ </linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_2_"
+ id="linearGradient5120"
+ x1="397.56918"
+ y1="128.12726"
+ x2="397.56918"
+ y2="166.25996"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.103059,0,0,1.103059,-38.997823,3.1312145)" /><filter
+ inkscape:collect="always"
+ id="filter5126"><feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.56377237"
+ id="feGaussianBlur5128" /></filter><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_2_"
+ id="linearGradient5134"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.103059,0,0,1.103059,-38.997823,3.1312145)"
+ x1="397.56918"
+ y1="128.12726"
+ x2="397.56918"
+ y2="166.25996" /></defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1440"
+ inkscape:window-height="838"
+ id="namedview341"
+ showgrid="false"
+ inkscape:zoom="0.63555556"
+ inkscape:cx="224.82424"
+ inkscape:cy="-52.085109"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1" />
+<g
+ id="g5130"
+ transform="matrix(0.91591318,0,0,0.91591318,28.176953,14.143571)"><path
+ transform="matrix(1.103059,0,0,1.103059,-35.073492,-16.03923)"
+ id="path5122"
+ style="fill:#383838;fill-opacity:0.34705882;stroke:none;filter:url(#filter5126)"
+ d="m 494.39333,173.6323 c 0.57407,0.28703 1.87073,1.00226 2.89426,1.02855 0.55732,0.0143 1.14006,-0.1672 1.60262,-0.4784 1.20466,-0.81046 2.23561,-2.03031 2.72683,-3.39661 0.19424,-0.54027 0.0238,-1.72222 0.0238,-1.72222 l -3.82713,-14.06478 -1.98533,0 0.50231,-2.67891 6.36261,0 2.55939,12.22285 4.78392,-9.68746 -2.00924,0 0,-2.65498 7.19979,0 -11.00301,22.38875 -1.69829,1.91358 -2.29628,1.3395 -2.46371,0.26312 -2.29628,-0.21528 -2.79859,-1.36342 z m -12.0637,-14.56445 c -0.93698,1.88565 -1.70261,4.35262 -0.81842,6.26333 0.36549,0.78976 1.35098,1.19428 2.192,1.41737 0.60934,0.16133 1.29167,0.0999 1.88775,-0.10468 0.48126,-0.1655 0.8829,-0.5224 1.255,-0.8697 0.40341,-0.3768 0.77723,-0.80461 1.03505,-1.29262 0.21864,-0.41395 0.40236,-0.84786 0.49325,-1.30698 0.20667,-1.0485 0.35879,-2.1079 0.33583,-3.17631 -0.0184,-0.87403 -0.0789,-1.87107 -0.47711,-2.64959 -0.26344,-0.51379 -0.77017,-0.71849 -1.33113,-0.85633 -0.42395,-0.10479 -0.81432,-0.0626 -1.21773,0.10517 -0.65479,0.27273 -1.2544,0.5311 -1.82112,0.95764 -0.57331,0.4317 -1.21403,0.86959 -1.53337,1.5127 z m 0.65588,-4.31208 c 0,0 2.19341,-1.80738 3.45549,-2.27082 0.71718,-0.26365 3.45363,-0.65258 4.15,-0.3378 1.47292,0.66633 2.26103,1.57529 2.7222,2.60001 0.46118,1.02472 0.69944,2.59956 0.79701,3.73627 0.13278,1.55027 -0.13682,3.77629 -0.53404,5.74843 -0.30079,1.49256 -1.01883,2.74423 -1.83478,3.92156 -1.06526,1.5373 -1.82382,2.15116 -3.66756,2.46594 -0.98864,0.16889 -1.93845,0.46787 -3.25466,0.0928 -1.4384,-0.40963 -2.35273,-0.81244 -3.39599,-1.63337 -0.72524,-0.57054 -1.16043,-1.54043 -1.16043,-1.54043 l 0,2.82636 -4.8903,0 3.39872,-23.01602 -1.92242,-0.85888 0.0403,-2.38127 7.25847,0.0534 z m -23.77803,2.20447 c 0.29175,1.49273 0.0813,4.83252 -0.86111,6.69751 -0.3062,0.60617 -0.94813,1.32967 -1.55479,1.6983 -1.01515,0.61713 -2.21688,1.21322 -3.3966,1.07639 -0.47944,-0.0541 -0.97036,-0.34348 -1.24383,-0.74151 -0.47686,-0.69328 -0.43621,-1.55032 -0.45448,-2.39198 -0.024,-1.06873 0.13137,-2.23775 0.38272,-3.277 0.18705,-0.7744 0.4229,-1.58254 0.86111,-2.24844 0.39037,-0.59323 0.92628,-1.12617 1.55478,-1.45909 0.54854,-0.29014 1.19695,-0.38467 1.81791,-0.40664 0.63637,-0.0231 1.3031,0.0385 1.88966,0.28704 0.3875,0.16453 0.92361,0.3524 1.00463,0.76542 z m 1.29312,-9.69052 -0.64254,6.12262 c 0,0 -1.68393,-0.96858 -2.605,-1.25148 -0.73032,-0.22434 -1.50312,-0.36654 -2.26624,-0.33838 -0.97069,0.0345 -1.91182,0.22099 -2.81751,0.57088 -0.9185,0.35497 -1.78344,0.94565 -2.49338,1.62792 -0.88025,0.84538 -1.51404,1.90455 -2.02977,3.0106 -0.39653,0.84993 -0.69517,1.75284 -0.87975,2.67232 -0.22875,1.14241 -0.44415,2.38719 -0.43937,3.55197 0.01,1.44865 0.0623,2.89489 0.54092,4.26214 0.25525,0.72907 0.71643,1.40578 1.28572,1.9283 0.56835,0.52207 1.29566,0.87604 2.02935,1.11621 0.41072,0.13491 0.85346,0.17274 1.28579,0.16935 1.00285,-0.01 2.03715,-0.0883 2.97671,-0.43999 0.66497,-0.2489 1.21759,-0.73399 1.79298,-1.1502 0.75304,-0.54475 2.16476,-1.86006 2.16476,-1.86006 l 0,1.62374 -0.5751,0 0,1.48807 6.86709,0 0,-2.84135 -1.92841,0 3.21374,-23.57782 -7.37422,0 0,2.33412 z m -93.60062,7.55781 2.33363,15.57933 6.23084,0 4.04243,-11.34169 1.62654,11.34169 5.88425,0 7.05633,-16.38872 0,-2.0141 -6.1713,0 0,2.82349 1.88966,0 -4.04243,10.16973 -0.74151,0 -1.29167,-12.55773 -5.38194,0 -4.7361,12.50989 -1.55478,-12.94538 -6.86496,0 0,2.82349 z m -12.15,0.72146 c -0.56264,0.0892 -1.03524,0.17358 -1.53086,0.45447 -0.737,0.41808 -1.46132,0.95771 -1.91357,1.67437 -0.44123,0.70048 -0.53204,1.57581 -0.66975,2.39196 -0.1751,1.04003 -0.20064,2.10306 -0.19136,3.15741 0.01,0.81614 -0.0138,1.66577 0.35879,2.39197 0.1904,0.37315 0.52874,0.80945 0.88503,1.02855 0.56015,0.34453 1.06632,0.55494 1.72222,0.598 0.72597,0.0483 1.48801,-0.18852 2.10493,-0.57408 0.59422,-0.37072 1.03334,-0.97401 1.38735,-1.5787 0.46117,-0.78744 0.70905,-1.69257 0.90895,-2.58334 0.20377,-0.90704 0.33579,-1.84565 0.28703,-2.77468 -0.0491,-0.92714 -0.18211,-1.88434 -0.57407,-2.72684 -0.2728,-0.58681 -0.70954,-1.00753 -1.29166,-1.29165 -0.44403,-0.21628 -0.99455,-0.24402 -1.48303,-0.16744 z m -6.62442,-0.73581 c 0.65404,-0.6664 1.4072,-1.25479 2.23273,-1.69161 1.0305,-0.54505 2.16429,-0.92749 3.31518,-1.11604 1.51307,-0.24806 3.09342,-0.2847 4.60036,0 0.88055,0.16632 1.78322,0.44742 2.50307,0.98113 0.77409,0.57312 1.35279,1.40936 1.79291,2.26639 0.42901,0.83457 0.6828,1.77223 0.77798,2.70605 0.16564,1.61985 0.024,3.29135 -0.37201,4.87103 -0.33328,1.33759 -0.88436,2.64754 -1.65745,3.78889 -0.67549,0.99679 -1.52894,1.91262 -2.53721,2.5709 -0.89957,0.58746 -1.9718,0.87641 -3.01035,1.15006 -0.87153,0.22963 -1.77166,0.4095 -2.67235,0.40576 -1.21068,-0.01 -2.47998,-0.0817 -3.58589,-0.57511 -1.09854,-0.48896 -1.89728,-1.32739 -2.60455,-2.30013 -0.61123,-0.83995 -1.02561,-1.59975 -1.31932,-2.87516 -0.2125,-0.9233 -0.40006,-2.19912 -0.37215,-3.14592 0.0335,-1.16537 0.3568,-2.74121 0.83416,-3.80434 0.52547,-1.17098 1.17609,-2.3161 2.07489,-3.2319 z m 94.95184,13.82318 c -2.20516,1.01761 -4.61429,1.69636 -7.02343,1.69636 -5.32726,0 -7.22678,-3.12145 -7.22678,-7.22678 0,-7.1251 4.54685,-11.19645 10.0772,-11.19645 3.7324,0 5.56453,1.69625 5.56453,4.47856 0,4.85189 -5.12329,6.27735 -10.41633,6.82001 0.10168,1.73076 0.81446,3.32485 3.3592,3.32485 1.2218,0 2.88401,-0.37315 4.91982,-1.22099 z m -3.22292,-11.77374 c 0,-0.81423 -0.57695,-1.28891 -1.62876,-1.28891 -1.89988,0 -3.46041,1.66212 -3.96978,4.34287 1.45897,-0.20368 5.59854,-0.91613 5.59854,-3.05396 z m -30.33408,11.77374 c -2.2054,1.01761 -4.61457,1.69636 -7.02371,1.69636 -5.32653,0 -7.22671,-3.12145 -7.22671,-7.22678 0,-7.1251 4.54679,-11.19645 10.07785,-11.19645 3.73175,0 5.56382,1.69625 5.56382,4.47856 0,4.85189 -5.12273,6.27735 -10.41568,6.82001 0.10142,1.73076 0.81422,3.32485 3.35884,3.32485 1.22158,0 2.8842,-0.37315 4.91994,-1.22099 z m -3.22305,-11.77374 c 0,-0.81423 -0.57638,-1.28891 -1.62883,-1.28891 -1.89959,0 -3.46023,1.66212 -3.96971,4.34287 1.4591,-0.20368 5.59854,-0.91613 5.59854,-3.05396 z m -82.36051,20.5268 -0.0679,-0.13571 0.98406,-5.66614 2.10303,-15.16698 c 0.0687,-0.40664 -0.0332,-0.61046 -0.30522,-0.71214 l -1.66259,-0.61111 0.37379,-2.57855 6.78556,0 -0.40663,2.71427 0.10142,0.0335 c 2.0016,-1.86631 4.10566,-3.08743 6.24306,-3.08743 2.91821,0 4.95366,1.86577 4.95366,6.78561 0,4.68241 -1.83206,11.6379 -8.14271,11.6379 -2.20534,0 -3.42694,-0.84825 -4.68256,-1.73039 l -0.74621,5.08917 c -0.0341,0.37361 0.0326,0.50898 0.47457,0.54273 l 3.42697,0.33969 -0.37385,2.5447 -9.0589,0 z m 6.78613,-12.04485 c 0.84787,0.71258 1.96788,1.32305 3.22348,1.32305 2.74798,0 3.76601,-3.86811 3.76601,-6.85368 0,-2.002 -0.47476,-3.32542 -1.76432,-3.32542 -1.35696,0 -3.08763,1.4591 -4.30913,2.54506 z m 81.08934,4.85147 0.33969,-2.54464 1.56064,-0.2038 c 0.47498,-0.0683 0.5429,-0.1695 0.61084,-0.67837 l 1.42466,-10.34864 c 0.0335,-0.37315 -0.0335,-0.61046 -0.33914,-0.71214 l -1.69691,-0.61111 0.37365,-2.57855 6.71797,0 -0.44097,3.05395 0.10191,0.0679 c 1.32326,-1.89982 3.22359,-3.46042 5.39485,-3.46042 0.7463,0 2.0359,0.13582 2.61295,0.30538 l -0.84863,6.17508 -3.96972,-0.13582 -0.10157,-1.76443 c -0.0335,-0.30537 -0.10223,-0.40701 -0.37391,-0.40701 -0.64452,0 -1.69636,0.78027 -2.64651,1.76455 l -1.18674,8.61817 c -0.0687,0.54303 -0.0334,0.64474 0.47477,0.67874 l 3.22351,0.27142 -0.37384,2.51081 -10.8575,0 z"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cssscccccccccccccccccssssssssccssscssssscsssccccccccsssssssssccsccsssssssssscsscccccccccccccccccccccccccccccccsssscsssssscscsssssssscsssssssssscsssscsccsscscsssscsccsscsccccccccccsssccccccccssscccccccccccccsccccsccccccc" /><path
+ sodipodi:nodetypes="cssscccccccccccccccccssssssssccssscssssscsssccccccccsssssssssccsccsssssssssscsscccccccccccccccccccccccccccccccsssscsssssscscsssssssscsssssssssscsssscsccsscscsssscsccsscsccccccccccsssccccccccssscccccccccccccsccccsccccccc"
+ inkscape:connector-curvature="0"
+ d="m 509.55935,174.26011 c 0.63327,0.31663 2.06355,1.10555 3.19256,1.13455 0.61476,0.0158 1.25757,-0.18443 1.76781,-0.5277 1.3288,-0.89397 2.46618,-2.23946 3.00784,-3.74661 0.21419,-0.59598 0.0258,-1.89972 0.0258,-1.89972 l -4.22153,-15.51428 -2.18993,0 0.55406,-2.95501 7.01835,0 2.82313,13.48255 5.27696,-10.68586 -2.21631,0 0,-2.92858 7.94179,0 -12.13698,24.69605 -1.87332,2.11078 -2.5329,1.4776 -2.71762,0.29022 -2.53295,-0.23748 -3.08699,-1.50392 z m -13.30698,-16.06545 c -1.0335,2.08005 -1.87803,4.80122 -0.90274,6.90883 0.4032,0.87116 1.49018,1.31738 2.4179,1.56347 0.67214,0.17793 1.42477,0.1102 2.08233,-0.11548 0.53084,-0.1826 0.97383,-0.5762 1.38432,-0.9593 0.44502,-0.4157 0.85733,-0.8875 1.14176,-1.42582 0.24113,-0.45665 0.44375,-0.93526 0.54404,-1.44168 0.22797,-1.1566 0.3958,-2.3252 0.37043,-3.50371 -0.0204,-0.96413 -0.0869,-2.06387 -0.52631,-2.92259 -0.29054,-0.56679 -0.84946,-0.79259 -1.46826,-0.94463 -0.46761,-0.11559 -0.89829,-0.0686 -1.34322,0.11597 -0.72226,0.30083 -1.38368,0.5859 -2.00879,1.05634 -0.63242,0.4762 -1.33915,0.9593 -1.69146,1.6686 z m 0.72346,-4.75648 c 0,0 2.41951,-1.99358 3.81169,-2.50482 0.79109,-0.29085 3.80953,-0.71977 4.57766,-0.3726 1.6247,0.73503 2.49408,1.73759 3.00274,2.86791 0.50868,1.13043 0.77154,2.86756 0.87911,4.12137 0.14648,1.71007 -0.15092,4.16549 -0.58904,6.34083 -0.33179,1.64636 -1.12383,3.02703 -2.02388,4.32576 -1.17506,1.6957 -2.01178,2.37286 -4.04556,2.72004 -1.09051,0.18629 -2.13814,0.51607 -3.59006,0.10268 -1.5866,-0.45183 -2.59522,-0.89615 -3.74599,-1.8017 -0.79994,-0.62933 -1.28003,-1.6992 -1.28003,-1.6992 l 0,3.11766 -5.39426,0 3.74898,-25.38802 -2.12052,-0.94738 0.0443,-2.62669 8.00657,0.0587 z m -26.22853,2.43167 c 0.32185,1.64663 0.0893,5.33062 -0.9498,7.38781 -0.33781,0.66857 -1.04588,1.46667 -1.7151,1.8733 -1.11975,0.68073 -2.44527,1.33822 -3.7466,1.18729 -0.52883,-0.0601 -1.07036,-0.37888 -1.37203,-0.81791 -0.52601,-0.76478 -0.48121,-1.71012 -0.50128,-2.63848 -0.0263,-1.17893 0.14487,-2.46835 0.42212,-3.6147 0.20635,-0.8543 0.4665,-1.74564 0.94981,-2.48024 0.43067,-0.65433 1.02178,-1.24217 1.71508,-1.60939 0.60504,-0.32004 1.32025,-0.42437 2.00521,-0.44854 0.70197,-0.0251 1.4374,0.0425 2.08446,0.31654 0.4274,0.18153 1.01882,0.3888 1.10813,0.84432 z m 1.42642,-10.68922 -0.70874,6.75362 c 0,0 -1.85753,-1.06838 -2.8735,-1.38048 -0.80562,-0.24744 -1.65802,-0.40424 -2.49984,-0.37318 -1.07069,0.0382 -2.10882,0.24369 -3.1078,0.62968 -1.01321,0.39157 -1.96724,1.04315 -2.75039,1.79572 -0.97095,0.93248 -1.67003,2.10085 -2.23897,3.3208 -0.43738,0.93753 -0.76677,1.93354 -0.9704,2.94777 -0.2523,1.26016 -0.4899,2.63324 -0.48461,3.91802 0.011,1.59795 0.0683,3.19329 0.59661,4.70144 0.28155,0.80417 0.79028,1.55058 1.41822,2.127 0.62695,0.57587 1.4292,0.96634 2.23856,1.23121 0.45301,0.14881 0.94135,0.19054 1.41828,0.18685 1.10615,-0.011 2.24705,-0.0973 3.28346,-0.48539 0.73352,-0.2745 1.34304,-0.80959 1.97773,-1.2687 0.83064,-0.60085 2.38786,-2.05176 2.38786,-2.05176 l 0,1.79104 -0.63429,0 0,1.64147 7.57478,0 0,-3.13415 -2.12721,0 3.54494,-26.00772 -8.13411,0 0,2.57462 z m -103.24702,8.33671 2.57413,17.18493 6.87304,0 4.45903,-12.51049 1.79414,12.51049 6.49065,0 7.78353,-18.07772 0,-2.2217 -6.8073,0 0,3.11449 2.08446,0 -4.45903,11.21783 -0.8179,0 -1.42488,-13.85193 -5.93654,0 -5.2242,13.79919 -1.71497,-14.27958 -7.57246,0 0,3.11449 z m -13.4021,0.79586 c -0.62064,0.0982 -1.14194,0.19148 -1.68866,0.50127 -0.813,0.46118 -1.61192,1.05641 -2.11077,1.84697 -0.48673,0.77268 -0.58683,1.73821 -0.73875,2.63846 -0.1932,1.14723 -0.22134,2.31976 -0.21116,3.48281 0.011,0.90024 -0.0148,1.83747 0.39579,2.63847 0.21,0.41165 0.58324,0.89285 0.97623,1.13455 0.61796,0.38003 1.17622,0.61214 1.89972,0.6596 0.80077,0.0533 1.64141,-0.20792 2.32189,-0.63318 0.65546,-0.40892 1.13978,-1.07441 1.53029,-1.7414 0.50878,-0.86864 0.78215,-1.86707 1.00265,-2.84964 0.22477,-1.00044 0.37039,-2.03585 0.31663,-3.06058 -0.0541,-1.02274 -0.20091,-2.07854 -0.63327,-3.00784 -0.3009,-0.64731 -0.78264,-1.11143 -1.42476,-1.42485 -0.48983,-0.23858 -1.09705,-0.26912 -1.63583,-0.18464 z m -7.30711,-0.81171 c 0.72143,-0.735 1.55219,-1.38409 2.46282,-1.86591 1.1367,-0.60125 2.38729,-1.02309 3.65678,-1.23104 1.66908,-0.27366 3.41222,-0.314 5.07446,0 0.97135,0.18342 1.96702,0.49352 2.76107,1.08223 0.85389,0.63222 1.49219,1.55466 1.97771,2.49999 0.47321,0.92057 0.7531,1.95483 0.85808,2.98495 0.18274,1.78675 0.0263,3.63055 -0.41031,5.37303 -0.36757,1.47539 -0.97545,2.92034 -1.82825,4.17929 -0.74509,1.09959 -1.68654,2.10982 -2.79871,2.8359 -0.99227,0.64796 -2.175,0.96671 -3.32055,1.26856 -0.96139,0.25333 -1.95426,0.4517 -2.94774,0.44756 -1.33549,-0.011 -2.73559,-0.0897 -3.9555,-0.63431 -1.21174,-0.53936 -2.09278,-1.46419 -2.87295,-2.53723 -0.67423,-0.92645 -1.13131,-1.76457 -1.45532,-3.17146 -0.2344,-1.0184 -0.44126,-2.42572 -0.41044,-3.47012 0.0365,-1.28547 0.39349,-3.02371 0.92005,-4.19644 0.57967,-1.29168 1.29729,-2.5548 2.2888,-3.565 z m 104.73744,15.24778 c -2.43247,1.12251 -5.0899,1.87126 -7.74734,1.87126 -5.87626,0 -7.97147,-3.44315 -7.97147,-7.97158 0,-7.8594 5.0154,-12.35035 11.11569,-12.35035 4.11711,0 6.13803,1.87105 6.13803,4.94016 0,5.35189 -5.65129,6.92425 -11.48983,7.52281 0.11219,1.90916 0.89836,3.66755 3.7054,3.66755 1.3477,0 3.18121,-0.41165 5.42682,-1.34689 z m -3.55513,-12.98704 c 0,-0.89823 -0.63635,-1.42181 -1.79655,-1.42181 -2.09568,0 -3.81712,1.83342 -4.37899,4.79047 1.60937,-0.22468 6.17554,-1.01053 6.17554,-3.36866 z m -33.46028,12.98704 c -2.4327,1.12251 -5.09006,1.87126 -7.74751,1.87126 -5.87553,0 -7.97151,-3.44315 -7.97151,-7.97158 0,-7.8594 5.01539,-12.35035 11.11645,-12.35035 4.11635,0 6.13722,1.87105 6.13722,4.94016 0,5.35189 -5.65062,6.92425 -11.48908,7.52281 0.11182,1.90916 0.89812,3.66755 3.70494,3.66755 1.34748,0 3.1815,-0.41165 5.42704,-1.34689 z m -3.55514,-12.98704 c 0,-0.89823 -0.63578,-1.42181 -1.79674,-1.42181 -2.09539,0 -3.81683,1.83342 -4.37881,4.79047 1.60951,-0.22468 6.17555,-1.01053 6.17555,-3.36866 z m -90.84852,22.6422 -0.0749,-0.14971 1.08546,-6.25004 2.31984,-16.73008 c 0.0757,-0.44854 -0.0367,-0.67336 -0.33673,-0.78554 l -1.83388,-0.67411 0.41228,-2.84425 7.48486,0 -0.44853,2.99397 0.11182,0.0371 c 2.2079,-2.05871 4.52887,-3.40563 6.88646,-3.40563 3.21901,0 5.46427,2.05807 5.46427,7.48491 0,5.16501 -2.02094,12.8373 -8.98192,12.8373 -2.43264,0 -3.78014,-0.93565 -5.16516,-1.90869 l -0.82311,5.61357 c -0.0376,0.41212 0.0356,0.56148 0.52347,0.59873 l 3.78017,0.37469 -0.41234,2.8069 -9.9925,0 z m 7.48553,-13.28615 c 0.93528,0.78598 2.17068,1.45946 3.55568,1.45946 3.03118,0 4.15411,-4.26682 4.15411,-7.56009 0,-2.2083 -0.52366,-3.66812 -1.94612,-3.66812 -1.49686,0 -3.40583,1.6095 -4.75323,2.80736 z m 89.44624,5.35147 0.37469,-2.80694 1.72154,-0.2248 c 0.52388,-0.0753 0.5988,-0.1869 0.67374,-0.74827 l 1.57152,-11.41514 c 0.0365,-0.41155 -0.0368,-0.67336 -0.3741,-0.78554 l -1.87181,-0.67411 0.41215,-2.84425 7.41037,0 -0.48647,3.36865 0.11241,0.0749 c 1.45966,-2.09562 3.55581,-3.81702 5.95085,-3.81702 0.8232,0 2.2457,0.14982 2.88225,0.33688 l -0.93613,6.81148 -4.37882,-0.14982 -0.11196,-1.94633 c -0.0371,-0.33677 -0.11284,-0.44891 -0.41252,-0.44891 -0.71092,0 -1.87116,0.86067 -2.91921,1.94635 l -1.30904,9.50637 c -0.0757,0.59903 -0.0368,0.71124 0.52367,0.74874 l 3.55571,0.29932 -0.41234,2.76961 -11.9765,0 z"
+ style="fill:url(#linearGradient5134);fill-opacity:1;stroke:none"
+ id="path5080" /></g><path
+ fill="#E2E2E2"
+ d="M256.023,135.437H196.36c-16.432,0-29.8,13.368-29.8,29.8v73.527c0,16.432,13.368,29.8,29.8,29.8h59.663 c16.433,0,29.801-13.368,29.801-29.8v-73.527C285.824,148.805,272.456,135.437,256.023,135.437z M191.561,165.236 c0-2.646,2.153-4.8,4.8-4.8h59.663c2.647,0,4.801,2.153,4.801,4.8v73.527c0,2.646-2.153,4.8-4.801,4.8H196.36 c-2.646,0-4.8-2.153-4.8-4.8V165.236z"
+ id="path3" />
+<path
+ d="m 531.664,250.155 h 18.498 l -2.809,18.064 h 5.59 37.586 l 2.6,-17.718 c 4.98,-1.091 9.133,-3.455 12.512,-6.693 3.084,4.075 8.566,7.37 18.252,7.37 6.338,0 12.775,-1.807 17.174,-3.687 4.254,2.399 9.463,3.687 15.459,3.687 3.088,0 6.236,-0.355 9.426,-1.023 h 67.135 l 3.354,-24.827 -5.445,-0.764 1.879,-13.356 c 0.371,-2.386 0.449,-4.66 0.449,-6.156 l -0.008,-0.375 c -0.457,-12.191 -8.139,-19.765 -20.045,-19.765 -2.404,0 -4.623,0.314 -6.676,0.852 h -34.189 l -0.035,0.244 c -2.527,-0.701 -5.41,-1.096 -8.686,-1.096 -3.801,0 -7.406,0.555 -10.76,1.598 l 0.105,-0.746 h -12.467 l 1.826,-12.951 H 615.08 l -1.846,7.658 c -1.373,5.704 -2.213,5.793 -4.453,6.03 l -4.508,0.477 c -3.049,-1.424 -6.357,-2.065 -9.602,-2.065 -2.135,0 -4.275,0.284 -6.416,0.852 h -19.291 c 0.502,-1.772 0.775,-3.674 0.775,-5.678 0,-9.601 -6.846,-16.305 -16.646,-16.305 -11.055,0 -18.775,7.721 -18.775,18.776 0,0.951 0.082,1.869 0.219,2.764 -2.135,-0.288 -4.277,-0.409 -5.553,-0.409 -2.053,0 -4.072,0.288 -6.045,0.852 h -31.342 c -2.74,-0.553 -5.641,-0.852 -8.537,-0.852 -7.138,0 -13.492,1.674 -18.808,4.723 l -3.451,-1.461 c -3.711,-1.571 -11.232,-3.262 -18.979,-3.262 -8.933,0 -16.383,2.56 -21.576,7.016 -3.265,-4.473 -8.523,-7.016 -15.228,-7.016 -4.822,0 -9.021,1.477 -12.572,3.44 -2.996,-2.204 -6.796,-3.44 -11.115,-3.44 -2.327,0 -4.48,0.315 -6.476,0.852 h -33.963 l -0.035,0.245 c -2.526,-0.702 -5.41,-1.097 -8.687,-1.097 -20.458,0 -35.307,16.031 -35.307,38.117 0,17.363 10.785,28.149 28.148,28.149 3.087,0 6.236,-0.356 9.426,-1.023 h 88.816 c 3.706,0.676 7.669,1.023 11.154,1.023 8.907,0 16.278,-2.375 21.51,-6.593 4.872,4.252 11.585,6.593 19.728,6.593 3.053,0 6.206,-0.368 9.286,-1.023 h 44.664 2.069 z"
+ id="path5"
+ inkscape:connector-curvature="0"
+ style="fill:#e2e2e2" />
+<path
+ fill="#F5F5F5"
+ d="M255.023,133.437H195.36c-16.432,0-29.8,13.368-29.8,29.8v73.527c0,16.432,13.368,29.8,29.8,29.8h59.663 c16.433,0,29.801-13.368,29.801-29.8v-73.527C284.824,146.805,271.456,133.437,255.023,133.437z M190.561,163.236 c0-2.646,2.153-4.8,4.8-4.8h59.663c2.647,0,4.801,2.153,4.801,4.8v73.527c0,2.646-2.153,4.8-4.801,4.8H195.36 c-2.646,0-4.8-2.153-4.8-4.8V163.236z"
+ id="path7" />
+<g
+ id="g9">
+ <g
+ id="g11">
+ <path
+ fill="#FBFDF8"
+ d="M195.361,251.626c-8.161,0-14.8-6.64-14.8-14.8v-73.527c0-8.161,6.639-14.8,14.8-14.8h59.663 c8.161,0,14.8,6.639,14.8,14.8v73.527c0,8.16-6.639,14.8-14.8,14.8H195.361z"
+ id="path13" />
+ <path
+ fill="#F0F4E1"
+ d="M255.024,152.499c5.964,0,10.8,4.835,10.8,10.8v73.527c0,5.965-4.835,10.8-10.8,10.8h-59.663 c-5.964,0-10.8-4.835-10.8-10.8v-73.527c0-5.964,4.835-10.8,10.8-10.8H255.024 M255.024,144.499h-59.663 c-10.366,0-18.8,8.434-18.8,18.8v73.527c0,10.366,8.434,18.8,18.8,18.8h59.663c10.366,0,18.8-8.434,18.8-18.8v-73.527 C273.824,152.933,265.391,144.499,255.024,144.499L255.024,144.499z"
+ id="path15" />
+ </g>
+ <defs
+ id="defs17">
+ <filter
+ id="Adobe_OpacityMaskFilter"
+ filterUnits="userSpaceOnUse"
+ x="176.562"
+ y="144.499"
+ width="97.263"
+ height="111.127">
+
+ <feColorMatrix
+ type="matrix"
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ color-interpolation-filters="sRGB"
+ result="source"
+ id="feColorMatrix20" />
+ </filter>
+ </defs>
+ <mask
+ maskUnits="userSpaceOnUse"
+ x="176.562"
+ y="144.499"
+ width="97.263"
+ height="111.127"
+ id="SVGID_1_">
+ <g
+ filter="url(#Adobe_OpacityMaskFilter)"
+ id="g23">
+
+ <image
+ overflow="visible"
+ width="422"
+ height="480"
+ xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEBLAEsAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAAAg2AAAQ4QAAF1b/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAeMBqQMBIgACEQEDEQH/ xACjAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAgEBAQAAAAAAAAAAAAAAAAAAAAEQAAEDAQQKAwAC AwEAAAAAAAABAwQCMRMUBRBQEjMVJQYWNgcgESEwI5AiMkARAAEBAwsEAQIFAwUBAAAAAAABMQID EFAycqOz0wQ0RaURIXGRIEFRMGEiExRAgRKh0SMzQxUSAQAAAAAAAAAAAAAAAAAAAJD/2gAMAwEA AhEDEQAAANUJsrZYFfFgV8WBXxYEL0ki5fo6GjJuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRu aRuaMHQ5dR3ojnJ9XxYFfFgV8WD0jxf2AodbslbAD6mDhlpLvI/qkuiovZL7CGzNfRCJwQacEGnB Bp0QSdEEnRBJ0QSdEEnRBJ3BBpwQacEHidwQXzPfBA6bBqK5w2nlKVH3iJitt+gAeweP+wFDrdkr Y+vmaN02k6+e3d2Gjo6N0c2zoyaM7xozuGluGluGluGluGluGluGluGluGluGluGluGnG8c/z1YO PVIfJF80xoIGPsfBVVrl6hIrD7+B7B4/7AUOt2StnXaYyxHTJ6ZKvrqb4x9MgAAAAAAAAAAAAAAA DGR8692Dh4pbkIKJscTVNiLdVY1+weP+wFDgJ+JLJORs3XbIc3dGz6ZAAAAAAAAAAAAAAAAAAAPn R0ayMi5uLqv1S51eIT2Dx/2AofB38Ra5uIm6kOzm6o+gAAAAAAAAAAAAAAAAAAAPj7+TkjJWNIOt 2et1WfYPH/YIofH2cZcJyEnKkenn6IyAAAAAAAAAAAAAAAAAAABjODmjZONIWt2WtVWPYPH/AGCK Hx9nIXGcg5ypLfo3xkAAAAAAAAAAAAAAAAAAADGcHPGyUaQ1astaqseweP8AsEUPk6+QuM7BTtSW 7TujIAAAAAAAAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f9gih8nXyFxnYKdqS3ad0ZAAAAAAAAAA AAAAAAAAAAxnBzx0jHENWbNWarHsHj/sEUPk6+QuM7BTtSW7TujIAAAAAAAAAAAAAAAAAAAGM4Oe OkY4hqzZqzVY9g8f9gih8nXyFxnYKdqS3ad0ZAAAAAAAAAAAAAAAAAAAAxnBzx0jHENWbNWarHsH j/sEUPk6+QuM7BTtSW7TujIAAAAAAAAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f9gih8nXyFxnYK dqS3ad0ZAAAAAAAAAAAAAAAAAAAAxnBzx0jHENWbNWarHsHj/sEUPk6+QuM7BTtSW7TujIAAAAAA AAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f8AYIofJ18hcZ2Cnakt2ndGQAAAAAAAAAAAAAAAAAAA MZwc8dIxxDVmzVmqx7B4/wCwRQ+Tr5C4zsFO1JbtO6MgAAAAAAAAAAAAAAAAAAAYzg546RjiGrNm rNVj2Dx/2CKHydfIXGdgp2pLdp3RkAAAAAAAAAAAAAAAAAAADGcHPHSMcQ1Zs1ZqseweP+wRQ+Tr 5C4zsFO1JbtO6MgAAAAAAAAAAAAAAAAAAAYzg546RjiGrNmrNVj2Dx/2CKHydfIXGdgp2pLdp3Rk AAAAAAAAAAAAAAAAAAADGcHPHSMcQ1Zs1ZqseweP+wRQ+Tr5C4zsFO1JbtO6MgAAAAAAAAAAAAAA AAAAAYzg546RjiGrNmrNVj2Dx/2CKHydfIXGdgp2pLdp3RkAAAAAAAAAAAAAAAAAAADGcHPHSMcQ 1Zs1ZqseweP+wRQ+Tr4y5TkHOVJb9G+MgAAAAAAAAAAAAAAAAAAAYzg542SjSGrVlrVVj2Dx/wBg ih8fZxlxnIKcqT6ObpjIAAAAAAAAAAAAAAAAAAAGM4OeNkY0h61Za1VY9g8f9gih8Xbwlxm4GbqW 6uLrj7AAAAAAAAAAAAAAAAAAAA+fr5OaNkI0ia1Y61Vb9g8f9gihxknCl1m65N1OdsZ3x0ZxkAAA AAAAAAAAAAAAAAAAx8fek5ozui6jazYKsRPsHj/sEUOu2Ktlqn6XZ6scjBSRLbOPpjYxkAAAAAAA AAAAAAAAAAYfJjm+uM0xXVE1xVOZr0Y9g8f9gKHW7JWz7s1W6i9SdYlasXXB9pLbI7fHY5/s3NeT 7fGT6fI+nyPp8j6fI+nyPp8j6fI+nyPp8j6fI+nyPp8D7x8fJtxp1m7Tp5jbw/MfWIjbXTk5SHsH j/sBQ63ZK2AdthqO8vXbUZWrJ0V/oJ7ZB7Sa+ofJMIkS6IySyJRLIkSyJEsiRLIkSyJEsiRLIkSy JVLYiRLYicEr8xfwSemN0kjy8PIdkfxQp0xWEAPYPH/YCh1uyVsAAz08ome2si37qZkumaULspIu 2aRkuyki7KSLspIuyki7KSLspIuyki7KSLtilC6qSLtilC6fNNFu5qz8k7wcI+vkAAHsHj/sBWoQ AAAAAAAAAAAAAAAAAAAAAAAAAHpAf//aAAgBAgABBQD/ACi//9oACAEDAAEFAP8AKL//2gAIAQEA AQUA6w6rz/LM+776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvv qs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qz vvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++ qzvvqs776rMfLPYHlHyRFUbivuDeUv1FOSVKJkRwE4CcAOAHADgBwA4AcAOAHADgBwA4AcAOAHAD gBwA4AcAOAHADgBwA4AcAOAnARciFyRUK8ndQcgyGxaaqf4fYHlHwRFUjZe68RsqbpGoKIUQkKYY kISEYJDAmBMCYEwJgTAmBMCYEwJgTAmBMCYEwJgTAmBMCYEwJgTAmCQWELCKoSFcNByEhIyxusk5 VVQV0VUL8vYHlGltupyqDlaIMREQaijcUoilMUSKgkZDDIYZDDIYZDDIYZDDIYZDDIYZDDIYZDDI YZDDIYZDDIYZDDIYZDDIYZDDIYZDDIYZDDILGQWKVRSuKORR2KPRCZltDiSYrjFXx9geUaG26nKs vy9KEjxhmONRxuOUMFLAjIjJdF0XRdIXSF0hdF0XRdF0XRdF0XRdF0XRdF0XRdIXSF0hdIXRdCsi sisFTBXHHY49GH4xMhU10y4tTFfw9geUCJ9rlcL6SNHGGBlgbZKGilsShDZQ+kPr/wBX0fSGygtC CtoVNDjI6wPsElgzCGjlLrdTden2B5QZfGvnYbCIkdkYZGmihsSn61ItJXQOtD7JIZJTBm0X6+Hs DyhP1cpjbLcVojtDLY3QIn1qZU+yugebJDRKaJ7CVUvtq27o9geURaLx6C19JFbI7Y1QU0/WqFQd oH6CS2TG/wAzZrZd0ewPKMqo2n4VH5FoGKBunVTifj9JJpJdBnVH+mj2B5RkqfdcOki0jFJQn5qm pPx5CTSS6TOKf6tHsDyjI0/2hIRU/GUKbNU1DyfklCWhm6f06PYHlGRf9QkIqfjKCWapWx4kkszj daPYHlGQ2wrItjImqlseJJMM43Wj2B5RkNsEjWNarUeJJMM43Oj2B5RkNsEjWNarUeJJMM43Oj2B 5RkNsGyLY1qtR6ySTDONzo9geUZDbBsi2NarUesk2TDON1o9geUZDbBsjWNarUesk2TDON1o9geU ZDbBsjWNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDb BsjWNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsj WNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNa rUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUe skkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskk wzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskkwzj daPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskkwzjdaP YHlGQ2wbI1jWq1HrJNkwzjdaPYHlGQ2wbItjWq1HrJNkwzjdaPYHlGQ2wbItjWq1HrJJMM43Oj2B 5RkNsGyNY1qtR4kkwzjc6PYHlGQ2wSNY1qtR4kkwzjc6PYHlGQ2wrItjImqlseJJMM43Wj2B5RkV sJSKv4yolmqVseJJLM43Wj2B5Rkf/UJSKv4ypTZqmoeX8kqS1M43Oj2B5Rki/wC0Koi1DKlC/mqa h5SSpLUzdf6tHsDyjJ6/p2HURaxiobX81TWv4/USaiXUZy59N6PYHlGXubEiE5+RaxisaqEXVCjl Q/WSayXX+Zy59ro9geUUVbNeXPpVRFdI7gzWUVfeqK6h2skOElwmu/ST3bx/R7A8oMpk/SxHiM8M OjThTX9iLqWqr6HHB50kOkp4zSVsUVKqro9geUDLit15fLSumM+MPjTw26UuCVH2moPsWoqcK3R1 4feJD5MkIiTpKvO6fYHlGiFLViuHLSpGJAzIGnyh8peKXRHEEcQ20NtDbQ2kNpDaQ2kNpDaQ2kNp DaQ2kNpDaQ2kNpDaQ2kNpDaQ2kNpDaQ20NtDbQVxBXEFdKnit8cfHpA/IJMn6TMp+0vw9geUaYU+ pmqJNprRmUNSRuSUSSmQgkgSQI+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X4r4sgWQV SCuSOSR2SPSiRLREzDMlUVVVfh7A8o+EeW4wsTNKKxmYijcsollMspliSxJZjDGIYxDGIYxDGIYx DGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxBZYssqllUsrljksdmISsxooSVmLjyqq r8vYHlHxRVRWZ77QznNI3mzSlGZUKU5hSJmKHEUOIocRQ4jScRQ4ihxFDiKHEUOIocRQ4ihxFDiK HEUOIocRQ4ihxFDiKHEUOIocRpOIocRQ4ihxFBcxQXMEKsxpHM1aQezmhB/M3nCquqtfn7A8o/hS utC9dL50vnS/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/ eL50vnS9dLytT7X+PrDhvHuTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOT HJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY/pP/aAAgBAgIGPwBR f//aAAgBAwIGPwBRf//aAAgBAQEGPwCPk8jmv2su47DV1z9uE90V5xHl7vuKrTXWMHDNdYwcM11j BwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHD NdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11 jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMH DNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDP+z/AEd/2MzUhXbvz7H6XVO/ Y7vFJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkp+le p3d6ndOn4OZqQrt349EOqp0QT9PVfzGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGC9X RVh9/wAjo8nRfnmakK7d+H+LqdVEefTqonYYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBg wYMGDBeqd/uKip2+/wAszUhXbsqOutURVT9SidhgwYMlZ/XsGDBgvYVFQVOnb6fHM1IV27J0QR95 O6idhOwyaWC9hU6d/oK6v0+GZqQrt2RFVOyCdhBJrUU/cRO6N+GZqQrt06CL07qIJNiijydGjzsu ZqQrt0dd/MRBBJsUUU/y+8uZqQrt06/YQQSbFFFOv2WXM1IV26KIJNyij0uZqQrt0e8iCTcoo/Lm akK7dHvIggk2KKKPy5mpCu3R7yIJNyij8uZqQrt0e8iCTcoo/LmakK7dHvIgk3KKPy5mpCu3R7yI JNyij8uZqQrt0e8iCTaooo/LmakK7dHvIgk3KKPy5mpCu3R7yIJNyij8uZqQrt0e8iCCTaoo/Lma kK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7y IIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo /LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu 3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCC Taoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCTcoo/LmakK7dHvIgk2qKKPy5m pCu3R7yIJNyij8uZqQrt0e8iCTcoo/LmakK7dHvIgk3KKPy5mpCu3R7yIJNyij8uZqQrt0e8iCCT aoo/LmakK7dHvIgk3KKPy5mpCu3R4QSblFHpczUhXboqfcQQSbVFFT7y5mpCu3RPzEEEmxRRRHZc zUhXbojyfRR1RBJsUUUX7JLmakK7dk/bVfAgk2KKL37qwVV+suZqQrt2RHk+giook2L3F7i9GJ8M zUhXbsqItFRFRRO40aNmVo0aL3FhuL5+OZqQrt34I69REVFGjRo0aNGjf6po0aNGjRo0XuK5DXv9 zqrV+OZqQrt349UXt9hEVeijRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0Xq9/YVH V6OnVflmakK7d+XVOw3qh0e7FM7PJ7KQ0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRpSKaH6V6nR 3sh1eXr+BmakK7d/C7KqFJfZTX2U19lNfZTX2U19lN72U3vZTe9lN72U3vZTe9lN72U3vZTe9lN7 2U3vZTe9lN72U3vZTe9lN72U3vZTe9lN72U19lNfZTX2U19lNfZSX2d3l/Ej/wAj/wCf+7/jD6/y f5/7tBOnX+L/AMfr+5tPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPK m08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptP Km08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKn/jan//Z"
+ transform="matrix(0.24 0 0 0.24 174.5615 142.499)"
+ id="image25">
+ </image>
+ </g>
+ </mask>
+ <g
+ opacity="0.09"
+ mask="url(#SVGID_1_)"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ id="g27">
+ <path
+ fill="#1D2915"
+ a:adobe-blending-mode="normal"
+ a:adobe-opacity-share="0"
+ d="M195.361,251.626 c-8.161,0-14.8-6.64-14.8-14.8v-73.527c0-8.161,6.639-14.8,14.8-14.8h59.663c8.161,0,14.8,6.639,14.8,14.8v73.527 c0,8.16-6.639,14.8-14.8,14.8H195.361z"
+ id="path29" />
+ <path
+ fill="#1D2915"
+ a:adobe-blending-mode="normal"
+ a:adobe-opacity-share="0"
+ d="M255.024,152.499 c5.964,0,10.8,4.835,10.8,10.8v73.527c0,5.965-4.835,10.8-10.8,10.8h-59.663c-5.964,0-10.8-4.835-10.8-10.8v-73.527 c0-5.964,4.835-10.8,10.8-10.8H255.024 M255.024,144.499h-59.663c-10.366,0-18.8,8.434-18.8,18.8v73.527 c0,10.366,8.434,18.8,18.8,18.8h59.663c10.366,0,18.8-8.434,18.8-18.8v-73.527C273.824,152.933,265.391,144.499,255.024,144.499 L255.024,144.499z"
+ id="path31" />
+ </g>
+</g>
+<g
+ id="g33">
+ <g
+ id="g35">
+ <linearGradient
+ id="SVGID_2_"
+ gradientUnits="userSpaceOnUse"
+ x1="225.1929"
+ y1="152.499"
+ x2="225.1929"
+ y2="247.6265">
+ <stop
+ offset="0.0123"
+ style="stop-color:#C1D72F"
+ id="stop38" />
+ <stop
+ offset="0.1394"
+ style="stop-color:#BCD631"
+ id="stop40" />
+ <stop
+ offset="0.5859"
+ style="stop-color:#AFD136"
+ id="stop42" />
+ <stop
+ offset="1"
+ style="stop-color:#ABD037"
+ id="stop44" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#C1D72F" />
+ <a:midPointStop
+ offset="0.3086"
+ style="stop-color:#C1D72F" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#ABD037" />
+ </linearGradient>
+ <path
+ d="M184.562,236.826c0,5.965,4.835,10.8,10.8,10.8h59.663c5.964,0,10.8-4.835,10.8-10.8v-73.527 c0-5.964-4.835-10.8-10.8-10.8h-59.663c-5.964,0-10.8,4.835-10.8,10.8V236.826z"
+ id="path46"
+ fill="url(#SVGID_2_)" />
+ </g>
+ <defs
+ id="defs48">
+ <filter
+ id="Adobe_OpacityMaskFilter_1_"
+ filterUnits="userSpaceOnUse"
+ x="184.562"
+ y="152.499"
+ width="81.263"
+ height="95.127">
+
+ <feColorMatrix
+ type="matrix"
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ color-interpolation-filters="sRGB"
+ result="source"
+ id="feColorMatrix51" />
+ </filter>
+ </defs>
+ <mask
+ maskUnits="userSpaceOnUse"
+ x="184.562"
+ y="152.499"
+ width="81.263"
+ height="95.127"
+ id="SVGID_3_">
+ <g
+ filter="url(#Adobe_OpacityMaskFilter_1_)"
+ id="g54">
+
+ <image
+ overflow="visible"
+ width="356"
+ height="414"
+ xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEBLAEsAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAAAXBAAALIQAAEOP/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAaEBawMBIgACEQEDEQH/ xACYAAEAAgMBAQAAAAAAAAAAAAAABAcBBQYDAgEBAAAAAAAAAAAAAAAAAAAAABAAAAMIAwEAAgMB AAAAAAAAAAIGATIDBBQFFjZQMwcRECKQMRMSEQABAgQEBgEBBwQDAQAAAAAAAQIxcgMEEFCRsyGC M6PTNBFBIGFxEiIyE1GB0UKhscFiEgEAAAAAAAAAAAAAAAAAAACQ/9oADAMBAAIRAxEAAADy0npz Z0Dnx0DS7Q9kr0IKcIKeICeICeICeICeICeICeICeICeICeICeICeICfggp2CElQD1aXxOgc+O1s um7kKj5vpObG6d2Q9zspRA9JmSGmCHmWIiWIiWIiWIiWIiWIiWIiWIiWIiWIiWIiWIaYIeJo1sPe 4OK5C2tCVS3OmN5clN3IVHod9EOv6zWb0zkAAAAAAAAAAAAAAAAAMRJnwcVXltVuetyU3chUfp5+ 5YexhTgAAAAAAAAAAAAAAAAABjODUVxZNbnjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwaut rJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAA AAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjy Cx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1t ZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAA AAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQ WPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautr JrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAA AAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyC x5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZ NbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAA AAAAAAABjODV1tZNbHjclN3IVH7+HqWTO1uxMgAAAAAAAAAAAAAAAAAYzg1Vb2NXB5XJTdyFRx5G jLc3XG9SS2MgAAAAAAAAAAAAAAAAD4+ohqq47GvTa3JTdyFR830nNm/7qp+gLVk8fuDcZgehLRBL RBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBKQohP0MbkT40OcG8uSm7kKj5vpObAJm45sd n98SO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3xxI7PX84JcQAN5 clN3IAAAAAAAAAAAAAAAAAAAAAAAf//aAAgBAgABBQD+G3//2gAIAQMAAQUA/ht//9oACAEBAAEF AFgq7/bL9narGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxn arGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qx narGdqsZ2qxnarCYVyhn78PQNo/MCUmJhssm48QEScNrGJGEMQgjEIIxCCMQgjEIIxCCMQgjEIIx CCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIQakYQOlI bGTCajw2R5SPLm/KK2gegbR+LVYzzDZGzFKyBaysYS3FYGSBBQkFCQUJBQkFCQUJBQkFCQUJBQkF CQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQNkCA9uK0R7WVrJ+ykMy6WI8BrW NY0IraB6BtAsdqbMHtttYxkvKFKxhCs4JpCtExKFMy5W5jWX22NgRAitoHoG0SsBsePZZFhSSkuw peFm5dhi3qRKYk1BbAjoraB6BtCcl/8ASYtUBjCkL8Lwp2fS3WCxpVDA/wA5lFbQPQNoShGNLbif CcM3+roX9VQz4ZFbQPQNoSLP0t7P04e5uql5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW 0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5F bQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnk VtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqe RW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp 5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6q nkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubq qeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5u qp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m 6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSLlvb+nD3N1UvIraB6BtCTN8Jbj /ScM3+rob9VQ36ZFbQPQNoTUx/xGtcdjSlb9ZwsRvwt1jMYVRR/+5hFbQPQNokZinmbPOsaWVjsM XhZuOwpbxOsYWcjtjzCK2gegbQLDdv8ANtuuDGsgTJTMYZjeCaZjBHmSlZcbgxjL9dGxDBFbQPQN oDGtK2z31pBJXYrWQLmVrCz5Whk8QVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFa QVpBWkFaQVpBWkFaQVpBWkFaQVpBWkDZ4gNPkYI9zKxk7dysZdr80zTGaZoRW0D0DaPzK3Oalmyy oYwEVEv8yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGV S4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXB1RL/JlUMMyauU1Mt/KK2gegbRxaK2jj/wD/ 2gAIAQICBj8AG3//2gAIAQMCBj8AG3//2gAIAQEBBj8Ar2djdfxW7G01az+Ok74VzEcvF7FWJ73Z o+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+ M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M9 7s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s 0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+Ms7O7u/5Leq5yVGfx0m/KIxzotYixTC5kpbbfsfFJir 9/0EWo74+5qHH8y/3IO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1U g7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1U4fmT+5803fP3Kn+D4qsVP v+n2LCd22/C5kpbbcUqVkX4+jf8AIiI34QTgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIEBe AqK1FRfuFqUE/SkWf4PhY4WE7tt+FzJS224JWqJw+f0ov/YnATgcMi4i8BeAtdifpX9yf+4WE7tt +FzJS22jKSfVeP4DUROCCcMmXgORU4KPpL/qvD8CwndtvwuZKW20dUVIcEE4Hxkyi8BHon7uC/2L Cd22/C5kpbbT5/8AoTKFG/iWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttp zKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+Fz JS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu 234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFG zFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZ RMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZK W205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22 /C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2Y sJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJ lCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS2 2nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzCZQo38SwndtvwuZKW20dTVfvQQ+cmUXiI xFhxUsJ3bb8LmSlttGVPp8/C/go1fkTjky8RyqsB9T6KvD8CwndtvwuZKW23BKNR3wqftX+qCcRO JwyLiLxF4i0Ka8V/cuFhO7bfhcyUttuCKi/CpBRtOs74cnBF/qJ+oiRIkSJEiRIkSJEiRIkSJEiR IkSJEiRIkSJEiRIkReIv6hadFfl31d9EFc5flViuFhO7bfhcyUttv2ERrvzNT/VT4qIrf+TqIdVD qodVDqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTq pqdVNTqpqdVNTqpqdVDqodVDqC/xorl0F/O74av+qfYsJ3bb8LmSlttyywndtvzD/9k="
+ transform="matrix(0.24 0 0 0.24 182.5615 150.499)"
+ id="image56">
+ </image>
+ </g>
+ </mask>
+ <g
+ opacity="0.35"
+ mask="url(#SVGID_3_)"
+ a:adobe-opacity-share="1"
+ id="g58">
+ <path
+ a:adobe-opacity-share="0"
+ d="M184.562,236.826c0,5.965,4.835,10.8,10.8,10.8h59.663 c5.964,0,10.8-4.835,10.8-10.8v-73.527c0-5.964-4.835-10.8-10.8-10.8h-59.663c-5.964,0-10.8,4.835-10.8,10.8V236.826z"
+ id="path60"
+ fill="#1D2915" />
+ </g>
+</g>
+<linearGradient
+ id="SVGID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="226.1924"
+ y1="159.7139"
+ x2="226.1924"
+ y2="200">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop63" />
+ <stop
+ offset="0.3788"
+ style="stop-color:#F8FBF3"
+ id="stop65" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop67" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.4383"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+</linearGradient>
+<polygon
+ fill="url(#SVGID_4_)"
+ points="221.189,159.714 214.142,180.951 224.048,180.951 214.142,200 238.243,173.61 227.655,173.61 236.978,159.714 "
+ id="polygon69" />
+<g
+ id="g71">
+ <g
+ id="g73">
+ <g
+ id="g75">
+
+ <image
+ overflow="visible"
+ opacity="0.75"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="392"
+ height="242"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYwAAAD2CAYAAADF97BZAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAHohJREFUeNrsnYlu40gSBZMU5Z75 /4+dbUsiFwtY2JrqvIqHSEoRACFZPtqk3BV8WVcvAAAACXouAQAAIAwAAEAYAADwWgYuwSp0XAKA wzJxCRAGIgCANf8fIxaE8RIxIBaA8yeMDokgjLkNfLfyzwOAfWTRNX49EkEY5h9N6+sIAuC8/++n mXKZjJ/5UfIYPuyPRXut9WOEAXDuxOGJYEqKZPpEebyjMOYKoTO+BmEAfIYwSjG0JJFaHm8rjncS RkYE2uutwkAgAO8liezzTPqY3jl1vIMwooa+fi0SRvQzshIBgHMKYwpez5Su3jJ1nFUYLWWlznne KpHW5AEAx5fF5Aijfi0jDy91nFocZxRGJgnUMvDkkf3arDiQCMD+YshIwxKE93xy5CGJ1HFqcZxJ GEsE4b0WHa3JA2EAHEcYU8PjlJREdESp47TiOIMwIlG0yqEPPl4iDmQBcCxpZMtOmWNs+Fy2n6M7 kzSOLIy5oogk0SsfZwWCNADeSxhZMYzGYy2I8uslIY5TpY2jCiMzsikjCO2xDz4fiaNFGggDYD9h LJGF9uh9rq8+7hxxWLI4vDiOJozsKCdPFJoc5ry2JG0gDYDzJouxOrTXLJHUsuiKz4uROurS1GHL VEcShpcqNGFoZSZLBBfla6zXO0MeGXGQMgCOkyyyopgCMfzveDifs44yRdQlLKtEdei0cRRhaLKI UkXZoFtCeH7uUn3dJfF9UV8HwgA4tzDG6nktjYfy/OF8zhJLZ0hjEns01SHTxt7C8EpQmdKTlhQu lSguxmu1TLSfNac8hTQAji+MMZEsahHUx6g8743v1aQxOudzSGnsKYyoBOUlCk0StQQGRRrW4aUO bWRVpj8DYQDsI4xaFJEwPFk8FGHcDYGUR1/Jon7uzf84bIlqL2FkS1BWP8XFSRKDIozBEclgiMPq CJ8rDSQCsI0cWmWRTRaWDO7BYy2OXhFH2SE+BudymLSxhzAsWbSkCk8S3vNBkUdGGJE06pTUIgTE AbCOKLRylCYNqxyVTRV347gYX9sr4nhUotDKVPXw292l8WphtMrCSxWeEOrjqghDE0hUlrKkYaUL ZACwj1S8lBGli1oYWpL433Eznl8qWdxFL2trfRsiev/GIaTxSmFkJ99po5+0RBHJoXy8Bt+j9WmU /743qU/E7vxGGgD7JBBrCRCvs9sqRd2NZHErRDEY4iiTxV1p72ppiPx/IqDVr7GbNF4ljBZZaKnC E0UtBu3jq5E0PGFcgpJUH8gCcQDsJworXWQTRiSMWyWM5/Oheu3ZltzFLmk/lPbhkCOoXiEMreHM 9FVYsrhWz8vjS3lNE8dglKiyHd9ewqAsBbB/KcoThjbvwhpCG6WL8vgu2pRb0XbdnGpFKY26vbCG 3u4mja2Fkemz8EpQZWOulZq+gkdNIlFZaq4wBGkAHFYWIm2d3lG6uFeiKNPFt9Ku3ESfEOyJY3TS xi7S2FIYc2ThpQpLFF/Bx6U4auFckiWpFlkgCoBjiCPb8T01Jow6WVx/JHEtZPEt+oCaaD6XRUYa b1OSapXFEJSdsodVporKUZlRUpEsEAbAcaWhpYx6WK02lPamSKOWxVBIo1UY3QJpbC6PrYTROhLK SxW1LH5VUvhlvG5JQ0sXWv/FReYNp0UaAPvKYq4wxoQwvIQRlbojYayRNDaVxhbCaFmKXJNFPcrp q5LFL0UUGWlE6UJ7Y7MT9hAGwDmFEaUMb/5F3X/hjb70hulnZVFL4/Sd3l2iLNUHsrBKUL+M48v4 2EoX0ZvqlaIEYQCcWhalNKwNkrz5GPeftuRWtCk30ed8aUsYzU0WdZoo25ZaHJsJZMuSVMs8i6iv opbEX4FAnt+jdXZnZaEtby6IAuBtUsac/oxaGoPy6A2mWZoupiJldK8uTa0pjLmlKK2DOxLFX8br WllKG5Lbsn4UO+0BII1B/uzLqG9Av+XPKQHZNsU7H22IcF2e0qRx2ISRkYU1g3sISlB/KY9/OUlD 67vIyOKSKEO1JAzEAbCfKFqF4c0CL1PGUKSNm9hr1LXchHYJWYjoy4RYZSnZQhxbz8OIRDEYwvhl SOIvQxh/KenC6+hu7eSOpIEwAM4hjCXSuBRp47lW1F1p16wtoFvShSYLa++MUV7Un7GGMFpKUV66 qPssaln8bUijFoY1u9vbOGnp8NkucX0A4LWyEGmbCT6KvnzIWMjiUcgjsyGbdQOa+V0nyW/p2r2i NLVmSWqJLLR0Ycnib6ck5U3S85JFy8KCSzq5kQfA9pJokUX52AdJo6/EkVmwdM6ci2nG0TmyWE0c S4URDaPN9ltkZPG3U5bS5l1kFhecu2w55SeAfcl0FncJgXh9G30hivqxXIE2Gl3ZO6KIymPZo0xI m/VjrFWSmjsqanBkYfVd/K2kC6uj25JFZ7yxraJAEADHF8pUvTYFjbZUd+5T0UY8hfEQfapAZnRl lCpG0eeHaB/XKcOS5CriGFZ6Qyx5aPMuhiBZ/FJkoaUMTRblMNpoFvfS3fOQBcB55DEp/3e9DuJa GE9ZWO1bpvRkNeZWp7u1Z0emNDUp579YGsOCNyBKF9HIqEFp7K1U4Q2lteZcWOu4tM6xoAQF8H7S EKN0Uz9qd/B90Xh3ku+r6IxUMTpHuWWsdvRGacrr09g9YWTnW7RM0rPKU9oyIN7CgpYs1twxD3EA HJcp+f9UuxPvFGnMFUUXpANLGJ5Qyu+t/+1Ddnp3iXKUNu/iy0gYvyQ/Qa8cGaUt+5FJFiJtI5+Q A8D50kVGIpNy0zgtkIYY/0b5PLOnuHZcqpTRK0nIK0+9TBjZLVfnzOrOJI0vQxbafAuvzyJbfmK4 LMB7JAzv/+zU8H+9lEZL2zApopgMcURHVJrqRO+72a0Pw0oX0YZIVsKIylDWkuVav0UpK2upj7mi QA4A504YnkCmoLpQfm/r3hbWarmRHJ5rV3kpwytNaalqljiGhRc+U4qKNkb6ctJFnSa0uRaaLC7J ZEEZCgCBRCOoLHFMxd19JuVEndyeMLIpo98yZcwtSWWXL5/bf/El9kioL7H3tYhmW1rpYm4pCgDe RyCt4pCigRaxZ297w2fHIFWU6aJ8HOTf61uVbd5mKWOYcVFb08Wc/bm1RQTrVFH3WViy6INUgSgA oEUcWn9HL7kFEOtS1BiIojy+5P97cdSlqUfVDnspYzZLh9Vq+3Rn5mBcE6KwtlgtReEli16YiAcA 64vDayt65XszQ2ejhFFu3FTuxfFQksYo+kitXfowOrFHSnmlqGgLVi9daEt9ZCbmibAzHgBsK46u kIFUlY3pp416CmNIlqNulShuRVtYbuB0r26aR6MsNYm/d8aqwpi7DEhm74urU36K9rTQ1p23Fg9E FgCwpjjqmeFdlTK8ctS1eNT2DP+qZPFVSOMm+grcUV/G4s7v1j6MOcuYe3MwNGl8KV8b7cFd/w4i /pR8RAEAc8QRSUOqlPH8+jpljEVJqZbGl5Iq6qPc7e9eScPry5AlKWONeRjeUNpLUI7SEsUg9sxt bwZ3L/RVAMBr04bXCT5Wpam6XF+WpK7y7z6Ka5EqynQxiL2DaC/xaKnNJ+5Fayi1jpQagtKTNXN7 SKSLaClhZAEAa6cNSxrlXX5fpYyxaNdqadyVdnBuyli187ufeaG0foJMyhgMMdSlp0wZykoXIu3b qAIAzE0b2nNtBGl2YdbBaRsHJ2W0rMg9q23sGy5My2S9PnExhsTFyG6BmHkDAQBeLRFNGpeqNOXt RJppG7Wb6i6Qxiz6hpP3RNIHCSNj0swF6WaUopAFALwyZWRvri1xXIL2sWVqQbR67qrCaEkaLUNr 6wtxCWRh7ZVryQFJAMAe0ojazWe7dWlsI6/JhKG1l6KUoma1lf3Ci2RdiGyyuIg+CspbRLA3TD7n jQQA2EIe0Y21Nw1hUB6z0sgkDC8dLRZGNlVkR0hZpSdLFpfkBVhkTgCADVJGZoM5qyLjyaN1o7hV +jH6mTHL2gcjugjWBfHKUN1WJw8AsFG6iGSRLeNn2spoFOlqbWXfeDG6IHK1ysI76cyOeaQLADhr maqfIY2L5Pt5rQ7vzYfVZspUfXC0CsLq5LbGEgMAnC1laP0Z1giqls7ubBl/k07vaOiYtp6TdjKa JKJJJ9n5FqQLADhj2vCG20Y33NlSVNfwu62SMLqkNb2E0SviyMzgXrUOBwDw4pThrY6R6QPOVmo2 7fvNTNzrgs9F9bhIHH3ihC07C+kCAE4mE00ctUCiakymhN+vfZPdz4gm2fHFXSALK0V409pFWPID AM6XNrwUklnANSpZzRlS29x+zllLqiVpZBKHNwoqE6OQBgAcXRTeIoCd0x564siW8K2RUs0MMy9E 9tBOwNv4KFtjQxwA8C5C8drOLlmlya4h5a21Fy513q948llbdo48okglQn8FAJxLCt68Ma1Bt9pD 7fW1O7q7LYQRxausLaPaGivPAsC7yyTbZnZiTznIyENk4UipfuZJtp68VXLyxJGZoEfaAIAzSaJl TtuaCWOVdrJ18UHrJCNZRFErU3ZCCgDwjglDa+u6GQkjszjr5sLIJI2oA8dLGtKYMBAHAJxVDJ4s Mmv1ZWURlaNeKgxJnmBmT9kueZFFKEEBwGdJJjui9CU7j/YrnJTX6Gcn3m1SbwMAOEnyyDT4SxNF tGrtLGF4nc3euN7MbMKsGDIlKMQCAO8kjeyNdIs0Vm0vt+jDiGQS2TVbtgIAOKMkoopMa5uaEc4q 9C+8EF4UmyMpAIB3Tx4tfcGb32T3G52sVzN7iQkBAA4ogJYbbetjbxe9zFp8s8v8/Y4XCQAAkeiN uwSJQiQ3qbn1Jn/zhNHNuDCR5RAKAHyKLDKfjxJG9t/YpdNbpH1/7ZY4BgDw6TKJSvWtW0Espt/g ROes/eQtxYtQAAAOsJFc/6KTmxPJAADAF8RL29F+5xMHAEAGfz5fvHfFFu1tf8ILCgDwbrLIrAi+ xs/+CGEAACCX/FpTm9x4IwwAgPMkka2+/jDCoJwEAPAGbSoJAwDgwxr+owuDlAEAcHJIGAAAgDAA AD6At5jpDQAAJAwAAPikdIEwAAAAYQAAAMIAAACEAQAACAMAABAGAAAgDAAAAIQBAAAIAwAAEAYA ACAMAABAGAAAgDAAAABhAAAAIAwAAEAYAACAMAAAAGEAAADCAAAAhAEAAAgDAAAAYQAAAMIAAACE AQAACAMAABAGAAAgDAAAQBgAAAAIAwAAEAYAACAMAABAGAAAgDAAAABhAAAAwgAAAEAYAACAMAAA AGEAAADCAAAAhAEAAAgDAAAQBgAAAMIAAACEAQDwMUwIAwAASBgAAHDOlIEwAADgUMKYuNQAAOdu F0kYAABwGGGQLgAA1mtHd2tTSRgAAOeThvX58vhYYZBSAOBTJDAl0sXU0EauJhESBgDA/tKoG/U1 GvnVk0a/08UhNQAArJtENqff4KQydbTpyBcFAODA0titA7xf+MtPM09YuwDT1nEKAOCEaSLqw5he 1Wb2K51c5hedErYkUQDAJ0ohalen4KZ9esXN9h4zvefIBQDgE6QxSVyJmSRXllq9xN9vdBEiM2ai FwDAp0hjMm6sWxKGN9oqandTbW+/0clnkkXr8DFkAgBnl8KcG+dJ/AFFU9DGZqUQ3uT3G1yUKGJ5 1pyEkVIA8BkCySSOKHVMiTZ2tfazn3liU/IEopPPXBhkAQDvKIu5N9JTcGx2o903xpLopDIXyJNB JIgp+XsCAJxBHNkb6czN+ZT8Ppl7Q96vcNItJxHZUoKTRBAA8K4CiYbIPp+PDW1t5qb+ZcKQwIxZ C3oJA2kAwLumi0w7OiqSGKWtI3yV9rNPntyc2KQdkRk9cQAAvIscJidZWG3mqHy89IZ804SR6Zix RDFWJzlK23Axz4zIBQDOJBCRuDQ/OqLItKOrDx5asw/DkoRmxFH5mlH8OhzDbQHg3WQRtZuZhDE6 clky9201YURlqDFIGGODGT0rAwCcVRxRKX9MtJ8tJarF7WffcIJZY3mmtKJVFK+s+AYAcBYxRJ+L Sk5jcMzp12iq2myVMFpO0CpXtdoRgQDAGSQSdW5bCePRII1R8h3tL1lLaq4kyhN/SNwhHtkaUQDA UdOFVRXxkoUmh0fQfmZK/SILy/t94mS9dUsiI3on6J209jNF4o5w5AEAZxFHNM/iURxLZbFKGT+7 ltSUSBjRCKjoRB/BBaQjHADOKAmvKqP1UTyM9jFqQz2BaL/D6sJoPenROdHoKC+EVdfLCAJ5AMCR xJGpzHg32I9EW9pSltosYXiiECNWRXW4R0PUmrOoFgDAEdOFJpEoSTyPe/U4VxpzfvdFCSNKGi1W fF6Au7T1a7SsagsAsHe6EMmVo7yb63tSFF5ZalHq6Gc2utnRUZEkshdgSpw8ogCAI6YLWUEUd+fj pQkj3W6uMXEvEkdWEnfR63abxSsAgBeki7k32Hfj0BJH3W5uMlqqbzh5TyCtUSpzEVpKU6QMADhi uvCE8VBuqj1R3IMb72iY7WLmrlabnXuRsWXGng/xZ4KTMgDgiOlCGiowLdKIOr6jzetm7ZGx1bDa TN/F87glLkhLR44IczQAYL90kZnYbI2EqtvEW4M8Mqt/L2of+4YLEfVfaOb0TvJWXIybcWE8e86Z owEAsJUsrOkGmVLUXZFG1D5mb7BXm4vRz7worQkjEsVNsanVqROtzLjYogAAM2URdXA/GtrIW0Ic L524Nyy4UJm+jEdwEerj+vM4/DxeiuN/P6P7kdz487z7ed4rF6P7ea0rfueOv3EA2KAMJZLbEygr iqjNbE0X2u/YfEM9JC9MV/3gLlGWsmpz1vH98/uUx70QRl8cXXFIJY5IGoI4AGBFWbR0cFtTDeo2 8ltpH7W+jUyHt7fH92YJY3JEkZFFfVG+fxLFd5EsbkXCGKqEEQmjThmlLOp0QdoAgLVkUYujbrSt AUC3QBLWa9mEYW0V8fKSVH1xygbbGjJWlppuijQG5Yhk0SmJoa+k4EmDtAEAS0RRPnorz1ojoer2 sD40aUQDgzJbts5KGUPDxeoco0bjiy9KuhgUWVyLz1+MhOEJoyt+v1H5Gk0SpA0AyIoiksUYVFse jizqR00ac6YeTMnzWj1haHfpVsdOb0SwoUgadbK4FsmiTBnZhNFVKUNDEwdpAwCyohCZtyzSwyhD 1cdvI2lEKcOTxSpTEJb0YZSNb1mailLGUxpRGWqoRKHJonMa+k7aO8ERBwCiiEShVVesEaLlTbM1 2Oe3IwpLGLdkyvDKaZsnDE0cXSGLTMrISKNMFhdHFpYwpkIWnZM4InEgDwBEYcnCWnVWW+LDE0Ut jUgcmc7uVdeQWiIMcS5iJmXcqpLTt/w5IqpFFlGjXs/b6BrEQeoAQBTRpLxphiwsUXji8EpSWv+F yEqd3XOFMTl34V7KuFelpUtwaGWovlEW5UXqg5SRKU1NhmQA4NyCyIpCjGShDZ3V5lV8B3L4bXzu OyhFeSOkWs5/s4RhDVEt7+QfRUNfSqNMGV6qqKXRBymjlsTFKFPV3zsVH7eUpqagzAUAxxRDNmFk k8XDSBfaCKhaCv/5OTxpRB3eXt/FquvtrdGHUd+p18t2PIqGXytNXZTk4U3Sy7zxtTiespjEHmk1 JctVmWQDAOcSibXQamYDJGvobCmL34njP+L3YWRLUasOpS25zPy+srPZKhFpX+Md3pDZqA+j5Y9k 6UXrFn4eAPZPGNnyU3borCaLm1KG+k+VLLzDG17rSWOTdLFEGCJ+B7IllEgCEryWbaCjWZlrxVlE AXA+cSyRxST6sFlNFjdHFnU5yhPGb0cW1gipTSofwwpvRl3S0dZ+19JEn0waljCiIW7Px6EqS12K z2n9IyL+pEBGTQGcUxaZ5T2iDm5v8yNtUp7VZ/FPQ7Lw9gpqWdJ8t+XNPVlIUhqZklSXSBGj2JNn roU0xh9ZjIU4ns9HRxzWo9dBjlAAjlOGmgJJiCzbz8KSxbfofRSRLH47Zaho7oXIhpvKrTUPo1N+ wbFoOLPSyAgjMw66vJClLMpjlD9HYdXikMSjJocu+SYhFYBlMmhJFa2y0EZCZWRxE33IbC2Hf6rH WhatI6M230RurZKUNcy2FkerNLw33lvw6/mmXos3tlyj6iH6aKw+WRaLZIEgAPYTSKs0rEUEvdFQ 1uZH2qQ8r5/iH4k7uVtGRmlltdVYM2FYb9RYNbgZaXiNq/amWtseatJ4iD9JcKk0WjrnAWB7aXhr QXk3oJP4o6G0mdzakh9WZ/c/Ys/DiFanrTdM8q7BoUpSUWmqbOSz0rB+flSGeiSkcRF7rw1vhrlI bhgx0gDYVxhT0GjWd+FjsmJxF31TuGg2dzSk9rdRjlpj7+7DJYxsaapMG1oDG02Es5ZR90RRvsHP pdOfW79mpZFdUh1hABxfGN5EvKws6r6Let8Kq/8imt3tLWWe2fNis1LUFgnDeyNHpeF8JGThJYxo 8kx5J3AtJHFVUoa1LIkmjH6mMJAFwPbCyHZyjzOqFlay0Pa1aJnR7Y2KinbV82SxujS2Kklpo4Qm RRwtPzsShZUqvooL/0wX9QZN1gq5njhE2kZSIQ2A7WQxNT5qZai6P3SU3G559RIgVsqwEoW1wGA0 jFacEtQpEoYnjXLOQ7bxzAyh9UYtfBXiuMq/d/UbnKShiWOuNJAFwHGkYQnj0ZAublU5yts5L1qy /DuQRVSCispzpyhJlfLwImGLLKw+DC8yluIYKnFo0uiN8hTSAHgfYYwSz+HKlqIyW61qaULbqzsq Q2X7LTaTx7DRm9gF4sjKQpKi8IRx/XkjalnUfRmeNCxhRP0ZCAPgGMLwZDGJP4imlsXdKEdF+3Pf xO+rqDu4DyWLLRNG1J8RScMaAjc69UUrXVyrhOGVpYbGlIEwAM6TLsZkwshULW4N0rgpj9oM7nr4 bKss3qIkNVcaIvl16LWRUc9SVJkwhiphWH0ZLSlj7dngANAuCi1R1M+z6WIUe85FnTK+FWnclBRR J4rspLwWWWwujuGFb3KLNDL9F1Z0/DJKUbUwWstSnjSQBcDxpRHJIprRHaWMmyEIL1FEqSLb0X36 Tu9SFFlpTOKvSZ8dVntVRKEJo+78tvYWvyQSBsIAOFZJKhKG1p6MTtXCGimlPY9E8RB9BvdDkdok L1qN9ggJo0Ua2T0vvIRxlT/7MKwSVDS8NprINzdlIA6AdUQRJYy6HOUtLGi1KZnSlCWSjChaS1C7 yGKPklQkDS1teEnjUr3JQ/H4nKh3q4RxUaRxCRJGZngtHd8Ax0oYmXJUZq+LaB0p77WHxP0UD4nX htqlz2IvYWSkMUnbHhhjII5aCjcjTXjlqOxcjEgaiAJge3FkN0NqmYORKU9ZcmhJFNYM7sPI4tXC mFue0t703hFH+ca2pIkoXWRkkU0ZHogFoK1BbNk9L+rH8OZ5ZYRgPc+Iwis/7S6LPYThSUOTxyh/ 7hNei6N+oy/y7z0v7skk4fVdZIWxRBaIAmC+OLKyyHZ+eyth3wOpRENkWzc/OoQs9hJGNmlMSmNc v+F9lTZ6+fduehdFHPXn+oQoMsIQsffKQAwA24ukRRqZlOF1hkevWf0To1IWkzPIYk9hlCffGc8l SBudkjaejXmdNHrjMRLEnHSBMAD2k4WIP2CmRRqePEbxl/Cw0kRUftp1nsWRhdFaotI6xbW00RWl qmfi0NJDS5pAGADnF4ZIbk0pSxjWx1lJjOL3URwyVRxNGFrasGRRp43668dKFmVD/0gKwtqiNdrn m/kXAPsJQyS3rPmkNN7185bDks00s/R0WFkcSRiiJAxLIJNxh1+nkzFICr3zemY01JzlzZEGwD7C kERpKtv4j4mUUm9L3ZImpqNe+OHAfwzRwoWROLoqcXTiL1MepYmlu+0hCoDXlaZapZFJHlMghslJ FJnf7dCyOKoworSREYcYAukqeWTkQKoAeO+kIQl5eK+PkptDccpUcRZhiPgjqTKd4p2TRGSGIJYI A2kAbC+LrDBE8qOpWo45SWI6y0UfTvbHEZWp6mSSafQzH4vkJ+chDIB9hRHdxWdGKUWL/0Wd2G8l irMJQ5OBKOnDk4bX6GdSw1qLCyINgNcKo0UakUhE5o1yOrUozioMcWTRkjqyKSGbJOjgBjiuSLyG u6V/YU5fxFuI4szC0N6MOaljmiGDTOkJUQAcM31MM59PC37GW4jiXYShiUMkP7JK+16SBMBnp45s w9/6McI48B9GlDrq2eNTQjgIA+D9hLH11yCME6cOCdJHy89AGADnFEbm89PCr0UYb5A6ZIFAsn8o SATguIJo+fppxX8HYZz8D6n75DcfAGE0ff3HtxEDf1ipdNDyh9LxhwVwOmkgB4Sx6h9Kxx8aAGJB GLDmHxb9FwCIAGEAf6gA8Ln0XAIAAEAYAACAMAAAAGEAAADCAACAs/JfAQYAL3iXmIlSiu4AAAAA SUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 179.2061 198.1514)"
+ id="image77">
+ </image>
+ <g
+ id="g79">
+
+ <radialGradient
+ id="SVGID_5_"
+ cx="225.1929"
+ cy="226.1387"
+ r="30.8299"
+ gradientTransform="matrix(1 0 0 0.75 0 56.5347)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop82" />
+ <stop
+ offset="0.4828"
+ style="stop-color:#FDFEFB"
+ id="stop84" />
+ <stop
+ offset="0.7611"
+ style="stop-color:#F8FBF3"
+ id="stop86" />
+ <stop
+ offset="0.989"
+ style="stop-color:#F2F8E8"
+ id="stop88" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop90" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.8025"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <path
+ fill="url(#SVGID_5_)"
+ d="M186.706,235.825c0,5.965,4.835,10.801,10.799,10.801h55.374c5.965,0,10.801-4.836,10.801-10.801 v-19.373c0-5.965-4.836-10.801-10.801-10.801h-55.374c-5.964,0-10.799,4.836-10.799,10.801V235.825z"
+ id="path92" />
+ <path
+ fill="none"
+ stroke="#EDF5E5"
+ stroke-width="5"
+ stroke-miterlimit="10"
+ d="M186.706,235.825 c0,5.965,4.835,10.801,10.799,10.801h55.374c5.965,0,10.801-4.836,10.801-10.801v-19.373c0-5.965-4.836-10.801-10.801-10.801 h-55.374c-5.964,0-10.799,4.836-10.799,10.801V235.825z"
+ id="path94" />
+ </g>
+ </g>
+ <path
+ opacity="0.74"
+ fill="#FFFFFF"
+ a:adobe-blending-mode="lighten"
+ d="M263.623,229.595c0.037-0.364,0.057-0.734,0.057-1.107 v-13.375c0-5.965-4.836-10.799-10.801-10.799h-55.374c-5.964,0-10.799,4.834-10.799,10.799v7.324 c7.545-1.012,15.699-1.566,24.213-1.566C231.959,220.87,250.812,224.252,263.623,229.595z"
+ id="path96" />
+ <linearGradient
+ id="SVGID_6_"
+ gradientUnits="userSpaceOnUse"
+ x1="225.1929"
+ y1="204.3135"
+ x2="225.1929"
+ y2="246.626">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF;stop-opacity:0"
+ id="stop99" />
+ <stop
+ offset="0.0141"
+ style="stop-color:#FDFDFC;stop-opacity:2.231669e-04"
+ id="stop101" />
+ <stop
+ offset="0.1344"
+ style="stop-color:#BEBEAF;stop-opacity:0.0148"
+ id="stop103" />
+ <stop
+ offset="0.2565"
+ style="stop-color:#94957C;stop-opacity:0.0297"
+ id="stop105" />
+ <stop
+ offset="0.3796"
+ style="stop-color:#747759;stop-opacity:0.0446"
+ id="stop107" />
+ <stop
+ offset="0.5029"
+ style="stop-color:#5D633F;stop-opacity:0.0596"
+ id="stop109" />
+ <stop
+ offset="0.6263"
+ style="stop-color:#4D552E;stop-opacity:0.0746"
+ id="stop111" />
+ <stop
+ offset="0.75"
+ style="stop-color:#414B23;stop-opacity:0.0896"
+ id="stop113" />
+ <stop
+ offset="0.8742"
+ style="stop-color:#3B461E;stop-opacity:0.1047"
+ id="stop115" />
+ <stop
+ offset="1"
+ style="stop-color:#38441C;stop-opacity:0.12"
+ id="stop117" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF;stop-opacity:0" />
+ <a:midPointStop
+ offset="0.2901"
+ style="stop-color:#FFFFFF;stop-opacity:0" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#38441C;stop-opacity:0.12" />
+ </linearGradient>
+ <path
+ fill="url(#SVGID_6_)"
+ a:adobe-blending-mode="darken"
+ d="M263.68,221.954v13.871c0,5.965-4.836,10.801-10.801,10.801 h-55.374c-5.964,0-10.799-4.836-10.799-10.801v-13.871l0.038-7.704c0,0,0.923-9.937,11.173-9.937h54.962 c0,0,10.063,0.328,10.801,10.799V221.954z"
+ id="path119" />
+ </g>
+ <g
+ id="g121">
+ <g
+ id="g123">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuJJREFUeNrsl9trE0EUxjO7m5vW tKFN1RqLCmqlIvjgkz5I/cOFIqLggw9KsRHxUo1IdEtactG9+A1+A8dxNrsxK/rgwI9lt5ueb875 ZuZspfJ//Bhqjvc0AfCIHClIQEzSMkUoBqyCJbAKWrxXQoBmBL6AQzChmGQREWbmNQY/DS6Aa6AL mtZvdcDPoEcOQEgxUV5mVMYzH5wCZ8FFcJ0CLoN1UHeIGII34AV4BvbBW4qbzsqKctzruq+ALXAL 3ABXwAafNyjS9sQ3cAwG4BXYA0/AU/AejLOE+I4MtME22AH3wE2wyedNivSFQT3eB/y79kwHnGE2 v4IjinCaNrBEtJiBu2SLs686VkRWGRt8/wTL5jFwxIxMbSGB+Ac1qtcluEMBbWslFDV7QBFdlmBE bwxZtthVDn1dpgF3WIIOhakF9iCf2ajQK32W5hcRJgvnmYHb9ECzQAnyhif8o7PxkWImsiQeRSyJ fWCjJAGy5G2usKtgzc6wx5dWxT6wYhm2jKNBm/UcV90m/aLsdLVoonX+QJV8RvmcXNflNVOOKktQ Fz4p+6AMrBg/GUeeFWUHd51HyuXevz7+GRELNSRzjMwYnmhI5Laa/gEBYxEjskVE7Ih67AeOi3ZE BYc55j+xxzjgpBMpImZL1mNDMuDxm5aYBT2x1+wx+vZJ6lt94kl2Ux1uWl4JWZhy9g/AQ/DOPjt8 q0ULuLebhiRYYO8wPUTIdm+X1zDrKE/FKjH95TL3eP83MiIF7FHAY2ZkYpfadxhoRE80WJ66EKIK BE9YAiPgPkW8dPUSFUfDGnMpHVmKvQJCEoofcsamBLs0fOgSUMnomo2QQ66UAbMTi4+hmOk2mGZW B39OE+rgj5iBcNb3h5qxk9boDb1SLrEh2c75+NlnCfT1A4OP8nZiVeAT0IhZY0Ni+gHP8oEpQ59Z HHP2uRtfkeUnxTj7AWHqMU0ZiRVX2ld5kZ4jnSewHN8FGACSOOKkAlOGAAAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 199.0298 216.5547)"
+ id="image125">
+ </image>
+ <g
+ id="g127">
+
+ <radialGradient
+ id="SVGID_7_"
+ cx="202.6289"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop130" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop132" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop134" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_7_)"
+ cx="202.629"
+ cy="219.704"
+ r="2.999"
+ id="circle136" />
+ </g>
+ </g>
+ <g
+ id="g138">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtFJREFUeNrsmP1LFEEYx292Ts3V 9ujFrCiwFyPShH4I+imoiPqbhYKIoKigN0W8SulNIrOU63S921u/A9+BYdm9mbndg4IGPiynuzOf eea52WeuVvvf/Joo8VwA6rxm+0lBD3R5TYctpu6XYBRE4DiYzMhpqRbYBDtgHyQ+gsIzQmMUOg3O gzkwzciZTUXqO1gCH8E3CsauERSOUiOgAc6AC2ABXAYXwZECsV/gPVgBb8AH8AVsg45NTjhKTYGr 4Aa4AmYZqYjLmpdj+4ySilwTLIOn4C34YZOTjlLXwH1wC8xzKSMureQym0g+O85ITxP1uU3hPS6r t5j63zFK3QM3uYwNQ0g45KUSPMSJNLjsLS71blHUZJ9Ox5lDSuo2k32SHYsBvslKcAIc5jJvUK7r I1ZntK6Du8yryBJhW9P73hi3jg2ym7ek0hKtO0z4E5xx2RYYOany7DPYyotaUPCwyoVL3KemKpLS TX+h5jhGI88jT0x9/U9yrzoHwoL7ykQtZN8LHGvURUxy05xhntWH8I7WOTzDsaSLmOAMQl6DIYgF mTGEi5iWEyWqD9dtpHCMoPaXtn9KrHSR59CsYxSJ6SKv1e9FW6L1MmM4iXWMIu8ri7u04mjF7HuJ Y3VcxLqciaqfVlnYJRWKJexzlWNs5r2SZMGMNOp1cRYc5atEVBCtPVazD8AzHzHdQUKZUyzywoIT kY9Uh9XrC4o1WTimPmI9ouv9iAXfIHKm1GtKvSyKlq2C1Una5sMTLBRHPN4MOvIxpV6BRfCEJU/s W8Ganf4xzoaCf5dGaS36JHnMKnWNUg/BY35uD1rza7ku5bY4658cMDHkEt6nUZP4TQG1dI/Ic/CJ /SVVHHglS2J94pnluXLecuB9x3Nlk5+3jUlV9hOBMAQjCpn1lMikgFrCdQrtGEKp62CDlCtaMLQc eNu+QmV/7XGp2cyN2rsdCDAAoyXZx8WJpTUAAAAASUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 213.9448 216.5547)"
+ id="image140">
+ </image>
+ <g
+ id="g142">
+
+ <radialGradient
+ id="SVGID_8_"
+ cx="217.5439"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop145" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop147" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop149" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_8_)"
+ cx="217.544"
+ cy="219.704"
+ r="2.999"
+ id="circle151" />
+ </g>
+ </g>
+ <g
+ id="g153">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAttJREFUeNrsmO9r00Acxptc1m6d Fn9M125sU4RVpyjiSwXB/9wXulciiE4dhpUMpwzFUa02XdP4HDwHR7hcLk0mCh58WOnI9548973k uTYa/0e54c15nQ8E8TJ1UpKQ2Z8QJgUtgDa4CC6AliZOiYrBCfgGfoLTsgK9OQStgE2wDa6DDv+v hhQwBAdgH0TgS1mBLsIEBV0F18BNcJvC1sCyQdgIHFHYG/AODMAxBSZVhQXgHJ15AO5T2Aa4TMHC 0GMJBXwFhxT2Erygkz/AtGhim1NS1A3wCDwGO+AKBS3QKS+nrlp6eQProKe5G4LvNucCS0+1uXQP wRNwj6JaFkH6SgitNxeJ0BwNueSzMsIC3ulduiX/roJmpp9cWkVQ1CrrqB17ws+TPGdM3y3Rftnk fTpVVlS2ZpN1+qy7znl8V2HSrUvcdbKnutryVRk+63RZd5vzBC7ClFvyMXALbHEDiJreNGpDbbH+ Wp5rJmEd7sQ+n13NCq8uU881WbfPeTquwtq0u1ezW1nXepyn7SJM9dgSCc4oPBTO4Rus9jKJwatZ lGeZy+rYXzH+GWEpXxEq5Kl8VecwBcnURVjMgCcZn5GwsTZH7CJMD3khL5zWLGzKuiHnGZpe5CZh I6bO9wx7v+bN7YYxY70j1o/yEoZpKSdMmntMoMq1tIYlVG7ts/4x50tddmXCEDfgxRETZ1JRWMI6 EesObGFRWCyfaa+oDl8jQd4DscApJUr21S54Dj7wu1JBUW2Ct1rybDDRntditUtPnWor8Aw8Zd2h rXdFQdGYd6WfbPTYnOeeEiSv/cTDyC5FvbL1luspSSXPFUYUmaHu8KS0yfjdMpySYp6QIop6TZdC njEnRTvdpVc8Lt0yBW4wS+04HHj3+Fg4pKARnUxdJnVNBL7hSNal4OxPBFLAZ/CRzumn8NR1wrKR xdfy1KLlwDvmw3RaRlDVX3s8h8dGWiUE/BZgAMf82R9IYLF+AAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 228.8599 216.5547)"
+ id="image155">
+ </image>
+ <g
+ id="g157">
+
+ <radialGradient
+ id="SVGID_9_"
+ cx="232.459"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop160" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop162" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop164" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_9_)"
+ cx="232.459"
+ cy="219.704"
+ r="2.999"
+ id="circle166" />
+ </g>
+ </g>
+ <g
+ id="g168">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAt9JREFUeNrsl91rE0EUxTOzm69a 05YmVWsUFdRKRfDBJ32Q+ocLRUTBBx+UYiOitlqRaEos2UT3w3P1jIzrbHZNVuiDAz9CNru5Z+69 M3O2Uvk/fg414zOCDzSxRwJiEJGkTBGKAatgEayCFr8rS4AwAp/BIRhTTDyPCDPzGoOfAhfANdAF zdT/SMBPoEf2wYBiQldmVAEBHjgJzoCL4DoFXAZroO4QMQRvwAvwDOyCtxQ3SWdF5QiQui+DDXAL 3ABXwDqvNygy3RPfwBHog1dgBzwBT8E7ENhCvJwMrIBNsAXugZvgPK83KdKzGlTzu8/fpWc64DSz +RV8oYhfTetPEdFiBu6SDc6+6lgRWZNo8P4Flk0zcMiMSGkSP+MPalQvJbhDASuplVB0RfkU0WUJ RuyNIcsWucoh15bYgFssQYfC1Bz7kcdsVNgrByzNHyJMFs4xA7fZA80CJcgb2uofycYHihlrh4hF ax9YL0mAGT7LKivsKmjLpLXjplVrH1ie0ryzlkWa9SxXnWR5QTv6ocUmWuMDqlLu8Di5ruk1Vzmq LEGdD5QtQln7yI8YespZUXbwzBi6cgzGsRTx14ZkxvFbDJeI9Laa/AMBgRUjTIsI6Yh69ANH0xzR DMMc8x/pMcTwjNIiIlqyHg1Jn8dvUmIWZGKv6THk/Jh4GWqFE3RTHW5auoQsTDj7B+Ah2JOzI8vU RNxQ2pYh8efYO4yHGNDubfNzkHWUJ9YqMf5yiZ7AmyEjtoAdCnjMjIj5TbycBhqxJxosT90SogoE j1kCI+A+Rbw0XmKaxzQlCXjz2GpOXUBITPFDztiUYJsNPzAC8kQklpBDrpQ+sxNZL0MR020wZlaC P2cTSvBHzMAg/f6hCu6qNfaGrJRLNCSbOS8/uyyBfL5n8JFrJy7a7Solpk1DYrynTvWBKcMBsxhw 9nEZL8S2GNtzuJo6YFOG1oor7a28iOdI8gLb47sAAwCDFN6m03jgxgAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 243.7749 216.5547)"
+ id="image170">
+ </image>
+ <g
+ id="g172">
+
+ <radialGradient
+ id="SVGID_10_"
+ cx="247.374"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop175" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop177" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop179" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_10_)"
+ cx="247.374"
+ cy="219.704"
+ r="2.999"
+ id="circle181" />
+ </g>
+ </g>
+ <g
+ id="g183">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAn9JREFUeNrsl+lrE0EYxvdKjSZW YxEPxBsVrNdHQTxA/KMFBRGPDwoVVIpoq3jUeJUG25qk2fVZ+A28WTabxG4lHzrwgxw78z7zzMw7 73reBDR/jOcCUREhn21LRCy6osfn0kT4BN0h9oiDoiGmTN8Efoum+CHWEBRvRoSbeZXgR8QZcVEc F7syfTcI/kq8Fgviu1jlv3hcET627xXHxFlxWZwXJ8RMxgmPIKkTn8UbMSdeinfiq1hnmUYS4QTs F5fENQSc4rfUgahgT7TFivgk5sVj8VQs4kqukGiAgCviDiKOijr/BUOWL7t/9uGaVyTEighYggsI uI79NQYfdY9FPF8x/WL2xiJLk9hOoelcJehtcYslqI8hYNDGrvP9G5t1PbtRQ+NIg/W/KWaxNNpk DnK5JZ35TzbuCq70ibAu3BBXxWHW1i8hGbpc0+akNLNuBDAtTopz4kBJAuxEC8cPzIlI88BpOoQl Xw1TuDtLsqvZkxbwUA2FjZxEVJYbdROj4mWOpVuzCMoWYGPlxggm4SrfFmFFJOTzDUi2KFY8KIYT sUoSWRadLRDSM0XPMgVPn4guOT0tSN6KVtHd/w8tYWJfqDHeM+m+jBkTeIEaoEmKTUp0oXD80Kjt kU4PkVSqJWTOhIDpFf5APBFLOOPliYhxZgYR00MKmVEEuKWeQ8Q8ruRe5Xb3po7s5CqvDSjnxhVw XzzjFu3k5XTbuuziNYLvZolCk+KHBU8n8QcBL8Rd8VB8yCto8kTEDNBCTIdBg4wQvyD4L6rsdOb3 xKNhhW44IKm4wZaghSAnoIdrHWhz/m3wlOfiI86OXPJPzMvPxLwG/tcX4u3m2l8BBgBQ/dU5d1Za tAAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 199.0298 230.2217)"
+ id="image185">
+ </image>
+ <g
+ id="g187">
+
+ <radialGradient
+ id="SVGID_11_"
+ cx="202.6289"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop190" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop192" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop194" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_11_)"
+ cx="202.629"
+ cy="233.37"
+ r="2.999"
+ id="circle196" />
+ </g>
+ </g>
+ <g
+ id="g198">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNrsmM9r1EAUx3cz2XW1 il2wLLagIh5aeilUBC967EX/XA/1It5aUaiC2JNY/EWp0lZkG3c3id+Bz0AIaXayibKHDnzIJfPm s29eZl/Sas3paNeYZ0SHaz5OKmIx5pr+azF7fyh6oi+WxXURZGJZiUScim/iWERiUkWwXTFDlxG6 I1bFBnKd3P1jpPbEvviE4JlvBtueUl1xQ9wVa2ITsdtkzOTmxGTsALE34oP4KH6I0TS5tofUJXFT PBCPxToZ67OlZTUWkSmbsffipXglvos/ZXLGI1N2qx6Kp+KRuFcgVYRh/oJYEgNxle08EUNqsbJY SDAnZa8r1FlYoQzc02sFF5n/W/wskzMlAReopydkaoVtDWocL1bqGtv8Bblx0YSgJFt9xNbJXLfG uZctjQEx11gj9M2YDXCFiVviflmAGeQCYtlt/MxTOvbJmEFkFZqSyu9GNr7xEXNP4gbnVK/mFhZl rUdsd0B3fcQCDs3lcw7PJobJrRH4iE37g24qa6VrBK05HRdiTYjVbvI8xtQ1isSyTd4pE5secW6N xEdslGnyDmhd0oazFRF7j7VGPmIxPdQ+HNMWNzUmBfFj3+7C1YDtMG7RT3UaONMS+jErtC1e05tV EksyPdkAyToHbsqW2e51R7ygs42qNooJaU/oPF2TF8wgl2SkdsVz8Y5sJVXFUvryX6TfNXld5HwE U37cWUbqGdfDsto1njVxQjscQ8jc8+SckO25jqipHTK1i+Ro1peR7FM6pKH7StAhC7uam7CQI+J+ J7RNTb0lU7Vf3+b6hXeuPxH8948qF6Pq+CvAAGGezDColMK7AAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 213.9448 230.2217)"
+ id="image200">
+ </image>
+ <g
+ id="g202">
+
+ <radialGradient
+ id="SVGID_12_"
+ cx="217.5439"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop205" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop207" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop209" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_12_)"
+ cx="217.544"
+ cy="233.37"
+ r="2.999"
+ id="circle211" />
+ </g>
+ </g>
+ <g
+ id="g213">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlRJREFUeNrsmM9LG0EUx5PdjTTW otDYWmoOQm2M/YGXnrxI/3IvnnoRW7TagocotqjQtLYp5pffgc/CECc7u+uGpuDAB2Y32Tff9+bN 7Jstlaa0lXM+E4gIAsd/BqIHpj+cpLBY0Ix4JBbhwYg4I+SvOIdf4jqrwHIOQUvihXgtVsWCQ9gP 8UV8El/Ft6wCyyl+DxH0XLwUb8UbxD0V1RE7ZtCO+I6oj2JPHIlTBPZ94sqe3yIi0hCb4h1Reibm iOK4HDPRuRJnRO+D2BGHRLSXJC7yRGpeNMV7sYXAeQSFCU6FRHIGB56IGveMI/uIGxu5JGFzTN0W wpqIijIsmpDFYZ55hah4xRpxP7MIM4NWWHEbTGGDKY1ybi8VKyVM/l2wYjtM+S1xrvww9x6KulgX K0QqvOOeGafGCnbrjOPScOtmnPA1Hm7Sr+TcjF2Rq2F3nb4zNVzCZsWyWMOr2XFe5WgB9urYX+ba KywkF1bJh8d4WWSrYLdhbdBhmohVrddNtYApLOUZI0jxgp6EMO8YQWlK272wuwobFlHkeVqqMVzC OlaR15mQMO8Yo8L6VpFnypNL0S1YWBe7h4wTVxneiP0RJ+KzaHE9KEjUAHst7J9wnWoqe7z9TVly QL9bwJQOsXOB3X36vbTVhfHqN16Zh49F2xXujK2PnWPsthhnkLYeiz0ziblrVZ55CkV7Ftrk1Q52 z5NmIkowdsUBIrIqz7SltR2la0vUNhxhP3PNP7RCf4CouPIs4jDS9p2U/svj21QfeKf6E8E/+ahy 37K2GwEGAJb/2mQI89WQAAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 228.8599 230.2217)"
+ id="image215">
+ </image>
+ <g
+ id="g217">
+
+ <radialGradient
+ id="SVGID_13_"
+ cx="232.459"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop220" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop222" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop224" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_13_)"
+ cx="232.459"
+ cy="233.37"
+ r="2.999"
+ id="circle226" />
+ </g>
+ </g>
+ <g
+ id="g228">
+
+ <image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnpJREFUeNrsl2lrE1EUhmdLjSZ2 sYgL4lqsYN0+CuIC4o8WFERcPii0YEsQtYpL3cVgW7PMjO+F55ZhmMlMzATyoRceSDKZc957zplz zzjOBCz3P+/xRE34fE6uWESiJ0I+VybCxekeMSMOizkxlbATwx/xRXwXWwiKRhFhd17H+TFxVlwU J8W+lJ0+zlfFmngjvolNrkXDinAJ+6w4IRbFZXFenBLzqUg4ODGR+CheimXxQrwWn8U2aSolwgo4 KC6Jawg4w28mAsGAmuiI3+KDaInH4qlYJyo7QoISAq6IO4g4Lppc8wrSl66fA0TNSQvJE+GRggsI uE74GxgvW8gB/68l7ouojXVSE/s5N9dxelvcIgXNIQTkFXaT718pViMiyjIa8OiZ/N8US4Q0GLEf 2d5iauYHhWtqpu8PiMINcVUcJbduBY3R9poOT4rpJdteRi1Mi9PinDhUkQC7/Cz7aRH2iTB9YIEb /IqPiSmiu0Sza3gZf2qgcC6jEVUVjWbCR83LOR8CqFpAMu07PrxJOMp3ReSJiOnnfYjH5DdK+sgS sUkT+SW6YxASJoYe46OXFtGjp5uB5JVop8/+EVfMxj4xY7w1m/YywtRmGmqhtlNhNMIs+36O2pB2 fYSmUq+gc8ZsyBzhD8QTsWEikyciomjnETFdMMiUEWBTvYyIFlGJ/ILqNRHZy1HeyBnnhhVwXzzj FO06BSHuUcVbON9Piuy7hlvCudnEXwSsiLvioXhnB5oiEREG2ojpYtRLCXEHOP/JlG12fk88yhp0 /RJNxRrbgDaCrICQqHWhw/OfdG54Lt4T2dIj/8S8/EzMa+DYX4h3l13/BBgABM7SO70ZkkMAAAAA SUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 243.7749 230.2217)"
+ id="image230">
+ </image>
+ <g
+ id="g232">
+
+ <radialGradient
+ id="SVGID_14_"
+ cx="247.374"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse">
+ <stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop235" />
+ <stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop237" />
+ <stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop239" />
+ <a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" />
+ </radialGradient>
+ <circle
+ fill="url(#SVGID_14_)"
+ cx="247.374"
+ cy="233.37"
+ r="2.999"
+ id="circle241" />
+ </g>
+ </g>
+ </g>
+</g>
+<path
+ d="m 529.664,248.155 h 18.498 l -2.809,18.064 h 5.59 37.586 l 2.6,-17.718 c 4.98,-1.091 9.133,-3.455 12.512,-6.693 3.084,4.075 8.566,7.37 18.252,7.37 6.338,0 12.775,-1.807 17.174,-3.687 4.254,2.399 9.463,3.687 15.459,3.687 3.088,0 6.236,-0.355 9.426,-1.023 h 67.135 l 3.354,-24.827 -5.445,-0.764 1.879,-13.356 c 0.371,-2.386 0.449,-4.66 0.449,-6.156 l -0.008,-0.375 c -0.457,-12.191 -8.139,-19.765 -20.045,-19.765 -2.404,0 -4.623,0.314 -6.676,0.852 h -34.189 l -0.035,0.244 c -2.527,-0.701 -5.41,-1.096 -8.686,-1.096 -3.801,0 -7.406,0.555 -10.76,1.598 l 0.105,-0.746 h -12.467 l 1.826,-12.951 H 613.08 l -1.846,7.658 c -1.373,5.704 -2.213,5.793 -4.453,6.03 l -4.508,0.477 c -3.049,-1.424 -6.357,-2.065 -9.602,-2.065 -2.135,0 -4.275,0.284 -6.416,0.852 h -19.291 c 0.502,-1.772 0.775,-3.674 0.775,-5.678 0,-9.601 -6.846,-16.305 -16.646,-16.305 -11.055,0 -18.775,7.721 -18.775,18.776 0,0.951 0.082,1.869 0.219,2.764 -2.135,-0.288 -4.277,-0.409 -5.553,-0.409 -2.053,0 -4.072,0.288 -6.045,0.852 h -31.342 c -2.74,-0.553 -5.641,-0.852 -8.537,-0.852 -7.138,0 -13.492,1.674 -18.808,4.723 l -3.451,-1.461 c -3.711,-1.571 -11.232,-3.262 -18.979,-3.262 -8.933,0 -16.383,2.56 -21.576,7.016 -3.265,-4.473 -8.523,-7.016 -15.228,-7.016 -4.822,0 -9.021,1.477 -12.572,3.44 -2.996,-2.204 -6.796,-3.44 -11.115,-3.44 -2.327,0 -4.48,0.315 -6.476,0.852 h -33.963 l -0.035,0.245 c -2.526,-0.702 -5.41,-1.097 -8.687,-1.097 -20.458,0 -35.307,16.031 -35.307,38.117 0,17.363 10.785,28.149 28.148,28.149 3.087,0 6.236,-0.356 9.426,-1.023 h 88.816 c 3.706,0.676 7.669,1.023 11.154,1.023 8.907,0 16.278,-2.375 21.51,-6.593 4.872,4.252 11.585,6.593 19.728,6.593 3.053,0 6.206,-0.368 9.286,-1.023 h 44.664 2.069 z"
+ id="path243"
+ inkscape:connector-curvature="0"
+ style="fill:#f5f5f5" />
+<g
+ id="g245"
+ transform="translate(0,16)">
+ <g
+ id="g247">
+ <path
+ d="m 340.308,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.095,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path249"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 394.07,221.7 -0.171,-0.255 1.789,-10.055 2.642,-18.063 c 0.512,-3.749 0.341,-5.623 -1.96,-5.623 -2.642,0 -5.794,2.727 -9.372,5.879 l -2.727,19.512 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 -0.852,6.305 h -18.404 l -0.171,-0.341 1.875,-10.82 2.471,-17.212 c 0.512,-3.237 0.682,-5.453 -1.789,-5.453 -3.238,0 -7.413,3.664 -9.714,5.709 l -2.642,19.512 c -0.17,1.363 -0.17,1.534 1.108,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.767,-1.789 l -4.176,-1.534 0.938,-6.476 h 16.871 l -0.938,6.987 0.256,0.085 c 4.43,-3.749 9.116,-7.924 15.592,-7.924 4.687,0 7.839,2.641 8.18,7.753 l 0.256,0.086 c 4.175,-3.664 9.202,-7.839 15.252,-7.839 6.22,0 8.775,3.152 8.946,9.202 0,1.618 -0.171,3.493 -0.426,5.538 l -3.067,21.897 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.175,0.597 -0.852,6.305 H 394.07 z"
+ id="path251"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 443.995,190.771 -0.17,-4.431 c 0,-0.682 -0.085,-1.108 -1.022,-1.363 -1.022,-0.256 -2.642,-0.427 -4.771,-0.427 -3.579,0 -6.391,1.108 -6.391,4.09 0,2.727 2.982,3.749 6.731,5.027 6.05,2.045 13.888,4.431 13.888,13.463 0,11.076 -9.372,15.592 -20.193,15.592 -8.009,0 -14.91,-1.959 -16.273,-2.981 l 1.618,-12.355 8.691,0.512 0.255,4.941 c 0,0.597 0.171,1.108 0.938,1.363 1.278,0.427 3.238,0.768 6.05,0.768 4.687,0 7.327,-1.79 7.327,-4.687 0,-3.408 -3.152,-4.175 -8.009,-5.624 -6.135,-1.874 -12.78,-4.26 -12.78,-13.206 0,-10.48 9.116,-14.996 19.597,-14.996 6.646,0 12.866,1.533 15.081,2.471 l -1.704,12.354 -8.863,-0.511 z"
+ id="path253"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 489.748,218.548 c -4.175,2.386 -10.395,4.175 -16.444,4.175 -13.036,0 -18.575,-7.583 -18.575,-18.574 0,-18.83 11.588,-27.691 25.988,-27.691 6.475,0 11.843,1.874 14.229,3.578 l -1.874,13.377 -8.691,-0.426 -0.255,-5.794 c 0,-0.597 -0.086,-0.938 -0.597,-1.192 -1.022,-0.427 -2.557,-0.597 -4.175,-0.597 -5.624,0 -11.418,4.601 -11.418,17.382 0,7.839 3.493,10.395 8.436,10.395 4.346,0 8.436,-1.448 11.247,-2.556 l 2.129,7.923 z"
+ id="path255"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 491.364,221.7 0.853,-6.39 3.919,-0.512 c 1.193,-0.17 1.363,-0.426 1.534,-1.704 l 3.578,-25.987 c 0.086,-0.938 -0.085,-1.534 -0.852,-1.789 l -4.261,-1.534 0.938,-6.476 h 16.87 l -1.107,7.669 0.256,0.17 c 3.323,-4.771 8.095,-8.69 13.548,-8.69 1.874,0 5.112,0.341 6.561,0.767 l -2.13,15.507 -9.969,-0.341 -0.256,-4.431 c -0.086,-0.767 -0.256,-1.022 -0.938,-1.022 -1.619,0 -4.26,1.96 -6.646,4.431 l -2.981,21.643 c -0.171,1.363 -0.085,1.619 1.192,1.704 l 8.095,0.682 -0.938,6.305 h -27.266 z"
+ id="path257"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 536.094,221.7 -0.17,-0.426 2.045,-11.503 3.152,-22.749 c 0.17,-0.938 -0.086,-1.534 -0.853,-1.79 l -4.175,-1.448 0.852,-6.476 h 18.149 l -5.027,35.786 c -0.171,1.363 -0.085,1.534 1.192,1.704 l 4.09,0.597 -0.852,6.305 h -18.403 z m 5.879,-57.598 c 0,-5.453 3.238,-8.775 8.776,-8.775 4.175,0 6.646,2.215 6.646,6.305 0,5.368 -3.322,8.861 -8.861,8.861 -4.176,-0.001 -6.561,-2.387 -6.561,-6.391 z"
+ id="path259"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 556.796,239.764 -0.17,-0.341 2.471,-14.229 5.282,-38.087 c 0.171,-1.022 -0.085,-1.534 -0.767,-1.789 l -4.175,-1.534 0.938,-6.476 h 17.041 l -1.022,6.816 0.255,0.085 c 5.027,-4.686 10.311,-7.753 15.678,-7.753 7.328,0 12.44,4.686 12.44,17.041 0,11.758 -4.601,29.225 -20.449,29.225 -5.538,0 -8.605,-2.13 -11.759,-4.345 l -1.874,12.78 c -0.085,0.938 0.085,1.278 1.192,1.363 l 8.606,0.853 -0.938,6.39 h -22.749 z m 17.041,-30.247 c 2.13,1.789 4.942,3.322 8.095,3.322 6.901,0 9.458,-9.713 9.458,-17.211 0,-5.027 -1.193,-8.351 -4.431,-8.351 -3.408,0 -7.754,3.664 -10.821,6.391 l -2.301,15.849 z"
+ id="path261"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 635.777,219.4 c -3.749,1.789 -9.458,3.322 -14.229,3.322 -8.521,0 -12.099,-2.981 -12.099,-9.969 0,-1.107 0.085,-2.386 0.256,-3.749 l 3.066,-22.323 c 0.086,-0.512 0.086,-0.853 -0.511,-0.853 h -5.879 l 1.107,-7.839 c 7.242,-0.767 10.906,-4.431 13.122,-13.633 h 7.924 l -1.704,12.1 c -0.085,0.596 -0.085,0.852 0.597,0.852 h 11.758 l -1.193,8.521 h -12.439 l -2.812,20.364 c -0.171,1.107 -0.256,1.96 -0.256,2.727 0,2.982 1.278,4.26 4.942,4.26 2.385,0 4.771,-0.596 6.816,-1.363 l 1.534,7.583 z"
+ id="path263"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 671.817,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.094,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path265"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ <path
+ d="m 703.596,221.7 -0.17,-0.255 1.874,-10.396 2.471,-17.723 c 0.512,-3.578 0.341,-5.879 -2.215,-5.879 -3.664,0 -8.18,3.578 -11.077,6.135 l -2.641,19.512 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.768,-1.789 l -4.175,-1.534 0.938,-6.476 h 16.87 l -0.937,6.987 0.255,0.085 c 4.771,-4.09 9.373,-7.924 16.02,-7.924 6.475,0 9.798,3.322 10.054,10.139 0,1.363 -0.085,3.067 -0.341,4.687 l -3.067,21.812 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 L 722,221.7 h -18.404 z"
+ id="path267"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" />
+ </g>
+ <g
+ id="g269">
+ <linearGradient
+ id="SVGID_15_"
+ gradientUnits="userSpaceOnUse"
+ x1="324.1611"
+ y1="239.7637"
+ x2="324.1611"
+ y2="155.3275">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop272" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop274" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 340.308,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.095,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path276"
+ style="fill:url(#SVGID_15_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_16_"
+ gradientUnits="userSpaceOnUse"
+ x1="377.45459"
+ y1="239.7637"
+ x2="377.45459"
+ y2="155.3277">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop279" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop281" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 394.07,221.7 -0.171,-0.255 1.789,-10.055 2.642,-18.063 c 0.512,-3.749 0.341,-5.623 -1.96,-5.623 -2.642,0 -5.794,2.727 -9.372,5.879 l -2.727,19.512 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 -0.852,6.305 h -18.404 l -0.171,-0.341 1.875,-10.82 2.471,-17.212 c 0.512,-3.237 0.682,-5.453 -1.789,-5.453 -3.238,0 -7.413,3.664 -9.714,5.709 l -2.642,19.512 c -0.17,1.363 -0.17,1.534 1.108,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.767,-1.789 l -4.176,-1.534 0.938,-6.476 h 16.871 l -0.938,6.987 0.256,0.085 c 4.43,-3.749 9.116,-7.924 15.592,-7.924 4.687,0 7.839,2.641 8.18,7.753 l 0.256,0.086 c 4.175,-3.664 9.202,-7.839 15.252,-7.839 6.22,0 8.775,3.152 8.946,9.202 0,1.618 -0.171,3.493 -0.426,5.538 l -3.067,21.897 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.175,0.597 -0.852,6.305 H 394.07 z"
+ id="path283"
+ style="fill:url(#SVGID_16_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_17_"
+ gradientUnits="userSpaceOnUse"
+ x1="435.17719"
+ y1="239.7637"
+ x2="435.17719"
+ y2="155.3275">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop286" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop288" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 443.995,190.771 -0.17,-4.431 c 0,-0.682 -0.085,-1.108 -1.022,-1.363 -1.022,-0.256 -2.642,-0.427 -4.771,-0.427 -3.579,0 -6.391,1.108 -6.391,4.09 0,2.727 2.982,3.749 6.731,5.027 6.05,2.045 13.888,4.431 13.888,13.463 0,11.076 -9.372,15.592 -20.193,15.592 -8.009,0 -14.91,-1.959 -16.273,-2.981 l 1.618,-12.355 8.691,0.512 0.255,4.941 c 0,0.597 0.171,1.108 0.938,1.363 1.278,0.427 3.238,0.768 6.05,0.768 4.687,0 7.327,-1.79 7.327,-4.687 0,-3.408 -3.152,-4.175 -8.009,-5.624 -6.135,-1.874 -12.78,-4.26 -12.78,-13.206 0,-10.48 9.116,-14.996 19.597,-14.996 6.646,0 12.866,1.533 15.081,2.471 l -1.704,12.354 -8.863,-0.511 z"
+ id="path290"
+ style="fill:url(#SVGID_17_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_18_"
+ gradientUnits="userSpaceOnUse"
+ x1="474.83691"
+ y1="239.7637"
+ x2="474.83691"
+ y2="155.3275">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop293" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop295" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 489.748,218.548 c -4.175,2.386 -10.395,4.175 -16.444,4.175 -13.036,0 -18.575,-7.583 -18.575,-18.574 0,-18.83 11.588,-27.691 25.988,-27.691 6.475,0 11.843,1.874 14.229,3.578 l -1.874,13.377 -8.691,-0.426 -0.255,-5.794 c 0,-0.597 -0.086,-0.938 -0.597,-1.192 -1.022,-0.427 -2.557,-0.597 -4.175,-0.597 -5.624,0 -11.418,4.601 -11.418,17.382 0,7.839 3.493,10.395 8.436,10.395 4.346,0 8.436,-1.448 11.247,-2.556 l 2.129,7.923 z"
+ id="path297"
+ style="fill:url(#SVGID_18_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_19_"
+ gradientUnits="userSpaceOnUse"
+ x1="512.28223"
+ y1="239.7637"
+ x2="512.28223"
+ y2="155.3277">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop300" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop302" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 491.364,221.7 0.853,-6.39 3.919,-0.512 c 1.193,-0.17 1.363,-0.426 1.534,-1.704 l 3.578,-25.987 c 0.086,-0.938 -0.085,-1.534 -0.852,-1.789 l -4.261,-1.534 0.938,-6.476 h 16.87 l -1.107,7.669 0.256,0.17 c 3.323,-4.771 8.095,-8.69 13.548,-8.69 1.874,0 5.112,0.341 6.561,0.767 l -2.13,15.507 -9.969,-0.341 -0.256,-4.431 c -0.086,-0.767 -0.256,-1.022 -0.938,-1.022 -1.619,0 -4.26,1.96 -6.646,4.431 l -2.981,21.643 c -0.171,1.363 -0.085,1.619 1.192,1.704 l 8.095,0.682 -0.938,6.305 h -27.266 z"
+ id="path304"
+ style="fill:url(#SVGID_19_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_20_"
+ gradientUnits="userSpaceOnUse"
+ x1="546.65918"
+ y1="239.7637"
+ x2="546.65918"
+ y2="155.32719">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop307" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop309" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 536.094,221.7 -0.17,-0.426 2.045,-11.503 3.152,-22.749 c 0.17,-0.938 -0.086,-1.534 -0.853,-1.79 l -4.175,-1.448 0.852,-6.476 h 18.149 l -5.027,35.786 c -0.171,1.363 -0.085,1.534 1.192,1.704 l 4.09,0.597 -0.852,6.305 h -18.403 z m 5.879,-57.598 c 0,-5.453 3.238,-8.775 8.776,-8.775 4.175,0 6.646,2.215 6.646,6.305 0,5.368 -3.322,8.861 -8.861,8.861 -4.176,-0.001 -6.561,-2.387 -6.561,-6.391 z"
+ id="path311"
+ style="fill:url(#SVGID_20_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_21_"
+ gradientUnits="userSpaceOnUse"
+ x1="580.69629"
+ y1="239.7637"
+ x2="580.69629"
+ y2="155.32719">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop314" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop316" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 556.796,239.764 -0.17,-0.341 2.471,-14.229 5.282,-38.087 c 0.171,-1.022 -0.085,-1.534 -0.767,-1.789 l -4.175,-1.534 0.938,-6.476 h 17.041 l -1.022,6.816 0.255,0.085 c 5.027,-4.686 10.311,-7.753 15.678,-7.753 7.328,0 12.44,4.686 12.44,17.041 0,11.758 -4.601,29.225 -20.449,29.225 -5.538,0 -8.605,-2.13 -11.759,-4.345 l -1.874,12.78 c -0.085,0.938 0.085,1.278 1.192,1.363 l 8.606,0.853 -0.938,6.39 h -22.749 z m 17.041,-30.247 c 2.13,1.789 4.942,3.322 8.095,3.322 6.901,0 9.458,-9.713 9.458,-17.211 0,-5.027 -1.193,-8.351 -4.431,-8.351 -3.408,0 -7.754,3.664 -10.821,6.391 l -2.301,15.849 z"
+ id="path318"
+ style="fill:url(#SVGID_21_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_22_"
+ gradientUnits="userSpaceOnUse"
+ x1="622.7832"
+ y1="239.7637"
+ x2="622.7832"
+ y2="155.3268">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop321" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop323" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 635.777,219.4 c -3.749,1.789 -9.458,3.322 -14.229,3.322 -8.521,0 -12.099,-2.981 -12.099,-9.969 0,-1.107 0.085,-2.386 0.256,-3.749 l 3.066,-22.323 c 0.086,-0.512 0.086,-0.853 -0.511,-0.853 h -5.879 l 1.107,-7.839 c 7.242,-0.767 10.906,-4.431 13.122,-13.633 h 7.924 l -1.704,12.1 c -0.085,0.596 -0.085,0.852 0.597,0.852 h 11.758 l -1.193,8.521 h -12.439 l -2.812,20.364 c -0.171,1.107 -0.256,1.96 -0.256,2.727 0,2.982 1.278,4.26 4.942,4.26 2.385,0 4.771,-0.596 6.816,-1.363 l 1.534,7.583 z"
+ id="path325"
+ style="fill:url(#SVGID_22_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_23_"
+ gradientUnits="userSpaceOnUse"
+ x1="655.6709"
+ y1="239.7637"
+ x2="655.6709"
+ y2="155.3275">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop328" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop330" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 671.817,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.094,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path332"
+ style="fill:url(#SVGID_23_)"
+ inkscape:connector-curvature="0" />
+ <linearGradient
+ id="SVGID_24_"
+ gradientUnits="userSpaceOnUse"
+ x1="697.92969"
+ y1="239.7637"
+ x2="697.92969"
+ y2="155.3277">
+ <stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop335" />
+ <stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop337" />
+ <a:midPointStop
+ offset="0"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" />
+ <a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" />
+ </linearGradient>
+ <path
+ d="m 703.596,221.7 -0.17,-0.255 1.874,-10.396 2.471,-17.723 c 0.512,-3.578 0.341,-5.879 -2.215,-5.879 -3.664,0 -8.18,3.578 -11.077,6.135 l -2.641,19.512 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.768,-1.789 l -4.175,-1.534 0.938,-6.476 h 16.87 l -0.937,6.987 0.255,0.085 c 4.771,-4.09 9.373,-7.924 16.02,-7.924 6.475,0 9.798,3.322 10.054,10.139 0,1.363 -0.085,3.067 -0.341,4.687 l -3.067,21.812 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 L 722,221.7 h -18.404 z"
+ id="path339"
+ style="fill:url(#SVGID_24_)"
+ inkscape:connector-curvature="0" />
+ </g>
+</g>
+<g
+ id="g4141"
+ transform="matrix(0.81856441,0,0,0.81856441,79.234731,-94.128741)">
+ <g
+ id="g4143">
+
+
+
+
+
+
+
+
+
+
+ </g>
+ <g
+ id="g4165">
+ <linearGradient
+ y2="155.3275"
+ x2="324.1611"
+ y1="239.7637"
+ x1="324.1611"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4167">
+ <stop
+ id="stop4169"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4171"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3277"
+ x2="377.45459"
+ y1="239.7637"
+ x1="377.45459"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4175">
+ <stop
+ id="stop4177"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4179"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3275"
+ x2="435.17719"
+ y1="239.7637"
+ x1="435.17719"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4183">
+ <stop
+ id="stop4185"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4187"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3275"
+ x2="474.83691"
+ y1="239.7637"
+ x1="474.83691"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4191">
+ <stop
+ id="stop4193"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4195"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3277"
+ x2="512.28223"
+ y1="239.7637"
+ x1="512.28223"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4199">
+ <stop
+ id="stop4201"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4203"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.32719"
+ x2="546.65918"
+ y1="239.7637"
+ x1="546.65918"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4207">
+ <stop
+ id="stop4209"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4211"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.32719"
+ x2="580.69629"
+ y1="239.7637"
+ x1="580.69629"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4215">
+ <stop
+ id="stop4217"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4219"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3268"
+ x2="622.7832"
+ y1="239.7637"
+ x1="622.7832"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4223">
+ <stop
+ id="stop4225"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4227"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3275"
+ x2="655.6709"
+ y1="239.7637"
+ x1="655.6709"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4231">
+ <stop
+ id="stop4233"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4235"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ <linearGradient
+ y2="155.3277"
+ x2="697.92969"
+ y1="239.7637"
+ x1="697.92969"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4239">
+ <stop
+ id="stop4241"
+ style="stop-color:#000000"
+ offset="0" />
+ <stop
+ id="stop4243"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0" />
+ <a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" />
+ <a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+
+ </g>
+</g></svg> \ No newline at end of file
diff --git a/emcc b/emcc
index f425ff4d..f7d1a939 100755
--- a/emcc
+++ b/emcc
@@ -48,19 +48,22 @@ emcc can be influenced by a few environment variables:
'''
import os, sys, shutil, tempfile, subprocess, shlex, time, re, logging
-from subprocess import PIPE, STDOUT
-from tools import shared, jsrun
+from subprocess import PIPE
+from tools import shared, jsrun, system_libs
from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename, WINDOWS
from tools.response_file import read_response_file
# endings = dot + a suffix, safe to test by filename.endswith(endings)
C_ENDINGS = ('.c', '.C')
CXX_ENDINGS = ('.cpp', '.cxx', '.cc', '.CPP', '.CXX', '.CC')
-SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + ('.m', '.mm')
+OBJC_ENDINGS = ('.m',)
+OBJCXX_ENDINGS = ('.mm',)
+SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + OBJC_ENDINGS + OBJCXX_ENDINGS
BITCODE_ENDINGS = ('.bc', '.o', '.obj')
DYNAMICLIB_ENDINGS = ('.dylib', '.so', '.dll')
STATICLIB_ENDINGS = ('.a',)
ASSEMBLY_ENDINGS = ('.ll',)
+HEADER_ENDINGS = ('.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH')
LIB_PREFIXES = ('', 'lib')
@@ -146,7 +149,7 @@ Options that are modified or new in %s include:
This is the recommended setting when you want a
reasonably optimized build that is generated as
- quickly as possible (it is much faster than -O2).
+ quickly as possible (it builds much faster than -O2).
(Note: for details on the affects of different
opt levels, see apply_opt_level() in
@@ -158,20 +161,20 @@ Options that are modified or new in %s include:
time in return for the smallest and fastest
output.
- -O3 As -O2, plus dangerous optimizations that may
- break the generated code! This adds
+ -Os Like -O2 with extra optimizations for size.
- -s FORCE_ALIGNED_MEMORY=1
- -s DOUBLE_MODE=0
- -s PRECISE_I64_MATH=0
- --closure 1
- --llvm-lto 3
+ -Oz Like -Os but reduces code size further.
- This is not recommended at all. A better idea
- is to try each of these separately on top of
- -O2 to see what works. See the wiki and
- src/settings.js (for the -s options) for more
- information.
+ -O3 Like -O2 plus additional JS optimizations that can
+ take a significant amount of compilation time and/or
+ are relatively new. Note that differs from -O2 only
+ during the bitcode to JS (final link + JS generation)
+ stage, as it is JS-specific, so you can run -Os
+ on your source files for example, and -O3 during
+ JS generation if you want.
+
+ For tips on optimizing your code, see
+ https://github.com/kripken/emscripten/wiki/Optimizing-Code
-s OPTION=VALUE JavaScript code generation option passed
into the emscripten compiler. For the
@@ -267,8 +270,7 @@ Options that are modified or new in %s include:
code size and may in some cases increase
runtime speed (although the opposite can also
occur). Note that it takes time to run, and
- may require some changes to the code. This
- is run by default in -O3.
+ may require some changes to the code.
In asm.js mode, closure will only be used on the
'shell' code around the compiled code (the
@@ -282,21 +284,6 @@ Options that are modified or new in %s include:
Note: Closure is only run if js opts are being
done (-O2 or above, or --js-opts 1).
- --js-transform <cmd> <cmd> will be called on the generated code
- before it is optimized. This lets you modify
- the JavaScript, for example adding some code
- or removing some code, in a way that those
- modifications will be optimized together with
- the generated code properly. <cmd> will be
- called with the filename of the generated
- code as a parameter; to modify the code, you
- can read the original data and then append to
- it or overwrite it with the modified data.
- <cmd> is interpreted as a space-separated
- list of arguments, for example, <cmd> of
- "python processor.py" will cause a python
- script to be run.
-
--pre-js <file> A file whose contents are added before the
generated code. This is done *before*
optimization, so it will be minified
@@ -319,6 +306,13 @@ Options that are modified or new in %s include:
If a directory is passed here, its entire
contents will be embedded.
+ Note: Embedding files is much less
+ efficient than preloading them. You
+ should only use it for small amounts
+ of small files. Instead, use
+ --preload-file which emits efficient
+ binary data.
+
--preload-file <name> A file to preload before running the
compiled code asynchronously. Otherwise
similar to --embed-file, except that this
@@ -344,10 +338,20 @@ Options that are modified or new in %s include:
For more docs on the options --preload-file
accepts, see https://github.com/kripken/emscripten/wiki/Filesystem-Guide
- --exclude-file <name> Files and directories to be excluded from
+ --exclude-file <name> Files and directories to be excluded from
--embed-file and --preload-file
wildcard is supported
+ --shell-file <path> The path name to a skeleton HTML file used
+ when generating HTML output. The shell file
+ used needs to have this token inside it:
+ {{{ SCRIPT }}}
+ (see src/shell.html and
+ src/shell_minimal.html for examples)
+ Note that this argument is ignored if a
+ target other than HTML is specified using
+ the -o option.
+
--compression <codec> **THIS OPTION IS DEPRECATED**
Compress both the compiled code and embedded/
@@ -371,6 +375,21 @@ Options that are modified or new in %s include:
--minify 0 Identical to -g1
+ --js-transform <cmd> <cmd> will be called on the generated code
+ before it is optimized. This lets you modify
+ the JavaScript, for example adding some code
+ or removing some code, in a way that those
+ modifications will be optimized together with
+ the generated code properly. <cmd> will be
+ called with the filename of the generated
+ code as a parameter; to modify the code, you
+ can read the original data and then append to
+ it or overwrite it with the modified data.
+ <cmd> is interpreted as a space-separated
+ list of arguments, for example, <cmd> of
+ "python processor.py" will cause a python
+ script to be run.
+
--split <size> Splits the resulting javascript file into pieces
to ease debugging. This option only works if
Javascript is generated (target -o <name>.js).
@@ -392,6 +411,9 @@ Options that are modified or new in %s include:
The main file resides in the base directory and
has the suffix ".js".
+ Note: this option is deprecated (modern JS debuggers
+ should work ok even on large files)
+
--bind Compiles the source code using the "embind"
bindings approach, which connects C/C++ and JS.
@@ -404,74 +426,22 @@ Options that are modified or new in %s include:
errors. However, you will need to manually
link to the shared libraries later on yourself.
- --shell-file <path> The path name to a skeleton HTML file used
- when generating HTML output. The shell file
- used needs to have this token inside it:
- {{{ SCRIPT }}}
- (see src/shell.html for an example)
- Note that this argument is ignored if a
- target other than HTML is specified using
- the -o option.
-
--js-library <lib> A JavaScript library to use in addition to
those in Emscripten's src/library_*
-v Turns on verbose output. This will pass
-v to Clang, and also enable EMCC_DEBUG
- to details emcc's operations
-
- --jcache Use a JavaScript cache. This is disabled by
- default. When enabled, emcc will store the
- results of compilation in a cache and check
- the cache when compiling later, something
- like what ccache does. This allows incremental
- builds - where you are compiling a large
- program but only modified a small part of it -
- to be much faster (at the cost of more disk
- IO for cache accesses). Note that you need
- to enable --jcache for both loading and saving
- of data, so you must enable it on a full build
- 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.
-
- To work around the problem mentioned in the
- previous paragraph, you can use
-
- emscripten_jcache_printf
-
- when adding debug printfs to your code. That
- function is specially preprocessed so that it
- does not create a constant string global for
- its first argument. See emscripten.h for more
- details. Note in particular that you need to
- already have a call to that function in your
- code *before* you add one and do an incremental
- build, so that adding an external reference
- (also a global property) does not invalidate
- everything.
-
- Note that you should use -g during the linking
- stage (bitcode to JS), for jcache to work
- (otherwise, JS minification can confuse it).
+ to details emcc's operations.
+
+ It will also run emscripten's internal sanity
+ checks, checking that things like the LLVM directory
+ path looks correct, etc. This works with or
+ without other arguments, so it can be useful to run
+
+ emcc -v
+
+ if you see odd errors, as it can help diagnose
+ things.
--clear-cache Manually clears the cache of compiled
emscripten system libraries (libc++,
@@ -494,10 +464,13 @@ Options that are modified or new in %s include:
libraries, and after any link-time optimizations
(if any).
- --memory-init-file <on> If on, we generate a separate memory initialization
- file. This is more efficient than storing the
- memory initialization data embedded inside
- JavaScript as text. (default is off)
+ --memory-init-file <on> 0: Do not emit a separate memory initialization
+ file, keep the static initialization inside
+ the generated JavaScript as text (default)
+ 1: Emit a separate memory initialization file
+ in binary format. This is more efficient than
+ storing it as text inside JavaScript, but does
+ mean you have another file to publish.
-Wno-warn-absolute-paths If not specified, the compiler will warn about any
uses of absolute paths in -I and -L command line
@@ -522,9 +495,9 @@ Options that are modified or new in %s include:
--default-obj-ext .ext Specifies the file suffix to generate if the location
of a directory name is passed to -o directive, e.g.
emcc -c a.c -o dir/
- will by default generate an output name 'dir/a.o',
+ will by default generate an output name 'dir/a.o',
but this cmdline param can be passed to generate a
- file with a custom suffix 'dir/a.ext'.
+ file with a custom suffix 'dir/a.ext'.
The target file, if specified (-o <target>), defines what will
be generated:
@@ -565,17 +538,19 @@ elif sys.argv[1] == '--version':
finally:
os.chdir(here)
print '''emcc (Emscripten GCC-like replacement) %s (%s)
-Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt)
+Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
''' % (shared.EMSCRIPTEN_VERSION, revision)
- exit(0)
+ exit(0)
elif len(sys.argv) == 2 and sys.argv[1] == '-v': # -v with no inputs
print 'emcc (Emscripten GCC-like replacement + linker emulating GNU ld ) %s' % shared.EMSCRIPTEN_VERSION
- exit(subprocess.call([shared.CLANG, '-v']))
+ code = subprocess.call([shared.CLANG, '-v'])
+ shared.check_sanity(force=True)
+ exit(code)
-def is_minus_s_for_emcc(newargs,i):
+def is_minus_s_for_emcc(newargs, i):
assert newargs[i] == '-s'
if i+1 < len(newargs) and '=' in newargs[i+1]: # -s OPT=VALUE is for us, -s by itself is a linker option
return True
@@ -636,7 +611,7 @@ if CONFIGURE_CONFIG or CMAKE_CONFIG:
idx += 1
cmd = [compiler] + list(filter_emscripten_options(sys.argv[1:]))
- if not use_js: cmd += shared.EMSDK_OPTS + ['-DEMSCRIPTEN']
+ if not use_js: cmd += shared.EMSDK_OPTS + ['-D__EMSCRIPTEN__', '-DEMSCRIPTEN']
if use_js: cmd += ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=1'] # configure tests should fail when an undefined symbol exists
logging.debug('just configuring: ' + ' '.join(cmd))
@@ -705,15 +680,12 @@ if len(sys.argv) == 1 or sys.argv[1] in ['x', 't']:
sys.exit(0)
use_cxx = True
-header = False # pre-compiled headers. We fake that by just copying the file
for i in range(1, len(sys.argv)):
arg = sys.argv[i]
if not arg.startswith('-'):
- if arg.endswith(('.c','.m')):
+ if arg.endswith(C_ENDINGS + OBJC_ENDINGS):
use_cxx = False
- if arg.endswith('.h') and sys.argv[i-1] != '-include':
- header = True
if '-M' in sys.argv or '-MM' in sys.argv:
# Just output dependencies, do not compile. Warning: clang and gcc behave differently with -MF! (clang seems to not recognize it)
@@ -747,15 +719,6 @@ if '.' in target:
else:
final_suffix = ''
-if header: # header or such
- if len(sys.argv) >= 3: # if there is a source and a target, then copy, otherwise do nothing
- sys.argv = filter(lambda arg: not arg.startswith('-I'), sys.argv)
- logging.debug('Just copy:' + sys.argv[-1] + target)
- shutil.copy(sys.argv[-1], target)
- else:
- logging.debug('No-op.')
- exit(0)
-
if TEMP_DIR:
temp_dir = TEMP_DIR
if os.path.exists(temp_dir):
@@ -781,6 +744,14 @@ def filename_type_ending(filename):
suffix = filename_type_suffix(filename)
return '' if not suffix else ('.' + suffix)
+# Log out times for emcc stages
+log_time_last = time.time()
+def log_time(name):
+ global log_time_last
+ now = time.time()
+ logging.debug('emcc step "%s" took %.2f seconds', name, now - log_time_last)
+ log_time_last = now
+
try:
call = CXX if use_cxx else CC
@@ -847,10 +818,19 @@ try:
# Let -O default to -O2, which is what gcc does.
requested_level = newargs[i][2:] or '2'
if requested_level == 's':
+ llvm_opts = ['-Os']
requested_level = 2
settings_changes.append('INLINING_LIMIT=50')
+ elif requested_level == 'z':
+ llvm_opts = ['-Oz']
+ requested_level = 2
+ settings_changes.append('INLINING_LIMIT=25')
opt_level = validate_arg_level(requested_level, 3, 'Invalid optimization level: ' + newargs[i])
- newargs[i] = ''
+ # We leave the -O option in place so that the clang front-end runs in that
+ # optimization mode, but we disable the actual optimization passes, as we'll
+ # run them seperately.
+ newargs.append('-mllvm')
+ newargs.append('-disable-llvm-optzns')
elif newargs[i].startswith('--js-opts'):
check_bad_eq(newargs[i])
js_opts = eval(newargs[i+1])
@@ -963,6 +943,7 @@ try:
shared.set_logging()
logging.debug('invocation: ' + ' '.join(sys.argv))
shared.apply_configuration() # reset config to pick up change
+ shared.check_sanity(force=True)
newargs[i] = ''
elif newargs[i].startswith('--shell-file'):
check_bad_eq(newargs[i])
@@ -975,15 +956,17 @@ try:
newargs[i] = ''
newargs[i+1] = ''
elif newargs[i] == '--remove-duplicates':
- logging.warning ('--remove-duplicates is deprecated as it is no longer needed. If you cannot link without it, file a bug with a testcase')
+ logging.warning('--remove-duplicates is deprecated as it is no longer needed. If you cannot link without it, file a bug with a testcase')
newargs[i] = ''
elif newargs[i] == '--jcache':
+ logging.warning('jcache is deprecated')
jcache = True
newargs[i] = ''
elif newargs[i] == '--clear-cache':
newargs[i] = ''
logging.warning('clearing cache')
shared.Cache.erase()
+ shared.check_sanity(force=True) # this is a good time for a sanity check
sys.exit(0)
elif newargs[i] == '--save-bc':
check_bad_eq(newargs[i])
@@ -1001,7 +984,7 @@ try:
elif newargs[i].startswith(('-I', '-L')):
path_name = newargs[i][2:]
if not absolute_warning_shown and os.path.isabs(path_name):
- logging.warning ('-I or -L of an absolute path "' + newargs[i] + '" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass \'-Wno-warn-absolute-paths\' to emcc to hide this warning.') # Of course an absolute path to a non-system-specific library or header is fine, and you can ignore this warning. The danger are system headers that are e.g. x86 specific and nonportable. The emscripten bundled headers are modified to be portable, local system ones are generally not
+ logging.warning('-I or -L of an absolute path "' + newargs[i] + '" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass \'-Wno-warn-absolute-paths\' to emcc to hide this warning.') # Of course an absolute path to a non-system-specific library or header is fine, and you can ignore this warning. The danger are system headers that are e.g. x86 specific and nonportable. The emscripten bundled headers are modified to be portable, local system ones are generally not
absolute_warning_shown = True
elif newargs[i] == '--emrun':
emrun = True
@@ -1017,7 +1000,7 @@ try:
default_object_extension = '.' + default_object_extension
newargs[i+1] = ''
- newargs = [ arg for arg in newargs if arg is not '' ]
+ newargs = [arg for arg in newargs if arg is not '']
# If user did not specify a default -std for C++ code, specify the emscripten default.
if default_cxx_std:
@@ -1029,9 +1012,7 @@ try:
if js_opts is None: js_opts = opt_level >= 2
if llvm_opts is None: llvm_opts = LLVM_OPT_LEVEL[opt_level]
- if llvm_lto is None and opt_level >= 3: llvm_lto = 3
if opt_level == 0: debug_level = 4
- if closure is None and opt_level == 3: closure = True
if llvm_lto is None and bind:
logging.debug('running lto for embind') # XXX this is a workaround for a pointer issue
@@ -1045,7 +1026,7 @@ try:
if DEBUG: start_time = time.time() # done after parsing arguments, which might affect debug state
if closure:
- assert os.path.exists(shared.CLOSURE_COMPILER), logging.error('fatal: Closure compiler (%s) does not exist' % shared.CLOSURE_COMPILER)
+ assert os.path.exists(shared.CLOSURE_COMPILER), logging.error('fatal: Closure compiler (%s) does not exist', shared.CLOSURE_COMPILER)
for i in range(len(newargs)):
if newargs[i] == '-s':
@@ -1057,7 +1038,7 @@ try:
settings_changes.append('USE_TYPED_ARRAYS=' + newargs[i+1])
newargs[i] = ''
newargs[i+1] = ''
- newargs = [ arg for arg in newargs if arg is not '' ]
+ newargs = [arg for arg in newargs if arg is not '']
if split_js_file:
settings_changes.append("PRINT_SPLIT_FILE_MARKER=1")
@@ -1066,6 +1047,7 @@ try:
input_files = []
has_source_inputs = False
+ has_header_inputs = False
lib_dirs = [shared.path_from_root('system', 'local', 'lib'),
shared.path_from_root('system', 'lib')]
libs = []
@@ -1077,20 +1059,23 @@ try:
prev = newargs[i-1]
if prev in ['-MT', '-MF', '-MQ', '-D', '-U', '-o', '-x', '-Xpreprocessor', '-include', '-imacros', '-idirafter', '-iprefix', '-iwithprefix', '-iwithprefixbefore', '-isysroot', '-imultilib', '-A', '-isystem', '-iquote', '-install_name', '-compatibility_version', '-current_version', '-I', '-L']: continue # ignore this gcc-style argument
- if (os.path.islink(arg) and os.path.realpath(arg).endswith(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS)):
+ if os.path.islink(arg) and os.path.realpath(arg).endswith(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS + HEADER_ENDINGS):
arg = os.path.realpath(arg)
if not arg.startswith('-'):
if not os.path.exists(arg):
- logging.error('%s: No such file or directory ("%s" was expected to be an input file, based on the commandline arguments provided)' % (arg, arg))
+ logging.error('%s: No such file or directory ("%s" was expected to be an input file, based on the commandline arguments provided)', arg, arg)
exit(1)
arg_ending = filename_type_ending(arg)
- if arg_ending.endswith(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS) or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs
+ if arg_ending.endswith(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + ASSEMBLY_ENDINGS + HEADER_ENDINGS) or shared.Building.is_ar(arg): # we already removed -o <target>, so all these should be inputs
newargs[i] = ''
if arg_ending.endswith(SOURCE_ENDINGS):
input_files.append(arg)
has_source_inputs = True
+ elif arg_ending.endswith(HEADER_ENDINGS):
+ input_files.append(arg)
+ has_header_inputs = True
elif arg_ending.endswith(ASSEMBLY_ENDINGS) or shared.Building.is_bitcode(arg): # this should be bitcode, make sure it is valid
input_files.append(arg)
elif arg_ending.endswith(STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS):
@@ -1124,18 +1109,18 @@ try:
original_input_files = input_files[:]
- newargs = [ arg for arg in newargs if arg is not '' ]
+ newargs = [arg for arg in newargs if arg is not '']
# -c means do not link in gcc, and for us, the parallel is to not go all the way to JS, but stop at bitcode
has_dash_c = '-c' in newargs
if has_dash_c:
- assert has_source_inputs, 'Must have source code inputs to use -c'
+ assert has_source_inputs or has_header_inputs, 'Must have source code or header inputs to use -c'
target = target_basename + '.o'
final_suffix = 'o'
# Find library files
for lib in libs:
- logging.debug('looking for library "%s"' % lib)
+ logging.debug('looking for library "%s"', lib)
found = False
for prefix in LIB_PREFIXES:
for suff in STATICLIB_ENDINGS + DYNAMICLIB_ENDINGS:
@@ -1143,27 +1128,27 @@ try:
for lib_dir in lib_dirs:
path = os.path.join(lib_dir, name)
if os.path.exists(path):
- logging.debug('found library "%s" at %s' % (lib, path))
+ logging.debug('found library "%s" at %s', lib, path)
input_files.append(path)
found = True
break
if found: break
if found: break
- if not found: logging.warning('emcc: cannot find library "%s"' % lib)
+ if not found: logging.warning('emcc: cannot find library "%s"', lib)
# If not compiling to JS, then we are compiling to an intermediate bitcode objects or library, so
# ignore dynamic linking, since multiple dynamic linkings can interfere with each other
if not filename_type_suffix(target) in JS_CONTAINING_SUFFIXES or ignore_dynamic_linking:
def check(input_file):
if filename_type_ending(input_file) in DYNAMICLIB_ENDINGS:
- if not ignore_dynamic_linking: logging.warning('ignoring dynamic library %s because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end' % os.path.basename(input_file))
+ if not ignore_dynamic_linking: logging.warning('ignoring dynamic library %s because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end', os.path.basename(input_file))
return False
else:
return True
- input_files = filter(lambda input_file: check(input_file), input_files)
+ input_files = [input_file for input_file in input_files if check(input_file)]
if len(input_files) == 0:
- logging.error('no input files\nnote that input files without a known suffix are ignored, make sure your input files end with one of: ' + str(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + STATICLIB_ENDINGS + ASSEMBLY_ENDINGS))
+ logging.error('no input files\nnote that input files without a known suffix are ignored, make sure your input files end with one of: ' + str(SOURCE_ENDINGS + BITCODE_ENDINGS + DYNAMICLIB_ENDINGS + STATICLIB_ENDINGS + ASSEMBLY_ENDINGS + HEADER_ENDINGS))
exit(0)
newargs = CC_ADDITIONAL_ARGS + newargs
@@ -1190,32 +1175,45 @@ try:
logging.warning('disabling asm.js since embind is not ready for it yet')
shared.Settings.ASM_JS = 0
- fastcomp = os.environ.get('EMCC_FAST_COMPILER') == '1'
+ fastcomp = os.environ.get('EMCC_FAST_COMPILER') != '0'
if fastcomp:
- shared.Settings.ASM_JS = 1
- assert shared.Settings.ALLOW_MEMORY_GROWTH == 0, 'memory growth not supported in fastcomp yet'
- assert shared.Settings.UNALIGNED_MEMORY == 0, 'forced unaligned memory not supported in fastcomp'
- assert shared.Settings.SAFE_HEAP == 0, 'safe heap not supported in fastcomp yet'
- assert shared.Settings.CHECK_HEAP_ALIGN == 0, 'check heap align not supported in fastcomp yet'
- assert shared.Settings.SAFE_DYNCALLS == 0, 'safe dyncalls not supported in fastcomp'
- assert shared.Settings.RESERVED_FUNCTION_POINTERS == 0, 'reserved function pointers not supported in fastcomp'
- assert shared.Settings.ASM_HEAP_LOG == 0, 'asm heap log not supported in fastcomp'
- assert shared.Settings.LABEL_DEBUG == 0, 'label debug not supported in fastcomp'
- assert shared.Settings.LEGACY_GL_EMULATION == 0, 'legacy gl emulation not supported in fastcomp'
- assert shared.Settings.EXECUTION_TIMEOUT == -1, 'execution timeout not supported in fastcomp'
- assert shared.Settings.NAMED_GLOBALS == 0, 'named globals not supported in fastcomp'
- assert shared.Settings.PGO == 0, 'pgo not supported in fastcomp'
- assert shared.Settings.TARGET_LE32 == 1, 'fastcomp requires le32'
- assert shared.Settings.USE_TYPED_ARRAYS == 2, 'fastcomp assumes ta2'
- assert not bind, 'embind not supported in fastcomp yet'
+ shared.Settings.ASM_JS = 1 if opt_level > 0 else 2
+ try:
+ assert shared.Settings.UNALIGNED_MEMORY == 0, 'forced unaligned memory not supported in fastcomp'
+ assert shared.Settings.CHECK_HEAP_ALIGN == 0, 'check heap align not supported in fastcomp yet'
+ assert shared.Settings.SAFE_DYNCALLS == 0, 'safe dyncalls not supported in fastcomp'
+ assert shared.Settings.ASM_HEAP_LOG == 0, 'asm heap log not supported in fastcomp'
+ assert shared.Settings.LABEL_DEBUG == 0, 'label debug not supported in fastcomp'
+ assert shared.Settings.EXECUTION_TIMEOUT == -1, 'execution timeout not supported in fastcomp'
+ assert shared.Settings.NAMED_GLOBALS == 0, 'named globals not supported in fastcomp'
+ assert shared.Settings.PGO == 0, 'pgo not supported in fastcomp'
+ assert shared.Settings.TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 1, 'fastcomp requires asmjs-unknown-emscripten'
+ assert shared.Settings.USE_TYPED_ARRAYS == 2, 'fastcomp assumes ta2'
+ assert not split_js_file, '--split-js is deprecated and not supported in fastcomp'
+ assert not bind, 'embind not supported in fastcomp yet'
+ assert shared.Settings.MAX_SETJMPS == 20, 'changing MAX_SETJMPS is not supported in fastcomp yet'
+ assert shared.Settings.INIT_HEAP == 0, 'HEAP_INIT is not supported in fastcomp (and should never be needed except for debugging)'
+ assert not shared.Settings.RUNTIME_TYPE_INFO, 'RUNTIME_TYPE_INFO is not supported in fastcomp'
+ assert not shared.Settings.CORRUPTION_CHECK, 'CORRUPTION_CHECK is not supported in asm.js mode, which is what fastcomp can emit (you can use non-asm.js mode in non-fastcomp)'
+ except Exception, e:
+ logging.error('Compiler settings are incompatible with fastcomp. You can fall back to the older compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend')
+ raise e
+
if jcache:
- logging.warning('jcache is not supported in fastcomp (you should not need it anyhow), disabling')
+ logging.warning('jcache is deprecated and not supported in fastcomp (you should not need it anyhow), disabling')
jcache = False
- fastcomp_opts = ['-pnacl-abi-simplify-preopt', '-pnacl-abi-simplify-postopt']
- if not shared.Settings.DISABLE_EXCEPTION_CATCHING:
+ pre_fastcomp_opts = []
+ fastcomp_opts = []
+ if shared.Settings.NO_EXIT_RUNTIME:
+ pre_fastcomp_opts += ['-emscripten-no-exit-runtime']
+ if not llvm_lto: fastcomp_opts += ['-globalopt', '-globaldce']
+ fastcomp_opts += ['-pnacl-abi-simplify-preopt', '-pnacl-abi-simplify-postopt']
+ if shared.Settings.DISABLE_EXCEPTION_CATCHING != 1:
fastcomp_opts += ['-enable-emscripten-cxx-exceptions']
+ if len(shared.Settings.EXCEPTION_CATCHING_WHITELIST) > 0:
+ fastcomp_opts += ['-emscripten-cxx-exceptions-whitelist=' + ','.join(shared.Settings.EXCEPTION_CATCHING_WHITELIST)]
if shared.Settings.ASM_JS:
assert opt_level >= 1 or fastcomp, 'asm.js requires -O1 or above'
@@ -1230,6 +1228,14 @@ try:
shared.Settings.CORRECT_OVERFLOWS = 1
assert not shared.Settings.PGO, 'cannot run PGO in ASM_JS mode'
+ if shared.Settings.SAFE_HEAP and not js_opts:
+ js_opts = True
+ logging.warning('enabling js opts to allow SAFE_HEAP to work properly')
+
+ if shared.Settings.ALLOW_MEMORY_GROWTH:
+ logging.warning('Disabling asm.js validation for memory growth (memory can grow, but you lose some amount of speed)');
+ shared.Settings.ASM_JS = 2
+
if shared.Settings.CORRECT_SIGNS >= 2 or shared.Settings.CORRECT_OVERFLOWS >= 2 or shared.Settings.CORRECT_ROUNDINGS >= 2:
debug_level = 4 # must keep debug info to do line-by-line operations
@@ -1240,10 +1246,12 @@ try:
assert shared.LLVM_TARGET in shared.COMPILER_OPTS
if shared.LLVM_TARGET == 'i386-pc-linux-gnu':
shared.Settings.TARGET_X86 = 1
- shared.Settings.TARGET_LE32 = 0
- assert 'le32-unknown-nacl' not in shared.COMPILER_OPTS
- elif shared.LLVM_TARGET == 'le32-unknown-nacl':
- shared.Settings.TARGET_LE32 = 1
+ shared.Settings.TARGET_ASMJS_UNKNOWN_EMSCRIPTEN = 0
+ assert 'asmjs-unknown-emscripten' not in shared.COMPILER_OPTS
+ elif shared.LLVM_TARGET == 'asmjs-unknown-emscripten' or \
+ shared.LLVM_TARGET == 'le32-unknown-nacl':
+ # For temporary compatibility, treat 'le32-unknown-nacl' as 'asmjs-unknown-emscripten'.
+ shared.Settings.TARGET_ASMJS_UNKNOWN_EMSCRIPTEN = 1
shared.Settings.TARGET_X86 = 0
assert 'i386-pc-linux-gnu' not in shared.COMPILER_OPTS
else:
@@ -1265,7 +1273,7 @@ try:
shared.Settings.LINKABLE = 1 # TODO: add FORCE_DCE option for the brave people that do want to dce here and in side modules
debug_level = max(debug_level, 2)
- if shared.Settings.ASSERTIONS and shared.Settings.ALIASING_FUNCTION_POINTERS:
+ if not fastcomp and shared.Settings.ASSERTIONS and shared.Settings.ALIASING_FUNCTION_POINTERS:
logging.warning('ALIASING_FUNCTION_POINTERS is on, function pointer comparisons may be invalid across types')
if shared.Settings.STB_IMAGE and final_suffix in JS_CONTAINING_SUFFIXES:
@@ -1289,12 +1297,27 @@ try:
if js_opts:
shared.Settings.RUNNING_JS_OPTS = 1
+ shared.Settings.EMSCRIPTEN_VERSION = shared.EMSCRIPTEN_VERSION
+ shared.Settings.OPT_LEVEL = opt_level
+ shared.Settings.DEBUG_LEVEL = debug_level
+
## Compile source code to bitcode
logging.debug('compiling to bitcode')
temp_files = []
+ log_time('parse arguments and setup')
+
+ # Precompiled headers support
+ if has_header_inputs:
+ for header in input_files:
+ assert header.endswith(HEADER_ENDINGS), 'if you have one header input, we assume you want to precompile headers, and cannot have source files or other inputs as well: ' + str(input_files) + ' : ' + header
+ args = newargs + shared.EMSDK_CXX_OPTS + input_files
+ logging.debug("running (for precompiled headers: " + call + ' ' + ' '.join(args))
+ execute([call] + args) # let compiler frontend print directly, so colors are saved (PIPE kills that)
+ sys.exit(1)
+
# First, generate LLVM bitcode. For each input file, we get base.o with bitcode
for input_file in input_files:
file_ending = filename_type_ending(input_file)
@@ -1334,6 +1357,8 @@ try:
logging.error(input_file + ': Unknown file suffix when compiling to LLVM bitcode!')
sys.exit(1)
+ log_time('bitcodeize inputs')
+
if not LEAVE_INPUTS_RAW:
assert len(temp_files) == len(input_files)
@@ -1343,7 +1368,7 @@ try:
file_ending = filename_type_ending(input_file)
if file_ending.endswith(SOURCE_ENDINGS):
temp_file = temp_files[i]
- logging.debug('optimizing %s with -O%s' % (input_file, llvm_opts))
+ logging.debug('optimizing %s', input_file)
shared.Building.llvm_opt(temp_file, llvm_opts)
# If we were just asked to generate bitcode, stop there
@@ -1380,387 +1405,27 @@ try:
shared.Building.link(temp_files, specified_target)
exit(0)
+ log_time('bitcodeize inputs')
+
## Continue on to create JavaScript
logging.debug('will generate JavaScript')
- extra_files_to_link = []
-
if not LEAVE_INPUTS_RAW and \
- not shared.Settings.BUILD_AS_SHARED_LIB == 2 and \
+ not shared.Settings.BUILD_AS_SHARED_LIB and \
not shared.Settings.SIDE_MODULE: # shared libraries/side modules link no C libraries, need them in parent
+ extra_files_to_link = system_libs.calculate(temp_files, in_temp, stdout, stderr)
+ else:
+ extra_files_to_link = []
- # Check if we need to include some libraries that we compile. (We implement libc ourselves in js, but
- # compile a malloc implementation and stdlibc++.)
-
- def read_symbols(path, exclude=None):
- symbols = map(lambda line: line.strip().split(' ')[1], open(path).readlines())
- if exclude:
- symbols = filter(lambda symbol: symbol not in exclude, symbols)
- return set(symbols)
-
- lib_opts = ['-O2']
-
- # XXX We also need to add libc symbols that use malloc, for example strdup. It's very rare to use just them and not
- # a normal malloc symbol (like free, after calling strdup), so we haven't hit this yet, but it is possible.
- libc_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libc.symbols'))
- sdl_symbols = read_symbols(shared.path_from_root('system', 'lib', 'sdl.symbols'))
- libcextra_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcextra.symbols'))
- libcxx_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcxx', 'symbols'), exclude=libc_symbols)
- libcxxabi_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcxxabi', 'symbols'), exclude=libc_symbols)
-
- # XXX we should disable EMCC_DEBUG when building libs, just like in the relooper
-
- def build_libc(lib_filename, files):
- o_s = []
- prev_cxx = os.environ.get('EMMAKEN_CXX')
- if prev_cxx: os.environ['EMMAKEN_CXX'] = ''
- musl_internal_includes = shared.path_from_root('system', 'lib', 'libc', 'musl', 'src', 'internal')
- for src in files:
- o = in_temp(os.path.basename(src) + '.o')
- execute([shared.PYTHON, shared.EMCC, shared.path_from_root('system', 'lib', src), '-o', o, '-I', musl_internal_includes] + lib_opts, stdout=stdout, stderr=stderr)
- o_s.append(o)
- if prev_cxx: os.environ['EMMAKEN_CXX'] = prev_cxx
- shared.Building.link(o_s, in_temp(lib_filename))
- return in_temp(lib_filename)
-
- def build_libcxx(src_dirname, lib_filename, files):
- o_s = []
- for src in files:
- o = in_temp(src + '.o')
- srcfile = shared.path_from_root(src_dirname, src)
- execute([shared.PYTHON, shared.EMXX, srcfile, '-o', o, '-std=c++11'] + lib_opts, stdout=stdout, stderr=stderr)
- o_s.append(o)
- shared.Building.link(o_s, in_temp(lib_filename))
- return in_temp(lib_filename)
-
- # libc
- def create_libc():
- logging.debug(' building libc for cache')
- libc_files = [
- 'dlmalloc.c',
- os.path.join('libcxx', 'new.cpp'),
- ]
- musl_files = [
- ['internal', [
- 'floatscan.c',
- 'shgetc.c',
- ]],
- ['math', [
- 'scalbn.c',
- 'scalbnl.c',
- ]],
- ['stdio', [
- '__overflow.c',
- '__toread.c',
- '__towrite.c',
- '__uflow.c',
- ]],
- ['stdlib', [
- 'atof.c',
- 'strtod.c',
- ]]
- ]
- for directory, sources in musl_files:
- libc_files += [os.path.join('libc', 'musl', 'src', directory, source) for source in sources]
- return build_libc('libc.bc', libc_files)
-
- def apply_libc(need):
- # libc needs some sign correction. # If we are in mode 0, switch to 2. We will add our lines
- try:
- if shared.Settings.CORRECT_SIGNS == 0: raise Exception('we need to change to 2')
- except: # we fail if equal to 0 - so we need to switch to 2 - or if CORRECT_SIGNS is not even in Settings
- shared.Settings.CORRECT_SIGNS = 2
- if shared.Settings.CORRECT_SIGNS == 2:
- shared.Settings.CORRECT_SIGNS_LINES = [shared.path_from_root('src', 'dlmalloc.c') + ':' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
- # If we are in mode 1, we are correcting everything anyhow. If we are in mode 3, we will be corrected
- # so all is well anyhow too.
- return True
-
- # libcextra
- def create_libcextra():
- logging.debug('building libcextra for cache')
- musl_files = [
- ['ctype', [
- 'iswalnum.c',
- 'iswalpha.c',
- 'iswblank.c',
- 'iswcntrl.c',
- 'iswctype.c',
- 'iswdigit.c',
- 'iswgraph.c',
- 'iswlower.c',
- 'iswprint.c',
- 'iswpunct.c',
- 'iswspace.c',
- 'iswupper.c',
- 'iswxdigit.c',
- 'towctrans.c',
- 'wcswidth.c',
- 'wctrans.c',
- 'wcwidth.c',
- ]],
- ['internal', [
- 'intscan.c',
- ]],
- ['legacy', [
- 'err.c',
- ]],
- ['locale', [
- 'iconv.c',
- 'iswalnum_l.c',
- 'iswalpha_l.c',
- 'iswblank_l.c',
- 'iswcntrl_l.c',
- 'iswctype_l.c',
- 'iswdigit_l.c',
- 'iswgraph_l.c',
- 'iswlower_l.c',
- 'iswprint_l.c',
- 'iswpunct_l.c',
- 'iswspace_l.c',
- 'iswupper_l.c',
- 'iswxdigit_l.c',
- 'strcasecmp_l.c',
- 'strfmon.c',
- 'strncasecmp_l.c',
- 'strxfrm.c',
- 'towctrans_l.c',
- 'towlower_l.c',
- 'towupper_l.c',
- 'wcscoll.c',
- 'wcscoll_l.c',
- 'wcsxfrm.c',
- 'wcsxfrm_l.c',
- 'wctrans_l.c',
- 'wctype_l.c',
- ]],
- ['math', [
- '__cos.c',
- '__cosdf.c',
- '__sin.c',
- '__sindf.c',
- 'ilogb.c',
- 'ilogbf.c',
- 'ilogbl.c',
- 'ldexp.c',
- 'ldexpf.c',
- 'ldexpl.c',
- 'logb.c',
- 'logbf.c',
- 'logbl.c',
- 'lgamma.c',
- 'lgamma_r.c',
- 'lgammaf.c',
- 'lgammaf_r.c',
- 'lgammal.c',
- 'scalbnf.c',
- 'signgam.c',
- 'tgamma.c',
- 'tgammaf.c',
- 'tgammal.c'
- ]],
- ['misc', [
- 'getopt.c',
- 'getopt_long.c',
- ]],
- ['multibyte', [
- 'btowc.c',
- 'mblen.c',
- 'mbrlen.c',
- 'mbrtowc.c',
- 'mbsinit.c',
- 'mbsnrtowcs.c',
- 'mbsrtowcs.c',
- 'mbstowcs.c',
- 'mbtowc.c',
- 'wcrtomb.c',
- 'wcsnrtombs.c',
- 'wcsrtombs.c',
- 'wcstombs.c',
- 'wctob.c',
- 'wctomb.c',
- ]],
- ['regex', [
- 'regcomp.c',
- 'regerror.c',
- 'regexec.c',
- 'tre-mem.c',
- ]],
- ['stdio', [
- 'fwprintf.c',
- 'swprintf.c',
- 'vfwprintf.c',
- 'vswprintf.c',
- 'vwprintf.c',
- 'wprintf.c',
- 'fputwc.c',
- 'fputws.c',
- ]],
- ['stdlib', [
- 'ecvt.c',
- 'fcvt.c',
- 'gcvt.c',
- 'wcstod.c',
- 'wcstol.c',
- ]],
- ['string', [
- 'memccpy.c',
- 'memmem.c',
- 'mempcpy.c',
- 'memrchr.c',
- 'strcasestr.c',
- 'strchrnul.c',
- 'strlcat.c',
- 'strlcpy.c',
- 'strsep.c',
- 'strverscmp.c',
- 'wcpcpy.c',
- 'wcpncpy.c',
- 'wcscasecmp.c',
- 'wcscasecmp_l.c',
- 'wcscat.c',
- 'wcschr.c',
- 'wcscmp.c',
- 'wcscpy.c',
- 'wcscspn.c',
- 'wcsdup.c',
- 'wcslen.c',
- 'wcsncasecmp.c',
- 'wcsncasecmp_l.c',
- 'wcsncat.c',
- 'wcsncmp.c',
- 'wcsncpy.c',
- 'wcsnlen.c',
- 'wcspbrk.c',
- 'wcsrchr.c',
- 'wcsspn.c',
- 'wcsstr.c',
- 'wcstok.c',
- 'wcswcs.c',
- 'wmemchr.c',
- 'wmemcmp.c',
- 'wmemcpy.c',
- 'wmemmove.c',
- 'wmemset.c',
- ]]
- ]
- libcextra_files = []
- for directory, sources in musl_files:
- libcextra_files += [os.path.join('libc', 'musl', 'src', directory, source) for source in sources]
- return build_libc('libcextra.bc', libcextra_files)
-
- # libcxx
- def create_libcxx():
- logging.debug('building libcxx for cache')
- libcxx_files = [
- 'algorithm.cpp',
- 'condition_variable.cpp',
- 'future.cpp',
- 'iostream.cpp',
- 'memory.cpp',
- 'random.cpp',
- 'stdexcept.cpp',
- 'system_error.cpp',
- 'utility.cpp',
- 'bind.cpp',
- 'debug.cpp',
- 'hash.cpp',
- 'mutex.cpp',
- 'string.cpp',
- 'thread.cpp',
- 'valarray.cpp',
- 'chrono.cpp',
- 'exception.cpp',
- 'ios.cpp',
- 'locale.cpp',
- 'regex.cpp',
- 'strstream.cpp'
- ]
- return build_libcxx(os.path.join('system', 'lib', 'libcxx'), 'libcxx.bc', libcxx_files)
-
- def apply_libcxx(need):
- assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++ with QUANTUM_SIZE == 1'
- # libcxx might need corrections, so turn them all on. TODO: check which are actually needed
- shared.Settings.CORRECT_SIGNS = shared.Settings.CORRECT_OVERFLOWS = shared.Settings.CORRECT_ROUNDINGS = 1
- #logging.info('using libcxx turns on CORRECT_* options')
- return True
-
- # libcxxabi - just for dynamic_cast for now
- def create_libcxxabi():
- logging.debug('building libcxxabi for cache')
- libcxxabi_files = [
- 'typeinfo.cpp',
- 'private_typeinfo.cpp'
- ]
- return build_libcxx(os.path.join('system', 'lib', 'libcxxabi', 'src'), 'libcxxabi.bc', libcxxabi_files)
-
- def apply_libcxxabi(need):
- assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++abi with QUANTUM_SIZE == 1'
- #logging.info('using libcxxabi, this may need CORRECT_* options')
- #shared.Settings.CORRECT_SIGNS = shared.Settings.CORRECT_OVERFLOWS = shared.Settings.CORRECT_ROUNDINGS = 1
- return True
-
- # SDL. We include code that demands malloc/free if not already required, so we have proper malloc/free from JS SDL code.
- # Note that the Force instance here can be optimized out, but we still export malloc/free, so they will be kept alive.
- def create_sdl():
- return build_libcxx(os.path.join('system', 'lib'), 'sdl.bc', ['sdl.cpp'])
-
- def apply_sdl(need):
- return 'SDL_Init' in all_needed and ('malloc' not in all_needed or 'free' not in all_needed)
-
- # Settings this in the environment will avoid checking dependencies and make building big projects a little faster
- # 1 means include everything; otherwise it can be the name of a lib (libcxx, etc.)
- force = os.environ.get('EMCC_FORCE_STDLIBS')
- force_all = force == '1'
-
- # Scan symbols
- all_needed = set()
- symbolses = map(lambda temp_file: shared.Building.llvm_nm(temp_file), temp_files)
- for symbols in symbolses:
- all_needed.update(symbols.undefs)
- for symbols in symbolses:
- all_needed.difference_update(symbols.defs)
-
- # Go over libraries to figure out which we must include
- # If we have libcxx, we must force inclusion of libc, since libcxx uses new internally. Note: this is kind of hacky.
- has = need = None
- for name, create, apply_, library_symbols in [('libcxx', create_libcxx, apply_libcxx, libcxx_symbols),
- ('libcextra', create_libcextra, lambda x: True, libcextra_symbols),
- ('libcxxabi', create_libcxxabi, apply_libcxxabi, libcxxabi_symbols),
- ('sdl', create_sdl, apply_sdl, sdl_symbols),
- ('libc', create_libc, apply_libc, libc_symbols)]:
- force_this = force_all or force == name
- if not force_this:
- need = set()
- has = set()
- for symbols in symbolses:
- for library_symbol in library_symbols:
- if library_symbol in symbols.undefs:
- need.add(library_symbol)
- if library_symbol in symbols.defs:
- has.add(library_symbol)
- for haz in has: # remove symbols that are supplied by another of the inputs
- if haz in need:
- need.remove(haz)
- if shared.Settings.VERBOSE: logging.debug('considering %s: we need %s and have %s' % (name, str(need), str(has)))
- if force_this or len(need) > 0:
- force_all = True
- if apply_(need):
- # We need to build and link the library in
- logging.debug('including %s' % name)
- libfile = shared.Cache.get(name, create)
- extra_files_to_link.append(libfile)
+ log_time('calculate system libraries')
# First, combine the bitcode files if there are several. We must also link if we have a singleton .a
if len(input_files) + len(extra_files_to_link) > 1 or \
(not LEAVE_INPUTS_RAW and not (suffix(temp_files[0]) in BITCODE_ENDINGS or suffix(temp_files[0]) in DYNAMICLIB_ENDINGS) and shared.Building.is_ar(temp_files[0])):
linker_inputs = temp_files + extra_files_to_link
logging.debug('linking: ' + str(linker_inputs))
- t0 = time.time()
- shared.Building.link(linker_inputs, in_temp(target_basename + '.bc'), force_archive_contents = len(filter(lambda temp: not temp.endswith(STATICLIB_ENDINGS), temp_files)) == 0)
- t1 = time.time()
- logging.debug(' linking took %.2f seconds' % (t1 - t0))
+ shared.Building.link(linker_inputs, in_temp(target_basename + '.bc'), force_archive_contents=len([temp for temp in temp_files if not temp.endswith(STATICLIB_ENDINGS)]) == 0)
final = in_temp(target_basename + '.bc')
else:
if not LEAVE_INPUTS_RAW:
@@ -1770,19 +1435,16 @@ try:
final = in_temp(input_files[0])
shutil.copyfile(input_files[0], final)
+ log_time('link')
+
if DEBUG:
- logging.debug('saving intermediate processing steps to %s' % shared.EMSCRIPTEN_TEMP_DIR)
+ logging.debug('saving intermediate processing steps to %s', shared.EMSCRIPTEN_TEMP_DIR)
intermediate_counter = 0
- intermediate_time = None
def save_intermediate(name=None, suffix='js'):
- global intermediate_counter, intermediate_time
+ global intermediate_counter
shutil.copyfile(final, os.path.join(shared.EMSCRIPTEN_TEMP_DIR, 'emcc-%d%s.%s' % (intermediate_counter, '' if name is None else '-' + name, suffix)))
intermediate_counter += 1
- now = time.time()
- if intermediate_time:
- logging.debug(' step took %.2f seconds' % (now - intermediate_time))
- intermediate_time = now
if not LEAVE_INPUTS_RAW: save_intermediate('basebc', 'bc')
@@ -1813,7 +1475,7 @@ try:
else:
if fastcomp and not save_bc:
# Simplify LLVM bitcode for fastcomp
- link_opts += fastcomp_opts
+ link_opts = pre_fastcomp_opts + link_opts + fastcomp_opts
shared.Building.llvm_opt(final, link_opts)
if DEBUG: save_intermediate('linktime', 'bc')
if save_bc:
@@ -1843,6 +1505,8 @@ try:
final += '.adsimp.bc'
if DEBUG: save_intermediate('adsimp', 'bc')
+ log_time('post-link')
+
# Emscripten
logging.debug('LLVM => JS')
extra_args = [] if not js_libraries else ['--libraries', ','.join(map(os.path.abspath, js_libraries))]
@@ -1850,6 +1514,8 @@ try:
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
if DEBUG: save_intermediate('original')
+ log_time('emscript (llvm=>js)')
+
# Embed and preload files
if len(preload_files) + len(embed_files) > 0:
logging.debug('setting up files')
@@ -1896,7 +1562,7 @@ try:
shutil.copyfile(final, final + '.tr.js')
final += '.tr.js'
posix = True if not shared.WINDOWS else False
- logging.debug('applying transform: %s' % js_transform)
+ logging.debug('applying transform: %s', js_transform)
subprocess.check_call(shlex.split(js_transform, posix=posix) + [os.path.abspath(final)])
if DEBUG: save_intermediate('transformed')
@@ -1910,9 +1576,7 @@ try:
shared.try_delete(memfile)
def repl(m):
# handle chunking of the memory initializer
- s = re.sub('[\[\]\n\(\)\. ]', '', m.groups(0)[0])
- s = s.replace('concat', ',')
- if s[-1] == ',': s = s[:-1]
+ s = m.groups(0)[0]
open(memfile, 'wb').write(''.join(map(lambda x: chr(int(x or '0')), s.split(','))))
if DEBUG:
# Copy into temp dir as well, so can be run there too
@@ -1923,38 +1587,59 @@ try:
src = re.sub(shared.JS.memory_initializer_pattern, repl, open(final).read(), count=1)
open(final + '.mem.js', 'w').write(src)
final += '.mem.js'
+ src = None
js_transform_tempfiles[-1] = final # simple text substitution preserves comment line number mappings
if DEBUG:
if os.path.exists(memfile):
save_intermediate('meminit')
- logging.debug('wrote memory initialization to %s' % memfile)
+ logging.debug('wrote memory initialization to %s', memfile)
else:
logging.debug('did not see memory initialization')
+ elif shared.Settings.USE_TYPED_ARRAYS == 2 and not shared.Settings.MAIN_MODULE and not shared.Settings.SIDE_MODULE:
+ # not writing a binary init, but we can at least optimize them by splitting them up
+ src = open(final).read()
+ src = shared.JS.optimize_initializer(src)
+ if src is not None:
+ logging.debug('optimizing memory initialization')
+ open(final + '.mem.js', 'w').write(src)
+ final += '.mem.js'
+ src = None
+
+ log_time('source transforms')
# It is useful to run several js optimizer passes together, to save on unneeded unparsing/reparsing
js_optimizer_queue = []
js_optimizer_extra_info = {}
+ js_optimizer_queue_history = []
def flush_js_optimizer_queue():
- global final, js_optimizer_queue, js_optimizer_extra_info
+ global final, js_optimizer_queue, js_optimizer_extra_info, js_optimizer_queue_history
if len(js_optimizer_extra_info) == 0:
js_optimizer_extra_info = None
if len(js_optimizer_queue) > 0 and not(not shared.Settings.ASM_JS and len(js_optimizer_queue) == 1 and js_optimizer_queue[0] == 'last'):
- if DEBUG != '2':
+
+ def add_opt_args(args):
if shared.Settings.ASM_JS:
- js_optimizer_queue = ['asm'] + js_optimizer_queue
+ args = ['asm'] + args
+ if shared.Settings.PRECISE_F32:
+ args = ['asmPreciseF32'] + args
+ return args
+
+ if DEBUG != '2':
+ js_optimizer_queue = add_opt_args(js_optimizer_queue)
logging.debug('applying js optimization passes: %s', js_optimizer_queue)
final = shared.Building.js_optimizer(final, js_optimizer_queue, jcache, debug_level >= 4, js_optimizer_extra_info)
js_transform_tempfiles.append(final)
if DEBUG: save_intermediate('js_opts')
else:
for name in js_optimizer_queue:
- passes = [name]
+ passes = add_opt_args([name])
if shared.Settings.ASM_JS:
passes = ['asm'] + passes
logging.debug('applying js optimization pass: %s', passes)
final = shared.Building.js_optimizer(final, passes, jcache, debug_level >= 4, js_optimizer_extra_info)
js_transform_tempfiles.append(final)
save_intermediate(name)
+ js_optimizer_queue_history += js_optimizer_queue
js_optimizer_queue = []
js_optimizer_extra_info = {}
@@ -1973,14 +1658,16 @@ try:
else:
return 'eliminate'
- js_optimizer_queue += [get_eliminate()]
+ if opt_level >= 2:
+ js_optimizer_queue += [get_eliminate()]
- if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION:
- js_optimizer_queue += ['aggressiveVariableElimination']
+ if shared.Settings.AGGRESSIVE_VARIABLE_ELIMINATION:
+ js_optimizer_queue += ['aggressiveVariableElimination']
- if opt_level >= 2:
js_optimizer_queue += ['simplifyExpressions']
+ if opt_level >= 3 and shared.Settings.PRECISE_F32: js_optimizer_queue += ['optimizeFrounds']
+
if closure and not shared.Settings.ASM_JS:
flush_js_optimizer_queue()
@@ -1991,28 +1678,35 @@ try:
if DEBUG: save_intermediate('closure')
if js_opts:
+ if shared.Settings.ASM_JS and shared.Settings.SAFE_HEAP: js_optimizer_queue += ['safeHeap']
+
if shared.Settings.OUTLINING_LIMIT > 0 and shared.Settings.ASM_JS:
js_optimizer_queue += ['outline']
js_optimizer_extra_info['sizeToOutline'] = shared.Settings.OUTLINING_LIMIT
- if (not closure or shared.Settings.ASM_JS) and shared.Settings.RELOOP and debug_level < 3:
- js_optimizer_queue += ['registerize']
+ if opt_level >= 2 and (not closure or shared.Settings.ASM_JS) and shared.Settings.RELOOP and debug_level < 3:
+ if shared.Settings.ASM_JS and opt_level >= 3 and shared.Settings.OUTLINING_LIMIT == 0:
+ js_optimizer_queue += ['registerizeHarder']
+ else:
+ js_optimizer_queue += ['registerize']
- if opt_level > 0:
- if debug_level < 2 and shared.Settings.ASM_JS: js_optimizer_queue = map(lambda p: p if p != 'registerize' else 'registerizeAndMinify', js_optimizer_queue)
+ if opt_level >= 2:
+ if debug_level < 2 and shared.Settings.ASM_JS: js_optimizer_queue += ['minifyNames']
if debug_level == 0: js_optimizer_queue += ['minifyWhitespace']
- if closure and shared.Settings.ASM_JS:
+ if closure and shared.Settings.ASM_JS:
js_optimizer_queue += ['closure']
if not shared.Settings.SIDE_MODULE: js_optimizer_queue += ['last'] # side modules are not finalized until after relocation
flush_js_optimizer_queue()
+ log_time('js opts')
+
# Remove some trivial whitespace # TODO: do not run when compress has already been done on all parts of the code
- src = open(final).read()
- src = re.sub(r'\n+[ \n]*\n+', '\n', src)
- open(final, 'w').write(src)
+ #src = open(final).read()
+ #src = re.sub(r'\n+[ \n]*\n+', '\n', src)
+ #open(final, 'w').write(src)
def generate_source_map(map_file_base_name, offset=0):
jsrun.run_js(shared.path_from_root('tools', 'source-maps', 'sourcemapper.js'),
@@ -2033,15 +1727,78 @@ try:
html.write(shell.replace('{{{ SCRIPT }}}', '<script>' + open(shared.path_from_root('src', 'proxyClient.js')).read().replace('{{{ filename }}}', target_basename) + '</script>'))
shutil.move(final, js_target)
elif not Compression.on:
+ # Normal code generation path
if debug_level >= 4:
generate_source_map(target)
shutil.move(final, js_target)
- # TODO: use an async blob, which would allow code rewriting on the client:
- # var blob = new Blob([codeString]);
- # var script = document.createElement('script');
- # script.src = URL.createObjectURL(blob);
- # document.body.appendChild(script);
- script_tag = '''<script async type="text/javascript" src="%s"></script>''' % base_js_target
+ need_mods = shared.Settings.PRECISE_F32 == 2
+ if not need_mods:
+ # Non-modifiable code, just load the code directly
+ script_tag = '''<script async type="text/javascript" src="%s"></script>''' % base_js_target
+ else:
+ # Potentially-modifiable code, load as text, modify, then execute. This lets you
+ # patch the code on the client machine right before it is executed, perhaps based
+ # on information about the client.
+ checks = []
+ mods = []
+ if shared.Settings.PRECISE_F32 == 2:
+ checks.append('!Math.fround')
+ if 'minifyNames' not in js_optimizer_queue_history:
+ # simple dumb replace
+ mods.append('''
+console.log('optimizing out Math.fround calls');
+code = code.replace(/Math_fround\(/g, '(').replace("'use asm'", "'almost asm'")
+''')
+ else:
+ # minified, not quite so simple - TODO
+ mods.append('''
+try {
+ console.log('optimizing out Math.fround calls');
+ var m = /var ([^=]+)=global\.Math\.fround;/.exec(code);
+ var minified = m[1];
+ if (!minified) throw 'fail';
+ var startAsm = code.indexOf('// EMSCRIPTEN_START_FUNCS');
+ var endAsm = code.indexOf('// EMSCRIPTEN_END_FUNCS');
+ var asm = code.substring(startAsm, endAsm);
+ do {
+ var moar = false; // we need to re-do, as x(x( will not be fixed
+ asm = asm.replace(new RegExp('[^a-zA-Z0-9\\\\$\\\\_]' + minified + '\\\\(', 'g'), function(s) { moar = true; return s[0] + '(' });
+ } while (moar);
+ code = code.substring(0, startAsm) + asm + code.substring(endAsm);
+ code = code.replace("'use asm'", "'almost asm'");
+} catch(e) { console.log('failed to optimize out Math.fround calls ' + e) }
+''')
+
+ fixes = ''
+ for i in range(len(checks)):
+ fixes += 'if (' + checks[i] + ') { ' + mods[i] + ' }\n'
+
+ # if all the checks are negative, just emit a script tag normally, that's better.
+ # otherwise, do an xhr to get the code as text, modify, and load asynchronously
+ code = 'if (!(' + ' || '.join(checks) + ''')) {
+ var script = document.createElement('script');
+ script.src = "''' + base_js_target + '''";
+ document.body.appendChild(script);
+} else {
+ var codeXHR = new XMLHttpRequest();
+ codeXHR.open('GET', '%s', true);
+ codeXHR.onload = function() {
+ var code = codeXHR.responseText;
+ %s
+ var blob = new Blob([code], { type: 'text/javascript' });
+ codeXHR = null;
+ var src = URL.createObjectURL(blob);
+ var script = document.createElement('script');
+ script.src = URL.createObjectURL(blob);
+ script.onload = function() {
+ URL.revokeObjectURL(script.src);
+ };
+ document.body.appendChild(script);
+ };
+ codeXHR.send(null);
+}
+''' % (base_js_target, fixes)
+ script_tag = '''<script>%s</script>''' % code
html.write(shell.replace('{{{ SCRIPT }}}', script_tag))
else:
# Compress the main code
@@ -2115,7 +1872,9 @@ try:
# copy final JS to output
shutil.move(final, target)
- if DEBUG: logging.debug('total time: %.2f seconds' % (time.time() - start_time))
+ log_time('final emitting')
+
+ if DEBUG: logging.debug('total time: %.2f seconds', (time.time() - start_time))
finally:
if not TEMP_DIR:
diff --git a/emlink.py b/emlink.py
index f767ce58..f767ce58 100644..100755
--- a/emlink.py
+++ b/emlink.py
diff --git a/emscripten-version.txt b/emscripten-version.txt
new file mode 100644
index 00000000..bf2b5ccf
--- /dev/null
+++ b/emscripten-version.txt
@@ -0,0 +1,2 @@
+1.13.0
+
diff --git a/emscripten.py b/emscripten.py
index befad8d5..37e1c83f 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -9,7 +9,7 @@ header files (so that the JS compiler can see the constants in those
headers, for the libc implementation in JS).
'''
-import os, sys, json, optparse, subprocess, re, time, multiprocessing, string, logging, shutil
+import os, sys, json, optparse, subprocess, re, time, multiprocessing, string, logging
from tools import shared
from tools import jsrun, cache as cache_module, tempfiles
@@ -455,7 +455,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
basic_funcs = ['abort', 'assert', 'asmPrintInt', 'asmPrintFloat'] + [m.replace('.', '_') for m in math_envs]
if settings['RESERVED_FUNCTION_POINTERS'] > 0: basic_funcs.append('jsCall')
- if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE', 'SAFE_HEAP_CLEAR']
+ if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE']
if settings['CHECK_HEAP_ALIGN']: basic_funcs += ['CHECK_ALIGN_2', 'CHECK_ALIGN_4', 'CHECK_ALIGN_8']
if settings['ASSERTIONS']:
basic_funcs += ['nullFunc']
@@ -474,6 +474,9 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
basic_vars.append('F_BASE_%s' % sig)
asm_setup += ' var F_BASE_%s = %s;\n' % (sig, 'FUNCTION_TABLE_OFFSET' if settings.get('SIDE_MODULE') else '0') + '\n'
+ if '_rand' in exported_implemented_functions or '_srand' in exported_implemented_functions:
+ basic_vars += ['___rand_seed']
+
asm_runtime_funcs = ['stackAlloc', 'stackSave', 'stackRestore', 'setThrew'] + ['setTempRet%d' % i for i in range(10)]
# function tables
function_tables = ['dynCall_' + table for table in last_forwarded_json['Functions']['tables']]
@@ -518,6 +521,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
exports = '{ ' + ', '.join(exports) + ' }'
else:
exports = '_main'
+
# calculate globals
try:
del forwarded_json['Variables']['globals']['_llvm_global_ctors'] # not a true variable
@@ -534,7 +538,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None,
''.join([' var ' + g + '=+env.' + g + ';\n' for g in basic_float_vars])
# In linkable modules, we need to add some explicit globals for global variables that can be linked and used across modules
if settings.get('MAIN_MODULE') or settings.get('SIDE_MODULE'):
- assert settings.get('TARGET_LE32'), 'TODO: support x86 target when linking modules (needs offset of 4 and not 8 here)'
+ assert settings.get('TARGET_ASMJS_UNKNOWN_EMSCRIPTEN'), 'TODO: support x86 target when linking modules (needs offset of 4 and not 8 here)'
for key, value in forwarded_json['Variables']['globals'].iteritems():
if value.get('linkable'):
init = forwarded_json['Variables']['indexedGlobals'][key] + 8 # 8 is Runtime.GLOBAL_BASE / STATIC_BASE
@@ -725,7 +729,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
outfile: The file where the output is written.
"""
- assert(settings['ASM_JS']) # TODO: apply ASM_JS even in -O0 for fastcomp
+ assert(settings['ASM_JS'])
# Overview:
# * Run LLVM backend to emit JS. JS includes function bodies, memory initializer,
@@ -733,14 +737,19 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
# * Run compiler.js on the metadata to emit the shell js code, pre/post-ambles,
# JS library dependencies, etc.
- if DEBUG:
- logging.debug('emscript: llvm backend')
- t = time.time()
-
temp_js = temp_files.get('.4.js').name
backend_compiler = os.path.join(shared.LLVM_ROOT, 'llc')
- shared.jsrun.timeout_run(subprocess.Popen([backend_compiler, infile, '-march=js', '-filetype=asm', '-o', temp_js], stdout=subprocess.PIPE))
-
+ backend_args = [backend_compiler, infile, '-march=js', '-filetype=asm', '-o', temp_js]
+ if settings['PRECISE_F32']:
+ backend_args += ['-emscripten-precise-f32']
+ if settings['WARN_UNALIGNED']:
+ backend_args += ['-emscripten-warn-unaligned']
+ if settings['RESERVED_FUNCTION_POINTERS'] > 0:
+ backend_args += ['-emscripten-reserved-function-pointers=%d' % settings['RESERVED_FUNCTION_POINTERS']]
+ if DEBUG:
+ logging.debug('emscript: llvm backend: ' + ' '.join(backend_args))
+ t = time.time()
+ shared.jsrun.timeout_run(subprocess.Popen(backend_args, stdout=subprocess.PIPE))
if DEBUG:
logging.debug(' emscript: llvm backend took %s seconds' % (time.time() - t))
t = time.time()
@@ -771,6 +780,8 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
table_sizes = {}
for k, v in metadata['tables'].iteritems():
table_sizes[k] = str(v.count(',')) # undercounts by one, but that is what we want
+ #if settings['ASSERTIONS'] >= 2 and table_sizes[k] == 0:
+ # print >> sys.stderr, 'warning: no function pointers with signature ' + k + ', but there is a call, which will abort if it occurs (this can result from undefined behavior, check for compiler warnings on your source files and consider -Werror)'
funcs = re.sub(r"#FM_(\w+)#", lambda m: table_sizes[m.groups(0)[0]], funcs)
# fix +float into float.0, if not running js opts
@@ -792,11 +803,15 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
if DEBUG: logging.debug('emscript: js compiler glue')
# Settings changes
- assert settings['TARGET_LE32'] == 1
- settings['TARGET_LE32'] = 2
- if 'i64Add' in metadata['declares']: # TODO: others, once we split them up
- settings['PRECISE_I64_MATH'] = 2
- metadata['declares'] = filter(lambda i64_func: i64_func not in ['getHigh32', 'setHigh32', '__muldi3', '__divdi3', '__remdi3', '__udivdi3', '__uremdi3'], metadata['declares']) # FIXME: do these one by one as normal js lib funcs
+ assert settings['TARGET_ASMJS_UNKNOWN_EMSCRIPTEN'] == 1
+ settings['TARGET_ASMJS_UNKNOWN_EMSCRIPTEN'] = 2
+ i64_funcs = ['i64Add', 'i64Subtract', '__muldi3', '__divdi3', '__udivdi3', '__remdi3', '__uremdi3']
+ for i64_func in i64_funcs:
+ if i64_func in metadata['declares']:
+ settings['PRECISE_I64_MATH'] = 2
+ break
+
+ metadata['declares'] = filter(lambda i64_func: i64_func not in ['getHigh32', 'setHigh32', '__muldi3', '__divdi3', '__remdi3', '__udivdi3', '__uremdi3'], metadata['declares']) # FIXME: do these one by one as normal js lib funcs
# Integrate info from backend
settings['DEFAULT_LIBRARY_FUNCS_TO_INCLUDE'] = list(
@@ -858,15 +873,13 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
pre = parts[0]
funcs_js.append(parts[1])
- # calculations on merged forwarded data TODO
-
# merge forwarded data
assert settings.get('ASM_JS'), 'fastcomp is asm.js only'
settings['EXPORTED_FUNCTIONS'] = forwarded_json['EXPORTED_FUNCTIONS']
all_exported_functions = set(settings['EXPORTED_FUNCTIONS']) # both asm.js and otherwise
for additional_export in settings['DEFAULT_LIBRARY_FUNCS_TO_INCLUDE']: # additional functions to export from asm, if they are implemented
all_exported_functions.add('_' + additional_export)
- exported_implemented_functions = set()
+ exported_implemented_functions = set(metadata['exports'])
export_bindings = settings['EXPORT_BINDINGS']
export_all = settings['EXPORT_ALL']
for key in metadata['implementedFunctions'] + forwarded_json['Functions']['implementedFunctions'].keys(): # XXX perf
@@ -904,28 +917,53 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
else:
pre_tables = ''
+ def unfloat(s):
+ return 'd' if s == 'f' else s # lower float to double for ffis
+
+ if settings['ASSERTIONS'] >= 2:
+ debug_tables = {}
+
def make_table(sig, raw):
- i = Counter.i
- Counter.i += 1
- bad = 'b' + str(i)
params = ','.join(['p%d' % p for p in range(len(sig)-1)])
- coerced_params = ','.join([shared.JS.make_coercion('p%d', sig[p+1], settings) % p for p in range(len(sig)-1)])
+ coerced_params = ','.join([shared.JS.make_coercion('p%d', unfloat(sig[p+1]), settings) % p for p in range(len(sig)-1)])
coercions = ';'.join(['p%d = %s' % (p, shared.JS.make_coercion('p%d' % p, sig[p+1], settings)) for p in range(len(sig)-1)]) + ';'
def make_func(name, code):
return 'function %s(%s) { %s %s }' % (name, params, coercions, code)
- Counter.pre = [make_func(bad, ('abort' if not settings['ASSERTIONS'] else 'nullFunc') + '(' + str(i) + ');' + (
- '' if sig[0] == 'v' else ('return %s' % shared.JS.make_initializer(sig[0], settings))
- ))]
+ def make_bad(target=None):
+ i = Counter.i
+ Counter.i += 1
+ if target is None: target = i
+ name = 'b' + str(i)
+ if not settings['ASSERTIONS']:
+ code = 'abort(%s);' % target
+ else:
+ code = 'nullFunc_' + sig + '(%d);' % target
+ if sig[0] != 'v':
+ code += 'return %s' % shared.JS.make_initializer(sig[0], settings) + ';'
+ return name, make_func(name, code)
+ bad, bad_func = make_bad() # the default bad func
+ if settings['ASSERTIONS'] <= 1:
+ Counter.pre = [bad_func]
+ else:
+ Counter.pre = []
start = raw.index('[')
end = raw.rindex(']')
body = raw[start+1:end].split(',')
for j in range(settings['RESERVED_FUNCTION_POINTERS']):
- body[settings['FUNCTION_POINTER_ALIGNMENT'] * (1 + j)] = 'jsCall_%s_%s' % (sig, j)
+ curr = 'jsCall_%s_%s' % (sig, j)
+ body[settings['FUNCTION_POINTER_ALIGNMENT'] * (1 + j)] = curr
+ implemented_functions.add(curr)
Counter.j = 0
def fix_item(item):
Counter.j += 1
newline = Counter.j % 30 == 29
- if item == '0': return bad if not newline else (bad + '\n')
+ if item == '0':
+ if settings['ASSERTIONS'] <= 1:
+ return bad if not newline else (bad + '\n')
+ else:
+ specific_bad, specific_bad_func = make_bad(Counter.j-1)
+ Counter.pre.append(specific_bad_func)
+ return specific_bad if not newline else (specific_bad + '\n')
if item not in implemented_functions:
# this is imported into asm, we must wrap it
call_ident = item
@@ -933,11 +971,15 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
if not call_ident.startswith('_') and not call_ident.startswith('Math_'): call_ident = '_' + call_ident
code = call_ident + '(' + coerced_params + ')'
if sig[0] != 'v':
+ # ffis cannot return float
+ if sig[0] == 'f': code = '+' + code
code = 'return ' + shared.JS.make_coercion(code, sig[0], settings)
code += ';'
Counter.pre.append(make_func(item + '__wrapper', code))
return item + '__wrapper'
return item if not newline else (item + '\n')
+ if settings['ASSERTIONS'] >= 2:
+ debug_tables[sig] = body
body = ','.join(map(fix_item, body))
return ('\n'.join(Counter.pre), ''.join([raw[:start+1], body, raw[end:]]))
@@ -956,11 +998,42 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
basic_funcs = ['abort', 'assert', 'asmPrintInt', 'asmPrintFloat'] + [m.replace('.', '_') for m in math_envs]
if settings['RESERVED_FUNCTION_POINTERS'] > 0: basic_funcs.append('jsCall')
- if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE', 'SAFE_HEAP_CLEAR']
+ if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE']
if settings['CHECK_HEAP_ALIGN']: basic_funcs += ['CHECK_ALIGN_2', 'CHECK_ALIGN_4', 'CHECK_ALIGN_8']
if settings['ASSERTIONS']:
- basic_funcs += ['nullFunc']
- asm_setup += 'function nullFunc(x) { Module["printErr"]("Invalid function pointer called. Perhaps a miscast function pointer (check compilation warnings) or bad vtable lookup (maybe due to derefing a bad pointer, like NULL)?"); abort(x) }\n'
+ if settings['ASSERTIONS'] >= 2: import difflib
+ for sig in last_forwarded_json['Functions']['tables'].iterkeys():
+ basic_funcs += ['nullFunc_' + sig]
+ if settings['ASSERTIONS'] <= 1:
+ extra = ' Module["printErr"]("Build with ASSERTIONS=2 for more info.");'
+ pointer = ' '
+ else:
+ pointer = ' \'" + x + "\' '
+ asm_setup += '\nvar debug_table_' + sig + ' = ' + json.dumps(debug_tables[sig]) + ';'
+ extra = ' Module["printErr"]("This pointer might make sense in another type signature: '
+ # sort signatures, attempting to show most likely related ones first
+ sigs = last_forwarded_json['Functions']['tables'].keys()
+ def keyfunc(other):
+ ret = 0
+ minlen = min(len(other), len(sig))
+ maxlen = min(len(other), len(sig))
+ if other.startswith(sig) or sig.startswith(other): ret -= 1000 # prioritize prefixes, could be dropped params
+ ret -= 133*difflib.SequenceMatcher(a=other, b=sig).ratio() # prioritize on diff similarity
+ ret += 15*abs(len(other) - len(sig))/float(maxlen) # deprioritize the bigger the length difference is
+ for i in range(minlen):
+ if other[i] == sig[i]: ret -= 5/float(maxlen) # prioritize on identically-placed params
+ ret += 20*len(other) # deprioritize on length
+ return ret
+ sigs.sort(key=keyfunc)
+ for other in sigs:
+ if other != sig:
+ extra += other + ': " + debug_table_' + other + '[x] + " '
+ extra += '"); '
+ asm_setup += '\nfunction nullFunc_' + sig + '(x) { Module["printErr"]("Invalid function pointer' + pointer + 'called with signature \'' + sig + '\'. ' + \
+ 'Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? ' + \
+ 'Or calling a function with an incorrect type, which will fail? ' + \
+ '(it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)' + \
+ '"); ' + extra + ' abort(x) }\n'
basic_vars = ['STACKTOP', 'STACK_MAX', 'tempDoublePtr', 'ABORT']
basic_float_vars = ['NaN', 'Infinity']
@@ -975,6 +1048,9 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
basic_vars.append('F_BASE_%s' % sig)
asm_setup += ' var F_BASE_%s = %s;\n' % (sig, 'FUNCTION_TABLE_OFFSET' if settings.get('SIDE_MODULE') else '0') + '\n'
+ if '_rand' in exported_implemented_functions or '_srand' in exported_implemented_functions:
+ basic_vars += ['___rand_seed']
+
asm_runtime_funcs = ['stackAlloc', 'stackSave', 'stackRestore', 'setThrew'] + ['setTempRet%d' % i for i in range(10)]
# function tables
function_tables = ['dynCall_' + table for table in last_forwarded_json['Functions']['tables']]
@@ -1034,7 +1110,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
asm_global_vars = ''.join([' var ' + g + '=env.' + g + '|0;\n' for g in basic_vars + global_vars])
# In linkable modules, we need to add some explicit globals for global variables that can be linked and used across modules
if settings.get('MAIN_MODULE') or settings.get('SIDE_MODULE'):
- assert settings.get('TARGET_LE32'), 'TODO: support x86 target when linking modules (needs offset of 4 and not 8 here)'
+ assert settings.get('TARGET_ASMJS_UNKNOWN_EMSCRIPTEN'), 'TODO: support x86 target when linking modules (needs offset of 4 and not 8 here)'
for key, value in forwarded_json['Variables']['globals'].iteritems():
if value.get('linkable'):
init = forwarded_json['Variables']['indexedGlobals'][key] + 8 # 8 is Runtime.GLOBAL_BASE / STATIC_BASE
@@ -1204,7 +1280,7 @@ Runtime.stackRestore = function(top) { asm['stackRestore'](top) };
if DEBUG: logging.debug(' emscript: final python processing took %s seconds' % (time.time() - t))
-if os.environ.get('EMCC_FAST_COMPILER'):
+if os.environ.get('EMCC_FAST_COMPILER') != '0':
emscript = emscript_fast
def main(args, compiler_engine, cache, jcache, relooper, temp_files, DEBUG, DEBUG_CACHE):
@@ -1224,13 +1300,13 @@ def main(args, compiler_engine, cache, jcache, relooper, temp_files, DEBUG, DEBU
settings.setdefault('RELOOPER', relooper)
if not os.path.exists(relooper):
shared.Building.ensure_relooper(relooper)
-
+
settings.setdefault('STRUCT_INFO', cache.get_path('struct_info.compiled.json'))
struct_info = settings.get('STRUCT_INFO')
-
+
if not os.path.exists(struct_info):
shared.Building.ensure_struct_info(struct_info)
-
+
emscript(args.infile, settings, args.outfile, libraries, compiler_engine=compiler_engine,
jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
diff --git a/docs/emscripten_switch_logo.eps b/media/switch_logo.eps
index 741970c1..741970c1 100644
--- a/docs/emscripten_switch_logo.eps
+++ b/media/switch_logo.eps
Binary files differ
diff --git a/docs/emscripten_switch_logo.jpg b/media/switch_logo.jpeg
index 7c05cd94..7c05cd94 100644
--- a/docs/emscripten_switch_logo.jpg
+++ b/media/switch_logo.jpeg
Binary files differ
diff --git a/docs/emscripten_switch_logo.svg b/media/switch_logo.svg
index 58277388..58277388 100644
--- a/docs/emscripten_switch_logo.svg
+++ b/media/switch_logo.svg
diff --git a/package.json b/package.json
index a1447c9f..4fbba2fb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "emscripten",
- "version": "1.0.0",
+ "version": "1.13.0",
"dependencies": {
"ws": "~0.4.28"
}
diff --git a/patches/README b/patches/README
deleted file mode 100644
index f6817fed..00000000
--- a/patches/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains a useful mercurial patch queue.
-
-Note to patch queue maintainer: You need to manually copy from .hg/patches into this directory, after |qrefresh|ing the patch.
-
diff --git a/patches/series b/patches/series
deleted file mode 100644
index 04f16d03..00000000
--- a/patches/series
+++ /dev/null
@@ -1,2 +0,0 @@
-sauer
-
diff --git a/scons-tools/emscripten.py b/scons-tools/emscripten.py
index b4912aaa..af85f106 100755
--- a/scons-tools/emscripten.py
+++ b/scons-tools/emscripten.py
@@ -274,7 +274,7 @@ def generate(env):
RANLIBCOM='',
CCFLAGS=[
'-U__STRICT_ANSI__',
- '-target', 'le32-unknown-nacl',
+ '-target', 'asmjs-unknown-emscripten',
'-nostdinc',
'-Wno-#warnings',
'-Wno-error=unused-variable',
@@ -316,6 +316,11 @@ def generate(env):
def depend_on_embedder(target, source, env):
env.Depends(target, env['JS_EMBEDDER'])
+ files = []
+ for src in source:
+ for dirpath, dirnames, filenames in os.walk(str(src.srcnode())):
+ files.extend(map(lambda p: os.path.join(dirpath, p), filenames))
+ env.Depends(target, env.Value(sorted(files)))
return target, source
def embed_files_in_js(target, source, env, for_signature):
diff --git a/src/compiler.js b/src/compiler.js
index e4ce1c88..17a8e83c 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -183,9 +183,6 @@ if (SAFE_HEAP) USE_BSS = 0; // must initialize heap for safe heap
// Settings sanity checks
assert(!(USE_TYPED_ARRAYS === 2 && QUANTUM_SIZE !== 4), 'For USE_TYPED_ARRAYS == 2, must have normal QUANTUM_SIZE of 4');
-if (ASM_JS) {
- assert(!ALLOW_MEMORY_GROWTH, 'Cannot grow asm.js heap');
-}
assert(!(!NAMED_GLOBALS && BUILD_AS_SHARED_LIB), 'shared libraries must have named globals');
// Output some info and warnings based on settings
diff --git a/src/deps_info.json b/src/deps_info.json
new file mode 100644
index 00000000..b38ffd00
--- /dev/null
+++ b/src/deps_info.json
@@ -0,0 +1,7 @@
+{
+ "uuid_compare": ["memcmp"],
+ "SDL_Init": ["malloc", "free"],
+ "SDL_GL_GetProcAddress": ["emscripten_GetProcAddress"],
+ "eglGetProcAddress": ["emscripten_GetProcAddress"]
+}
+
diff --git a/src/embind/emval.js b/src/embind/emval.js
index 0d075188..039f1d61 100644
--- a/src/embind/emval.js
+++ b/src/embind/emval.js
@@ -3,7 +3,7 @@
/*global new_*/
/*global createNamedFunction*/
/*global readLatin1String, writeStringToMemory*/
-/*global requireRegisteredType, throwBindingError*/
+/*global requireRegisteredType, throwBindingError, runDestructors*/
/*jslint sub:true*/ /* The symbols 'fromWireType' and 'toWireType' must be accessed via array notation to be closure-safe since craftInvokerFunction crafts functions as strings that can't be closured. */
var Module = Module || {};
@@ -79,6 +79,12 @@ function __emval_decref(handle) {
}
}
+function __emval_run_destructors(handle) {
+ var destructors = _emval_handle_array[handle].value;
+ runDestructors(destructors);
+ __emval_decref(handle);
+}
+
function __emval_new_array() {
return __emval_register([]);
}
@@ -199,11 +205,12 @@ function __emval_set_property(handle, key, value) {
_emval_handle_array[handle].value[_emval_handle_array[key].value] = _emval_handle_array[value].value;
}
-function __emval_as(handle, returnType) {
+function __emval_as(handle, returnType, destructorsRef) {
requireHandle(handle);
returnType = requireRegisteredType(returnType, 'emval::as');
var destructors = [];
- // caller owns destructing
+ var rd = __emval_register(destructors);
+ HEAP32[destructorsRef >> 2] = rd;
return returnType['toWireType'](destructors, _emval_handle_array[handle].value);
}
@@ -242,14 +249,20 @@ function lookupTypes(argCount, argTypes, argWireTypes) {
return a;
}
+function allocateDestructors(destructorsRef) {
+ var destructors = [];
+ HEAP32[destructorsRef >> 2] = __emval_register(destructors);
+ return destructors;
+}
+
function __emval_get_method_caller(argCount, argTypes) {
var types = lookupTypes(argCount, argTypes);
var retType = types[0];
var signatureName = retType.name + "_$" + types.slice(1).map(function (t) { return t.name; }).join("_") + "$";
- var args1 = ["addFunction", "createNamedFunction", "requireHandle", "getStringOrSymbol", "_emval_handle_array", "retType"];
- var args2 = [Runtime.addFunction, createNamedFunction, requireHandle, getStringOrSymbol, _emval_handle_array, retType];
+ var args1 = ["addFunction", "createNamedFunction", "requireHandle", "getStringOrSymbol", "_emval_handle_array", "retType", "allocateDestructors"];
+ var args2 = [Runtime.addFunction, createNamedFunction, requireHandle, getStringOrSymbol, _emval_handle_array, retType, allocateDestructors];
var argsList = ""; // 'arg0, arg1, arg2, ... , argN'
var argsListWired = ""; // 'arg0Wired, ..., argNWired'
@@ -261,16 +274,17 @@ function __emval_get_method_caller(argCount, argTypes) {
}
var invokerFnBody =
- "return addFunction(createNamedFunction('" + signatureName + "', function (handle, name" + argsListWired + ") {\n" +
- "requireHandle(handle);\n" +
- "name = getStringOrSymbol(name);\n";
+ "return addFunction(createNamedFunction('" + signatureName + "', function (handle, name, destructorsRef" + argsListWired + ") {\n" +
+ " requireHandle(handle);\n" +
+ " name = getStringOrSymbol(name);\n";
for (var i = 0; i < argCount - 1; ++i) {
- invokerFnBody += "var arg" + i + " = argType" + i + ".fromWireType(arg" + i + "Wired);\n";
+ invokerFnBody += " var arg" + i + " = argType" + i + ".fromWireType(arg" + i + "Wired);\n";
}
invokerFnBody +=
- "var obj = _emval_handle_array[handle].value;\n" +
- "return retType.toWireType(null, obj[name](" + argsList + "));\n" +
+ " var obj = _emval_handle_array[handle].value;\n" +
+ " var rv = obj[name](" + argsList + ");\n" +
+ " return retType.toWireType(allocateDestructors(destructorsRef), rv);\n" +
"}));\n";
args1.push(invokerFnBody);
diff --git a/src/headless.js b/src/headless.js
index e5458641..5880c087 100644
--- a/src/headless.js
+++ b/src/headless.js
@@ -82,6 +82,16 @@ var window = {
}
listeners.push(func);
},
+ removeEventListener: function(id, func) {
+ var listeners = this.eventListeners[id];
+ if (!listeners) return;
+ for (var i = 0; i < listeners.length; i++) {
+ if (listeners[i] === func) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ },
callEventListeners: function(id) {
var listeners = this.eventListeners[id];
if (listeners) {
@@ -101,6 +111,7 @@ var document = {
headless: true,
eventListeners: {},
addEventListener: window.addEventListener,
+ removeEventListener: window.removeEventListener,
callEventListeners: window.callEventListeners,
getElementById: function(id) {
switch(id) {
@@ -144,6 +155,7 @@ var document = {
},
eventListeners: {},
addEventListener: document.addEventListener,
+ removeEventListener: document.removeEventListener,
callEventListeners: document.callEventListeners,
};
};
diff --git a/src/headlessCanvas.js b/src/headlessCanvas.js
index 4951aed8..1eefe48e 100644
--- a/src/headlessCanvas.js
+++ b/src/headlessCanvas.js
@@ -446,6 +446,7 @@ function headlessCanvas() {
case /* GL_MAX_FRAGMENT_UNIFORM_VECTORS */ 0x8DFD: return 4096;
case /* GL_MAX_VARYING_VECTORS */ 0x8DFC: return 32;
case /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ 0x8B4D: return 32;
+ case /* GL_ARRAY_BUFFER_BINDING */ 0x8894: return 0;
default: console.log('getParameter ' + pname + '?'); return 0;
}
},
@@ -597,9 +598,12 @@ function headlessCanvas() {
});
},
exitPointerLock: function(){},
- style: {},
+ style: {
+ setProperty: function(){}
+ },
eventListeners: {},
addEventListener: function(){},
+ removeEventListener: function(){},
requestFullScreen: function() {
document.fullscreenElement = document.getElementById('canvas');
window.setTimeout(function() {
diff --git a/src/intertyper.js b/src/intertyper.js
index 10822e48..323787ac 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -348,9 +348,11 @@ function intertyper(lines, sidePass, baseLineNums) {
if (token1Text == 'triple') {
var triple = item.tokens[3].text;
triple = triple.substr(1, triple.length-2);
- var expected = TARGET_LE32 ? 'le32-unknown-nacl' : 'i386-pc-linux-gnu';
+ var expected = TARGET_ASMJS_UNKNOWN_EMSCRIPTEN ? 'asmjs-unknown-emscripten' : 'i386-pc-linux-gnu';
if (triple !== expected) {
- warn('using an unexpected LLVM triple: ' + [triple, ' !== ', expected] + ' (are you using emcc for everything and not clang?)');
+ if (!(TARGET_ASMJS_UNKNOWN_EMSCRIPTEN && triple === 'le32-unknown-nacl')) {
+ warn('using an unexpected LLVM triple: ' + [triple, ' !== ', expected] + ' (are you using emcc for everything and not clang?)');
+ }
}
}
return null;
@@ -688,7 +690,7 @@ function intertyper(lines, sidePass, baseLineNums) {
Types.hasInlineJS = true;
warnOnce('inline JavaScript using asm() will cause the code to no longer fall in the asm.js subset of JavaScript, which can reduce performance - consider using emscripten_run_script');
}
- assert(TARGET_LE32, 'inline js is only supported in le32');
+ assert(TARGET_ASMJS_UNKNOWN_EMSCRIPTEN, 'inline js is only supported in asmjs-unknown-emscripten');
// Inline assembly is just JavaScript that we paste into the code
item.intertype = 'value';
if (tokensLeft[0].text == 'sideeffect') tokensLeft.splice(0, 1);
@@ -848,7 +850,7 @@ function intertyper(lines, sidePass, baseLineNums) {
}).filter(function(param) { return param.value && param.value.ident != 'undef' });
return item;
}
- // 'phi'
+ // 'va_arg'
function va_argHandler(item) {
item.intertype = 'va_arg';
var segments = splitTokenList(item.tokens.slice(1));
diff --git a/src/jsifier.js b/src/jsifier.js
index 726a5eda..503f0b71 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -224,6 +224,7 @@ function JSify(data, functionsOnly) {
// globalVariable
function globalVariableHandler(item) {
+
function needsPostSet(value) {
if (typeof value !== 'string') return false;
// (' is ok, as it is something we can indexize later into a concrete int: ('{{ FI_ ...
@@ -274,7 +275,9 @@ function JSify(data, functionsOnly) {
constant = Runtime.alignMemory(calcAllocatedSize(item.type));
} else {
if (item.external) {
- if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {
+ if (LibraryManager.library[item.ident.slice(1)]) {
+ constant = LibraryManager.library[item.ident.slice(1)];
+ } else if (Runtime.isNumberType(item.type) || isPointerType(item.type)) {
constant = zeros(Runtime.getNativeFieldSize(item.type));
} else {
constant = makeEmptyStruct(item.type);
@@ -282,22 +285,23 @@ function JSify(data, functionsOnly) {
} else {
constant = parseConst(item.value, item.type, item.ident);
}
- assert(typeof constant === 'object');//, [typeof constant, JSON.stringify(constant), item.external]);
// This is a flattened object. We need to find its idents, so they can be assigned to later
- var structTypes = null;
- constant.forEach(function(value, i) {
- if (needsPostSet(value)) { // ident, or expression containing an ident
- if (!structTypes) structTypes = generateStructTypes(item.type);
- itemsDict.GlobalVariablePostSet.push({
- intertype: 'GlobalVariablePostSet',
- JS: makeSetValue(makeGlobalUse(item.ident), i, value, structTypes[i], false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
- });
- constant[i] = '0';
- } else {
- if (typeof value === 'string') constant[i] = deParenCarefully(value);
- }
- });
+ if (typeof constant === 'object') {
+ var structTypes = null;
+ constant.forEach(function(value, i) {
+ if (needsPostSet(value)) { // ident, or expression containing an ident
+ if (!structTypes) structTypes = generateStructTypes(item.type);
+ itemsDict.GlobalVariablePostSet.push({
+ intertype: 'GlobalVariablePostSet',
+ JS: makeSetValue(makeGlobalUse(item.ident), i, value, structTypes[i], false, true) + ';' // ignore=true, since e.g. rtti and statics cause lots of safe_heap errors
+ });
+ constant[i] = '0';
+ } else {
+ if (typeof value === 'string') constant[i] = deParenCarefully(value);
+ }
+ });
+ }
if (item.external) {
// External variables in shared libraries should not be declared as
@@ -312,14 +316,18 @@ function JSify(data, functionsOnly) {
}
// ensure alignment
- var extra = Runtime.alignMemory(constant.length) - constant.length;
- if (item.ident.substr(0, 5) == '__ZTV') extra += Runtime.alignMemory(QUANTUM_SIZE);
- while (extra-- > 0) constant.push(0);
+ if (typeof constant === 'object') {
+ var extra = Runtime.alignMemory(constant.length) - constant.length;
+ if (item.ident.substr(0, 5) == '__ZTV') extra += Runtime.alignMemory(QUANTUM_SIZE);
+ while (extra-- > 0) constant.push(0);
+ }
}
// NOTE: This is the only place that could potentially create static
// allocations in a shared library.
- constant = makePointer(constant, null, allocator, item.type, index);
+ if (typeof constant !== 'string') {
+ constant = makePointer(constant, null, allocator, item.type, index);
+ }
var js = (index !== null ? '' : item.ident + '=') + constant;
if (js) js += ';';
@@ -376,7 +384,7 @@ function JSify(data, functionsOnly) {
functionStubSigs[item.ident] = Functions.getSignature(item.returnType.text, item.params.map(function(arg) { return arg.type }), false);
}
- function addFromLibrary(ident) {
+ function addFromLibrary(ident, notDep) {
if (ident in addedLibraryItems) return '';
addedLibraryItems[ident] = true;
@@ -387,6 +395,15 @@ function JSify(data, functionsOnly) {
// Note: We don't return the dependencies here. Be careful not to end up where this matters
if (('_' + ident) in Functions.implementedFunctions) return '';
+ if (!LibraryManager.library.hasOwnProperty(ident) && !LibraryManager.library.hasOwnProperty(ident + '__inline')) {
+ if (notDep) {
+ if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + ident);
+ else if (VERBOSE || (WARN_ON_UNDEFINED_SYMBOLS && !LINKABLE)) warn('unresolved symbol: ' + ident);
+ }
+ // emit a stub that will fail at runtime
+ LibraryManager.library[shortident] = new Function("Module['printErr']('missing function: " + shortident + "'); abort(-1);");
+ }
+
var snippet = LibraryManager.library[ident];
var redirectedIdent = null;
var deps = LibraryManager.library[ident + '__deps'] || [];
@@ -448,7 +465,7 @@ function JSify(data, functionsOnly) {
} else {
ident = '_' + ident;
}
- if (VERBOSE) printErr('adding ' + ident + ' and deps ' + deps);
+ if (VERBOSE) printErr('adding ' + ident + ' and deps ' + deps + ' : ' + (snippet + '').substr(0, 40));
var depsText = (deps ? '\n' + deps.map(addFromLibrary).filter(function(x) { return x != '' }).join('\n') : '');
var contentText = isFunction ? snippet : ('var ' + ident + '=' + snippet + ';');
if (ASM_JS) {
@@ -478,7 +495,6 @@ function JSify(data, functionsOnly) {
item.JS = '';
} else {
// If this is not linkable, anything not in the library is definitely missing
- var cancel = false;
if (item.ident in DEAD_FUNCTIONS) {
if (LibraryManager.library[shortident + '__asm']) {
warn('cannot kill asm library function ' + item.ident);
@@ -488,17 +504,7 @@ function JSify(data, functionsOnly) {
delete LibraryManager.library[shortident + '__deps'];
}
}
- if (!LINKABLE && !LibraryManager.library.hasOwnProperty(shortident) && !LibraryManager.library.hasOwnProperty(shortident + '__inline')) {
- if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + shortident);
- else if (VERBOSE || WARN_ON_UNDEFINED_SYMBOLS) warn('unresolved symbol: ' + shortident);
- if (ASM_JS) {
- // emit a stub that will fail during runtime. this allows asm validation to succeed.
- LibraryManager.library[shortident] = new Function("Module['printErr']('missing function: " + shortident + "'); abort(-1);");
- } else {
- cancel = true; // emit nothing, not even var X = undefined;
- }
- }
- item.JS = cancel ? ';' : addFromLibrary(shortident);
+ item.JS = addFromLibrary(shortident, true);
}
}
@@ -1223,7 +1229,7 @@ function JSify(data, functionsOnly) {
// in an assignment
var disabled = DISABLE_EXCEPTION_CATCHING == 2 && !(item.funcData.ident in EXCEPTION_CATCHING_WHITELIST);
var phiSets = calcPhiSets(item);
- var call_ = makeFunctionCall(item, item.params, item.funcData, item.type, ASM_JS && !disabled, !!item.assignTo || !item.standalone, true);
+ var call_ = makeFunctionCall(item, item.params, item.funcData, item.type, ASM_JS && !disabled, !!item.assignTo || !item.standalone, !disabled);
var ret;
@@ -1409,13 +1415,13 @@ function JSify(data, functionsOnly) {
}
}
function va_argHandler(item) {
- assert(TARGET_LE32);
+ assert(TARGET_ASMJS_UNKNOWN_EMSCRIPTEN);
var ident = item.value.ident;
var move = Runtime.STACK_ALIGN;
// store current list offset in tempInt, advance list offset by STACK_ALIGN, return list entry stored at tempInt
return '(tempInt=' + makeGetValue(ident, Runtime.QUANTUM_SIZE, '*') + ',' +
- makeSetValue(ident, Runtime.QUANTUM_SIZE, 'tempInt + ' + move, '*', null, null, null, null, ',') + ',' +
+ makeSetValue(ident, Runtime.QUANTUM_SIZE, asmCoercion('tempInt + ' + move, 'i32'), '*', null, null, null, null, ',') + ',' +
makeGetValue(makeGetValue(ident, 0, '*'), 'tempInt', item.type) + ')';
}
@@ -1706,7 +1712,7 @@ function JSify(data, functionsOnly) {
if ((phase == 'pre' || phase == 'glue') && !Variables.generatedGlobalBase && !BUILD_AS_SHARED_LIB) {
Variables.generatedGlobalBase = true;
// Globals are done, here is the rest of static memory
- assert((TARGET_LE32 && Runtime.GLOBAL_BASE == 8) || (TARGET_X86 && Runtime.GLOBAL_BASE == 4)); // this is assumed in e.g. relocations for linkable modules
+ assert((TARGET_ASMJS_UNKNOWN_EMSCRIPTEN && Runtime.GLOBAL_BASE == 8) || (TARGET_X86 && Runtime.GLOBAL_BASE == 4)); // this is assumed in e.g. relocations for linkable modules
if (!SIDE_MODULE) {
print('STATIC_BASE = ' + Runtime.GLOBAL_BASE + ';\n');
print('STATICTOP = STATIC_BASE + ' + Runtime.alignMemory(Variables.nextIndexedOffset) + ';\n');
@@ -1844,7 +1850,7 @@ function JSify(data, functionsOnly) {
// rest of the output that we started to print out earlier (see comment on the
// "Final shape that will be created").
if (PRECISE_I64_MATH && Types.preciseI64MathUsed) {
- if (!INCLUDE_FULL_LIBRARY) {
+ if (!INCLUDE_FULL_LIBRARY && !SIDE_MODULE && !BUILD_AS_SHARED_LIB) {
// first row are utilities called from generated code, second are needed from fastLong
['i64Add', 'i64Subtract', 'bitshift64Shl', 'bitshift64Lshr', 'bitshift64Ashr',
'llvm_ctlz_i32', 'llvm_cttz_i32'].forEach(function(func) {
@@ -1866,6 +1872,7 @@ function JSify(data, functionsOnly) {
}
});
}
+ // these may be duplicated in side modules and the main module without issue
print(read('fastLong.js'));
print('// EMSCRIPTEN_END_FUNCS\n');
print(read('long.js'));
diff --git a/src/library.js b/src/library.js
index 69569601..62695ae7 100644
--- a/src/library.js
+++ b/src/library.js
@@ -52,32 +52,33 @@ LibraryManager.library = {
___setErrNo(ERRNO_CODES.ENOTDIR);
return 0;
}
- var err = _open(dirname, {{{ cDefine('O_RDONLY') }}}, allocate([0, 0, 0, 0], 'i32', ALLOC_STACK));
- // open returns 0 on failure, not -1
- return err === -1 ? 0 : err;
+ var fd = _open(dirname, {{{ cDefine('O_RDONLY') }}}, allocate([0, 0, 0, 0], 'i32', ALLOC_STACK));
+ return fd === -1 ? 0 : FS.getPtrForStream(FS.getStream(fd));
},
- closedir__deps: ['$FS', '__setErrNo', '$ERRNO_CODES', 'close'],
+ closedir__deps: ['$FS', '__setErrNo', '$ERRNO_CODES', 'close', 'fileno'],
closedir: function(dirp) {
// int closedir(DIR *dirp);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/closedir.html
- return _close(dirp);
+ var fd = _fileno(dirp);
+ return _close(fd);
},
telldir__deps: ['$FS', '__setErrNo', '$ERRNO_CODES'],
telldir: function(dirp) {
// long int telldir(DIR *dirp);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/telldir.html
- var stream = FS.getStream(dirp);
+ var stream = FS.getStreamFromPtr(dirp);
if (!stream || !FS.isDir(stream.node.mode)) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
}
return stream.position;
},
- seekdir__deps: ['$FS', '__setErrNo', '$ERRNO_CODES', 'lseek'],
+ seekdir__deps: ['$FS', '__setErrNo', '$ERRNO_CODES', 'lseek', 'fileno'],
seekdir: function(dirp, loc) {
// void seekdir(DIR *dirp, long int loc);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/seekdir.html
- _lseek(dirp, loc, {{{ cDefine('SEEK_SET') }}});
+ var fd = _fileno(dirp);
+ _lseek(fd, loc, {{{ cDefine('SEEK_SET') }}});
},
rewinddir__deps: ['seekdir'],
rewinddir: function(dirp) {
@@ -89,7 +90,7 @@ LibraryManager.library = {
readdir_r: function(dirp, entry, result) {
// int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/readdir_r.html
- var stream = FS.getStream(dirp);
+ var stream = FS.getStreamFromPtr(dirp);
if (!stream) {
return ___setErrNo(ERRNO_CODES.EBADF);
}
@@ -100,7 +101,7 @@ LibraryManager.library = {
return FS.handleFSError(e);
}
if (stream.position < 0 || stream.position >= entries.length) {
- {{{ makeSetValue('result', '0', '0', 'i8*') }}}
+ {{{ makeSetValue('result', '0', '0', 'i8*') }}};
return 0;
}
var id;
@@ -118,23 +119,23 @@ LibraryManager.library = {
FS.isLink(child.mode) ? 10 : // DT_LNK, symbolic link.
8; // DT_REG, regular file.
}
- {{{ makeSetValue('entry', C_STRUCTS.dirent.d_ino, 'id', 'i32') }}}
- {{{ makeSetValue('entry', C_STRUCTS.dirent.d_off, 'offset', 'i32') }}}
- {{{ makeSetValue('entry', C_STRUCTS.dirent.d_reclen, 'name.length + 1', 'i32') }}}
+ {{{ makeSetValue('entry', C_STRUCTS.dirent.d_ino, 'id', 'i32') }}};
+ {{{ makeSetValue('entry', C_STRUCTS.dirent.d_off, 'offset', 'i32') }}};
+ {{{ makeSetValue('entry', C_STRUCTS.dirent.d_reclen, 'name.length + 1', 'i32') }}};
for (var i = 0; i < name.length; i++) {
- {{{ makeSetValue('entry + ' + C_STRUCTS.dirent.d_name, 'i', 'name.charCodeAt(i)', 'i8') }}}
+ {{{ makeSetValue('entry + ' + C_STRUCTS.dirent.d_name, 'i', 'name.charCodeAt(i)', 'i8') }}};
}
- {{{ makeSetValue('entry + ' + C_STRUCTS.dirent.d_name, 'i', '0', 'i8') }}}
- {{{ makeSetValue('entry', C_STRUCTS.dirent.d_type, 'type', 'i8') }}}
- {{{ makeSetValue('result', '0', 'entry', 'i8*') }}}
+ {{{ makeSetValue('entry + ' + C_STRUCTS.dirent.d_name, 'i', '0', 'i8') }}};
+ {{{ makeSetValue('entry', C_STRUCTS.dirent.d_type, 'type', 'i8') }}};
+ {{{ makeSetValue('result', '0', 'entry', 'i8*') }}};
stream.position++;
return 0;
},
- readdir__deps: ['readdir_r', '__setErrNo', '$ERRNO_CODES'],
+ readdir__deps: ['readdir_r', '__setErrNo', '$ERRNO_CODES', 'malloc'],
readdir: function(dirp) {
// struct dirent *readdir(DIR *dirp);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/readdir_r.html
- var stream = FS.getStream(dirp);
+ var stream = FS.getStreamFromPtr(dirp);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return 0;
@@ -149,8 +150,6 @@ LibraryManager.library = {
}
return {{{ makeGetValue(0, '_readdir.result', 'i8*') }}};
},
- __01readdir64_: 'readdir',
- // TODO: Check if we need to link any other aliases.
// ==========================================================================
// utime.h
@@ -164,7 +163,7 @@ LibraryManager.library = {
if (times) {
// NOTE: We don't keep track of access timestamps.
var offset = {{{ C_STRUCTS.utimbuf.modtime }}};
- time = {{{ makeGetValue('times', 'offset', 'i32') }}}
+ time = {{{ makeGetValue('times', 'offset', 'i32') }}};
time *= 1000;
} else {
time = Date.now();
@@ -207,13 +206,13 @@ LibraryManager.library = {
var length = i;
if (allSlashes) {
// All slashes result in a single slash.
- {{{ makeSetValue('path', '1', '0', 'i8') }}}
+ {{{ makeSetValue('path', '1', '0', 'i8') }}};
return [path, -1];
} else {
// Strip trailing slashes.
while (slashPositions.length &&
slashPositions[slashPositions.length - 1] == length - 1) {
- {{{ makeSetValue('path', 'slashPositions.pop(i)', '0', 'i8') }}}
+ {{{ makeSetValue('path', 'slashPositions.pop(i)', '0', 'i8') }}};
length--;
}
return [path, slashPositions.pop()];
@@ -227,16 +226,15 @@ LibraryManager.library = {
var result = ___libgenSplitName(path);
return result[0] + result[1] + 1;
},
- __xpg_basename: 'basename',
dirname__deps: ['__libgenSplitName'],
dirname: function(path) {
// char *dirname(char *path);
// http://pubs.opengroup.org/onlinepubs/007908799/xsh/dirname.html
var result = ___libgenSplitName(path);
if (result[1] == 0) {
- {{{ makeSetValue('result[0]', 1, '0', 'i8') }}}
+ {{{ makeSetValue('result[0]', 1, '0', 'i8') }}};
} else if (result[1] !== -1) {
- {{{ makeSetValue('result[0]', 'result[1]', '0', 'i8') }}}
+ {{{ makeSetValue('result[0]', 'result[1]', '0', 'i8') }}};
}
return result[0];
},
@@ -257,22 +255,22 @@ LibraryManager.library = {
{{{ makeSetValue('buf', C_STRUCTS.stat.st_dev, 'stat.dev', 'i32') }}};
{{{ makeSetValue('buf', C_STRUCTS.stat.__st_dev_padding, '0', 'i32') }}};
{{{ makeSetValue('buf', C_STRUCTS.stat.__st_ino_truncated, 'stat.ino', 'i32') }}};
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_mode, 'stat.mode', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_nlink, 'stat.nlink', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_uid, 'stat.uid', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_gid, 'stat.gid', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_rdev, 'stat.rdev', 'i32') }}}
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_mode, 'stat.mode', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_nlink, 'stat.nlink', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_uid, 'stat.uid', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_gid, 'stat.gid', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_rdev, 'stat.rdev', 'i32') }}};
{{{ makeSetValue('buf', C_STRUCTS.stat.__st_rdev_padding, '0', 'i32') }}};
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_size, 'stat.size', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_blksize, '4096', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_blocks, 'stat.blocks', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_atim.tv_sec, 'Math.floor(stat.atime.getTime() / 1000)', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_atim.tv_nsec, '0', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_mtim.tv_sec, 'Math.floor(stat.mtime.getTime() / 1000)', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_mtim.tv_nsec, '0', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_sec, 'Math.floor(stat.ctime.getTime() / 1000)', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_nsec, '0', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.stat.st_ino, 'stat.ino', 'i32') }}}
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_size, 'stat.size', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_blksize, '4096', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_blocks, 'stat.blocks', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_atim.tv_sec, 'Math.floor(stat.atime.getTime() / 1000)', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_atim.tv_nsec, '0', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_mtim.tv_sec, 'Math.floor(stat.mtime.getTime() / 1000)', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_mtim.tv_nsec, '0', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_sec, 'Math.floor(stat.ctime.getTime() / 1000)', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_ctim.tv_nsec, '0', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.stat.st_ino, 'stat.ino', 'i32') }}};
return 0;
} catch (e) {
FS.handleFSError(e);
@@ -395,14 +393,6 @@ LibraryManager.library = {
_umask.cmask = newMask;
return oldMask;
},
- stat64: 'stat',
- fstat64: 'fstat',
- lstat64: 'lstat',
- __01fstat64_: 'fstat',
- __01stat64_: 'stat',
- __01lstat64_: 'lstat',
-
- // TODO: Check if other aliases are needed.
// ==========================================================================
// sys/statvfs.h
@@ -414,17 +404,17 @@ LibraryManager.library = {
// int statvfs(const char *restrict path, struct statvfs *restrict buf);
// NOTE: None of the constants here are true. We're just returning safe and
// sane values.
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bsize, '4096', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_frsize, '4096', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_blocks, '1000000', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bfree, '500000', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bavail, '500000', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_files, 'FS.nextInode', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_ffree, '1000000', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_favail, '1000000', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_fsid, '42', 'i32') }}}
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_flag, '2', 'i32') }}} // ST_NOSUID
- {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_namemax, '255', 'i32') }}}
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bsize, '4096', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_frsize, '4096', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_blocks, '1000000', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bfree, '500000', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_bavail, '500000', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_files, 'FS.nextInode', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_ffree, '1000000', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_favail, '1000000', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_fsid, '42', 'i32') }}};
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_flag, '2', 'i32') }}}; // ST_NOSUID
+ {{{ makeSetValue('buf', C_STRUCTS.statvfs.f_namemax, '255', 'i32') }}};
return 0;
},
fstatvfs__deps: ['statvfs'],
@@ -433,8 +423,6 @@ LibraryManager.library = {
// http://pubs.opengroup.org/onlinepubs/009604499/functions/statvfs.html
return _statvfs(0, buf);
},
- __01statvfs64_: 'statvfs',
- __01fstatvfs64_: 'fstatvfs',
// ==========================================================================
// fcntl.h
@@ -515,7 +503,7 @@ LibraryManager.library = {
var arg = {{{ makeGetValue('varargs', 0, 'i32') }}};
var offset = {{{ C_STRUCTS.flock.l_type }}};
// We're always unlocked.
- {{{ makeSetValue('arg', 'offset', cDefine('F_UNLCK'), 'i16') }}}
+ {{{ makeSetValue('arg', 'offset', cDefine('F_UNLCK'), 'i16') }}};
return 0;
case {{{ cDefine('F_SETLK') }}}:
case {{{ cDefine('F_SETLKW') }}}:
@@ -571,6 +559,25 @@ LibraryManager.library = {
},
// ==========================================================================
+ // nl_types.h
+ // ==========================================================================
+
+ catopen: function(name, oflag) {
+ // nl_catd catopen (const char *name, int oflag)
+ return -1;
+ },
+
+ catgets: function(catd, set_id, msg_id, s) {
+ // char *catgets (nl_catd catd, int set_id, int msg_id, const char *s)
+ return s;
+ },
+
+ catclose: function(catd) {
+ // int catclose (nl_catd catd)
+ return 0;
+ },
+
+ // ==========================================================================
// poll.h
// ==========================================================================
@@ -594,7 +601,7 @@ LibraryManager.library = {
}
mask &= events | {{{ cDefine('POLLERR') }}} | {{{ cDefine('POLLHUP') }}};
if (mask) nonzero++;
- {{{ makeSetValue('pollfd', C_STRUCTS.pollfd.revents, 'mask', 'i16') }}}
+ {{{ makeSetValue('pollfd', C_STRUCTS.pollfd.revents, 'mask', 'i16') }}};
}
return nonzero;
},
@@ -1014,7 +1021,7 @@ LibraryManager.library = {
return -1;
}
},
- ttyname__deps: ['ttyname_r'],
+ ttyname__deps: ['ttyname_r', 'malloc'],
ttyname: function(fildes) {
// char *ttyname(int fildes);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ttyname.html
@@ -1174,9 +1181,9 @@ LibraryManager.library = {
} else {
var length = Math.min(len, value.length);
for (var i = 0; i < length; i++) {
- {{{ makeSetValue('buf', 'i', 'value.charCodeAt(i)', 'i8') }}}
+ {{{ makeSetValue('buf', 'i', 'value.charCodeAt(i)', 'i8') }}};
}
- if (len > length) {{{ makeSetValue('buf', 'i++', '0', 'i8') }}}
+ if (len > length) {{{ makeSetValue('buf', 'i++', '0', 'i8') }}};
return i;
}
},
@@ -1223,9 +1230,9 @@ LibraryManager.library = {
// int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
// http://linux.die.net/man/2/getresuid
// We have just one process/group/user, all with ID 0.
- {{{ makeSetValue('ruid', '0', '0', 'i32') }}}
- {{{ makeSetValue('euid', '0', '0', 'i32') }}}
- {{{ makeSetValue('suid', '0', '0', 'i32') }}}
+ {{{ makeSetValue('ruid', '0', '0', 'i32') }}};
+ {{{ makeSetValue('euid', '0', '0', 'i32') }}};
+ {{{ makeSetValue('suid', '0', '0', 'i32') }}};
return 0;
},
getresgid: 'getresuid',
@@ -1237,7 +1244,7 @@ LibraryManager.library = {
___setErrNo(ERRNO_CODES.EINVAL);
return -1;
} else {
- {{{ makeSetValue('grouplist', '0', '0', 'i32') }}}
+ {{{ makeSetValue('grouplist', '0', '0', 'i32') }}};
return 1;
}
},
@@ -1270,17 +1277,17 @@ LibraryManager.library = {
}
var length = Math.min(namelen, host.length);
for (var i = 0; i < length; i++) {
- {{{ makeSetValue('name', 'i', 'host.charCodeAt(i)', 'i8') }}}
+ {{{ makeSetValue('name', 'i', 'host.charCodeAt(i)', 'i8') }}};
}
if (namelen > length) {
- {{{ makeSetValue('name', 'i', '0', 'i8') }}}
+ {{{ makeSetValue('name', 'i', '0', 'i8') }}};
return 0;
} else {
___setErrNo(ERRNO_CODES.ENAMETOOLONG);
return -1;
}
},
- getlogin__deps: ['getlogin_r'],
+ getlogin__deps: ['getlogin_r', 'malloc'],
getlogin: function() {
// char *getlogin(void);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/getlogin.html
@@ -1390,8 +1397,8 @@ LibraryManager.library = {
for (var i = 0; i < nbytes; i += 2) {
var first = {{{ makeGetValue('src', 'i', 'i8') }}};
var second = {{{ makeGetValue('src', 'i + 1', 'i8') }}};
- {{{ makeSetValue('dest', 'i', 'second', 'i8') }}}
- {{{ makeSetValue('dest', 'i + 1', 'first', 'i8') }}}
+ {{{ makeSetValue('dest', 'i', 'second', 'i8') }}};
+ {{{ makeSetValue('dest', 'i + 1', 'first', 'i8') }}};
}
},
tcgetpgrp: function(fildes) {
@@ -1565,14 +1572,6 @@ LibraryManager.library = {
if (bytes != 0) self.alloc(bytes);
return ret; // Previous break location.
},
- open64: 'open',
- lseek64: 'lseek',
- ftruncate64: 'ftruncate',
- __01open64_: 'open',
- __01lseek64_: 'lseek',
- __01truncate64_: 'truncate',
- __01ftruncate64_: 'ftruncate',
- // TODO: Check if any other aliases are needed.
// ==========================================================================
// stdio.h
@@ -1643,6 +1642,7 @@ LibraryManager.library = {
for (var i = 0; i < maxx; i++) {
next = get();
{{{ makeSetValue('argPtr++', 0, 'next', 'i8') }}};
+ if (next === 0) return i > 0 ? fields : fields-1; // we failed to read the full length of this field
}
formatIndex += nextC - formatIndex + 1;
continue;
@@ -1804,7 +1804,7 @@ LibraryManager.library = {
break;
case 'X':
case 'x':
- {{{ makeSetValue('argPtr', 0, 'parseInt(text, 16)', 'i32') }}}
+ {{{ makeSetValue('argPtr', 0, 'parseInt(text, 16)', 'i32') }}};
break;
case 'F':
case 'f':
@@ -1815,15 +1815,15 @@ LibraryManager.library = {
case 'E':
// fallthrough intended
if (long_) {
- {{{ makeSetValue('argPtr', 0, 'parseFloat(text)', 'double') }}}
+ {{{ makeSetValue('argPtr', 0, 'parseFloat(text)', 'double') }}};
} else {
- {{{ makeSetValue('argPtr', 0, 'parseFloat(text)', 'float') }}}
+ {{{ makeSetValue('argPtr', 0, 'parseFloat(text)', 'float') }}};
}
break;
case 's':
var array = intArrayFromString(text);
for (var j = 0; j < array.length; j++) {
- {{{ makeSetValue('argPtr', 'j', 'array[j]', 'i8') }}}
+ {{{ makeSetValue('argPtr', 'j', 'array[j]', 'i8') }}};
}
break;
}
@@ -1861,14 +1861,14 @@ LibraryManager.library = {
// int x = 4; printf("%c\n", (char)x);
var ret;
if (type === 'double') {
-#if TARGET_LE32 == 2
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 2
ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true, 4) }}};
#else
ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true) }}};
#endif
#if USE_TYPED_ARRAYS == 2
} else if (type == 'i64') {
-#if TARGET_LE32 == 1
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 1
ret = [{{{ makeGetValue('varargs', 'argIndex', 'i32', undefined, undefined, true) }}},
{{{ makeGetValue('varargs', 'argIndex+8', 'i32', undefined, undefined, true) }}}];
argIndex += {{{ STACK_ALIGN }}}; // each 32-bit chunk is in a 64-bit block
@@ -1885,7 +1885,7 @@ LibraryManager.library = {
type = 'i32'; // varargs are always i32, i64, or double
ret = {{{ makeGetValue('varargs', 'argIndex', 'i32', undefined, undefined, true) }}};
}
-#if TARGET_LE32 == 2
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 2
argIndex += Runtime.getNativeFieldSize(type);
#else
argIndex += Math.max(Runtime.getNativeFieldSize(type), Runtime.getAlignSize(type, null, true));
@@ -1970,7 +1970,7 @@ LibraryManager.library = {
}
next = {{{ makeGetValue(0, 'textIndex+1', 'i8') }}};
}
- if (precision === -1) {
+ if (precision < 0) {
precision = 6; // Standard default.
precisionSet = false;
}
@@ -2259,7 +2259,7 @@ LibraryManager.library = {
case 'n': {
// Write the length written so far to the next parameter.
var ptr = getNextArg('i32*');
- {{{ makeSetValue('ptr', '0', 'ret.length', 'i32') }}}
+ {{{ makeSetValue('ptr', '0', 'ret.length', 'i32') }}};
break;
}
case '%': {
@@ -2291,19 +2291,20 @@ LibraryManager.library = {
clearerr: function(stream) {
// void clearerr(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/clearerr.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
if (!stream) {
return;
}
stream.eof = false;
stream.error = false;
},
- fclose__deps: ['close', 'fsync'],
+ fclose__deps: ['close', 'fsync', 'fileno'],
fclose: function(stream) {
// int fclose(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fclose.html
- _fsync(stream);
- return _close(stream);
+ var fd = _fileno(stream);
+ _fsync(fd);
+ return _close(fd);
},
fdopen__deps: ['$FS', '__setErrNo', '$ERRNO_CODES'],
fdopen: function(fildes, mode) {
@@ -2324,21 +2325,21 @@ LibraryManager.library = {
} else {
stream.error = false;
stream.eof = false;
- return fildes;
+ return FS.getPtrForStream(stream);
}
},
feof__deps: ['$FS'],
feof: function(stream) {
// int feof(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/feof.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
return Number(stream && stream.eof);
},
ferror__deps: ['$FS'],
ferror: function(stream) {
// int ferror(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ferror.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
return Number(stream && stream.error);
},
fflush__deps: ['$FS', '__setErrNo', '$ERRNO_CODES'],
@@ -2352,7 +2353,7 @@ LibraryManager.library = {
fgetc: function(stream) {
// int fgetc(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetc.html
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (!streamObj) return -1;
if (streamObj.eof || streamObj.error) return -1;
var ret = _fread(_fgetc.ret, 1, 1, stream);
@@ -2377,7 +2378,7 @@ LibraryManager.library = {
fgetpos: function(stream, pos) {
// int fgetpos(FILE *restrict stream, fpos_t *restrict pos);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fgetpos.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
@@ -2386,16 +2387,16 @@ LibraryManager.library = {
___setErrNo(ERRNO_CODES.ESPIPE);
return -1;
}
- {{{ makeSetValue('pos', '0', 'stream.position', 'i32') }}}
+ {{{ makeSetValue('pos', '0', 'stream.position', 'i32') }}};
var state = (stream.eof ? 1 : 0) + (stream.error ? 2 : 0);
- {{{ makeSetValue('pos', Runtime.getNativeTypeSize('i32'), 'state', 'i32') }}}
+ {{{ makeSetValue('pos', Runtime.getNativeTypeSize('i32'), 'state', 'i32') }}};
return 0;
},
fgets__deps: ['fgetc'],
fgets: function(s, n, stream) {
// char *fgets(char *restrict s, int n, FILE *restrict stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fgets.html
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (!streamObj) return 0;
if (streamObj.error || streamObj.eof) return 0;
var byte_;
@@ -2405,9 +2406,9 @@ LibraryManager.library = {
if (streamObj.error || (streamObj.eof && i == 0)) return 0;
else if (streamObj.eof) break;
}
- {{{ makeSetValue('s', 'i', 'byte_', 'i8') }}}
+ {{{ makeSetValue('s', 'i', 'byte_', 'i8') }}};
}
- {{{ makeSetValue('s', 'i', '0', 'i8') }}}
+ {{{ makeSetValue('s', 'i', '0', 'i8') }}};
return s;
},
gets__deps: ['fgets'],
@@ -2419,8 +2420,9 @@ LibraryManager.library = {
fileno: function(stream) {
// int fileno(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fileno.html
- // We use file descriptor numbers and FILE* streams interchangeably.
- return stream;
+ stream = FS.getStreamFromPtr(stream);
+ if (!stream) return -1;
+ return stream.fd;
},
ftrylockfile: function() {
// int ftrylockfile(FILE *file);
@@ -2462,19 +2464,20 @@ LibraryManager.library = {
___setErrNo(ERRNO_CODES.EINVAL);
return 0;
}
- var ret = _open(filename, flags, allocate([0x1FF, 0, 0, 0], 'i32', ALLOC_STACK)); // All creation permissions.
- return (ret == -1) ? 0 : ret;
+ var fd = _open(filename, flags, allocate([0x1FF, 0, 0, 0], 'i32', ALLOC_STACK)); // All creation permissions.
+ return fd === -1 ? 0 : FS.getPtrForStream(FS.getStream(fd));
},
- fputc__deps: ['$FS', 'write'],
+ fputc__deps: ['$FS', 'write', 'fileno'],
fputc__postset: '_fputc.ret = allocate([0], "i8", ALLOC_STATIC);',
fputc: function(c, stream) {
// int fputc(int c, FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fputc.html
var chr = unSign(c & 0xFF);
- {{{ makeSetValue('_fputc.ret', '0', 'chr', 'i8') }}}
- var ret = _write(stream, _fputc.ret, 1);
+ {{{ makeSetValue('_fputc.ret', '0', 'chr', 'i8') }}};
+ var fd = _fileno(stream);
+ var ret = _write(fd, _fputc.ret, 1);
if (ret == -1) {
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (streamObj) streamObj.error = true;
return -1;
} else {
@@ -2490,11 +2493,12 @@ LibraryManager.library = {
return _fputc(c, {{{ makeGetValue(makeGlobalUse('_stdout'), '0', 'void*') }}});
},
putchar_unlocked: 'putchar',
- fputs__deps: ['write', 'strlen'],
+ fputs__deps: ['write', 'strlen', 'fileno'],
fputs: function(s, stream) {
// int fputs(const char *restrict s, FILE *restrict stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fputs.html
- return _write(stream, s, _strlen(s));
+ var fd = _fileno(stream);
+ return _write(fd, s, _strlen(s));
},
puts__deps: ['fputs', 'fputc', 'stdout'],
puts: function(s) {
@@ -2519,17 +2523,17 @@ LibraryManager.library = {
return 0;
}
var bytesRead = 0;
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (!streamObj) {
___setErrNo(ERRNO_CODES.EBADF);
return 0;
}
while (streamObj.ungotten.length && bytesToRead > 0) {
- {{{ makeSetValue('ptr++', '0', 'streamObj.ungotten.pop()', 'i8') }}}
+ {{{ makeSetValue('ptr++', '0', 'streamObj.ungotten.pop()', 'i8') }}};
bytesToRead--;
bytesRead++;
}
- var err = _read(stream, ptr, bytesToRead);
+ var err = _read(streamObj.fd, ptr, bytesToRead);
if (err == -1) {
if (streamObj) streamObj.error = true;
return 0;
@@ -2543,7 +2547,7 @@ LibraryManager.library = {
// FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *restrict stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/freopen.html
if (!filename) {
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (!streamObj) {
___setErrNo(ERRNO_CODES.EBADF);
return 0;
@@ -2555,25 +2559,25 @@ LibraryManager.library = {
_fclose(stream);
return _fopen(filename, mode);
},
- fseek__deps: ['$FS', 'lseek'],
+ fseek__deps: ['$FS', 'lseek', 'fileno'],
fseek: function(stream, offset, whence) {
// int fseek(FILE *stream, long offset, int whence);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fseek.html
- var ret = _lseek(stream, offset, whence);
+ var fd = _fileno(stream);
+ var ret = _lseek(fd, offset, whence);
if (ret == -1) {
return -1;
}
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
stream.eof = false;
return 0;
},
fseeko: 'fseek',
- fseeko64: 'fseek',
fsetpos__deps: ['$FS', 'lseek', '__setErrNo', '$ERRNO_CODES'],
fsetpos: function(stream, pos) {
// int fsetpos(FILE *stream, const fpos_t *pos);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fsetpos.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
@@ -2592,7 +2596,7 @@ LibraryManager.library = {
ftell: function(stream) {
// long ftell(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ftell.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
@@ -2605,16 +2609,16 @@ LibraryManager.library = {
}
},
ftello: 'ftell',
- ftello64: 'ftell',
- fwrite__deps: ['$FS', 'write'],
+ fwrite__deps: ['$FS', 'write', 'fileno'],
fwrite: function(ptr, size, nitems, stream) {
// size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html
var bytesToWrite = nitems * size;
if (bytesToWrite == 0) return 0;
- var bytesWritten = _write(stream, ptr, bytesToWrite);
+ var fd = _fileno(stream);
+ var bytesWritten = _write(fd, ptr, bytesToWrite);
if (bytesWritten == -1) {
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (streamObj) streamObj.error = true;
return 0;
} else {
@@ -2677,7 +2681,7 @@ LibraryManager.library = {
// void rewind(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/rewind.html
_fseek(stream, 0, 0); // SEEK_SET.
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (streamObj) streamObj.error = false;
},
setvbuf: function(stream, buf, type, size) {
@@ -2693,7 +2697,7 @@ LibraryManager.library = {
if (buf) _setvbuf(stream, buf, 0, 8192); // _IOFBF, BUFSIZ.
else _setvbuf(stream, buf, 2, 8192); // _IONBF, BUFSIZ.
},
- tmpnam__deps: ['$FS'],
+ tmpnam__deps: ['$FS', 'malloc'],
tmpnam: function(s, dir, prefix) {
// char *tmpnam(char *s);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/tmpnam.html
@@ -2734,7 +2738,7 @@ LibraryManager.library = {
ungetc: function(c, stream) {
// int ungetc(int c, FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/ungetc.html
- stream = FS.getStream(stream);
+ stream = FS.getStreamFromPtr(stream);
if (!stream) {
return -1;
}
@@ -2759,7 +2763,7 @@ LibraryManager.library = {
fscanf: function(stream, format, varargs) {
// int fscanf(FILE *restrict stream, const char *restrict format, ... );
// http://pubs.opengroup.org/onlinepubs/000095399/functions/scanf.html
- var streamObj = FS.getStream(stream);
+ var streamObj = FS.getStreamFromPtr(stream);
if (!streamObj) {
return -1;
}
@@ -2790,7 +2794,7 @@ LibraryManager.library = {
function unget() { index--; };
return __scanString(format, get, unget, varargs);
},
- snprintf__deps: ['_formatString'],
+ snprintf__deps: ['_formatString', 'malloc'],
snprintf: function(s, n, format, varargs) {
// int snprintf(char *restrict s, size_t n, const char *restrict format, ...);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
@@ -2857,7 +2861,7 @@ LibraryManager.library = {
vsscanf: 'sscanf',
#endif
-#if TARGET_LE32
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN
// convert va_arg into varargs
vfprintf__deps: ['fprintf'],
vfprintf: function(s, f, va_arg) {
@@ -2897,28 +2901,12 @@ LibraryManager.library = {
},
#endif
- fopen64: 'fopen',
- __01fopen64_: 'fopen',
- __01freopen64_: 'freopen',
- __01fseeko64_: 'fseek',
- __01ftello64_: 'ftell',
- __01tmpfile64_: 'tmpfile',
- __isoc99_fscanf: 'fscanf',
- // TODO: Check if any other aliases are needed.
- _IO_getc: 'getc',
- _IO_putc: 'putc',
- _ZNSo3putEc: 'putchar',
- _ZNSo5flushEv__deps: ['fflush', 'stdout'],
- _ZNSo5flushEv: function() {
- _fflush({{{ makeGetValue(makeGlobalUse('_stdout'), '0', 'void*') }}});
- },
-
// ==========================================================================
// sys/mman.h
// ==========================================================================
- mmap__deps: ['$FS'],
- mmap: function(start, num, prot, flags, stream, offset) {
+ mmap__deps: ['$FS', 'malloc', 'memset'],
+ mmap: function(start, num, prot, flags, fd, offset) {
/* FIXME: Since mmap is normally implemented at the kernel level,
* this implementation simply uses malloc underneath the call to
* mmap.
@@ -2929,13 +2917,13 @@ LibraryManager.library = {
if (!_mmap.mappings) _mmap.mappings = {};
- if (stream == -1) {
+ if (fd == -1) {
ptr = _malloc(num);
if (!ptr) return -1;
_memset(ptr, 0, num);
allocated = true;
} else {
- var info = FS.getStream(stream);
+ var info = FS.getStream(fd);
if (!info) return -1;
try {
var res = FS.mmap(info, HEAPU8, start, num, offset, prot, flags);
@@ -2950,7 +2938,6 @@ LibraryManager.library = {
_mmap.mappings[ptr] = { malloc: ptr, num: num, allocated: allocated };
return ptr;
},
- __01mmap64_: 'mmap',
munmap: function(start, num) {
if (!_mmap.mappings) _mmap.mappings = {};
@@ -3076,7 +3063,7 @@ LibraryManager.library = {
return 0;
},
- realloc__deps: ['memcpy'],
+ realloc__deps: ['malloc', 'memcpy', 'free'],
realloc: function(ptr, size) {
// Very simple, inefficient implementation - if you use a real malloc, best to use
// a real realloc with it
@@ -3147,7 +3134,7 @@ LibraryManager.library = {
// Set end pointer.
if (endptr) {
- {{{ makeSetValue('endptr', 0, 'str', '*') }}}
+ {{{ makeSetValue('endptr', 0, 'str', '*') }}};
}
// Unsign if needed.
@@ -3233,7 +3220,7 @@ LibraryManager.library = {
// Set end pointer.
if (endptr) {
- {{{ makeSetValue('endptr', 0, 'str', '*') }}}
+ {{{ makeSetValue('endptr', 0, 'str', '*') }}};
}
try {
@@ -3250,22 +3237,34 @@ LibraryManager.library = {
strtoll: function(str, endptr, base) {
return __parseInt64(str, endptr, base, '-9223372036854775808', '9223372036854775807'); // LLONG_MIN, LLONG_MAX.
},
- strtoll_l: 'strtoll', // no locale support yet
+ strtoll_l__deps: ['strtoll'],
+ strtoll_l: function(str, endptr, base) {
+ return _strtoll(str, endptr, base); // no locale support yet
+ },
strtol__deps: ['_parseInt'],
strtol: function(str, endptr, base) {
return __parseInt(str, endptr, base, -2147483648, 2147483647, 32); // LONG_MIN, LONG_MAX.
},
- strtol_l: 'strtol', // no locale support yet
+ strtol_l__deps: ['strtol'],
+ strtol_l: function(str, endptr, base) {
+ return _strtol(str, endptr, base); // no locale support yet
+ },
strtoul__deps: ['_parseInt'],
strtoul: function(str, endptr, base) {
return __parseInt(str, endptr, base, 0, 4294967295, 32, true); // ULONG_MAX.
},
- strtoul_l: 'strtoul', // no locale support yet
+ strtoul_l__deps: ['strtoul'],
+ strtoul_l: function(str, endptr, base) {
+ return _strtoul(str, endptr, base); // no locale support yet
+ },
strtoull__deps: ['_parseInt64'],
strtoull: function(str, endptr, base) {
return __parseInt64(str, endptr, base, 0, '18446744073709551615', true); // ULONG_MAX.
},
- strtoull_l: 'strtoull', // no locale support yet
+ strtoull_l__deps: ['strtoull'],
+ strtoull_l: function(str, endptr, base) {
+ return _strtoull(str, endptr, base); // no locale support yet
+ },
atoi__deps: ['strtol'],
atoi: function(ptr) {
@@ -3278,7 +3277,7 @@ LibraryManager.library = {
return _strtoll(ptr, null, 10);
},
- qsort__deps: ['memcpy'],
+ qsort__deps: ['malloc', 'memcpy', 'free'],
qsort: function(base, num, size, cmp) {
if (num == 0 || size == 0) return;
// forward calls to the JavaScript sort method
@@ -3327,7 +3326,7 @@ LibraryManager.library = {
poolPtr = allocate(TOTAL_ENV_SIZE, 'i8', ALLOC_STATIC);
envPtr = allocate(MAX_ENV_VALUES * {{{ Runtime.QUANTUM_SIZE }}},
'i8*', ALLOC_STATIC);
- {{{ makeSetValue('envPtr', '0', 'poolPtr', 'i8*') }}}
+ {{{ makeSetValue('envPtr', '0', 'poolPtr', 'i8*') }}};
{{{ makeSetValue(makeGlobalUse('_environ'), 0, 'envPtr', 'i8*') }}};
} else {
envPtr = {{{ makeGetValue(makeGlobalUse('_environ'), '0', 'i8**') }}};
@@ -3451,18 +3450,30 @@ LibraryManager.library = {
var limit = Math.min(nelem, 3);
var doubleSize = {{{ Runtime.getNativeTypeSize('double') }}};
for (var i = 0; i < limit; i++) {
- {{{ makeSetValue('loadavg', 'i * doubleSize', '0.1', 'double') }}}
+ {{{ makeSetValue('loadavg', 'i * doubleSize', '0.1', 'double') }}};
}
return limit;
},
- // Use browser's Math.random(). We can't set a seed, though.
- srand: function(seed) {}, // XXX ignored
- rand: function() {
- return Math.floor(Math.random()*0x80000000);
+ __rand_seed: 'allocate([0x0273459b, 0, 0, 0], "i32", ALLOC_STATIC)',
+ srand__deps: ['__rand_seed'],
+ srand: function(seed) {
+ {{{ makeSetValue('___rand_seed', 0, 'seed', 'i32') }}}
+ },
+ rand_r__sig: 'ii',
+ rand_r__asm: true,
+ rand_r: function(seedp) {
+ seedp = seedp|0;
+ var val = 0;
+ val = ((Math_imul({{{ makeGetValueAsm('seedp', 0, 'i32') }}}, 31010991)|0) + 0x676e6177 ) & {{{ cDefine('RAND_MAX') }}}; // assumes RAND_MAX is in bit mask form (power of 2 minus 1)
+ {{{ makeSetValueAsm('seedp', 0, 'val', 'i32') }}};
+ return val|0;
},
- rand_r: function(seed) { // XXX ignores the seed
- return Math.floor(Math.random()*0x80000000);
+ rand__sig: 'i',
+ rand__asm: true,
+ rand__deps: ['rand_r', '__rand_seed'],
+ rand: function() {
+ return _rand_r(___rand_seed)|0;
},
drand48: function() {
@@ -3480,9 +3491,9 @@ LibraryManager.library = {
} else {
var size = Math.min(4095, absolute.path.length); // PATH_MAX - 1.
for (var i = 0; i < size; i++) {
- {{{ makeSetValue('resolved_name', 'i', 'absolute.path.charCodeAt(i)', 'i8') }}}
+ {{{ makeSetValue('resolved_name', 'i', 'absolute.path.charCodeAt(i)', 'i8') }}};
}
- {{{ makeSetValue('resolved_name', 'size', '0', 'i8') }}}
+ {{{ makeSetValue('resolved_name', 'size', '0', 'i8') }}};
return resolved_name;
}
},
@@ -3506,11 +3517,18 @@ LibraryManager.library = {
return ret;
},
+ emscripten_memcpy_big: function(dest, src, num) {
+ HEAPU8.set(HEAPU8.subarray(src, src+num), dest);
+ return dest;
+ },
+
memcpy__asm: true,
memcpy__sig: 'iiii',
+ memcpy__deps: ['emscripten_memcpy_big'],
memcpy: function(dest, src, num) {
dest = dest|0; src = src|0; num = num|0;
var ret = 0;
+ if ((num|0) >= 4096) return _emscripten_memcpy_big(dest|0, src|0, num|0)|0;
ret = dest|0;
if ((dest&3) == (src&3)) {
while (dest & 3) {
@@ -3690,7 +3708,7 @@ LibraryManager.library = {
var padding = 0, curr = 0, i = 0;
while ((i|0) < (num|0)) {
curr = padding ? 0 : {{{ makeGetValueAsm('psrc', 'i', 'i8') }}};
- {{{ makeSetValue('pdest', 'i', 'curr', 'i8') }}}
+ {{{ makeSetValue('pdest', 'i', 'curr', 'i8') }}};
padding = padding ? 1 : ({{{ makeGetValueAsm('psrc', 'i', 'i8') }}} == 0);
i = (i+1)|0;
}
@@ -3743,83 +3761,13 @@ LibraryManager.library = {
if ({{{ makeGetValue('pdest', 'len+i', 'i8') }}} == 0) break;
i ++;
if (i == num) {
- {{{ makeSetValue('pdest', 'len+i', 0, 'i8') }}}
+ {{{ makeSetValue('pdest', 'len+i', 0, 'i8') }}};
break;
}
}
return pdest;
},
- strcmp__deps: ['strncmp'],
- strcmp: function(px, py) {
- return _strncmp(px, py, TOTAL_MEMORY);
- },
- // We always assume ASCII locale.
- strcoll: 'strcmp',
- strcoll_l: 'strcmp',
-
- strcasecmp__asm: true,
- strcasecmp__sig: 'iii',
- strcasecmp__deps: ['strncasecmp'],
- strcasecmp: function(px, py) {
- px = px|0; py = py|0;
- return _strncasecmp(px, py, -1)|0;
- },
-
- strncmp: function(px, py, n) {
- var i = 0;
- while (i < n) {
- var x = {{{ makeGetValue('px', 'i', 'i8', 0, 1) }}};
- var y = {{{ makeGetValue('py', 'i', 'i8', 0, 1) }}};
- if (x == y && x == 0) return 0;
- if (x == 0) return -1;
- if (y == 0) return 1;
- if (x == y) {
- i ++;
- continue;
- } else {
- return x > y ? 1 : -1;
- }
- }
- return 0;
- },
-
- strncasecmp__asm: true,
- strncasecmp__sig: 'iiii',
- strncasecmp__deps: ['tolower'],
- strncasecmp: function(px, py, n) {
- px = px|0; py = py|0; n = n|0;
- var i = 0, x = 0, y = 0;
- while ((i>>>0) < (n>>>0)) {
- x = _tolower({{{ makeGetValueAsm('px', 'i', 'i8', 0, 1) }}})|0;
- y = _tolower({{{ makeGetValueAsm('py', 'i', 'i8', 0, 1) }}})|0;
- if (((x|0) == (y|0)) & ((x|0) == 0)) return 0;
- if ((x|0) == 0) return -1;
- if ((y|0) == 0) return 1;
- if ((x|0) == (y|0)) {
- i = (i + 1)|0;
- continue;
- } else {
- return ((x>>>0) > (y>>>0) ? 1 : -1)|0;
- }
- }
- return 0;
- },
-
- memcmp__asm: true,
- memcmp__sig: 'iiii',
- memcmp: function(p1, p2, num) {
- p1 = p1|0; p2 = p2|0; num = num|0;
- var i = 0, v1 = 0, v2 = 0;
- while ((i|0) < (num|0)) {
- v1 = {{{ makeGetValueAsm('p1', 'i', 'i8', true) }}};
- v2 = {{{ makeGetValueAsm('p2', 'i', 'i8', true) }}};
- if ((v1|0) != (v2|0)) return ((v1|0) > (v2|0) ? 1 : -1)|0;
- i = (i+1)|0;
- }
- return 0;
- },
-
memchr: function(ptr, chr, num) {
chr = unSign(chr);
for (var i = 0; i < num; i++) {
@@ -3830,6 +3778,7 @@ LibraryManager.library = {
},
strnlen: function(ptr, num) {
+ num = num >>> 0;
for (var i = 0; i < num; i++) {
if ({{{ makeGetValue('ptr', 0, 'i8') }}} == 0) return i;
ptr++;
@@ -3878,7 +3827,7 @@ LibraryManager.library = {
},
rindex: 'strrchr',
- strdup__deps: ['strlen'],
+ strdup__deps: ['strlen', 'malloc'],
strdup: function(ptr) {
var len = _strlen(ptr);
var newStr = _malloc(len + 1);
@@ -3887,7 +3836,7 @@ LibraryManager.library = {
return newStr;
},
- strndup__deps: ['strdup', 'strlen'],
+ strndup__deps: ['strdup', 'strlen', 'malloc'],
strndup: function(ptr, size) {
var len = _strlen(ptr);
@@ -3995,7 +3944,7 @@ LibraryManager.library = {
return ___setErrNo(ERRNO_CODES.EINVAL);
}
},
- strerror__deps: ['strerror_r'],
+ strerror__deps: ['strerror_r', 'malloc'],
strerror: function(errnum) {
if (!_strerror.buffer) _strerror.buffer = _malloc(256);
_strerror_r(errnum, _strerror.buffer, 256);
@@ -4020,7 +3969,10 @@ LibraryManager.library = {
}
},
_toupper: 'toupper',
- toupper_l: 'toupper',
+ toupper_l__deps: ['toupper'],
+ toupper_l: function(str, endptr, base) {
+ return _toupper(str, endptr, base); // no locale support yet
+ },
tolower__asm: true,
tolower__sig: 'ii',
@@ -4031,66 +3983,106 @@ LibraryManager.library = {
return (chr - {{{ charCode('A') }}} + {{{ charCode('a') }}})|0;
},
_tolower: 'tolower',
- tolower_l: 'tolower',
+ tolower_l__deps: ['tolower'],
+ tolower_l: function(chr) {
+ return _tolower(chr); // no locale support yet
+ },
// The following functions are defined as macros in glibc.
islower: function(chr) {
return chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}};
},
- islower_l: 'islower',
+ islower_l__deps: ['islower'],
+ islower_l: function(chr) {
+ return _islower(chr); // no locale support yet
+ },
isupper: function(chr) {
return chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}};
},
- isupper_l: 'isupper',
+ isupper_l__deps: ['isupper'],
+ isupper_l: function(chr) {
+ return _isupper(chr); // no locale support yet
+ },
isalpha: function(chr) {
return (chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}});
},
- isalpha_l: 'isalpha',
+ isalpha_l__deps: ['isalpha'],
+ isalpha_l: function(chr) {
+ return _isalpha(chr); // no locale support yet
+ },
isdigit: function(chr) {
return chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}};
},
- isdigit_l: 'isdigit',
+ isdigit_l__deps: ['isdigit'],
+ isdigit_l: function(chr) {
+ return _isdigit(chr); // no locale support yet
+ },
isxdigit: function(chr) {
return (chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}}) ||
(chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('f') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('F') }}});
},
- isxdigit_l: 'isxdigit',
+ isxdigit_l__deps: ['isxdigit'],
+ isxdigit_l: function(chr) {
+ return _isxdigit(chr); // no locale support yet
+ },
isalnum: function(chr) {
return (chr >= {{{ charCode('0') }}} && chr <= {{{ charCode('9') }}}) ||
(chr >= {{{ charCode('a') }}} && chr <= {{{ charCode('z') }}}) ||
(chr >= {{{ charCode('A') }}} && chr <= {{{ charCode('Z') }}});
},
- isalnum_l: 'isalnum',
+ isalnum_l__deps: ['isalnum'],
+ isalnum_l: function(chr) {
+ return _isalnum(chr); // no locale support yet
+ },
ispunct: function(chr) {
return (chr >= {{{ charCode('!') }}} && chr <= {{{ charCode('/') }}}) ||
(chr >= {{{ charCode(':') }}} && chr <= {{{ charCode('@') }}}) ||
(chr >= {{{ charCode('[') }}} && chr <= {{{ charCode('`') }}}) ||
(chr >= {{{ charCode('{') }}} && chr <= {{{ charCode('~') }}});
},
- ispunct_l: 'ispunct',
+ ispunct_l__deps: ['ispunct'],
+ ispunct_l: function(chr) {
+ return _ispunct(chr); // no locale support yet
+ },
isspace: function(chr) {
return (chr == 32) || (chr >= 9 && chr <= 13);
},
- isspace_l: 'isspace',
+ isspace_l__deps: ['isspace'],
+ isspace_l: function(chr) {
+ return _isspace(chr); // no locale support yet
+ },
isblank: function(chr) {
return chr == {{{ charCode(' ') }}} || chr == {{{ charCode('\t') }}};
},
- isblank_l: 'isblank',
+ isblank_l__deps: ['isblank'],
+ isblank_l: function(chr) {
+ return _isblank(chr); // no locale support yet
+ },
iscntrl: function(chr) {
return (0 <= chr && chr <= 0x1F) || chr === 0x7F;
},
- iscntrl_l: 'iscntrl',
+ iscntrl_l__deps: ['iscntrl'],
+ iscntrl_l: function(chr) {
+ return _iscntrl(chr); // no locale support yet
+ },
isprint: function(chr) {
return 0x1F < chr && chr < 0x7F;
},
- isprint_l: 'isprint',
+ isprint_l__deps: ['isprint'],
+ isprint_l: function(chr) {
+ return _isprint(chr); // no locale support yet
+ },
isgraph: function(chr) {
return 0x20 < chr && chr < 0x7F;
},
- isgraph_l: 'isgraph',
+ isgraph_l__deps: ['isgraph'],
+ isgraph_l: function(chr) {
+ return _isgraph(chr); // no locale support yet
+ },
// Lookup tables for glibc ctype implementation.
+ __ctype_b_loc__deps: ['malloc'],
__ctype_b_loc: function() {
// http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/baselib---ctype-b-loc.html
var me = ___ctype_b_loc;
@@ -4110,12 +4102,13 @@ LibraryManager.library = {
var i16size = {{{ Runtime.getNativeTypeSize('i16') }}};
var arr = _malloc(values.length * i16size);
for (var i = 0; i < values.length; i++) {
- {{{ makeSetValue('arr', 'i * i16size', 'values[i]', 'i16') }}}
+ {{{ makeSetValue('arr', 'i * i16size', 'values[i]', 'i16') }}};
}
me.ret = allocate([arr + 128 * i16size], 'i16*', ALLOC_NORMAL);
}
return me.ret;
},
+ __ctype_tolower_loc__deps: ['malloc'],
__ctype_tolower_loc: function() {
// http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-tolower-loc.html
var me = ___ctype_tolower_loc;
@@ -4138,12 +4131,13 @@ LibraryManager.library = {
var i32size = {{{ Runtime.getNativeTypeSize('i32') }}};
var arr = _malloc(values.length * i32size);
for (var i = 0; i < values.length; i++) {
- {{{ makeSetValue('arr', 'i * i32size', 'values[i]', 'i32') }}}
+ {{{ makeSetValue('arr', 'i * i32size', 'values[i]', 'i32') }}};
}
me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);
}
return me.ret;
},
+ __ctype_toupper_loc__deps: ['malloc'],
__ctype_toupper_loc: function() {
// http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/libutil---ctype-toupper-loc.html
var me = ___ctype_toupper_loc;
@@ -4165,7 +4159,7 @@ LibraryManager.library = {
var i32size = {{{ Runtime.getNativeTypeSize('i32') }}};
var arr = _malloc(values.length * i32size);
for (var i = 0; i < values.length; i++) {
- {{{ makeSetValue('arr', 'i * i32size', 'values[i]', 'i32') }}}
+ {{{ makeSetValue('arr', 'i * i32size', 'values[i]', 'i32') }}};
}
me.ret = allocate([arr + 128 * i32size], 'i32*', ALLOC_NORMAL);
}
@@ -4186,7 +4180,7 @@ LibraryManager.library = {
#if TARGET_X86
return makeSetValue(ptr, 0, 'varrp', 'void*');
#endif
-#if TARGET_LE32
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN
// 2-word structure: struct { void* start; void* currentOffset; }
return makeSetValue(ptr, 0, 'varrp', 'void*') + ';' + makeSetValue(ptr, Runtime.QUANTUM_SIZE, 0, 'void*');
#endif
@@ -4311,6 +4305,8 @@ LibraryManager.library = {
abort('trap!');
},
+ llvm_prefetch: function(){},
+
__assert_fail: function(condition, filename, line, func) {
ABORT = true;
throw 'Assertion failed: ' + Pointer_stringify(condition) + ', at: ' + [filename ? Pointer_stringify(filename) : 'unknown filename', line, func ? Pointer_stringify(func) : 'unknown function'] + ' at ' + stackTrace();
@@ -4336,21 +4332,36 @@ LibraryManager.library = {
_ZTVN10__cxxabiv120__si_class_type_infoE: [2], // yes inherited classes
#endif
+ // We store an extra header in front of the exception data provided
+ // by the user.
+ // This header is:
+ // * type
+ // * destructor function pointer
+ // This is then followed by the actual exception data.
+ __cxa_exception_header_size: 8,
+ __cxa_last_thrown_exception: 0,
+ __cxa_caught_exceptions: [],
+
// Exceptions
+ __cxa_allocate_exception__deps: ['__cxa_exception_header_size', 'malloc'],
__cxa_allocate_exception: function(size) {
- return _malloc(size);
+ var ptr = _malloc(size + ___cxa_exception_header_size);
+ return ptr + ___cxa_exception_header_size;
},
+ __cxa_free_exception__deps: ['__cxa_exception_header_size', 'free'],
__cxa_free_exception: function(ptr) {
try {
- return _free(ptr);
+ return _free(ptr - ___cxa_exception_header_size);
} catch(e) { // XXX FIXME
#if ASSERTIONS
Module.printErr('exception during cxa_free_exception: ' + e);
#endif
}
},
+ // Here, we throw an exception after recording a couple of values that we need to remember
+ // We also remember that it was the last exception thrown as we need to know that later.
__cxa_throw__sig: 'viii',
- __cxa_throw__deps: ['llvm_eh_exception', '_ZSt18uncaught_exceptionv', '__cxa_find_matching_catch'],
+ __cxa_throw__deps: ['_ZSt18uncaught_exceptionv', '__cxa_find_matching_catch', '__cxa_exception_header_size', '__cxa_last_thrown_exception'],
__cxa_throw: function(ptr, type, destructor) {
if (!___cxa_throw.initialized) {
try {
@@ -4367,28 +4378,34 @@ LibraryManager.library = {
#if EXCEPTION_DEBUG
Module.printErr('Compiled code throwing an exception, ' + [ptr,type,destructor] + ', at ' + stackTrace());
#endif
- {{{ makeSetValue('_llvm_eh_exception.buf', '0', 'ptr', 'void*') }}}
- {{{ makeSetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'type', 'void*') }}}
- {{{ makeSetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, 'destructor', 'void*') }}}
+ var header = ptr - ___cxa_exception_header_size;
+ {{{ makeSetValue('header', 0, 'type', 'void*') }}};
+ {{{ makeSetValue('header', 4, 'destructor', 'void*') }}};
+ ___cxa_last_thrown_exception = ptr;
if (!("uncaught_exception" in __ZSt18uncaught_exceptionv)) {
__ZSt18uncaught_exceptionv.uncaught_exception = 1;
} else {
__ZSt18uncaught_exceptionv.uncaught_exception++;
}
- {{{ makeThrow('ptr') }}};
+ {{{ makeThrow('ptr') }}}
},
- __cxa_rethrow__deps: ['llvm_eh_exception', '__cxa_end_catch'],
+ // This exception will be caught twice, but while begin_catch runs twice,
+ // we early-exit from end_catch when the exception has been rethrown, so
+ // pop that here from the caught exceptions.
+ __cxa_rethrow__deps: ['__cxa_end_catch', '__cxa_caught_exceptions'],
__cxa_rethrow: function() {
___cxa_end_catch.rethrown = true;
- {{{ makeThrow(makeGetValue('_llvm_eh_exception.buf', '0', 'void*')) }}};
+ var ptr = ___cxa_caught_exceptions.pop();
+ {{{ makeThrow('ptr') }}}
},
- llvm_eh_exception__postset: '_llvm_eh_exception.buf = allocate(12, "void*", ALLOC_STATIC);',
+ llvm_eh_exception__deps: ['__cxa_last_thrown_exception'],
llvm_eh_exception: function() {
- return {{{ makeGetValue('_llvm_eh_exception.buf', '0', 'void*') }}};
+ return ___cxa_last_thrown_exception;
},
llvm_eh_selector__jsargs: true,
+ llvm_eh_selector__deps: ['__cxa_last_thrown_exception'],
llvm_eh_selector: function(unused_exception_value, personality/*, varargs*/) {
- var type = {{{ makeGetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'void*') }}}
+ var type = ___cxa_last_thrown_exception;
for (var i = 2; i < arguments.length; i++) {
if (arguments[i] == type) return type;
}
@@ -4397,12 +4414,22 @@ LibraryManager.library = {
llvm_eh_typeid_for: function(type) {
return type;
},
- __cxa_begin_catch__deps: ['_ZSt18uncaught_exceptionv'],
+ // Note that we push the last thrown exception here rather than the ptr.
+ // This is because if the exception is a pointer (as in test 3 of test_exceptions_typed),
+ // we don't actually get the value that we allocated, but something else. Easiest
+ // to remember that the last exception thrown is going to be the first to be caught,
+ // so just use that value instead as it is what we're really looking for.
+ __cxa_begin_catch__deps: ['_ZSt18uncaught_exceptionv', '__cxa_caught_exceptions', '__cxa_last_thrown_exception'],
__cxa_begin_catch: function(ptr) {
__ZSt18uncaught_exceptionv.uncaught_exception--;
+ ___cxa_caught_exceptions.push(___cxa_last_thrown_exception);
return ptr;
},
- __cxa_end_catch__deps: ['llvm_eh_exception', '__cxa_free_exception'],
+ // We're done with a catch. Now, we can run the destructor if there is one
+ // and free the exception. Note that if the dynCall on the destructor fails
+ // due to calling apply on undefined, that means that the destructor is
+ // an invalid index into the FUNCTION_TABLE, so something has gone wrong.
+ __cxa_end_catch__deps: ['__cxa_free_exception', '__cxa_last_thrown_exception', '__cxa_exception_header_size', '__cxa_caught_exceptions'],
__cxa_end_catch: function() {
if (___cxa_end_catch.rethrown) {
___cxa_end_catch.rethrown = false;
@@ -4414,29 +4441,26 @@ LibraryManager.library = {
#else
__THREW__ = 0;
#endif
- // Clear type.
- {{{ makeSetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, '0', 'void*') }}}
// Call destructor if one is registered then clear it.
- var ptr = {{{ makeGetValue('_llvm_eh_exception.buf', '0', 'void*') }}};
- var destructor = {{{ makeGetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, 'void*') }}};
- if (destructor) {
- Runtime.dynCall('vi', destructor, [ptr]);
- {{{ makeSetValue('_llvm_eh_exception.buf', 2 * QUANTUM_SIZE, '0', 'i32') }}}
- }
- // Free ptr if it isn't null.
+ var ptr = ___cxa_caught_exceptions.pop();
if (ptr) {
+ header = ptr - ___cxa_exception_header_size;
+ var destructor = {{{ makeGetValue('header', 4, 'void*') }}};
+ if (destructor) {
+ Runtime.dynCall('vi', destructor, [ptr]);
+ {{{ makeSetValue('header', 4, '0', 'i32') }}};
+ }
___cxa_free_exception(ptr);
- {{{ makeSetValue('_llvm_eh_exception.buf', '0', '0', 'void*') }}}
+ ___cxa_last_thrown_exception = 0;
}
},
- __cxa_get_exception_ptr__deps: ['llvm_eh_exception'],
__cxa_get_exception_ptr: function(ptr) {
return ptr;
},
_ZSt18uncaught_exceptionv: function() { // std::uncaught_exception()
return !!__ZSt18uncaught_exceptionv.uncaught_exception;
},
- __cxa_uncaught_exception__deps: ['_Zst18uncaught_exceptionv'],
+ __cxa_uncaught_exception__deps: ['_ZSt18uncaught_exceptionv'],
__cxa_uncaught_exception: function() {
return !!__ZSt18uncaught_exceptionv.uncaught_exception;
},
@@ -4447,17 +4471,9 @@ LibraryManager.library = {
throw exception;
},
- _Unwind_Resume_or_Rethrow: function(ptr) {
- {{{ makeThrow('ptr') }}};
- },
- _Unwind_RaiseException: function(ptr) {
- {{{ makeThrow('ptr') }}};
- },
- _Unwind_DeleteException: function(ptr) {},
-
terminate: '__cxa_call_unexpected',
- __gxx_personality_v0__deps: ['llvm_eh_exception', '_ZSt18uncaught_exceptionv', '__cxa_find_matching_catch'],
+ __gxx_personality_v0__deps: ['_ZSt18uncaught_exceptionv', '__cxa_find_matching_catch'],
__gxx_personality_v0: function() {
},
@@ -4490,10 +4506,11 @@ LibraryManager.library = {
// functionality boils down to picking a suitable 'catch' block.
// We'll do that here, instead, to keep things simpler.
- __cxa_find_matching_catch__deps: ['__cxa_does_inherit', '__cxa_is_number_type', '__resumeException'],
+ __cxa_find_matching_catch__deps: ['__cxa_does_inherit', '__cxa_is_number_type', '__resumeException', '__cxa_last_thrown_exception', '__cxa_exception_header_size'],
__cxa_find_matching_catch: function(thrown, throwntype) {
- if (thrown == -1) thrown = {{{ makeGetValue('_llvm_eh_exception.buf', '0', 'void*') }}};
- if (throwntype == -1) throwntype = {{{ makeGetValue('_llvm_eh_exception.buf', QUANTUM_SIZE, 'void*') }}};
+ if (thrown == -1) thrown = ___cxa_last_thrown_exception;
+ header = thrown - ___cxa_exception_header_size;
+ if (throwntype == -1) throwntype = {{{ makeGetValue('header', 0, 'void*') }}};
var typeArray = Array.prototype.slice.call(arguments, 2);
// If throwntype is a pointer, this means a pointer has been
@@ -4519,13 +4536,13 @@ LibraryManager.library = {
{{{ makeStructuralReturn(['thrown', 'throwntype']) }}};
},
- __resumeException__deps: [function() { Functions.libraryFunctions['__resumeException'] = 1 }], // will be called directly from compiled code
+ __resumeException__deps: [function() { Functions.libraryFunctions['__resumeException'] = 1 }, '__cxa_last_thrown_exception'], // will be called directly from compiled code
__resumeException: function(ptr) {
#if EXCEPTION_DEBUG
Module.print("Resuming exception");
#endif
- if ({{{ makeGetValue('_llvm_eh_exception.buf', 0, 'void*') }}} == 0) {{{ makeSetValue('_llvm_eh_exception.buf', 0, 'ptr', 'void*') }}};
- {{{ makeThrow('ptr') }}};
+ if (!___cxa_last_thrown_exception) { ___cxa_last_thrown_exception = ptr; }
+ {{{ makeThrow('ptr') }}}
},
// Recursively walks up the base types of 'possibilityType'
@@ -4567,7 +4584,21 @@ LibraryManager.library = {
}
},
- _ZNSt9exceptionD2Ev: function(){}, // XXX a dependency of dlmalloc, but not actually needed if libcxx is not anyhow included
+ // Destructors for std::exception since we don't have them implemented in libcxx as we aren't using libcxxabi.
+ // These are also needed for the dlmalloc tests.
+ _ZNSt9exceptionD0Ev: function() {},
+ _ZNSt9exceptionD1Ev: function() {},
+ _ZNSt9exceptionD2Ev: function() {},
+
+ _ZNKSt9exception4whatEv__deps: ['malloc'],
+ _ZNKSt9exception4whatEv: function() {
+ if (!__ZNKSt9exception4whatEv.buffer) {
+ var name = "std::exception";
+ __ZNKSt9exception4whatEv.buffer = _malloc(name.length + 1);
+ writeStringToMemory(name, __ZNKSt9exception4whatEv.buffer);
+ }
+ return __ZNKSt9exception4whatEv.buffer;
+ },
_ZNSt9type_infoD2Ev: function(){},
@@ -4592,6 +4623,8 @@ LibraryManager.library = {
_ZTIv: [0], // void
_ZTIPv: [0], // void*
+ _ZTISt9exception: 'allocate([allocate([1,0,0,0,0,0,0], "i8", ALLOC_STATIC)+8, 0], "i32", ALLOC_STATIC)', // typeinfo for std::exception
+
llvm_uadd_with_overflow_i8: function(x, y) {
x = x & 0xff;
y = y & 0xff;
@@ -4837,11 +4870,11 @@ LibraryManager.library = {
cbrtl: 'cbrt',
modf: function(x, intpart) {
- {{{ makeSetValue('intpart', 0, 'Math.floor(x)', 'double') }}}
+ {{{ makeSetValue('intpart', 0, 'Math.floor(x)', 'double') }}};
return x - {{{ makeGetValue('intpart', 0, 'double') }}};
},
modff: function(x, intpart) {
- {{{ makeSetValue('intpart', 0, 'Math.floor(x)', 'float') }}}
+ {{{ makeSetValue('intpart', 0, 'Math.floor(x)', 'float') }}};
return x - {{{ makeGetValue('intpart', 0, 'float') }}};
},
frexp: function(x, exp_addr) {
@@ -4857,7 +4890,7 @@ LibraryManager.library = {
if (exp_ === raw_exp) exp_ += 1;
sig = sign*x/Math.pow(2, exp_);
}
- {{{ makeSetValue('exp_addr', 0, 'exp_', 'i32') }}}
+ {{{ makeSetValue('exp_addr', 0, 'exp_', 'i32') }}};
return sig;
},
frexpf: 'frexp',
@@ -5365,7 +5398,7 @@ LibraryManager.library = {
time: function(ptr) {
var ret = Math.floor(Date.now()/1000);
if (ptr) {
- {{{ makeSetValue('ptr', 0, 'ret', 'i32') }}}
+ {{{ makeSetValue('ptr', 0, 'ret', 'i32') }}};
}
return ret;
},
@@ -5392,9 +5425,9 @@ LibraryManager.library = {
{{{ makeGetValue('tmPtr', C_STRUCTS.tm.tm_min, 'i32') }}},
{{{ makeGetValue('tmPtr', C_STRUCTS.tm.tm_sec, 'i32') }}},
0).getTime() / 1000;
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'new Date(timestamp).getDay()', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'new Date(timestamp).getDay()', 'i32') }}};
var yday = Math.round((timestamp - (new Date(year, 0, 1)).getTime()) / (1000 * 60 * 60 * 24));
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}};
return timestamp;
},
timelocal: 'mktime',
@@ -5407,15 +5440,15 @@ LibraryManager.library = {
gmtime_r__deps: ['__tm_timezone'],
gmtime_r: function(time, tmPtr) {
var date = new Date({{{ makeGetValue('time', 0, 'i32') }}}*1000);
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_sec, 'date.getUTCSeconds()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_min, 'date.getUTCMinutes()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_hour, 'date.getUTCHours()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mday, 'date.getUTCDate()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mon, 'date.getUTCMonth()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_year, 'date.getUTCFullYear()-1900', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'date.getUTCDay()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_gmtoff, '0', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_isdst, '0', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_sec, 'date.getUTCSeconds()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_min, 'date.getUTCMinutes()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_hour, 'date.getUTCHours()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mday, 'date.getUTCDate()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mon, 'date.getUTCMonth()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_year, 'date.getUTCFullYear()-1900', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'date.getUTCDay()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_gmtoff, '0', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_isdst, '0', 'i32') }}};
var start = new Date(date); // define date using UTC, start from Jan 01 00:00:00 UTC
start.setUTCDate(1);
start.setUTCMonth(0);
@@ -5424,8 +5457,8 @@ LibraryManager.library = {
start.setUTCSeconds(0);
start.setUTCMilliseconds(0);
var yday = Math.floor((date.getTime() - start.getTime()) / (1000 * 60 * 60 * 24));
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_zone, '___tm_timezone', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_zone, '___tm_timezone', 'i32') }}};
return tmPtr;
},
@@ -5448,23 +5481,23 @@ LibraryManager.library = {
localtime_r: function(time, tmPtr) {
_tzset();
var date = new Date({{{ makeGetValue('time', 0, 'i32') }}}*1000);
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_sec, 'date.getSeconds()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_min, 'date.getMinutes()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_hour, 'date.getHours()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mday, 'date.getDate()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mon, 'date.getMonth()', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_year, 'date.getFullYear()-1900', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'date.getDay()', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_sec, 'date.getSeconds()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_min, 'date.getMinutes()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_hour, 'date.getHours()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mday, 'date.getDate()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_mon, 'date.getMonth()', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_year, 'date.getFullYear()-1900', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_wday, 'date.getDay()', 'i32') }}};
var start = new Date(date.getFullYear(), 0, 1);
var yday = Math.floor((date.getTime() - start.getTime()) / (1000 * 60 * 60 * 24));
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}}
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_gmtoff, 'start.getTimezoneOffset() * 60', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_yday, 'yday', 'i32') }}};
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_gmtoff, 'start.getTimezoneOffset() * 60', 'i32') }}};
var dst = Number(start.getTimezoneOffset() != date.getTimezoneOffset());
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_isdst, 'dst', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_isdst, 'dst', 'i32') }}};
- {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_zone, '___tm_timezone', 'i32') }}}
+ {{{ makeSetValue('tmPtr', C_STRUCTS.tm.tm_zone, '___tm_timezone', 'i32') }}};
return tmPtr;
},
@@ -5482,9 +5515,9 @@ LibraryManager.library = {
var timePart = formatted.match(/\d{2}:\d{2}:\d{2}/)[0];
formatted = datePart + timePart + ' ' + date.getFullYear() + '\n';
formatted.split('').forEach(function(chr, index) {
- {{{ makeSetValue('buf', 'index', 'chr.charCodeAt(0)', 'i8') }}}
+ {{{ makeSetValue('buf', 'index', 'chr.charCodeAt(0)', 'i8') }}};
});
- {{{ makeSetValue('buf', '25', '0', 'i8') }}}
+ {{{ makeSetValue('buf', '25', '0', 'i8') }}};
return buf;
},
@@ -5514,18 +5547,18 @@ LibraryManager.library = {
if (_tzset.called) return;
_tzset.called = true;
- {{{ makeSetValue(makeGlobalUse('_timezone'), '0', '-(new Date()).getTimezoneOffset() * 60', 'i32') }}}
+ {{{ makeSetValue(makeGlobalUse('_timezone'), '0', '-(new Date()).getTimezoneOffset() * 60', 'i32') }}};
var winter = new Date(2000, 0, 1);
var summer = new Date(2000, 6, 1);
- {{{ makeSetValue(makeGlobalUse('_daylight'), '0', 'Number(winter.getTimezoneOffset() != summer.getTimezoneOffset())', 'i32') }}}
+ {{{ makeSetValue(makeGlobalUse('_daylight'), '0', 'Number(winter.getTimezoneOffset() != summer.getTimezoneOffset())', 'i32') }}};
var winterName = 'GMT'; // XXX do not rely on browser timezone info, it is very unpredictable | winter.toString().match(/\(([A-Z]+)\)/)[1];
var summerName = 'GMT'; // XXX do not rely on browser timezone info, it is very unpredictable | summer.toString().match(/\(([A-Z]+)\)/)[1];
var winterNamePtr = allocate(intArrayFromString(winterName), 'i8', ALLOC_NORMAL);
var summerNamePtr = allocate(intArrayFromString(summerName), 'i8', ALLOC_NORMAL);
- {{{ makeSetValue(makeGlobalUse('_tzname'), '0', 'winterNamePtr', 'i32') }}}
- {{{ makeSetValue(makeGlobalUse('_tzname'), Runtime.QUANTUM_SIZE, 'summerNamePtr', 'i32') }}}
+ {{{ makeSetValue(makeGlobalUse('_tzname'), '0', 'winterNamePtr', 'i32') }}};
+ {{{ makeSetValue(makeGlobalUse('_tzname'), Runtime.QUANTUM_SIZE, 'summerNamePtr', 'i32') }}};
},
stime__deps: ['$ERRNO_CODES', '__setErrNo'],
@@ -5870,7 +5903,10 @@ LibraryManager.library = {
writeArrayToMemory(bytes, s);
return bytes.length-1;
},
- strftime_l: 'strftime', // no locale support yet
+ strftime_l__deps: ['strftime'],
+ strftime_l: function(s, maxsize, format, tm) {
+ return _strftime(s, maxsize, format, tm); // no locale support yet
+ },
strptime__deps: ['_isLeapYear', '_arraySum', '_addDays', '_MONTH_DAYS_REGULAR', '_MONTH_DAYS_LEAP'],
strptime: function(buf, format, tm) {
@@ -6095,15 +6131,15 @@ LibraryManager.library = {
*/
var fullDate = new Date(date.year, date.month, date.day, date.hour, date.min, date.sec, 0);
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_sec, 'fullDate.getSeconds()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_min, 'fullDate.getMinutes()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_hour, 'fullDate.getHours()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_mday, 'fullDate.getDate()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_mon, 'fullDate.getMonth()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_year, 'fullDate.getFullYear()-1900', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_wday, 'fullDate.getDay()', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_yday, '__arraySum(__isLeapYear(fullDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, fullDate.getMonth()-1)+fullDate.getDate()-1', 'i32') }}}
- {{{ makeSetValue('tm', C_STRUCTS.tm.tm_isdst, '0', 'i32') }}}
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_sec, 'fullDate.getSeconds()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_min, 'fullDate.getMinutes()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_hour, 'fullDate.getHours()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_mday, 'fullDate.getDate()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_mon, 'fullDate.getMonth()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_year, 'fullDate.getFullYear()-1900', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_wday, 'fullDate.getDay()', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_yday, '__arraySum(__isLeapYear(fullDate.getFullYear()) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, fullDate.getMonth()-1)+fullDate.getDate()-1', 'i32') }}};
+ {{{ makeSetValue('tm', C_STRUCTS.tm.tm_isdst, '0', 'i32') }}};
// we need to convert the matched sequence into an integer array to take care of UTF-8 characters > 0x7F
// TODO: not sure that intArrayFromString handles all unicode characters correctly
@@ -6112,7 +6148,10 @@ LibraryManager.library = {
return 0;
},
- strptime_l: 'strptime', // no locale support yet
+ strptime_l__deps: ['strptime'],
+ strptime_l: function(buf, format, tm) {
+ return _strptime(buf, format, tm); // no locale support yet
+ },
getdate: function(string) {
// struct tm *getdate(const char *string);
@@ -6134,8 +6173,8 @@ LibraryManager.library = {
var seconds = {{{ makeGetValue('rqtp', C_STRUCTS.timespec.tv_sec, 'i32') }}};
var nanoseconds = {{{ makeGetValue('rqtp', C_STRUCTS.timespec.tv_nsec, 'i32') }}};
if (rmtp !== 0) {
- {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_sec, '0', 'i32') }}}
- {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_nsec, '0', 'i32') }}}
+ {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_sec, '0', 'i32') }}};
+ {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_nsec, '0', 'i32') }}};
}
return _usleep((seconds * 1e6) + (nanoseconds / 1000));
},
@@ -6166,7 +6205,7 @@ LibraryManager.library = {
} else {
nsec = _emscripten_get_now_res();
}
- {{{ makeSetValue('res', C_STRUCTS.timespec.tv_sec, '1', 'i32') }}}
+ {{{ makeSetValue('res', C_STRUCTS.timespec.tv_sec, '1', 'i32') }}};
{{{ makeSetValue('res', C_STRUCTS.timespec.tv_nsec, 'nsec', 'i32') }}} // resolution is milliseconds
return 0;
},
@@ -6250,9 +6289,6 @@ LibraryManager.library = {
label = label|0;
table = table|0;
var i = 0;
-#if ASSERTIONS
- if ((label|0) == 0) abort(121);
-#endif
setjmpId = (setjmpId+1)|0;
{{{ makeSetValueAsm('env', '0', 'setjmpId', 'i32') }}};
while ((i|0) < {{{ 2*MAX_SETJMPS }}}) {
@@ -6310,6 +6346,10 @@ LibraryManager.library = {
throw { longjmp: true, id: {{{ makeGetValue('env', '0', 'i32') }}}, value: value || 1 };
#endif
},
+ emscripten_longjmp__deps: ['longjmp'],
+ emscripten_longjmp: function(env, value) {
+ _longjmp(env, value);
+ },
// ==========================================================================
// signal.h
@@ -6408,7 +6448,19 @@ LibraryManager.library = {
// var indexes = Runtime.calculateStructAlignment({ fields: ['i32', 'i32'] });
var me = _localeconv;
if (!me.ret) {
- me.ret = allocate([allocate(intArrayFromString('.'), 'i8', ALLOC_NORMAL)], 'i8*', ALLOC_NORMAL); // just decimal point, for now
+ // These are defaults from the "C" locale
+ me.ret = allocate([
+ allocate(intArrayFromString('.'), 'i8', ALLOC_NORMAL),0,0,0, // decimal_point
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // thousands_sep
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // grouping
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // int_curr_symbol
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // currency_symbol
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // mon_decimal_point
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // mon_thousands_sep
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // mon_grouping
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0, // positive_sign
+ allocate(intArrayFromString(''), 'i8', ALLOC_NORMAL),0,0,0 // negative_sign
+ ], 'i8*', ALLOC_NORMAL); // Allocate strings in lconv, still don't allocate chars
}
return me.ret;
},
@@ -6419,6 +6471,7 @@ LibraryManager.library = {
// langinfo.h
// ==========================================================================
+ nl_langinfo__deps: ['malloc'],
nl_langinfo: function(item) {
// char *nl_langinfo(nl_item item);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/nl_langinfo.html
@@ -6847,7 +6900,7 @@ LibraryManager.library = {
__setErrNo__postset: '___errno_state = Runtime.staticAlloc(4); {{{ makeSetValue("___errno_state", 0, 0, "i32") }}};',
__setErrNo: function(value) {
// For convenient setting and returning of errno.
- {{{ makeSetValue('___errno_state', '0', 'value', 'i32') }}}
+ {{{ makeSetValue('___errno_state', '0', 'value', 'i32') }}};
return value;
},
__errno_location__deps: ['__setErrNo'],
@@ -6871,15 +6924,14 @@ LibraryManager.library = {
// int setrlimit(int resource, const struct rlimit *rlp)
return 0;
},
- __01getrlimit64_: 'getrlimit',
// TODO: Implement for real. We just do time used, and no useful data
getrusage: function(resource, rlp) {
// int getrusage(int resource, struct rusage *rlp);
- {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_utime.tv_sec, '1', 'i32') }}}
- {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_utime.tv_usec, '2', 'i32') }}}
- {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_stime.tv_sec, '3', 'i32') }}}
- {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_stime.tv_usec, '4', 'i32') }}}
+ {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_utime.tv_sec, '1', 'i32') }}};
+ {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_utime.tv_usec, '2', 'i32') }}};
+ {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_stime.tv_sec, '3', 'i32') }}};
+ {{{ makeSetValue('rlp', C_STRUCTS.rusage.ru_stime.tv_usec, '4', 'i32') }}};
return 0;
},
@@ -6943,8 +6995,8 @@ LibraryManager.library = {
void **restrict stackaddr, size_t *restrict stacksize); */
/*FIXME: assumes that there is only one thread, and that attr is the
current thread*/
- {{{ makeSetValue('stackaddr', '0', 'STACK_BASE', 'i8*') }}}
- {{{ makeSetValue('stacksize', '0', 'TOTAL_STACK', 'i32') }}}
+ {{{ makeSetValue('stackaddr', '0', 'STACK_BASE', 'i8*') }}};
+ {{{ makeSetValue('stacksize', '0', 'TOTAL_STACK', 'i32') }}};
return 0;
},
@@ -6962,7 +7014,7 @@ LibraryManager.library = {
if (key == 0) {
return ERRNO_CODES.EINVAL;
}
- {{{ makeSetValue('key', '0', 'PTHREAD_SPECIFIC_NEXT_KEY', 'i32*') }}}
+ {{{ makeSetValue('key', '0', 'PTHREAD_SPECIFIC_NEXT_KEY', 'i32*') }}};
// values start at 0
PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY] = 0;
PTHREAD_SPECIFIC_NEXT_KEY++;
@@ -7020,7 +7072,7 @@ LibraryManager.library = {
posix_memalign__deps: ['memalign'],
posix_memalign: function(memptr, alignment, size) {
var ptr = _memalign(alignment, size);
- {{{ makeSetValue('memptr', '0', 'ptr', 'i8*') }}}
+ {{{ makeSetValue('memptr', '0', 'ptr', 'i8*') }}};
return 0;
},
@@ -7046,7 +7098,7 @@ LibraryManager.library = {
}
return addr;
},
- inet_ntoa__deps: ['_inet_ntop4_raw'],
+ inet_ntoa__deps: ['_inet_ntop4_raw', 'malloc'],
inet_ntoa: function(in_addr) {
if (!_inet_ntoa.buffer) {
_inet_ntoa.buffer = _malloc(1024);
@@ -7062,7 +7114,7 @@ LibraryManager.library = {
if (addr === null) {
return 0;
}
- {{{ makeSetValue('inp', '0', 'addr', 'i32') }}}
+ {{{ makeSetValue('inp', '0', 'addr', 'i32') }}};
return 1;
},
@@ -7221,7 +7273,7 @@ LibraryManager.library = {
if (ret === null) {
return 0;
}
- {{{ makeSetValue('dst', '0', 'ret', 'i32') }}}
+ {{{ makeSetValue('dst', '0', 'ret', 'i32') }}};
return 1;
},
_inet_pton6_raw__deps: ['htons'],
@@ -7325,25 +7377,21 @@ LibraryManager.library = {
// netinet/in.h
// ==========================================================================
- _in6addr_any:
+ in6addr_any:
'allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], "i8", ALLOC_STATIC)',
- _in6addr_loopback:
+ in6addr_loopback:
'allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
- _in6addr_linklocal_allnodes:
- 'allocate([255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
- _in6addr_linklocal_allrouters:
- 'allocate([255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
- _in6addr_interfacelocal_allnodes:
- 'allocate([255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1], "i8", ALLOC_STATIC)',
- _in6addr_interfacelocal_allrouters:
- 'allocate([255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
- _in6addr_sitelocal_allrouters:
- 'allocate([255,5,0,0,0,0,0,0,0,0,0,0,0,0,0,2], "i8", ALLOC_STATIC)',
// ==========================================================================
// netdb.h
// ==========================================================================
+ __h_errno_state: 'allocate(1, "i32", ALLOC_STATIC)',
+ __h_errno_location__deps: ['__h_errno_state'],
+ __h_errno_location: function() {
+ return ___h_errno_state;
+ },
+
// We can't actually resolve hostnames in the browser, so instead
// we're generating fake IP addresses with lookup_name that we can
// resolve later on with lookup_addr.
@@ -7399,6 +7447,7 @@ LibraryManager.library = {
gethostbyaddr: function (addr, addrlen, type) {
if (type !== {{{ cDefine('AF_INET') }}}) {
___setErrNo(ERRNO_CODES.EAFNOSUPPORT);
+ // TODO: set h_errno
return null;
}
addr = {{{ makeGetValue('addr', '0', 'i32') }}}; // addr is in_addr
@@ -7411,7 +7460,7 @@ LibraryManager.library = {
return _gethostbyname(hostp);
},
- gethostbyname__deps: ['$DNS', '_inet_pton4_raw'],
+ gethostbyname__deps: ['$DNS', '_inet_pton4_raw', 'malloc'],
gethostbyname: function(name) {
name = Pointer_stringify(name);
@@ -7419,18 +7468,18 @@ LibraryManager.library = {
var ret = _malloc({{{ C_STRUCTS.hostent.__size__ }}}); // XXX possibly leaked, as are others here
var nameBuf = _malloc(name.length+1);
writeStringToMemory(name, nameBuf);
- {{{ makeSetValue('ret', C_STRUCTS.hostent.h_name, 'nameBuf', 'i8*') }}}
+ {{{ makeSetValue('ret', C_STRUCTS.hostent.h_name, 'nameBuf', 'i8*') }}};
var aliasesBuf = _malloc(4);
- {{{ makeSetValue('aliasesBuf', '0', '0', 'i8*') }}}
- {{{ makeSetValue('ret', C_STRUCTS.hostent.h_aliases, 'aliasesBuf', 'i8**') }}}
+ {{{ makeSetValue('aliasesBuf', '0', '0', 'i8*') }}};
+ {{{ makeSetValue('ret', C_STRUCTS.hostent.h_aliases, 'aliasesBuf', 'i8**') }}};
var afinet = {{{ cDefine('AF_INET') }}};
- {{{ makeSetValue('ret', C_STRUCTS.hostent.h_addrtype, 'afinet', 'i32') }}}
- {{{ makeSetValue('ret', C_STRUCTS.hostent.h_length, '4', 'i32') }}}
+ {{{ makeSetValue('ret', C_STRUCTS.hostent.h_addrtype, 'afinet', 'i32') }}};
+ {{{ makeSetValue('ret', C_STRUCTS.hostent.h_length, '4', 'i32') }}};
var addrListBuf = _malloc(12);
- {{{ makeSetValue('addrListBuf', '0', 'addrListBuf+8', 'i32*') }}}
- {{{ makeSetValue('addrListBuf', '4', '0', 'i32*') }}}
- {{{ makeSetValue('addrListBuf', '8', '__inet_pton4_raw(DNS.lookup_name(name))', 'i32') }}}
- {{{ makeSetValue('ret', C_STRUCTS.hostent.h_addr_list, 'addrListBuf', 'i8**') }}}
+ {{{ makeSetValue('addrListBuf', '0', 'addrListBuf+8', 'i32*') }}};
+ {{{ makeSetValue('addrListBuf', '4', '0', 'i32*') }}};
+ {{{ makeSetValue('addrListBuf', '8', '__inet_pton4_raw(DNS.lookup_name(name))', 'i32') }}};
+ {{{ makeSetValue('ret', C_STRUCTS.hostent.h_addr_list, 'addrListBuf', 'i8**') }}};
return ret;
},
@@ -7444,7 +7493,7 @@ LibraryManager.library = {
return 0;
},
- getaddrinfo__deps: ['$Sockets', '$DNS', '_inet_pton4_raw', '_inet_ntop4_raw', '_inet_pton6_raw', '_inet_ntop6_raw', '_write_sockaddr', 'htonl'],
+ getaddrinfo__deps: ['$Sockets', '$DNS', '_inet_pton4_raw', '_inet_ntop4_raw', '_inet_pton6_raw', '_inet_ntop6_raw', '_write_sockaddr', 'htonl', 'malloc'],
getaddrinfo: function(node, service, hint, out) {
// Note getaddrinfo currently only returns a single addrinfo with ai_next defaulting to NULL. When NULL
// hints are specified or ai_family set to AF_UNSPEC or ai_socktype or ai_protocol set to 0 then we
@@ -7486,6 +7535,7 @@ LibraryManager.library = {
} else {
{{{ makeSetValue('ai', C_STRUCTS.addrinfo.ai_addrlen, C_STRUCTS.sockaddr_in.__size__, 'i32') }}};
}
+ {{{ makeSetValue('ai', C_STRUCTS.addrinfo.ai_next, '0', 'i32') }}};
return ai;
}
@@ -7606,7 +7656,7 @@ LibraryManager.library = {
node = DNS.lookup_name(node);
addr = __inet_pton4_raw(node);
if (family === {{{ cDefine('AF_UNSPEC') }}}) {
- family = {{{ cDefine('AF_INET') }}}
+ family = {{{ cDefine('AF_INET') }}};
} else if (family === {{{ cDefine('AF_INET6') }}}) {
addr = [0, 0, _htonl(0xffff), addr];
}
@@ -7660,7 +7710,7 @@ LibraryManager.library = {
// are actually negative numbers and you can't have expressions as keys in JavaScript literals.
$GAI_ERRNO_MESSAGES: {},
- gai_strerror__deps: ['$GAI_ERRNO_MESSAGES'],
+ gai_strerror__deps: ['$GAI_ERRNO_MESSAGES', 'malloc'],
gai_strerror: function(val) {
var buflen = 256;
@@ -7702,7 +7752,7 @@ LibraryManager.library = {
list: [],
map: {}
},
- setprotoent__deps: ['$Protocols'],
+ setprotoent__deps: ['$Protocols', 'malloc'],
setprotoent: function(stayopen) {
// void setprotoent(int stayopen);
@@ -8365,7 +8415,7 @@ LibraryManager.library = {
}
},
- getsockname__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_write_sockaddr', '_inet_pton_raw'],
+ getsockname__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_write_sockaddr'],
getsockname: function (fd, addr, addrlen) {
var sock = SOCKFS.getSocket(fd);
if (!sock) {
@@ -8383,7 +8433,7 @@ LibraryManager.library = {
}
},
- getpeername__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_write_sockaddr', '_inet_pton_raw'],
+ getpeername__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_write_sockaddr'],
getpeername: function (fd, addr, addrlen) {
var sock = SOCKFS.getSocket(fd);
if (!sock) {
@@ -8533,7 +8583,7 @@ LibraryManager.library = {
}
},
- recvmsg__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_inet_pton_raw', '_write_sockaddr'],
+ recvmsg__deps: ['$FS', '$SOCKFS', '$DNS', '$ERRNO_CODES', '__setErrNo', '_write_sockaddr'],
recvmsg: function(fd, message, flags) {
var sock = SOCKFS.getSocket(fd);
if (!sock) {
@@ -8612,6 +8662,8 @@ LibraryManager.library = {
return 0;
},
+ mkport: function() { throw 'TODO' },
+
// ==========================================================================
// select.h
// ==========================================================================
@@ -8892,7 +8944,8 @@ LibraryManager.library = {
// Process all lines:
lines = callstack.split('\n');
callstack = '';
- var firefoxRe = new RegExp('\\s*(.*?)@(.*):(.*)'); // Extract components of form ' Object._main@http://server.com:4324'
+ var newFirefoxRe = new RegExp('\\s*(.*?)@(.*?):([0-9]+):([0-9]+)'); // New FF30 with column info: extract components of form ' Object._main@http://server.com:4324:12'
+ var firefoxRe = new RegExp('\\s*(.*?)@(.*):(.*)(:(.*))?'); // Old FF without column info: extract components of form ' Object._main@http://server.com:4324'
var chromeRe = new RegExp('\\s*at (.*?) \\\((.*):(.*):(.*)\\\)'); // Extract components of form ' at Object._main (http://server.com/file.html:4324:12)'
for(l in lines) {
@@ -8910,12 +8963,13 @@ LibraryManager.library = {
lineno = parts[3];
column = parts[4];
} else {
- parts = firefoxRe.exec(line);
- if (parts && parts.length == 4) {
+ parts = newFirefoxRe.exec(line);
+ if (!parts) parts = firefoxRe.exec(line);
+ if (parts && parts.length >= 4) {
jsSymbolName = parts[1];
file = parts[2];
lineno = parts[3];
- column = 0; // Firefox doesn't carry column information. See https://bugzilla.mozilla.org/show_bug.cgi?id=762556
+ column = parts[4]|0; // Old Firefox doesn't carry column information, but in new FF30, it is present. See https://bugzilla.mozilla.org/show_bug.cgi?id=762556
} else {
// Was not able to extract this line for demangling/sourcemapping purposes. Output it as-is.
callstack += line + '\n';
@@ -8971,7 +9025,7 @@ LibraryManager.library = {
}
// Truncate output to avoid writing past bounds.
if (callstack.length > maxbytes-1) {
- callstack.slice(0, maxbytes-1);
+ callstack = callstack.slice(0, maxbytes-1);
}
// Output callstack string as C string to HEAP.
writeStringToMemory(callstack, str, false);
@@ -9017,6 +9071,49 @@ LibraryManager.library = {
_emscripten_log_js(flags, str);
},
+ emscripten_get_compiler_setting: function(name) {
+ name = Pointer_stringify(name);
+
+ var ret = Runtime.getCompilerSetting(name);
+ if (typeof ret === 'number') return ret;
+
+ if (!_emscripten_get_compiler_setting.cache) _emscripten_get_compiler_setting.cache = {};
+ var cache = _emscripten_get_compiler_setting.cache;
+ var fullname = name + '__str';
+ var fullret = cache[fullname];
+ if (fullret) return fullret;
+ return cache[fullname] = allocate(intArrayFromString(ret + ''), 'i8', ALLOC_NORMAL);
+ },
+
+#if ASM_JS
+#if ALLOW_MEMORY_GROWTH
+ emscripten_replace_memory__asm: true, // this is used inside the asm module
+ emscripten_replace_memory__sig: 'viiiiiiii', // bogus
+ emscripten_replace_memory: function(_HEAP8, _HEAP16, _HEAP32, _HEAPU8, _HEAPU16, _HEAPU32, _HEAPF32, _HEAPF64) {
+ _HEAP8 = _HEAP8; // fake asm coercions
+ _HEAP16 = _HEAP16;
+ _HEAP32 = _HEAP32;
+ _HEAPU8 = _HEAPU8;
+ _HEAPU16 = _HEAPU16;
+ _HEAPU32 = _HEAPU32;
+ _HEAPF32 = _HEAPF32;
+ _HEAPF64 = _HEAPF64;
+ HEAP8 = _HEAP8; // replace the memory views
+ HEAP16 = _HEAP16;
+ HEAP32 = _HEAP32;
+ HEAPU8 = _HEAPU8;
+ HEAPU16 = _HEAPU16;
+ HEAPU32 = _HEAPU32;
+ HEAPF32 = _HEAPF32;
+ HEAPF64 = _HEAPF64;
+ },
+ // this function is inside the asm block, but prevents validation as asm.js
+ // the codebase still benefits from being in the general asm.js shape,
+ // but should not declare itself as validating (which is prevented in ASM_JS == 2).
+ {{{ (assert(ASM_JS === 2), DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push('emscripten_replace_memory'), '') }}}
+#endif
+#endif
+
//============================
// emscripten vector ops
//============================
@@ -9176,6 +9273,30 @@ LibraryManager.library = {
// misc shims for musl
__lockfile: function() { return 1 },
__unlockfile: function(){},
+
+ // misc definitions to avoid unnecessary unresolved symbols from fastcomp
+ emscripten_prep_setjmp: true,
+ emscripten_check_longjmp: true,
+ emscripten_get_longjmp_result: true,
+ emscripten_setjmp: true,
+ emscripten_preinvoke: true,
+ emscripten_postinvoke: true,
+ emscripten_resume: true,
+ emscripten_landingpad: true,
+ getHigh32: true,
+ setHigh32: true,
+ FtoILow: true,
+ FtoIHigh: true,
+ DtoILow: true,
+ DtoIHigh: true,
+ BDtoILow: true,
+ BDtoIHigh: true,
+ SItoF: true,
+ UItoF: true,
+ SItoD: true,
+ UItoD: true,
+ BItoD: true,
+ llvm_dbg_value: true,
};
function autoAddDeps(object, name) {
@@ -9188,7 +9309,7 @@ function autoAddDeps(object, name) {
}
// Add aborting stubs for various libc stuff needed by libc++
-['pthread_cond_signal', 'pthread_equal', 'pthread_join', 'pthread_detach', 'catgets', 'catopen', 'catclose'].forEach(function(aborter) {
+['pthread_cond_signal', 'pthread_equal', 'pthread_join', 'pthread_detach'].forEach(function(aborter) {
LibraryManager.library[aborter] = function aborting_stub() { throw 'TODO: ' + aborter };
});
diff --git a/src/library_browser.js b/src/library_browser.js
index 9261a2cf..03da394e 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -12,6 +12,7 @@ mergeInto(LibraryManager.library, {
$Browser: {
mainLoop: {
scheduler: null,
+ method: '',
shouldPause: false,
paused: false,
queue: [],
@@ -195,24 +196,33 @@ mergeInto(LibraryManager.library, {
// Canvas event setup
var canvas = Module['canvas'];
+
+ // forced aspect ratio can be enabled by defining 'forcedAspectRatio' on Module
+ // Module['forcedAspectRatio'] = 4 / 3;
+
canvas.requestPointerLock = canvas['requestPointerLock'] ||
canvas['mozRequestPointerLock'] ||
- canvas['webkitRequestPointerLock'];
+ canvas['webkitRequestPointerLock'] ||
+ canvas['msRequestPointerLock'] ||
+ function(){};
canvas.exitPointerLock = document['exitPointerLock'] ||
document['mozExitPointerLock'] ||
document['webkitExitPointerLock'] ||
+ document['msExitPointerLock'] ||
function(){}; // no-op if function does not exist
canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
function pointerLockChange() {
Browser.pointerLock = document['pointerLockElement'] === canvas ||
document['mozPointerLockElement'] === canvas ||
- document['webkitPointerLockElement'] === canvas;
+ document['webkitPointerLockElement'] === canvas ||
+ document['msPointerLockElement'] === canvas;
}
document.addEventListener('pointerlockchange', pointerLockChange, false);
document.addEventListener('mozpointerlockchange', pointerLockChange, false);
document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
+ document.addEventListener('mspointerlockchange', pointerLockChange, false);
if (Module['elementPointerLock']) {
canvas.addEventListener("click", function(ev) {
@@ -232,6 +242,10 @@ mergeInto(LibraryManager.library, {
}
#endif
var ctx;
+ var errorInfo = '?';
+ function onContextCreationError(event) {
+ errorInfo = event.statusMessage || errorInfo;
+ }
try {
if (useWebGL) {
var contextAttributes = {
@@ -249,10 +263,6 @@ mergeInto(LibraryManager.library, {
contextAttributes.preserveDrawingBuffer = true;
#endif
- var errorInfo = '?';
- function onContextCreationError(event) {
- errorInfo = event.statusMessage || errorInfo;
- }
canvas.addEventListener('webglcontextcreationerror', onContextCreationError, false);
try {
['experimental-webgl', 'webgl'].some(function(webglId) {
@@ -338,22 +348,35 @@ mergeInto(LibraryManager.library, {
if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
var canvas = Module['canvas'];
+ var canvasContainer = canvas.parentNode;
function fullScreenChange() {
Browser.isFullScreen = false;
if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
- document['fullScreenElement'] || document['fullscreenElement']) === canvas) {
+ document['fullScreenElement'] || document['fullscreenElement'] ||
+ document['msFullScreenElement'] || document['msFullscreenElement'] ||
+ document['webkitCurrentFullScreenElement']) === canvasContainer) {
canvas.cancelFullScreen = document['cancelFullScreen'] ||
document['mozCancelFullScreen'] ||
- document['webkitCancelFullScreen'];
+ document['webkitCancelFullScreen'] ||
+ document['msExitFullscreen'] ||
+ document['exitFullscreen'] ||
+ function() {};
canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);
if (Browser.lockPointer) canvas.requestPointerLock();
Browser.isFullScreen = true;
if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();
- } else if (Browser.resizeCanvas){
- Browser.setWindowedCanvasSize();
+ } else {
+
+ // remove the full screen specific parent of the canvas again to restore the HTML structure from before going full screen
+ var canvasContainer = canvas.parentNode;
+ canvasContainer.parentNode.insertBefore(canvas, canvasContainer);
+ canvasContainer.parentNode.removeChild(canvasContainer);
+
+ if (Browser.resizeCanvas) Browser.setWindowedCanvasSize();
}
if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);
+ Browser.updateCanvasDimensions(canvas);
}
if (!Browser.fullScreenHandlersInstalled) {
@@ -361,12 +384,20 @@ mergeInto(LibraryManager.library, {
document.addEventListener('fullscreenchange', fullScreenChange, false);
document.addEventListener('mozfullscreenchange', fullScreenChange, false);
document.addEventListener('webkitfullscreenchange', fullScreenChange, false);
+ document.addEventListener('MSFullscreenChange', fullScreenChange, false);
}
- canvas.requestFullScreen = canvas['requestFullScreen'] ||
- canvas['mozRequestFullScreen'] ||
- (canvas['webkitRequestFullScreen'] ? function() { canvas['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
- canvas.requestFullScreen();
+ // create a new parent to ensure the canvas has no siblings. this allows browsers to optimize full screen performance when its parent is the full screen root
+ var canvasContainer = document.createElement("div");
+ canvas.parentNode.insertBefore(canvasContainer, canvas);
+ canvasContainer.appendChild(canvas);
+
+ // use parent of canvas as full screen root to allow aspect ratio correction (Firefox stretches the root to screen size)
+ canvasContainer.requestFullScreen = canvasContainer['requestFullScreen'] ||
+ canvasContainer['mozRequestFullScreen'] ||
+ canvasContainer['msRequestFullscreen'] ||
+ (canvasContainer['webkitRequestFullScreen'] ? function() { canvasContainer['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
+ canvasContainer.requestFullScreen();
},
requestAnimationFrame: function requestAnimationFrame(func) {
@@ -444,6 +475,10 @@ mergeInto(LibraryManager.library, {
0;
},
+ getMouseWheelDelta: function(event) {
+ return Math.max(-1, Math.min(1, event.type === 'DOMMouseScroll' ? event.detail : -event.wheelDelta));
+ },
+
mouseX: 0,
mouseY: 0,
mouseMovementX: 0,
@@ -559,19 +594,13 @@ mergeInto(LibraryManager.library, {
setCanvasSize: function(width, height, noUpdates) {
var canvas = Module['canvas'];
- canvas.width = width;
- canvas.height = height;
+ Browser.updateCanvasDimensions(canvas, width, height);
if (!noUpdates) Browser.updateResizeListeners();
},
windowedWidth: 0,
windowedHeight: 0,
setFullScreenCanvasSize: function() {
- var canvas = Module['canvas'];
- this.windowedWidth = canvas.width;
- this.windowedHeight = canvas.height;
- canvas.width = screen.width;
- canvas.height = screen.height;
// check if SDL is available
if (typeof SDL != "undefined") {
var flags = {{{ makeGetValue('SDL.screen+Runtime.QUANTUM_SIZE*0', '0', 'i32', 0, 1) }}};
@@ -582,9 +611,6 @@ mergeInto(LibraryManager.library, {
},
setWindowedCanvasSize: function() {
- var canvas = Module['canvas'];
- canvas.width = this.windowedWidth;
- canvas.height = this.windowedHeight;
// check if SDL is available
if (typeof SDL != "undefined") {
var flags = {{{ makeGetValue('SDL.screen+Runtime.QUANTUM_SIZE*0', '0', 'i32', 0, 1) }}};
@@ -592,8 +618,55 @@ mergeInto(LibraryManager.library, {
{{{ makeSetValue('SDL.screen+Runtime.QUANTUM_SIZE*0', '0', 'flags', 'i32') }}}
}
Browser.updateResizeListeners();
- }
+ },
+ updateCanvasDimensions : function(canvas, wNative, hNative) {
+ if (wNative && hNative) {
+ canvas.widthNative = wNative;
+ canvas.heightNative = hNative;
+ } else {
+ wNative = canvas.widthNative;
+ hNative = canvas.heightNative;
+ }
+ var w = wNative;
+ var h = hNative;
+ if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
+ if (w/h < Module['forcedAspectRatio']) {
+ w = Math.round(h * Module['forcedAspectRatio']);
+ } else {
+ h = Math.round(w / Module['forcedAspectRatio']);
+ }
+ }
+ if (((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
+ document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
+ document['fullScreenElement'] || document['fullscreenElement'] ||
+ document['msFullScreenElement'] || document['msFullscreenElement'] ||
+ document['webkitCurrentFullScreenElement']) === canvas.parentNode) && (typeof screen != 'undefined')) {
+ var factor = Math.min(screen.width / w, screen.height / h);
+ w = Math.round(w * factor);
+ h = Math.round(h * factor);
+ }
+ if (Browser.resizeCanvas) {
+ if (canvas.width != w) canvas.width = w;
+ if (canvas.height != h) canvas.height = h;
+ if (typeof canvas.style != 'undefined') {
+ canvas.style.removeProperty( "width");
+ canvas.style.removeProperty("height");
+ }
+ } else {
+ if (canvas.width != wNative) canvas.width = wNative;
+ if (canvas.height != hNative) canvas.height = hNative;
+ if (typeof canvas.style != 'undefined') {
+ if (w != wNative || h != hNative) {
+ canvas.style.setProperty( "width", w + "px", "important");
+ canvas.style.setProperty("height", h + "px", "important");
+ } else {
+ canvas.style.removeProperty( "width");
+ canvas.style.removeProperty("height");
+ }
+ }
+ }
+ }
},
emscripten_async_wget: function(url, file, onload, onerror) {
@@ -673,6 +746,8 @@ mergeInto(LibraryManager.library, {
},
emscripten_async_prepare: function(file, onload, onerror) {
+ Module['noExitRuntime'] = true;
+
var _file = Pointer_stringify(file);
var data = FS.analyzePath(_file);
if (!data.exists) return -1;
@@ -692,6 +767,8 @@ mergeInto(LibraryManager.library, {
},
emscripten_async_prepare_data: function(data, size, suffix, arg, onload, onerror) {
+ Module['noExitRuntime'] = true;
+
var _suffix = Pointer_stringify(suffix);
if (!Browser.asyncPrepareDataCounter) Browser.asyncPrepareDataCounter = 0;
var name = 'prepare_data_' + (Browser.asyncPrepareDataCounter++) + '.' + _suffix;
@@ -742,7 +819,7 @@ mergeInto(LibraryManager.library, {
document.body.appendChild(script);
},
- emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop) {
+ emscripten_set_main_loop: function(func, fps, simulateInfiniteLoop, arg) {
Module['noExitRuntime'] = true;
Browser.mainLoop.runner = function Browser_mainLoop_runner() {
@@ -783,12 +860,21 @@ mergeInto(LibraryManager.library, {
GL.newRenderingFrameStarted();
#endif
+ if (Browser.mainLoop.method === 'timeout' && Module.ctx) {
+ Module.printErr('Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!');
+ Browser.mainLoop.method = ''; // just warn once per call to set main loop
+ }
+
if (Module['preMainLoop']) {
Module['preMainLoop']();
}
try {
- Runtime.dynCall('v', func);
+ if (typeof arg !== 'undefined') {
+ Runtime.dynCall('vi', func, [arg]);
+ } else {
+ Runtime.dynCall('v', func);
+ }
} catch (e) {
if (e instanceof ExitStatus) {
return;
@@ -813,11 +899,13 @@ mergeInto(LibraryManager.library, {
if (fps && fps > 0) {
Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler() {
setTimeout(Browser.mainLoop.runner, 1000/fps); // doing this each time means that on exception, we stop
- }
+ };
+ Browser.mainLoop.method = 'timeout';
} else {
Browser.mainLoop.scheduler = function Browser_mainLoop_scheduler() {
Browser.requestAnimationFrame(Browser.mainLoop.runner);
- }
+ };
+ Browser.mainLoop.method = 'rAF';
}
Browser.mainLoop.scheduler();
@@ -826,6 +914,11 @@ mergeInto(LibraryManager.library, {
}
},
+ emscripten_set_main_loop_arg__deps: ['emscripten_set_main_loop'],
+ emscripten_set_main_loop_arg: function(func, arg, fps, simulateInfiniteLoop) {
+ _emscripten_set_main_loop(func, fps, simulateInfiniteLoop, arg);
+ },
+
emscripten_cancel_main_loop: function() {
Browser.mainLoop.scheduler = null;
Browser.mainLoop.shouldPause = true;
@@ -948,6 +1041,8 @@ mergeInto(LibraryManager.library, {
},
emscripten_call_worker: function(id, funcName, data, size, callback, arg) {
+ Module['noExitRuntime'] = true; // should we only do this if there is a callback?
+
funcName = Pointer_stringify(funcName);
var info = Browser.workers[id];
var callbackId = -1;
diff --git a/src/library_egl.js b/src/library_egl.js
index 11cf8951..e2d1df43 100644
--- a/src/library_egl.js
+++ b/src/library_egl.js
@@ -550,12 +550,26 @@ var LibraryEGL = {
// EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
eglSwapBuffers: function() {
- EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
+ if (!EGL.defaultDisplayInitialized) {
+ EGL.setErrorCode(0x3001 /* EGL_NOT_INITIALIZED */);
+ } else if (!Module.ctx) {
+ EGL.setErrorCode(0x3002 /* EGL_BAD_ACCESS */);
+ } else if (Module.ctx.isContextLost()) {
+ EGL.setErrorCode(0x300E /* EGL_CONTEXT_LOST */);
+ } else {
+ // According to documentation this does an implicit flush.
+ // Due to discussion at https://github.com/kripken/emscripten/pull/1871
+ // the flush was removed since this _may_ result in slowing code down.
+ //_glFlush();
+ EGL.setErrorCode(0x3000 /* EGL_SUCCESS */);
+ return 1; // EGL_TRUE
+ }
+ return 0; // EGL_FALSE
},
eglGetProcAddress__deps: ['emscripten_GetProcAddress'],
eglGetProcAddress: function(name_) {
- return _emscripten_GetProcAddress(Pointer_stringify(name_));
+ return _emscripten_GetProcAddress(name_);
},
};
diff --git a/src/library_fs.js b/src/library_fs.js
index e6b060f6..1428f041 100644
--- a/src/library_fs.js
+++ b/src/library_fs.js
@@ -16,7 +16,7 @@ mergeInto(LibraryManager.library, {
root: null,
mounts: [],
devices: [null],
- streams: [null],
+ streams: [],
nextInode: 1,
nameTable: null,
currentPath: '/',
@@ -40,7 +40,17 @@ mergeInto(LibraryManager.library, {
//
lookupPath: function(path, opts) {
path = PATH.resolve(FS.cwd(), path);
- opts = opts || { recurse_count: 0 };
+ opts = opts || {};
+
+ var defaults = {
+ follow_mount: true,
+ recurse_count: 0
+ };
+ for (var key in defaults) {
+ if (opts[key] === undefined) {
+ opts[key] = defaults[key];
+ }
+ }
if (opts.recurse_count > 8) { // max recursive lookup of 8
throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
@@ -67,10 +77,11 @@ mergeInto(LibraryManager.library, {
// jump to the mount's root node if this is a mountpoint
if (FS.isMountpoint(current)) {
- current = current.mount.root;
+ if (!islast || (islast && opts.follow_mount)) {
+ current = current.mounted.root;
+ }
}
- // follow symlinks
// by default, lookupPath will not follow a symlink if it is the final path component.
// setting opts.follow = true will override this behavior.
if (!islast || opts.follow) {
@@ -163,28 +174,26 @@ mergeInto(LibraryManager.library, {
createNode: function(parent, name, mode, rdev) {
if (!FS.FSNode) {
FS.FSNode = function(parent, name, mode, rdev) {
+ if (!parent) {
+ parent = this; // root node sets parent to itself
+ }
+ this.parent = parent;
+ this.mount = parent.mount;
+ this.mounted = null;
this.id = FS.nextInode++;
this.name = name;
this.mode = mode;
this.node_ops = {};
this.stream_ops = {};
this.rdev = rdev;
- this.parent = null;
- this.mount = null;
- if (!parent) {
- parent = this; // root node sets parent to itself
- }
- this.parent = parent;
- this.mount = parent.mount;
- FS.hashAddNode(this);
};
+ FS.FSNode.prototype = {};
+
// compatibility
var readMode = {{{ cDefine('S_IRUGO') }}} | {{{ cDefine('S_IXUGO') }}};
var writeMode = {{{ cDefine('S_IWUGO') }}};
- FS.FSNode.prototype = {};
-
// NOTE we must use Object.defineProperties instead of individual calls to
// Object.defineProperty in order to make closure compiler happy
Object.defineProperties(FS.FSNode.prototype, {
@@ -204,7 +213,12 @@ mergeInto(LibraryManager.library, {
},
});
}
- return new FS.FSNode(parent, name, mode, rdev);
+
+ var node = new FS.FSNode(parent, name, mode, rdev);
+
+ FS.hashAddNode(node);
+
+ return node;
},
destroyNode: function(node) {
FS.hashRemoveNode(node);
@@ -213,7 +227,7 @@ mergeInto(LibraryManager.library, {
return node === node.parent;
},
isMountpoint: function(node) {
- return node.mounted;
+ return !!node.mounted;
},
isFile: function(mode) {
return (mode & {{{ cDefine('S_IFMT') }}}) === {{{ cDefine('S_IFREG') }}};
@@ -344,7 +358,7 @@ mergeInto(LibraryManager.library, {
//
MAX_OPEN_FDS: 4096,
nextfd: function(fd_start, fd_end) {
- fd_start = fd_start || 1;
+ fd_start = fd_start || 0;
fd_end = fd_end || FS.MAX_OPEN_FDS;
for (var fd = fd_start; fd <= fd_end; fd++) {
if (!FS.streams[fd]) {
@@ -400,6 +414,22 @@ mergeInto(LibraryManager.library, {
},
//
+ // file pointers
+ //
+ // instead of maintaining a separate mapping from FILE* to file descriptors,
+ // we employ a simple trick: the pointer to a stream is its fd plus 1. This
+ // means that all valid streams have a valid non-zero pointer while allowing
+ // the fs for stdin to be the standard value of zero.
+ //
+ //
+ getStreamFromPtr: function(ptr) {
+ return FS.streams[ptr - 1];
+ },
+ getPtrForStream: function(stream) {
+ return stream ? stream.fd + 1 : 0;
+ },
+
+ //
// devices
//
// each character device consists of a device id + stream operations.
@@ -441,61 +471,131 @@ mergeInto(LibraryManager.library, {
//
// core
//
+ getMounts: function(mount) {
+ var mounts = [];
+ var check = [mount];
+
+ while (check.length) {
+ var m = check.pop();
+
+ mounts.push(m);
+
+ check.push.apply(check, m.mounts);
+ }
+
+ return mounts;
+ },
syncfs: function(populate, callback) {
if (typeof(populate) === 'function') {
callback = populate;
populate = false;
}
+ var mounts = FS.getMounts(FS.root.mount);
var completed = 0;
- var total = FS.mounts.length;
+
function done(err) {
if (err) {
- return callback(err);
+ if (!done.errored) {
+ done.errored = true;
+ return callback(err);
+ }
+ return;
}
- if (++completed >= total) {
+ if (++completed >= mounts.length) {
callback(null);
}
};
// sync all mounts
- for (var i = 0; i < FS.mounts.length; i++) {
- var mount = FS.mounts[i];
+ mounts.forEach(function (mount) {
if (!mount.type.syncfs) {
- done(null);
- continue;
+ return done(null);
}
mount.type.syncfs(mount, populate, done);
- }
+ });
},
mount: function(type, opts, mountpoint) {
- var lookup;
- if (mountpoint) {
- lookup = FS.lookupPath(mountpoint, { follow: false });
+ var root = mountpoint === '/';
+ var pseudo = !mountpoint;
+ var node;
+
+ if (root && FS.root) {
+ throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
+ } else if (!root && !pseudo) {
+ var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
+
mountpoint = lookup.path; // use the absolute path
+ node = lookup.node;
+
+ if (FS.isMountpoint(node)) {
+ throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
+ }
+
+ if (!FS.isDir(node.mode)) {
+ throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
+ }
}
+
var mount = {
type: type,
opts: opts,
mountpoint: mountpoint,
- root: null
+ mounts: []
};
+
// create a root node for the fs
- var root = type.mount(mount);
- root.mount = mount;
- mount.root = root;
- // assign the mount info to the mountpoint's node
- if (lookup) {
- lookup.node.mount = mount;
- lookup.node.mounted = true;
- // compatibility update FS.root if we mount to /
- if (mountpoint === '/') {
- FS.root = mount.root;
+ var mountRoot = type.mount(mount);
+ mountRoot.mount = mount;
+ mount.root = mountRoot;
+
+ if (root) {
+ FS.root = mountRoot;
+ } else if (node) {
+ // set as a mountpoint
+ node.mounted = mount;
+
+ // add the new mount to the current mount's children
+ if (node.mount) {
+ node.mount.mounts.push(mount);
}
}
- // add to our cached list of mounts
- FS.mounts.push(mount);
- return root;
+
+ return mountRoot;
+ },
+ unmount: function (mountpoint) {
+ var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
+
+ if (!FS.isMountpoint(lookup.node)) {
+ throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
+ }
+
+ // destroy the nodes for this mount, and all its child mounts
+ var node = lookup.node;
+ var mount = node.mounted;
+ var mounts = FS.getMounts(mount);
+
+ Object.keys(FS.nameTable).forEach(function (hash) {
+ var current = FS.nameTable[hash];
+
+ while (current) {
+ var next = current.name_next;
+
+ if (mounts.indexOf(current.mount) !== -1) {
+ FS.destroyNode(current);
+ }
+
+ current = next;
+ }
+ });
+
+ // no longer a mountpoint
+ node.mounted = null;
+
+ // remove this mount from the child mounts
+ var idx = node.mount.mounts.indexOf(mount);
+ assert(idx !== -1);
+ node.mount.mounts.splice(idx, 1);
},
lookup: function(parent, name) {
return parent.node_ops.lookup(parent, name);
@@ -516,13 +616,13 @@ mergeInto(LibraryManager.library, {
},
// helpers to create specific types of nodes
create: function(path, mode) {
- mode = mode !== undefined ? mode : 0666;
+ mode = mode !== undefined ? mode : 438 /* 0666 */;
mode &= {{{ cDefine('S_IALLUGO') }}};
mode |= {{{ cDefine('S_IFREG') }}};
return FS.mknod(path, mode, 0);
},
mkdir: function(path, mode) {
- mode = mode !== undefined ? mode : 0777;
+ mode = mode !== undefined ? mode : 511 /* 0777 */;
mode &= {{{ cDefine('S_IRWXUGO') }}} | {{{ cDefine('S_ISVTX') }}};
mode |= {{{ cDefine('S_IFDIR') }}};
return FS.mknod(path, mode, 0);
@@ -530,7 +630,7 @@ mergeInto(LibraryManager.library, {
mkdev: function(path, mode, dev) {
if (typeof(dev) === 'undefined') {
dev = mode;
- mode = 0666;
+ mode = 438 /* 0666 */;
}
mode |= {{{ cDefine('S_IFCHR') }}};
return FS.mknod(path, mode, dev);
@@ -677,7 +777,7 @@ mergeInto(LibraryManager.library, {
FS.destroyNode(node);
},
readlink: function(path) {
- var lookup = FS.lookupPath(path, { follow: false });
+ var lookup = FS.lookupPath(path);
var link = lookup.node;
if (!link.node_ops.readlink) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
@@ -795,7 +895,7 @@ mergeInto(LibraryManager.library, {
},
open: function(path, flags, mode, fd_start, fd_end) {
flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
- mode = typeof mode === 'undefined' ? 0666 : mode;
+ mode = typeof mode === 'undefined' ? 438 /* 0666 */ : mode;
if ((flags & {{{ cDefine('O_CREAT') }}})) {
mode = (mode & {{{ cDefine('S_IALLUGO') }}}) | {{{ cDefine('S_IFREG') }}};
} else {
@@ -975,6 +1075,9 @@ mergeInto(LibraryManager.library, {
opts = opts || {};
opts.flags = opts.flags || 'r';
opts.encoding = opts.encoding || 'binary';
+ if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
+ throw new Error('Invalid encoding type "' + opts.encoding + '"');
+ }
var ret;
var stream = FS.open(path, opts.flags);
var stat = FS.stat(path);
@@ -989,8 +1092,6 @@ mergeInto(LibraryManager.library, {
}
} else if (opts.encoding === 'binary') {
ret = buf;
- } else {
- throw new Error('Invalid encoding type "' + opts.encoding + '"');
}
FS.close(stream);
return ret;
@@ -999,15 +1100,16 @@ mergeInto(LibraryManager.library, {
opts = opts || {};
opts.flags = opts.flags || 'w';
opts.encoding = opts.encoding || 'utf8';
+ if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') {
+ throw new Error('Invalid encoding type "' + opts.encoding + '"');
+ }
var stream = FS.open(path, opts.flags, opts.mode);
if (opts.encoding === 'utf8') {
var utf8 = new Runtime.UTF8Processor();
var buf = new Uint8Array(utf8.processJSString(data));
- FS.write(stream, buf, 0, buf.length, 0);
+ FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);
} else if (opts.encoding === 'binary') {
- FS.write(stream, data, 0, data.length, 0);
- } else {
- throw new Error('Invalid encoding type "' + opts.encoding + '"');
+ FS.write(stream, data, 0, data.length, 0, opts.canOwn);
}
FS.close(stream);
},
@@ -1080,16 +1182,16 @@ mergeInto(LibraryManager.library, {
// open default streams for the stdin, stdout and stderr devices
var stdin = FS.open('/dev/stdin', 'r');
- {{{ makeSetValue(makeGlobalUse('_stdin'), 0, 'stdin.fd', 'void*') }}};
- assert(stdin.fd === 1, 'invalid handle for stdin (' + stdin.fd + ')');
+ {{{ makeSetValue(makeGlobalUse('_stdin'), 0, 'FS.getPtrForStream(stdin)', 'void*') }}};
+ assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')');
var stdout = FS.open('/dev/stdout', 'w');
- {{{ makeSetValue(makeGlobalUse('_stdout'), 0, 'stdout.fd', 'void*') }}};
- assert(stdout.fd === 2, 'invalid handle for stdout (' + stdout.fd + ')');
+ {{{ makeSetValue(makeGlobalUse('_stdout'), 0, 'FS.getPtrForStream(stdout)', 'void*') }}};
+ assert(stdout.fd === 1, 'invalid handle for stdout (' + stdout.fd + ')');
var stderr = FS.open('/dev/stderr', 'w');
- {{{ makeSetValue(makeGlobalUse('_stderr'), 0, 'stderr.fd', 'void*') }}};
- assert(stderr.fd === 3, 'invalid handle for stderr (' + stderr.fd + ')');
+ {{{ makeSetValue(makeGlobalUse('_stderr'), 0, 'FS.getPtrForStream(stderr)', 'void*') }}};
+ assert(stderr.fd === 2, 'invalid handle for stderr (' + stderr.fd + ')');
},
ensureErrnoError: function() {
if (FS.ErrnoError) return;
@@ -1119,7 +1221,6 @@ mergeInto(LibraryManager.library, {
FS.nameTable = new Array(4096);
- FS.root = FS.createNode(null, '/', {{{ cDefine('S_IFDIR') }}} | 0777, 0);
FS.mount(MEMFS, {}, '/');
FS.createDefaultDirectories();
diff --git a/src/library_gc.js b/src/library_gc.js
index b3dae0e9..d86f2d15 100644
--- a/src/library_gc.js
+++ b/src/library_gc.js
@@ -1,4 +1,6 @@
+// WARNING: this is deprecated. You should just build Boehm from source, it is much faster than the toy version written in emscripten
+
if (GC_SUPPORT) {
EXPORTED_FUNCTIONS['_calloc'] = 1;
EXPORTED_FUNCTIONS['_realloc'] = 1;
diff --git a/src/library_gl.js b/src/library_gl.js
index 61ca8957..d797cbb4 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -19,6 +19,7 @@ var LibraryGL = {
textures: [],
uniforms: [],
shaders: [],
+ vaos: [],
#if FULL_ES2
clientBuffers: [],
@@ -210,6 +211,7 @@ var LibraryGL = {
}
},
+#if LEGACY_GL_EMULATION
// Find a token in a shader source string
findToken: function(source, token) {
function isIdentChar(ch) {
@@ -238,6 +240,7 @@ var LibraryGL = {
} while (true);
return false;
},
+#endif
getSource: function(shader, count, string, length) {
var source = '';
@@ -255,6 +258,7 @@ var LibraryGL = {
}
source += frag;
}
+#if LEGACY_GL_EMULATION
// Let's see if we need to enable the standard derivatives extension
type = GLctx.getShaderParameter(GL.shaders[shader], 0x8B4F /* GL_SHADER_TYPE */);
if (type == 0x8B30 /* GL_FRAGMENT_SHADER */) {
@@ -270,6 +274,7 @@ var LibraryGL = {
#endif
}
}
+#endif
return source;
},
@@ -629,6 +634,9 @@ var LibraryGL = {
// Extension available from Firefox 26 and Google Chrome 30
GL.instancedArraysExt = GLctx.getExtension('ANGLE_instanced_arrays');
+
+ // Extension available from Firefox 25 and WebKit
+ GL.vaoExt = Module.ctx.getExtension('OES_vertex_array_object');
// These are the 'safe' feature-enabling extensions that don't add any performance impact related to e.g. debugging, and
// should be enabled by default so that client GLES2/GL code will not need to go through extra hoops to get its stuff working.
@@ -819,7 +827,7 @@ var LibraryGL = {
} else {
data = null;
}
- CLctx['compressedTexSubImage2D'](target, level, xoffset, yoffset, width, height, data);
+ GLctx['compressedTexSubImage2D'](target, level, xoffset, yoffset, width, height, format, data);
},
glTexImage2D__sig: 'viiiiiiiii',
@@ -879,12 +887,12 @@ var LibraryGL = {
glGetTexParameterfv__sig: 'viii',
glGetTexParameterfv: function(target, pname, params) {
- {{{ makeSetValue('params', '0', 'Module.getTexParameter(target, pname)', 'float') }}};
+ {{{ makeSetValue('params', '0', 'GLctx.getTexParameter(target, pname)', 'float') }}};
},
glGetTexParameteriv__sig: 'viii',
glGetTexParameteriv: function(target, pname, params) {
- {{{ makeSetValue('params', '0', 'Module.getTexParameter(target, pname)', 'i32') }}};
+ {{{ makeSetValue('params', '0', 'GLctx.getTexParameter(target, pname)', 'i32') }}};
},
glTexParameterfv__sig: 'viii',
@@ -957,7 +965,11 @@ var LibraryGL = {
usage = 0x88E8; // GL_DYNAMIC_DRAW
break;
}
- GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
+ if (!data) {
+ GLctx.bufferData(target, size, usage);
+ } else {
+ GLctx.bufferData(target, HEAPU8.subarray(data, data+size), usage);
+ }
},
glBufferSubData__sig: 'viiii',
@@ -1540,9 +1552,7 @@ var LibraryGL = {
#endif
var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
// Work around a bug in Chromium which causes getShaderInfoLog to return null
- if (!log) {
- log = "";
- }
+ if (!log) log = '(unknown error)';
log = log.substr(0, maxLength - 1);
writeStringToMemory(log, infoLog);
if (length) {
@@ -1556,7 +1566,10 @@ var LibraryGL = {
GL.validateGLObjectID(GL.shaders, shader, 'glGetShaderiv', 'shader');
#endif
if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH
- {{{ makeSetValue('p', '0', 'GLctx.getShaderInfoLog(GL.shaders[shader]).length + 1', 'i32') }}};
+ var log = GLctx.getShaderInfoLog(GL.shaders[shader]);
+ // Work around a bug in Chromium which causes getShaderInfoLog to return null
+ if (!log) log = '(unknown error)';
+ {{{ makeSetValue('p', '0', 'log.length + 1', 'i32') }}};
} else {
{{{ makeSetValue('p', '0', 'GLctx.getShaderParameter(GL.shaders[shader], pname)', 'i32') }}};
}
@@ -1788,6 +1801,81 @@ var LibraryGL = {
},
#if LEGACY_GL_EMULATION
+ glGenVertexArrays__deps: ['emulGlGenVertexArrays'],
+#endif
+ glGenVertexArrays__sig: 'vii',
+ glGenVertexArrays: function (n, arrays) {
+#if LEGACY_GL_EMULATION
+ _emulGlGenVertexArrays(n, arrays);
+#else
+#if GL_ASSERTIONS
+ assert(GL.vaoExt, 'Must have OES_vertex_array_object to use vao');
+#endif
+
+ for(var i = 0; i < n; i++) {
+ var id = GL.getNewId(GL.vaos);
+ var vao = GL.vaoExt.createVertexArrayOES();
+ vao.name = id;
+ GL.vaos[id] = vao;
+ {{{ makeSetValue('arrays', 'i*4', 'id', 'i32') }}};
+ }
+#endif
+ },
+
+#if LEGACY_GL_EMULATION
+ glDeleteVertexArrays__deps: ['emulGlDeleteVertexArrays'],
+#endif
+ glDeleteVertexArrays__sig: 'vii',
+ glDeleteVertexArrays: function(n, vaos) {
+#if LEGACY_GL_EMULATION
+ _emulGlDeleteVertexArrays(n, vaos);
+#else
+#if GL_ASSERTIONS
+ assert(GL.vaoExt, 'Must have OES_vertex_array_object to use vao');
+#endif
+ for(var i = 0; i < n; i++) {
+ var id = {{{ makeGetValue('vaos', 'i*4', 'i32') }}};
+ GL.vaoExt.deleteVertexArrayOES(GL.vaos[id]);
+ GL.vaos[id] = null;
+ }
+#endif
+ },
+
+#if LEGACY_GL_EMULATION
+ glBindVertexArray__deps: ['emulGlBindVertexArray'],
+#endif
+ glBindVertexArray__sig: 'vi',
+ glBindVertexArray: function(vao) {
+#if LEGACY_GL_EMULATION
+ _emulGlBindVertexArray(vao);
+#else
+#if GL_ASSERTIONS
+ assert(GL.vaoExt, 'Must have OES_vertex_array_object to use vao');
+#endif
+
+ GL.vaoExt.bindVertexArrayOES(GL.vaos[vao]);
+#endif
+ },
+
+#if LEGACY_GL_EMULATION
+ glIsVertexArray__deps: ['emulGlIsVertexArray'],
+#endif
+ glIsVertexArray__sig: 'ii',
+ glIsVertexArray: function(array) {
+#if LEGACY_GL_EMULATION
+ return _emulGlIsVertexArray(array);
+#else
+#if GL_ASSERTIONS
+ assert(GL.vaoExt, 'Must have OES_vertex_array_object to use vao');
+#endif
+
+ var vao = GL.vaos[array];
+ if (!vao) return 0;
+ return GL.vaoExt.isVertexArrayOES(vao);
+#endif
+ },
+
+#if LEGACY_GL_EMULATION
// GL emulation: provides misc. functionality not present in OpenGL ES 2.0 or WebGL
@@ -1845,7 +1933,7 @@ var LibraryGL = {
};
var glEnable = _glEnable;
- _glEnable = function _glEnable(cap) {
+ _glEnable = _emscripten_glEnable = function _glEnable(cap) {
// Clean up the renderer on any change to the rendering state. The optimization of
// skipping renderer setup is aimed at the case of multiple glDraw* right after each other
if (GLImmediate.lastRenderer) GLImmediate.lastRenderer.cleanup();
@@ -1870,7 +1958,7 @@ var LibraryGL = {
};
var glDisable = _glDisable;
- _glDisable = function _glDisable(cap) {
+ _glDisable = _emscripten_glDisable = function _glDisable(cap) {
if (GLImmediate.lastRenderer) GLImmediate.lastRenderer.cleanup();
if (cap == 0x0B60 /* GL_FOG */) {
if (GLEmulation.fogEnabled != false) {
@@ -1891,7 +1979,7 @@ var LibraryGL = {
}
glDisable(cap);
};
- _glIsEnabled = function _glIsEnabled(cap) {
+ _glIsEnabled = _emscripten_glIsEnabled = function _glIsEnabled(cap) {
if (cap == 0x0B60 /* GL_FOG */) {
return GLEmulation.fogEnabled ? 1 : 0;
} else if (!(cap in validCapabilities)) {
@@ -1901,7 +1989,7 @@ var LibraryGL = {
};
var glGetBooleanv = _glGetBooleanv;
- _glGetBooleanv = function _glGetBooleanv(pname, p) {
+ _glGetBooleanv = _emscripten_glGetBooleanv = function _glGetBooleanv(pname, p) {
var attrib = GLEmulation.getAttributeFromCapability(pname);
if (attrib !== null) {
var result = GLImmediate.enabledClientAttributes[attrib];
@@ -1912,7 +2000,7 @@ var LibraryGL = {
};
var glGetIntegerv = _glGetIntegerv;
- _glGetIntegerv = function _glGetIntegerv(pname, params) {
+ _glGetIntegerv = _emscripten_glGetIntegerv = function _glGetIntegerv(pname, params) {
switch (pname) {
case 0x84E2: pname = GLctx.MAX_TEXTURE_IMAGE_UNITS /* fake it */; break; // GL_MAX_TEXTURE_UNITS
case 0x8B4A: { // GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
@@ -1981,7 +2069,7 @@ var LibraryGL = {
};
var glGetString = _glGetString;
- _glGetString = function _glGetString(name_) {
+ _glGetString = _emscripten_glGetString = function _glGetString(name_) {
if (GL.stringCache[name_]) return GL.stringCache[name_];
switch(name_) {
case 0x1F03 /* GL_EXTENSIONS */: // Add various extensions that we can support
@@ -2005,7 +2093,7 @@ var LibraryGL = {
GL.shaderOriginalSources = {};
#endif
var glCreateShader = _glCreateShader;
- _glCreateShader = function _glCreateShader(shaderType) {
+ _glCreateShader = _emscripten_glCreateShader = function _glCreateShader(shaderType) {
var id = glCreateShader(shaderType);
GL.shaderInfos[id] = {
type: shaderType,
@@ -2022,7 +2110,7 @@ var LibraryGL = {
}
var glShaderSource = _glShaderSource;
- _glShaderSource = function _glShaderSource(shader, count, string, length) {
+ _glShaderSource = _emscripten_glShaderSource = function _glShaderSource(shader, count, string, length) {
var source = GL.getSource(shader, count, string, length);
#if GL_DEBUG
console.log("glShaderSource: Input: \n" + source);
@@ -2136,7 +2224,7 @@ var LibraryGL = {
};
var glCompileShader = _glCompileShader;
- _glCompileShader = function _glCompileShader(shader) {
+ _glCompileShader = _emscripten_glCompileShader = function _glCompileShader(shader) {
GLctx.compileShader(GL.shaders[shader]);
#if GL_DEBUG
if (!GLctx.getShaderParameter(GL.shaders[shader], GLctx.COMPILE_STATUS)) {
@@ -2151,14 +2239,14 @@ var LibraryGL = {
GL.programShaders = {};
var glAttachShader = _glAttachShader;
- _glAttachShader = function _glAttachShader(program, shader) {
+ _glAttachShader = _emscripten_glAttachShader = function _glAttachShader(program, shader) {
if (!GL.programShaders[program]) GL.programShaders[program] = [];
GL.programShaders[program].push(shader);
glAttachShader(program, shader);
};
var glDetachShader = _glDetachShader;
- _glDetachShader = function _glDetachShader(program, shader) {
+ _glDetachShader = _emscripten_glDetachShader = function _glDetachShader(program, shader) {
var programShader = GL.programShaders[program];
if (!programShader) {
Module.printErr('WARNING: _glDetachShader received invalid program: ' + program);
@@ -2170,7 +2258,7 @@ var LibraryGL = {
};
var glUseProgram = _glUseProgram;
- _glUseProgram = function _glUseProgram(program) {
+ _glUseProgram = _emscripten_glUseProgram = function _glUseProgram(program) {
#if GL_DEBUG
if (GL.debug) {
Module.printErr('[using program with shaders]');
@@ -2191,7 +2279,7 @@ var LibraryGL = {
}
var glDeleteProgram = _glDeleteProgram;
- _glDeleteProgram = function _glDeleteProgram(program) {
+ _glDeleteProgram = _emscripten_glDeleteProgram = function _glDeleteProgram(program) {
glDeleteProgram(program);
if (program == GL.currProgram) {
GLImmediate.currentRenderer = null; // This changes the FFP emulation shader program, need to recompute that.
@@ -2202,12 +2290,12 @@ var LibraryGL = {
// If attribute 0 was not bound, bind it to 0 for WebGL performance reasons. Track if 0 is free for that.
var zeroUsedPrograms = {};
var glBindAttribLocation = _glBindAttribLocation;
- _glBindAttribLocation = function _glBindAttribLocation(program, index, name) {
+ _glBindAttribLocation = _emscripten_glBindAttribLocation = function _glBindAttribLocation(program, index, name) {
if (index == 0) zeroUsedPrograms[program] = true;
glBindAttribLocation(program, index, name);
};
var glLinkProgram = _glLinkProgram;
- _glLinkProgram = function _glLinkProgram(program) {
+ _glLinkProgram = _emscripten_glLinkProgram = function _glLinkProgram(program) {
if (!(program in zeroUsedPrograms)) {
GLctx.bindAttribLocation(GL.programs[program], 0, 'a_position');
}
@@ -2215,7 +2303,7 @@ var LibraryGL = {
};
var glBindBuffer = _glBindBuffer;
- _glBindBuffer = function _glBindBuffer(target, buffer) {
+ _glBindBuffer = _emscripten_glBindBuffer = function _glBindBuffer(target, buffer) {
glBindBuffer(target, buffer);
if (target == GLctx.ARRAY_BUFFER) {
if (GLEmulation.currentVao) {
@@ -2230,7 +2318,7 @@ var LibraryGL = {
};
var glGetFloatv = _glGetFloatv;
- _glGetFloatv = function _glGetFloatv(pname, params) {
+ _glGetFloatv = _emscripten_glGetFloatv = function _glGetFloatv(pname, params) {
if (pname == 0x0BA6) { // GL_MODELVIEW_MATRIX
HEAPF32.set(GLImmediate.matrix[0/*m*/], params >> 2);
} else if (pname == 0x0BA7) { // GL_PROJECTION_MATRIX
@@ -2253,7 +2341,7 @@ var LibraryGL = {
};
var glHint = _glHint;
- _glHint = function _glHint(target, mode) {
+ _glHint = _emscripten_glHint = function _glHint(target, mode) {
if (target == 0x84EF) { // GL_TEXTURE_COMPRESSION_HINT
return;
}
@@ -2261,21 +2349,21 @@ var LibraryGL = {
};
var glEnableVertexAttribArray = _glEnableVertexAttribArray;
- _glEnableVertexAttribArray = function _glEnableVertexAttribArray(index) {
+ _glEnableVertexAttribArray = _emscripten_glEnableVertexAttribArray = function _glEnableVertexAttribArray(index) {
glEnableVertexAttribArray(index);
GLEmulation.enabledVertexAttribArrays[index] = 1;
if (GLEmulation.currentVao) GLEmulation.currentVao.enabledVertexAttribArrays[index] = 1;
};
var glDisableVertexAttribArray = _glDisableVertexAttribArray;
- _glDisableVertexAttribArray = function _glDisableVertexAttribArray(index) {
+ _glDisableVertexAttribArray = _emscripten_glDisableVertexAttribArray = function _glDisableVertexAttribArray(index) {
glDisableVertexAttribArray(index);
delete GLEmulation.enabledVertexAttribArrays[index];
if (GLEmulation.currentVao) delete GLEmulation.currentVao.enabledVertexAttribArrays[index];
};
var glVertexAttribPointer = _glVertexAttribPointer;
- _glVertexAttribPointer = function _glVertexAttribPointer(index, size, type, normalized, stride, pointer) {
+ _glVertexAttribPointer = _emscripten_glVertexAttribPointer = function _glVertexAttribPointer(index, size, type, normalized, stride, pointer) {
glVertexAttribPointer(index, size, type, normalized, stride, pointer);
if (GLEmulation.currentVao) { // TODO: avoid object creation here? likely not hot though
GLEmulation.currentVao.vertexAttribPointers[index] = [index, size, type, normalized, stride, pointer];
@@ -2307,6 +2395,7 @@ var LibraryGL = {
glGetShaderPrecisionFormat__sig: 'v',
glGetShaderPrecisionFormat: function() { throw 'glGetShaderPrecisionFormat: TODO' },
+ glDeleteObject__deps: ['glDeleteProgram', 'glDeleteShader'],
glDeleteObject__sig: 'vi',
glDeleteObject: function(id) {
if (GL.programs[id]) {
@@ -2317,8 +2406,10 @@ var LibraryGL = {
Module.printErr('WARNING: deleteObject received invalid id: ' + id);
}
},
+ glDeleteObjectARB: 'glDeleteObject',
glGetObjectParameteriv__sig: 'viii',
+ glGetObjectParameteriv__deps: ['glGetProgramiv', 'glGetShaderiv'],
glGetObjectParameteriv: function(id, type, result) {
if (GL.programs[id]) {
if (type == 0x8B84) { // GL_OBJECT_INFO_LOG_LENGTH_ARB
@@ -2339,7 +2430,9 @@ var LibraryGL = {
Module.printErr('WARNING: getObjectParameteriv received invalid id: ' + id);
}
},
+ glGetObjectParameterivARB: 'glGetObjectParameteriv',
+ glGetInfoLog__deps: ['glGetProgramInfoLog', 'glGetShaderInfoLog'],
glGetInfoLog__sig: 'viiii',
glGetInfoLog: function(id, maxLength, length, infoLog) {
if (GL.programs[id]) {
@@ -2350,6 +2443,7 @@ var LibraryGL = {
Module.printErr('WARNING: getObjectParameteriv received invalid id: ' + id);
}
},
+ glGetInfoLogARB: 'glGetInfoLog',
glBindProgram__sig: 'vii',
glBindProgram: function(type, id) {
@@ -2357,6 +2451,7 @@ var LibraryGL = {
assert(id == 0);
#endif
},
+ glBindProgramARB: 'glBindProgram',
glGetPointerv: function(name, p) {
var attribute;
@@ -2380,7 +2475,7 @@ var LibraryGL = {
// GL Immediate mode
// See comment in GLEmulation.init()
-#if FULL_ES2 == 0
+#if !FULL_ES2
$GLImmediate__postset: 'GLImmediate.setupFuncs(); Browser.moduleContextCreatedCallbacks.push(function() { GLImmediate.init() });',
#endif
$GLImmediate__deps: ['$Browser', '$GL', '$GLEmulation'],
@@ -2644,7 +2739,7 @@ var LibraryGL = {
return "float";
}
- return Abort_NoSupport("Unsupported combiner op: 0x" + op.toString(16));
+ return abort_noSupport("Unsupported combiner op: 0x" + op.toString(16));
}
function getCurTexUnit() {
@@ -2997,7 +3092,7 @@ var LibraryGL = {
}
}
- return Abort_NoSupport("Unsupported TexEnv mode: 0x" + this.mode.toString(16));
+ return abort_noSupport("Unsupported TexEnv mode: 0x" + this.mode.toString(16));
}
CTexEnv.prototype.genCombinerLines = function CTexEnv_getCombinerLines(isColor, outputVar,
@@ -3417,6 +3512,107 @@ var LibraryGL = {
Module.printErr('WARNING: Unhandled `pname` in call to `glTexEnvfv`.');
}
},
+
+ hook_getTexEnviv: function(target, pname, param) {
+ if (target != GL_TEXTURE_ENV)
+ return;
+
+ var env = getCurTexUnit().env;
+ switch (pname) {
+ case GL_TEXTURE_ENV_MODE:
+ {{{ makeSetValue('param', '0', 'env.mode', 'i32') }}};
+ return;
+
+ case GL_TEXTURE_ENV_COLOR:
+ {{{ makeSetValue('param', '0', 'Math.max(Math.min(env.envColor[0]*255, 255, -255))', 'i32') }}};
+ {{{ makeSetValue('param', '1', 'Math.max(Math.min(env.envColor[1]*255, 255, -255))', 'i32') }}};
+ {{{ makeSetValue('param', '2', 'Math.max(Math.min(env.envColor[2]*255, 255, -255))', 'i32') }}};
+ {{{ makeSetValue('param', '3', 'Math.max(Math.min(env.envColor[3]*255, 255, -255))', 'i32') }}};
+ return;
+
+ case GL_COMBINE_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorCombiner', 'i32') }}};
+ return;
+
+ case GL_COMBINE_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaCombiner', 'i32') }}};
+ return;
+
+ case GL_SRC0_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorSrc[0]', 'i32') }}};
+ return;
+
+ case GL_SRC1_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorSrc[1]', 'i32') }}};
+ return;
+
+ case GL_SRC2_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorSrc[2]', 'i32') }}};
+ return;
+
+ case GL_SRC0_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaSrc[0]', 'i32') }}};
+ return;
+
+ case GL_SRC1_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaSrc[1]', 'i32') }}};
+ return;
+
+ case GL_SRC2_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaSrc[2]', 'i32') }}};
+ return;
+
+ case GL_OPERAND0_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorOp[0]', 'i32') }}};
+ return;
+
+ case GL_OPERAND1_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorOp[1]', 'i32') }}};
+ return;
+
+ case GL_OPERAND2_RGB:
+ {{{ makeSetValue('param', '0', 'env.colorOp[2]', 'i32') }}};
+ return;
+
+ case GL_OPERAND0_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaOp[0]', 'i32') }}};
+ return;
+
+ case GL_OPERAND1_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaOp[1]', 'i32') }}};
+ return;
+
+ case GL_OPERAND2_ALPHA:
+ {{{ makeSetValue('param', '0', 'env.alphaOp[2]', 'i32') }}};
+ return;
+
+ case GL_RGB_SCALE:
+ {{{ makeSetValue('param', '0', 'env.colorScale', 'i32') }}};
+ return;
+
+ case GL_ALPHA_SCALE:
+ {{{ makeSetValue('param', '0', 'env.alphaScale', 'i32') }}};
+ return;
+
+ default:
+ Module.printErr('WARNING: Unhandled `pname` in call to `glGetTexEnvi`.');
+ }
+ },
+
+ hook_getTexEnvfv: function(target, pname, param) {
+ if (target != GL_TEXTURE_ENV)
+ return;
+
+ var env = getCurTexUnit().env;
+ switch (pname) {
+ case GL_TEXTURE_ENV_COLOR:
+ {{{ makeSetValue('param', '0', 'env.envColor[0]', 'float') }}};
+ {{{ makeSetValue('param', '4', 'env.envColor[1]', 'float') }}};
+ {{{ makeSetValue('param', '8', 'env.envColor[2]', 'float') }}};
+ {{{ makeSetValue('param', '12', 'env.envColor[3]', 'float') }}};
+ return;
+ }
+ }
};
},
@@ -3501,6 +3697,11 @@ var LibraryGL = {
GLImmediate.enabledClientAttributes[name] = true;
GLImmediate.setClientAttribute(name, size, type, 0, GLImmediate.rendererComponentPointer);
GLImmediate.rendererComponentPointer += size * GL.byteSizeByType[type - GL.byteSizeByTypeRoot];
+#if GL_FFP_ONLY
+ // We can enable the correct attribute stream index immediately here, since the same attribute in each shader
+ // will be bound to this same index.
+ GL.enableVertexAttribArray(name);
+#endif
} else {
GLImmediate.rendererComponents[name]++;
}
@@ -3733,7 +3934,8 @@ var LibraryGL = {
GLctx.bindAttribLocation(this.program, GLImmediate.VERTEX, 'a_position');
GLctx.bindAttribLocation(this.program, GLImmediate.COLOR, 'a_color');
GLctx.bindAttribLocation(this.program, GLImmediate.NORMAL, 'a_normal');
- for (var i = 0; i < GLImmediate.MAX_TEXTURES; i++) {
+ var maxVertexAttribs = GLctx.getParameter(GLctx.MAX_VERTEX_ATTRIBS);
+ for (var i = 0; i < GLImmediate.MAX_TEXTURES && GLImmediate.TEXTURE0 + i < maxVertexAttribs; i++) {
GLctx.bindAttribLocation(this.program, GLImmediate.TEXTURE0 + i, 'a_texCoord'+i);
GLctx.bindAttribLocation(this.program, GLImmediate.TEXTURE0 + i, aTexCoordPrefix+i);
}
@@ -3760,7 +3962,7 @@ var LibraryGL = {
this.texCoordLocations[i] = GLctx.getAttribLocation(this.program, aTexCoordPrefix + i);
}
}
-
+ this.colorLocation = GLctx.getAttribLocation(this.program, 'a_color');
if (!useCurrProgram) {
// Temporarily switch to the program so we can set our sampler uniforms early.
var prevBoundProg = GLctx.getParameter(GLctx.CURRENT_PROGRAM);
@@ -3772,6 +3974,9 @@ var LibraryGL = {
GLctx.uniform1i(texSamplerLoc, texUnitID);
}
}
+ // The default color attribute value is not the same as the default for all other attribute streams (0,0,0,1) but (1,1,1,1),
+ // so explicitly set it right at start.
+ GLctx.vertexAttrib4fv(this.colorLocation, [1,1,1,1]);
GLctx.useProgram(prevBoundProg);
}
@@ -3779,7 +3984,6 @@ var LibraryGL = {
for (var i = 0; i < GLImmediate.MAX_TEXTURES; i++) {
this.textureMatrixLocations[i] = GLctx.getUniformLocation(this.program, 'u_textureMatrix' + i);
}
- this.colorLocation = GLctx.getAttribLocation(this.program, 'a_color');
this.normalLocation = GLctx.getAttribLocation(this.program, 'a_normal');
this.modelViewLocation = GLctx.getUniformLocation(this.program, 'u_modelView');
@@ -3872,11 +4076,9 @@ var LibraryGL = {
#if GL_FFP_ONLY
if (!GL.currArrayBuffer) {
GLctx.vertexAttribPointer(GLImmediate.VERTEX, posAttr.size, posAttr.type, false, GLImmediate.stride, posAttr.offset);
- GL.enableVertexAttribArray(GLImmediate.VERTEX);
if (this.hasNormal) {
var normalAttr = clientAttributes[GLImmediate.NORMAL];
GLctx.vertexAttribPointer(GLImmediate.NORMAL, normalAttr.size, normalAttr.type, true, GLImmediate.stride, normalAttr.offset);
- GL.enableVertexAttribArray(GLImmediate.NORMAL);
}
}
#else
@@ -3899,11 +4101,9 @@ var LibraryGL = {
var texAttr = clientAttributes[attribLoc];
if (texAttr.size) {
GLctx.vertexAttribPointer(attribLoc, texAttr.size, texAttr.type, false, GLImmediate.stride, texAttr.offset);
- GL.enableVertexAttribArray(attribLoc);
} else {
// These two might be dangerous, but let's try them.
GLctx.vertexAttrib4f(attribLoc, 0, 0, 0, 1);
- GL.disableVertexAttribArray(attribLoc);
}
}
#else
@@ -3938,21 +4138,18 @@ var LibraryGL = {
#if GL_FFP_ONLY
if (!GL.currArrayBuffer) {
GLctx.vertexAttribPointer(GLImmediate.COLOR, colorAttr.size, colorAttr.type, true, GLImmediate.stride, colorAttr.offset);
- GL.enableVertexAttribArray(GLImmediate.COLOR);
}
#else
GLctx.vertexAttribPointer(this.colorLocation, colorAttr.size, colorAttr.type, true, GLImmediate.stride, colorAttr.offset);
GLctx.enableVertexAttribArray(this.colorLocation);
#endif
- } else if (this.hasColor) {
-#if GL_FFP_ONLY
- GL.disableVertexAttribArray(GLImmediate.COLOR);
- GLctx.vertexAttrib4fv(GLImmediate.COLOR, GLImmediate.clientColor);
-#else
+ }
+#if !GL_FFP_ONLY
+ else if (this.hasColor) {
GLctx.disableVertexAttribArray(this.colorLocation);
GLctx.vertexAttrib4fv(this.colorLocation, GLImmediate.clientColor);
-#endif
}
+#endif
if (this.hasFog) {
if (this.fogColorLocation) GLctx.uniform4fv(this.fogColorLocation, GLEmulation.fogColor);
if (this.fogEndLocation) GLctx.uniform1f(this.fogEndLocation, GLEmulation.fogEnd);
@@ -3979,6 +4176,7 @@ var LibraryGL = {
}
if (!GL.currProgram) {
GLctx.useProgram(null);
+ GLImmediate.fixedFunctionProgram = 0;
}
if (!GL.currArrayBuffer) {
GLctx.bindBuffer(GLctx.ARRAY_BUFFER, null);
@@ -4001,7 +4199,7 @@ var LibraryGL = {
// Replace some functions with immediate-mode aware versions. If there are no client
// attributes enabled, and we use webgl-friendly modes (no GL_QUADS), then no need
// for emulation
- _glDrawArrays = function _glDrawArrays(mode, first, count) {
+ _glDrawArrays = _emscripten_glDrawArrays = function _glDrawArrays(mode, first, count) {
if (GLImmediate.totalEnabledClientAttributes == 0 && mode <= 6) {
GLctx.drawArrays(mode, first, count);
return;
@@ -4017,7 +4215,7 @@ var LibraryGL = {
GLImmediate.mode = -1;
};
- _glDrawElements = function _glDrawElements(mode, count, type, indices, start, end) { // start, end are given if we come from glDrawRangeElements
+ _glDrawElements = _emscripten_glDrawElements = function _glDrawElements(mode, count, type, indices, start, end) { // start, end are given if we come from glDrawRangeElements
if (GLImmediate.totalEnabledClientAttributes == 0 && mode <= 6 && GL.currElementArrayBuffer) {
GLctx.drawElements(mode, count, type, indices);
return;
@@ -4057,43 +4255,51 @@ var LibraryGL = {
}
var glActiveTexture = _glActiveTexture;
- _glActiveTexture = function _glActiveTexture(texture) {
+ _glActiveTexture = _emscripten_glActiveTexture = function _glActiveTexture(texture) {
GLImmediate.TexEnvJIT.hook_activeTexture(texture);
glActiveTexture(texture);
};
var glEnable = _glEnable;
- _glEnable = function _glEnable(cap) {
+ _glEnable = _emscripten_glEnable = function _glEnable(cap) {
GLImmediate.TexEnvJIT.hook_enable(cap);
glEnable(cap);
};
var glDisable = _glDisable;
- _glDisable = function _glDisable(cap) {
+ _glDisable = _emscripten_glDisable = function _glDisable(cap) {
GLImmediate.TexEnvJIT.hook_disable(cap);
glDisable(cap);
};
var glTexEnvf = (typeof(_glTexEnvf) != 'undefined') ? _glTexEnvf : function(){};
- _glTexEnvf = function _glTexEnvf(target, pname, param) {
+ _glTexEnvf = _emscripten_glTexEnvf = function _glTexEnvf(target, pname, param) {
GLImmediate.TexEnvJIT.hook_texEnvf(target, pname, param);
// Don't call old func, since we are the implementor.
//glTexEnvf(target, pname, param);
};
var glTexEnvi = (typeof(_glTexEnvi) != 'undefined') ? _glTexEnvi : function(){};
- _glTexEnvi = function _glTexEnvi(target, pname, param) {
+ _glTexEnvi = _emscripten_glTexEnvi = function _glTexEnvi(target, pname, param) {
GLImmediate.TexEnvJIT.hook_texEnvi(target, pname, param);
// Don't call old func, since we are the implementor.
//glTexEnvi(target, pname, param);
};
var glTexEnvfv = (typeof(_glTexEnvfv) != 'undefined') ? _glTexEnvfv : function(){};
- _glTexEnvfv = function _glTexEnvfv(target, pname, param) {
+ _glTexEnvfv = _emscripten_glTexEnvfv = function _glTexEnvfv(target, pname, param) {
GLImmediate.TexEnvJIT.hook_texEnvfv(target, pname, param);
// Don't call old func, since we are the implementor.
//glTexEnvfv(target, pname, param);
};
+ _glGetTexEnviv = function _glGetTexEnviv(target, pname, param) {
+ GLImmediate.TexEnvJIT.hook_getTexEnviv(target, pname, param);
+ };
+
+ _glGetTexEnvfv = function _glGetTexEnvfv(target, pname, param) {
+ GLImmediate.TexEnvJIT.hook_getTexEnvfv(target, pname, param);
+ };
+
var glGetIntegerv = _glGetIntegerv;
- _glGetIntegerv = function _glGetIntegerv(pname, params) {
+ _glGetIntegerv = _emscripten_glGetIntegerv = function _glGetIntegerv(pname, params) {
switch (pname) {
case 0x8B8D: { // GL_CURRENT_PROGRAM
// Just query directly so we're working with WebGL objects.
@@ -4348,7 +4554,7 @@ var LibraryGL = {
GLctx.bindBuffer(GLctx.ELEMENT_ARRAY_BUFFER, GL.buffers[GL.currElementArrayBuffer] || null);
}
-#if GL_UNSAFE_OPTS == 0
+#if !GL_UNSAFE_OPTS
#if !GL_FFP_ONLY
renderer.cleanup();
#endif
@@ -4461,6 +4667,9 @@ var LibraryGL = {
GLImmediate.clientColor[1] = g;
GLImmediate.clientColor[2] = b;
GLImmediate.clientColor[3] = a;
+#if GL_FFP_ONLY
+ GLctx.vertexAttrib4fv(GLImmediate.COLOR, GLImmediate.clientColor);
+#endif
}
},
glColor4d: 'glColor4f',
@@ -4589,6 +4798,7 @@ var LibraryGL = {
// Additional non-GLES rendering calls
+ glDrawRangeElements__deps: ['glDrawElements'],
glDrawRangeElements__sig: 'viiiiii',
glDrawRangeElements: function(mode, start, end, count, type, indices) {
_glDrawElements(mode, count, type, indices, start, end);
@@ -4608,6 +4818,10 @@ var LibraryGL = {
GLImmediate.enabledClientAttributes[attrib] = true;
GLImmediate.totalEnabledClientAttributes++;
GLImmediate.currentRenderer = null; // Will need to change current renderer, since the set of active vertex pointers changed.
+#if GL_FFP_ONLY
+ // In GL_FFP_ONLY mode, attributes are bound to the same index in each FFP emulation shader, so we can immediately apply the change here.
+ GL.enableVertexAttribArray(attrib);
+#endif
if (GLEmulation.currentVao) GLEmulation.currentVao.enabledClientStates[cap] = 1;
GLImmediate.modifiedClientAttributes = true;
}
@@ -4624,6 +4838,10 @@ var LibraryGL = {
GLImmediate.enabledClientAttributes[attrib] = false;
GLImmediate.totalEnabledClientAttributes--;
GLImmediate.currentRenderer = null; // Will need to change current renderer, since the set of active vertex pointers changed.
+#if GL_FFP_ONLY
+ // In GL_FFP_ONLY mode, attributes are bound to the same index in each FFP emulation shader, so we can immediately apply the change here.
+ GL.disableVertexAttribArray(attrib);
+#endif
if (GLEmulation.currentVao) delete GLEmulation.currentVao.enabledClientStates[cap];
GLImmediate.modifiedClientAttributes = true;
}
@@ -4635,7 +4853,6 @@ var LibraryGL = {
#if GL_FFP_ONLY
if (GL.currArrayBuffer) {
GLctx.vertexAttribPointer(GLImmediate.VERTEX, size, type, false, stride, pointer);
- GL.enableVertexAttribArray(GLImmediate.VERTEX);
}
#endif
},
@@ -4645,7 +4862,6 @@ var LibraryGL = {
if (GL.currArrayBuffer) {
var loc = GLImmediate.TEXTURE0 + GLImmediate.clientActiveTexture;
GLctx.vertexAttribPointer(loc, size, type, false, stride, pointer);
- GL.enableVertexAttribArray(loc);
}
#endif
},
@@ -4654,7 +4870,6 @@ var LibraryGL = {
#if GL_FFP_ONLY
if (GL.currArrayBuffer) {
GLctx.vertexAttribPointer(GLImmediate.NORMAL, size, type, true, stride, pointer);
- GL.enableVertexAttribArray(GLImmediate.NORMAL);
}
#endif
},
@@ -4663,7 +4878,6 @@ var LibraryGL = {
#if GL_FFP_ONLY
if (GL.currArrayBuffer) {
GLctx.vertexAttribPointer(GLImmediate.COLOR, size, type, true, stride, pointer);
- GL.enableVertexAttribArray(GLImmediate.COLOR);
}
#endif
},
@@ -4674,9 +4888,9 @@ var LibraryGL = {
},
// Vertex array object (VAO) support. TODO: when the WebGL extension is popular, use that and remove this code and GL.vaos
- glGenVertexArrays__deps: ['$GLEmulation'],
- glGenVertexArrays__sig: 'vii',
- glGenVertexArrays: function(n, vaos) {
+ emulGlGenVertexArrays__deps: ['$GLEmulation'],
+ emulGlGenVertexArrays__sig: 'vii',
+ emulGlGenVertexArrays: function(n, vaos) {
for (var i = 0; i < n; i++) {
var id = GL.getNewId(GLEmulation.vaos);
GLEmulation.vaos[id] = {
@@ -4690,16 +4904,23 @@ var LibraryGL = {
{{{ makeSetValue('vaos', 'i*4', 'id', 'i32') }}};
}
},
- glDeleteVertexArrays__sig: 'vii',
- glDeleteVertexArrays: function(n, vaos) {
+ emulGlDeleteVertexArrays__sig: 'vii',
+ emulGlDeleteVertexArrays: function(n, vaos) {
for (var i = 0; i < n; i++) {
var id = {{{ makeGetValue('vaos', 'i*4', 'i32') }}};
GLEmulation.vaos[id] = null;
if (GLEmulation.currentVao && GLEmulation.currentVao.id == id) GLEmulation.currentVao = null;
}
},
- glBindVertexArray__sig: 'vi',
- glBindVertexArray: function(vao) {
+ emulGlIsVertexArray__sig: 'vi',
+ emulGlIsVertexArray: function(array) {
+ var vao = GLEmulation.vaos[array];
+ if (!vao) return 0;
+ return 1;
+ },
+ emulGlBindVertexArray__deps: ['glBindBuffer', 'glEnableVertexAttribArray', 'glVertexAttribPointer', 'glEnableClientState'],
+ emulGlBindVertexArray__sig: 'vi',
+ emulGlBindVertexArray: function(vao) {
// undo vao-related things, wipe the slate clean, both for vao of 0 or an actual vao
GLEmulation.currentVao = null; // make sure the commands we run here are not recorded
if (GLImmediate.lastRenderer) GLImmediate.lastRenderer.cleanup();
@@ -4877,6 +5098,9 @@ var LibraryGL = {
glTexEnvf: function() { Runtime.warnOnce('glTexEnvf: TODO') },
glTexEnvfv: function() { Runtime.warnOnce('glTexEnvfv: TODO') },
+ glGetTexEnviv: function(target, pname, param) { throw 'GL emulation not initialized!'; },
+ glGetTexEnvfv: function(target, pname, param) { throw 'GL emulation not initialized!'; },
+
glTexImage1D: function() { throw 'glTexImage1D: TODO' },
glTexCoord3f: function() { throw 'glTexCoord3f: TODO' },
glGetTexLevelParameteriv: function() { throw 'glGetTexLevelParameteriv: TODO' },
@@ -4895,49 +5119,23 @@ var LibraryGL = {
glCheckFramebufferStatusOES : 'glCheckFramebufferStatus',
glDeleteFramebuffersOES : 'glDeleteFramebuffers',
glDeleteRenderbuffersOES : 'glDeleteRenderbuffers',
- glGenVertexArraysOES: 'glGenVertexArrays',
- glDeleteVertexArraysOES: 'glDeleteVertexArrays',
- glBindVertexArrayOES: 'glBindVertexArray',
glFramebufferTexture2DOES: 'glFramebufferTexture2D',
#else // LEGACY_GL_EMULATION
- // Warn if code tries to use various emulation stuff, when emulation is disabled
- // (do not warn if INCLUDE_FULL_LIBRARY is one, because then likely the gl code will
- // not be called anyhow, leave only the runtime aborts)
- glVertexPointer__deps: [function() {
-#if INCLUDE_FULL_LIBRARY == 0
- warn('Legacy GL function (glVertexPointer) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.');
-#endif
- }],
- glVertexPointer: function(){ throw 'Legacy GL function (glVertexPointer) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
- glGenVertexArrays__deps: [function() {
-#if INCLUDE_FULL_LIBRARY == 0
- warn('Legacy GL function (glGenVertexArrays) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.');
-#endif
- }],
- glGenVertexArrays: function(){ throw 'Legacy GL function (glGenVertexArrays) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
- glMatrixMode__deps: [function() {
-#if INCLUDE_FULL_LIBRARY == 0
- warn('Legacy GL function (glMatrixMode) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.');
-#endif
- }],
- glMatrixMode: function(){ throw 'Legacy GL function (glMatrixMode) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
- glBegin__deps: [function() {
-#if INCLUDE_FULL_LIBRARY == 0
- warn('Legacy GL function (glBegin) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.');
-#endif
- }],
- glBegin: function(){ throw 'Legacy GL function (glBegin) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
- glLoadIdentity__deps: [function() {
-#if INCLUDE_FULL_LIBRARY == 0
- warn('Legacy GL function (glLoadIdentity) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.');
-#endif
- }],
- glLoadIdentity: function(){ throw 'Legacy GL function (glLoadIdentity) called. You need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
+ glVertexPointer: function(){ throw 'Legacy GL function (glVertexPointer) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
+ glMatrixMode: function(){ throw 'Legacy GL function (glMatrixMode) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
+ glBegin: function(){ throw 'Legacy GL function (glBegin) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
+ glLoadIdentity: function(){ throw 'Legacy GL function (glLoadIdentity) called. If you want legacy GL emulation, you need to compile with -s LEGACY_GL_EMULATION=1 to enable legacy GL emulation.'; },
#endif // LEGACY_GL_EMULATION
+ // Open GLES1.1 vao compatibility (Could work w/o -s LEGACY_GL_EMULATION=1)
+
+ glGenVertexArraysOES: 'glGenVertexArrays',
+ glDeleteVertexArraysOES: 'glDeleteVertexArrays',
+ glBindVertexArrayOES: 'glBindVertexArray',
+
// GLU
gluPerspective: function(fov, aspect, near, far) {
@@ -5245,53 +5443,37 @@ if (LEGACY_GL_EMULATION) {
DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.push('$GLEmulation');
}
-// GL proc address retrieval
-LibraryGL.emscripten_GetProcAddress__deps = [function() {
- // ProcAddress is used, so include everything in GL. This runs before we go to the $ProcAddressTable object,
- // and we fill its deps just in time, and create the lookup table
- var table = {};
- LibraryManager.library.emscripten_procAddressTable__deps = keys(LibraryGL).map(function(x) {
- if (x.substr(-6) == '__deps' || x.substr(-9) == '__postset' || x.substr(-5) == '__sig' || x.substr(-5) == '__asm' || x.substr(0, 2) != 'gl') return null;
- var original = x;
- if (('_' + x) in Functions.implementedFunctions) {
- // a user-implemented function aliases this one, but we still want it to be accessible by name, so rename it
- var y = x + '__procTable';
- LibraryManager.library[y] = LibraryManager.library[x];
- LibraryManager.library[y + '__deps'] = LibraryManager.library[x + '__deps'];
- LibraryManager.library[y + '__postset'] = LibraryManager.library[x + '__postset'];
- LibraryManager.library[y + '__sig'] = LibraryManager.library[x + '__sig'];//|| Functions.implementedFunctions['_' + x];
- LibraryManager.library[y + '__asm'] = LibraryManager.library[x + '__asm'];
- x = y;
- assert(!(y in Functions.implementedFunctions) && !Functions.unimplementedFunctions['_' + y]);
- }
- var longX = '_' + x;
- var sig = LibraryManager.library[x + '__sig'] || functionStubSigs[longX];
- if (sig) {
- table[original] = Functions.getIndex(longX, sig);
- if (!(longX in Functions.implementedFunctions)) Functions.unimplementedFunctions[longX] = sig;
- }
- return x;
- }).filter(function(x) { return x !== null });
- // convert table into function with switch, to not confuse closure compiler
- var tableImpl = 'switch(name) {\n';
- for (var x in table) tableImpl += 'case "' + x + '": return ' + table[x] + '; break;\n';
- tableImpl += '}\nreturn 0;';
- LibraryManager.library.emscripten_procAddressTable = new Function('name', tableImpl);
-}, 'emscripten_procAddressTable'];
-LibraryGL.emscripten_GetProcAddress = function _LibraryGL_emscripten_GetProcAddress(name) {
- name = name.replace('EXT', '').replace('ARB', '');
- switch(name) { // misc renamings
- case 'glCreateProgramObject': name = 'glCreateProgram'; break;
- case 'glUseProgramObject': name = 'glUseProgram'; break;
- case 'glCreateShaderObject': name = 'glCreateShader'; break;
- case 'glAttachObject': name = 'glAttachShader'; break;
- case 'glDetachObject': name = 'glDetachShader'; break;
- }
- var ret = _emscripten_procAddressTable(name);
- if (!ret) Module.printErr('WARNING: getProcAddress failed for ' + name);
- return ret;
+function copyLibEntry(a, b) {
+ LibraryGL[a] = LibraryGL[b];
+ LibraryGL[a + '__postset'] = LibraryGL[b + '__postset'];
+ LibraryGL[a + '__sig'] = LibraryGL[b + '__sig'];
+ LibraryGL[a + '__asm'] = LibraryGL[b + '__asm'];
+ LibraryGL[a + '__deps'] = LibraryGL[b + '__deps'].slice(0);
}
+// GL proc address retrieval - allow access through glX and emscripten_glX, to allow name collisions with user-implemented things having the same name (see gl.c)
+keys(LibraryGL).forEach(function(x) {
+ if (x.substr(-6) == '__deps' || x.substr(-9) == '__postset' || x.substr(-5) == '__sig' || x.substr(-5) == '__asm' || x.substr(0, 2) != 'gl') return;
+ while (typeof LibraryGL[x] === 'string') {
+ // resolve aliases right here, simpler for fastcomp
+ copyLibEntry(x, LibraryGL[x]);
+ }
+ var y = 'emscripten_' + x;
+ LibraryGL[x + '__deps'] = LibraryGL[x + '__deps'].map(function(dep) {
+ // prefix dependencies as well
+ if (typeof dep === 'string' && dep[0] == 'g' && dep[1] == 'l' && LibraryGL[dep]) {
+ var orig = dep;
+ dep = 'emscripten_' + dep;
+ var fixed = LibraryGL[x].toString().replace(new RegExp('_' + orig + '\\(', 'g'), '_' + dep + '(');
+ fixed = fixed.substr(0, 9) + '_' + y + fixed.substr(9);
+ LibraryGL[x] = eval('(function() { return ' + fixed + ' })()');
+ }
+ return dep;
+ });
+ // copy it
+ copyLibEntry(y, x);
+});
+
// Final merge
mergeInto(LibraryManager.library, LibraryGL);
diff --git a/src/library_glfw.js b/src/library_glfw.js
index 17e8956a..b54205ad 100644
--- a/src/library_glfw.js
+++ b/src/library_glfw.js
@@ -197,13 +197,7 @@ var LibraryGLFW = {
},
onMouseWheel: function(event) {
- if (event.detail > 0) {
- GLFW.wheelPos++;
- }
-
- if (event.detail < 0) {
- GLFW.wheelPos--;
- }
+ GLFW.wheelPos += Browser.getMouseWheelDelta(event);
if (GLFW.mouseWheelFunc && event.target == Module["canvas"]) {
Runtime.dynCall('vi', GLFW.mouseWheelFunc, [GLFW.wheelPos]);
diff --git a/src/library_glut.js b/src/library_glut.js
index 65ac10c4..167e5272 100644
--- a/src/library_glut.js
+++ b/src/library_glut.js
@@ -229,7 +229,7 @@ var LibraryGLUT = {
// cross-browser wheel delta
var e = window.event || event; // old IE support
- var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
+ var delta = -Browser.getMouseWheelDelta(event);
var button = 3; // wheel up
if (delta < 0) {
diff --git a/src/library_html5.js b/src/library_html5.js
new file mode 100644
index 00000000..b17a0d4d
--- /dev/null
+++ b/src/library_html5.js
@@ -0,0 +1,1280 @@
+var LibraryJSEvents = {
+ $JSEvents: {
+ // pointers to structs malloc()ed to Emscripten HEAP for JS->C interop.
+ keyEvent: 0,
+ mouseEvent: 0,
+ wheelEvent: 0,
+ uiEvent: 0,
+ focusEvent: 0,
+ deviceOrientationEvent: 0,
+ deviceMotionEvent: 0,
+ fullscreenChangeEvent: 0,
+ pointerlockChangeEvent: 0,
+ visibilityChangeEvent: 0,
+ touchEvent: 0,
+
+ // When we transition from fullscreen to windowed mode, we remember here the element that was just in fullscreen mode
+ // so that we can report information about that element in the event message.
+ previousFullscreenElement: null,
+
+ // When the C runtime exits via exit(), we unregister all event handlers added by this library to be nice and clean.
+ // Track in this field whether we have yet registered that __ATEXIT__ handler.
+ removeEventListenersRegistered: false,
+
+ registerRemoveEventListeners: function() {
+ if (!JSEvents.removeEventListenersRegistered) {
+ __ATEXIT__.push({ func: function() {
+ for(var i = JSEvents.eventHandlers.length-1; i >= 0; --i) {
+ JSEvents._removeHandler(i);
+ }
+ } });
+ JSEvents.removeEventListenersRegistered = true;
+ }
+ },
+
+ findEventTarget: function(target) {
+ if (target) {
+ if (typeof target == "number") {
+ target = Pointer_stringify(target);
+ }
+ if (target == '#window') return window;
+ else if (target == '#document') return document;
+ else if (target == '#screen') return window.screen;
+ else if (target == '#canvas') return Module['canvas'];
+
+ if (typeof target == 'string') return document.getElementById(target);
+ else return target;
+ } else {
+ // The sensible target varies between events, but use window as the default
+ // since DOM events mostly can default to that. Specific callback registrations
+ // override their own defaults.
+ return window;
+ }
+ },
+
+ deferredCalls: [],
+
+ // Queues the given function call to occur the next time we enter an event handler.
+ // Existing implementations of pointerlock apis have required that
+ // the target element is active in fullscreen mode first. Thefefore give
+ // fullscreen mode request a precedence of 1 and pointer lock a precedence of 2
+ // and sort by that to always request fullscreen before pointer lock.
+ deferCall: function(targetFunction, precedence, argsList) {
+ function arraysHaveEqualContent(arrA, arrB) {
+ if (arrA.length != arrB.length) return false;
+
+ for(var i in arrA) {
+ if (arrA[i] != arrB[i]) return false;
+ }
+ return true;
+ }
+ // Test if the given call was already queued, and if so, don't add it again.
+ for(var i in JSEvents.deferredCalls) {
+ var call = JSEvents.deferredCalls[i];
+ if (call.targetFunction == targetFunction && arraysHaveEqualContent(call.argsList, argsList)) {
+ return;
+ }
+ }
+ JSEvents.deferredCalls.push({
+ targetFunction: targetFunction,
+ precedence: precedence,
+ argsList: argsList
+ });
+
+ JSEvents.deferredCalls.sort(function(x,y) { return x.precedence < y.precedence; });
+ },
+
+ // Erases all deferred calls to the given target function from the queue list.
+ removeDeferredCalls: function(targetFunction) {
+ for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
+ if (JSEvents.deferredCalls[i].targetFunction == targetFunction) {
+ JSEvents.deferredCalls.splice(i, 1);
+ --i;
+ }
+ }
+ },
+
+ canPerformEventHandlerRequests: function() {
+ return JSEvents.inEventHandler && JSEvents.currentEventHandler.allowsDeferredCalls;
+ },
+
+ runDeferredCalls: function() {
+ if (!JSEvents.canPerformEventHandlerRequests()) {
+ return;
+ }
+ for(var i = 0; i < JSEvents.deferredCalls.length; ++i) {
+ var call = JSEvents.deferredCalls[i];
+ JSEvents.deferredCalls.splice(i, 1);
+ --i;
+ call.targetFunction.apply(this, call.argsList);
+ }
+ },
+
+ // If positive, we are currently executing in a JS event handler.
+ inEventHandler: 0,
+ // If we are in an event handler, specifies the event handler object from the eventHandlers array that is currently running.
+ currentEventHandler: null,
+
+ // Stores objects representing each currently registered JS event handler.
+ eventHandlers: [],
+
+ _removeHandler: function(i) {
+ JSEvents.eventHandlers[i].target.removeEventListener(JSEvents.eventHandlers[i].eventTypeString, JSEvents.eventHandlers[i].handlerFunc, true);
+ JSEvents.eventHandlers.splice(i, 1);
+ },
+
+ registerOrRemoveHandler: function(eventHandler) {
+ var jsEventHandler = function jsEventHandler(event) {
+ // Increment nesting count for the event handler.
+ ++JSEvents.inEventHandler;
+ JSEvents.currentEventHandler = eventHandler;
+ // Process any old deferred calls the user has placed.
+ JSEvents.runDeferredCalls();
+ // Process the actual event, calls back to user C code handler.
+ eventHandler.handlerFunc(event);
+ // Process any new deferred calls that were placed right now from this event handler.
+ JSEvents.runDeferredCalls();
+ // Out of event handler - restore nesting count.
+ --JSEvents.inEventHandler;
+ }
+
+ if (eventHandler.callbackfunc) {
+ eventHandler.target.addEventListener(eventHandler.eventTypeString, jsEventHandler, eventHandler.useCapture);
+ JSEvents.eventHandlers.push(eventHandler);
+ JSEvents.registerRemoveEventListeners();
+ } else {
+ for(var i = 0; i < JSEvents.eventHandlers.length; ++i) {
+ if (JSEvents.eventHandlers[i].target == eventHandler.target
+ && JSEvents.eventHandlers[i].eventTypeString == eventHandler.eventTypeString) {
+ JSEvents._removeHandler(i--);
+ }
+ }
+ }
+ },
+
+ registerKeyEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.keyEvent) {
+ JSEvents.keyEvent = _malloc( {{{ C_STRUCTS.EmscriptenKeyboardEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+ writeStringToMemory(e.key ? e.key : "", JSEvents.keyEvent + {{{ C_STRUCTS.EmscriptenKeyboardEvent.key }}} );
+ writeStringToMemory(e.code ? e.code : "", JSEvents.keyEvent + {{{ C_STRUCTS.EmscriptenKeyboardEvent.code }}} );
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.location, 'e.location', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.ctrlKey, 'e.ctrlKey', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.shiftKey, 'e.shiftKey', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.altKey, 'e.altKey', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.metaKey, 'e.metaKey', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.repeat, 'e.repeat', 'i32') }}};
+ writeStringToMemory(e.locale ? e.locale : "", JSEvents.keyEvent + {{{ C_STRUCTS.EmscriptenKeyboardEvent.locale }}} );
+ writeStringToMemory(e.char ? e.char : "", JSEvents.keyEvent + {{{ C_STRUCTS.EmscriptenKeyboardEvent.charValue }}} );
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.charCode, 'e.charCode', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.keyCode, 'e.keyCode', 'i32') }}};
+ {{{ makeSetValue('JSEvents.keyEvent', C_STRUCTS.EmscriptenKeyboardEvent.which, 'e.which', 'i32') }}};
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.keyEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var isInternetExplorer = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0);
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: isInternetExplorer ? false : true, // MSIE doesn't allow fullscreen and pointerlock requests from key handlers, others do.
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ fillMouseEventData: function(eventStruct, e) {
+ var rect = Module['canvas'].getBoundingClientRect();
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.timestamp, 'JSEvents.tick()', 'double') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.screenX, 'e.screenX', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.screenY, 'e.screenY', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.clientX, 'e.clientX', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.clientY, 'e.clientY', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.ctrlKey, 'e.ctrlKey', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.shiftKey, 'e.shiftKey', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.altKey, 'e.altKey', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.metaKey, 'e.metaKey', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.button, 'e.button', 'i16') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.buttons, 'e.buttons', 'i16') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementX, 'e.movementX || e.mozMovementX || e.webkitMovementX', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.movementY, 'e.movementY || e.mozMovementY || e.webkitMovementY', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.canvasX, 'e.clientX - rect.left', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenMouseEvent.canvasY, 'e.clientY - rect.top', 'i32') }}};
+ },
+
+ registerMouseEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.mouseEvent) {
+ JSEvents.mouseEvent = _malloc( {{{ C_STRUCTS.EmscriptenMouseEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+ JSEvents.fillMouseEventData(JSEvents.mouseEvent, e);
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.mouseEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: eventTypeString != 'mousemove', // Mouse move events do not allow fullscreen/pointer lock requests to be handled in them!
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ registerWheelEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.wheelEvent) {
+ JSEvents.wheelEvent = _malloc( {{{ C_STRUCTS.EmscriptenWheelEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+ JSEvents.fillMouseEventData(JSEvents.wheelEvent, e);
+ {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaX, 'e.deltaX', 'double') }}};
+ {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaY, 'e.deltaY', 'double') }}};
+ {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaZ, 'e.deltaZ', 'double') }}};
+ {{{ makeSetValue('JSEvents.wheelEvent', C_STRUCTS.EmscriptenWheelEvent.deltaMode, 'e.deltaMode', 'i32') }}};
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.wheelEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: true,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ pageScrollPos: function() {
+ if (window.pageXOffset > 0 || window.pageYOffset > 0) {
+ return [window.pageXOffset, window.pageYOffset];
+ }
+ if (typeof document.documentElement.scrollLeft !== 'undefined' || typeof document.documentElement.scrollTop !== 'undefined') {
+ return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
+ }
+ return [document.body.scrollLeft|0, document.body.scrollTop|0];
+ },
+
+ registerUiEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.uiEvent) {
+ JSEvents.uiEvent = _malloc( {{{ C_STRUCTS.EmscriptenUiEvent.__size__ }}} );
+ }
+
+ if (eventTypeString == "scroll" && !target) {
+ target = document; // By default read scroll events on document rather than window.
+ } else {
+ target = JSEvents.findEventTarget(target);
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+ if (e.target != target) {
+ // Never take ui events such as scroll via a 'bubbled' route, but always from the direct element that
+ // was targeted. Otherwise e.g. if app logs a message in response to a page scroll, the Emscripten log
+ // message box could cause to scroll, generating a new (bubbled) scroll message, causing a new log print,
+ // causing a new scroll, etc..
+ return;
+ }
+ var scrollPos = JSEvents.pageScrollPos();
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.detail, 'e.detail', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.documentBodyClientWidth, 'document.body.clientWidth', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.documentBodyClientHeight, 'document.body.clientHeight', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.windowInnerWidth, 'window.innerWidth', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.windowInnerHeight, 'window.innerHeight', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.windowOuterWidth, 'window.outerWidth', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.windowOuterHeight, 'window.outerHeight', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.scrollTop, 'scrollPos[0]', 'i32') }}};
+ {{{ makeSetValue('JSEvents.uiEvent', C_STRUCTS.EmscriptenUiEvent.scrollLeft, 'scrollPos[1]', 'i32') }}};
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.uiEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: target,
+ allowsDeferredCalls: false, // Neither scroll or resize events allow running requests inside them.
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ getNodeNameForTarget: function(target) {
+ if (!target) return '';
+ if (target == window) return '#window';
+ if (target == window.screen) return '#screen';
+ return (target && target.nodeName) ? target.nodeName : '';
+ },
+
+ registerFocusEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.focusEvent) {
+ JSEvents.focusEvent = _malloc( {{{ C_STRUCTS.EmscriptenFocusEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ var nodeName = JSEvents.getNodeNameForTarget(e.target);
+ var id = e.target.id ? e.target.id : '';
+ writeStringToMemory(nodeName, JSEvents.focusEvent + {{{ C_STRUCTS.EmscriptenFocusEvent.nodeName }}} );
+ writeStringToMemory(id, JSEvents.focusEvent + {{{ C_STRUCTS.EmscriptenFocusEvent.id }}} );
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.focusEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ tick: function() {
+ if (window['performance'] && window['performance']['now']) return window['performance']['now']();
+ else return Date.now();
+ },
+
+ registerDeviceOrientationEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.deviceOrientationEvent) {
+ JSEvents.deviceOrientationEvent = _malloc( {{{ C_STRUCTS.EmscriptenDeviceOrientationEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceOrientationEvent.timestamp, 'JSEvents.tick()', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceOrientationEvent.alpha, 'e.alpha', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceOrientationEvent.beta, 'e.beta', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceOrientationEvent.gamma, 'e.gamma', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceOrientationEvent.absolute, 'e.absolute', 'i32') }}};
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.deviceOrientationEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ registerDeviceMotionEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.deviceMotionEvent) {
+ JSEvents.deviceMotionEvent = _malloc( {{{ C_STRUCTS.EmscriptenDeviceMotionEvent.__size__ }}} );
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ {{{ makeSetValue('JSEvents.deviceOrientationEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.timestamp, 'JSEvents.tick()', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationX, 'e.acceleration.x', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationY, 'e.acceleration.y', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationZ, 'e.acceleration.z', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationIncludingGravityX, 'e.accelerationIncludingGravity.x', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationIncludingGravityY, 'e.accelerationIncludingGravity.y', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.accelerationIncludingGravityZ, 'e.accelerationIncludingGravity.z', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.rotationRateAlpha, 'e.rotationRate.alpha', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.rotationRateBeta, 'e.rotationRate.beta', 'double') }}};
+ {{{ makeSetValue('JSEvents.deviceMotionEvent', C_STRUCTS.EmscriptenDeviceMotionEvent.rotationRateGamma, 'e.rotationRate.gamma', 'double') }}};
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.deviceMotionEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ screenOrientation: function() {
+ if (!window.screen) return undefined;
+ return window.screen.orientation || window.screen.mozOrientation || window.screen.webkitOrientation || window.screen.msOrientation;
+ },
+
+ fillOrientationChangeEventData: function(eventStruct, e) {
+ var orientations = ["portrait-primary", "portrait-secondary", "landscape-primary", "landscape-secondary"];
+ var orientations2 = ["portrait", "portrait", "landscape", "landscape"];
+
+ var orientationString = JSEvents.screenOrientation();
+ var orientation = orientations.indexOf(orientationString);
+ if (orientation == -1) {
+ orientation = orientations2.indexOf(orientationString);
+ }
+
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenOrientationChangeEvent.orientationIndex, '1 << orientation', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenOrientationChangeEvent.orientationAngle, 'window.orientation', 'i32') }}};
+ },
+
+ registerOrientationChangeEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.orientationChangeEvent) {
+ JSEvents.orientationChangeEvent = _malloc( {{{ C_STRUCTS.EmscriptenOrientationChangeEvent.__size__ }}} );
+ }
+
+ if (!target) {
+ target = window.screen; // Orientation events need to be captured from 'window.screen' instead of 'window'
+ } else {
+ target = JSEvents.findEventTarget(target);
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillOrientationChangeEventData(JSEvents.orientationChangeEvent, e);
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.orientationChangeEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ if (eventTypeString == "orientationchange" && window.screen.mozOrientation !== undefined) {
+ eventTypeString = "mozorientationchange";
+ }
+
+ var eventHandler = {
+ target: target,
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ fullscreenEnabled: function() {
+ return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
+ },
+
+ fillFullscreenChangeEventData: function(eventStruct, e) {
+ var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
+ var isFullscreen = !!fullscreenElement;
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.isFullscreen, 'isFullscreen', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.fullscreenEnabled, 'JSEvents.fullscreenEnabled()', 'i32') }}};
+ // If transitioning to fullscreen, report info about the element that is now fullscreen.
+ // If transitioning to windowed mode, report info about the element that just was fullscreen.
+ var reportedElement = isFullscreen ? fullscreenElement : JSEvents.previousFullscreenElement;
+ var nodeName = JSEvents.getNodeNameForTarget(reportedElement);
+ var id = (reportedElement && reportedElement.id) ? reportedElement.id : '';
+ writeStringToMemory(nodeName, eventStruct + {{{ C_STRUCTS.EmscriptenFullscreenChangeEvent.nodeName }}} );
+ writeStringToMemory(id, eventStruct + {{{ C_STRUCTS.EmscriptenFullscreenChangeEvent.id }}} );
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.elementWidth, 'reportedElement ? reportedElement.clientWidth : 0', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.elementHeight, 'reportedElement ? reportedElement.clientHeight : 0', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.screenWidth, 'screen.width', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenFullscreenChangeEvent.screenHeight, 'screen.height', 'i32') }}};
+ if (isFullscreen) {
+ JSEvents.previousFullscreenElement = fullscreenElement;
+ }
+ },
+
+ registerFullscreenChangeEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.fullscreenChangeEvent) {
+ JSEvents.fullscreenChangeEvent = _malloc( {{{ C_STRUCTS.EmscriptenFullscreenChangeEvent.__size__ }}} );
+ }
+
+ if (!target) {
+ target = document; // Fullscreen change events need to be captured from 'document' by default instead of 'window'
+ } else {
+ target = JSEvents.findEventTarget(target);
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillFullscreenChangeEventData(JSEvents.fullscreenChangeEvent, e);
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.fullscreenChangeEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: target,
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ requestFullscreen: function(target) {
+ if (target.requestFullscreen) {
+ target.requestFullscreen();
+ } else if (target.msRequestFullscreen) {
+ target.msRequestFullscreen();
+ } else if (target.mozRequestFullScreen) {
+ target.mozRequestFullScreen();
+ } else if (target.mozRequestFullscreen) {
+ target.mozRequestFullscreen();
+ } else if (target.webkitRequestFullscreen) {
+ target.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
+ } else {
+ if (typeof JSEvents.fullscreenEnabled() === 'undefined') {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_INVALID_TARGET') }}};
+ }
+ }
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ fillPointerlockChangeEventData: function(eventStruct, e) {
+ var pointerLockElement = document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement || document.msPointerLockElement;
+ var isPointerlocked = !!pointerLockElement;
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenPointerlockChangeEvent.isActive, 'isPointerlocked', 'i32') }}};
+ var nodeName = JSEvents.getNodeNameForTarget(pointerLockElement);
+ var id = (pointerLockElement && pointerLockElement.id) ? pointerLockElement.id : '';
+ writeStringToMemory(nodeName, eventStruct + {{{ C_STRUCTS.EmscriptenPointerlockChangeEvent.nodeName }}} );
+ writeStringToMemory(id, eventStruct + {{{ C_STRUCTS.EmscriptenPointerlockChangeEvent.id }}});
+ },
+
+ registerPointerlockChangeEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.pointerlockChangeEvent) {
+ JSEvents.pointerlockChangeEvent = _malloc( {{{ C_STRUCTS.EmscriptenPointerlockChangeEvent.__size__ }}} );
+ }
+
+ if (!target) {
+ target = document; // Pointer lock change events need to be captured from 'document' by default instead of 'window'
+ } else {
+ target = JSEvents.findEventTarget(target);
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillPointerlockChangeEventData(JSEvents.pointerlockChangeEvent, e);
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.pointerlockChangeEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: target,
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ requestPointerLock: function(target) {
+ if (target.requestPointerLock) {
+ target.requestPointerLock();
+ } else if (target.mozRequestPointerLock) {
+ target.mozRequestPointerLock();
+ } else if (target.webkitRequestPointerLock) {
+ target.webkitRequestPointerLock();
+ } else if (target.msRequestPointerLock) {
+ target.msRequestPointerLock();
+ } else {
+ // document.body is known to accept pointer lock, so use that to differentiate if the user passed a bad element,
+ // or if the whole browser just doesn't support the feature.
+ if (document.body.requestPointerLock || document.body.mozRequestPointerLock || document.body.webkitRequestPointerLock || document.body.msRequestPointerLock) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_INVALID_TARGET') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ }
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ fillVisibilityChangeEventData: function(eventStruct, e) {
+ var visibilityStates = [ "hidden", "visible", "prerender", "unloaded" ];
+ var visibilityState = visibilityStates.indexOf(document.visibilityState);
+
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenVisibilityChangeEvent.hidden, 'document.hidden', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenVisibilityChangeEvent.visibilityState, 'visibilityState', 'i32') }}};
+ },
+
+ registerVisibilityChangeEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.visibilityChangeEvent) {
+ JSEvents.visibilityChangeEvent = _malloc( {{{ C_STRUCTS.EmscriptenVisibilityChangeEvent.__size__ }}} );
+ }
+
+ if (!target) {
+ target = document; // Visibility change events need to be captured from 'document' by default instead of 'window'
+ } else {
+ target = JSEvents.findEventTarget(target);
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillVisibilityChangeEventData(JSEvents.visibilityChangeEvent, e);
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.visibilityChangeEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: target,
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ registerTouchEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.touchEvent) {
+ JSEvents.touchEvent = _malloc( {{{ C_STRUCTS.EmscriptenTouchEvent.__size__ }}} );
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ var touches = {};
+ for(var i = 0; i < e.touches.length; ++i) {
+ var touch = e.touches[i];
+ touches[touch.identifier] = touch;
+ }
+ for(var i = 0; i < e.changedTouches.length; ++i) {
+ var touch = e.changedTouches[i];
+ touches[touch.identifier] = touch;
+ touch.changed = true;
+ }
+ for(var i = 0; i < e.targetTouches.length; ++i) {
+ var touch = e.targetTouches[i];
+ touches[touch.identifier].onTarget = true;
+ }
+
+ var ptr = JSEvents.touchEvent;
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchEvent.ctrlKey, 'e.ctrlKey', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchEvent.shiftKey, 'e.shiftKey', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchEvent.altKey, 'e.altKey', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchEvent.metaKey, 'e.metaKey', 'i32') }}};
+ ptr += {{{ C_STRUCTS.EmscriptenTouchEvent.touches }}}; // Advance to the start of the touch array.
+ var rect = Module['canvas'].getBoundingClientRect();
+ var numTouches = 0;
+ for(var i in touches) {
+ var t = touches[i];
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.identifier, 't.identifier', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.screenX, 't.screenX', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.screenY, 't.screenY', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.clientX, 't.clientX', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.clientY, 't.clientY', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.pageX, 't.pageX', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.pageY, 't.pageY', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.isChanged, 't.changed', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.onTarget, 't.onTarget', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.canvasX, 't.clientX - rect.left', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.EmscriptenTouchPoint.canvasY, 't.clientY - rect.top', 'i32') }}};
+ ptr += {{{ C_STRUCTS.EmscriptenTouchPoint.__size__ }}};
+
+ if (++numTouches >= 32) {
+ break;
+ }
+ }
+ {{{ makeSetValue('JSEvents.touchEvent', C_STRUCTS.EmscriptenTouchEvent.numTouches, 'numTouches', 'i32') }}};
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.touchEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false, // XXX Currently disabled, see bug https://bugzilla.mozilla.org/show_bug.cgi?id=966493
+ // Once the above bug is resolved, enable the following condition if possible:
+ // allowsDeferredCalls: eventTypeString == 'touchstart',
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ fillGamepadEventData: function(eventStruct, e) {
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenGamepadEvent.timestamp, 'e.timestamp', 'double') }}};
+ for(var i = 0; i < e.axes.length; ++i) {
+ {{{ makeSetValue('eventStruct+i*8', C_STRUCTS.EmscriptenGamepadEvent.axis, 'e.axes[i]', 'double') }}};
+ }
+ for(var i = 0; i < e.buttons.length; ++i) {
+ {{{ makeSetValue('eventStruct+i*8', C_STRUCTS.EmscriptenGamepadEvent.analogButton, 'e.buttons[i].value', 'double') }}};
+ }
+ for(var i = 0; i < e.buttons.length; ++i) {
+ {{{ makeSetValue('eventStruct+i*4', C_STRUCTS.EmscriptenGamepadEvent.digitalButton, 'e.buttons[i].pressed', 'i32') }}};
+ }
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenGamepadEvent.connected, 'e.connected', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenGamepadEvent.index, 'e.index', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenGamepadEvent.numAxes, 'e.axes.length', 'i32') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenGamepadEvent.numButtons, 'e.buttons.length', 'i32') }}};
+ writeStringToMemory(e.id, eventStruct + {{{ C_STRUCTS.EmscriptenGamepadEvent.id }}} );
+ writeStringToMemory(e.mapping, eventStruct + {{{ C_STRUCTS.EmscriptenGamepadEvent.mapping }}} );
+ },
+
+ registerGamepadEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.gamepadEvent) {
+ JSEvents.gamepadEvent = _malloc( {{{ C_STRUCTS.EmscriptenGamepadEvent.__size__ }}} );
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillGamepadEventData(JSEvents.gamepadEvent, e.gamepad);
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.gamepadEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: true,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ registerBeforeUnloadEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ var confirmationMessage = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, 0, userData]);
+
+ if (confirmationMessage) {
+ confirmationMessage = Pointer_stringify(confirmationMessage);
+ }
+ if (confirmationMessage) {
+ e.preventDefault();
+ e.returnValue = confirmationMessage;
+ return confirmationMessage;
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ battery: function() { return navigator.battery || navigator.mozBattery || navigator.webkitBattery; },
+
+ fillBatteryEventData: function(eventStruct, e) {
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenBatteryEvent.chargingTime, 'e.chargingTime', 'double') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenBatteryEvent.dischargingTime, 'e.dischargingTime', 'double') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenBatteryEvent.level, 'e.level', 'double') }}};
+ {{{ makeSetValue('eventStruct', C_STRUCTS.EmscriptenBatteryEvent.charging, 'e.charging', 'i32') }}};
+ },
+
+ registerBatteryEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!JSEvents.batteryEvent) {
+ JSEvents.batteryEvent = _malloc( {{{ C_STRUCTS.EmscriptenBatteryEvent.__size__ }}} );
+ }
+
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ JSEvents.fillBatteryEventData(JSEvents.batteryEvent, JSEvents.battery());
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, JSEvents.batteryEvent, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+
+ registerWebGlEventCallback: function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
+ if (!target) {
+ target = Module['canvas'];
+ }
+ var handlerFunc = function(event) {
+ var e = event || window.event;
+
+ var shouldCancel = Runtime.dynCall('iiii', callbackfunc, [eventTypeId, 0, userData]);
+ if (shouldCancel) {
+ e.preventDefault();
+ }
+ };
+
+ var eventHandler = {
+ target: JSEvents.findEventTarget(target),
+ allowsDeferredCalls: false,
+ eventTypeString: eventTypeString,
+ callbackfunc: callbackfunc,
+ handlerFunc: handlerFunc,
+ useCapture: useCapture
+ };
+ JSEvents.registerOrRemoveHandler(eventHandler);
+ },
+ },
+
+ emscripten_set_keypress_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerKeyEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_KEYPRESS') }}}, "keypress");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_keydown_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerKeyEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_KEYDOWN') }}}, "keydown");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_keyup_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerKeyEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_KEYUP') }}}, "keyup");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_click_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_CLICK') }}}, "click");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_mousedown_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_MOUSEDOWN') }}}, "mousedown");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_mouseup_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_MOUSEUP') }}}, "mouseup");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_dblclick_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_DBLCLICK') }}}, "dblclick");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_mousemove_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerMouseEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_MOUSEMOVE') }}}, "mousemove");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_mouse_status: function(mouseState) {
+ if (!JSEvents.mouseEvent) return {{{ cDefine('EMSCRIPTEN_RESULT_NO_DATA') }}};
+ // HTML5 does not really have a polling API for mouse events, so implement one manually by
+ // returning the data from the most recently received event. This requires that user has registered
+ // at least some no-op function as an event handler to any of the mouse function.
+ HEAP32.set(HEAP32.subarray(JSEvents.mouseEvent, {{{ C_STRUCTS.EmscriptenMouseEvent.__size__ }}}), mouseState);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_wheel_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerWheelEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_WHEEL') }}}, "wheel");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_resize_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerUiEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_RESIZE') }}}, "resize");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_scroll_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerUiEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_SCROLL') }}}, "scroll");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_blur_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerFocusEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_BLUR') }}}, "blur");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_focus_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerFocusEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FOCUS') }}}, "focus");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_focusin_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerFocusEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FOCUSIN') }}}, "focusin");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_focusout_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerFocusEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FOCUSOUT') }}}, "focusout");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_deviceorientation_callback: function(userData, useCapture, callbackfunc) {
+ JSEvents.registerDeviceOrientationEventCallback(window, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_DEVICEORIENTATION') }}}, "deviceorientation");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_deviceorientation_status: function(orientationState) {
+ if (!JSEvents.deviceOrientationEvent) return {{{ cDefine('EMSCRIPTEN_RESULT_NO_DATA') }}};
+ // HTML5 does not really have a polling API for device orientation events, so implement one manually by
+ // returning the data from the most recently received event. This requires that user has registered
+ // at least some no-op function as an event handler.
+ HEAP32.set(HEAP32.subarray(JSEvents.deviceOrientationEvent, {{{ C_STRUCTS.EmscriptenDeviceOrientationEvent.__size__ }}}), orientationState);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_devicemotion_callback: function(userData, useCapture, callbackfunc) {
+ JSEvents.registerDeviceMotionEventCallback(window, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_DEVICEMOTION') }}}, "devicemotion");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_devicemotion_status: function(motionState) {
+ if (!JSEvents.deviceMotionEvent) return {{{ cDefine('EMSCRIPTEN_RESULT_NO_DATA') }}};
+ // HTML5 does not really have a polling API for device motion events, so implement one manually by
+ // returning the data from the most recently received event. This requires that user has registered
+ // at least some no-op function as an event handler.
+ HEAP32.set(HEAP32.subarray(JSEvents.deviceMotionEvent, {{{ C_STRUCTS.EmscriptenDeviceMotionEvent.__size__ }}}), motionState);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_orientationchange_callback: function(userData, useCapture, callbackfunc) {
+ if (!window.screen || !window.screen.addEventListener) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerOrientationChangeEventCallback(window.screen, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_ORIENTATIONCHANGE') }}}, "orientationchange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_orientation_status: function(orientationChangeEvent) {
+ if (!JSEvents.screenOrientation() && typeof window.orientation === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.fillOrientationChangeEventData(orientationChangeEvent);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_lock_orientation: function(allowedOrientations) {
+ var orientations = [];
+ if (allowedOrientations & 1) orientations.push("portrait-primary");
+ if (allowedOrientations & 2) orientations.push("portrait-secondary");
+ if (allowedOrientations & 4) orientations.push("landscape-primary");
+ if (allowedOrientations & 8) orientations.push("landscape-secondary");
+ var succeeded;
+ if (window.screen.lockOrientation) {
+ succeeded = window.screen.lockOrientation(orientations);
+ } else if (window.screen.mozLockOrientation) {
+ succeeded = window.screen.mozLockOrientation(orientations);
+ } else if (window.screen.webkitLockOrientation) {
+ succeeded = window.screen.webkitLockOrientation(orientations);
+ } else if (window.screen.msLockOrientation) {
+ succeeded = window.screen.msLockOrientation(orientations);
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ if (succeeded) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_FAILED') }}};
+ }
+ },
+
+ emscripten_unlock_orientation: function() {
+ if (window.screen.unlockOrientation) {
+ window.screen.unlockOrientation();
+ } else if (window.screen.mozUnlockOrientation) {
+ window.screen.mozUnlockOrientation();
+ } else if (window.screen.webkitUnlockOrientation) {
+ window.screen.webkitUnlockOrientation();
+ } else if (window.screen.msUnlockOrientation) {
+ window.screen.msUnlockOrientation();
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_fullscreenchange_callback: function(target, userData, useCapture, callbackfunc) {
+ if (typeof JSEvents.fullscreenEnabled() === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ if (!target) target = document;
+ else {
+ target = JSEvents.findEventTarget(target);
+ if (!target) return {{{ cDefine('EMSCRIPTEN_RESULT_UNKNOWN_TARGET') }}};
+ }
+ JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FULLSCREENCHANGE') }}}, "fullscreenchange");
+ JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FULLSCREENCHANGE') }}}, "mozfullscreenchange");
+ JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FULLSCREENCHANGE') }}}, "webkitfullscreenchange");
+ JSEvents.registerFullscreenChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_FULLSCREENCHANGE') }}}, "msfullscreenchange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_fullscreen_status: function(fullscreenStatus) {
+ if (typeof JSEvents.fullscreenEnabled() === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.fillFullscreenChangeEventData(fullscreenStatus);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ // https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
+ emscripten_request_fullscreen: function(target, deferUntilInEventHandler) {
+ if (typeof JSEvents.fullscreenEnabled() === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ if (!JSEvents.fullscreenEnabled()) return {{{ cDefine('EMSCRIPTEN_RESULT_INVALID_TARGET') }}};
+ if (!target) target = '#canvas';
+ target = JSEvents.findEventTarget(target);
+ if (!target) return {{{ cDefine('EMSCRIPTEN_RESULT_UNKNOWN_TARGET') }}};
+
+ if (!target.requestFullscreen && !target.msRequestFullscreen && !target.mozRequestFullScreen && !target.mozRequestFullscreen && !target.webkitRequestFullscreen) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_INVALID_TARGET') }}};
+ }
+
+ var canPerformRequests = JSEvents.canPerformEventHandlerRequests();
+
+ // Queue this function call if we're not currently in an event handler and the user saw it appropriate to do so.
+ if (!canPerformRequests) {
+ if (deferUntilInEventHandler) {
+ JSEvents.deferCall(JSEvents.requestFullscreen, 1 /* priority over pointer lock */, [target]);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_DEFERRED') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED') }}};
+ }
+ }
+
+ return JSEvents.requestFullscreen(target);
+ },
+
+ emscripten_exit_fullscreen: function() {
+ if (typeof JSEvents.fullscreenEnabled() === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ // Make sure no queued up calls will fire after this.
+ JSEvents.removeDeferredCalls(JSEvents.requestFullscreen);
+
+ if (document.exitFullscreen) {
+ document.exitFullscreen();
+ } else if (document.msExitFullscreen) {
+ document.msExitFullscreen();
+ } else if (document.mozCancelFullScreen) {
+ document.mozCancelFullScreen();
+ } else if (document.webkitExitFullscreen) {
+ document.webkitExitFullscreen();
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_pointerlockchange_callback: function(target, userData, useCapture, callbackfunc) {
+ if (!document.body.requestPointerLock && !document.body.mozRequestPointerLock && !document.body.webkitRequestPointerLock && !document.body.msRequestPointerLock) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ if (!target) target = document;
+ else {
+ target = JSEvents.findEventTarget(target);
+ if (!target) return {{{ cDefine('EMSCRIPTEN_RESULT_UNKNOWN_TARGET') }}};
+ }
+ JSEvents.registerPointerlockChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_POINTERLOCKCHANGE') }}}, "pointerlockchange");
+ JSEvents.registerPointerlockChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_POINTERLOCKCHANGE') }}}, "mozpointerlockchange");
+ JSEvents.registerPointerlockChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_POINTERLOCKCHANGE') }}}, "webkitpointerlockchange");
+ JSEvents.registerPointerlockChangeEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_POINTERLOCKCHANGE') }}}, "mspointerlockchange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_pointerlock_status: function(pointerlockStatus) {
+ if (!document.body.requestPointerLock && !document.body.mozRequestPointerLock && !document.body.webkitRequestPointerLock && !document.body.msRequestPointerLock) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ JSEvents.fillPointerlockChangeEventData(pointerlockStatus);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_request_pointerlock: function(target, deferUntilInEventHandler) {
+ if (!target) target = '#canvas';
+ target = JSEvents.findEventTarget(target);
+ if (!target) return {{{ cDefine('EMSCRIPTEN_RESULT_UNKNOWN_TARGET') }}};
+ if (!target.requestPointerLock && !target.mozRequestPointerLock && !target.webkitRequestPointerLock && !target.msRequestPointerLock) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+
+ var canPerformRequests = JSEvents.canPerformEventHandlerRequests();
+
+ // Queue this function call if we're not currently in an event handler and the user saw it appropriate to do so.
+ if (!canPerformRequests) {
+ if (deferUntilInEventHandler) {
+ JSEvents.deferCall(JSEvents.requestPointerLock, 2 /* priority below fullscreen */, [target]);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_DEFERRED') }}};
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED') }}};
+ }
+ }
+
+ return JSEvents.requestPointerLock(target);
+ },
+
+ emscripten_exit_pointerlock: function() {
+ // Make sure no queued up calls will fire after this.
+ JSEvents.removeDeferredCalls(JSEvents.requestPointerLock);
+
+ if (document.exitPointerLock) {
+ document.exitPointerLock();
+ } else if (document.msExitPointerLock) {
+ document.msExitPointerLock();
+ } else if (document.mozExitPointerLock) {
+ document.mozExitPointerLock();
+ } else if (document.webkitExitPointerLock) {
+ document.webkitExitPointerLock();
+ } else {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_vibrate: function(msecs) {
+ if (!navigator.vibrate) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ navigator.vibrate(msecs);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_vibrate_pattern: function(msecsArray, numEntries) {
+ if (!navigator.vibrate) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+
+ var vibrateList = [];
+ for(var i = 0; i < numEntries; ++i) {
+ var msecs = {{{ makeGetValue('msecsArray', 'i*4', 'i32') }}};
+ vibrateList.push(msecs);
+ }
+ navigator.vibrate(vibrateList);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_visibilitychange_callback: function(userData, useCapture, callbackfunc) {
+ JSEvents.registerVisibilityChangeEventCallback(document, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_VISIBILITYCHANGE') }}}, "visibilitychange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_visibility_status: function(visibilityStatus) {
+ if (typeof document.visibilityState === 'undefined' && typeof document.hidden === 'undefined') {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ }
+ JSEvents.fillVisibilityChangeEventData(visibilityStatus);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_touchstart_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_TOUCHSTART') }}}, "touchstart");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_touchend_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_TOUCHEND') }}}, "touchend");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_touchmove_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_TOUCHMOVE') }}}, "touchmove");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_touchcancel_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerTouchEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_TOUCHCANCEL') }}}, "touchcancel");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_gamepadconnected_callback: function(userData, useCapture, callbackfunc) {
+ if (!navigator.getGamepads) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_GAMEPADCONNECTED') }}}, "gamepadconnected");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_gamepaddisconnected_callback: function(userData, useCapture, callbackfunc) {
+ if (!navigator.getGamepads) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerGamepadEventCallback(window, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_GAMEPADDISCONNECTED') }}}, "gamepaddisconnected");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_num_gamepads: function() {
+ if (!navigator.getGamepads) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ return navigator.getGamepads().length;
+ },
+
+ emscripten_get_gamepad_status: function(index, gamepadState) {
+ if (!navigator.getGamepads) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ var gamepads = navigator.getGamepads();
+ if (index < 0 || index >= gamepads.length) {
+ return {{{ cDefine('EMSCRIPTEN_RESULT_INVALID_PARAM') }}};
+ }
+ JSEvents.fillGamepadEventData(gamepadState, gamepads[index]);
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_beforeunload_callback: function(userData, callbackfunc) {
+ if (typeof window.onbeforeunload === 'undefined') return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerBeforeUnloadEventCallback(window, userData, true, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_BEFOREUNLOAD') }}}, "beforeunload");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_batterychargingchange_callback: function(userData, callbackfunc) {
+ if (!JSEvents.battery()) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerBatteryEventCallback(JSEvents.battery(), userData, true, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE') }}}, "chargingchange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_batterylevelchange_callback: function(userData, callbackfunc) {
+ if (!JSEvents.battery()) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.registerBatteryEventCallback(JSEvents.battery(), userData, true, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE') }}}, "levelchange");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_get_battery_status: function(batteryState) {
+ if (!JSEvents.battery()) return {{{ cDefine('EMSCRIPTEN_RESULT_NOT_SUPPORTED') }}};
+ JSEvents.fillBatteryEventData(batteryState, JSEvents.battery());
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_webglcontextlost_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerWebGlEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST') }}}, "webglcontextlost");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+
+ emscripten_set_webglcontextrestored_callback: function(target, userData, useCapture, callbackfunc) {
+ JSEvents.registerWebGlEventCallback(target, userData, useCapture, callbackfunc, {{{ cDefine('EMSCRIPTEN_EVENT_WEBGLCONTEXTRESTORED') }}}, "webglcontextrestored");
+ return {{{ cDefine('EMSCRIPTEN_RESULT_SUCCESS') }}};
+ },
+};
+
+autoAddDeps(LibraryJSEvents, '$JSEvents');
+mergeInto(LibraryManager.library, LibraryJSEvents);
diff --git a/src/library_idbfs.js b/src/library_idbfs.js
index 7f50f17e..91015e77 100644
--- a/src/library_idbfs.js
+++ b/src/library_idbfs.js
@@ -5,14 +5,12 @@ mergeInto(LibraryManager.library, {
indexedDB: function() {
return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
},
- DB_VERSION: 20,
+ DB_VERSION: 21,
DB_STORE_NAME: 'FILE_DATA',
- // reuse all of the core MEMFS functionality
mount: function(mount) {
+ // reuse all of the core MEMFS functionality
return MEMFS.mount.apply(null, arguments);
},
- // the only custom function IDBFS implements is to handle
- // synchronizing the wrapped MEMFS with a backing IDB instance
syncfs: function(mount, populate, callback) {
IDBFS.getLocalSet(mount, function(err, local) {
if (err) return callback(err);
@@ -27,103 +25,46 @@ mergeInto(LibraryManager.library, {
});
});
},
- reconcile: function(src, dst, callback) {
- var total = 0;
-
- var create = {};
- for (var key in src.files) {
- if (!src.files.hasOwnProperty(key)) continue;
- var e = src.files[key];
- var e2 = dst.files[key];
- if (!e2 || e.timestamp > e2.timestamp) {
- create[key] = e;
- total++;
- }
- }
-
- var remove = {};
- for (var key in dst.files) {
- if (!dst.files.hasOwnProperty(key)) continue;
- var e = dst.files[key];
- var e2 = src.files[key];
- if (!e2) {
- remove[key] = e;
- total++;
- }
+ getDB: function(name, callback) {
+ // check the cache first
+ var db = IDBFS.dbs[name];
+ if (db) {
+ return callback(null, db);
}
- if (!total) {
- // early out
- return callback(null);
+ var req;
+ try {
+ req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
+ } catch (e) {
+ return callback(e);
}
+ req.onupgradeneeded = function(e) {
+ var db = e.target.result;
+ var transaction = e.target.transaction;
- var completed = 0;
- function done(err) {
- if (err) return callback(err);
- if (++completed >= total) {
- return callback(null);
- }
- };
-
- // create a single transaction to handle and IDB reads / writes we'll need to do
- var db = src.type === 'remote' ? src.db : dst.db;
- var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
- transaction.onerror = function transaction_onerror() { callback(this.error); };
- var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
-
- for (var path in create) {
- if (!create.hasOwnProperty(path)) continue;
- var entry = create[path];
+ var fileStore;
- if (dst.type === 'local') {
- // save file to local
- try {
- if (FS.isDir(entry.mode)) {
- FS.mkdir(path, entry.mode);
- } else if (FS.isFile(entry.mode)) {
- var stream = FS.open(path, 'w+', 0666);
- FS.write(stream, entry.contents, 0, entry.contents.length, 0, true /* canOwn */);
- FS.close(stream);
- }
- done(null);
- } catch (e) {
- return done(e);
- }
+ if (db.objectStoreNames.contains(IDBFS.DB_STORE_NAME)) {
+ fileStore = transaction.objectStore(IDBFS.DB_STORE_NAME);
} else {
- // save file to IDB
- var req = store.put(entry, path);
- req.onsuccess = function req_onsuccess() { done(null); };
- req.onerror = function req_onerror() { done(this.error); };
+ fileStore = db.createObjectStore(IDBFS.DB_STORE_NAME);
}
- }
- for (var path in remove) {
- if (!remove.hasOwnProperty(path)) continue;
- var entry = remove[path];
+ fileStore.createIndex('timestamp', 'timestamp', { unique: false });
+ };
+ req.onsuccess = function() {
+ db = req.result;
- if (dst.type === 'local') {
- // delete file from local
- try {
- if (FS.isDir(entry.mode)) {
- // TODO recursive delete?
- FS.rmdir(path);
- } else if (FS.isFile(entry.mode)) {
- FS.unlink(path);
- }
- done(null);
- } catch (e) {
- return done(e);
- }
- } else {
- // delete file from IDB
- var req = store.delete(path);
- req.onsuccess = function req_onsuccess() { done(null); };
- req.onerror = function req_onerror() { done(this.error); };
- }
- }
+ // add to the cache
+ IDBFS.dbs[name] = db;
+ callback(null, db);
+ };
+ req.onerror = function() {
+ callback(this.error);
+ };
},
getLocalSet: function(mount, callback) {
- var files = {};
+ var entries = {};
function isRealDir(p) {
return p !== '.' && p !== '..';
@@ -134,83 +75,192 @@ mergeInto(LibraryManager.library, {
}
};
- var check = FS.readdir(mount.mountpoint)
- .filter(isRealDir)
- .map(toAbsolute(mount.mountpoint));
+ var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
while (check.length) {
var path = check.pop();
- var stat, node;
+ var stat;
try {
- var lookup = FS.lookupPath(path);
- node = lookup.node;
stat = FS.stat(path);
} catch (e) {
return callback(e);
}
if (FS.isDir(stat.mode)) {
- check.push.apply(check, FS.readdir(path)
- .filter(isRealDir)
- .map(toAbsolute(path)));
-
- files[path] = { mode: stat.mode, timestamp: stat.mtime };
- } else if (FS.isFile(stat.mode)) {
- files[path] = { contents: node.contents, mode: stat.mode, timestamp: stat.mtime };
- } else {
- return callback(new Error('node type not supported'));
+ check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
}
- }
- return callback(null, { type: 'local', files: files });
- },
- getDB: function(name, callback) {
- // look it up in the cache
- var db = IDBFS.dbs[name];
- if (db) {
- return callback(null, db);
- }
- var req;
- try {
- req = IDBFS.indexedDB().open(name, IDBFS.DB_VERSION);
- } catch (e) {
- return onerror(e);
+ entries[path] = { timestamp: stat.mtime };
}
- req.onupgradeneeded = function req_onupgradeneeded() {
- db = req.result;
- db.createObjectStore(IDBFS.DB_STORE_NAME);
- };
- req.onsuccess = function req_onsuccess() {
- db = req.result;
- // add to the cache
- IDBFS.dbs[name] = db;
- callback(null, db);
- };
- req.onerror = function req_onerror() {
- callback(this.error);
- };
+
+ return callback(null, { type: 'local', entries: entries });
},
getRemoteSet: function(mount, callback) {
- var files = {};
+ var entries = {};
IDBFS.getDB(mount.mountpoint, function(err, db) {
if (err) return callback(err);
var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readonly');
- transaction.onerror = function transaction_onerror() { callback(this.error); };
+ transaction.onerror = function() { callback(this.error); };
var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
- store.openCursor().onsuccess = function store_openCursor_onsuccess(event) {
+ var index = store.index('timestamp');
+
+ index.openKeyCursor().onsuccess = function(event) {
var cursor = event.target.result;
+
if (!cursor) {
- return callback(null, { type: 'remote', db: db, files: files });
+ return callback(null, { type: 'remote', db: db, entries: entries });
}
- files[cursor.key] = cursor.value;
+ entries[cursor.primaryKey] = { timestamp: cursor.key };
+
cursor.continue();
};
});
+ },
+ loadLocalEntry: function(path, callback) {
+ var stat, node;
+
+ try {
+ var lookup = FS.lookupPath(path);
+ node = lookup.node;
+ stat = FS.stat(path);
+ } catch (e) {
+ return callback(e);
+ }
+
+ if (FS.isDir(stat.mode)) {
+ return callback(null, { timestamp: stat.mtime, mode: stat.mode });
+ } else if (FS.isFile(stat.mode)) {
+ return callback(null, { timestamp: stat.mtime, mode: stat.mode, contents: node.contents });
+ } else {
+ return callback(new Error('node type not supported'));
+ }
+ },
+ storeLocalEntry: function(path, entry, callback) {
+ try {
+ if (FS.isDir(entry.mode)) {
+ FS.mkdir(path, entry.mode);
+ } else if (FS.isFile(entry.mode)) {
+ FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
+ } else {
+ return callback(new Error('node type not supported'));
+ }
+
+ FS.utime(path, entry.timestamp, entry.timestamp);
+ } catch (e) {
+ return callback(e);
+ }
+
+ callback(null);
+ },
+ removeLocalEntry: function(path, callback) {
+ try {
+ var lookup = FS.lookupPath(path);
+ var stat = FS.stat(path);
+
+ if (FS.isDir(stat.mode)) {
+ FS.rmdir(path);
+ } else if (FS.isFile(stat.mode)) {
+ FS.unlink(path);
+ }
+ } catch (e) {
+ return callback(e);
+ }
+
+ callback(null);
+ },
+ loadRemoteEntry: function(store, path, callback) {
+ var req = store.get(path);
+ req.onsuccess = function(event) { callback(null, event.target.result); };
+ req.onerror = function() { callback(this.error); };
+ },
+ storeRemoteEntry: function(store, path, entry, callback) {
+ var req = store.put(entry, path);
+ req.onsuccess = function() { callback(null); };
+ req.onerror = function() { callback(this.error); };
+ },
+ removeRemoteEntry: function(store, path, callback) {
+ var req = store.delete(path);
+ req.onsuccess = function() { callback(null); };
+ req.onerror = function() { callback(this.error); };
+ },
+ reconcile: function(src, dst, callback) {
+ var total = 0;
+
+ var create = [];
+ Object.keys(src.entries).forEach(function (key) {
+ var e = src.entries[key];
+ var e2 = dst.entries[key];
+ if (!e2 || e.timestamp > e2.timestamp) {
+ create.push(key);
+ total++;
+ }
+ });
+
+ var remove = [];
+ Object.keys(dst.entries).forEach(function (key) {
+ var e = dst.entries[key];
+ var e2 = src.entries[key];
+ if (!e2) {
+ remove.push(key);
+ total++;
+ }
+ });
+
+ if (!total) {
+ return callback(null);
+ }
+
+ var errored = false;
+ var completed = 0;
+ var db = src.type === 'remote' ? src.db : dst.db;
+ var transaction = db.transaction([IDBFS.DB_STORE_NAME], 'readwrite');
+ var store = transaction.objectStore(IDBFS.DB_STORE_NAME);
+
+ function done(err) {
+ if (err) {
+ if (!done.errored) {
+ done.errored = true;
+ return callback(err);
+ }
+ return;
+ }
+ if (++completed >= total) {
+ return callback(null);
+ }
+ };
+
+ transaction.onerror = function() { done(this.error); };
+
+ // sort paths in ascending order so directory entries are created
+ // before the files inside them
+ create.sort().forEach(function (path) {
+ if (dst.type === 'local') {
+ IDBFS.loadRemoteEntry(store, path, function (err, entry) {
+ if (err) return done(err);
+ IDBFS.storeLocalEntry(path, entry, done);
+ });
+ } else {
+ IDBFS.loadLocalEntry(path, function (err, entry) {
+ if (err) return done(err);
+ IDBFS.storeRemoteEntry(store, path, entry, done);
+ });
+ }
+ });
+
+ // sort paths in descending order so files are deleted before their
+ // parent directories
+ remove.sort().reverse().forEach(function(path) {
+ if (dst.type === 'local') {
+ IDBFS.removeLocalEntry(path, done);
+ } else {
+ IDBFS.removeRemoteEntry(store, path, done);
+ }
+ });
}
}
});
diff --git a/src/library_memfs.js b/src/library_memfs.js
index d3148d8b..95c3ae65 100644
--- a/src/library_memfs.js
+++ b/src/library_memfs.js
@@ -8,7 +8,7 @@ mergeInto(LibraryManager.library, {
CONTENT_FLEXIBLE: 2, // has been modified or never set to anything, and is a flexible js array that can grow/shrink
CONTENT_FIXED: 3, // contains some fixed-size content written into it, in a typed array
mount: function(mount) {
- return MEMFS.createNode(null, '/', {{{ cDefine('S_IFDIR') }}} | 0777, 0);
+ return MEMFS.createNode(null, '/', {{{ cDefine('S_IFDIR') }}} | 511 /* 0777 */, 0);
},
createNode: function(parent, name, mode, dev) {
if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
@@ -23,7 +23,6 @@ mergeInto(LibraryManager.library, {
setattr: MEMFS.node_ops.setattr,
lookup: MEMFS.node_ops.lookup,
mknod: MEMFS.node_ops.mknod,
- mknod: MEMFS.node_ops.mknod,
rename: MEMFS.node_ops.rename,
unlink: MEMFS.node_ops.unlink,
rmdir: MEMFS.node_ops.rmdir,
@@ -185,7 +184,7 @@ mergeInto(LibraryManager.library, {
return entries;
},
symlink: function(parent, newname, oldpath) {
- var node = MEMFS.createNode(parent, newname, 0777 | {{{ cDefine('S_IFLNK') }}}, 0);
+ var node = MEMFS.createNode(parent, newname, 511 /* 0777 */ | {{{ cDefine('S_IFLNK') }}}, 0);
node.link = oldpath;
return node;
},
diff --git a/src/library_openal.js b/src/library_openal.js
index eb152f62..bdbb2dca 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -5,6 +5,10 @@ var LibraryOpenAL = {
$AL: {
contexts: [],
currentContext: null,
+
+ stringCache: {},
+ alcStringCache: {},
+
QUEUE_INTERVAL: 25,
QUEUE_LOOKAHEAD: 100,
@@ -170,8 +174,8 @@ var LibraryOpenAL = {
},
alcOpenDevice: function(deviceName) {
- if (typeof(AudioContext) == "function" ||
- typeof(webkitAudioContext) == "function") {
+ if (typeof(AudioContext) !== "undefined" ||
+ typeof(webkitAudioContext) !== "undefined") {
return 1; // non-null pointer -- we just simulate one device
} else {
return 0;
@@ -201,12 +205,15 @@ var LibraryOpenAL = {
}
if (ctx) {
+ var gain = ctx.createGain();
+ gain.connect(ctx.destination);
var context = {
ctx: ctx,
err: 0,
src: [],
buf: [],
- interval: setInterval(function() { AL.updateSources(context); }, AL.QUEUE_INTERVAL)
+ interval: setInterval(function() { AL.updateSources(context); }, AL.QUEUE_INTERVAL),
+ gain: gain
};
AL.contexts.push(context);
return AL.contexts.length;
@@ -232,6 +239,42 @@ var LibraryOpenAL = {
return _alGetError();
},
+ alcGetIntegerv: function(device, param, size, data) {
+ if (size == 0 || !data) {
+ AL.currentContext.err = 0xA003 /* AL_INVALID_VALUE */;
+ return;
+ }
+
+ switch(param) {
+ case 0x1000 /* ALC_MAJOR_VERSION */:
+ {{{ makeSetValue('data', '0', '1', 'i32') }}};
+ break;
+ case 0x1001 /* ALC_MINOR_VERSION */:
+ {{{ makeSetValue('data', '0', '1', 'i32') }}};
+ break;
+ case 0x1002 /* ALC_ATTRIBUTES_SIZE */:
+ if (!device) {
+ AL.currentContext.err = 0xA001 /* ALC_INVALID_DEVICE */;
+ return 0;
+ }
+ {{{ makeSetValue('data', '0', '1', 'i32') }}};
+ break;
+ case 0x1003 /* ALC_ALL_ATTRIBUTES */:
+ if (!device) {
+ AL.currentContext.err = 0xA001 /* ALC_INVALID_DEVICE */;
+ return 0;
+ }
+ {{{ makeSetValue('data', '0', '0', 'i32') }}};
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.log("alcGetIntegerv with param " + param + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA003 /* ALC_INVALID_ENUM */;
+ break;
+ }
+ },
+
alDeleteSources: function(count, sources) {
if (!AL.currentContext) {
#if OPENAL_DEBUG
@@ -254,7 +297,7 @@ var LibraryOpenAL = {
}
for (var i = 0; i < count; ++i) {
var gain = AL.currentContext.ctx.createGain();
- gain.connect(AL.currentContext.ctx.destination);
+ gain.connect(AL.currentContext.gain);
AL.currentContext.src.push({
state: 0x1011 /* AL_INITIAL */,
queue: [],
@@ -294,6 +337,34 @@ var LibraryOpenAL = {
this._velocity = val;
if (this.panner) this.panner.setVelocity(val[0], val[1], val[2]);
},
+ get direction() {
+ return this._direction || [0, 0, 0];
+ },
+ set direction(val) {
+ this._direction = val;
+ if (this.panner) this.panner.setOrientation(val[0], val[1], val[2]);
+ },
+ get coneOuterGain() {
+ return this._coneOuterGain || 0.0;
+ },
+ set coneOuterGain(val) {
+ this._coneOuterGain = val;
+ if (this.panner) this.panner.coneOuterGain = val;
+ },
+ get coneInnerAngle() {
+ return this._coneInnerAngle || 360.0;
+ },
+ set coneInnerAngle(val) {
+ this._coneInnerAngle = val;
+ if (this.panner) this.panner.coneInnerAngle = val;
+ },
+ get coneOuterAngle() {
+ return this._coneOuterAngle || 360.0;
+ },
+ set coneOuterAngle(val) {
+ this._coneOuterAngle = val;
+ if (this.panner) this.panner.coneOuterAngle = val;
+ },
gain: gain,
panner: null,
buffersPlayed: 0,
@@ -303,6 +374,18 @@ var LibraryOpenAL = {
}
},
+ alIsSource: function(sourceId) {
+ if (!AL.currentContext) {
+ return false;
+ }
+
+ if (!AL.currentContext.src[sourceId - 1]) {
+ return false;
+ } else {
+ return true;
+ }
+ },
+
alSourcei__deps: ['updateSource'],
alSourcei: function(source, param, value) {
if (!AL.currentContext) {
@@ -320,6 +403,12 @@ var LibraryOpenAL = {
return;
}
switch (param) {
+ case 0x1001 /* AL_CONE_INNER_ANGLE */:
+ src.coneInnerAngle = value;
+ break;
+ case 0x1002 /* AL_CONE_OUTER_ANGLE */:
+ src.coneOuterAngle = value;
+ break;
case 0x1007 /* AL_LOOPING */:
src.loop = (value === 1 /* AL_TRUE */);
break;
@@ -406,12 +495,15 @@ var LibraryOpenAL = {
case 0x1021 /* AL_ROLLOFF_FACTOR */:
src.rolloffFactor = value;
break;
- // case 0x1022 /* AL_CONE_OUTER_GAIN */:
- // break;
- // case 0x1001 /* AL_CONE_INNER_ANGLE */:
- // break;
- // case 0x1002 /* AL_CONE_OUTER_ANGLE */:
- // break;
+ case 0x1022 /* AL_CONE_OUTER_GAIN */:
+ src.coneOuterGain = value;
+ break;
+ case 0x1001 /* AL_CONE_INNER_ANGLE */:
+ src.coneInnerAngle = value;
+ break;
+ case 0x1002 /* AL_CONE_OUTER_ANGLE */:
+ src.coneOuterAngle = value;
+ break;
case 0x1020 /* AL_REFERENCE_DISTANCE */:
src.refDistance = value;
break;
@@ -443,6 +535,9 @@ var LibraryOpenAL = {
case 0x1004 /* AL_POSITION */:
src.position = [v1, v2, v3];
break;
+ case 0x1005 /* AL_DIRECTION */:
+ src.direction = [v1, v2, v3];
+ break;
case 0x1006 /* AL_VELOCITY */:
src.velocity = [v1, v2, v3];
break;
@@ -594,6 +689,21 @@ var LibraryOpenAL = {
}
},
+ alIsBuffer: function(bufferId) {
+ if (!AL.currentContext) {
+ return false;
+ }
+ if (bufferId > AL.currentContext.buf.length) {
+ return false;
+ }
+
+ if (!AL.currentContext.buf[bufferId - 1]) {
+ return false;
+ } else {
+ return true;
+ }
+ },
+
alBufferData: function(buffer, format, data, size, freq) {
if (!AL.currentContext) {
#if OPENAL_DEBUG
@@ -633,6 +743,7 @@ var LibraryOpenAL = {
}
try {
AL.currentContext.buf[buffer - 1] = AL.currentContext.ctx.createBuffer(channels, size / (bytes * channels), freq);
+ AL.currentContext.buf[buffer - 1].bytesPerSample = bytes;
} catch (e) {
AL.currentContext.err = 0xA003 /* AL_INVALID_VALUE */;
return;
@@ -657,6 +768,41 @@ var LibraryOpenAL = {
}
},
+ alGetBufferi: function(buffer, param, value)
+ {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alGetBufferi called without a valid context");
+#endif
+ return;
+ }
+ var buf = AL.currentContext.buf[buffer - 1];
+ if (!buf) {
+#if OPENAL_DEBUG
+ console.error("alGetBufferi called with an invalid buffer");
+#endif
+ AL.currentContext.err = 0xA001 /* AL_INVALID_NAME */;
+ return;
+ }
+ switch (param) {
+ case 0x2001 /* AL_FREQUENCY */:
+ {{{ makeSetValue('value', '0', 'buf.sampleRate', 'i32') }}};
+ break;
+ case 0x2002 /* AL_BITS */:
+ {{{ makeSetValue('value', '0', 'buf.bytesPerSample * 8', 'i32') }}};
+ break;
+ case 0x2003 /* AL_CHANNELS */:
+ {{{ makeSetValue('value', '0', 'buf.numberOfChannels', 'i32') }}};
+ break;
+ case 0x2004 /* AL_SIZE */:
+ {{{ makeSetValue('value', '0', 'buf.length * buf.bytesPerSample * buf.numberOfChannels', 'i32') }}};
+ break;
+ default:
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
alSourcePlay__deps: ['setSourceState'],
alSourcePlay: function(source) {
if (!AL.currentContext) {
@@ -743,6 +889,12 @@ var LibraryOpenAL = {
case 0x202 /* AL_SOURCE_RELATIVE */:
{{{ makeSetValue('value', '0', 'src.panner ? 1 : 0', 'i32') }}};
break;
+ case 0x1001 /* AL_CONE_INNER_ANGLE */:
+ {{{ makeSetValue('value', '0', 'src.coneInnerAngle', 'i32') }}};
+ break;
+ case 0x1002 /* AL_CONE_OUTER_ANGLE */:
+ {{{ makeSetValue('value', '0', 'src.coneOuterAngle', 'i32') }}};
+ break;
case 0x1009 /* AL_BUFFER */:
if (!src.queue.length) {
{{{ makeSetValue('value', '0', '0', 'i32') }}};
@@ -809,12 +961,15 @@ var LibraryOpenAL = {
case 0x1021 /* AL_ROLLOFF_FACTOR */:
{{{ makeSetValue('value', '0', 'src.rolloffFactor', 'float') }}}
break;
- // case 0x1022 /* AL_CONE_OUTER_GAIN */:
- // break;
- // case 0x1001 /* AL_CONE_INNER_ANGLE */:
- // break;
- // case 0x1002 /* AL_CONE_OUTER_ANGLE */:
- // break;
+ case 0x1022 /* AL_CONE_OUTER_GAIN */:
+ {{{ makeSetValue('value', '0', 'src.coneOuterGain', 'float') }}}
+ break;
+ case 0x1001 /* AL_CONE_INNER_ANGLE */:
+ {{{ makeSetValue('value', '0', 'src.coneInnerAngle', 'float') }}}
+ break;
+ case 0x1002 /* AL_CONE_OUTER_ANGLE */:
+ {{{ makeSetValue('value', '0', 'src.coneOuterAngle', 'float') }}}
+ break;
case 0x1020 /* AL_REFERENCE_DISTANCE */:
{{{ makeSetValue('value', '0', 'src.refDistance', 'float') }}}
break;
@@ -830,6 +985,49 @@ var LibraryOpenAL = {
}
},
+ alGetSourcefv: function(source, param, values) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alGetSourcefv called without a valid context");
+#endif
+ return;
+ }
+ var src = AL.currentContext.src[source - 1];
+ if (!src) {
+#if OPENAL_DEBUG
+ console.error("alGetSourcefv called with an invalid source");
+#endif
+ AL.currentContext.err = 0xA001 /* AL_INVALID_NAME */;
+ return;
+ }
+ switch (param) {
+ case 0x1004 /* AL_POSITION */:
+ var position = src.position;
+ {{{ makeSetValue('values', '0', 'position[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'position[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'position[2]', 'float') }}}
+ break;
+ case 0x1005 /* AL_DIRECTION */:
+ var direction = src.direction;
+ {{{ makeSetValue('values', '0', 'direction[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'direction[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'direction[2]', 'float') }}}
+ break;
+ case 0x1006 /* AL_VELOCITY */:
+ var velocity = src.velocity;
+ {{{ makeSetValue('values', '0', 'velocity[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'velocity[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'velocity[2]', 'float') }}}
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.error("alGetSourcefv with param " + param + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
alDistanceModel: function(model) {
if (model !== 0 /* AL_NONE */) {
#if OPENAL_DEBUG
@@ -838,6 +1036,136 @@ var LibraryOpenAL = {
}
},
+ alGetListenerf: function(pname, values) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alGetListenerf called without a valid context");
+#endif
+ return;
+ }
+ switch (pname) {
+ case 0x100A /* AL_GAIN */:
+ {{{ makeSetValue('value', '0', 'AL.currentContext.gain.gain', 'float') }}}
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.error("alGetListenerf with param " + pname + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+
+ },
+
+ alGetListenerfv: function(pname, values) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alGetListenerfv called without a valid context");
+#endif
+ return;
+ }
+ switch (pname) {
+ case 0x1004 /* AL_POSITION */:
+ var position = AL.currentContext.ctx.listener._position || [0,0,0];
+ {{{ makeSetValue('values', '0', 'position[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'position[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'position[2]', 'float') }}}
+ break;
+ case 0x1006 /* AL_VELOCITY */:
+ var velocity = AL.currentContext.ctx.listener._velocity || [0,0,0];
+ {{{ makeSetValue('values', '0', 'velocity[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'velocity[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'velocity[2]', 'float') }}}
+ break;
+ case 0x100F /* AL_ORIENTATION */:
+ var orientation = AL.currentContext.ctx.listener._orientation || [0,0,0,0,0,0];
+ {{{ makeSetValue('values', '0', 'orientation[0]', 'float') }}}
+ {{{ makeSetValue('values', '4', 'orientation[1]', 'float') }}}
+ {{{ makeSetValue('values', '8', 'orientation[2]', 'float') }}}
+ {{{ makeSetValue('values', '12', 'orientation[3]', 'float') }}}
+ {{{ makeSetValue('values', '16', 'orientation[4]', 'float') }}}
+ {{{ makeSetValue('values', '20', 'orientation[5]', 'float') }}}
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.error("alGetListenerfv with param " + pname + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
+ alGetListeneri: function(pname, value) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alGetListeneri called without a valid context");
+#endif
+ return;
+ }
+ switch (pname) {
+ default:
+#if OPENAL_DEBUG
+ console.error("alGetListeneri with param " + pname + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
+ alListenerf: function(param, value) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alListenerf called without a valid context");
+#endif
+ return;
+ }
+ switch (param) {
+ case 0x100A /* AL_GAIN */:
+ AL.currentContext.gain.value = value;
+ break;
+ default:
+#if OPENAL_DEBUG
+ console.error("alListenerf with param " + param + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
+ alEnable: function(param) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alEnable called without a valid context");
+#endif
+ return;
+ }
+ switch (param) {
+ default:
+#if OPENAL_DEBUG
+ console.error("alEnable with param " + param + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
+ alDisable: function(param) {
+ if (!AL.currentContext) {
+#if OPENAL_DEBUG
+ console.error("alDisable called without a valid context");
+#endif
+ return;
+ }
+ switch (pname) {
+ default:
+#if OPENAL_DEBUG
+ console.error("alDisable with param " + param + " not implemented yet");
+#endif
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ break;
+ }
+ },
+
alListenerfv: function(param, values) {
if (!AL.currentContext) {
#if OPENAL_DEBUG
@@ -847,32 +1175,32 @@ var LibraryOpenAL = {
}
switch (param) {
case 0x1004 /* AL_POSITION */:
- AL.currentContext.ctx.listener.setPosition(
- {{{ makeGetValue('values', '0', 'float') }}},
- {{{ makeGetValue('values', '4', 'float') }}},
- {{{ makeGetValue('values', '8', 'float') }}}
- );
+ var x = {{{ makeGetValue('values', '0', 'float') }}};
+ var y = {{{ makeGetValue('values', '4', 'float') }}};
+ var z = {{{ makeGetValue('values', '8', 'float') }}};
+ AL.currentContext.ctx.listener._position = [x, y, z];
+ AL.currentContext.ctx.listener.setPosition(x, y, z);
break;
case 0x1006 /* AL_VELOCITY */:
- AL.currentContext.ctx.listener.setVelocity(
- {{{ makeGetValue('values', '0', 'float') }}},
- {{{ makeGetValue('values', '4', 'float') }}},
- {{{ makeGetValue('values', '8', 'float') }}}
- );
+ var x = {{{ makeGetValue('values', '0', 'float') }}};
+ var y = {{{ makeGetValue('values', '4', 'float') }}};
+ var z = {{{ makeGetValue('values', '8', 'float') }}};
+ AL.currentContext.ctx.listener._velocity = [x, y, z];
+ AL.currentContext.ctx.listener.setVelocity(x, y, z);
break;
case 0x100F /* AL_ORIENTATION */:
- AL.currentContext.ctx.listener.setOrientation(
- {{{ makeGetValue('values', '0', 'float') }}},
- {{{ makeGetValue('values', '4', 'float') }}},
- {{{ makeGetValue('values', '8', 'float') }}},
- {{{ makeGetValue('values', '12', 'float') }}},
- {{{ makeGetValue('values', '16', 'float') }}},
- {{{ makeGetValue('values', '20', 'float') }}}
- );
+ var x = {{{ makeGetValue('values', '0', 'float') }}};
+ var y = {{{ makeGetValue('values', '4', 'float') }}};
+ var z = {{{ makeGetValue('values', '8', 'float') }}};
+ var x2 = {{{ makeGetValue('values', '12', 'float') }}};
+ var y2 = {{{ makeGetValue('values', '16', 'float') }}};
+ var z2 = {{{ makeGetValue('values', '20', 'float') }}};
+ AL.currentContext.ctx.listener._orientation = [x, y, z, x2, y2, z2];
+ AL.currentContext.ctx.listener.setOrientation(x, y, z, x2, y2, z2);
break;
default:
#if OPENAL_DEBUG
- console.log("alListenerfv with param " + param + " not implemented yet");
+ console.error("alListenerfv with param " + param + " not implemented yet");
#endif
AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
break;
@@ -888,15 +1216,116 @@ var LibraryOpenAL = {
},
alGetString: function(param) {
- return allocate(intArrayFromString('NA'), 'i8', ALLOC_NORMAL);
+ if (AL.stringCache[param]) return AL.stringCache[param];
+ var ret;
+ switch (param) {
+ case 0 /* AL_NO_ERROR */:
+ ret = 'No Error';
+ break;
+ case 0xA001 /* AL_INVALID_NAME */:
+ ret = 'Invalid Name';
+ break;
+ case 0xA002 /* AL_INVALID_ENUM */:
+ ret = 'Invalid Enum';
+ break;
+ case 0xA003 /* AL_INVALID_VALUE */:
+ ret = 'Invalid Value';
+ break;
+ case 0xA004 /* AL_INVALID_OPERATION */:
+ ret = 'Invalid Operation';
+ break;
+ case 0xA005 /* AL_OUT_OF_MEMORY */:
+ ret = 'Out of Memory';
+ break;
+ case 0xB001 /* AL_VENDOR */:
+ ret = 'Emscripten';
+ break;
+ case 0xB002 /* AL_VERSION */:
+ ret = '1.1';
+ break;
+ case 0xB003 /* AL_RENDERER */:
+ ret = 'WebAudio';
+ break;
+ case 0xB004 /* AL_EXTENSIONS */:
+ ret = '';
+ break;
+ default:
+ AL.currentContext.err = 0xA002 /* AL_INVALID_ENUM */;
+ return 0;
+ }
+
+ ret = allocate(intArrayFromString(ret), 'i8', ALLOC_NORMAL);
+
+ AL.stringCache[param] = ret;
+
+ return ret;
},
alGetProcAddress: function(fname) {
return 0;
},
- alcGetString: function(param) {
- return allocate(intArrayFromString('NA'), 'i8', ALLOC_NORMAL);
+ alcGetString: function(device, param) {
+ if (AL.alcStringCache[param]) return AL.alcStringCache[param];
+ var ret;
+ switch (param) {
+ case 0 /* ALC_NO_ERROR */:
+ ret = 'No Error';
+ break;
+ case 0xA001 /* ALC_INVALID_DEVICE */:
+ ret = 'Invalid Device';
+ break;
+ case 0xA002 /* ALC_INVALID_CONTEXT */:
+ ret = 'Invalid Context';
+ break;
+ case 0xA003 /* ALC_INVALID_ENUM */:
+ ret = 'Invalid Enum';
+ break;
+ case 0xA004 /* ALC_INVALID_VALUE */:
+ ret = 'Invalid Value';
+ break;
+ case 0xA005 /* ALC_OUT_OF_MEMORY */:
+ ret = 'Out of Memory';
+ break;
+ case 0x1004 /* ALC_DEFAULT_DEVICE_SPECIFIER */:
+ if (typeof(AudioContext) == "function" ||
+ typeof(webkitAudioContext) == "function") {
+ ret = 'Device';
+ } else {
+ return 0;
+ }
+ break;
+ case 0x1005 /* ALC_DEVICE_SPECIFIER */:
+ if (typeof(AudioContext) == "function" ||
+ typeof(webkitAudioContext) == "function") {
+ ret = 'Device\0';
+ } else {
+ ret = '\0';
+ }
+ break;
+ case 0x311 /* ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER */:
+ return 0;
+ break;
+ case 0x310 /* ALC_CAPTURE_DEVICE_SPECIFIER */:
+ ret = '\0'
+ break;
+ case 0x1006 /* ALC_EXTENSIONS */:
+ if (!device) {
+ AL.currentContext.err = 0xA001 /* ALC_INVALID_DEVICE */;
+ return 0;
+ }
+ ret = '';
+ break;
+ default:
+ AL.currentContext.err = 0xA003 /* ALC_INVALID_ENUM */;
+ return 0;
+ }
+
+ ret = allocate(intArrayFromString(ret), 'i8', ALLOC_NORMAL);
+
+ AL.alcStringCache[param] = ret;
+
+ return ret;
},
alcGetProcAddress: function(device, fname) {
diff --git a/src/library_sdl.js b/src/library_sdl.js
index fc38dd1c..0755a9cc 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -214,39 +214,44 @@ var LibrarySDL = {
makeSurface: function(width, height, flags, usePageCanvas, source, rmask, gmask, bmask, amask) {
flags = flags || 0;
- var surf = _malloc({{{ C_STRUCTS.SDL_Surface.__size__ }}}); // SDL_Surface has 15 fields of quantum size
- var buffer = _malloc(width*height*4); // TODO: only allocate when locked the first time
- var pixelFormat = _malloc({{{ C_STRUCTS.SDL_PixelFormat.__size__ }}});
- flags |= 1; // SDL_HWSURFACE - this tells SDL_MUSTLOCK that this needs to be locked
+ var is_SDL_HWSURFACE = flags & 0x00000001;
+ var is_SDL_HWPALETTE = flags & 0x00200000;
+ var is_SDL_OPENGL = flags & 0x04000000;
+ var surf = _malloc({{{ C_STRUCTS.SDL_Surface.__size__ }}});
+ var pixelFormat = _malloc({{{ C_STRUCTS.SDL_PixelFormat.__size__ }}});
//surface with SDL_HWPALETTE flag is 8bpp surface (1 byte)
- var is_SDL_HWPALETTE = flags & 0x00200000;
var bpp = is_SDL_HWPALETTE ? 1 : 4;
-
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.flags, 'flags', 'i32') }}} // SDL_Surface.flags
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.format, 'pixelFormat', 'void*') }}} // SDL_Surface.format TODO
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.w, 'width', 'i32') }}} // SDL_Surface.w
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.h, 'height', 'i32') }}} // SDL_Surface.h
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pitch, 'width * bpp', 'i32') }}} // SDL_Surface.pitch, assuming RGBA or indexed for now,
- // since that is what ImageData gives us in browsers
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pixels, 'buffer', 'void*') }}} // SDL_Surface.pixels
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.clip_rect, '0', 'i32*') }}} // SDL_Surface.offset
-
- {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.refcount, '1', 'i32') }}}
-
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.format, cDefine('SDL_PIXELFORMAT_RGBA8888'), 'i32') }}} // SDL_PIXELFORMAT_RGBA8888
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.palette, '0', 'i32') }}} // TODO
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BitsPerPixel, 'bpp * 8', 'i8') }}}
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BytesPerPixel, 'bpp', 'i8') }}}
-
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Rmask, 'rmask || 0x000000ff', 'i32') }}}
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Gmask, 'gmask || 0x0000ff00', 'i32') }}}
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Bmask, 'bmask || 0x00ff0000', 'i32') }}}
- {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Amask, 'amask || 0xff000000', 'i32') }}}
+ var buffer = 0;
+
+ // preemptively initialize this for software surfaces,
+ // otherwise it will be lazily initialized inside of SDL_LockSurface
+ if (!is_SDL_HWSURFACE && !is_SDL_OPENGL) {
+ buffer = _malloc(width * height * 4);
+ }
+
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.flags, 'flags', 'i32') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.format, 'pixelFormat', 'void*') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.w, 'width', 'i32') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.h, 'height', 'i32') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pitch, 'width * bpp', 'i32') }}}; // assuming RGBA or indexed for now,
+ // since that is what ImageData gives us in browsers
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pixels, 'buffer', 'void*') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.clip_rect, '0', 'i32*') }}};
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.refcount, '1', 'i32') }}};
+
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.format, cDefine('SDL_PIXELFORMAT_RGBA8888'), 'i32') }}};
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.palette, '0', 'i32') }}};// TODO
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BitsPerPixel, 'bpp * 8', 'i8') }}};
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.BytesPerPixel, 'bpp', 'i8') }}};
+
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Rmask, 'rmask || 0x000000ff', 'i32') }}};
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Gmask, 'gmask || 0x0000ff00', 'i32') }}};
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Bmask, 'bmask || 0x00ff0000', 'i32') }}};
+ {{{ makeSetValue('pixelFormat', C_STRUCTS.SDL_PixelFormat.Amask, 'amask || 0xff000000', 'i32') }}};
// Decide if we want to use WebGL or not
- var useWebGL = (flags & 0x04000000) != 0; // SDL_OPENGL
- SDL.GL = SDL.GL || useWebGL;
+ SDL.GL = SDL.GL || is_SDL_OPENGL;
var canvas;
if (!usePageCanvas) {
if (SDL.canvasPool.length > 0) {
@@ -266,7 +271,7 @@ var LibrarySDL = {
stencil: (SDL.glAttributes[7 /*SDL_GL_STENCIL_SIZE*/] > 0)
};
- var ctx = Browser.createContext(canvas, useWebGL, usePageCanvas, webGLContextAttributes);
+ var ctx = Browser.createContext(canvas, is_SDL_OPENGL, usePageCanvas, webGLContextAttributes);
SDL.surfaces[surf] = {
width: width,
@@ -337,7 +342,7 @@ var LibrarySDL = {
var info = SDL.surfaces[surf];
if (!info.usePageCanvas && info.canvas) SDL.canvasPool.push(info.canvas);
- _free(info.buffer);
+ if (info.buffer) _free(info.buffer);
_free(info.pixelFormat);
_free(surf);
SDL.surfaces[surf] = null;
@@ -407,12 +412,12 @@ var LibrarySDL = {
// won't fire. However, it's fine (and in some cases necessary) to
// preventDefault for keys that don't generate a character. Otherwise,
// preventDefault is the right thing to do in general.
- if (event.type !== 'keydown' || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) {
+ if (event.type !== 'keydown' || (!SDL.unicode && !SDL.textInput) || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) {
event.preventDefault();
}
if (event.type == 'DOMMouseScroll' || event.type == 'mousewheel') {
- var button = (event.type == 'DOMMouseScroll' ? event.detail : -event.wheelDelta) > 0 ? 4 : 3;
+ var button = Browser.getMouseWheelDelta(event) > 0 ? 4 : 3;
var event2 = {
type: 'mousedown',
button: button,
@@ -592,19 +597,19 @@ var LibrarySDL = {
scan = SDL.scanCodes[key] || key;
}
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}}
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.state, 'down ? 1 : 0', 'i8') }}}
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.repeat, '0', 'i8') }}} // TODO
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.scancode, 'scan', 'i32') }}}
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.sym, 'key', 'i32') }}}
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.mod, 'SDL.modState', 'i16') }}}
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.state, 'down ? 1 : 0', 'i8') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.repeat, '0', 'i8') }}}; // TODO
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.scancode, 'scan', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.sym, 'key', 'i32') }}};
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.mod, 'SDL.modState', 'i16') }}};
// some non-character keys (e.g. backspace and tab) won't have keypressCharCode set, fill in with the keyCode.
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.unicode, 'event.keypressCharCode || key', 'i32') }}}
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_KeyboardEvent.keysym + C_STRUCTS.SDL_Keysym.unicode, 'event.keypressCharCode || key', 'i32') }}};
break;
}
case 'keypress': {
- {{{ makeSetValue('ptr', C_STRUCTS.SDL_TextInputEvent.type, 'SDL.DOMEventToSDLEvent[event.type]', 'i32') }}}
+ {{{ makeSetValue('ptr', C_STRUCTS.SDL_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) {
@@ -701,6 +706,29 @@ var LibrarySDL = {
return ret;
},
+ fillWebAudioBufferFromHeap: function(heapPtr, sizeSamplesPerChannel, dstAudioBuffer) {
+ // The input audio data is interleaved across the channels, i.e. [L, R, L, R, L, R, ...] and is either 8-bit or 16-bit as
+ // supported by the SDL API. The output audio wave data for Web Audio API must be in planar buffers of [-1,1]-normalized Float32 data,
+ // so perform a buffer conversion for the data.
+ var numChannels = SDL.audio.channels;
+ for(var c = 0; c < numChannels; ++c) {
+ var channelData = dstAudioBuffer['getChannelData'](c);
+ if (channelData.length != sizeSamplesPerChannel) {
+ throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + sizeSamplesPerChannel + ' samples!';
+ }
+ if (SDL.audio.format == 0x8010 /*AUDIO_S16LSB*/) {
+ for(var j = 0; j < sizeSamplesPerChannel; ++j) {
+ channelData[j] = ({{{ makeGetValue('heapPtr', '(j*numChannels + c)*2', 'i16', 0, 0) }}}) / 0x8000;
+ }
+ } else if (SDL.audio.format == 0x0008 /*AUDIO_U8*/) {
+ for(var j = 0; j < sizeSamplesPerChannel; ++j) {
+ var v = ({{{ makeGetValue('heapPtr', 'j*numChannels + c', 'i8', 0, 0) }}});
+ channelData[j] = ((v >= 0) ? v-128 : v+128) /128;
+ }
+ }
+ }
+ },
+
// Debugging
debugSurface: function(surfData) {
@@ -819,9 +847,9 @@ var LibrarySDL = {
SDL_Linked_Version: function() {
if (SDL.version === null) {
SDL.version = _malloc({{{ C_STRUCTS.SDL_version.__size__ }}});
- {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.major, '0', '1', 'i8') }}}
- {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.minor, '0', '3', 'i8') }}}
- {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.patch, '0', '0', 'i8') }}}
+ {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.major, '0', '1', 'i8') }}};
+ {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.minor, '0', '3', 'i8') }}};
+ {{{ makeSetValue('SDL.version + ' + C_STRUCTS.SDL_version.patch, '0', '0', 'i8') }}};
}
return SDL.version;
},
@@ -879,11 +907,11 @@ var LibrarySDL = {
SDL_GetVideoInfo: function() {
// %struct.SDL_VideoInfo = type { i32, i32, %struct.SDL_PixelFormat*, i32, i32 } - 5 fields of quantum size
var ret = _malloc(5*Runtime.QUANTUM_SIZE);
- {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*0', '0', '0', 'i32') }}} // TODO
- {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*1', '0', '0', 'i32') }}} // TODO
- {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*2', '0', '0', 'void*') }}}
- {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*3', '0', 'Module["canvas"].width', 'i32') }}}
- {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*4', '0', 'Module["canvas"].height', 'i32') }}}
+ {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*0', '0', '0', 'i32') }}}; // TODO
+ {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*1', '0', '0', 'i32') }}}; // TODO
+ {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*2', '0', '0', 'void*') }}};
+ {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*3', '0', 'Module["canvas"].width', 'i32') }}};
+ {{{ makeSetValue('ret+Runtime.QUANTUM_SIZE*4', '0', 'Module["canvas"].height', 'i32') }}};
return ret;
},
@@ -986,6 +1014,11 @@ var LibrarySDL = {
surfData.locked++;
if (surfData.locked > 1) return 0;
+ if (!surfData.buffer) {
+ surfData.buffer = _malloc(surfData.width * surfData.height * 4);
+ {{{ makeSetValue('surf', C_STRUCTS.SDL_Surface.pixels, 'surfData.buffer', 'void*') }}};
+ }
+
// Mark in C/C++-accessible SDL structure
// SDL_Surface has the following fields: Uint32 flags, SDL_PixelFormat *format; int w, h; Uint16 pitch; void *pixels; ...
// So we have fields all of the same size, and 5 of them before us.
@@ -1045,8 +1078,9 @@ var LibrarySDL = {
var surfData = SDL.surfaces[surf];
- surfData.locked--;
- if (surfData.locked > 0) return;
+ if (!surfData.locked || --surfData.locked > 0) {
+ return;
+ }
// Copy pixel data to image
if (surfData.isFlagSet(0x00200000 /* SDL_HWPALETTE */)) {
@@ -1220,6 +1254,11 @@ var LibrarySDL = {
return SDL.errorMessage;
},
+ SDL_SetError: function() {},
+
+ SDL_Malloc: 'malloc',
+ SDL_Free: 'free',
+
SDL_CreateRGBSurface: function(flags, width, height, depth, rmask, gmask, bmask, amask) {
return SDL.makeSurface(width, height, flags, false, 'CreateRGBSurface', rmask, gmask, bmask, amask);
},
@@ -1265,7 +1304,7 @@ var LibrarySDL = {
dstData.ctx.globalAlpha = oldAlpha;
if (dst != SDL.screen) {
// XXX As in IMG_Load, for compatibility we write out |pixels|
- console.log('WARNING: copying canvas data to memory for compatibility');
+ Runtime.warnOnce('WARNING: copying canvas data to memory for compatibility');
_SDL_LockSurface(dst);
dstData.locked--; // The surface is not actually locked in this hack
}
@@ -1723,6 +1762,7 @@ var LibrarySDL = {
SDL.audio.pushAudio=function(ptr,sizeBytes) {
try {
--SDL.audio.numAudioTimersPending;
+ if (SDL.audio.paused) return;
var sizeSamples = sizeBytes / SDL.audio.bytesPerSample; // How many samples fit in the callback buffer?
var sizeSamplesPerChannel = sizeSamples / SDL.audio.channels; // How many samples per a single channel fit in the cb buffer?
@@ -1738,26 +1778,7 @@ var LibrarySDL = {
var soundBuffer = SDL.audioContext['createBuffer'](SDL.audio.channels,sizeSamplesPerChannel,SDL.audio.freq);
SDL.audio.soundSource[SDL.audio.nextSoundSource]['connect'](SDL.audioContext['destination']);
- // The input audio data is interleaved across the channels, i.e. [L, R, L, R, L, R, ...] and is either 8-bit or 16-bit as
- // supported by the SDL API. The output audio wave data for Web Audio API must be in planar buffers of [-1,1]-normalized Float32 data,
- // so perform a buffer conversion for the data.
- var numChannels = SDL.audio.channels;
- for(var i = 0; i < numChannels; ++i) {
- var channelData = soundBuffer['getChannelData'](i);
- if (channelData.length != sizeSamplesPerChannel) {
- throw 'Web Audio output buffer length mismatch! Destination size: ' + channelData.length + ' samples vs expected ' + sizeSamplesPerChannel + ' samples!';
- }
- if (SDL.audio.format == 0x8010 /*AUDIO_S16LSB*/) {
- for(var j = 0; j < sizeSamplesPerChannel; ++j) {
- channelData[j] = ({{{ makeGetValue('ptr', '(j*numChannels + i)*2', 'i16', 0, 0) }}}) / 0x8000;
- }
- } else if (SDL.audio.format == 0x0008 /*AUDIO_U8*/) {
- for(var j = 0; j < sizeSamplesPerChannel; ++j) {
- var v = ({{{ makeGetValue('ptr', 'j*numChannels + i', 'i8', 0, 0) }}});
- channelData[j] = ((v >= 0) ? v-128 : v+128) /128;
- }
- }
- }
+ SDL.fillWebAudioBufferFromHeap(ptr, sizeSamplesPerChannel, soundBuffer);
// Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=883675 by setting the buffer only after filling. The order is important here!
source['buffer'] = soundBuffer;
@@ -1773,18 +1794,18 @@ var LibrarySDL = {
SDL.audio.soundSource[SDL.audio.nextSoundSource]['start'](playtime);
var buffer_duration = sizeSamplesPerChannel / SDL.audio.freq;
SDL.audio.nextPlayTime = playtime + buffer_duration;
- SDL.audio.nextSoundSource = (SDL.audio.nextSoundSource + 1) % 4;
+ // Timer will be scheduled before the buffer completed playing.
+ // Extra buffers are needed to avoid disturbing playing buffer.
+ SDL.audio.nextSoundSource = (SDL.audio.nextSoundSource + 1) % (SDL.audio.numSimultaneouslyQueuedBuffers + 2);
var secsUntilNextCall = playtime-curtime;
// Queue the next audio frame push to be performed when the previously queued buffer has finished playing.
- if (SDL.audio.numAudioTimersPending == 0) {
- var preemptBufferFeedMSecs = buffer_duration/2.0;
- SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, Math.max(0.0, 1000.0*secsUntilNextCall-preemptBufferFeedMSecs));
- ++SDL.audio.numAudioTimersPending;
- }
+ var preemptBufferFeedMSecs = 1000*buffer_duration/2.0;
+ SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, Math.max(0.0, 1000.0*secsUntilNextCall-preemptBufferFeedMSecs));
+ ++SDL.audio.numAudioTimersPending;
// If we are risking starving, immediately queue extra buffers.
- if (secsUntilNextCall <= buffer_duration && SDL.audio.numAudioTimersPending < SDL.audio.numSimultaneouslyQueuedBuffers) {
+ if (SDL.audio.numAudioTimersPending < SDL.audio.numSimultaneouslyQueuedBuffers) {
++SDL.audio.numAudioTimersPending;
Browser.safeSetTimeout(SDL.audio.caller, 1.0);
}
@@ -1836,11 +1857,27 @@ var LibrarySDL = {
SDL.audio.numAudioTimersPending = 0;
SDL.audio.timer = undefined;
}
- } else if (!SDL.audio.timer) {
- // Start the audio playback timer callback loop.
- SDL.audio.numAudioTimersPending = 1;
- SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, 1);
- SDL.audio.startTime = Date.now() / 1000.0; // Only used for Mozilla Audio Data API. Not needed for Web Audio API.
+ if (SDL.audio.scriptProcessorNode !== undefined) {
+ SDL.audio.scriptProcessorNode['disconnect']();
+ SDL.audio.scriptProcessorNode = undefined;
+ }
+ } else if (!SDL.audio.timer && !SDL.audio.scriptProcessorNode) {
+ // If we are using the same sampling frequency as the native sampling rate of the Web Audio graph is using, we can feed our buffers via
+ // Web Audio ScriptProcessorNode, which is a pull-mode API that calls back to our code to get audio data.
+ if (SDL.audioContext !== undefined && SDL.audio.freq == SDL.audioContext['sampleRate']) {
+ var sizeSamplesPerChannel = SDL.audio.bufferSize / SDL.audio.bytesPerSample / SDL.audio.channels; // How many samples per a single channel fit in the cb buffer?
+ SDL.audio.scriptProcessorNode = SDL.audioContext['createScriptProcessor'](sizeSamplesPerChannel, 0, SDL.audio.channels);
+ SDL.audio.scriptProcessorNode['onaudioprocess'] = function (e) {
+ Runtime.dynCall('viii', SDL.audio.callback, [SDL.audio.userdata, SDL.audio.buffer, SDL.audio.bufferSize]);
+ SDL.fillWebAudioBufferFromHeap(SDL.audio.buffer, sizeSamplesPerChannel, e['outputBuffer']);
+ }
+ SDL.audio.scriptProcessorNode['connect'](SDL.audioContext['destination']);
+ } else { // If we are using a different sampling rate, must manually queue audio data to the graph via timers.
+ // Start the audio playback timer callback loop.
+ SDL.audio.numAudioTimersPending = 1;
+ SDL.audio.timer = Browser.safeSetTimeout(SDL.audio.caller, 1);
+ SDL.audio.startTime = Date.now() / 1000.0; // Only used for Mozilla Audio Data API. Not needed for Web Audio API.
+ }
}
SDL.audio.paused = pauseOn;
},
@@ -2482,7 +2519,7 @@ var LibrarySDL = {
SDL_GL_GetProcAddress__deps: ['emscripten_GetProcAddress'],
SDL_GL_GetProcAddress: function(name_) {
- return _emscripten_GetProcAddress(Pointer_stringify(name_));
+ return _emscripten_GetProcAddress(name_);
},
SDL_GL_SwapBuffers: function() {},
@@ -2676,6 +2713,14 @@ var LibrarySDL = {
}
},
+ SDL_GetNumAudioDrivers: function() { return 1 },
+ SDL_GetCurrentAudioDriver: function() {
+ return allocate(intArrayFromString('Emscripten Audio'), 'i8', ALLOC_NORMAL);
+ },
+
+ SDL_GetAudioDriver__deps: ['SDL_GetCurrentAudioDriver'],
+ SDL_GetAudioDriver: function(index) { return _SDL_GetCurrentAudioDriver() },
+
SDL_EnableUNICODE: function(on) {
var ret = SDL.unicode || 0;
SDL.unicode = on;
@@ -2705,6 +2750,9 @@ var LibrarySDL = {
SDL_WM_IconifyWindow: function() { throw 'SDL_WM_IconifyWindow TODO' },
Mix_SetPostMix: function() { Runtime.warnOnce('Mix_SetPostMix: TODO') },
+
+ Mix_VolumeChunk: function(chunk, volume) { throw 'Mix_VolumeChunk: TODO' },
+ Mix_SetPosition: function(channel, angle, distance) { throw 'Mix_SetPosition: TODO' },
Mix_QuerySpec: function() { throw 'Mix_QuerySpec: TODO' },
Mix_FadeInChannelTimed: function() { throw 'Mix_FadeInChannelTimed' },
Mix_FadeOutChannel: function() { throw 'Mix_FadeOutChannel' },
diff --git a/src/library_sockfs.js b/src/library_sockfs.js
index 2028d841..22fd8761 100644
--- a/src/library_sockfs.js
+++ b/src/library_sockfs.js
@@ -3,7 +3,7 @@ mergeInto(LibraryManager.library, {
$SOCKFS__deps: ['$FS', 'mkport'],
$SOCKFS: {
mount: function(mount) {
- return FS.createNode(null, '/', {{{ cDefine('S_IFDIR') }}} | 0777, 0);
+ return FS.createNode(null, '/', {{{ cDefine('S_IFDIR') }}} | 511 /* 0777 */, 0);
},
createSocket: function(family, type, protocol) {
var streaming = type == {{{ cDefine('SOCK_STREAM') }}};
diff --git a/src/modules.js b/src/modules.js
index ad467ba7..2d2a75d0 100644
--- a/src/modules.js
+++ b/src/modules.js
@@ -424,9 +424,22 @@ var LibraryManager = {
load: function() {
if (this.library) return;
- var libraries = ['library.js', 'library_path.js', 'library_fs.js', 'library_idbfs.js', 'library_memfs.js', 'library_nodefs.js', 'library_sockfs.js', 'library_tty.js', 'library_browser.js', 'library_sdl.js', 'library_gl.js', 'library_glut.js', 'library_xlib.js', 'library_egl.js', 'library_gc.js', 'library_jansson.js', 'library_openal.js', 'library_glfw.js', 'library_uuid.js', 'library_glew.js'].concat(additionalLibraries);
+ var libraries = ['library.js', 'library_path.js', 'library_fs.js', 'library_idbfs.js', 'library_memfs.js', 'library_nodefs.js', 'library_sockfs.js', 'library_tty.js', 'library_browser.js', 'library_sdl.js', 'library_gl.js', 'library_glut.js', 'library_xlib.js', 'library_egl.js', 'library_gc.js', 'library_jansson.js', 'library_openal.js', 'library_glfw.js', 'library_uuid.js', 'library_glew.js', 'library_html5.js'].concat(additionalLibraries);
for (var i = 0; i < libraries.length; i++) {
- eval(processMacros(preprocess(read(libraries[i]))));
+ var filename = libraries[i];
+ var src = read(filename);
+ try {
+ var processed = processMacros(preprocess(src));
+ eval(processed);
+ } catch(e) {
+ var details = [e, e.lineNumber ? 'line number: ' + e.lineNumber : '', (e.stack || "").toString().replace('Object.<anonymous>', filename)];
+ if (processed) {
+ error('failure to execute js library "' + filename + '": ' + details + '\npreprocessed source (you can run a js engine on this to get a clearer error message sometimes):\n=============\n' + processed + '\n=============\n');
+ } else {
+ error('failure to process js library "' + filename + '": ' + details + '\noriginal source:\n=============\n' + src + '\n=============\n');
+ }
+ throw e;
+ }
}
/*
diff --git a/src/parseTools.js b/src/parseTools.js
index be0cbcab..4fb76196 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -46,7 +46,11 @@ function preprocess(text) {
error('unsupported preprecessor op ' + op);
}
} else {
- showStack.push(ident in this && this[ident] > 0);
+ if (ident[0] === '!') {
+ showStack.push(!(this[ident.substr(1)] > 0));
+ } else {
+ showStack.push(ident in this && this[ident] > 0);
+ }
}
} else if (line[2] == 'n') { // include
var included = read(line.substr(line.indexOf(' ')+1));
@@ -158,7 +162,7 @@ function isArrayType(type) {
function isStructType(type) {
if (isPointerType(type)) return false;
if (isArrayType(type)) return true;
- if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
+ if (/<?\{ ?[^}]* ?\}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
// See comment in isStructPointerType()
return type[0] == '%';
}
@@ -168,7 +172,7 @@ function isVectorType(type) {
}
function isStructuralType(type) {
- return /^{ ?[^}]* ?}$/.test(type); // { i32, i8 } etc. - anonymous struct types
+ return /^\{ ?[^}]* ?\}$/.test(type); // { i32, i8 } etc. - anonymous struct types
}
function getStructuralTypeParts(type) { // split { i32, i8 } etc. into parts
@@ -1157,7 +1161,7 @@ function getHeapOffset(offset, type, forceAsm) {
if (Runtime.getNativeFieldSize(type) > 4) {
if (type == 'i64' || TARGET_X86) {
- type = 'i32'; // XXX we emulate 64-bit values as 32 in x86, and also in le32 but only i64, not double
+ type = 'i32'; // XXX we emulate 64-bit values as 32 in x86, and also in asmjs-unknown-emscripten but only i64, not double
}
}
@@ -1283,7 +1287,7 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa
return '{ ' + ret.join(', ') + ' }';
}
- // In double mode 1, in x86 we always assume unaligned because we can't trust that; otherwise in le32
+ // In double mode 1, in x86 we always assume unaligned because we can't trust that; otherwise in asmjs-unknown-emscripten
// we need this code path if we are not fully aligned.
if (DOUBLE_MODE == 1 && USE_TYPED_ARRAYS == 2 && type == 'double' && (TARGET_X86 || align < 8)) {
return '(' + makeSetTempDouble(0, 'i32', makeGetValue(ptr, pos, 'i32', noNeedFirst, unsigned, ignore, align, noSafe)) + ',' +
@@ -1327,18 +1331,22 @@ function makeGetValue(ptr, pos, type, noNeedFirst, unsigned, ignore, align, noSa
var printType = type;
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
if (printType[0] === '#') printType = printType.substr(1);
- return asmCoercion('SAFE_HEAP_LOAD(' + asmCoercion(offset, 'i32') + ', ' + (ASM_JS ? 0 : printType) + ', ' + (!!unsigned+0) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')', type);
- } else {
- var ret = makeGetSlabs(ptr, type, false, unsigned)[0] + '[' + getHeapOffset(offset, type, forceAsm) + ']';
- if (ASM_JS && (phase == 'funcs' || forceAsm)) {
- ret = asmCoercion(ret, type);
- }
- if (ASM_HEAP_LOG) {
- ret = makeInlineCalculation('(asmPrint' + (type in Runtime.FLOAT_TYPES ? 'Float' : 'Int') + '(' + (asmPrintCounter++) + ',' + asmCoercion('VALUE', type) + '), VALUE)', ret,
- 'temp' + (type in Runtime.FLOAT_TYPES ? 'Double' : 'Int'));
+ if (ASM_JS) {
+ if (!ignore && phase !== 'funcs') return asmCoercion('SAFE_HEAP_LOAD(' + asmCoercion(offset, 'i32') + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ', ' + (!!unsigned+0) + ')', type);
+ // else fall through
+ } else {
+ return asmCoercion('SAFE_HEAP_LOAD(' + offset + ', ' + (ASM_JS ? 0 : printType) + ', ' + (!!unsigned+0) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')', type);
}
- return ret;
}
+ var ret = makeGetSlabs(ptr, type, false, unsigned)[0] + '[' + getHeapOffset(offset, type, forceAsm) + ']';
+ if (ASM_JS && (phase == 'funcs' || forceAsm)) {
+ ret = asmCoercion(ret, type);
+ }
+ if (ASM_HEAP_LOG) {
+ ret = makeInlineCalculation('(asmPrint' + (type in Runtime.FLOAT_TYPES ? 'Float' : 'Int') + '(' + (asmPrintCounter++) + ',' + asmCoercion('VALUE', type) + '), VALUE)', ret,
+ 'temp' + (type in Runtime.FLOAT_TYPES ? 'Double' : 'Int'));
+ }
+ return ret;
}
function makeGetValueAsm(ptr, pos, type, unsigned) {
@@ -1435,10 +1443,14 @@ function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe,
var printType = type;
if (printType !== 'null' && printType[0] !== '#') printType = '"' + safeQuote(printType) + '"';
if (printType[0] === '#') printType = printType.substr(1);
- return 'SAFE_HEAP_STORE(' + asmCoercion(offset, 'i32') + ', ' + asmCoercion(value, type) + ', ' + (ASM_JS ? 0 : printType) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')';
- } else {
- return makeGetSlabs(ptr, type, true).map(function(slab) { return slab + '[' + getHeapOffset(offset, type, forceAsm) + ']=' + value }).join(sep);
+ if (ASM_JS) {
+ if (!ignore && phase !== 'funcs') return asmCoercion('SAFE_HEAP_STORE(' + asmCoercion(offset, 'i32') + ', ' + asmCoercion(value, type) + ', ' + Runtime.getNativeTypeSize(type) + ', ' + ((type in Runtime.FLOAT_TYPES)|0) + ')', type);
+ // else fall through
+ } else {
+ return 'SAFE_HEAP_STORE(' + offset + ', ' + value + ', ' + (ASM_JS ? 0 : printType) + ', ' + ((!checkSafeHeap() || ignore)|0) + ')';
+ }
}
+ return makeGetSlabs(ptr, type, true).map(function(slab) { return slab + '[' + getHeapOffset(offset, type, forceAsm) + ']=' + value }).join(sep);
}
function makeSetValueAsm(ptr, pos, value, type, noNeedFirst, ignore, align, noSafe, sep, forcedAlign) {
@@ -1781,31 +1793,12 @@ function makePointer(slab, pos, allocator, type, ptr, finalMemoryInitialization)
types = 'i8';
}
- // JS engines sometimes say array initializers are too large. Work around that by chunking and calling concat to combine at runtime
- var chunkSize = JS_CHUNK_SIZE;
- function chunkify(array) {
- // break very large slabs into parts
- var ret = '';
- var index = 0;
- while (index < array.length) {
- ret = (ret ? ret + '.concat(' : '') + '[' + array.slice(index, index + chunkSize).map(JSON.stringify) + ']' + (ret ? ')\n' : '');
- index += chunkSize;
- }
- return ret;
- }
- if (typeof slab == 'object' && slab.length > chunkSize) {
- slab = chunkify(slab);
- }
if (typeof types == 'object') {
while (types.length < slab.length) types.push(0);
}
- if (typeof types != 'string' && types.length > chunkSize) {
- types = chunkify(types);
- } else {
- types = JSON.stringify(types);
- }
+ types = JSON.stringify(types);
if (typeof slab == 'object') slab = '[' + slab.join(',') + ']';
- return 'allocate(' + slab + ', ' + types + (allocator ? ', ' + allocator : '') + (allocator == 'ALLOC_NONE' ? ', ' + ptr : '') + ')';
+ return 'allocate(' + slab + ', ' + types + (allocator ? ', ' + allocator : '') + (allocator == 'ALLOC_NONE' ? ', ' + ptr : '') + ');';
}
function makeGetSlabs(ptr, type, allowMultiple, unsigned) {
@@ -1833,7 +1826,7 @@ function makeGetSlabs(ptr, type, allowMultiple, unsigned) {
case '<4 x i32>':
case 'i32': case 'i64': return [unsigned ? 'HEAPU32' : 'HEAP32']; break;
case 'double': {
- if (TARGET_LE32) return ['HEAPF64']; // in le32, we do have the ability to assume 64-bit alignment
+ if (TARGET_ASMJS_UNKNOWN_EMSCRIPTEN) return ['HEAPF64']; // in asmjs-unknown-emscripten, we do have the ability to assume 64-bit alignment
// otherwise, fall through to float
}
case '<4 x float>':
diff --git a/src/postamble.js b/src/postamble.js
index 90a86474..603b330c 100644
--- a/src/postamble.js
+++ b/src/postamble.js
@@ -2,19 +2,21 @@
// === Auto-generated postamble setup entry stuff ===
if (memoryInitializer) {
- function applyData(data) {
+ if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
+ var data = Module['readBinary'](memoryInitializer);
#if USE_TYPED_ARRAYS == 2
HEAPU8.set(data, STATIC_BASE);
#else
allocate(data, 'i8', ALLOC_NONE, STATIC_BASE);
#endif
- }
- if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
- applyData(Module['readBinary'](memoryInitializer));
} else {
addRunDependency('memory initializer');
Browser.asyncLoad(memoryInitializer, function(data) {
- applyData(data);
+#if USE_TYPED_ARRAYS == 2
+ HEAPU8.set(data, STATIC_BASE);
+#else
+ allocate(data, 'i8', ALLOC_NONE, STATIC_BASE);
+#endif
removeRunDependency('memory initializer');
}, function(data) {
throw 'could not load memory initializer ' + memoryInitializer;
@@ -179,7 +181,13 @@ function abort(text) {
ABORT = true;
EXITSTATUS = 1;
- throw 'abort() at ' + stackTrace();
+#if ASSERTIONS == 0
+ var extra = '\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.';
+#else
+ var extra = '';
+#endif
+
+ throw 'abort() at ' + stackTrace() + extra;
}
Module['abort'] = Module.abort = abort;
@@ -202,6 +210,10 @@ if (Module['noInitialRun']) {
shouldRunNow = false;
}
+#if NO_EXIT_RUNTIME
+Module["noExitRuntime"] = true;
+#endif
+
run();
// {{POST_RUN_ADDITIONS}}
diff --git a/src/preamble.js b/src/preamble.js
index ac6ee7b3..28a1dcbc 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -6,6 +6,8 @@
{{RUNTIME}}
+Module['Runtime'] = Runtime;
+
#if ASM_JS
#if RESERVED_FUNCTION_POINTERS
function jsCall() {
@@ -21,6 +23,7 @@ Module.print = Module.printErr = function(){};
#endif
#if SAFE_HEAP
+#if ASM_JS == 0
//========================================
// Debugging tools - Heap
//========================================
@@ -166,6 +169,45 @@ function SAFE_HEAP_FILL_HISTORY(from, to, type) {
}
//==========================================
+#else
+// ASM_JS safe heap
+
+function getSafeHeapType(bytes, isFloat) {
+ switch (bytes) {
+ case 1: return 'i8';
+ case 2: return 'i16';
+ case 4: return isFloat ? 'float' : 'i32';
+ case 8: return 'double';
+ default: assert(0);
+ }
+}
+
+function SAFE_HEAP_STORE(dest, value, bytes, isFloat) {
+#if SAFE_HEAP_LOG
+ Module.print('SAFE_HEAP store: ' + [dest, value, bytes, isFloat]);
+#endif
+ assert(dest > 0, 'segmentation fault');
+ assert(dest % bytes === 0);
+ assert(dest < Math.max(DYNAMICTOP, STATICTOP));
+ assert(DYNAMICTOP <= TOTAL_MEMORY);
+ setValue(dest, value, getSafeHeapType(bytes, isFloat), 1);
+}
+
+function SAFE_HEAP_LOAD(dest, bytes, isFloat, unsigned) {
+ assert(dest > 0, 'segmentation fault');
+ assert(dest % bytes === 0);
+ assert(dest < Math.max(DYNAMICTOP, STATICTOP));
+ assert(DYNAMICTOP <= TOTAL_MEMORY);
+ var type = getSafeHeapType(bytes, isFloat);
+ var ret = getValue(dest, type, 1);
+ if (unsigned) ret = unSign(ret, parseInt(type.substr(1)), 1);
+#if SAFE_HEAP_LOG
+ Module.print('SAFE_HEAP load: ' + [dest, ret, bytes, isFloat, unsigned]);
+#endif
+ return ret;
+}
+
+#endif
#endif
#if CHECK_HEAP_ALIGN
@@ -641,6 +683,130 @@ function stringToUTF32(str, outPtr) {
Module['stringToUTF32'] = stringToUTF32;
function demangle(func) {
+ var i = 3;
+ // params, etc.
+ var basicTypes = {
+ 'v': 'void',
+ 'b': 'bool',
+ 'c': 'char',
+ 's': 'short',
+ 'i': 'int',
+ 'l': 'long',
+ 'f': 'float',
+ 'd': 'double',
+ 'w': 'wchar_t',
+ 'a': 'signed char',
+ 'h': 'unsigned char',
+ 't': 'unsigned short',
+ 'j': 'unsigned int',
+ 'm': 'unsigned long',
+ 'x': 'long long',
+ 'y': 'unsigned long long',
+ 'z': '...'
+ };
+ var subs = [];
+ var first = true;
+ function dump(x) {
+ //return;
+ if (x) Module.print(x);
+ Module.print(func);
+ var pre = '';
+ for (var a = 0; a < i; a++) pre += ' ';
+ Module.print (pre + '^');
+ }
+ function parseNested() {
+ i++;
+ if (func[i] === 'K') i++; // ignore const
+ var parts = [];
+ while (func[i] !== 'E') {
+ if (func[i] === 'S') { // substitution
+ i++;
+ var next = func.indexOf('_', i);
+ var num = func.substring(i, next) || 0;
+ parts.push(subs[num] || '?');
+ i = next+1;
+ continue;
+ }
+ if (func[i] === 'C') { // constructor
+ parts.push(parts[parts.length-1]);
+ i += 2;
+ continue;
+ }
+ var size = parseInt(func.substr(i));
+ var pre = size.toString().length;
+ if (!size || !pre) { i--; break; } // counter i++ below us
+ var curr = func.substr(i + pre, size);
+ parts.push(curr);
+ subs.push(curr);
+ i += pre + size;
+ }
+ i++; // skip E
+ return parts;
+ }
+ function parse(rawList, limit, allowVoid) { // main parser
+ limit = limit || Infinity;
+ var ret = '', list = [];
+ function flushList() {
+ return '(' + list.join(', ') + ')';
+ }
+ var name;
+ if (func[i] === 'N') {
+ // namespaced N-E
+ name = parseNested().join('::');
+ limit--;
+ if (limit === 0) return rawList ? [name] : name;
+ } else {
+ // not namespaced
+ if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'
+ var size = parseInt(func.substr(i));
+ if (size) {
+ var pre = size.toString().length;
+ name = func.substr(i + pre, size);
+ i += pre + size;
+ }
+ }
+ first = false;
+ if (func[i] === 'I') {
+ i++;
+ var iList = parse(true);
+ var iRet = parse(true, 1, true);
+ ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';
+ } else {
+ ret = name;
+ }
+ paramLoop: while (i < func.length && limit-- > 0) {
+ //dump('paramLoop');
+ var c = func[i++];
+ if (c in basicTypes) {
+ list.push(basicTypes[c]);
+ } else {
+ switch (c) {
+ case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer
+ case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference
+ case 'L': { // literal
+ i++; // skip basic type
+ var end = func.indexOf('E', i);
+ var size = end - i;
+ list.push(func.substr(i, size));
+ i += size + 2; // size + 'EE'
+ break;
+ }
+ case 'A': { // array
+ var size = parseInt(func.substr(i));
+ i += size.toString().length;
+ if (func[i] !== '_') throw '?';
+ i++; // skip _
+ list.push(parse(true, 1, true)[0] + ' [' + size + ']');
+ break;
+ }
+ case 'E': break paramLoop;
+ default: ret += '?' + c; break paramLoop;
+ }
+ }
+ }
+ if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)
+ return rawList ? list : ret + flushList();
+ }
try {
// Special-case the entry point, since its name differs from other name mangling.
if (func == 'Object._main' || func == '_main') {
@@ -654,130 +820,6 @@ function demangle(func) {
case 'n': return 'operator new()';
case 'd': return 'operator delete()';
}
- var i = 3;
- // params, etc.
- var basicTypes = {
- 'v': 'void',
- 'b': 'bool',
- 'c': 'char',
- 's': 'short',
- 'i': 'int',
- 'l': 'long',
- 'f': 'float',
- 'd': 'double',
- 'w': 'wchar_t',
- 'a': 'signed char',
- 'h': 'unsigned char',
- 't': 'unsigned short',
- 'j': 'unsigned int',
- 'm': 'unsigned long',
- 'x': 'long long',
- 'y': 'unsigned long long',
- 'z': '...'
- };
- function dump(x) {
- //return;
- if (x) Module.print(x);
- Module.print(func);
- var pre = '';
- for (var a = 0; a < i; a++) pre += ' ';
- Module.print (pre + '^');
- }
- var subs = [];
- function parseNested() {
- i++;
- if (func[i] === 'K') i++; // ignore const
- var parts = [];
- while (func[i] !== 'E') {
- if (func[i] === 'S') { // substitution
- i++;
- var next = func.indexOf('_', i);
- var num = func.substring(i, next) || 0;
- parts.push(subs[num] || '?');
- i = next+1;
- continue;
- }
- if (func[i] === 'C') { // constructor
- parts.push(parts[parts.length-1]);
- i += 2;
- continue;
- }
- var size = parseInt(func.substr(i));
- var pre = size.toString().length;
- if (!size || !pre) { i--; break; } // counter i++ below us
- var curr = func.substr(i + pre, size);
- parts.push(curr);
- subs.push(curr);
- i += pre + size;
- }
- i++; // skip E
- return parts;
- }
- var first = true;
- function parse(rawList, limit, allowVoid) { // main parser
- limit = limit || Infinity;
- var ret = '', list = [];
- function flushList() {
- return '(' + list.join(', ') + ')';
- }
- var name;
- if (func[i] === 'N') {
- // namespaced N-E
- name = parseNested().join('::');
- limit--;
- if (limit === 0) return rawList ? [name] : name;
- } else {
- // not namespaced
- if (func[i] === 'K' || (first && func[i] === 'L')) i++; // ignore const and first 'L'
- var size = parseInt(func.substr(i));
- if (size) {
- var pre = size.toString().length;
- name = func.substr(i + pre, size);
- i += pre + size;
- }
- }
- first = false;
- if (func[i] === 'I') {
- i++;
- var iList = parse(true);
- var iRet = parse(true, 1, true);
- ret += iRet[0] + ' ' + name + '<' + iList.join(', ') + '>';
- } else {
- ret = name;
- }
- paramLoop: while (i < func.length && limit-- > 0) {
- //dump('paramLoop');
- var c = func[i++];
- if (c in basicTypes) {
- list.push(basicTypes[c]);
- } else {
- switch (c) {
- case 'P': list.push(parse(true, 1, true)[0] + '*'); break; // pointer
- case 'R': list.push(parse(true, 1, true)[0] + '&'); break; // reference
- case 'L': { // literal
- i++; // skip basic type
- var end = func.indexOf('E', i);
- var size = end - i;
- list.push(func.substr(i, size));
- i += size + 2; // size + 'EE'
- break;
- }
- case 'A': { // array
- var size = parseInt(func.substr(i));
- i += size.toString().length;
- if (func[i] !== '_') throw '?';
- i++; // skip _
- list.push(parse(true, 1, true)[0] + ' [' + size + ']');
- break;
- }
- case 'E': break paramLoop;
- default: ret += '?' + c; break paramLoop;
- }
- }
- }
- if (!allowVoid && list.length === 1 && list[0] === 'void') list = []; // avoid (void)
- return rawList ? list : ret + flushList();
- }
return parse();
} catch(e) {
return func;
@@ -818,33 +860,19 @@ var DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk
#if USE_TYPED_ARRAYS
function enlargeMemory() {
#if ALLOW_MEMORY_GROWTH == 0
-#if ASM_JS == 0
abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');
#else
- abort('Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value ' + TOTAL_MEMORY + ', or (2) set Module.TOTAL_MEMORY before the program runs.');
-#endif
-#else
// TOTAL_MEMORY is the current size of the actual array, and DYNAMICTOP is the new top.
#if ASSERTIONS
- Module.printErr('Warning: Enlarging memory arrays, this is not fast, and ALLOW_MEMORY_GROWTH is not fully tested with all optimizations on! ' + [DYNAMICTOP, TOTAL_MEMORY]); // We perform safe elimination instead of elimination in this mode, but if you see this error, try to disable it and other optimizations entirely
+ Module.printErr('Warning: Enlarging memory arrays, this is not fast! ' + [DYNAMICTOP, TOTAL_MEMORY]);
assert(DYNAMICTOP >= TOTAL_MEMORY);
assert(TOTAL_MEMORY > 4); // So the loop below will not be infinite
#endif
- while (TOTAL_MEMORY <= DYNAMICTOP) { // Simple heuristic. Override enlargeMemory() if your program has something more optimal for it
+
+ while (TOTAL_MEMORY <= DYNAMICTOP) { // Simple heuristic.
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);
- IHEAP.set(oldIHEAP);
- IHEAPU = new Uint32Array(IHEAP.buffer);
-#if USE_FHEAP
- var oldFHEAP = FHEAP;
- Module['FHEAP'] = FHEAP = new Float64Array(TOTAL_MEMORY);
- FHEAP.set(oldFHEAP);
-#endif
-#endif
#if USE_TYPED_ARRAYS == 2
var oldHEAP8 = HEAP8;
var buffer = new ArrayBuffer(TOTAL_MEMORY);
@@ -857,6 +885,11 @@ function enlargeMemory() {
Module['HEAPF32'] = HEAPF32 = new Float32Array(buffer);
Module['HEAPF64'] = HEAPF64 = new Float64Array(buffer);
HEAP8.set(oldHEAP8);
+#else
+ abort('cannot enlarge memory arrays in non-ta2 modes');
+#endif
+#if ASM_JS
+ _emscripten_replace_memory(HEAP8, HEAP16, HEAP32, HEAPU8, HEAPU16, HEAPU32, HEAPF32, HEAPF64);
#endif
#endif
}
@@ -885,7 +918,7 @@ if (totalMemory !== TOTAL_MEMORY) {
#if USE_TYPED_ARRAYS
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
- 'Cannot fallback to non-typed array case: Code is too specialized');
+ 'JS engine does not provide full typed array support');
#if USE_TYPED_ARRAYS == 1
HEAP = IHEAP = new Int32Array(TOTAL_MEMORY);
@@ -985,6 +1018,11 @@ function preMain() {
}
function exitRuntime() {
+#if ASSERTIONS
+ if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
+ Module.printErr('Exiting runtime. Any attempt to access the compiled C code may fail from now. If you want to keep the runtime alive, set Module["noExitRuntime"] = true or build with -s NO_EXIT_RUNTIME=1');
+ }
+#endif
callRuntimeCallbacks(__ATEXIT__);
}
diff --git a/src/proxyClient.js b/src/proxyClient.js
index 8f4ad7a6..2d1c76fe 100644
--- a/src/proxyClient.js
+++ b/src/proxyClient.js
@@ -3,9 +3,39 @@
Module.ctx = Module.canvas.getContext('2d');
+// render
+
+var renderFrameData = null;
+
+function renderFrame() {
+ var dst = Module.canvasData.data;
+ if (dst.set) {
+ dst.set(renderFrameData);
+ } else {
+ for (var i = 0; i < renderFrameData.length; i++) {
+ dst[i] = renderFrameData[i];
+ }
+ }
+ Module.ctx.putImageData(Module.canvasData, 0, 0);
+ renderFrameData = null;
+}
+
+window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
+ window.webkitRequestAnimationFrame || window.msRequestAnimationFrame ||
+ renderFrame;
+
+// end render
+
var worker = new Worker('{{{ filename }}}.js');
+var workerResponded = false;
+
worker.onmessage = function worker_onmessage(event) {
+ if (!workerResponded) {
+ workerResponded = true;
+ if (Module.setStatus) Module.setStatus('');
+ }
+
var data = event.data;
switch (data.target) {
case 'stdout': {
@@ -26,20 +56,18 @@ worker.onmessage = function worker_onmessage(event) {
Module.canvas.width = data.width;
Module.canvas.height = data.height;
Module.canvasData = Module.ctx.getImageData(0, 0, data.width, data.height);
- postMessage({ target: 'canvas', boundingClientRect: Module.canvas.getBoundingClientRect() });
+ worker.postMessage({ target: 'canvas', boundingClientRect: cloneObject(Module.canvas.getBoundingClientRect()) });
break;
}
case 'render': {
- var src = data.image.data;
- var dst = Module.canvasData.data;
- if (dst.set) {
- dst.set(src);
+ if (renderFrameData) {
+ // previous image was not rendered yet, just update image
+ renderFrameData = data.image.data;
} else {
- for (var i = 0; i < src.length; i++) {
- dst[i] = src[i];
- }
+ // previous image was rendered so update image and request another frame
+ renderFrameData = data.image.data;
+ window.requestAnimationFrame(renderFrame);
}
- Module.ctx.putImageData(Module.canvasData, 0, 0);
break;
}
default: throw 'eh?';
@@ -50,7 +78,7 @@ worker.onmessage = function worker_onmessage(event) {
}
};
-function cloneEvent(event) {
+function cloneObject(event) {
var ret = {};
for (var x in event) {
if (x == x.toUpperCase()) continue;
@@ -62,20 +90,20 @@ function cloneEvent(event) {
['keydown', 'keyup', 'keypress', 'blur', 'visibilitychange'].forEach(function(event) {
document.addEventListener(event, function(event) {
- worker.postMessage({ target: 'document', event: cloneEvent(event) });
+ worker.postMessage({ target: 'document', event: cloneObject(event) });
event.preventDefault();
});
});
['unload'].forEach(function(event) {
window.addEventListener(event, function(event) {
- worker.postMessage({ target: 'window', event: cloneEvent(event) });
+ worker.postMessage({ target: 'window', event: cloneObject(event) });
});
});
['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 'mouseout'].forEach(function(event) {
Module.canvas.addEventListener(event, function(event) {
- worker.postMessage({ target: 'canvas', event: cloneEvent(event) });
+ worker.postMessage({ target: 'canvas', event: cloneObject(event) });
event.preventDefault();
}, true);
});
diff --git a/src/proxyWorker.js b/src/proxyWorker.js
index 5d34b900..cfe0c26e 100644
--- a/src/proxyWorker.js
+++ b/src/proxyWorker.js
@@ -79,11 +79,13 @@ document.createElement = function document_createElement(what) {
}
};
-var console = {
- log: function(x) {
- Module.printErr(x);
- }
-};
+if (typeof console === 'undefined') {
+ var console = {
+ log: function(x) {
+ Module.printErr(x);
+ }
+ };
+}
Module.canvas = document.createElement('canvas');
diff --git a/src/relooper/README.markdown b/src/relooper/README.markdown
deleted file mode 100644
index 9b0187b3..00000000
--- a/src/relooper/README.markdown
+++ /dev/null
@@ -1,14 +0,0 @@
-
-Relooper
-========
-
-This is an optimized C++ implemention of the Relooper algorithm originally
-developed as part of Emscripten. This implementation includes optimizations
-added since the original academic paper [1] - see paper.pdf - was published
-about it, and is written in an LLVM-friendly way with the goal of inclusion
-in upstream LLVM.
-
-License: MIT&LLVM
-
-[1] Alon Zakai. 2011. Emscripten: an LLVM-to-JavaScript compiler. In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion (SPLASH '11). ACM, New York, NY, USA, 301-312. DOI=10.1145/2048147.2048224 http://doi.acm.org/10.1145/2048147.2048224
-
diff --git a/src/relooper/README.md b/src/relooper/README.md
new file mode 100644
index 00000000..a4073a77
--- /dev/null
+++ b/src/relooper/README.md
@@ -0,0 +1,12 @@
+Relooper
+========
+
+This is an optimized C++ implemention of the Relooper algorithm originally developed as part
+of Emscripten. This implementation includes optimizations added since the original academic
+paper [1] - see paper.pdf - was published about it, and is written in an LLVM-friendly way
+with the goal of inclusion in upstream LLVM.
+
+[1] Alon Zakai. 2011. Emscripten: an LLVM-to-JavaScript compiler. In Proceedings of the ACM
+international conference companion on Object oriented programming systems languages and
+applications companion (SPLASH '11). ACM, New York, NY, USA, 301-312.
+DOI=10.1145/2048147.2048224 http://doi.acm.org/10.1145/2048147.2048224
diff --git a/src/relooper/Relooper.cpp b/src/relooper/Relooper.cpp
index d5772c62..c11de099 100644
--- a/src/relooper/Relooper.cpp
+++ b/src/relooper/Relooper.cpp
@@ -1,3 +1,7 @@
+// We are implementing the Relooper C API, so always export from this file.
+#ifndef RELOOPERDLL_EXPORTS
+#define RELOOPERDLL_EXPORTS
+#endif
#include "Relooper.h"
@@ -13,8 +17,8 @@
typedef std::string ministring;
#endif
-template <class T, class U> bool contains(const T& container, const U& contained) {
- return container.find(contained) != container.end();
+template <class T, class U> static bool contains(const T& container, const U& contained) {
+ return container.count(contained);
}
#if DEBUG
@@ -322,12 +326,26 @@ void MultipleShape::RenderLoopPostfix() {
void MultipleShape::Render(bool InLoop) {
RenderLoopPrefix();
- bool First = true;
+
+ // We know that blocks with the same Id were split from the same source, so their contents are identical and they are logically the same, so re-merge them here
+ typedef std::map<int, Shape*> IdShapeMap;
+ IdShapeMap IdMap;
for (BlockShapeMap::iterator iter = InnerMap.begin(); iter != InnerMap.end(); iter++) {
+ int Id = iter->first->Id;
+ IdShapeMap::iterator Test = IdMap.find(Id);
+ if (Test != IdMap.end()) {
+ assert(Shape::IsSimple(iter->second) && Shape::IsSimple(Test->second)); // we can only merge simple blocks, something horrible has gone wrong if we see anything else
+ continue;
+ }
+ IdMap[iter->first->Id] = iter->second;
+ }
+
+ bool First = true;
+ for (IdShapeMap::iterator iter = IdMap.begin(); iter != IdMap.end(); iter++) {
if (AsmJS) {
- PrintIndented("%sif ((label|0) == %d) {\n", First ? "" : "else ", iter->first->Id);
+ PrintIndented("%sif ((label|0) == %d) {\n", First ? "" : "else ", iter->first);
} else {
- PrintIndented("%sif (label == %d) {\n", First ? "" : "else ", iter->first->Id);
+ PrintIndented("%sif (label == %d) {\n", First ? "" : "else ", iter->first);
}
First = false;
Indenter::Indent();
@@ -391,8 +409,8 @@ Relooper::~Relooper() {
for (unsigned i = 0; i < Shapes.size(); i++) delete Shapes[i];
}
-void Relooper::AddBlock(Block *New) {
- New->Id = BlockIdCounter++;
+void Relooper::AddBlock(Block *New, int Id) {
+ New->Id = Id == -1 ? BlockIdCounter++ : Id;
Blocks.push_back(New);
}
@@ -446,8 +464,7 @@ void Relooper::Calculate(Block *Entry) {
for (BlockSet::iterator iter = Original->BranchesIn.begin(); iter != Original->BranchesIn.end(); iter++) {
Block *Prior = *iter;
Block *Split = new Block(Original->Code, Original->BranchVar);
- Parent->AddBlock(Split);
- PrintDebug(" to %d\n", Split->Id);
+ Parent->AddBlock(Split, Original->Id);
Split->BranchesIn.insert(Prior);
Branch *Details = Prior->BranchesOut[Original];
Prior->BranchesOut[Split] = new Branch(Details->Condition, Details->Code);
@@ -633,7 +650,7 @@ void Relooper::Calculate(Block *Entry) {
Block *Curr = *iter;
for (BlockBranchMap::iterator iter = Curr->BranchesOut.begin(); iter != Curr->BranchesOut.end(); iter++) {
Block *Target = iter->first;
- if (Hoisted.find(Target) == Hoisted.end() && NextEntries.find(Target) == NextEntries.end()) {
+ if (!contains(Hoisted, Target) && !contains(NextEntries, Target))
// abort this hoisting
abort = true;
break;
@@ -1256,7 +1273,7 @@ VoidIntMap __blockDebugMap__; // maps block pointers in currently running code t
extern "C" {
-void rl_set_output_buffer(char *buffer, int size) {
+RELOOPERDLL_API void rl_set_output_buffer(char *buffer, int size) {
#if DEBUG
printf("#include \"Relooper.h\"\n");
printf("int main() {\n");
@@ -1266,15 +1283,15 @@ void rl_set_output_buffer(char *buffer, int size) {
Relooper::SetOutputBuffer(buffer, size);
}
-void rl_make_output_buffer(int size) {
+RELOOPERDLL_API void rl_make_output_buffer(int size) {
Relooper::SetOutputBuffer((char*)malloc(size), size);
}
-void rl_set_asm_js_mode(int on) {
+RELOOPERDLL_API void rl_set_asm_js_mode(int on) {
Relooper::SetAsmJSMode(on);
}
-void *rl_new_block(const char *text, const char *branch_var) {
+RELOOPERDLL_API void *rl_new_block(const char *text, const char *branch_var) {
Block *ret = new Block(text, branch_var);
#if DEBUG
printf(" void *b%d = rl_new_block(\"// code %d\");\n", ret->Id, ret->Id);
@@ -1284,21 +1301,21 @@ void *rl_new_block(const char *text, const char *branch_var) {
return ret;
}
-void rl_delete_block(void *block) {
+RELOOPERDLL_API void rl_delete_block(void *block) {
#if DEBUG
printf(" rl_delete_block(block_map[%d]);\n", ((Block*)block)->Id);
#endif
delete (Block*)block;
}
-void rl_block_add_branch_to(void *from, void *to, const char *condition, const char *code) {
+RELOOPERDLL_API void rl_block_add_branch_to(void *from, void *to, const char *condition, const char *code) {
#if DEBUG
printf(" rl_block_add_branch_to(block_map[%d], block_map[%d], %s%s%s, %s%s%s);\n", ((Block*)from)->Id, ((Block*)to)->Id, condition ? "\"" : "", condition ? condition : "NULL", condition ? "\"" : "", code ? "\"" : "", code ? code : "NULL", code ? "\"" : "");
#endif
((Block*)from)->AddBranchTo((Block*)to, condition, code);
}
-void *rl_new_relooper() {
+RELOOPERDLL_API void *rl_new_relooper() {
#if DEBUG
printf(" void *block_map[10000];\n");
printf(" void *rl = rl_new_relooper();\n");
@@ -1306,18 +1323,18 @@ void *rl_new_relooper() {
return new Relooper;
}
-void rl_delete_relooper(void *relooper) {
+RELOOPERDLL_API void rl_delete_relooper(void *relooper) {
delete (Relooper*)relooper;
}
-void rl_relooper_add_block(void *relooper, void *block) {
+RELOOPERDLL_API void rl_relooper_add_block(void *relooper, void *block) {
#if DEBUG
printf(" rl_relooper_add_block(rl, block_map[%d]);\n", ((Block*)block)->Id);
#endif
((Relooper*)relooper)->AddBlock((Block*)block);
}
-void rl_relooper_calculate(void *relooper, void *entry) {
+RELOOPERDLL_API void rl_relooper_calculate(void *relooper, void *entry) {
#if DEBUG
printf(" rl_relooper_calculate(rl, block_map[%d]);\n", ((Block*)entry)->Id);
printf(" rl_relooper_render(rl);\n");
@@ -1329,7 +1346,7 @@ void rl_relooper_calculate(void *relooper, void *entry) {
((Relooper*)relooper)->Calculate((Block*)entry);
}
-void rl_relooper_render(void *relooper) {
+RELOOPERDLL_API void rl_relooper_render(void *relooper) {
((Relooper*)relooper)->Render();
}
diff --git a/src/relooper/Relooper.h b/src/relooper/Relooper.h
index 6b9394db..85adf359 100644
--- a/src/relooper/Relooper.h
+++ b/src/relooper/Relooper.h
@@ -57,7 +57,7 @@ struct Block {
BlockBranchMap ProcessedBranchesOut;
BlockSet ProcessedBranchesIn;
Shape *Parent; // The shape we are directly inside
- int Id; // A unique identifier, defined when added to relooper
+ int Id; // A unique identifier, defined when added to relooper. Note that this uniquely identifies a *logical* block - if we split it, the two instances have the same content *and* the same Id
const char *Code; // The string representation of the code in this block. Owning pointer (we copy the input)
const char *BranchVar; // If we have more than one branch out, the variable whose value determines where we go
bool IsCheckedMultipleEntry; // If true, we are a multiple entry, so reaching us requires setting the label variable
@@ -191,7 +191,7 @@ struct Relooper {
Relooper();
~Relooper();
- void AddBlock(Block *New);
+ void AddBlock(Block *New, int Id=-1);
// Calculates the shapes
void Calculate(Block *Entry);
diff --git a/src/relooper/test.txt b/src/relooper/test.txt
index cb02b867..82b02ad7 100644
--- a/src/relooper/test.txt
+++ b/src/relooper/test.txt
@@ -91,7 +91,7 @@
}
default: {
var $x_1 = $x_0;
- label = 8;
+ label = 7;
break L1;
}
}
@@ -106,7 +106,7 @@
}
}
}
- if (label == 8) {
+ if (label == 7) {
// code 7
}
// code 4
diff --git a/src/runtime.js b/src/runtime.js
index cd3afb4b..97de7473 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -49,7 +49,7 @@ var RuntimeGenerator = {
stackExit: function(initial, force) {
if (initial === 0 && SKIP_STACK_IN_SMALL && !force) return '';
var ret = '';
- if (SAFE_HEAP) {
+ if (SAFE_HEAP && !ASM_JS) {
ret += 'var i = sp; while ((i|0) < (STACKTOP|0)) { SAFE_HEAP_CLEAR(i|0); i = (i+1)|0 }';
}
return ret += 'STACKTOP=sp';
@@ -185,10 +185,10 @@ var Runtime = {
// type can be a native type or a struct (or null, for structs we only look at size here)
getAlignSize: function(type, size, vararg) {
// we align i64s and doubles on 64-bit boundaries, unlike x86
-#if TARGET_LE32 == 1
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN == 1
if (vararg) return 8;
#endif
-#if TARGET_LE32
+#if TARGET_ASMJS_UNKNOWN_EMSCRIPTEN
if (!vararg && (type == 'i64' || type == 'double')) return 8;
if (!type) return Math.min(size, 8); // align structures internally to 64 bits
#endif
@@ -336,6 +336,9 @@ var Runtime = {
#if ASM_JS
if (!args.splice) args = Array.prototype.slice.call(args);
args.splice(0, 0, ptr);
+#if ASSERTIONS
+ assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
+#endif
return Module['dynCall_' + sig].apply(null, args);
#else
return FUNCTION_TABLE[ptr].apply(null, args);
@@ -345,6 +348,9 @@ var Runtime = {
assert(sig.length == 1);
#endif
#if ASM_JS
+#if ASSERTIONS
+ assert(('dynCall_' + sig) in Module, 'bad function pointer type - no table for sig \'' + sig + '\'');
+#endif
return Module['dynCall_' + sig].call(null, ptr);
#else
return FUNCTION_TABLE[ptr]();
@@ -393,7 +399,17 @@ var Runtime = {
for (var i = 0; i < numArgs; i++) {
args.push(String.fromCharCode(36) + i); // $0, $1 etc
}
- return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + Pointer_stringify(code) + ' })'); // new Function does not allow upvars in node
+ code = Pointer_stringify(code);
+ if (code[0] === '"') {
+ // tolerate EM_ASM("..code..") even though EM_ASM(..code..) is correct
+ if (code.indexOf('"', 1) === code.length-1) {
+ code = code.substr(1, code.length-2);
+ } else {
+ // something invalid happened, e.g. EM_ASM("..code($0)..", input)
+ abort('invalid EM_ASM input |' + code + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)');
+ }
+ }
+ return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + code + ' })'); // new Function does not allow upvars in node
},
warnOnce: function(text) {
@@ -477,6 +493,19 @@ var Runtime = {
}
},
+#if RETAIN_COMPILER_SETTINGS
+ compilerSettings: {},
+#endif
+
+ getCompilerSetting: function(name) {
+#if RETAIN_COMPILER_SETTINGS == 0
+ throw 'You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work';
+#else
+ if (!(name in Runtime.compilerSettings)) return 'invalid compiler setting: ' + name;
+ return Runtime.compilerSettings[name];
+#endif
+ },
+
#if RUNTIME_DEBUG
debug: true, // Switch to false at runtime to disable logging at the right times
@@ -555,7 +584,7 @@ function getRuntime() {
// Converts a value we have as signed, into an unsigned value. For
// example, -1 in int32 would be a very large number as unsigned.
-function unSign(value, bits, ignore, sig) {
+function unSign(value, bits, ignore) {
if (value >= 0) {
return value;
}
@@ -568,7 +597,7 @@ function unSign(value, bits, ignore, sig) {
// Converts a value we have as unsigned, into a signed value. For
// example, 200 in a uint8 would be a negative number.
-function reSign(value, bits, ignore, sig) {
+function reSign(value, bits, ignore) {
if (value <= 0) {
return value;
}
@@ -602,3 +631,12 @@ function reSign(value, bits, ignore, sig) {
// Then 'dynamic' memory for sbrk.
Runtime.GLOBAL_BASE = Runtime.alignMemory(1);
+if (RETAIN_COMPILER_SETTINGS) {
+ var blacklist = set('RELOOPER', 'STRUCT_INFO');
+ for (var x in this) {
+ try {
+ if (x[0] !== '_' && !(x in blacklist) && x == x.toUpperCase() && (typeof this[x] === 'number' || typeof this[x] === 'string' || this.isArray())) Runtime.compilerSettings[x] = this[x];
+ } catch(e){}
+ }
+}
+
diff --git a/src/settings.js b/src/settings.js
index 720fb53f..7f9fbabf 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -23,8 +23,8 @@ var QUANTUM_SIZE = 4; // This is the size of an individual field in a structure.
// Changing this from the default of 4 is deprecated.
var TARGET_X86 = 0; // For i386-pc-linux-gnu
-var TARGET_LE32 = 1; // For le32-unknown-nacl. 1 is normal, 2 is for the fastcomp llvm
- // backend using pnacl abi simplification
+var TARGET_ASMJS_UNKNOWN_EMSCRIPTEN = 1; // For asmjs-unknown-emscripten. 1 is normal, 2 is for the fastcomp llvm
+ // backend using emscripten-customized abi simplification
var CORRECT_SIGNS = 1; // Whether we make sure to convert unsigned values to signed values.
// Decreases performance with additional runtime checks. Might not be
@@ -48,6 +48,8 @@ var VERBOSE = 0; // When set to 1, will generate more verbose output during comp
var INVOKE_RUN = 1; // Whether we will run the main() function. Disable if you embed the generated
// code in your own, and will call main() yourself at the right time (which you
// can do with Module.callMain(), with an optional parameter of commandline args).
+var NO_EXIT_RUNTIME = 0; // If set, the runtime is not quit when main() completes (allowing code to
+ // run afterwards, for example from the browser main event loop).
var INIT_HEAP = 0; // Whether to initialize memory anywhere other than the stack to 0.
var TOTAL_STACK = 5*1024*1024; // The total stack size. There is no way to enlarge the stack, so this
// value must be large enough for the program's requirements. If
@@ -104,6 +106,9 @@ var FORCE_ALIGNED_MEMORY = 0; // If enabled, assumes all reads and writes are fu
// for ways to help find places in your code where unaligned reads/writes are done -
// you might be able to refactor your codebase to prevent them, which leads to
// smaller and faster code, or even the option to turn this flag on.
+var WARN_UNALIGNED = 0; // Warn at compile time about instructions that LLVM tells us are not fully aligned.
+ // This is useful to find places in your code where you might refactor to ensure proper
+ // alignment. (this option is fastcomp-only)
var PRECISE_I64_MATH = 1; // If enabled, i64 addition etc. is emulated - which is slow but precise. If disabled,
// we use the 'double trick' which is fast but incurs rounding at high values.
// Note that we do not catch 32-bit multiplication by default (which must be done in
@@ -121,8 +126,11 @@ var PRECISE_F32 = 0; // 0: Use JS numbers for floating-point values. These are 6
// 1: Model C++ floats precisely, using Math.fround, polyfilling when necessary. This
// can be slow if the polyfill is used on heavy float32 computation.
// 2: Model C++ floats precisely using Math.fround if available in the JS engine, otherwise
- // use an empty polyfill. This will have less of a speed penalty than using the full
- // polyfill in cases where engine support is not present.
+ // use an empty polyfill. This will have much less of a speed penalty than using the full
+ // polyfill in cases where engine support is not present. In addition, we can
+ // remove the empty polyfill calls themselves on the client when generating html,
+ // which should mean that this gives you the best of both worlds of 0 and 1, and is
+ // therefore recommended.
var SIMD = 0; // Whether to emit SIMD code ( https://github.com/johnmccutchan/ecmascript_simd )
var CLOSURE_ANNOTATIONS = 0; // If set, the generated code will be annotated for the closure
@@ -251,8 +259,8 @@ var DISABLE_EXCEPTION_CATCHING = 0; // Disables generating code to actually catc
// TODO: Make this also remove cxa_begin_catch etc., optimize relooper
// for it, etc. (perhaps do all of this as preprocessing on .ll?)
-var EXCEPTION_CATCHING_WHITELIST = []; // Enables catching exception in listed functions if
- // DISABLE_EXCEPTION_CATCHING = 2 set
+var EXCEPTION_CATCHING_WHITELIST = []; // Enables catching exception in the listed functions only, if
+ // DISABLE_EXCEPTION_CATCHING = 2 is set
var EXECUTION_TIMEOUT = -1; // Throw an exception after X seconds - useful to debug infinite loops
var CHECK_OVERFLOWS = 0; // Add code that checks for overflows in integer math operations.
@@ -307,6 +315,17 @@ var EXPORT_ALL = 0; // If true, we export all the symbols. Note that this does *
// still eliminate functions as dead. This just exports them on the Module object.
var EXPORT_BINDINGS = 0; // Export all bindings generator functions (prefixed with emscripten_bind_). This
// is necessary to use the bindings generator with asm.js
+var RETAIN_COMPILER_SETTINGS = 0; // Remembers the values of these settings, and makes them accessible
+ // through Runtime.getCompilerSetting and emscripten_get_compiler_setting.
+ // To see what is retained, look for compilerSettings in the generated code.
+
+
+var EMSCRIPTEN_VERSION = ''; // this will contain the emscripten version. you should not modify it. This
+ // and the following few settings are useful in combination with
+ // RETAIN_COMPILER_SETTINGS
+var OPT_LEVEL = 0; // this will contain the optimization level (-Ox). you should not modify it.
+var DEBUG_LEVEL = 0; // this will contain the debug level (-gx). you should not modify it.
+
// JS library functions (C functions implemented in JS)
// that we include by default. If you want to make sure
@@ -427,7 +446,7 @@ var HEADLESS = 0; // If 1, will include shim code that tries to 'fake' a browser
var BENCHMARK = 0; // If 1, will just time how long main() takes to execute, and not
// print out anything at all whatsoever. This is useful for benchmarking.
-var ASM_JS = 0; // If 1, generate code in asm.js format. If 2, emits the same code except
+var ASM_JS = 1; // If 1, generate code in asm.js format. If 2, emits the same code except
// for omitting 'use asm'
var PGO = 0; // Enables profile-guided optimization in the form of runtime checks for
diff --git a/src/shell.html b/src/shell.html
index efb9e91d..cbf8c0d8 100644
--- a/src/shell.html
+++ b/src/shell.html
@@ -5,37 +5,1218 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Emscripten-Generated Code</title>
<style>
+ body {
+ font-family: arial;
+ margin: 0;
+ padding: none;
+ }
+
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
- textarea.emscripten { font-family: monospace; width: 80%; }
- div.emscripten { text-align: center; }
+ div.emscripten { text-align: center; }
div.emscripten_border { border: 1px solid black; }
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten { border: 0px none; }
+
+ #emscripten_logo {
+ display: inline-block;
+ margin: 0;
+ }
+
+ .spinner {
+ height: 30px;
+ width: 30px;
+ margin: 0;
+ margin-top: 20px;
+ margin-left: 20px;
+ display: inline-block;
+ vertical-align: top;
+
+ -webkit-animation: rotation .8s linear infinite;
+ -moz-animation: rotation .8s linear infinite;
+ -o-animation: rotation .8s linear infinite;
+ animation: rotation 0.8s linear infinite;
+
+ border-left: 5px solid rgb(235, 235, 235);
+ border-right: 5px solid rgb(235, 235, 235);
+ border-bottom: 5px solid rgb(235, 235, 235);
+ border-top: 5px solid rgb(120, 120, 120);
+
+ border-radius: 100%;
+ background-color: rgb(189, 215, 46);
+ }
+
+ @-webkit-keyframes rotation {
+ from {-webkit-transform: rotate(0deg);}
+ to {-webkit-transform: rotate(360deg);}
+ }
+ @-moz-keyframes rotation {
+ from {-moz-transform: rotate(0deg);}
+ to {-moz-transform: rotate(360deg);}
+ }
+ @-o-keyframes rotation {
+ from {-o-transform: rotate(0deg);}
+ to {-o-transform: rotate(360deg);}
+ }
+ @keyframes rotation {
+ from {transform: rotate(0deg);}
+ to {transform: rotate(360deg);}
+ }
+
+ #status {
+ display: inline-block;
+ vertical-align: top;
+ margin-top: 30px;
+ margin-left: 20px;
+ font-weight: bold;
+ color: rgb(120, 120, 120);
+ }
+
+ #progress {
+ height: 20px;
+ width: 30px;
+ }
+
+ #controls {
+ display: inline-block;
+ float: right;
+ vertical-align: top;
+ margin-top: 30px;
+ margin-right: 20px;
+ }
+
+ #output {
+ width: 100%;
+ height: 200px;
+ margin: 0 auto;
+ margin-top: 10px;
+ display: block;
+ background-color: black;
+ color: white;
+ font-family: 'Lucida Console', Monaco, monospace;
+ outline: none;
+ }
</style>
</head>
<body>
- <hr/>
+ <a href="http://emscripten.org">
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="296px"
+ height="78px"
+ viewBox="420 120 100 170"
+ enable-background="new 0 0 900 400"
+ xml:space="preserve"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="emscripten_powered_by_logo.svg"><metadata
+ id="metadata345"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs343"><linearGradient
+ y2="247.6265"
+ x2="225.1929"
+ y1="152.499"
+ x1="225.1929"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient5104"><stop
+ id="stop5106"
+ style="stop-color:#C1D72F"
+ offset="0.3227531" /><stop
+ id="stop5108"
+ style="stop-color:#BCD631"
+ offset="0.45119295" /><stop
+ id="stop5110"
+ style="stop-color:#AFD136"
+ offset="0.64491969" /><stop
+ id="stop5112"
+ style="stop-color:#ABD037"
+ offset="1" /><a:midPointStop
+ style="stop-color:#C1D72F"
+ offset="0.0123" /><a:midPointStop
+ style="stop-color:#C1D72F"
+ offset="0.3086" /><a:midPointStop
+ style="stop-color:#ABD037"
+ offset="1" /></linearGradient><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_2_"
+ id="linearGradient5120"
+ x1="397.56918"
+ y1="128.12726"
+ x2="397.56918"
+ y2="166.25996"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.103059,0,0,1.103059,-38.997823,3.1312145)" /><filter
+ inkscape:collect="always"
+ id="filter5126"><feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.56377237"
+ id="feGaussianBlur5128" /></filter><linearGradient
+ inkscape:collect="always"
+ xlink:href="#SVGID_2_"
+ id="linearGradient5134"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.103059,0,0,1.103059,-38.997823,3.1312145)"
+ x1="397.56918"
+ y1="128.12726"
+ x2="397.56918"
+ y2="166.25996" /></defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1440"
+ inkscape:window-height="838"
+ id="namedview341"
+ showgrid="false"
+ inkscape:zoom="0.63555556"
+ inkscape:cx="224.82424"
+ inkscape:cy="-52.085109"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_1" /><g
+ id="g5130"
+ transform="matrix(0.91591318,0,0,0.91591318,28.176953,14.143571)"><path
+ transform="matrix(1.103059,0,0,1.103059,-35.073492,-16.03923)"
+ id="path5122"
+ style="fill:#383838;fill-opacity:0.34705882;stroke:none;filter:url(#filter5126)"
+ d="m 494.39333,173.6323 c 0.57407,0.28703 1.87073,1.00226 2.89426,1.02855 0.55732,0.0143 1.14006,-0.1672 1.60262,-0.4784 1.20466,-0.81046 2.23561,-2.03031 2.72683,-3.39661 0.19424,-0.54027 0.0238,-1.72222 0.0238,-1.72222 l -3.82713,-14.06478 -1.98533,0 0.50231,-2.67891 6.36261,0 2.55939,12.22285 4.78392,-9.68746 -2.00924,0 0,-2.65498 7.19979,0 -11.00301,22.38875 -1.69829,1.91358 -2.29628,1.3395 -2.46371,0.26312 -2.29628,-0.21528 -2.79859,-1.36342 z m -12.0637,-14.56445 c -0.93698,1.88565 -1.70261,4.35262 -0.81842,6.26333 0.36549,0.78976 1.35098,1.19428 2.192,1.41737 0.60934,0.16133 1.29167,0.0999 1.88775,-0.10468 0.48126,-0.1655 0.8829,-0.5224 1.255,-0.8697 0.40341,-0.3768 0.77723,-0.80461 1.03505,-1.29262 0.21864,-0.41395 0.40236,-0.84786 0.49325,-1.30698 0.20667,-1.0485 0.35879,-2.1079 0.33583,-3.17631 -0.0184,-0.87403 -0.0789,-1.87107 -0.47711,-2.64959 -0.26344,-0.51379 -0.77017,-0.71849 -1.33113,-0.85633 -0.42395,-0.10479 -0.81432,-0.0626 -1.21773,0.10517 -0.65479,0.27273 -1.2544,0.5311 -1.82112,0.95764 -0.57331,0.4317 -1.21403,0.86959 -1.53337,1.5127 z m 0.65588,-4.31208 c 0,0 2.19341,-1.80738 3.45549,-2.27082 0.71718,-0.26365 3.45363,-0.65258 4.15,-0.3378 1.47292,0.66633 2.26103,1.57529 2.7222,2.60001 0.46118,1.02472 0.69944,2.59956 0.79701,3.73627 0.13278,1.55027 -0.13682,3.77629 -0.53404,5.74843 -0.30079,1.49256 -1.01883,2.74423 -1.83478,3.92156 -1.06526,1.5373 -1.82382,2.15116 -3.66756,2.46594 -0.98864,0.16889 -1.93845,0.46787 -3.25466,0.0928 -1.4384,-0.40963 -2.35273,-0.81244 -3.39599,-1.63337 -0.72524,-0.57054 -1.16043,-1.54043 -1.16043,-1.54043 l 0,2.82636 -4.8903,0 3.39872,-23.01602 -1.92242,-0.85888 0.0403,-2.38127 7.25847,0.0534 z m -23.77803,2.20447 c 0.29175,1.49273 0.0813,4.83252 -0.86111,6.69751 -0.3062,0.60617 -0.94813,1.32967 -1.55479,1.6983 -1.01515,0.61713 -2.21688,1.21322 -3.3966,1.07639 -0.47944,-0.0541 -0.97036,-0.34348 -1.24383,-0.74151 -0.47686,-0.69328 -0.43621,-1.55032 -0.45448,-2.39198 -0.024,-1.06873 0.13137,-2.23775 0.38272,-3.277 0.18705,-0.7744 0.4229,-1.58254 0.86111,-2.24844 0.39037,-0.59323 0.92628,-1.12617 1.55478,-1.45909 0.54854,-0.29014 1.19695,-0.38467 1.81791,-0.40664 0.63637,-0.0231 1.3031,0.0385 1.88966,0.28704 0.3875,0.16453 0.92361,0.3524 1.00463,0.76542 z m 1.29312,-9.69052 -0.64254,6.12262 c 0,0 -1.68393,-0.96858 -2.605,-1.25148 -0.73032,-0.22434 -1.50312,-0.36654 -2.26624,-0.33838 -0.97069,0.0345 -1.91182,0.22099 -2.81751,0.57088 -0.9185,0.35497 -1.78344,0.94565 -2.49338,1.62792 -0.88025,0.84538 -1.51404,1.90455 -2.02977,3.0106 -0.39653,0.84993 -0.69517,1.75284 -0.87975,2.67232 -0.22875,1.14241 -0.44415,2.38719 -0.43937,3.55197 0.01,1.44865 0.0623,2.89489 0.54092,4.26214 0.25525,0.72907 0.71643,1.40578 1.28572,1.9283 0.56835,0.52207 1.29566,0.87604 2.02935,1.11621 0.41072,0.13491 0.85346,0.17274 1.28579,0.16935 1.00285,-0.01 2.03715,-0.0883 2.97671,-0.43999 0.66497,-0.2489 1.21759,-0.73399 1.79298,-1.1502 0.75304,-0.54475 2.16476,-1.86006 2.16476,-1.86006 l 0,1.62374 -0.5751,0 0,1.48807 6.86709,0 0,-2.84135 -1.92841,0 3.21374,-23.57782 -7.37422,0 0,2.33412 z m -93.60062,7.55781 2.33363,15.57933 6.23084,0 4.04243,-11.34169 1.62654,11.34169 5.88425,0 7.05633,-16.38872 0,-2.0141 -6.1713,0 0,2.82349 1.88966,0 -4.04243,10.16973 -0.74151,0 -1.29167,-12.55773 -5.38194,0 -4.7361,12.50989 -1.55478,-12.94538 -6.86496,0 0,2.82349 z m -12.15,0.72146 c -0.56264,0.0892 -1.03524,0.17358 -1.53086,0.45447 -0.737,0.41808 -1.46132,0.95771 -1.91357,1.67437 -0.44123,0.70048 -0.53204,1.57581 -0.66975,2.39196 -0.1751,1.04003 -0.20064,2.10306 -0.19136,3.15741 0.01,0.81614 -0.0138,1.66577 0.35879,2.39197 0.1904,0.37315 0.52874,0.80945 0.88503,1.02855 0.56015,0.34453 1.06632,0.55494 1.72222,0.598 0.72597,0.0483 1.48801,-0.18852 2.10493,-0.57408 0.59422,-0.37072 1.03334,-0.97401 1.38735,-1.5787 0.46117,-0.78744 0.70905,-1.69257 0.90895,-2.58334 0.20377,-0.90704 0.33579,-1.84565 0.28703,-2.77468 -0.0491,-0.92714 -0.18211,-1.88434 -0.57407,-2.72684 -0.2728,-0.58681 -0.70954,-1.00753 -1.29166,-1.29165 -0.44403,-0.21628 -0.99455,-0.24402 -1.48303,-0.16744 z m -6.62442,-0.73581 c 0.65404,-0.6664 1.4072,-1.25479 2.23273,-1.69161 1.0305,-0.54505 2.16429,-0.92749 3.31518,-1.11604 1.51307,-0.24806 3.09342,-0.2847 4.60036,0 0.88055,0.16632 1.78322,0.44742 2.50307,0.98113 0.77409,0.57312 1.35279,1.40936 1.79291,2.26639 0.42901,0.83457 0.6828,1.77223 0.77798,2.70605 0.16564,1.61985 0.024,3.29135 -0.37201,4.87103 -0.33328,1.33759 -0.88436,2.64754 -1.65745,3.78889 -0.67549,0.99679 -1.52894,1.91262 -2.53721,2.5709 -0.89957,0.58746 -1.9718,0.87641 -3.01035,1.15006 -0.87153,0.22963 -1.77166,0.4095 -2.67235,0.40576 -1.21068,-0.01 -2.47998,-0.0817 -3.58589,-0.57511 -1.09854,-0.48896 -1.89728,-1.32739 -2.60455,-2.30013 -0.61123,-0.83995 -1.02561,-1.59975 -1.31932,-2.87516 -0.2125,-0.9233 -0.40006,-2.19912 -0.37215,-3.14592 0.0335,-1.16537 0.3568,-2.74121 0.83416,-3.80434 0.52547,-1.17098 1.17609,-2.3161 2.07489,-3.2319 z m 94.95184,13.82318 c -2.20516,1.01761 -4.61429,1.69636 -7.02343,1.69636 -5.32726,0 -7.22678,-3.12145 -7.22678,-7.22678 0,-7.1251 4.54685,-11.19645 10.0772,-11.19645 3.7324,0 5.56453,1.69625 5.56453,4.47856 0,4.85189 -5.12329,6.27735 -10.41633,6.82001 0.10168,1.73076 0.81446,3.32485 3.3592,3.32485 1.2218,0 2.88401,-0.37315 4.91982,-1.22099 z m -3.22292,-11.77374 c 0,-0.81423 -0.57695,-1.28891 -1.62876,-1.28891 -1.89988,0 -3.46041,1.66212 -3.96978,4.34287 1.45897,-0.20368 5.59854,-0.91613 5.59854,-3.05396 z m -30.33408,11.77374 c -2.2054,1.01761 -4.61457,1.69636 -7.02371,1.69636 -5.32653,0 -7.22671,-3.12145 -7.22671,-7.22678 0,-7.1251 4.54679,-11.19645 10.07785,-11.19645 3.73175,0 5.56382,1.69625 5.56382,4.47856 0,4.85189 -5.12273,6.27735 -10.41568,6.82001 0.10142,1.73076 0.81422,3.32485 3.35884,3.32485 1.22158,0 2.8842,-0.37315 4.91994,-1.22099 z m -3.22305,-11.77374 c 0,-0.81423 -0.57638,-1.28891 -1.62883,-1.28891 -1.89959,0 -3.46023,1.66212 -3.96971,4.34287 1.4591,-0.20368 5.59854,-0.91613 5.59854,-3.05396 z m -82.36051,20.5268 -0.0679,-0.13571 0.98406,-5.66614 2.10303,-15.16698 c 0.0687,-0.40664 -0.0332,-0.61046 -0.30522,-0.71214 l -1.66259,-0.61111 0.37379,-2.57855 6.78556,0 -0.40663,2.71427 0.10142,0.0335 c 2.0016,-1.86631 4.10566,-3.08743 6.24306,-3.08743 2.91821,0 4.95366,1.86577 4.95366,6.78561 0,4.68241 -1.83206,11.6379 -8.14271,11.6379 -2.20534,0 -3.42694,-0.84825 -4.68256,-1.73039 l -0.74621,5.08917 c -0.0341,0.37361 0.0326,0.50898 0.47457,0.54273 l 3.42697,0.33969 -0.37385,2.5447 -9.0589,0 z m 6.78613,-12.04485 c 0.84787,0.71258 1.96788,1.32305 3.22348,1.32305 2.74798,0 3.76601,-3.86811 3.76601,-6.85368 0,-2.002 -0.47476,-3.32542 -1.76432,-3.32542 -1.35696,0 -3.08763,1.4591 -4.30913,2.54506 z m 81.08934,4.85147 0.33969,-2.54464 1.56064,-0.2038 c 0.47498,-0.0683 0.5429,-0.1695 0.61084,-0.67837 l 1.42466,-10.34864 c 0.0335,-0.37315 -0.0335,-0.61046 -0.33914,-0.71214 l -1.69691,-0.61111 0.37365,-2.57855 6.71797,0 -0.44097,3.05395 0.10191,0.0679 c 1.32326,-1.89982 3.22359,-3.46042 5.39485,-3.46042 0.7463,0 2.0359,0.13582 2.61295,0.30538 l -0.84863,6.17508 -3.96972,-0.13582 -0.10157,-1.76443 c -0.0335,-0.30537 -0.10223,-0.40701 -0.37391,-0.40701 -0.64452,0 -1.69636,0.78027 -2.64651,1.76455 l -1.18674,8.61817 c -0.0687,0.54303 -0.0334,0.64474 0.47477,0.67874 l 3.22351,0.27142 -0.37384,2.51081 -10.8575,0 z"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cssscccccccccccccccccssssssssccssscssssscsssccccccccsssssssssccsccsssssssssscsscccccccccccccccccccccccccccccccsssscsssssscscsssssssscsssssssssscsssscsccsscscsssscsccsscsccccccccccsssccccccccssscccccccccccccsccccsccccccc" /><path
+ sodipodi:nodetypes="cssscccccccccccccccccssssssssccssscssssscsssccccccccsssssssssccsccsssssssssscsscccccccccccccccccccccccccccccccsssscsssssscscsssssssscsssssssssscsssscsccsscscsssscsccsscsccccccccccsssccccccccssscccccccccccccsccccsccccccc"
+ inkscape:connector-curvature="0"
+ d="m 509.55935,174.26011 c 0.63327,0.31663 2.06355,1.10555 3.19256,1.13455 0.61476,0.0158 1.25757,-0.18443 1.76781,-0.5277 1.3288,-0.89397 2.46618,-2.23946 3.00784,-3.74661 0.21419,-0.59598 0.0258,-1.89972 0.0258,-1.89972 l -4.22153,-15.51428 -2.18993,0 0.55406,-2.95501 7.01835,0 2.82313,13.48255 5.27696,-10.68586 -2.21631,0 0,-2.92858 7.94179,0 -12.13698,24.69605 -1.87332,2.11078 -2.5329,1.4776 -2.71762,0.29022 -2.53295,-0.23748 -3.08699,-1.50392 z m -13.30698,-16.06545 c -1.0335,2.08005 -1.87803,4.80122 -0.90274,6.90883 0.4032,0.87116 1.49018,1.31738 2.4179,1.56347 0.67214,0.17793 1.42477,0.1102 2.08233,-0.11548 0.53084,-0.1826 0.97383,-0.5762 1.38432,-0.9593 0.44502,-0.4157 0.85733,-0.8875 1.14176,-1.42582 0.24113,-0.45665 0.44375,-0.93526 0.54404,-1.44168 0.22797,-1.1566 0.3958,-2.3252 0.37043,-3.50371 -0.0204,-0.96413 -0.0869,-2.06387 -0.52631,-2.92259 -0.29054,-0.56679 -0.84946,-0.79259 -1.46826,-0.94463 -0.46761,-0.11559 -0.89829,-0.0686 -1.34322,0.11597 -0.72226,0.30083 -1.38368,0.5859 -2.00879,1.05634 -0.63242,0.4762 -1.33915,0.9593 -1.69146,1.6686 z m 0.72346,-4.75648 c 0,0 2.41951,-1.99358 3.81169,-2.50482 0.79109,-0.29085 3.80953,-0.71977 4.57766,-0.3726 1.6247,0.73503 2.49408,1.73759 3.00274,2.86791 0.50868,1.13043 0.77154,2.86756 0.87911,4.12137 0.14648,1.71007 -0.15092,4.16549 -0.58904,6.34083 -0.33179,1.64636 -1.12383,3.02703 -2.02388,4.32576 -1.17506,1.6957 -2.01178,2.37286 -4.04556,2.72004 -1.09051,0.18629 -2.13814,0.51607 -3.59006,0.10268 -1.5866,-0.45183 -2.59522,-0.89615 -3.74599,-1.8017 -0.79994,-0.62933 -1.28003,-1.6992 -1.28003,-1.6992 l 0,3.11766 -5.39426,0 3.74898,-25.38802 -2.12052,-0.94738 0.0443,-2.62669 8.00657,0.0587 z m -26.22853,2.43167 c 0.32185,1.64663 0.0893,5.33062 -0.9498,7.38781 -0.33781,0.66857 -1.04588,1.46667 -1.7151,1.8733 -1.11975,0.68073 -2.44527,1.33822 -3.7466,1.18729 -0.52883,-0.0601 -1.07036,-0.37888 -1.37203,-0.81791 -0.52601,-0.76478 -0.48121,-1.71012 -0.50128,-2.63848 -0.0263,-1.17893 0.14487,-2.46835 0.42212,-3.6147 0.20635,-0.8543 0.4665,-1.74564 0.94981,-2.48024 0.43067,-0.65433 1.02178,-1.24217 1.71508,-1.60939 0.60504,-0.32004 1.32025,-0.42437 2.00521,-0.44854 0.70197,-0.0251 1.4374,0.0425 2.08446,0.31654 0.4274,0.18153 1.01882,0.3888 1.10813,0.84432 z m 1.42642,-10.68922 -0.70874,6.75362 c 0,0 -1.85753,-1.06838 -2.8735,-1.38048 -0.80562,-0.24744 -1.65802,-0.40424 -2.49984,-0.37318 -1.07069,0.0382 -2.10882,0.24369 -3.1078,0.62968 -1.01321,0.39157 -1.96724,1.04315 -2.75039,1.79572 -0.97095,0.93248 -1.67003,2.10085 -2.23897,3.3208 -0.43738,0.93753 -0.76677,1.93354 -0.9704,2.94777 -0.2523,1.26016 -0.4899,2.63324 -0.48461,3.91802 0.011,1.59795 0.0683,3.19329 0.59661,4.70144 0.28155,0.80417 0.79028,1.55058 1.41822,2.127 0.62695,0.57587 1.4292,0.96634 2.23856,1.23121 0.45301,0.14881 0.94135,0.19054 1.41828,0.18685 1.10615,-0.011 2.24705,-0.0973 3.28346,-0.48539 0.73352,-0.2745 1.34304,-0.80959 1.97773,-1.2687 0.83064,-0.60085 2.38786,-2.05176 2.38786,-2.05176 l 0,1.79104 -0.63429,0 0,1.64147 7.57478,0 0,-3.13415 -2.12721,0 3.54494,-26.00772 -8.13411,0 0,2.57462 z m -103.24702,8.33671 2.57413,17.18493 6.87304,0 4.45903,-12.51049 1.79414,12.51049 6.49065,0 7.78353,-18.07772 0,-2.2217 -6.8073,0 0,3.11449 2.08446,0 -4.45903,11.21783 -0.8179,0 -1.42488,-13.85193 -5.93654,0 -5.2242,13.79919 -1.71497,-14.27958 -7.57246,0 0,3.11449 z m -13.4021,0.79586 c -0.62064,0.0982 -1.14194,0.19148 -1.68866,0.50127 -0.813,0.46118 -1.61192,1.05641 -2.11077,1.84697 -0.48673,0.77268 -0.58683,1.73821 -0.73875,2.63846 -0.1932,1.14723 -0.22134,2.31976 -0.21116,3.48281 0.011,0.90024 -0.0148,1.83747 0.39579,2.63847 0.21,0.41165 0.58324,0.89285 0.97623,1.13455 0.61796,0.38003 1.17622,0.61214 1.89972,0.6596 0.80077,0.0533 1.64141,-0.20792 2.32189,-0.63318 0.65546,-0.40892 1.13978,-1.07441 1.53029,-1.7414 0.50878,-0.86864 0.78215,-1.86707 1.00265,-2.84964 0.22477,-1.00044 0.37039,-2.03585 0.31663,-3.06058 -0.0541,-1.02274 -0.20091,-2.07854 -0.63327,-3.00784 -0.3009,-0.64731 -0.78264,-1.11143 -1.42476,-1.42485 -0.48983,-0.23858 -1.09705,-0.26912 -1.63583,-0.18464 z m -7.30711,-0.81171 c 0.72143,-0.735 1.55219,-1.38409 2.46282,-1.86591 1.1367,-0.60125 2.38729,-1.02309 3.65678,-1.23104 1.66908,-0.27366 3.41222,-0.314 5.07446,0 0.97135,0.18342 1.96702,0.49352 2.76107,1.08223 0.85389,0.63222 1.49219,1.55466 1.97771,2.49999 0.47321,0.92057 0.7531,1.95483 0.85808,2.98495 0.18274,1.78675 0.0263,3.63055 -0.41031,5.37303 -0.36757,1.47539 -0.97545,2.92034 -1.82825,4.17929 -0.74509,1.09959 -1.68654,2.10982 -2.79871,2.8359 -0.99227,0.64796 -2.175,0.96671 -3.32055,1.26856 -0.96139,0.25333 -1.95426,0.4517 -2.94774,0.44756 -1.33549,-0.011 -2.73559,-0.0897 -3.9555,-0.63431 -1.21174,-0.53936 -2.09278,-1.46419 -2.87295,-2.53723 -0.67423,-0.92645 -1.13131,-1.76457 -1.45532,-3.17146 -0.2344,-1.0184 -0.44126,-2.42572 -0.41044,-3.47012 0.0365,-1.28547 0.39349,-3.02371 0.92005,-4.19644 0.57967,-1.29168 1.29729,-2.5548 2.2888,-3.565 z m 104.73744,15.24778 c -2.43247,1.12251 -5.0899,1.87126 -7.74734,1.87126 -5.87626,0 -7.97147,-3.44315 -7.97147,-7.97158 0,-7.8594 5.0154,-12.35035 11.11569,-12.35035 4.11711,0 6.13803,1.87105 6.13803,4.94016 0,5.35189 -5.65129,6.92425 -11.48983,7.52281 0.11219,1.90916 0.89836,3.66755 3.7054,3.66755 1.3477,0 3.18121,-0.41165 5.42682,-1.34689 z m -3.55513,-12.98704 c 0,-0.89823 -0.63635,-1.42181 -1.79655,-1.42181 -2.09568,0 -3.81712,1.83342 -4.37899,4.79047 1.60937,-0.22468 6.17554,-1.01053 6.17554,-3.36866 z m -33.46028,12.98704 c -2.4327,1.12251 -5.09006,1.87126 -7.74751,1.87126 -5.87553,0 -7.97151,-3.44315 -7.97151,-7.97158 0,-7.8594 5.01539,-12.35035 11.11645,-12.35035 4.11635,0 6.13722,1.87105 6.13722,4.94016 0,5.35189 -5.65062,6.92425 -11.48908,7.52281 0.11182,1.90916 0.89812,3.66755 3.70494,3.66755 1.34748,0 3.1815,-0.41165 5.42704,-1.34689 z m -3.55514,-12.98704 c 0,-0.89823 -0.63578,-1.42181 -1.79674,-1.42181 -2.09539,0 -3.81683,1.83342 -4.37881,4.79047 1.60951,-0.22468 6.17555,-1.01053 6.17555,-3.36866 z m -90.84852,22.6422 -0.0749,-0.14971 1.08546,-6.25004 2.31984,-16.73008 c 0.0757,-0.44854 -0.0367,-0.67336 -0.33673,-0.78554 l -1.83388,-0.67411 0.41228,-2.84425 7.48486,0 -0.44853,2.99397 0.11182,0.0371 c 2.2079,-2.05871 4.52887,-3.40563 6.88646,-3.40563 3.21901,0 5.46427,2.05807 5.46427,7.48491 0,5.16501 -2.02094,12.8373 -8.98192,12.8373 -2.43264,0 -3.78014,-0.93565 -5.16516,-1.90869 l -0.82311,5.61357 c -0.0376,0.41212 0.0356,0.56148 0.52347,0.59873 l 3.78017,0.37469 -0.41234,2.8069 -9.9925,0 z m 7.48553,-13.28615 c 0.93528,0.78598 2.17068,1.45946 3.55568,1.45946 3.03118,0 4.15411,-4.26682 4.15411,-7.56009 0,-2.2083 -0.52366,-3.66812 -1.94612,-3.66812 -1.49686,0 -3.40583,1.6095 -4.75323,2.80736 z m 89.44624,5.35147 0.37469,-2.80694 1.72154,-0.2248 c 0.52388,-0.0753 0.5988,-0.1869 0.67374,-0.74827 l 1.57152,-11.41514 c 0.0365,-0.41155 -0.0368,-0.67336 -0.3741,-0.78554 l -1.87181,-0.67411 0.41215,-2.84425 7.41037,0 -0.48647,3.36865 0.11241,0.0749 c 1.45966,-2.09562 3.55581,-3.81702 5.95085,-3.81702 0.8232,0 2.2457,0.14982 2.88225,0.33688 l -0.93613,6.81148 -4.37882,-0.14982 -0.11196,-1.94633 c -0.0371,-0.33677 -0.11284,-0.44891 -0.41252,-0.44891 -0.71092,0 -1.87116,0.86067 -2.91921,1.94635 l -1.30904,9.50637 c -0.0757,0.59903 -0.0368,0.71124 0.52367,0.74874 l 3.55571,0.29932 -0.41234,2.76961 -11.9765,0 z"
+ style="fill:url(#linearGradient5134);fill-opacity:1;stroke:none"
+ id="path5080" /></g><path
+ fill="#E2E2E2"
+ d="M256.023,135.437H196.36c-16.432,0-29.8,13.368-29.8,29.8v73.527c0,16.432,13.368,29.8,29.8,29.8h59.663 c16.433,0,29.801-13.368,29.801-29.8v-73.527C285.824,148.805,272.456,135.437,256.023,135.437z M191.561,165.236 c0-2.646,2.153-4.8,4.8-4.8h59.663c2.647,0,4.801,2.153,4.801,4.8v73.527c0,2.646-2.153,4.8-4.801,4.8H196.36 c-2.646,0-4.8-2.153-4.8-4.8V165.236z"
+ id="path3" /><path
+ d="m 531.664,250.155 h 18.498 l -2.809,18.064 h 5.59 37.586 l 2.6,-17.718 c 4.98,-1.091 9.133,-3.455 12.512,-6.693 3.084,4.075 8.566,7.37 18.252,7.37 6.338,0 12.775,-1.807 17.174,-3.687 4.254,2.399 9.463,3.687 15.459,3.687 3.088,0 6.236,-0.355 9.426,-1.023 h 67.135 l 3.354,-24.827 -5.445,-0.764 1.879,-13.356 c 0.371,-2.386 0.449,-4.66 0.449,-6.156 l -0.008,-0.375 c -0.457,-12.191 -8.139,-19.765 -20.045,-19.765 -2.404,0 -4.623,0.314 -6.676,0.852 h -34.189 l -0.035,0.244 c -2.527,-0.701 -5.41,-1.096 -8.686,-1.096 -3.801,0 -7.406,0.555 -10.76,1.598 l 0.105,-0.746 h -12.467 l 1.826,-12.951 H 615.08 l -1.846,7.658 c -1.373,5.704 -2.213,5.793 -4.453,6.03 l -4.508,0.477 c -3.049,-1.424 -6.357,-2.065 -9.602,-2.065 -2.135,0 -4.275,0.284 -6.416,0.852 h -19.291 c 0.502,-1.772 0.775,-3.674 0.775,-5.678 0,-9.601 -6.846,-16.305 -16.646,-16.305 -11.055,0 -18.775,7.721 -18.775,18.776 0,0.951 0.082,1.869 0.219,2.764 -2.135,-0.288 -4.277,-0.409 -5.553,-0.409 -2.053,0 -4.072,0.288 -6.045,0.852 h -31.342 c -2.74,-0.553 -5.641,-0.852 -8.537,-0.852 -7.138,0 -13.492,1.674 -18.808,4.723 l -3.451,-1.461 c -3.711,-1.571 -11.232,-3.262 -18.979,-3.262 -8.933,0 -16.383,2.56 -21.576,7.016 -3.265,-4.473 -8.523,-7.016 -15.228,-7.016 -4.822,0 -9.021,1.477 -12.572,3.44 -2.996,-2.204 -6.796,-3.44 -11.115,-3.44 -2.327,0 -4.48,0.315 -6.476,0.852 h -33.963 l -0.035,0.245 c -2.526,-0.702 -5.41,-1.097 -8.687,-1.097 -20.458,0 -35.307,16.031 -35.307,38.117 0,17.363 10.785,28.149 28.148,28.149 3.087,0 6.236,-0.356 9.426,-1.023 h 88.816 c 3.706,0.676 7.669,1.023 11.154,1.023 8.907,0 16.278,-2.375 21.51,-6.593 4.872,4.252 11.585,6.593 19.728,6.593 3.053,0 6.206,-0.368 9.286,-1.023 h 44.664 2.069 z"
+ id="path5"
+ inkscape:connector-curvature="0"
+ style="fill:#e2e2e2" /><path
+ fill="#F5F5F5"
+ d="M255.023,133.437H195.36c-16.432,0-29.8,13.368-29.8,29.8v73.527c0,16.432,13.368,29.8,29.8,29.8h59.663 c16.433,0,29.801-13.368,29.801-29.8v-73.527C284.824,146.805,271.456,133.437,255.023,133.437z M190.561,163.236 c0-2.646,2.153-4.8,4.8-4.8h59.663c2.647,0,4.801,2.153,4.801,4.8v73.527c0,2.646-2.153,4.8-4.801,4.8H195.36 c-2.646,0-4.8-2.153-4.8-4.8V163.236z"
+ id="path7" /><g
+ id="g9"><g
+ id="g11"><path
+ fill="#FBFDF8"
+ d="M195.361,251.626c-8.161,0-14.8-6.64-14.8-14.8v-73.527c0-8.161,6.639-14.8,14.8-14.8h59.663 c8.161,0,14.8,6.639,14.8,14.8v73.527c0,8.16-6.639,14.8-14.8,14.8H195.361z"
+ id="path13" /><path
+ fill="#F0F4E1"
+ d="M255.024,152.499c5.964,0,10.8,4.835,10.8,10.8v73.527c0,5.965-4.835,10.8-10.8,10.8h-59.663 c-5.964,0-10.8-4.835-10.8-10.8v-73.527c0-5.964,4.835-10.8,10.8-10.8H255.024 M255.024,144.499h-59.663 c-10.366,0-18.8,8.434-18.8,18.8v73.527c0,10.366,8.434,18.8,18.8,18.8h59.663c10.366,0,18.8-8.434,18.8-18.8v-73.527 C273.824,152.933,265.391,144.499,255.024,144.499L255.024,144.499z"
+ id="path15" /></g><defs
+ id="defs17"><filter
+ id="Adobe_OpacityMaskFilter"
+ filterUnits="userSpaceOnUse"
+ x="176.562"
+ y="144.499"
+ width="97.263"
+ height="111.127"><feColorMatrix
+ type="matrix"
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ color-interpolation-filters="sRGB"
+ result="source"
+ id="feColorMatrix20" /></filter></defs><mask
+ maskUnits="userSpaceOnUse"
+ x="176.562"
+ y="144.499"
+ width="97.263"
+ height="111.127"
+ id="SVGID_1_"><g
+ filter="url(#Adobe_OpacityMaskFilter)"
+ id="g23"><image
+ overflow="visible"
+ width="422"
+ height="480"
+ xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEBLAEsAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAAAg2AAAQ4QAAF1b/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAeMBqQMBIgACEQEDEQH/ xACjAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQHAgEBAQAAAAAAAAAAAAAAAAAAAAEQAAEDAQQKAwAC AwEAAAAAAAABAwQCMRMUBRBQEjMVJQYWNgcgESEwI5AiMkARAAEBAwsEAQIFAwUBAAAAAAABMQID EFAycqOz0wQ0RaURIXGRIEFRMGEiExRAgRKh0SMzQxUSAQAAAAAAAAAAAAAAAAAAAJD/2gAMAwEA AhEDEQAAANUJsrZYFfFgV8WBXxYEL0ki5fo6GjJuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRuaRu aRuaMHQ5dR3ojnJ9XxYFfFgV8WD0jxf2AodbslbAD6mDhlpLvI/qkuiovZL7CGzNfRCJwQacEGnB Bp0QSdEEnRBJ0QSdEEnRBJ3BBpwQacEHidwQXzPfBA6bBqK5w2nlKVH3iJitt+gAeweP+wFDrdkr Y+vmaN02k6+e3d2Gjo6N0c2zoyaM7xozuGluGluGluGluGluGluGluGluGluGluGluGnG8c/z1YO PVIfJF80xoIGPsfBVVrl6hIrD7+B7B4/7AUOt2StnXaYyxHTJ6ZKvrqb4x9MgAAAAAAAAAAAAAAA DGR8692Dh4pbkIKJscTVNiLdVY1+weP+wFDgJ+JLJORs3XbIc3dGz6ZAAAAAAAAAAAAAAAAAAAPn R0ayMi5uLqv1S51eIT2Dx/2AofB38Ra5uIm6kOzm6o+gAAAAAAAAAAAAAAAAAAAPj7+TkjJWNIOt 2et1WfYPH/YIofH2cZcJyEnKkenn6IyAAAAAAAAAAAAAAAAAAABjODmjZONIWt2WtVWPYPH/AGCK Hx9nIXGcg5ypLfo3xkAAAAAAAAAAAAAAAAAAADGcHPGyUaQ1astaqseweP8AsEUPk6+QuM7BTtSW 7TujIAAAAAAAAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f9gih8nXyFxnYKdqS3ad0ZAAAAAAAAAA AAAAAAAAAAxnBzx0jHENWbNWarHsHj/sEUPk6+QuM7BTtSW7TujIAAAAAAAAAAAAAAAAAAAGM4Oe OkY4hqzZqzVY9g8f9gih8nXyFxnYKdqS3ad0ZAAAAAAAAAAAAAAAAAAAAxnBzx0jHENWbNWarHsH j/sEUPk6+QuM7BTtSW7TujIAAAAAAAAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f9gih8nXyFxnYK dqS3ad0ZAAAAAAAAAAAAAAAAAAAAxnBzx0jHENWbNWarHsHj/sEUPk6+QuM7BTtSW7TujIAAAAAA AAAAAAAAAAAAAGM4OeOkY4hqzZqzVY9g8f8AYIofJ18hcZ2Cnakt2ndGQAAAAAAAAAAAAAAAAAAA MZwc8dIxxDVmzVmqx7B4/wCwRQ+Tr5C4zsFO1JbtO6MgAAAAAAAAAAAAAAAAAAAYzg546RjiGrNm rNVj2Dx/2CKHydfIXGdgp2pLdp3RkAAAAAAAAAAAAAAAAAAADGcHPHSMcQ1Zs1ZqseweP+wRQ+Tr 5C4zsFO1JbtO6MgAAAAAAAAAAAAAAAAAAAYzg546RjiGrNmrNVj2Dx/2CKHydfIXGdgp2pLdp3Rk AAAAAAAAAAAAAAAAAAADGcHPHSMcQ1Zs1ZqseweP+wRQ+Tr5C4zsFO1JbtO6MgAAAAAAAAAAAAAA AAAAAYzg546RjiGrNmrNVj2Dx/2CKHydfIXGdgp2pLdp3RkAAAAAAAAAAAAAAAAAAADGcHPHSMcQ 1Zs1ZqseweP+wRQ+Tr4y5TkHOVJb9G+MgAAAAAAAAAAAAAAAAAAAYzg542SjSGrVlrVVj2Dx/wBg ih8fZxlxnIKcqT6ObpjIAAAAAAAAAAAAAAAAAAAGM4OeNkY0h61Za1VY9g8f9gih8Xbwlxm4GbqW 6uLrj7AAAAAAAAAAAAAAAAAAAA+fr5OaNkI0ia1Y61Vb9g8f9gihxknCl1m65N1OdsZ3x0ZxkAAA AAAAAAAAAAAAAAAAx8fek5ozui6jazYKsRPsHj/sEUOu2Ktlqn6XZ6scjBSRLbOPpjYxkAAAAAAA AAAAAAAAAAYfJjm+uM0xXVE1xVOZr0Y9g8f9gKHW7JWz7s1W6i9SdYlasXXB9pLbI7fHY5/s3NeT 7fGT6fI+nyPp8j6fI+nyPp8j6fI+nyPp8j6fI+nyPp8D7x8fJtxp1m7Tp5jbw/MfWIjbXTk5SHsH j/sBQ63ZK2AdthqO8vXbUZWrJ0V/oJ7ZB7Sa+ofJMIkS6IySyJRLIkSyJEsiRLIkSyJEsiRLIkSy JVLYiRLYicEr8xfwSemN0kjy8PIdkfxQp0xWEAPYPH/YCh1uyVsAAz08ome2si37qZkumaULspIu 2aRkuyki7KSLspIuyki7KSLspIuyki7KSLtilC6qSLtilC6fNNFu5qz8k7wcI+vkAAHsHj/sBWoQ AAAAAAAAAAAAAAAAAAAAAAAAAHpAf//aAAgBAgABBQD/ACi//9oACAEDAAEFAP8AKL//2gAIAQEA AQUA6w6rz/LM+776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvv qs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qz vvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++qzvvqs776rO++ qzvvqs776rMfLPYHlHyRFUbivuDeUv1FOSVKJkRwE4CcAOAHADgBwA4AcAOAHADgBwA4AcAOAHAD gBwA4AcAOAHADgBwA4AcAOAnARciFyRUK8ndQcgyGxaaqf4fYHlHwRFUjZe68RsqbpGoKIUQkKYY kISEYJDAmBMCYEwJgTAmBMCYEwJgTAmBMCYEwJgTAmBMCYEwJgTAmCQWELCKoSFcNByEhIyxusk5 VVQV0VUL8vYHlGltupyqDlaIMREQaijcUoilMUSKgkZDDIYZDDIYZDDIYZDDIYZDDIYZDDIYZDDI YZDDIYZDDIYZDDIYZDDIYZDDIYZDDIYZDDILGQWKVRSuKORR2KPRCZltDiSYrjFXx9geUaG26nKs vy9KEjxhmONRxuOUMFLAjIjJdF0XRdIXSF0hdF0XRdF0XRdF0XRdF0XRdF0XRdIXSF0hdIXRdCsi sisFTBXHHY49GH4xMhU10y4tTFfw9geUCJ9rlcL6SNHGGBlgbZKGilsShDZQ+kPr/wBX0fSGygtC CtoVNDjI6wPsElgzCGjlLrdTden2B5QZfGvnYbCIkdkYZGmihsSn61ItJXQOtD7JIZJTBm0X6+Hs DyhP1cpjbLcVojtDLY3QIn1qZU+yugebJDRKaJ7CVUvtq27o9geURaLx6C19JFbI7Y1QU0/WqFQd oH6CS2TG/wAzZrZd0ewPKMqo2n4VH5FoGKBunVTifj9JJpJdBnVH+mj2B5RkqfdcOki0jFJQn5qm pPx5CTSS6TOKf6tHsDyjI0/2hIRU/GUKbNU1DyfklCWhm6f06PYHlGRf9QkIqfjKCWapWx4kkszj daPYHlGQ2wrItjImqlseJJMM43Wj2B5RkNsEjWNarUeJJMM43Oj2B5RkNsEjWNarUeJJMM43Oj2B 5RkNsGyLY1qtR6ySTDONzo9geUZDbBsi2NarUesk2TDON1o9geUZDbBsjWNarUesk2TDON1o9geU ZDbBsjWNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDb BsjWNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsj WNarUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNa rUeskkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUe skkwzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskk wzjdaPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskkwzj daPYHlGQ2wbI1jWq1HrJJMM43Wj2B5RkNsGyNY1qtR6ySTDON1o9geUZDbBsjWNarUeskkwzjdaP YHlGQ2wbI1jWq1HrJNkwzjdaPYHlGQ2wbItjWq1HrJNkwzjdaPYHlGQ2wbItjWq1HrJJMM43Oj2B 5RkNsGyNY1qtR4kkwzjc6PYHlGQ2wSNY1qtR4kkwzjc6PYHlGQ2wrItjImqlseJJMM43Wj2B5RkV sJSKv4yolmqVseJJLM43Wj2B5Rkf/UJSKv4ypTZqmoeX8kqS1M43Oj2B5Rki/wC0Koi1DKlC/mqa h5SSpLUzdf6tHsDyjJ6/p2HURaxiobX81TWv4/USaiXUZy59N6PYHlGXubEiE5+RaxisaqEXVCjl Q/WSayXX+Zy59ro9geUUVbNeXPpVRFdI7gzWUVfeqK6h2skOElwmu/ST3bx/R7A8oMpk/SxHiM8M OjThTX9iLqWqr6HHB50kOkp4zSVsUVKqro9geUDLit15fLSumM+MPjTw26UuCVH2moPsWoqcK3R1 4feJD5MkIiTpKvO6fYHlGiFLViuHLSpGJAzIGnyh8peKXRHEEcQ20NtDbQ2kNpDaQ2kNpDaQ2kNp DaQ2kNpDaQ2kNpDaQ2kNpDaQ2kNpDaQ20NtDbQVxBXEFdKnit8cfHpA/IJMn6TMp+0vw9geUaYU+ pmqJNprRmUNSRuSUSSmQgkgSQI+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X5fl+X4r4sgWQV SCuSOSR2SPSiRLREzDMlUVVVfh7A8o+EeW4wsTNKKxmYijcsollMspliSxJZjDGIYxDGIYxDGIYx DGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxDGIYxBZYssqllUsrljksdmISsxooSVmLjyqq r8vYHlHxRVRWZ77QznNI3mzSlGZUKU5hSJmKHEUOIocRQ4jScRQ4ihxFDiKHEUOIocRQ4ihxFDiK HEUOIocRQ4ihxFDiKHEUOIocRpOIocRQ4ihxFBcxQXMEKsxpHM1aQezmhB/M3nCquqtfn7A8o/hS utC9dL50vnS/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/eL94v3i/ eL50vnS9dLytT7X+PrDhvHuTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOT HJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY5McmOTHJjkxyY/pP/aAAgBAgIGPwBR f//aAAgBAwIGPwBRf//aAAgBAQEGPwCPk8jmv2su47DV1z9uE90V5xHl7vuKrTXWMHDNdYwcM11j BwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHD NdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11 jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMH DNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDNdYwcM11jBwzXWMHDP+z/AEd/2MzUhXbvz7H6XVO/ Y7vFJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkpSUpKUlKSlJSkp+le p3d6ndOn4OZqQrt349EOqp0QT9PVfzGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGC9X RVh9/wAjo8nRfnmakK7d+H+LqdVEefTqonYYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBgwYMGDBg wYMGDBeqd/uKip2+/wAszUhXbsqOutURVT9SidhgwYMlZ/XsGDBgvYVFQVOnb6fHM1IV27J0QR95 O6idhOwyaWC9hU6d/oK6v0+GZqQrt2RFVOyCdhBJrUU/cRO6N+GZqQrt06CL07qIJNiijydGjzsu ZqQrt0dd/MRBBJsUUU/y+8uZqQrt06/YQQSbFFFOv2WXM1IV26KIJNyij0uZqQrt0e8iCTcoo/Lm akK7dHvIggk2KKKPy5mpCu3R7yIJNyij8uZqQrt0e8iCTcoo/LmakK7dHvIgk3KKPy5mpCu3R7yI JNyij8uZqQrt0e8iCTaooo/LmakK7dHvIgk3KKPy5mpCu3R7yIJNyij8uZqQrt0e8iCCTaoo/Lma kK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7y IIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo /LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu 3R7yIIJNqij8uZqQrt0e8iCCTaoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCC Taoo/LmakK7dHvIggk2qKPy5mpCu3R7yIIJNqij8uZqQrt0e8iCTcoo/LmakK7dHvIgk2qKKPy5m pCu3R7yIJNyij8uZqQrt0e8iCTcoo/LmakK7dHvIgk3KKPy5mpCu3R7yIJNyij8uZqQrt0e8iCCT aoo/LmakK7dHvIgk3KKPy5mpCu3R4QSblFHpczUhXboqfcQQSbVFFT7y5mpCu3RPzEEEmxRRRHZc zUhXbojyfRR1RBJsUUUX7JLmakK7dk/bVfAgk2KKL37qwVV+suZqQrt2RHk+giook2L3F7i9GJ8M zUhXbsqItFRFRRO40aNmVo0aL3FhuL5+OZqQrt34I69REVFGjRo0aNGjf6po0aNGjRo0XuK5DXv9 zqrV+OZqQrt349UXt9hEVeijRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRo0Xq9/YVH V6OnVflmakK7d+XVOw3qh0e7FM7PJ7KQ0aNGjRo0aNGjRo0aNGjRo0aNGjRo0aNGjRpSKaH6V6nR 3sh1eXr+BmakK7d/C7KqFJfZTX2U19lNfZTX2U19lN72U3vZTe9lN72U3vZTe9lN72U3vZTe9lN7 2U3vZTe9lN72U3vZTe9lN72U3vZTe9lN72U19lNfZTX2U19lNfZSX2d3l/Ej/wAj/wCf+7/jD6/y f5/7tBOnX+L/AMfr+5tPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPK m08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptP Km08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKm08qbTyptPKn/jan//Z"
+ transform="matrix(0.24 0 0 0.24 174.5615 142.499)"
+ id="image25"></image></g></mask><g
+ opacity="0.09"
+ mask="url(#SVGID_1_)"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ id="g27"><path
+ fill="#1D2915"
+ a:adobe-blending-mode="normal"
+ a:adobe-opacity-share="0"
+ d="M195.361,251.626 c-8.161,0-14.8-6.64-14.8-14.8v-73.527c0-8.161,6.639-14.8,14.8-14.8h59.663c8.161,0,14.8,6.639,14.8,14.8v73.527 c0,8.16-6.639,14.8-14.8,14.8H195.361z"
+ id="path29" /><path
+ fill="#1D2915"
+ a:adobe-blending-mode="normal"
+ a:adobe-opacity-share="0"
+ d="M255.024,152.499 c5.964,0,10.8,4.835,10.8,10.8v73.527c0,5.965-4.835,10.8-10.8,10.8h-59.663c-5.964,0-10.8-4.835-10.8-10.8v-73.527 c0-5.964,4.835-10.8,10.8-10.8H255.024 M255.024,144.499h-59.663c-10.366,0-18.8,8.434-18.8,18.8v73.527 c0,10.366,8.434,18.8,18.8,18.8h59.663c10.366,0,18.8-8.434,18.8-18.8v-73.527C273.824,152.933,265.391,144.499,255.024,144.499 L255.024,144.499z"
+ id="path31" /></g></g><g
+ id="g33"><g
+ id="g35"><linearGradient
+ id="SVGID_2_"
+ gradientUnits="userSpaceOnUse"
+ x1="225.1929"
+ y1="152.499"
+ x2="225.1929"
+ y2="247.6265"><stop
+ offset="0.0123"
+ style="stop-color:#C1D72F"
+ id="stop38" /><stop
+ offset="0.1394"
+ style="stop-color:#BCD631"
+ id="stop40" /><stop
+ offset="0.5859"
+ style="stop-color:#AFD136"
+ id="stop42" /><stop
+ offset="1"
+ style="stop-color:#ABD037"
+ id="stop44" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#C1D72F" /><a:midPointStop
+ offset="0.3086"
+ style="stop-color:#C1D72F" /><a:midPointStop
+ offset="1"
+ style="stop-color:#ABD037" /></linearGradient><path
+ d="M184.562,236.826c0,5.965,4.835,10.8,10.8,10.8h59.663c5.964,0,10.8-4.835,10.8-10.8v-73.527 c0-5.964-4.835-10.8-10.8-10.8h-59.663c-5.964,0-10.8,4.835-10.8,10.8V236.826z"
+ id="path46"
+ fill="url(#SVGID_2_)" /></g><defs
+ id="defs48"><filter
+ id="Adobe_OpacityMaskFilter_1_"
+ filterUnits="userSpaceOnUse"
+ x="184.562"
+ y="152.499"
+ width="81.263"
+ height="95.127"><feColorMatrix
+ type="matrix"
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ color-interpolation-filters="sRGB"
+ result="source"
+ id="feColorMatrix51" /></filter></defs><mask
+ maskUnits="userSpaceOnUse"
+ x="184.562"
+ y="152.499"
+ width="81.263"
+ height="95.127"
+ id="SVGID_3_"><g
+ filter="url(#Adobe_OpacityMaskFilter_1_)"
+ id="g54"><image
+ overflow="visible"
+ width="356"
+ height="414"
+ xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEBLAEsAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAAAXBAAALIQAAEOP/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAaEBawMBIgACEQEDEQH/ xACYAAEAAgMBAQAAAAAAAAAAAAAABAcBBQYDAgEBAAAAAAAAAAAAAAAAAAAAABAAAAMIAwEAAgMB AAAAAAAAAAIGATIDBBQFFjZQMwcRECKQMRMSEQABAgQEBgEBBwQDAQAAAAAAAQIxcgMEEFCRsyGC M6PTNBFBIGFxEiIyE1GB0UKhscFiEgEAAAAAAAAAAAAAAAAAAACQ/9oADAMBAAIRAxEAAADy0npz Z0Dnx0DS7Q9kr0IKcIKeICeICeICeICeICeICeICeICeICeICeICeICfggp2CElQD1aXxOgc+O1s um7kKj5vpObG6d2Q9zspRA9JmSGmCHmWIiWIiWIiWIiWIiWIiWIiWIiWIiWIiWIiWIaYIeJo1sPe 4OK5C2tCVS3OmN5clN3IVHod9EOv6zWb0zkAAAAAAAAAAAAAAAAAMRJnwcVXltVuetyU3chUfp5+ 5YexhTgAAAAAAAAAAAAAAAAABjODUVxZNbnjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwaut rJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAA AAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjy Cx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1t ZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAA AAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQ WPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautr JrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyCx5sKaAAAAAAAAAA AAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZNbHjclN3IVHIjyC x5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAAAAAAAAABjODV1tZ NbHjclN3IVHIjyCx5sKaAAAAAAAAAAAAAAAAAAMZwautrJrY8bkpu5Co5EeQWPNhTQAAAAAAAAAA AAAAAAABjODV1tZNbHjclN3IVH7+HqWTO1uxMgAAAAAAAAAAAAAAAAAYzg1Vb2NXB5XJTdyFRx5G jLc3XG9SS2MgAAAAAAAAAAAAAAAAD4+ohqq47GvTa3JTdyFR830nNm/7qp+gLVk8fuDcZgehLRBL RBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBLRBKQohP0MbkT40OcG8uSm7kKj5vpObAJm45sd n98SO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3cQO3xxI7PX84JcQAN5 clN3IAAAAAAAAAAAAAAAAAAAAAAAf//aAAgBAgABBQD+G3//2gAIAQMAAQUA/ht//9oACAEBAAEF AFgq7/bL9narGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxn arGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qxnarGdqsZ2qx narGdqsZ2qxnarCYVyhn78PQNo/MCUmJhssm48QEScNrGJGEMQgjEIIxCCMQgjEIIxCCMQgjEIIx CCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIIxCCMQgjEIQakYQOlI bGTCajw2R5SPLm/KK2gegbR+LVYzzDZGzFKyBaysYS3FYGSBBQkFCQUJBQkFCQUJBQkFCQUJBQkF CQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQUJBQkFCQNkCA9uK0R7WVrJ+ykMy6WI8BrW NY0IraB6BtAsdqbMHtttYxkvKFKxhCs4JpCtExKFMy5W5jWX22NgRAitoHoG0SsBsePZZFhSSkuw peFm5dhi3qRKYk1BbAjoraB6BtCcl/8ASYtUBjCkL8Lwp2fS3WCxpVDA/wA5lFbQPQNoShGNLbif CcM3+roX9VQz4ZFbQPQNoSLP0t7P04e5uql5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW 0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5F bQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnk VtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqe RW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp 5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6q nkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubq qeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5u qp5FbQPQNoSPXIOcPc3VU8itoHoG0JHrkHOHubqqeRW0D0DaEj1yDnD3N1VPIraB6BtCR65Bzh7m 6qnkVtA9A2hI9cg5w9zdVTyK2gegbQkeuQc4e5uqp5FbQPQNoSLlvb+nD3N1UvIraB6BtCTN8Jbj /ScM3+rob9VQ36ZFbQPQNoTUx/xGtcdjSlb9ZwsRvwt1jMYVRR/+5hFbQPQNokZinmbPOsaWVjsM XhZuOwpbxOsYWcjtjzCK2gegbQLDdv8ANtuuDGsgTJTMYZjeCaZjBHmSlZcbgxjL9dGxDBFbQPQN oDGtK2z31pBJXYrWQLmVrCz5Whk8QVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFaQVpBWkFa QVpBWkFaQVpBWkFaQVpBWkFaQVpBWkDZ4gNPkYI9zKxk7dysZdr80zTGaZoRW0D0DaPzK3Oalmyy oYwEVEv8yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGV S4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXGVS4yqXB1RL/JlUMMyauU1Mt/KK2gegbRxaK2jj/wD/ 2gAIAQICBj8AG3//2gAIAQMCBj8AG3//2gAIAQEBBj8Ar2djdfxW7G01az+Ok74VzEcvF7FWJ73Z o+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+ M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M9 7s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+M97s 0fGe92aPjPe7NHxnvdmj4z3uzR8Z73Zo+Ms7O7u/5Leq5yVGfx0m/KIxzotYixTC5kpbbfsfFJir 9/0EWo74+5qHH8y/3IO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1U g7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1Ug7VSDtVIO1U4fmT+5803fP3Kn+D4qsVP v+n2LCd22/C5kpbbcUqVkX4+jf8AIiI34QTgQIECBAgQIECBAgQIECBAgQIECBAgQIECBAgQIEBe AqK1FRfuFqUE/SkWf4PhY4WE7tt+FzJS224JWqJw+f0ov/YnATgcMi4i8BeAtdifpX9yf+4WE7tt +FzJS22jKSfVeP4DUROCCcMmXgORU4KPpL/qvD8CwndtvwuZKW20dUVIcEE4Hxkyi8BHon7uC/2L Cd22/C5kpbbT5/8AoTKFG/iWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttp zKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+Fz JS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu 234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFG zFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZ RMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZK W205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22 /C5kpbbTmUTKFGzFhO7bfhcyUttpzKJlCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2Y sJ3bb8LmSlttOZRMoUbMWE7tt+FzJS22nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzKJ lCjZiwndtvwuZKW205lEyhRsxYTu234XMlLbacyiZQo2YsJ3bb8LmSlttOZRMoUbMWE7tt+FzJS2 2nMomUKNmLCd22/C5kpbbTmUTKFGzFhO7bfhcyUttpzCZQo38SwndtvwuZKW20dTVfvQQ+cmUXiI xFhxUsJ3bb8LmSlttGVPp8/C/go1fkTjky8RyqsB9T6KvD8CwndtvwuZKW23BKNR3wqftX+qCcRO JwyLiLxF4i0Ka8V/cuFhO7bfhcyUttuCKi/CpBRtOs74cnBF/qJ+oiRIkSJEiRIkSJEiRIkSJEiR IkSJEiRIkSJEiRIkReIv6hadFfl31d9EFc5flViuFhO7bfhcyUttv2ERrvzNT/VT4qIrf+TqIdVD qodVDqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTqpqdVNTq pqdVNTqpqdVNTqpqdVDqodVDqC/xorl0F/O74av+qfYsJ3bb8LmSlttyywndtvzD/9k="
+ transform="matrix(0.24 0 0 0.24 182.5615 150.499)"
+ id="image56"></image></g></mask><g
+ opacity="0.35"
+ mask="url(#SVGID_3_)"
+ a:adobe-opacity-share="1"
+ id="g58"><path
+ a:adobe-opacity-share="0"
+ d="M184.562,236.826c0,5.965,4.835,10.8,10.8,10.8h59.663 c5.964,0,10.8-4.835,10.8-10.8v-73.527c0-5.964-4.835-10.8-10.8-10.8h-59.663c-5.964,0-10.8,4.835-10.8,10.8V236.826z"
+ id="path60"
+ fill="#1D2915" /></g></g><linearGradient
+ id="SVGID_4_"
+ gradientUnits="userSpaceOnUse"
+ x1="226.1924"
+ y1="159.7139"
+ x2="226.1924"
+ y2="200"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop63" /><stop
+ offset="0.3788"
+ style="stop-color:#F8FBF3"
+ id="stop65" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop67" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.4383"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></linearGradient><polygon
+ fill="url(#SVGID_4_)"
+ points="221.189,159.714 214.142,180.951 224.048,180.951 214.142,200 238.243,173.61 227.655,173.61 236.978,159.714 "
+ id="polygon69" /><g
+ id="g71"><g
+ id="g73"><g
+ id="g75"><image
+ overflow="visible"
+ opacity="0.75"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="392"
+ height="242"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYwAAAD2CAYAAADF97BZAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAHohJREFUeNrsnYlu40gSBZMU5Z75 /4+dbUsiFwtY2JrqvIqHSEoRACFZPtqk3BV8WVcvAAAACXouAQAAIAwAAEAYAADwWgYuwSp0XAKA wzJxCRAGIgCANf8fIxaE8RIxIBaA8yeMDokgjLkNfLfyzwOAfWTRNX49EkEY5h9N6+sIAuC8/++n mXKZjJ/5UfIYPuyPRXut9WOEAXDuxOGJYEqKZPpEebyjMOYKoTO+BmEAfIYwSjG0JJFaHm8rjncS RkYE2uutwkAgAO8liezzTPqY3jl1vIMwooa+fi0SRvQzshIBgHMKYwpez5Su3jJ1nFUYLWWlznne KpHW5AEAx5fF5Aijfi0jDy91nFocZxRGJgnUMvDkkf3arDiQCMD+YshIwxKE93xy5CGJ1HFqcZxJ GEsE4b0WHa3JA2EAHEcYU8PjlJREdESp47TiOIMwIlG0yqEPPl4iDmQBcCxpZMtOmWNs+Fy2n6M7 kzSOLIy5oogk0SsfZwWCNADeSxhZMYzGYy2I8uslIY5TpY2jCiMzsikjCO2xDz4fiaNFGggDYD9h LJGF9uh9rq8+7hxxWLI4vDiOJozsKCdPFJoc5ry2JG0gDYDzJouxOrTXLJHUsuiKz4uROurS1GHL VEcShpcqNGFoZSZLBBfla6zXO0MeGXGQMgCOkyyyopgCMfzveDifs44yRdQlLKtEdei0cRRhaLKI UkXZoFtCeH7uUn3dJfF9UV8HwgA4tzDG6nktjYfy/OF8zhJLZ0hjEns01SHTxt7C8EpQmdKTlhQu lSguxmu1TLSfNac8hTQAji+MMZEsahHUx6g8743v1aQxOudzSGnsKYyoBOUlCk0StQQGRRrW4aUO bWRVpj8DYQDsI4xaFJEwPFk8FGHcDYGUR1/Jon7uzf84bIlqL2FkS1BWP8XFSRKDIozBEclgiMPq CJ8rDSQCsI0cWmWRTRaWDO7BYy2OXhFH2SE+BudymLSxhzAsWbSkCk8S3vNBkUdGGJE06pTUIgTE AbCOKLRylCYNqxyVTRV347gYX9sr4nhUotDKVPXw292l8WphtMrCSxWeEOrjqghDE0hUlrKkYaUL ZACwj1S8lBGli1oYWpL433Eznl8qWdxFL2trfRsiev/GIaTxSmFkJ99po5+0RBHJoXy8Bt+j9WmU /743qU/E7vxGGgD7JBBrCRCvs9sqRd2NZHErRDEY4iiTxV1p72ppiPx/IqDVr7GbNF4ljBZZaKnC E0UtBu3jq5E0PGFcgpJUH8gCcQDsJworXWQTRiSMWyWM5/Oheu3ZltzFLmk/lPbhkCOoXiEMreHM 9FVYsrhWz8vjS3lNE8dglKiyHd9ewqAsBbB/KcoThjbvwhpCG6WL8vgu2pRb0XbdnGpFKY26vbCG 3u4mja2Fkemz8EpQZWOulZq+gkdNIlFZaq4wBGkAHFYWIm2d3lG6uFeiKNPFt9Ku3ESfEOyJY3TS xi7S2FIYc2ThpQpLFF/Bx6U4auFckiWpFlkgCoBjiCPb8T01Jow6WVx/JHEtZPEt+oCaaD6XRUYa b1OSapXFEJSdsodVporKUZlRUpEsEAbAcaWhpYx6WK02lPamSKOWxVBIo1UY3QJpbC6PrYTROhLK SxW1LH5VUvhlvG5JQ0sXWv/FReYNp0UaAPvKYq4wxoQwvIQRlbojYayRNDaVxhbCaFmKXJNFPcrp q5LFL0UUGWlE6UJ7Y7MT9hAGwDmFEaUMb/5F3X/hjb70hulnZVFL4/Sd3l2iLNUHsrBKUL+M48v4 2EoX0ZvqlaIEYQCcWhalNKwNkrz5GPeftuRWtCk30ed8aUsYzU0WdZoo25ZaHJsJZMuSVMs8i6iv opbEX4FAnt+jdXZnZaEtby6IAuBtUsac/oxaGoPy6A2mWZoupiJldK8uTa0pjLmlKK2DOxLFX8br WllKG5Lbsn4UO+0BII1B/uzLqG9Av+XPKQHZNsU7H22IcF2e0qRx2ISRkYU1g3sISlB/KY9/OUlD 67vIyOKSKEO1JAzEAbCfKFqF4c0CL1PGUKSNm9hr1LXchHYJWYjoy4RYZSnZQhxbz8OIRDEYwvhl SOIvQxh/KenC6+hu7eSOpIEwAM4hjCXSuBRp47lW1F1p16wtoFvShSYLa++MUV7Un7GGMFpKUV66 qPssaln8bUijFoY1u9vbOGnp8NkucX0A4LWyEGmbCT6KvnzIWMjiUcgjsyGbdQOa+V0nyW/p2r2i NLVmSWqJLLR0Ycnib6ck5U3S85JFy8KCSzq5kQfA9pJokUX52AdJo6/EkVmwdM6ci2nG0TmyWE0c S4URDaPN9ltkZPG3U5bS5l1kFhecu2w55SeAfcl0FncJgXh9G30hivqxXIE2Gl3ZO6KIymPZo0xI m/VjrFWSmjsqanBkYfVd/K2kC6uj25JFZ7yxraJAEADHF8pUvTYFjbZUd+5T0UY8hfEQfapAZnRl lCpG0eeHaB/XKcOS5CriGFZ6Qyx5aPMuhiBZ/FJkoaUMTRblMNpoFvfS3fOQBcB55DEp/3e9DuJa GE9ZWO1bpvRkNeZWp7u1Z0emNDUp579YGsOCNyBKF9HIqEFp7K1U4Q2lteZcWOu4tM6xoAQF8H7S EKN0Uz9qd/B90Xh3ku+r6IxUMTpHuWWsdvRGacrr09g9YWTnW7RM0rPKU9oyIN7CgpYs1twxD3EA HJcp+f9UuxPvFGnMFUUXpANLGJ5Qyu+t/+1Ddnp3iXKUNu/iy0gYvyQ/Qa8cGaUt+5FJFiJtI5+Q A8D50kVGIpNy0zgtkIYY/0b5PLOnuHZcqpTRK0nIK0+9TBjZLVfnzOrOJI0vQxbafAuvzyJbfmK4 LMB7JAzv/+zU8H+9lEZL2zApopgMcURHVJrqRO+72a0Pw0oX0YZIVsKIylDWkuVav0UpK2upj7mi QA4A504YnkCmoLpQfm/r3hbWarmRHJ5rV3kpwytNaalqljiGhRc+U4qKNkb6ctJFnSa0uRaaLC7J ZEEZCgCBRCOoLHFMxd19JuVEndyeMLIpo98yZcwtSWWXL5/bf/El9kioL7H3tYhmW1rpYm4pCgDe RyCt4pCigRaxZ297w2fHIFWU6aJ8HOTf61uVbd5mKWOYcVFb08Wc/bm1RQTrVFH3WViy6INUgSgA oEUcWn9HL7kFEOtS1BiIojy+5P97cdSlqUfVDnspYzZLh9Vq+3Rn5mBcE6KwtlgtReEli16YiAcA 64vDayt65XszQ2ejhFFu3FTuxfFQksYo+kitXfowOrFHSnmlqGgLVi9daEt9ZCbmibAzHgBsK46u kIFUlY3pp416CmNIlqNulShuRVtYbuB0r26aR6MsNYm/d8aqwpi7DEhm74urU36K9rTQ1p23Fg9E FgCwpjjqmeFdlTK8ctS1eNT2DP+qZPFVSOMm+grcUV/G4s7v1j6MOcuYe3MwNGl8KV8b7cFd/w4i /pR8RAEAc8QRSUOqlPH8+jpljEVJqZbGl5Iq6qPc7e9eScPry5AlKWONeRjeUNpLUI7SEsUg9sxt bwZ3L/RVAMBr04bXCT5Wpam6XF+WpK7y7z6Ka5EqynQxiL2DaC/xaKnNJ+5Fayi1jpQagtKTNXN7 SKSLaClhZAEAa6cNSxrlXX5fpYyxaNdqadyVdnBuyli187ufeaG0foJMyhgMMdSlp0wZykoXIu3b qAIAzE0b2nNtBGl2YdbBaRsHJ2W0rMg9q23sGy5My2S9PnExhsTFyG6BmHkDAQBeLRFNGpeqNOXt RJppG7Wb6i6Qxiz6hpP3RNIHCSNj0swF6WaUopAFALwyZWRvri1xXIL2sWVqQbR67qrCaEkaLUNr 6wtxCWRh7ZVryQFJAMAe0ojazWe7dWlsI6/JhKG1l6KUoma1lf3Ci2RdiGyyuIg+CspbRLA3TD7n jQQA2EIe0Y21Nw1hUB6z0sgkDC8dLRZGNlVkR0hZpSdLFpfkBVhkTgCADVJGZoM5qyLjyaN1o7hV +jH6mTHL2gcjugjWBfHKUN1WJw8AsFG6iGSRLeNn2spoFOlqbWXfeDG6IHK1ysI76cyOeaQLADhr maqfIY2L5Pt5rQ7vzYfVZspUfXC0CsLq5LbGEgMAnC1laP0Z1giqls7ubBl/k07vaOiYtp6TdjKa JKJJJ9n5FqQLADhj2vCG20Y33NlSVNfwu62SMLqkNb2E0SviyMzgXrUOBwDw4pThrY6R6QPOVmo2 7fvNTNzrgs9F9bhIHH3ihC07C+kCAE4mE00ctUCiakymhN+vfZPdz4gm2fHFXSALK0V409pFWPID AM6XNrwUklnANSpZzRlS29x+zllLqiVpZBKHNwoqE6OQBgAcXRTeIoCd0x564siW8K2RUs0MMy9E 9tBOwNv4KFtjQxwA8C5C8drOLlmlya4h5a21Fy513q948llbdo48okglQn8FAJxLCt68Ma1Bt9pD 7fW1O7q7LYQRxausLaPaGivPAsC7yyTbZnZiTznIyENk4UipfuZJtp68VXLyxJGZoEfaAIAzSaJl TtuaCWOVdrJ18UHrJCNZRFErU3ZCCgDwjglDa+u6GQkjszjr5sLIJI2oA8dLGtKYMBAHAJxVDJ4s Mmv1ZWURlaNeKgxJnmBmT9kueZFFKEEBwGdJJjui9CU7j/YrnJTX6Gcn3m1SbwMAOEnyyDT4SxNF tGrtLGF4nc3euN7MbMKsGDIlKMQCAO8kjeyNdIs0Vm0vt+jDiGQS2TVbtgIAOKMkoopMa5uaEc4q 9C+8EF4UmyMpAIB3Tx4tfcGb32T3G52sVzN7iQkBAA4ogJYbbetjbxe9zFp8s8v8/Y4XCQAAkeiN uwSJQiQ3qbn1Jn/zhNHNuDCR5RAKAHyKLDKfjxJG9t/YpdNbpH1/7ZY4BgDw6TKJSvWtW0Espt/g ROes/eQtxYtQAAAOsJFc/6KTmxPJAADAF8RL29F+5xMHAEAGfz5fvHfFFu1tf8ILCgDwbrLIrAi+ xs/+CGEAACCX/FpTm9x4IwwAgPMkka2+/jDCoJwEAPAGbSoJAwDgwxr+owuDlAEAcHJIGAAAgDAA AD6At5jpDQAAJAwAAPikdIEwAAAAYQAAAMIAAACEAQAACAMAABAGAAAgDAAAAIQBAAAIAwAAEAYA ACAMAABAGAAAgDAAAABhAAAAIAwAAEAYAACAMAAAAGEAAADCAAAAhAEAAAgDAAAAYQAAAMIAAACE AQAACAMAABAGAAAgDAAAQBgAAAAIAwAAEAYAACAMAABAGAAAgDAAAABhAAAAwgAAAEAYAACAMAAA AGEAAADCAAAAhAEAAAgDAAAQBgAAAMIAAACEAQDwMUwIAwAASBgAAHDOlIEwAADgUMKYuNQAAOdu F0kYAABwGGGQLgAA1mtHd2tTSRgAAOeThvX58vhYYZBSAOBTJDAl0sXU0EauJhESBgDA/tKoG/U1 GvnVk0a/08UhNQAArJtENqff4KQydbTpyBcFAODA0titA7xf+MtPM09YuwDT1nEKAOCEaSLqw5he 1Wb2K51c5hedErYkUQDAJ0ohalen4KZ9esXN9h4zvefIBQDgE6QxSVyJmSRXllq9xN9vdBEiM2ai FwDAp0hjMm6sWxKGN9oqandTbW+/0clnkkXr8DFkAgBnl8KcG+dJ/AFFU9DGZqUQ3uT3G1yUKGJ5 1pyEkVIA8BkCySSOKHVMiTZ2tfazn3liU/IEopPPXBhkAQDvKIu5N9JTcGx2o903xpLopDIXyJNB JIgp+XsCAJxBHNkb6czN+ZT8Ppl7Q96vcNItJxHZUoKTRBAA8K4CiYbIPp+PDW1t5qb+ZcKQwIxZ C3oJA2kAwLumi0w7OiqSGKWtI3yV9rNPntyc2KQdkRk9cQAAvIscJidZWG3mqHy89IZ804SR6Zix RDFWJzlK23Axz4zIBQDOJBCRuDQ/OqLItKOrDx5asw/DkoRmxFH5mlH8OhzDbQHg3WQRtZuZhDE6 clky9201YURlqDFIGGODGT0rAwCcVRxRKX9MtJ8tJarF7WffcIJZY3mmtKJVFK+s+AYAcBYxRJ+L Sk5jcMzp12iq2myVMFpO0CpXtdoRgQDAGSQSdW5bCePRII1R8h3tL1lLaq4kyhN/SNwhHtkaUQDA UdOFVRXxkoUmh0fQfmZK/SILy/t94mS9dUsiI3on6J209jNF4o5w5AEAZxFHNM/iURxLZbFKGT+7 ltSUSBjRCKjoRB/BBaQjHADOKAmvKqP1UTyM9jFqQz2BaL/D6sJoPenROdHoKC+EVdfLCAJ5AMCR xJGpzHg32I9EW9pSltosYXiiECNWRXW4R0PUmrOoFgDAEdOFJpEoSTyPe/U4VxpzfvdFCSNKGi1W fF6Au7T1a7SsagsAsHe6EMmVo7yb63tSFF5ZalHq6Gc2utnRUZEkshdgSpw8ogCAI6YLWUEUd+fj pQkj3W6uMXEvEkdWEnfR63abxSsAgBeki7k32Hfj0BJH3W5uMlqqbzh5TyCtUSpzEVpKU6QMADhi uvCE8VBuqj1R3IMb72iY7WLmrlabnXuRsWXGng/xZ4KTMgDgiOlCGiowLdKIOr6jzetm7ZGx1bDa TN/F87glLkhLR44IczQAYL90kZnYbI2EqtvEW4M8Mqt/L2of+4YLEfVfaOb0TvJWXIybcWE8e86Z owEAsJUsrOkGmVLUXZFG1D5mb7BXm4vRz7worQkjEsVNsanVqROtzLjYogAAM2URdXA/GtrIW0Ic L524Nyy4UJm+jEdwEerj+vM4/DxeiuN/P6P7kdz487z7ed4rF6P7ea0rfueOv3EA2KAMJZLbEygr iqjNbE0X2u/YfEM9JC9MV/3gLlGWsmpz1vH98/uUx70QRl8cXXFIJY5IGoI4AGBFWbR0cFtTDeo2 8ltpH7W+jUyHt7fH92YJY3JEkZFFfVG+fxLFd5EsbkXCGKqEEQmjThmlLOp0QdoAgLVkUYujbrSt AUC3QBLWa9mEYW0V8fKSVH1xygbbGjJWlppuijQG5Yhk0SmJoa+k4EmDtAEAS0RRPnorz1ojoer2 sD40aUQDgzJbts5KGUPDxeoco0bjiy9KuhgUWVyLz1+MhOEJoyt+v1H5Gk0SpA0AyIoiksUYVFse jizqR00ac6YeTMnzWj1haHfpVsdOb0SwoUgadbK4FsmiTBnZhNFVKUNDEwdpAwCyohCZtyzSwyhD 1cdvI2lEKcOTxSpTEJb0YZSNb1mailLGUxpRGWqoRKHJonMa+k7aO8ERBwCiiEShVVesEaLlTbM1 2Oe3IwpLGLdkyvDKaZsnDE0cXSGLTMrISKNMFhdHFpYwpkIWnZM4InEgDwBEYcnCWnVWW+LDE0Ut jUgcmc7uVdeQWiIMcS5iJmXcqpLTt/w5IqpFFlGjXs/b6BrEQeoAQBTRpLxphiwsUXji8EpSWv+F yEqd3XOFMTl34V7KuFelpUtwaGWovlEW5UXqg5SRKU1NhmQA4NyCyIpCjGShDZ3V5lV8B3L4bXzu OyhFeSOkWs5/s4RhDVEt7+QfRUNfSqNMGV6qqKXRBymjlsTFKFPV3zsVH7eUpqagzAUAxxRDNmFk k8XDSBfaCKhaCv/5OTxpRB3eXt/FquvtrdGHUd+p18t2PIqGXytNXZTk4U3Sy7zxtTiespjEHmk1 JctVmWQDAOcSibXQamYDJGvobCmL34njP+L3YWRLUasOpS25zPy+srPZKhFpX+Md3pDZqA+j5Y9k 6UXrFn4eAPZPGNnyU3borCaLm1KG+k+VLLzDG17rSWOTdLFEGCJ+B7IllEgCEryWbaCjWZlrxVlE AXA+cSyRxST6sFlNFjdHFnU5yhPGb0cW1gipTSofwwpvRl3S0dZ+19JEn0waljCiIW7Px6EqS12K z2n9IyL+pEBGTQGcUxaZ5T2iDm5v8yNtUp7VZ/FPQ7Lw9gpqWdJ8t+XNPVlIUhqZklSXSBGj2JNn roU0xh9ZjIU4ns9HRxzWo9dBjlAAjlOGmgJJiCzbz8KSxbfofRSRLH47Zaho7oXIhpvKrTUPo1N+ wbFoOLPSyAgjMw66vJClLMpjlD9HYdXikMSjJocu+SYhFYBlMmhJFa2y0EZCZWRxE33IbC2Hf6rH WhatI6M230RurZKUNcy2FkerNLw33lvw6/mmXos3tlyj6iH6aKw+WRaLZIEgAPYTSKs0rEUEvdFQ 1uZH2qQ8r5/iH4k7uVtGRmlltdVYM2FYb9RYNbgZaXiNq/amWtseatJ4iD9JcKk0WjrnAWB7aXhr QXk3oJP4o6G0mdzakh9WZ/c/Ys/DiFanrTdM8q7BoUpSUWmqbOSz0rB+flSGeiSkcRF7rw1vhrlI bhgx0gDYVxhT0GjWd+FjsmJxF31TuGg2dzSk9rdRjlpj7+7DJYxsaapMG1oDG02Es5ZR90RRvsHP pdOfW79mpZFdUh1hABxfGN5EvKws6r6Let8Kq/8imt3tLWWe2fNis1LUFgnDeyNHpeF8JGThJYxo 8kx5J3AtJHFVUoa1LIkmjH6mMJAFwPbCyHZyjzOqFlay0Pa1aJnR7Y2KinbV82SxujS2Kklpo4Qm RRwtPzsShZUqvooL/0wX9QZN1gq5njhE2kZSIQ2A7WQxNT5qZai6P3SU3G559RIgVsqwEoW1wGA0 jFacEtQpEoYnjXLOQ7bxzAyh9UYtfBXiuMq/d/UbnKShiWOuNJAFwHGkYQnj0ZAublU5yts5L1qy /DuQRVSCispzpyhJlfLwImGLLKw+DC8yluIYKnFo0uiN8hTSAHgfYYwSz+HKlqIyW61qaULbqzsq Q2X7LTaTx7DRm9gF4sjKQpKi8IRx/XkjalnUfRmeNCxhRP0ZCAPgGMLwZDGJP4imlsXdKEdF+3Pf xO+rqDu4DyWLLRNG1J8RScMaAjc69UUrXVyrhOGVpYbGlIEwAM6TLsZkwshULW4N0rgpj9oM7nr4 bKss3qIkNVcaIvl16LWRUc9SVJkwhiphWH0ZLSlj7dngANAuCi1R1M+z6WIUe85FnTK+FWnclBRR J4rspLwWWWwujuGFb3KLNDL9F1Z0/DJKUbUwWstSnjSQBcDxpRHJIprRHaWMmyEIL1FEqSLb0X36 Tu9SFFlpTOKvSZ8dVntVRKEJo+78tvYWvyQSBsIAOFZJKhKG1p6MTtXCGimlPY9E8RB9BvdDkdok L1qN9ggJo0Ua2T0vvIRxlT/7MKwSVDS8NprINzdlIA6AdUQRJYy6HOUtLGi1KZnSlCWSjChaS1C7 yGKPklQkDS1teEnjUr3JQ/H4nKh3q4RxUaRxCRJGZngtHd8Ax0oYmXJUZq+LaB0p77WHxP0UD4nX htqlz2IvYWSkMUnbHhhjII5aCjcjTXjlqOxcjEgaiAJge3FkN0NqmYORKU9ZcmhJFNYM7sPI4tXC mFue0t703hFH+ca2pIkoXWRkkU0ZHogFoK1BbNk9L+rH8OZ5ZYRgPc+Iwis/7S6LPYThSUOTxyh/ 7hNei6N+oy/y7z0v7skk4fVdZIWxRBaIAmC+OLKyyHZ+eyth3wOpRENkWzc/OoQs9hJGNmlMSmNc v+F9lTZ6+fduehdFHPXn+oQoMsIQsffKQAwA24ukRRqZlOF1hkevWf0To1IWkzPIYk9hlCffGc8l SBudkjaejXmdNHrjMRLEnHSBMAD2k4WIP2CmRRqePEbxl/Cw0kRUftp1nsWRhdFaotI6xbW00RWl qmfi0NJDS5pAGADnF4ZIbk0pSxjWx1lJjOL3URwyVRxNGFrasGRRp43668dKFmVD/0gKwtqiNdrn m/kXAPsJQyS3rPmkNN7185bDks00s/R0WFkcSRiiJAxLIJNxh1+nkzFICr3zemY01JzlzZEGwD7C kERpKtv4j4mUUm9L3ZImpqNe+OHAfwzRwoWROLoqcXTiL1MepYmlu+0hCoDXlaZapZFJHlMghslJ FJnf7dCyOKoworSREYcYAukqeWTkQKoAeO+kIQl5eK+PkptDccpUcRZhiPgjqTKd4p2TRGSGIJYI A2kAbC+LrDBE8qOpWo45SWI6y0UfTvbHEZWp6mSSafQzH4vkJ+chDIB9hRHdxWdGKUWL/0Wd2G8l irMJQ5OBKOnDk4bX6GdSw1qLCyINgNcKo0UakUhE5o1yOrUozioMcWTRkjqyKSGbJOjgBjiuSLyG u6V/YU5fxFuI4szC0N6MOaljmiGDTOkJUQAcM31MM59PC37GW4jiXYShiUMkP7JK+16SBMBnp45s w9/6McI48B9GlDrq2eNTQjgIA+D9hLH11yCME6cOCdJHy89AGADnFEbm89PCr0UYb5A6ZIFAsn8o SATguIJo+fppxX8HYZz8D6n75DcfAGE0ff3HtxEDf1ipdNDyh9LxhwVwOmkgB4Sx6h9Kxx8aAGJB GLDmHxb9FwCIAGEAf6gA8Ln0XAIAAEAYAACAMAAAAGEAAADCAACAs/JfAQYAL3iXmIlSiu4AAAAA SUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 179.2061 198.1514)"
+ id="image77"></image><g
+ id="g79"><radialGradient
+ id="SVGID_5_"
+ cx="225.1929"
+ cy="226.1387"
+ r="30.8299"
+ gradientTransform="matrix(1 0 0 0.75 0 56.5347)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop82" /><stop
+ offset="0.4828"
+ style="stop-color:#FDFEFB"
+ id="stop84" /><stop
+ offset="0.7611"
+ style="stop-color:#F8FBF3"
+ id="stop86" /><stop
+ offset="0.989"
+ style="stop-color:#F2F8E8"
+ id="stop88" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop90" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.8025"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><path
+ fill="url(#SVGID_5_)"
+ d="M186.706,235.825c0,5.965,4.835,10.801,10.799,10.801h55.374c5.965,0,10.801-4.836,10.801-10.801 v-19.373c0-5.965-4.836-10.801-10.801-10.801h-55.374c-5.964,0-10.799,4.836-10.799,10.801V235.825z"
+ id="path92" /><path
+ fill="none"
+ stroke="#EDF5E5"
+ stroke-width="5"
+ stroke-miterlimit="10"
+ d="M186.706,235.825 c0,5.965,4.835,10.801,10.799,10.801h55.374c5.965,0,10.801-4.836,10.801-10.801v-19.373c0-5.965-4.836-10.801-10.801-10.801 h-55.374c-5.964,0-10.799,4.836-10.799,10.801V235.825z"
+ id="path94" /></g></g><path
+ opacity="0.74"
+ fill="#FFFFFF"
+ a:adobe-blending-mode="lighten"
+ d="M263.623,229.595c0.037-0.364,0.057-0.734,0.057-1.107 v-13.375c0-5.965-4.836-10.799-10.801-10.799h-55.374c-5.964,0-10.799,4.834-10.799,10.799v7.324 c7.545-1.012,15.699-1.566,24.213-1.566C231.959,220.87,250.812,224.252,263.623,229.595z"
+ id="path96" /><linearGradient
+ id="SVGID_6_"
+ gradientUnits="userSpaceOnUse"
+ x1="225.1929"
+ y1="204.3135"
+ x2="225.1929"
+ y2="246.626"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF;stop-opacity:0"
+ id="stop99" /><stop
+ offset="0.0141"
+ style="stop-color:#FDFDFC;stop-opacity:2.231669e-04"
+ id="stop101" /><stop
+ offset="0.1344"
+ style="stop-color:#BEBEAF;stop-opacity:0.0148"
+ id="stop103" /><stop
+ offset="0.2565"
+ style="stop-color:#94957C;stop-opacity:0.0297"
+ id="stop105" /><stop
+ offset="0.3796"
+ style="stop-color:#747759;stop-opacity:0.0446"
+ id="stop107" /><stop
+ offset="0.5029"
+ style="stop-color:#5D633F;stop-opacity:0.0596"
+ id="stop109" /><stop
+ offset="0.6263"
+ style="stop-color:#4D552E;stop-opacity:0.0746"
+ id="stop111" /><stop
+ offset="0.75"
+ style="stop-color:#414B23;stop-opacity:0.0896"
+ id="stop113" /><stop
+ offset="0.8742"
+ style="stop-color:#3B461E;stop-opacity:0.1047"
+ id="stop115" /><stop
+ offset="1"
+ style="stop-color:#38441C;stop-opacity:0.12"
+ id="stop117" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF;stop-opacity:0" /><a:midPointStop
+ offset="0.2901"
+ style="stop-color:#FFFFFF;stop-opacity:0" /><a:midPointStop
+ offset="1"
+ style="stop-color:#38441C;stop-opacity:0.12" /></linearGradient><path
+ fill="url(#SVGID_6_)"
+ a:adobe-blending-mode="darken"
+ d="M263.68,221.954v13.871c0,5.965-4.836,10.801-10.801,10.801 h-55.374c-5.964,0-10.799-4.836-10.799-10.801v-13.871l0.038-7.704c0,0,0.923-9.937,11.173-9.937h54.962 c0,0,10.063,0.328,10.801,10.799V221.954z"
+ id="path119" /></g><g
+ id="g121"><g
+ id="g123"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAuJJREFUeNrsl9trE0EUxjO7m5vW tKFN1RqLCmqlIvjgkz5I/cOFIqLggw9KsRHxUo1IdEtactG9+A1+A8dxNrsxK/rgwI9lt5ueb875 ZuZspfJ//Bhqjvc0AfCIHClIQEzSMkUoBqyCJbAKWrxXQoBmBL6AQzChmGQREWbmNQY/DS6Aa6AL mtZvdcDPoEcOQEgxUV5mVMYzH5wCZ8FFcJ0CLoN1UHeIGII34AV4BvbBW4qbzsqKctzruq+ALXAL 3ABXwAafNyjS9sQ3cAwG4BXYA0/AU/AejLOE+I4MtME22AH3wE2wyedNivSFQT3eB/y79kwHnGE2 v4IjinCaNrBEtJiBu2SLs686VkRWGRt8/wTL5jFwxIxMbSGB+Ac1qtcluEMBbWslFDV7QBFdlmBE bwxZtthVDn1dpgF3WIIOhakF9iCf2ajQK32W5hcRJgvnmYHb9ECzQAnyhif8o7PxkWImsiQeRSyJ fWCjJAGy5G2usKtgzc6wx5dWxT6wYhm2jKNBm/UcV90m/aLsdLVoonX+QJV8RvmcXNflNVOOKktQ Fz4p+6AMrBg/GUeeFWUHd51HyuXevz7+GRELNSRzjMwYnmhI5Laa/gEBYxEjskVE7Ih67AeOi3ZE BYc55j+xxzjgpBMpImZL1mNDMuDxm5aYBT2x1+wx+vZJ6lt94kl2Ux1uWl4JWZhy9g/AQ/DOPjt8 q0ULuLebhiRYYO8wPUTIdm+X1zDrKE/FKjH95TL3eP83MiIF7FHAY2ZkYpfadxhoRE80WJ66EKIK BE9YAiPgPkW8dPUSFUfDGnMpHVmKvQJCEoofcsamBLs0fOgSUMnomo2QQ66UAbMTi4+hmOk2mGZW B39OE+rgj5iBcNb3h5qxk9boDb1SLrEh2c75+NlnCfT1A4OP8nZiVeAT0IhZY0Ni+gHP8oEpQ59Z HHP2uRtfkeUnxTj7AWHqMU0ZiRVX2ld5kZ4jnSewHN8FGACSOOKkAlOGAAAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 199.0298 216.5547)"
+ id="image125"></image><g
+ id="g127"><radialGradient
+ id="SVGID_7_"
+ cx="202.6289"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop130" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop132" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop134" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_7_)"
+ cx="202.629"
+ cy="219.704"
+ r="2.999"
+ id="circle136" /></g></g><g
+ id="g138"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtFJREFUeNrsmP1LFEEYx292Ts3V 9ujFrCiwFyPShH4I+imoiPqbhYKIoKigN0W8SulNIrOU63S921u/A9+BYdm9mbndg4IGPiynuzOf eea52WeuVvvf/Joo8VwA6rxm+0lBD3R5TYctpu6XYBRE4DiYzMhpqRbYBDtgHyQ+gsIzQmMUOg3O gzkwzciZTUXqO1gCH8E3CsauERSOUiOgAc6AC2ABXAYXwZECsV/gPVgBb8AH8AVsg45NTjhKTYGr 4Aa4AmYZqYjLmpdj+4ySilwTLIOn4C34YZOTjlLXwH1wC8xzKSMureQym0g+O85ITxP1uU3hPS6r t5j63zFK3QM3uYwNQ0g45KUSPMSJNLjsLS71blHUZJ9Ox5lDSuo2k32SHYsBvslKcAIc5jJvUK7r I1ZntK6Du8yryBJhW9P73hi3jg2ym7ek0hKtO0z4E5xx2RYYOany7DPYyotaUPCwyoVL3KemKpLS TX+h5jhGI88jT0x9/U9yrzoHwoL7ykQtZN8LHGvURUxy05xhntWH8I7WOTzDsaSLmOAMQl6DIYgF mTGEi5iWEyWqD9dtpHCMoPaXtn9KrHSR59CsYxSJ6SKv1e9FW6L1MmM4iXWMIu8ri7u04mjF7HuJ Y3VcxLqciaqfVlnYJRWKJexzlWNs5r2SZMGMNOp1cRYc5atEVBCtPVazD8AzHzHdQUKZUyzywoIT kY9Uh9XrC4o1WTimPmI9ouv9iAXfIHKm1GtKvSyKlq2C1Una5sMTLBRHPN4MOvIxpV6BRfCEJU/s W8Ganf4xzoaCf5dGaS36JHnMKnWNUg/BY35uD1rza7ku5bY4658cMDHkEt6nUZP4TQG1dI/Ic/CJ /SVVHHglS2J94pnluXLecuB9x3Nlk5+3jUlV9hOBMAQjCpn1lMikgFrCdQrtGEKp62CDlCtaMLQc eNu+QmV/7XGp2cyN2rsdCDAAoyXZx8WJpTUAAAAASUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 213.9448 216.5547)"
+ id="image140"></image><g
+ id="g142"><radialGradient
+ id="SVGID_8_"
+ cx="217.5439"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop145" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop147" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop149" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_8_)"
+ cx="217.544"
+ cy="219.704"
+ r="2.999"
+ id="circle151" /></g></g><g
+ id="g153"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAttJREFUeNrsmO9r00Acxptc1m6d Fn9M125sU4RVpyjiSwXB/9wXulciiE4dhpUMpwzFUa02XdP4HDwHR7hcLk0mCh58WOnI9548973k uTYa/0e54c15nQ8E8TJ1UpKQ2Z8QJgUtgDa4CC6AliZOiYrBCfgGfoLTsgK9OQStgE2wDa6DDv+v hhQwBAdgH0TgS1mBLsIEBV0F18BNcJvC1sCyQdgIHFHYG/AODMAxBSZVhQXgHJ15AO5T2Aa4TMHC 0GMJBXwFhxT2Erygkz/AtGhim1NS1A3wCDwGO+AKBS3QKS+nrlp6eQProKe5G4LvNucCS0+1uXQP wRNwj6JaFkH6SgitNxeJ0BwNueSzMsIC3ulduiX/roJmpp9cWkVQ1CrrqB17ws+TPGdM3y3Rftnk fTpVVlS2ZpN1+qy7znl8V2HSrUvcdbKnutryVRk+63RZd5vzBC7ClFvyMXALbHEDiJreNGpDbbH+ Wp5rJmEd7sQ+n13NCq8uU881WbfPeTquwtq0u1ezW1nXepyn7SJM9dgSCc4oPBTO4Rus9jKJwatZ lGeZy+rYXzH+GWEpXxEq5Kl8VecwBcnURVjMgCcZn5GwsTZH7CJMD3khL5zWLGzKuiHnGZpe5CZh I6bO9wx7v+bN7YYxY70j1o/yEoZpKSdMmntMoMq1tIYlVG7ts/4x50tddmXCEDfgxRETZ1JRWMI6 EesObGFRWCyfaa+oDl8jQd4DscApJUr21S54Dj7wu1JBUW2Ct1rybDDRntditUtPnWor8Aw8Zd2h rXdFQdGYd6WfbPTYnOeeEiSv/cTDyC5FvbL1luspSSXPFUYUmaHu8KS0yfjdMpySYp6QIop6TZdC njEnRTvdpVc8Lt0yBW4wS+04HHj3+Fg4pKARnUxdJnVNBL7hSNal4OxPBFLAZ/CRzumn8NR1wrKR xdfy1KLlwDvmw3RaRlDVX3s8h8dGWiUE/BZgAMf82R9IYLF+AAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 228.8599 216.5547)"
+ id="image155"></image><g
+ id="g157"><radialGradient
+ id="SVGID_9_"
+ cx="232.459"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop160" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop162" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop164" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_9_)"
+ cx="232.459"
+ cy="219.704"
+ r="2.999"
+ id="circle166" /></g></g><g
+ id="g168"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAt9JREFUeNrsl91rE0EUxTOzm69a 05YmVWsUFdRKRfDBJ32Q+ocLRUTBBx+UYiOitlqRaEos2UT3w3P1jIzrbHZNVuiDAz9CNru5Z+69 M3O2Uvk/fg414zOCDzSxRwJiEJGkTBGKAatgEayCFr8rS4AwAp/BIRhTTDyPCDPzGoOfAhfANdAF zdT/SMBPoEf2wYBiQldmVAEBHjgJzoCL4DoFXAZroO4QMQRvwAvwDOyCtxQ3SWdF5QiQui+DDXAL 3ABXwDqvNygy3RPfwBHog1dgBzwBT8E7ENhCvJwMrIBNsAXugZvgPK83KdKzGlTzu8/fpWc64DSz +RV8oYhfTetPEdFiBu6SDc6+6lgRWZNo8P4Flk0zcMiMSGkSP+MPalQvJbhDASuplVB0RfkU0WUJ RuyNIcsWucoh15bYgFssQYfC1Bz7kcdsVNgrByzNHyJMFs4xA7fZA80CJcgb2uofycYHihlrh4hF ax9YL0mAGT7LKivsKmjLpLXjplVrH1ie0ryzlkWa9SxXnWR5QTv6ocUmWuMDqlLu8Di5ruk1Vzmq LEGdD5QtQln7yI8YespZUXbwzBi6cgzGsRTx14ZkxvFbDJeI9Laa/AMBgRUjTIsI6Yh69ANH0xzR DMMc8x/pMcTwjNIiIlqyHg1Jn8dvUmIWZGKv6THk/Jh4GWqFE3RTHW5auoQsTDj7B+Ah2JOzI8vU RNxQ2pYh8efYO4yHGNDubfNzkHWUJ9YqMf5yiZ7AmyEjtoAdCnjMjIj5TbycBhqxJxosT90SogoE j1kCI+A+Rbw0XmKaxzQlCXjz2GpOXUBITPFDztiUYJsNPzAC8kQklpBDrpQ+sxNZL0MR020wZlaC P2cTSvBHzMAg/f6hCu6qNfaGrJRLNCSbOS8/uyyBfL5n8JFrJy7a7Solpk1DYrynTvWBKcMBsxhw 9nEZL8S2GNtzuJo6YFOG1oor7a28iOdI8gLb47sAAwCDFN6m03jgxgAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 243.7749 216.5547)"
+ id="image170"></image><g
+ id="g172"><radialGradient
+ id="SVGID_10_"
+ cx="247.374"
+ cy="219.7041"
+ r="2.9995"
+ gradientTransform="matrix(1 0 0 0.75 0 54.926)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop175" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop177" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop179" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_10_)"
+ cx="247.374"
+ cy="219.704"
+ r="2.999"
+ id="circle181" /></g></g><g
+ id="g183"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAn9JREFUeNrsl+lrE0EYxvdKjSZW YxEPxBsVrNdHQTxA/KMFBRGPDwoVVIpoq3jUeJUG25qk2fVZ+A28WTabxG4lHzrwgxw78z7zzMw7 73reBDR/jOcCUREhn21LRCy6osfn0kT4BN0h9oiDoiGmTN8Efoum+CHWEBRvRoSbeZXgR8QZcVEc F7syfTcI/kq8Fgviu1jlv3hcET627xXHxFlxWZwXJ8RMxgmPIKkTn8UbMSdeinfiq1hnmUYS4QTs F5fENQSc4rfUgahgT7TFivgk5sVj8VQs4kqukGiAgCviDiKOijr/BUOWL7t/9uGaVyTEighYggsI uI79NQYfdY9FPF8x/WL2xiJLk9hOoelcJehtcYslqI8hYNDGrvP9G5t1PbtRQ+NIg/W/KWaxNNpk DnK5JZ35TzbuCq70ibAu3BBXxWHW1i8hGbpc0+akNLNuBDAtTopz4kBJAuxEC8cPzIlI88BpOoQl Xw1TuDtLsqvZkxbwUA2FjZxEVJYbdROj4mWOpVuzCMoWYGPlxggm4SrfFmFFJOTzDUi2KFY8KIYT sUoSWRadLRDSM0XPMgVPn4guOT0tSN6KVtHd/w8tYWJfqDHeM+m+jBkTeIEaoEmKTUp0oXD80Kjt kU4PkVSqJWTOhIDpFf5APBFLOOPliYhxZgYR00MKmVEEuKWeQ8Q8ruRe5Xb3po7s5CqvDSjnxhVw XzzjFu3k5XTbuuziNYLvZolCk+KHBU8n8QcBL8Rd8VB8yCto8kTEDNBCTIdBg4wQvyD4L6rsdOb3 xKNhhW44IKm4wZaghSAnoIdrHWhz/m3wlOfiI86OXPJPzMvPxLwG/tcX4u3m2l8BBgBQ/dU5d1Za tAAAAABJRU5ErkJggg=="
+ transform="matrix(0.24 0 0 0.24 199.0298 230.2217)"
+ id="image185"></image><g
+ id="g187"><radialGradient
+ id="SVGID_11_"
+ cx="202.6289"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop190" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop192" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop194" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_11_)"
+ cx="202.629"
+ cy="233.37"
+ r="2.999"
+ id="circle196" /></g></g><g
+ id="g198"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNrsmM9r1EAUx3cz2XW1 il2wLLagIh5aeilUBC967EX/XA/1It5aUaiC2JNY/EWp0lZkG3c3id+Bz0AIaXayibKHDnzIJfPm s29eZl/Sas3paNeYZ0SHaz5OKmIx5pr+azF7fyh6oi+WxXURZGJZiUScim/iWERiUkWwXTFDlxG6 I1bFBnKd3P1jpPbEvviE4JlvBtueUl1xQ9wVa2ITsdtkzOTmxGTsALE34oP4KH6I0TS5tofUJXFT PBCPxToZ67OlZTUWkSmbsffipXglvos/ZXLGI1N2qx6Kp+KRuFcgVYRh/oJYEgNxle08EUNqsbJY SDAnZa8r1FlYoQzc02sFF5n/W/wskzMlAReopydkaoVtDWocL1bqGtv8Bblx0YSgJFt9xNbJXLfG uZctjQEx11gj9M2YDXCFiVviflmAGeQCYtlt/MxTOvbJmEFkFZqSyu9GNr7xEXNP4gbnVK/mFhZl rUdsd0B3fcQCDs3lcw7PJobJrRH4iE37g24qa6VrBK05HRdiTYjVbvI8xtQ1isSyTd4pE5secW6N xEdslGnyDmhd0oazFRF7j7VGPmIxPdQ+HNMWNzUmBfFj3+7C1YDtMG7RT3UaONMS+jErtC1e05tV EksyPdkAyToHbsqW2e51R7ygs42qNooJaU/oPF2TF8wgl2SkdsVz8Y5sJVXFUvryX6TfNXld5HwE U37cWUbqGdfDsto1njVxQjscQ8jc8+SckO25jqipHTK1i+Ro1peR7FM6pKH7StAhC7uam7CQI+J+ J7RNTb0lU7Vf3+b6hXeuPxH8948qF6Pq+CvAAGGezDColMK7AAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 213.9448 230.2217)"
+ id="image200"></image><g
+ id="g202"><radialGradient
+ id="SVGID_12_"
+ cx="217.5439"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop205" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop207" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop209" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_12_)"
+ cx="217.544"
+ cy="233.37"
+ r="2.999"
+ id="circle211" /></g></g><g
+ id="g213"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlRJREFUeNrsmM9LG0EUx5PdjTTW otDYWmoOQm2M/YGXnrxI/3IvnnoRW7TagocotqjQtLYp5pffgc/CECc7u+uGpuDAB2Y32Tff9+bN 7Jstlaa0lXM+E4gIAsd/BqIHpj+cpLBY0Ix4JBbhwYg4I+SvOIdf4jqrwHIOQUvihXgtVsWCQ9gP 8UV8El/Ft6wCyyl+DxH0XLwUb8UbxD0V1RE7ZtCO+I6oj2JPHIlTBPZ94sqe3yIi0hCb4h1Reibm iOK4HDPRuRJnRO+D2BGHRLSXJC7yRGpeNMV7sYXAeQSFCU6FRHIGB56IGveMI/uIGxu5JGFzTN0W wpqIijIsmpDFYZ55hah4xRpxP7MIM4NWWHEbTGGDKY1ybi8VKyVM/l2wYjtM+S1xrvww9x6KulgX K0QqvOOeGafGCnbrjOPScOtmnPA1Hm7Sr+TcjF2Rq2F3nb4zNVzCZsWyWMOr2XFe5WgB9urYX+ba KywkF1bJh8d4WWSrYLdhbdBhmohVrddNtYApLOUZI0jxgp6EMO8YQWlK272wuwobFlHkeVqqMVzC OlaR15mQMO8Yo8L6VpFnypNL0S1YWBe7h4wTVxneiP0RJ+KzaHE9KEjUAHst7J9wnWoqe7z9TVly QL9bwJQOsXOB3X36vbTVhfHqN16Zh49F2xXujK2PnWPsthhnkLYeiz0ziblrVZ55CkV7Ftrk1Q52 z5NmIkowdsUBIrIqz7SltR2la0vUNhxhP3PNP7RCf4CouPIs4jDS9p2U/svj21QfeKf6E8E/+ahy 37K2GwEGAJb/2mQI89WQAAAAAElFTkSuQmCC"
+ transform="matrix(0.24 0 0 0.24 228.8599 230.2217)"
+ id="image215"></image><g
+ id="g217"><radialGradient
+ id="SVGID_13_"
+ cx="232.459"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop220" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop222" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop224" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_13_)"
+ cx="232.459"
+ cy="233.37"
+ r="2.999"
+ id="circle226" /></g></g><g
+ id="g228"><image
+ overflow="visible"
+ opacity="0.25"
+ a:adobe-blending-mode="multiply"
+ a:adobe-opacity-share="1"
+ width="30"
+ height="30"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnpJREFUeNrsl2lrE1EUhmdLjSZ2 sYgL4lqsYN0+CuIC4o8WFERcPii0YEsQtYpL3cVgW7PMjO+F55ZhmMlMzATyoRceSDKZc957zplz zzjOBCz3P+/xRE34fE6uWESiJ0I+VybCxekeMSMOizkxlbATwx/xRXwXWwiKRhFhd17H+TFxVlwU J8W+lJ0+zlfFmngjvolNrkXDinAJ+6w4IRbFZXFenBLzqUg4ODGR+CheimXxQrwWn8U2aSolwgo4 KC6Jawg4w28mAsGAmuiI3+KDaInH4qlYJyo7QoISAq6IO4g4Lppc8wrSl66fA0TNSQvJE+GRggsI uE74GxgvW8gB/68l7ouojXVSE/s5N9dxelvcIgXNIQTkFXaT718pViMiyjIa8OiZ/N8US4Q0GLEf 2d5iauYHhWtqpu8PiMINcVUcJbduBY3R9poOT4rpJdteRi1Mi9PinDhUkQC7/Cz7aRH2iTB9YIEb /IqPiSmiu0Sza3gZf2qgcC6jEVUVjWbCR83LOR8CqFpAMu07PrxJOMp3ReSJiOnnfYjH5DdK+sgS sUkT+SW6YxASJoYe46OXFtGjp5uB5JVop8/+EVfMxj4xY7w1m/YywtRmGmqhtlNhNMIs+36O2pB2 fYSmUq+gc8ZsyBzhD8QTsWEikyciomjnETFdMMiUEWBTvYyIFlGJ/ILqNRHZy1HeyBnnhhVwXzzj FO06BSHuUcVbON9Piuy7hlvCudnEXwSsiLvioXhnB5oiEREG2ojpYtRLCXEHOP/JlG12fk88yhp0 /RJNxRrbgDaCrICQqHWhw/OfdG54Lt4T2dIj/8S8/EzMa+DYX4h3l13/BBgABM7SO70ZkkMAAAAA SUVORK5CYII="
+ transform="matrix(0.24 0 0 0.24 243.7749 230.2217)"
+ id="image230"></image><g
+ id="g232"><radialGradient
+ id="SVGID_14_"
+ cx="247.374"
+ cy="233.3711"
+ r="2.999"
+ gradientTransform="matrix(1 0 0 0.75 0 58.3428)"
+ gradientUnits="userSpaceOnUse"><stop
+ offset="0.0123"
+ style="stop-color:#FFFFFF"
+ id="stop235" /><stop
+ offset="0.4235"
+ style="stop-color:#FAFCF6"
+ id="stop237" /><stop
+ offset="1"
+ style="stop-color:#F2F7E8"
+ id="stop239" /><a:midPointStop
+ offset="0.0123"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="0.6235"
+ style="stop-color:#FFFFFF" /><a:midPointStop
+ offset="1"
+ style="stop-color:#F2F7E8" /></radialGradient><circle
+ fill="url(#SVGID_14_)"
+ cx="247.374"
+ cy="233.37"
+ r="2.999"
+ id="circle241" /></g></g></g></g><path
+ d="m 529.664,248.155 h 18.498 l -2.809,18.064 h 5.59 37.586 l 2.6,-17.718 c 4.98,-1.091 9.133,-3.455 12.512,-6.693 3.084,4.075 8.566,7.37 18.252,7.37 6.338,0 12.775,-1.807 17.174,-3.687 4.254,2.399 9.463,3.687 15.459,3.687 3.088,0 6.236,-0.355 9.426,-1.023 h 67.135 l 3.354,-24.827 -5.445,-0.764 1.879,-13.356 c 0.371,-2.386 0.449,-4.66 0.449,-6.156 l -0.008,-0.375 c -0.457,-12.191 -8.139,-19.765 -20.045,-19.765 -2.404,0 -4.623,0.314 -6.676,0.852 h -34.189 l -0.035,0.244 c -2.527,-0.701 -5.41,-1.096 -8.686,-1.096 -3.801,0 -7.406,0.555 -10.76,1.598 l 0.105,-0.746 h -12.467 l 1.826,-12.951 H 613.08 l -1.846,7.658 c -1.373,5.704 -2.213,5.793 -4.453,6.03 l -4.508,0.477 c -3.049,-1.424 -6.357,-2.065 -9.602,-2.065 -2.135,0 -4.275,0.284 -6.416,0.852 h -19.291 c 0.502,-1.772 0.775,-3.674 0.775,-5.678 0,-9.601 -6.846,-16.305 -16.646,-16.305 -11.055,0 -18.775,7.721 -18.775,18.776 0,0.951 0.082,1.869 0.219,2.764 -2.135,-0.288 -4.277,-0.409 -5.553,-0.409 -2.053,0 -4.072,0.288 -6.045,0.852 h -31.342 c -2.74,-0.553 -5.641,-0.852 -8.537,-0.852 -7.138,0 -13.492,1.674 -18.808,4.723 l -3.451,-1.461 c -3.711,-1.571 -11.232,-3.262 -18.979,-3.262 -8.933,0 -16.383,2.56 -21.576,7.016 -3.265,-4.473 -8.523,-7.016 -15.228,-7.016 -4.822,0 -9.021,1.477 -12.572,3.44 -2.996,-2.204 -6.796,-3.44 -11.115,-3.44 -2.327,0 -4.48,0.315 -6.476,0.852 h -33.963 l -0.035,0.245 c -2.526,-0.702 -5.41,-1.097 -8.687,-1.097 -20.458,0 -35.307,16.031 -35.307,38.117 0,17.363 10.785,28.149 28.148,28.149 3.087,0 6.236,-0.356 9.426,-1.023 h 88.816 c 3.706,0.676 7.669,1.023 11.154,1.023 8.907,0 16.278,-2.375 21.51,-6.593 4.872,4.252 11.585,6.593 19.728,6.593 3.053,0 6.206,-0.368 9.286,-1.023 h 44.664 2.069 z"
+ id="path243"
+ inkscape:connector-curvature="0"
+ style="fill:#f5f5f5" /><g
+ id="g245"
+ transform="translate(0,16)"><g
+ id="g247"><path
+ d="m 340.308,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.095,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path249"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 394.07,221.7 -0.171,-0.255 1.789,-10.055 2.642,-18.063 c 0.512,-3.749 0.341,-5.623 -1.96,-5.623 -2.642,0 -5.794,2.727 -9.372,5.879 l -2.727,19.512 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 -0.852,6.305 h -18.404 l -0.171,-0.341 1.875,-10.82 2.471,-17.212 c 0.512,-3.237 0.682,-5.453 -1.789,-5.453 -3.238,0 -7.413,3.664 -9.714,5.709 l -2.642,19.512 c -0.17,1.363 -0.17,1.534 1.108,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.767,-1.789 l -4.176,-1.534 0.938,-6.476 h 16.871 l -0.938,6.987 0.256,0.085 c 4.43,-3.749 9.116,-7.924 15.592,-7.924 4.687,0 7.839,2.641 8.18,7.753 l 0.256,0.086 c 4.175,-3.664 9.202,-7.839 15.252,-7.839 6.22,0 8.775,3.152 8.946,9.202 0,1.618 -0.171,3.493 -0.426,5.538 l -3.067,21.897 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.175,0.597 -0.852,6.305 H 394.07 z"
+ id="path251"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 443.995,190.771 -0.17,-4.431 c 0,-0.682 -0.085,-1.108 -1.022,-1.363 -1.022,-0.256 -2.642,-0.427 -4.771,-0.427 -3.579,0 -6.391,1.108 -6.391,4.09 0,2.727 2.982,3.749 6.731,5.027 6.05,2.045 13.888,4.431 13.888,13.463 0,11.076 -9.372,15.592 -20.193,15.592 -8.009,0 -14.91,-1.959 -16.273,-2.981 l 1.618,-12.355 8.691,0.512 0.255,4.941 c 0,0.597 0.171,1.108 0.938,1.363 1.278,0.427 3.238,0.768 6.05,0.768 4.687,0 7.327,-1.79 7.327,-4.687 0,-3.408 -3.152,-4.175 -8.009,-5.624 -6.135,-1.874 -12.78,-4.26 -12.78,-13.206 0,-10.48 9.116,-14.996 19.597,-14.996 6.646,0 12.866,1.533 15.081,2.471 l -1.704,12.354 -8.863,-0.511 z"
+ id="path253"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 489.748,218.548 c -4.175,2.386 -10.395,4.175 -16.444,4.175 -13.036,0 -18.575,-7.583 -18.575,-18.574 0,-18.83 11.588,-27.691 25.988,-27.691 6.475,0 11.843,1.874 14.229,3.578 l -1.874,13.377 -8.691,-0.426 -0.255,-5.794 c 0,-0.597 -0.086,-0.938 -0.597,-1.192 -1.022,-0.427 -2.557,-0.597 -4.175,-0.597 -5.624,0 -11.418,4.601 -11.418,17.382 0,7.839 3.493,10.395 8.436,10.395 4.346,0 8.436,-1.448 11.247,-2.556 l 2.129,7.923 z"
+ id="path255"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 491.364,221.7 0.853,-6.39 3.919,-0.512 c 1.193,-0.17 1.363,-0.426 1.534,-1.704 l 3.578,-25.987 c 0.086,-0.938 -0.085,-1.534 -0.852,-1.789 l -4.261,-1.534 0.938,-6.476 h 16.87 l -1.107,7.669 0.256,0.17 c 3.323,-4.771 8.095,-8.69 13.548,-8.69 1.874,0 5.112,0.341 6.561,0.767 l -2.13,15.507 -9.969,-0.341 -0.256,-4.431 c -0.086,-0.767 -0.256,-1.022 -0.938,-1.022 -1.619,0 -4.26,1.96 -6.646,4.431 l -2.981,21.643 c -0.171,1.363 -0.085,1.619 1.192,1.704 l 8.095,0.682 -0.938,6.305 h -27.266 z"
+ id="path257"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 536.094,221.7 -0.17,-0.426 2.045,-11.503 3.152,-22.749 c 0.17,-0.938 -0.086,-1.534 -0.853,-1.79 l -4.175,-1.448 0.852,-6.476 h 18.149 l -5.027,35.786 c -0.171,1.363 -0.085,1.534 1.192,1.704 l 4.09,0.597 -0.852,6.305 h -18.403 z m 5.879,-57.598 c 0,-5.453 3.238,-8.775 8.776,-8.775 4.175,0 6.646,2.215 6.646,6.305 0,5.368 -3.322,8.861 -8.861,8.861 -4.176,-0.001 -6.561,-2.387 -6.561,-6.391 z"
+ id="path259"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 556.796,239.764 -0.17,-0.341 2.471,-14.229 5.282,-38.087 c 0.171,-1.022 -0.085,-1.534 -0.767,-1.789 l -4.175,-1.534 0.938,-6.476 h 17.041 l -1.022,6.816 0.255,0.085 c 5.027,-4.686 10.311,-7.753 15.678,-7.753 7.328,0 12.44,4.686 12.44,17.041 0,11.758 -4.601,29.225 -20.449,29.225 -5.538,0 -8.605,-2.13 -11.759,-4.345 l -1.874,12.78 c -0.085,0.938 0.085,1.278 1.192,1.363 l 8.606,0.853 -0.938,6.39 h -22.749 z m 17.041,-30.247 c 2.13,1.789 4.942,3.322 8.095,3.322 6.901,0 9.458,-9.713 9.458,-17.211 0,-5.027 -1.193,-8.351 -4.431,-8.351 -3.408,0 -7.754,3.664 -10.821,6.391 l -2.301,15.849 z"
+ id="path261"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 635.777,219.4 c -3.749,1.789 -9.458,3.322 -14.229,3.322 -8.521,0 -12.099,-2.981 -12.099,-9.969 0,-1.107 0.085,-2.386 0.256,-3.749 l 3.066,-22.323 c 0.086,-0.512 0.086,-0.853 -0.511,-0.853 h -5.879 l 1.107,-7.839 c 7.242,-0.767 10.906,-4.431 13.122,-13.633 h 7.924 l -1.704,12.1 c -0.085,0.596 -0.085,0.852 0.597,0.852 h 11.758 l -1.193,8.521 h -12.439 l -2.812,20.364 c -0.171,1.107 -0.256,1.96 -0.256,2.727 0,2.982 1.278,4.26 4.942,4.26 2.385,0 4.771,-0.596 6.816,-1.363 l 1.534,7.583 z"
+ id="path263"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 671.817,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.094,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path265"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /><path
+ d="m 703.596,221.7 -0.17,-0.255 1.874,-10.396 2.471,-17.723 c 0.512,-3.578 0.341,-5.879 -2.215,-5.879 -3.664,0 -8.18,3.578 -11.077,6.135 l -2.641,19.512 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.768,-1.789 l -4.175,-1.534 0.938,-6.476 h 16.87 l -0.937,6.987 0.255,0.085 c 4.771,-4.09 9.373,-7.924 16.02,-7.924 6.475,0 9.798,3.322 10.054,10.139 0,1.363 -0.085,3.067 -0.341,4.687 l -3.067,21.812 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 L 722,221.7 h -18.404 z"
+ id="path267"
+ inkscape:connector-curvature="0"
+ style="fill:#383838" /></g><g
+ id="g269"><linearGradient
+ id="SVGID_15_"
+ gradientUnits="userSpaceOnUse"
+ x1="324.1611"
+ y1="239.7637"
+ x2="324.1611"
+ y2="155.3275"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop272" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop274" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 340.308,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.095,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path276"
+ style="fill:url(#SVGID_15_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_16_"
+ gradientUnits="userSpaceOnUse"
+ x1="377.45459"
+ y1="239.7637"
+ x2="377.45459"
+ y2="155.3277"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop279" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop281" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 394.07,221.7 -0.171,-0.255 1.789,-10.055 2.642,-18.063 c 0.512,-3.749 0.341,-5.623 -1.96,-5.623 -2.642,0 -5.794,2.727 -9.372,5.879 l -2.727,19.512 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 -0.852,6.305 h -18.404 l -0.171,-0.341 1.875,-10.82 2.471,-17.212 c 0.512,-3.237 0.682,-5.453 -1.789,-5.453 -3.238,0 -7.413,3.664 -9.714,5.709 l -2.642,19.512 c -0.17,1.363 -0.17,1.534 1.108,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.767,-1.789 l -4.176,-1.534 0.938,-6.476 h 16.871 l -0.938,6.987 0.256,0.085 c 4.43,-3.749 9.116,-7.924 15.592,-7.924 4.687,0 7.839,2.641 8.18,7.753 l 0.256,0.086 c 4.175,-3.664 9.202,-7.839 15.252,-7.839 6.22,0 8.775,3.152 8.946,9.202 0,1.618 -0.171,3.493 -0.426,5.538 l -3.067,21.897 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.175,0.597 -0.852,6.305 H 394.07 z"
+ id="path283"
+ style="fill:url(#SVGID_16_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_17_"
+ gradientUnits="userSpaceOnUse"
+ x1="435.17719"
+ y1="239.7637"
+ x2="435.17719"
+ y2="155.3275"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop286" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop288" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 443.995,190.771 -0.17,-4.431 c 0,-0.682 -0.085,-1.108 -1.022,-1.363 -1.022,-0.256 -2.642,-0.427 -4.771,-0.427 -3.579,0 -6.391,1.108 -6.391,4.09 0,2.727 2.982,3.749 6.731,5.027 6.05,2.045 13.888,4.431 13.888,13.463 0,11.076 -9.372,15.592 -20.193,15.592 -8.009,0 -14.91,-1.959 -16.273,-2.981 l 1.618,-12.355 8.691,0.512 0.255,4.941 c 0,0.597 0.171,1.108 0.938,1.363 1.278,0.427 3.238,0.768 6.05,0.768 4.687,0 7.327,-1.79 7.327,-4.687 0,-3.408 -3.152,-4.175 -8.009,-5.624 -6.135,-1.874 -12.78,-4.26 -12.78,-13.206 0,-10.48 9.116,-14.996 19.597,-14.996 6.646,0 12.866,1.533 15.081,2.471 l -1.704,12.354 -8.863,-0.511 z"
+ id="path290"
+ style="fill:url(#SVGID_17_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_18_"
+ gradientUnits="userSpaceOnUse"
+ x1="474.83691"
+ y1="239.7637"
+ x2="474.83691"
+ y2="155.3275"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop293" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop295" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 489.748,218.548 c -4.175,2.386 -10.395,4.175 -16.444,4.175 -13.036,0 -18.575,-7.583 -18.575,-18.574 0,-18.83 11.588,-27.691 25.988,-27.691 6.475,0 11.843,1.874 14.229,3.578 l -1.874,13.377 -8.691,-0.426 -0.255,-5.794 c 0,-0.597 -0.086,-0.938 -0.597,-1.192 -1.022,-0.427 -2.557,-0.597 -4.175,-0.597 -5.624,0 -11.418,4.601 -11.418,17.382 0,7.839 3.493,10.395 8.436,10.395 4.346,0 8.436,-1.448 11.247,-2.556 l 2.129,7.923 z"
+ id="path297"
+ style="fill:url(#SVGID_18_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_19_"
+ gradientUnits="userSpaceOnUse"
+ x1="512.28223"
+ y1="239.7637"
+ x2="512.28223"
+ y2="155.3277"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop300" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop302" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 491.364,221.7 0.853,-6.39 3.919,-0.512 c 1.193,-0.17 1.363,-0.426 1.534,-1.704 l 3.578,-25.987 c 0.086,-0.938 -0.085,-1.534 -0.852,-1.789 l -4.261,-1.534 0.938,-6.476 h 16.87 l -1.107,7.669 0.256,0.17 c 3.323,-4.771 8.095,-8.69 13.548,-8.69 1.874,0 5.112,0.341 6.561,0.767 l -2.13,15.507 -9.969,-0.341 -0.256,-4.431 c -0.086,-0.767 -0.256,-1.022 -0.938,-1.022 -1.619,0 -4.26,1.96 -6.646,4.431 l -2.981,21.643 c -0.171,1.363 -0.085,1.619 1.192,1.704 l 8.095,0.682 -0.938,6.305 h -27.266 z"
+ id="path304"
+ style="fill:url(#SVGID_19_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_20_"
+ gradientUnits="userSpaceOnUse"
+ x1="546.65918"
+ y1="239.7637"
+ x2="546.65918"
+ y2="155.32719"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop307" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop309" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 536.094,221.7 -0.17,-0.426 2.045,-11.503 3.152,-22.749 c 0.17,-0.938 -0.086,-1.534 -0.853,-1.79 l -4.175,-1.448 0.852,-6.476 h 18.149 l -5.027,35.786 c -0.171,1.363 -0.085,1.534 1.192,1.704 l 4.09,0.597 -0.852,6.305 h -18.403 z m 5.879,-57.598 c 0,-5.453 3.238,-8.775 8.776,-8.775 4.175,0 6.646,2.215 6.646,6.305 0,5.368 -3.322,8.861 -8.861,8.861 -4.176,-0.001 -6.561,-2.387 -6.561,-6.391 z"
+ id="path311"
+ style="fill:url(#SVGID_20_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_21_"
+ gradientUnits="userSpaceOnUse"
+ x1="580.69629"
+ y1="239.7637"
+ x2="580.69629"
+ y2="155.32719"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop314" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop316" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 556.796,239.764 -0.17,-0.341 2.471,-14.229 5.282,-38.087 c 0.171,-1.022 -0.085,-1.534 -0.767,-1.789 l -4.175,-1.534 0.938,-6.476 h 17.041 l -1.022,6.816 0.255,0.085 c 5.027,-4.686 10.311,-7.753 15.678,-7.753 7.328,0 12.44,4.686 12.44,17.041 0,11.758 -4.601,29.225 -20.449,29.225 -5.538,0 -8.605,-2.13 -11.759,-4.345 l -1.874,12.78 c -0.085,0.938 0.085,1.278 1.192,1.363 l 8.606,0.853 -0.938,6.39 h -22.749 z m 17.041,-30.247 c 2.13,1.789 4.942,3.322 8.095,3.322 6.901,0 9.458,-9.713 9.458,-17.211 0,-5.027 -1.193,-8.351 -4.431,-8.351 -3.408,0 -7.754,3.664 -10.821,6.391 l -2.301,15.849 z"
+ id="path318"
+ style="fill:url(#SVGID_21_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_22_"
+ gradientUnits="userSpaceOnUse"
+ x1="622.7832"
+ y1="239.7637"
+ x2="622.7832"
+ y2="155.3268"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop321" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop323" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 635.777,219.4 c -3.749,1.789 -9.458,3.322 -14.229,3.322 -8.521,0 -12.099,-2.981 -12.099,-9.969 0,-1.107 0.085,-2.386 0.256,-3.749 l 3.066,-22.323 c 0.086,-0.512 0.086,-0.853 -0.511,-0.853 h -5.879 l 1.107,-7.839 c 7.242,-0.767 10.906,-4.431 13.122,-13.633 h 7.924 l -1.704,12.1 c -0.085,0.596 -0.085,0.852 0.597,0.852 h 11.758 l -1.193,8.521 h -12.439 l -2.812,20.364 c -0.171,1.107 -0.256,1.96 -0.256,2.727 0,2.982 1.278,4.26 4.942,4.26 2.385,0 4.771,-0.596 6.816,-1.363 l 1.534,7.583 z"
+ id="path325"
+ style="fill:url(#SVGID_22_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_23_"
+ gradientUnits="userSpaceOnUse"
+ x1="655.6709"
+ y1="239.7637"
+ x2="655.6709"
+ y2="155.3275"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop328" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop330" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 671.817,218.463 c -5.538,2.556 -11.588,4.26 -17.638,4.26 -13.377,0 -18.148,-7.839 -18.148,-18.148 0,-17.893 11.418,-28.117 25.307,-28.117 9.372,0 13.973,4.26 13.973,11.247 0,12.184 -12.865,15.763 -26.157,17.126 0.255,4.346 2.045,8.35 8.435,8.35 3.068,0 7.243,-0.937 12.355,-3.067 l 1.873,8.349 z m -8.094,-29.567 c 0,-2.045 -1.448,-3.237 -4.09,-3.237 -4.771,0 -8.69,4.175 -9.969,10.906 3.664,-0.511 14.059,-2.3 14.059,-7.669 z"
+ id="path332"
+ style="fill:url(#SVGID_23_)"
+ inkscape:connector-curvature="0" /><linearGradient
+ id="SVGID_24_"
+ gradientUnits="userSpaceOnUse"
+ x1="697.92969"
+ y1="239.7637"
+ x2="697.92969"
+ y2="155.3277"><stop
+ offset="0"
+ style="stop-color:#000000"
+ id="stop335" /><stop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0"
+ id="stop337" /><a:midPointStop
+ offset="0"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="0.6933"
+ style="stop-color:#000000" /><a:midPointStop
+ offset="1"
+ style="stop-color:#000000;stop-opacity:0" /></linearGradient><path
+ d="m 703.596,221.7 -0.17,-0.255 1.874,-10.396 2.471,-17.723 c 0.512,-3.578 0.341,-5.879 -2.215,-5.879 -3.664,0 -8.18,3.578 -11.077,6.135 l -2.641,19.512 c -0.171,1.363 -0.171,1.534 1.107,1.704 l 4.26,0.597 -0.852,6.305 h -23.347 l 0.853,-6.39 3.749,-0.512 c 1.107,-0.17 1.363,-0.426 1.533,-1.704 l 3.579,-25.987 c 0.17,-0.938 0,-1.534 -0.768,-1.789 l -4.175,-1.534 0.938,-6.476 h 16.87 l -0.937,6.987 0.255,0.085 c 4.771,-4.09 9.373,-7.924 16.02,-7.924 6.475,0 9.798,3.322 10.054,10.139 0,1.363 -0.085,3.067 -0.341,4.687 l -3.067,21.812 c -0.171,1.363 -0.171,1.534 1.022,1.704 l 4.26,0.597 L 722,221.7 h -18.404 z"
+ id="path339"
+ style="fill:url(#SVGID_24_)"
+ inkscape:connector-curvature="0" /></g></g><g
+ id="g4141"
+ transform="matrix(0.81856441,0,0,0.81856441,79.234731,-94.128741)"><g
+ id="g4143"></g><g
+ id="g4165"><linearGradient
+ y2="155.3275"
+ x2="324.1611"
+ y1="239.7637"
+ x1="324.1611"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4167"><stop
+ id="stop4169"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4171"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3277"
+ x2="377.45459"
+ y1="239.7637"
+ x1="377.45459"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4175"><stop
+ id="stop4177"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4179"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3275"
+ x2="435.17719"
+ y1="239.7637"
+ x1="435.17719"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4183"><stop
+ id="stop4185"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4187"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3275"
+ x2="474.83691"
+ y1="239.7637"
+ x1="474.83691"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4191"><stop
+ id="stop4193"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4195"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3277"
+ x2="512.28223"
+ y1="239.7637"
+ x1="512.28223"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4199"><stop
+ id="stop4201"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4203"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.32719"
+ x2="546.65918"
+ y1="239.7637"
+ x1="546.65918"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4207"><stop
+ id="stop4209"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4211"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.32719"
+ x2="580.69629"
+ y1="239.7637"
+ x1="580.69629"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4215"><stop
+ id="stop4217"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4219"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3268"
+ x2="622.7832"
+ y1="239.7637"
+ x1="622.7832"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4223"><stop
+ id="stop4225"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4227"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3275"
+ x2="655.6709"
+ y1="239.7637"
+ x1="655.6709"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4231"><stop
+ id="stop4233"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4235"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient><linearGradient
+ y2="155.3277"
+ x2="697.92969"
+ y1="239.7637"
+ x1="697.92969"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient4239"><stop
+ id="stop4241"
+ style="stop-color:#000000"
+ offset="0" /><stop
+ id="stop4243"
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0" /><a:midPointStop
+ style="stop-color:#000000"
+ offset="0.6933" /><a:midPointStop
+ style="stop-color:#000000;stop-opacity:0"
+ offset="1" /></linearGradient></g></g></svg>
+ </a>
+
+ <div class="spinner" id='spinner'></div>
<div class="emscripten" id="status">Downloading...</div>
+
+<span id='controls'>
+ <span><input type="checkbox" id="resize">Resize canvas</span>
+ <span><input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer &nbsp;&nbsp;&nbsp;</span>
+ <span><input type="button" value="Fullscreen" onclick="Module.requestFullScreen(document.getElementById('pointerLock').checked,
+ document.getElementById('resize').checked)">
+ </span>
+</span>
+
<div class="emscripten">
- <progress value="0" max="100" id="progress" hidden=1></progress>
+ <progress value="0" max="100" id="progress" hidden=1></progress>
</div>
+
+
<div class="emscripten_border">
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
- <hr/>
- <div class="emscripten">
- <input type="checkbox" id="resize">Resize canvas
- <input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer
- &nbsp;&nbsp;&nbsp;
- <input type="button" value="Fullscreen" onclick="Module.requestFullScreen(document.getElementById('pointerLock').checked,
- document.getElementById('resize').checked)">
- </div>
-
- <hr/>
- <textarea class="emscripten" id="output" rows="8"></textarea>
- <hr>
+ <textarea id="output" rows="8"></textarea>
+
<script type='text/javascript'>
- // connect to canvas
+ var statusElement = document.getElementById('status');
+ var progressElement = document.getElementById('progress');
+ var spinnerElement = document.getElementById('spinner');
+
var Module = {
preRun: [],
postRun: [],
@@ -68,17 +1249,17 @@
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
- var statusElement = document.getElementById('status');
- var progressElement = document.getElementById('progress');
if (m) {
text = m[1];
progressElement.value = parseInt(m[2])*100;
progressElement.max = parseInt(m[4])*100;
progressElement.hidden = false;
+ spinnerElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
+ if (!text) spinnerElement.style.display = 'none';
}
statusElement.innerHTML = text;
},
diff --git a/src/shell.js b/src/shell.js
index b41fbb51..84844c85 100644
--- a/src/shell.js
+++ b/src/shell.js
@@ -38,10 +38,10 @@ var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIR
if (ENVIRONMENT_IS_NODE) {
// Expose functionality in the same simple way that the shells work
// Note that we pollute the global namespace here, otherwise we break in node
- Module['print'] = function print(x) {
+ if (!Module['print']) Module['print'] = function print(x) {
process['stdout'].write(x + '\n');
};
- Module['printErr'] = function printErr(x) {
+ if (!Module['printErr']) Module['printErr'] = function printErr(x) {
process['stderr'].write(x + '\n');
};
@@ -71,7 +71,7 @@ if (ENVIRONMENT_IS_NODE) {
module['exports'] = Module;
}
else if (ENVIRONMENT_IS_SHELL) {
- Module['print'] = print;
+ if (!Module['print']) Module['print'] = print;
if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
if (typeof read != 'undefined') {
@@ -107,16 +107,16 @@ else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
}
if (typeof console !== 'undefined') {
- Module['print'] = function print(x) {
+ if (!Module['print']) Module['print'] = function print(x) {
console.log(x);
};
- Module['printErr'] = function printErr(x) {
+ if (!Module['printErr']) Module['printErr'] = function printErr(x) {
console.log(x);
};
} else {
// Probably a worker, and without console.log. We can do very little here...
var TRY_USE_DUMP = false;
- Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
+ if (!Module['print']) Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
dump(x);
}) : (function(x) {
// self.postMessage(x); // enable this if you want stdout to be sent as messages
diff --git a/src/shell_minimal.html b/src/shell_minimal.html
new file mode 100644
index 00000000..7a3a8d08
--- /dev/null
+++ b/src/shell_minimal.html
@@ -0,0 +1,132 @@
+<!doctype html>
+<html lang="en-us">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Emscripten-Generated Code</title>
+ <style>
+ .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
+ textarea.emscripten { font-family: monospace; width: 80%; }
+ div.emscripten { text-align: center; }
+ div.emscripten_border { border: 1px solid black; }
+ /* the canvas *must not* have any border or padding, or mouse coords will be wrong */
+ canvas.emscripten { border: 0px none; }
+
+ .spinner {
+ height: 50px;
+ width: 50px;
+ margin: 0px auto;
+ -webkit-animation: rotation .8s linear infinite;
+ -moz-animation: rotation .8s linear infinite;
+ -o-animation: rotation .8s linear infinite;
+ animation: rotation 0.8s linear infinite;
+ border-left: 10px solid rgb(0,150,240);
+ border-right: 10px solid rgb(0,150,240);
+ border-bottom: 10px solid rgb(0,150,240);
+ border-top: 10px solid rgb(100,0,200);
+ border-radius: 100%;
+ background-color: rgb(200,100,250);
+ }
+ @-webkit-keyframes rotation {
+ from {-webkit-transform: rotate(0deg);}
+ to {-webkit-transform: rotate(360deg);}
+ }
+ @-moz-keyframes rotation {
+ from {-moz-transform: rotate(0deg);}
+ to {-moz-transform: rotate(360deg);}
+ }
+ @-o-keyframes rotation {
+ from {-o-transform: rotate(0deg);}
+ to {-o-transform: rotate(360deg);}
+ }
+ @keyframes rotation {
+ from {transform: rotate(0deg);}
+ to {transform: rotate(360deg);}
+ }
+
+ </style>
+ </head>
+ <body>
+ <hr/>
+ <figure style="overflow:visible;" id="spinner"><div class="spinner"></div><center style="margin-top:0.5em"><strong>emscripten</strong></center></figure>
+ <div class="emscripten" id="status">Downloading...</div>
+ <div class="emscripten">
+ <progress value="0" max="100" id="progress" hidden=1></progress>
+ </div>
+ <div class="emscripten_border">
+ <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+ </div>
+ <hr/>
+ <div class="emscripten">
+ <input type="checkbox" id="resize">Resize canvas
+ <input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer
+ &nbsp;&nbsp;&nbsp;
+ <input type="button" value="Fullscreen" onclick="Module.requestFullScreen(document.getElementById('pointerLock').checked,
+ document.getElementById('resize').checked)">
+ </div>
+
+ <hr/>
+ <textarea class="emscripten" id="output" rows="8"></textarea>
+ <hr>
+ <script type='text/javascript'>
+ var statusElement = document.getElementById('status');
+ var progressElement = document.getElementById('progress');
+ var spinnerElement = document.getElementById('spinner');
+
+ var Module = {
+ preRun: [],
+ postRun: [],
+ print: (function() {
+ 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, "&amp;");
+ //text = text.replace(/</g, "&lt;");
+ //text = text.replace(/>/g, "&gt;");
+ //text = text.replace('\n', '<br>', 'g');
+ element.value += text + "\n";
+ element.scrollTop = element.scrollHeight; // focus on bottom
+ };
+ })(),
+ 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 {
+ console.log(text);
+ }
+ },
+ canvas: document.getElementById('canvas'),
+ setStatus: function(text) {
+ if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
+ if (text === Module.setStatus.text) return;
+ var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+ var now = Date.now();
+ if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
+ if (m) {
+ text = m[1];
+ progressElement.value = parseInt(m[2])*100;
+ progressElement.max = parseInt(m[4])*100;
+ progressElement.hidden = false;
+ spinnerElement.hidden = false;
+ } else {
+ progressElement.value = null;
+ progressElement.max = null;
+ progressElement.hidden = true;
+ if (!text) spinnerElement.hidden = true;
+ }
+ statusElement.innerHTML = text;
+ },
+ totalDependencies: 0,
+ monitorRunDependencies: function(left) {
+ this.totalDependencies = Math.max(this.totalDependencies, left);
+ Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
+ }
+ };
+ Module.setStatus('Downloading...');
+ </script>
+ {{{ SCRIPT }}}
+ </body>
+</html>
diff --git a/src/struct_info.json b/src/struct_info.json
index a22851b6..2a2b4c64 100644
--- a/src/struct_info.json
+++ b/src/struct_info.json
@@ -141,7 +141,9 @@
},
{
"file": "libc/stdlib.h",
- "defines": [],
+ "defines": [
+ "RAND_MAX"
+ ],
"structs": {
// NOTE: The hash sign at the end of this name is a hint to the processor that it mustn't prefix "struct " to the name to reference this struct.
// It will be stripped away when writing the compiled JSON file. You can just refer to it as C_STRUCTS.div_t when using it in the JS code.
@@ -1073,5 +1075,192 @@
"UUID_TYPE_DCE_RANDOM"
],
"structs": {}
+ },
+ // ===========================================
+ // emscripten html5 library
+ // ===========================================
+ {
+ "file": "emscripten/html5.h",
+ "defines": [
+ "EMSCRIPTEN_EVENT_KEYPRESS",
+ "EMSCRIPTEN_EVENT_KEYDOWN",
+ "EMSCRIPTEN_EVENT_KEYUP",
+ "EMSCRIPTEN_EVENT_CLICK",
+ "EMSCRIPTEN_EVENT_MOUSEDOWN",
+ "EMSCRIPTEN_EVENT_MOUSEUP",
+ "EMSCRIPTEN_EVENT_DBLCLICK",
+ "EMSCRIPTEN_EVENT_MOUSEMOVE",
+ "EMSCRIPTEN_EVENT_WHEEL",
+ "EMSCRIPTEN_EVENT_RESIZE",
+ "EMSCRIPTEN_EVENT_SCROLL",
+ "EMSCRIPTEN_EVENT_BLUR",
+ "EMSCRIPTEN_EVENT_FOCUS",
+ "EMSCRIPTEN_EVENT_FOCUSIN",
+ "EMSCRIPTEN_EVENT_FOCUSOUT",
+ "EMSCRIPTEN_EVENT_DEVICEORIENTATION",
+ "EMSCRIPTEN_EVENT_DEVICEMOTION",
+ "EMSCRIPTEN_EVENT_ORIENTATIONCHANGE",
+ "EMSCRIPTEN_EVENT_FULLSCREENCHANGE",
+ "EMSCRIPTEN_EVENT_POINTERLOCKCHANGE",
+ "EMSCRIPTEN_EVENT_VISIBILITYCHANGE",
+ "EMSCRIPTEN_EVENT_TOUCHSTART",
+ "EMSCRIPTEN_EVENT_TOUCHEND",
+ "EMSCRIPTEN_EVENT_TOUCHMOVE",
+ "EMSCRIPTEN_EVENT_TOUCHCANCEL",
+ "EMSCRIPTEN_EVENT_GAMEPADCONNECTED",
+ "EMSCRIPTEN_EVENT_GAMEPADDISCONNECTED",
+ "EMSCRIPTEN_EVENT_BEFOREUNLOAD",
+ "EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE",
+ "EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE",
+ "EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST",
+ "EMSCRIPTEN_EVENT_WEBGLCONTEXTRESTORED",
+
+ "EMSCRIPTEN_RESULT_SUCCESS",
+ "EMSCRIPTEN_RESULT_DEFERRED",
+ "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED",
+ "EMSCRIPTEN_RESULT_INVALID_TARGET",
+ "EMSCRIPTEN_RESULT_UNKNOWN_TARGET",
+ "EMSCRIPTEN_RESULT_INVALID_PARAM",
+ "EMSCRIPTEN_RESULT_NOT_SUPPORTED",
+ "EMSCRIPTEN_RESULT_FAILED",
+ "EMSCRIPTEN_RESULT_NO_DATA"
+ ],
+ "structs": {
+ "EmscriptenKeyboardEvent": [
+ "key",
+ "code",
+ "location",
+ "ctrlKey",
+ "shiftKey",
+ "altKey",
+ "metaKey",
+ "repeat",
+ "locale",
+ "charValue",
+ "charCode",
+ "keyCode",
+ "which"
+ ],
+ "EmscriptenMouseEvent": [
+ "timestamp",
+ "screenX",
+ "screenY",
+ "clientX",
+ "clientY",
+ "ctrlKey",
+ "shiftKey",
+ "altKey",
+ "metaKey",
+ "button",
+ "buttons",
+ "movementX",
+ "movementY",
+ "canvasX",
+ "canvasY"
+ ],
+ "EmscriptenWheelEvent": [
+ "mouse",
+ "deltaX",
+ "deltaY",
+ "deltaZ",
+ "deltaMode"
+ ],
+ "EmscriptenUiEvent": [
+ "detail",
+ "documentBodyClientWidth",
+ "documentBodyClientHeight",
+ "windowInnerWidth",
+ "windowInnerHeight",
+ "windowOuterWidth",
+ "windowOuterHeight",
+ "scrollTop",
+ "scrollLeft"
+ ],
+ "EmscriptenFocusEvent": [
+ "nodeName",
+ "id"
+ ],
+ "EmscriptenDeviceOrientationEvent": [
+ "timestamp",
+ "alpha",
+ "beta",
+ "gamma",
+ "absolute"
+ ],
+ "EmscriptenDeviceMotionEvent": [
+ "timestamp",
+ "accelerationX",
+ "accelerationY",
+ "accelerationZ",
+ "accelerationIncludingGravityX",
+ "accelerationIncludingGravityY",
+ "accelerationIncludingGravityZ",
+ "rotationRateAlpha",
+ "rotationRateBeta",
+ "rotationRateGamma"
+ ],
+ "EmscriptenOrientationChangeEvent": [
+ "orientationIndex",
+ "orientationAngle"
+ ],
+ "EmscriptenFullscreenChangeEvent": [
+ "isFullscreen",
+ "fullscreenEnabled",
+ "nodeName",
+ "id",
+ "elementWidth",
+ "elementHeight",
+ "screenWidth",
+ "screenHeight"
+ ],
+ "EmscriptenPointerlockChangeEvent": [
+ "isActive",
+ "nodeName",
+ "id"
+ ],
+ "EmscriptenVisibilityChangeEvent": [
+ "hidden",
+ "visibilityState"
+ ],
+ "EmscriptenTouchPoint": [
+ "identifier",
+ "screenX",
+ "screenY",
+ "clientX",
+ "clientY",
+ "pageX",
+ "pageY",
+ "isChanged",
+ "onTarget",
+ "canvasX",
+ "canvasY"
+ ],
+ "EmscriptenTouchEvent": [
+ "numTouches",
+ "ctrlKey",
+ "shiftKey",
+ "altKey",
+ "metaKey",
+ "touches"
+ ],
+ "EmscriptenGamepadEvent": [
+ "timestamp",
+ "axis",
+ "analogButton",
+ "digitalButton",
+ "connected",
+ "index",
+ "numAxes",
+ "numButtons",
+ "id",
+ "mapping"
+ ],
+ "EmscriptenBatteryEvent": [
+ "chargingTime",
+ "dischargingTime",
+ "level",
+ "charging"
+ ]
+ }
}
-]
+ ]
diff --git a/src/utility.js b/src/utility.js
index 178c596b..54cc2d69 100644
--- a/src/utility.js
+++ b/src/utility.js
@@ -200,11 +200,11 @@ function dprint() {
printErr(text);
}
-var PROF_ORIGIN = Date.now();
-var PROF_TIME = PROF_ORIGIN;
+var _PROF_ORIGIN = Date.now();
+var _PROF_TIME = _PROF_ORIGIN;
function PROF(pass) {
if (!pass) {
- dprint("Profiling: " + ((Date.now() - PROF_TIME)/1000) + ' seconds, total: ' + ((Date.now() - PROF_ORIGIN)/1000));
+ dprint("Profiling: " + ((Date.now() - _PROF_TIME)/1000) + ' seconds, total: ' + ((Date.now() - _PROF_ORIGIN)/1000));
}
PROF_TIME = Date.now();
}
diff --git a/system/include/EGL/eglplatform.h b/system/include/EGL/eglplatform.h
index 2db2cc47..77e885a8 100644
--- a/system/include/EGL/eglplatform.h
+++ b/system/include/EGL/eglplatform.h
@@ -75,7 +75,7 @@ typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
-#elif defined(EMSCRIPTEN)
+#elif defined(__EMSCRIPTEN__)
typedef int EGLNativeDisplayType;
typedef int EGLNativeWindowType;
diff --git a/system/include/GL/glew.h b/system/include/GL/glew.h
index efd90d6f..8be23b60 100644
--- a/system/include/GL/glew.h
+++ b/system/include/GL/glew.h
@@ -827,7 +827,9 @@ GLenum glewInit (void);
GLboolean glewIsSupported (const char *name);
#define glewIsExtensionSupported(x) glewIsSupported(x)
-GLboolean glewExperimental;
+//GLboolean glewExperimental;
+static GLboolean glewExperimental; // XXX Emscripten Added 'static' to work around a linkage issue. See https://github.com/kripken/emscripten/issues/2025
+
GLboolean glewGetExtension (const char *name);
const GLubyte * glewGetErrorString (GLenum error);
const GLubyte * glewGetString (GLenum name);
diff --git a/system/include/SDL/SDL_config_minimal.h b/system/include/SDL/SDL_config_minimal.h
index ea0cec10..18951f18 100644
--- a/system/include/SDL/SDL_config_minimal.h
+++ b/system/include/SDL/SDL_config_minimal.h
@@ -33,7 +33,7 @@
#include <stddef.h>
#include <stdarg.h>
-#if !defined(EMSCRIPTEN) && !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
+#if !defined(__EMSCRIPTEN__) && !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef unsigned int size_t;
typedef signed char int8_t;
typedef unsigned char uint8_t;
diff --git a/system/include/SDL/SDL_stdinc.h b/system/include/SDL/SDL_stdinc.h
index c4ce7ccd..508ecdb4 100644
--- a/system/include/SDL/SDL_stdinc.h
+++ b/system/include/SDL/SDL_stdinc.h
@@ -65,7 +65,7 @@
#endif
#if defined(HAVE_INTTYPES_H)
# include <inttypes.h>
-#elif defined(EMSCRIPTEN) || defined(HAVE_STDINT_H)
+#elif defined(__EMSCRIPTEN__) || defined(HAVE_STDINT_H)
# include <stdint.h>
#endif
#ifdef HAVE_CTYPE_H
diff --git a/system/include/X11/XKBlib.h b/system/include/X11/XKBlib.h
new file mode 100644
index 00000000..8f6c72c1
--- /dev/null
+++ b/system/include/X11/XKBlib.h
@@ -0,0 +1,1149 @@
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _X11_XKBLIB_H_
+#define _X11_XKBLIB_H_
+
+#include <X11/Xlib.h>
+#include <X11/extensions/XKBstr.h>
+
+typedef struct _XkbAnyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* # of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XKB event minor code */
+ unsigned int device; /* device ID */
+} XkbAnyEvent;
+
+typedef struct _XkbNewKeyboardNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbNewKeyboardNotify */
+ int device; /* device ID */
+ int old_device; /* device ID of previous keyboard */
+ int min_key_code; /* minimum key code */
+ int max_key_code; /* maximum key code */
+ int old_min_key_code;/* min key code of previous kbd */
+ int old_max_key_code;/* max key code of previous kbd */
+ unsigned int changed; /* changed aspects of the keyboard */
+ char req_major; /* major and minor opcode of req */
+ char req_minor; /* that caused change, if applicable */
+} XkbNewKeyboardNotifyEvent;
+
+typedef struct _XkbMapNotifyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbMapNotify */
+ int device; /* device ID */
+ unsigned int changed; /* fields which have been changed */
+ unsigned int flags; /* reserved */
+ int first_type; /* first changed key type */
+ int num_types; /* number of changed key types */
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+ KeyCode first_key_sym;
+ KeyCode first_key_act;
+ KeyCode first_key_behavior;
+ KeyCode first_key_explicit;
+ KeyCode first_modmap_key;
+ KeyCode first_vmodmap_key;
+ int num_key_syms;
+ int num_key_acts;
+ int num_key_behaviors;
+ int num_key_explicit;
+ int num_modmap_keys;
+ int num_vmodmap_keys;
+ unsigned int vmods; /* mask of changed virtual mods */
+} XkbMapNotifyEvent;
+
+typedef struct _XkbStateNotifyEvent {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* # of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbStateNotify */
+ int device; /* device ID */
+ unsigned int changed; /* mask of changed state components */
+ int group; /* keyboard group */
+ int base_group; /* base keyboard group */
+ int latched_group; /* latched keyboard group */
+ int locked_group; /* locked keyboard group */
+ unsigned int mods; /* modifier state */
+ unsigned int base_mods; /* base modifier state */
+ unsigned int latched_mods; /* latched modifiers */
+ unsigned int locked_mods; /* locked modifiers */
+ int compat_state; /* compatibility state */
+ unsigned char grab_mods; /* mods used for grabs */
+ unsigned char compat_grab_mods;/* grab mods for non-XKB clients */
+ unsigned char lookup_mods; /* mods sent to clients */
+ unsigned char compat_lookup_mods; /* mods sent to non-XKB clients */
+ int ptr_buttons; /* pointer button state */
+ KeyCode keycode; /* keycode that caused the change */
+ char event_type; /* KeyPress or KeyRelease */
+ char req_major; /* Major opcode of request */
+ char req_minor; /* Minor opcode of request */
+} XkbStateNotifyEvent;
+
+typedef struct _XkbControlsNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbControlsNotify */
+ int device; /* device ID */
+ unsigned int changed_ctrls; /* controls with changed sub-values */
+ unsigned int enabled_ctrls; /* controls currently enabled */
+ unsigned int enabled_ctrl_changes;/* controls just {en,dis}abled */
+ int num_groups; /* total groups on keyboard */
+ KeyCode keycode; /* key that caused change or 0 */
+ char event_type; /* type of event that caused change */
+ char req_major; /* if keycode==0, major and minor */
+ char req_minor; /* opcode of req that caused change */
+} XkbControlsNotifyEvent;
+
+typedef struct _XkbIndicatorNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbIndicatorNotify */
+ int device; /* device ID */
+ unsigned int changed; /* indicators with new state or map */
+ unsigned int state; /* current state of all indicators */
+} XkbIndicatorNotifyEvent;
+
+typedef struct _XkbNamesNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbNamesNotify */
+ int device; /* device ID */
+ unsigned int changed; /* names that have changed */
+ int first_type; /* first key type with new name */
+ int num_types; /* number of key types with new names */
+ int first_lvl; /* first key type new new level names */
+ int num_lvls; /* # of key types w/new level names */
+ int num_aliases; /* total number of key aliases*/
+ int num_radio_groups;/* total number of radio groups */
+ unsigned int changed_vmods; /* virtual modifiers with new names */
+ unsigned int changed_groups; /* groups with new names */
+ unsigned int changed_indicators;/* indicators with new names */
+ int first_key; /* first key with new name */
+ int num_keys; /* number of keys with new names */
+} XkbNamesNotifyEvent;
+
+typedef struct _XkbCompatMapNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbCompatMapNotify */
+ int device; /* device ID */
+ unsigned int changed_groups; /* groups with new compat maps */
+ int first_si; /* first new symbol interp */
+ int num_si; /* number of new symbol interps */
+ int num_total_si; /* total # of symbol interps */
+} XkbCompatMapNotifyEvent;
+
+typedef struct _XkbBellNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbBellNotify */
+ int device; /* device ID */
+ int percent; /* requested volume as a % of maximum */
+ int pitch; /* requested pitch in Hz */
+ int duration; /* requested duration in useconds */
+ int bell_class; /* (input extension) feedback class */
+ int bell_id; /* (input extension) ID of feedback */
+ Atom name; /* "name" of requested bell */
+ Window window; /* window associated with event */
+ Bool event_only; /* "event only" requested */
+} XkbBellNotifyEvent;
+
+typedef struct _XkbActionMessage {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbActionMessage */
+ int device; /* device ID */
+ KeyCode keycode; /* key that generated the event */
+ Bool press; /* true if act caused by key press */
+ Bool key_event_follows;/* true if key event also generated */
+ int group; /* effective group */
+ unsigned int mods; /* effective mods */
+ char message[XkbActionMessageLength+1];
+ /* message -- leave space for NUL */
+} XkbActionMessageEvent;
+
+typedef struct _XkbAccessXNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbAccessXNotify */
+ int device; /* device ID */
+ int detail; /* XkbAXN_* */
+ int keycode; /* key of event */
+ int sk_delay; /* current slow keys delay */
+ int debounce_delay; /* current debounce delay */
+} XkbAccessXNotifyEvent;
+
+typedef struct _XkbExtensionDeviceNotify {
+ int type; /* XkbAnyEvent */
+ unsigned long serial; /* of last req processed by server */
+ Bool send_event; /* is this from a SendEvent request? */
+ Display * display; /* Display the event was read from */
+ Time time; /* milliseconds */
+ int xkb_type; /* XkbExtensionDeviceNotify */
+ int device; /* device ID */
+ unsigned int reason; /* reason for the event */
+ unsigned int supported; /* mask of supported features */
+ unsigned int unsupported; /* mask of unsupported features */
+ /* that some app tried to use */
+ int first_btn; /* first button that changed */
+ int num_btns; /* range of buttons changed */
+ unsigned int leds_defined; /* indicators with names or maps */
+ unsigned int led_state; /* current state of the indicators */
+ int led_class; /* feedback class for led changes */
+ int led_id; /* feedback id for led changes */
+} XkbExtensionDeviceNotifyEvent;
+
+typedef union _XkbEvent {
+ int type;
+ XkbAnyEvent any;
+ XkbNewKeyboardNotifyEvent new_kbd;
+ XkbMapNotifyEvent map;
+ XkbStateNotifyEvent state;
+ XkbControlsNotifyEvent ctrls;
+ XkbIndicatorNotifyEvent indicators;
+ XkbNamesNotifyEvent names;
+ XkbCompatMapNotifyEvent compat;
+ XkbBellNotifyEvent bell;
+ XkbActionMessageEvent message;
+ XkbAccessXNotifyEvent accessx;
+ XkbExtensionDeviceNotifyEvent device;
+ XEvent core;
+} XkbEvent;
+
+typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr;
+
+ /* XkbOpenDisplay error codes */
+#define XkbOD_Success 0
+#define XkbOD_BadLibraryVersion 1
+#define XkbOD_ConnectionRefused 2
+#define XkbOD_NonXkbServer 3
+#define XkbOD_BadServerVersion 4
+
+ /* Values for XlibFlags */
+#define XkbLC_ForceLatin1Lookup (1<<0)
+#define XkbLC_ConsumeLookupMods (1<<1)
+#define XkbLC_AlwaysConsumeShiftAndLock (1<<2)
+#define XkbLC_IgnoreNewKeyboards (1<<3)
+#define XkbLC_ControlFallback (1<<4)
+#define XkbLC_ConsumeKeysOnComposeFail (1<<29)
+#define XkbLC_ComposeLED (1<<30)
+#define XkbLC_BeepOnComposeFail (1<<31)
+
+#define XkbLC_AllComposeControls (0xc0000000)
+#define XkbLC_AllControls (0xc000001f)
+
+_XFUNCPROTOBEGIN
+
+extern Bool XkbIgnoreExtension(
+ Bool /* ignore */
+);
+
+extern Display *XkbOpenDisplay(
+ char * /* name */,
+ int * /* ev_rtrn */,
+ int * /* err_rtrn */,
+ int * /* major_rtrn */,
+ int * /* minor_rtrn */,
+ int * /* reason */
+);
+
+extern Bool XkbQueryExtension(
+ Display * /* dpy */,
+ int * /* opcodeReturn */,
+ int * /* eventBaseReturn */,
+ int * /* errorBaseReturn */,
+ int * /* majorRtrn */,
+ int * /* minorRtrn */
+);
+
+extern Bool XkbUseExtension(
+ Display * /* dpy */,
+ int * /* major_rtrn */,
+ int * /* minor_rtrn */
+);
+
+extern Bool XkbLibraryVersion(
+ int * /* libMajorRtrn */,
+ int * /* libMinorRtrn */
+);
+
+extern unsigned int XkbSetXlibControls(
+ Display* /* dpy */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern unsigned int XkbGetXlibControls(
+ Display* /* dpy */
+);
+
+extern unsigned int XkbXlibControlsImplemented(void);
+
+typedef Atom (*XkbInternAtomFunc)(
+ Display * /* dpy */,
+ _Xconst char * /* name */,
+ Bool /* only_if_exists */
+);
+
+typedef char * (*XkbGetAtomNameFunc)(
+ Display * /* dpy */,
+ Atom /* atom */
+);
+
+extern void XkbSetAtomFuncs(
+ XkbInternAtomFunc /* getAtom */,
+ XkbGetAtomNameFunc /* getName */
+);
+
+extern KeySym XkbKeycodeToKeysym(
+ Display * /* dpy */,
+#if NeedWidePrototypes
+ unsigned int /* kc */,
+#else
+ KeyCode /* kc */,
+#endif
+ int /* group */,
+ int /* level */
+);
+
+extern unsigned int XkbKeysymToModifiers(
+ Display * /* dpy */,
+ KeySym /* ks */
+);
+
+extern Bool XkbLookupKeySym(
+ Display * /* dpy */,
+ KeyCode /* keycode */,
+ unsigned int /* modifiers */,
+ unsigned int * /* modifiers_return */,
+ KeySym * /* keysym_return */
+);
+
+extern int XkbLookupKeyBinding(
+ Display * /* dpy */,
+ KeySym /* sym_rtrn */,
+ unsigned int /* mods */,
+ char * /* buffer */,
+ int /* nbytes */,
+ int * /* extra_rtrn */
+);
+
+extern Bool XkbTranslateKeyCode(
+ XkbDescPtr /* xkb */,
+ KeyCode /* keycode */,
+ unsigned int /* modifiers */,
+ unsigned int * /* modifiers_return */,
+ KeySym * /* keysym_return */
+);
+
+extern int XkbTranslateKeySym(
+ Display * /* dpy */,
+ register KeySym * /* sym_return */,
+ unsigned int /* modifiers */,
+ char * /* buffer */,
+ int /* nbytes */,
+ int * /* extra_rtrn */
+);
+
+extern Bool XkbSetAutoRepeatRate(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* delay */,
+ unsigned int /* interval */
+);
+
+extern Bool XkbGetAutoRepeatRate(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int * /* delayRtrn */,
+ unsigned int * /* intervalRtrn */
+);
+
+extern Bool XkbChangeEnabledControls(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbDeviceBell(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbForceDeviceBell(
+ Display * /* dpy */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */
+);
+
+extern Bool XkbDeviceBellEvent(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* deviceSpec */,
+ int /* bellClass */,
+ int /* bellID */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbBell(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbForceBell(
+ Display * /* dpy */,
+ int /* percent */
+);
+
+extern Bool XkbBellEvent(
+ Display * /* dpy */,
+ Window /* win */,
+ int /* percent */,
+ Atom /* name */
+);
+
+extern Bool XkbSelectEvents(
+ Display * /* dpy */,
+ unsigned int /* deviceID */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbSelectEventDetails(
+ Display * /* dpy */,
+ unsigned int /* deviceID */,
+ unsigned int /* eventType */,
+ unsigned long /* affect */,
+ unsigned long /* details */
+);
+
+extern void XkbNoteMapChanges(
+ XkbMapChangesPtr /* old */,
+ XkbMapNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern void XkbNoteNameChanges(
+ XkbNameChangesPtr /* old */,
+ XkbNamesNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern Status XkbGetIndicatorState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int * /* pStateRtrn */
+);
+
+extern Status XkbGetDeviceIndicatorState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ unsigned int * /* pStateRtrn */
+);
+
+extern Status XkbGetIndicatorMap(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetIndicatorMap(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+#define XkbNoteIndicatorMapChanges(o,n,w) \
+ ((o)->map_changes|=((n)->map_changes&(w)))
+#define XkbNoteIndicatorStateChanges(o,n,w)\
+ ((o)->state_changes|=((n)->state_changes&(w)))
+#define XkbGetIndicatorMapChanges(d,x,c) \
+ (XkbGetIndicatorMap((d),(c)->map_changes,x))
+#define XkbChangeIndicatorMaps(d,x,c) \
+ (XkbSetIndicatorMap((d),(c)->map_changes,x))
+
+extern Bool XkbGetNamedIndicator(
+ Display * /* dpy */,
+ Atom /* name */,
+ int * /* pNdxRtrn */,
+ Bool * /* pStateRtrn */,
+ XkbIndicatorMapPtr /* pMapRtrn */,
+ Bool * /* pRealRtrn */
+);
+
+extern Bool XkbGetNamedDeviceIndicator(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ Atom /* name */,
+ int * /* pNdxRtrn */,
+ Bool * /* pStateRtrn */,
+ XkbIndicatorMapPtr /* pMapRtrn */,
+ Bool * /* pRealRtrn */
+);
+
+extern Bool XkbSetNamedIndicator(
+ Display * /* dpy */,
+ Atom /* name */,
+ Bool /* changeState */,
+ Bool /* state */,
+ Bool /* createNewMap */,
+ XkbIndicatorMapPtr /* pMap */
+);
+
+extern Bool XkbSetNamedDeviceIndicator(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ Atom /* name */,
+ Bool /* changeState */,
+ Bool /* state */,
+ Bool /* createNewMap */,
+ XkbIndicatorMapPtr /* pMap */
+);
+
+extern Bool XkbLockModifiers(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbLatchModifiers(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affect */,
+ unsigned int /* values */
+);
+
+extern Bool XkbLockGroup(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* group */
+);
+
+extern Bool XkbLatchGroup(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* group */
+);
+
+extern Bool XkbSetServerInternalMods(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affectReal */,
+ unsigned int /* realValues */,
+ unsigned int /* affectVirtual */,
+ unsigned int /* virtualValues */
+);
+
+extern Bool XkbSetIgnoreLockMods(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* affectReal */,
+ unsigned int /* realValues */,
+ unsigned int /* affectVirtual */,
+ unsigned int /* virtualValues */
+);
+
+
+extern Bool XkbVirtualModsToReal(
+ XkbDescPtr /* xkb */,
+ unsigned int /* virtual_mask */,
+ unsigned int * /* mask_rtrn */
+);
+
+extern Bool XkbComputeEffectiveMap(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned char * /* map_rtrn */
+);
+
+extern Status XkbInitCanonicalKeyTypes(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* keypadVMod */
+);
+
+extern XkbDescPtr XkbAllocKeyboard(
+ void
+);
+
+extern void XkbFreeKeyboard(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeDesc */
+);
+
+extern Status XkbAllocClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nTypes */
+);
+
+extern Status XkbAllocServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nActions */
+);
+
+extern void XkbFreeClientMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern void XkbFreeServerMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* what */,
+ Bool /* freeMap */
+);
+
+extern XkbKeyTypePtr XkbAddKeyType(
+ XkbDescPtr /* xkb */,
+ Atom /* name */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* num_lvls */
+);
+
+extern Status XkbAllocIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern void XkbFreeIndicatorMaps(
+ XkbDescPtr /* xkb */
+);
+
+extern XkbDescPtr XkbGetMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */
+);
+
+extern Status XkbGetUpdatedMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetMapChanges(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ XkbMapChangesPtr /* changes */
+);
+
+
+extern Status XkbRefreshKeyboardMapping(
+ XkbMapNotifyEvent * /* event */
+);
+
+extern Status XkbGetKeyTypes(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeySyms(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeyActions(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbGetKeyBehaviors(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetVirtualMods(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyExplicitComponents(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyModifierMap(
+ Display * /* dpy */,
+ unsigned int /* firstKey */,
+ unsigned int /* nKeys */,
+ XkbDescPtr /* desc */
+);
+
+extern Status XkbGetKeyVirtualModMap(
+ Display * /* dpy */,
+ unsigned int /* first */,
+ unsigned int /* num */,
+ XkbDescPtr /* xkb */
+);
+
+extern Status XkbAllocControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which*/
+);
+
+extern void XkbFreeControls(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status XkbGetControls(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetControls(
+ Display * /* dpy */,
+ unsigned long /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern void XkbNoteControlsChanges(
+ XkbControlsChangesPtr /* old */,
+ XkbControlsNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+#define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x)
+#define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x)
+
+extern Status XkbAllocCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ unsigned int /* nInterpret */
+);
+
+extern void XkbFreeCompatMap(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+extern Status XkbGetCompatMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* xkb */
+);
+
+extern Bool XkbSetCompatMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* xkb */,
+ Bool /* updateActions */
+);
+
+extern XkbSymInterpretPtr XkbAddSymInterpret(
+ XkbDescPtr /* xkb */,
+ XkbSymInterpretPtr /* si */,
+ Bool /* updateMap */,
+ XkbChangesPtr /* changes */
+);
+
+extern Status XkbAllocNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ int /* nTotalRG */,
+ int /* nTotalAliases */
+);
+
+extern Status XkbGetNames(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbSetNames(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* firstType */,
+ unsigned int /* nTypes */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbChangeNames(
+ Display * /* dpy */,
+ XkbDescPtr /* xkb */,
+ XkbNameChangesPtr /* changes */
+);
+
+extern void XkbFreeNames(
+ XkbDescPtr /* xkb */,
+ unsigned int /* which */,
+ Bool /* freeMap */
+);
+
+
+extern Status XkbGetState(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbStatePtr /* rtrnState */
+);
+
+extern Bool XkbSetMap(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDescPtr /* desc */
+);
+
+extern Bool XkbChangeMap(
+ Display* /* dpy */,
+ XkbDescPtr /* desc */,
+ XkbMapChangesPtr /* changes */
+);
+
+extern Bool XkbSetDetectableAutoRepeat(
+ Display * /* dpy */,
+ Bool /* detectable */,
+ Bool * /* supported */
+);
+
+extern Bool XkbGetDetectableAutoRepeat(
+ Display * /* dpy */,
+ Bool * /* supported */
+);
+
+extern Bool XkbSetAutoResetControls(
+ Display * /* dpy */,
+ unsigned int /* changes */,
+ unsigned int * /* auto_ctrls */,
+ unsigned int * /* auto_values */
+);
+
+extern Bool XkbGetAutoResetControls(
+ Display * /* dpy */,
+ unsigned int * /* auto_ctrls */,
+ unsigned int * /* auto_ctrl_values */
+);
+
+extern Bool XkbSetPerClientControls(
+ Display * /* dpy */,
+ unsigned int /* change */,
+ unsigned int * /* values */
+);
+
+extern Bool XkbGetPerClientControls(
+ Display * /* dpy */,
+ unsigned int * /* ctrls */
+);
+
+extern Status XkbCopyKeyType(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */
+);
+
+extern Status XkbCopyKeyTypes(
+ XkbKeyTypePtr /* from */,
+ XkbKeyTypePtr /* into */,
+ int /* num_types */
+);
+
+extern Status XkbResizeKeyType(
+ XkbDescPtr /* xkb */,
+ int /* type_ndx */,
+ int /* map_count */,
+ Bool /* want_preserve */,
+ int /* new_num_lvls */
+);
+
+extern KeySym *XkbResizeKeySyms(
+ XkbDescPtr /* desc */,
+ int /* forKey */,
+ int /* symsNeeded */
+);
+
+extern XkbAction *XkbResizeKeyActions(
+ XkbDescPtr /* desc */,
+ int /* forKey */,
+ int /* actsNeeded */
+);
+
+extern Status XkbChangeTypesOfKey(
+ XkbDescPtr /* xkb */,
+ int /* key */,
+ int /* num_groups */,
+ unsigned int /* groups */,
+ int * /* newTypes */,
+ XkbMapChangesPtr /* pChanges */
+);
+
+extern Status XkbChangeKeycodeRange(
+ XkbDescPtr /* xkb */,
+ int /* minKC */,
+ int /* maxKC */,
+ XkbChangesPtr /* changes */
+);
+
+/***====================================================================***/
+
+extern XkbComponentListPtr XkbListComponents(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbComponentNamesPtr /* ptrns */,
+ int * /* max_inout */
+);
+
+extern void XkbFreeComponentList(
+ XkbComponentListPtr /* list */
+);
+
+extern XkbDescPtr XkbGetKeyboard(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */
+);
+
+extern XkbDescPtr XkbGetKeyboardByName(
+ Display * /* dpy */,
+ unsigned int /* deviceSpec */,
+ XkbComponentNamesPtr /* names */,
+ unsigned int /* want */,
+ unsigned int /* need */,
+ Bool /* load */
+);
+
+/***====================================================================***/
+
+extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */
+ XkbDescPtr /* xkb */, /* keyboard device */
+ int /* map_width */, /* width of core KeySym array */
+ KeySym * /* core_syms */, /* always mapWidth symbols */
+ unsigned int /* protected */, /* explicit key types */
+ int * /* types_inout */, /* always four type indices */
+ KeySym * /* xkb_syms_rtrn */ /* must have enough space */
+);
+
+extern Bool XkbApplyCompatMapToKey( /* False only on error */
+ XkbDescPtr /* xkb */, /* keymap to be edited */
+ KeyCode /* key */, /* key to be updated */
+ XkbChangesPtr /* changes */ /* resulting changes to map */
+);
+
+extern Bool XkbUpdateMapFromCore( /* False only on error */
+ XkbDescPtr /* xkb */, /* XKB keyboard to be edited */
+ KeyCode /* first_key */, /* first changed key */
+ int /* num_keys */, /* number of changed keys */
+ int /* map_width */, /* width of core keymap */
+ KeySym * /* core_keysyms */, /* symbols from core keymap */
+ XkbChangesPtr /* changes */ /* resulting changes */
+);
+
+/***====================================================================***/
+
+extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledId */
+);
+
+extern Status XkbResizeDeviceButtonActions(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* newTotal */
+);
+
+extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
+ unsigned int /* deviceSpec */,
+ unsigned int /* nButtons */,
+ unsigned int /* szLeds */
+);
+
+extern void XkbFreeDeviceInfo(
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* which */,
+ Bool /* freeDevI */
+);
+
+extern void XkbNoteDeviceChanges(
+ XkbDeviceChangesPtr /* old */,
+ XkbExtensionDeviceNotifyEvent * /* new */,
+ unsigned int /* wanted */
+);
+
+extern XkbDeviceInfoPtr XkbGetDeviceInfo(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ unsigned int /* deviceSpec */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */
+);
+
+extern Status XkbGetDeviceInfoChanges(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ XkbDeviceChangesPtr /* changes */
+);
+
+extern Status XkbGetDeviceButtonActions(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ Bool /* all */,
+ unsigned int /* first */,
+ unsigned int /* nBtns */
+);
+
+extern Status XkbGetDeviceLedInfo(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass (class, XIDflt, XIAll) */,
+ unsigned int /* ledId (id, XIDflt, XIAll) */,
+ unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */
+);
+
+extern Bool XkbSetDeviceInfo(
+ Display * /* dpy */,
+ unsigned int /* which */,
+ XkbDeviceInfoPtr /* devi */
+);
+
+extern Bool XkbChangeDeviceInfo(
+ Display* /* dpy */,
+ XkbDeviceInfoPtr /* desc */,
+ XkbDeviceChangesPtr /* changes */
+);
+
+extern Bool XkbSetDeviceLedInfo(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* ledClass */,
+ unsigned int /* ledID */,
+ unsigned int /* which */
+);
+
+extern Bool XkbSetDeviceButtonActions(
+ Display * /* dpy */,
+ XkbDeviceInfoPtr /* devi */,
+ unsigned int /* first */,
+ unsigned int /* nBtns */
+);
+
+/***====================================================================***/
+
+extern char XkbToControl(
+ char /* c */
+);
+
+/***====================================================================***/
+
+extern Bool XkbSetDebuggingFlags(
+ Display * /* dpy */,
+ unsigned int /* mask */,
+ unsigned int /* flags */,
+ char * /* msg */,
+ unsigned int /* ctrls_mask */,
+ unsigned int /* ctrls */,
+ unsigned int * /* rtrn_flags */,
+ unsigned int * /* rtrn_ctrls */
+);
+
+extern Bool XkbApplyVirtualModChanges(
+ XkbDescPtr /* xkb */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+extern Bool XkbUpdateActionVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbAction * /* act */,
+ unsigned int /* changed */
+);
+
+extern void XkbUpdateKeyTypeVirtualMods(
+ XkbDescPtr /* xkb */,
+ XkbKeyTypePtr /* type */,
+ unsigned int /* changed */,
+ XkbChangesPtr /* changes */
+);
+
+_XFUNCPROTOEND
+
+#endif /* _X11_XKBLIB_H_ */
diff --git a/system/include/X11/Xfuncs.h b/system/include/X11/Xfuncs.h
new file mode 100644
index 00000000..2bcf991a
--- /dev/null
+++ b/system/include/X11/Xfuncs.h
@@ -0,0 +1,69 @@
+/*
+ *
+Copyright 1990, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ */
+
+#ifndef _XFUNCS_H_
+# define _XFUNCS_H_
+
+# include <X11/Xosdefs.h>
+
+/* the old Xfuncs.h, for pre-R6 */
+# if !(defined(XFree86LOADER) && defined(IN_MODULE))
+
+# ifdef X_USEBFUNCS
+void bcopy();
+void bzero();
+int bcmp();
+# else
+# if defined(SYSV) && !defined(__SCO__) && !defined(__sun) && !defined(__UNIXWARE__)
+# include <memory.h>
+void bcopy();
+# define bzero(b,len) memset(b, 0, len)
+# define bcmp(b1,b2,len) memcmp(b1, b2, len)
+# else
+# include <string.h>
+# if defined(__SCO__) || defined(__sun) || defined(__UNIXWARE__) || defined(__CYGWIN__)
+# include <strings.h>
+# endif
+# define _XFUNCS_H_INCLUDED_STRING_H
+# endif
+# endif /* X_USEBFUNCS */
+
+/* the new Xfuncs.h */
+
+/* the ANSI C way */
+# ifndef _XFUNCS_H_INCLUDED_STRING_H
+# include <string.h>
+# endif
+# undef bzero
+# define bzero(b,len) memset(b,0,len)
+
+# if defined WIN32 && defined __MINGW32__
+# define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
+# endif
+
+# endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
+
+#endif /* _XFUNCS_H_ */
diff --git a/system/include/X11/XlibConf.h b/system/include/X11/XlibConf.h
new file mode 100644
index 00000000..9f9b9403
--- /dev/null
+++ b/system/include/X11/XlibConf.h
@@ -0,0 +1,38 @@
+/* include/X11/XlibConf.h. Generated from XlibConf.h.in by configure. */
+/*
+ * Copyright © 2005 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _XLIBCONF_H_
+#define _XLIBCONF_H_
+/*
+ * This header file exports defines necessary to correctly
+ * use Xlibint.h both inside Xlib and by external libraries
+ * such as extensions.
+ */
+
+/* Threading support? */
+#define XTHREADS 1
+
+/* Use multi-threaded libc functions? */
+#define XUSE_MTSAFE_API 1
+
+#endif /* _XLIBCONF_H_ */
diff --git a/system/include/X11/Xlibint.h b/system/include/X11/Xlibint.h
new file mode 100644
index 00000000..d04e8fd1
--- /dev/null
+++ b/system/include/X11/Xlibint.h
@@ -0,0 +1,1387 @@
+
+/*
+
+Copyright 1984, 1985, 1987, 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifndef _X11_XLIBINT_H_
+#define _X11_XLIBINT_H_ 1
+
+/*
+ * Xlibint.h - Header definition and support file for the internal
+ * support routines used by the C subroutine interface
+ * library (Xlib) to the X Window System.
+ *
+ * Warning, there be dragons here....
+ */
+
+#include <X11/Xlib.h>
+#include <X11/Xproto.h> /* to declare xEvent */
+#include <X11/XlibConf.h> /* for configured options like XTHREADS */
+
+#ifdef WIN32
+#define _XFlush _XFlushIt
+#endif
+
+/*
+ * If your BytesReadable correctly detects broken connections, then
+ * you should NOT define XCONN_CHECK_FREQ.
+ */
+#ifndef XCONN_CHECK_FREQ
+#define XCONN_CHECK_FREQ 256
+#endif
+
+struct _XGC
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ GContext gid; /* protocol ID for graphics context */
+ Bool rects; /* boolean: TRUE if clipmask is list of rectangles */
+ Bool dashes; /* boolean: TRUE if dash-list is really a list */
+ unsigned long dirty;/* cache dirty bits */
+ XGCValues values; /* shadow structure of values */
+};
+
+struct _XDisplay
+{
+ XExtData *ext_data; /* hook for extension to hang data */
+ struct _XFreeFuncs *free_funcs; /* internal free functions */
+ int fd; /* Network socket. */
+ int conn_checker; /* ugly thing used by _XEventsQueued */
+ int proto_major_version;/* maj. version of server's X protocol */
+ int proto_minor_version;/* minor version of server's X protocol */
+ char *vendor; /* vendor of the server hardware */
+ XID resource_base; /* resource ID base */
+ XID resource_mask; /* resource ID mask bits */
+ XID resource_id; /* allocator current ID */
+ int resource_shift; /* allocator shift to correct bits */
+ XID (*resource_alloc)( /* allocator function */
+ struct _XDisplay*
+ );
+ int byte_order; /* screen byte order, LSBFirst, MSBFirst */
+ int bitmap_unit; /* padding and data requirements */
+ int bitmap_pad; /* padding requirements on bitmaps */
+ int bitmap_bit_order; /* LeastSignificant or MostSignificant */
+ int nformats; /* number of pixmap formats in list */
+ ScreenFormat *pixmap_format; /* pixmap format list */
+ int vnumber; /* Xlib's X protocol version number. */
+ int release; /* release of the server */
+ struct _XSQEvent *head, *tail; /* Input event queue. */
+ int qlen; /* Length of input event queue */
+ unsigned long last_request_read; /* seq number of last event read */
+ unsigned long request; /* sequence number of last request. */
+ char *last_req; /* beginning of last request, or dummy */
+ char *buffer; /* Output buffer starting address. */
+ char *bufptr; /* Output buffer index pointer. */
+ char *bufmax; /* Output buffer maximum+1 address. */
+ unsigned max_request_size; /* maximum number 32 bit words in request*/
+ struct _XrmHashBucketRec *db;
+ int (*synchandler)( /* Synchronization handler */
+ struct _XDisplay*
+ );
+ char *display_name; /* "host:display" string used on this connect*/
+ int default_screen; /* default screen for operations */
+ int nscreens; /* number of screens on this server*/
+ Screen *screens; /* pointer to list of screens */
+ unsigned long motion_buffer; /* size of motion buffer */
+ volatile unsigned long flags; /* internal connection flags */
+ int min_keycode; /* minimum defined keycode */
+ int max_keycode; /* maximum defined keycode */
+ KeySym *keysyms; /* This server's keysyms */
+ XModifierKeymap *modifiermap; /* This server's modifier keymap */
+ int keysyms_per_keycode;/* number of rows */
+ char *xdefaults; /* contents of defaults from server */
+ char *scratch_buffer; /* place to hang scratch buffer */
+ unsigned long scratch_length; /* length of scratch buffer */
+ int ext_number; /* extension number on this display */
+ struct _XExten *ext_procs; /* extensions initialized on this display */
+ /*
+ * the following can be fixed size, as the protocol defines how
+ * much address space is available.
+ * While this could be done using the extension vector, there
+ * may be MANY events processed, so a search through the extension
+ * list to find the right procedure for each event might be
+ * expensive if many extensions are being used.
+ */
+ Bool (*event_vec[128])( /* vector for wire to event */
+ Display * /* dpy */,
+ XEvent * /* re */,
+ xEvent * /* event */
+ );
+ Status (*wire_vec[128])( /* vector for event to wire */
+ Display * /* dpy */,
+ XEvent * /* re */,
+ xEvent * /* event */
+ );
+ KeySym lock_meaning; /* for XLookupString */
+ struct _XLockInfo *lock; /* multi-thread state, display lock */
+ struct _XInternalAsync *async_handlers; /* for internal async */
+ unsigned long bigreq_size; /* max size of big requests */
+ struct _XLockPtrs *lock_fns; /* pointers to threads functions */
+ void (*idlist_alloc)( /* XID list allocator function */
+ Display * /* dpy */,
+ XID * /* ids */,
+ int /* count */
+ );
+ /* things above this line should not move, for binary compatibility */
+ struct _XKeytrans *key_bindings; /* for XLookupString */
+ Font cursor_font; /* for XCreateFontCursor */
+ struct _XDisplayAtoms *atoms; /* for XInternAtom */
+ unsigned int mode_switch; /* keyboard group modifiers */
+ unsigned int num_lock; /* keyboard numlock modifiers */
+ struct _XContextDB *context_db; /* context database */
+ Bool (**error_vec)( /* vector for wire to error */
+ Display * /* display */,
+ XErrorEvent * /* he */,
+ xError * /* we */
+ );
+ /*
+ * Xcms information
+ */
+ struct {
+ XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */
+ XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */
+ XPointer perVisualIntensityMaps;
+ /* linked list of XcmsIntensityMap */
+ } cms;
+ struct _XIMFilter *im_filters;
+ struct _XSQEvent *qfree; /* unallocated event queue elements */
+ unsigned long next_event_serial_num; /* inserted into next queue elt */
+ struct _XExten *flushes; /* Flush hooks */
+ struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */
+ int im_fd_length; /* number of im_fd_info */
+ struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */
+ int watcher_count; /* number of conn_watchers */
+ XPointer filedes; /* struct pollfd cache for _XWaitForReadable */
+ int (*savedsynchandler)( /* user synchandler when Xlib usurps */
+ Display * /* dpy */
+ );
+ XID resource_max; /* allocator max ID */
+ int xcmisc_opcode; /* major opcode for XC-MISC */
+ struct _XkbInfoRec *xkb_info; /* XKB info */
+ struct _XtransConnInfo *trans_conn; /* transport connection object */
+ struct _X11XCBPrivate *xcb; /* XCB glue private data */
+
+ /* Generic event cookie handling */
+ unsigned int next_cookie; /* next event cookie */
+ /* vector for wire to generic event, index is (extension - 128) */
+ Bool (*generic_event_vec[128])(
+ Display * /* dpy */,
+ XGenericEventCookie * /* Xlib event */,
+ xEvent * /* wire event */);
+ /* vector for event copy, index is (extension - 128) */
+ Bool (*generic_event_copy_vec[128])(
+ Display * /* dpy */,
+ XGenericEventCookie * /* in */,
+ XGenericEventCookie * /* out*/);
+ void *cookiejar; /* cookie events returned but not claimed */
+};
+
+#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
+
+/*
+ * define the following if you want the Data macro to be a procedure instead
+ */
+#ifdef CRAY
+#define DataRoutineIsProcedure
+#endif /* CRAY */
+
+#ifndef _XEVENT_
+/*
+ * _QEvent datatype for use in input queueing.
+ */
+typedef struct _XSQEvent
+{
+ struct _XSQEvent *next;
+ XEvent event;
+ unsigned long qserial_num; /* so multi-threaded code can find new ones */
+} _XQEvent;
+#endif
+
+#include <X11/Xproto.h>
+#ifdef __sgi
+#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */
+#endif
+#include <errno.h>
+#define _XBCOPYFUNC _Xbcopy
+#include <X11/Xfuncs.h>
+#include <X11/Xosdefs.h>
+
+/* Utek leaves kernel macros around in include files (bleah) */
+#ifdef dirty
+#undef dirty
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+/*
+ * The following definitions can be used for locking requests in multi-threaded
+ * address spaces.
+ */
+#ifdef XTHREADS
+/* Author: Stephen Gildea, MIT X Consortium
+ *
+ * declarations for C Threads locking
+ */
+
+typedef struct _LockInfoRec *LockInfoPtr;
+
+/* interfaces for locking.c */
+struct _XLockPtrs {
+ /* used by all, including extensions; do not move */
+ void (*lock_display)(
+ Display *dpy
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char *file
+ , int line
+#endif
+ );
+ void (*unlock_display)(
+ Display *dpy
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char *file
+ , int line
+#endif
+ );
+};
+
+#if defined(WIN32) && !defined(_XLIBINT_)
+#define _XCreateMutex_fn (*_XCreateMutex_fn_p)
+#define _XFreeMutex_fn (*_XFreeMutex_fn_p)
+#define _XLockMutex_fn (*_XLockMutex_fn_p)
+#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p)
+#define _Xglobal_lock (*_Xglobal_lock_p)
+#endif
+
+/* in XlibInt.c */
+extern void (*_XCreateMutex_fn)(
+ LockInfoPtr /* lock */
+);
+extern void (*_XFreeMutex_fn)(
+ LockInfoPtr /* lock */
+);
+extern void (*_XLockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+);
+extern void (*_XUnlockMutex_fn)(
+ LockInfoPtr /* lock */
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+ , char * /* file */
+ , int /* line */
+#endif
+);
+
+extern LockInfoPtr _Xglobal_lock;
+
+#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
+#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__)
+#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__)
+#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__)
+#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__)
+#else
+/* used everywhere, so must be fast if not using threads */
+#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d)
+#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d)
+#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock)
+#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock)
+#endif
+#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock);
+#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock);
+
+#else /* XTHREADS */
+#define LockDisplay(dis)
+#define _XLockMutex(lock)
+#define _XUnlockMutex(lock)
+#define UnlockDisplay(dis)
+#define _XCreateMutex(lock)
+#define _XFreeMutex(lock)
+#endif
+
+#define Xfree(ptr) free((ptr))
+
+/*
+ * Note that some machines do not return a valid pointer for malloc(0), in
+ * which case we provide an alternate under the control of the
+ * define MALLOC_0_RETURNS_NULL. This is necessary because some
+ * Xlib code expects malloc(0) to return a valid pointer to storage.
+ */
+#if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__)
+
+# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))
+# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))
+# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))
+
+#else
+
+# define Xmalloc(size) malloc((size))
+# define Xrealloc(ptr, size) realloc((ptr), (size))
+# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))
+
+#endif
+
+#include <stddef.h>
+
+#define LOCKED 1
+#define UNLOCKED 0
+
+#ifndef BUFSIZE
+#define BUFSIZE 2048 /* X output buffer size. */
+#endif
+#ifndef PTSPERBATCH
+#define PTSPERBATCH 1024 /* point batching */
+#endif
+#ifndef WLNSPERBATCH
+#define WLNSPERBATCH 50 /* wide line batching */
+#endif
+#ifndef ZLNSPERBATCH
+#define ZLNSPERBATCH 1024 /* thin line batching */
+#endif
+#ifndef WRCTSPERBATCH
+#define WRCTSPERBATCH 10 /* wide line rectangle batching */
+#endif
+#ifndef ZRCTSPERBATCH
+#define ZRCTSPERBATCH 256 /* thin line rectangle batching */
+#endif
+#ifndef FRCTSPERBATCH
+#define FRCTSPERBATCH 256 /* filled rectangle batching */
+#endif
+#ifndef FARCSPERBATCH
+#define FARCSPERBATCH 256 /* filled arc batching */
+#endif
+#ifndef CURSORFONT
+#define CURSORFONT "cursor" /* standard cursor fonts */
+#endif
+
+/*
+ * Display flags
+ */
+#define XlibDisplayIOError (1L << 0)
+#define XlibDisplayClosing (1L << 1)
+#define XlibDisplayNoXkb (1L << 2)
+#define XlibDisplayPrivSync (1L << 3)
+#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */
+#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */
+#define XlibDisplayReply (1L << 5) /* in _XReply */
+#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */
+#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */
+
+/*
+ * X Protocol packetizing macros.
+ */
+
+/* Need to start requests on 64 bit word boundaries
+ * on a CRAY computer so add a NoOp (127) if needed.
+ * A character pointer on a CRAY computer will be non-zero
+ * after shifting right 61 bits of it is not pointing to
+ * a word boundary.
+ */
+#ifdef WORD64
+#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\
+ dpy->last_req = dpy->bufptr;\
+ *(dpy->bufptr) = X_NoOperation;\
+ *(dpy->bufptr+1) = 0;\
+ *(dpy->bufptr+2) = 0;\
+ *(dpy->bufptr+3) = 1;\
+ dpy->request++;\
+ dpy->bufptr += 4;\
+ }
+#else /* else does not require alignment on 64-bit boundaries */
+#define WORD64ALIGN
+#endif /* WORD64 */
+
+/**
+ * Return a len-sized request buffer for the request type. This function may
+ * flush the output queue.
+ *
+ * @param dpy The display connection
+ * @param type The request type
+ * @param len Length of the request in bytes
+ *
+ * @returns A pointer to the request buffer with a few default values
+ * initialized.
+ */
+extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
+
+/* GetReqSized is the same as GetReq but allows the caller to specify the
+ * size in bytes. 'sz' must be a multiple of 4! */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReqSized(name, sz, req) \
+ req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz)
+#else
+#define GetReqSized(name, sz, req) \
+ req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz)
+#endif
+
+
+/*
+ * GetReq - Get the next available X request packet in the buffer and
+ * return it.
+ *
+ * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
+ * "req" is the name of the request pointer.
+ *
+ */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReq(name, req) \
+ GetReqSized(name, SIZEOF(x##name##Req), req)
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#define GetReq(name, req) \
+ GetReqSized(name, SIZEOF(x/**/name/**/Req), req)
+#endif
+
+/* GetReqExtra is the same as GetReq, but allocates "n" additional
+ bytes after the request. "n" must be a multiple of 4! */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetReqExtra(name, n, req) \
+ GetReqSized(name, SIZEOF(x##name##Req) + n, req)
+#else
+#define GetReqExtra(name, n, req) \
+ GetReqSized(name, SIZEOF(x/**/name/**/Req) + n, req)
+#endif
+
+
+/*
+ * GetResReq is for those requests that have a resource ID
+ * (Window, Pixmap, GContext, etc.) as their single argument.
+ * "rid" is the name of the resource.
+ */
+
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetResReq(name, rid, req) \
+ req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \
+ req->id = (rid)
+#else
+#define GetResReq(name, rid, req) \
+ req = (xResourceReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xResourceReq)); \
+ req->id = (rid)
+#endif
+
+/*
+ * GetEmptyReq is for those requests that have no arguments
+ * at all.
+ */
+#if !defined(UNIXCPP) || defined(ANSICPP)
+#define GetEmptyReq(name, req) \
+ req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq))
+#else
+#define GetEmptyReq(name, req) \
+ req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq))
+#endif
+
+#ifdef WORD64
+#define MakeBigReq(req,n) \
+ { \
+ char _BRdat[4]; \
+ unsigned long _BRlen = req->length - 1; \
+ req->length = 0; \
+ memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memcpy(((char *)req) + 4, _BRdat, 4); \
+ Data32(dpy, (long *)&_BRdat, 4); \
+ }
+#else
+#ifdef LONG64
+#define MakeBigReq(req,n) \
+ { \
+ CARD64 _BRdat; \
+ CARD32 _BRlen = req->length - 1; \
+ req->length = 0; \
+ _BRdat = ((CARD32 *)req)[_BRlen]; \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ ((CARD32 *)req)[1] = _BRlen + n + 2; \
+ Data32(dpy, &_BRdat, 4); \
+ }
+#else
+#define MakeBigReq(req,n) \
+ { \
+ CARD32 _BRdat; \
+ CARD32 _BRlen = req->length - 1; \
+ req->length = 0; \
+ _BRdat = ((CARD32 *)req)[_BRlen]; \
+ memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ ((CARD32 *)req)[1] = _BRlen + n + 2; \
+ Data32(dpy, &_BRdat, 4); \
+ }
+#endif
+#endif
+
+#ifndef __clang_analyzer__
+#define SetReqLen(req,n,badlen) \
+ if ((req->length + n) > (unsigned)65535) { \
+ if (dpy->bigreq_size) { \
+ MakeBigReq(req,n) \
+ } else { \
+ n = badlen; \
+ req->length += n; \
+ } \
+ } else \
+ req->length += n
+#else
+#define SetReqLen(req,n,badlen) \
+ req->length += n
+#endif
+
+#define SyncHandle() \
+ if (dpy->synchandler) (*dpy->synchandler)(dpy)
+
+extern void _XFlushGCCache(Display *dpy, GC gc);
+#define FlushGC(dpy, gc) \
+ if ((gc)->dirty) _XFlushGCCache((dpy), (gc))
+/*
+ * Data - Place data in the buffer and pad the end to provide
+ * 32 bit word alignment. Transmit if the buffer fills.
+ *
+ * "dpy" is a pointer to a Display.
+ * "data" is a pinter to a data buffer.
+ * "len" is the length of the data buffer.
+ */
+#ifndef DataRoutineIsProcedure
+#define Data(dpy, data, len) {\
+ if (dpy->bufptr + (len) <= dpy->bufmax) {\
+ memcpy(dpy->bufptr, data, (int)len);\
+ dpy->bufptr += ((len) + 3) & ~3;\
+ } else\
+ _XSend(dpy, data, len);\
+ }
+#endif /* DataRoutineIsProcedure */
+
+
+/* Allocate bytes from the buffer. No padding is done, so if
+ * the length is not a multiple of 4, the caller must be
+ * careful to leave the buffer aligned after sending the
+ * current request.
+ *
+ * "type" is the type of the pointer being assigned to.
+ * "ptr" is the pointer being assigned to.
+ * "n" is the number of bytes to allocate.
+ *
+ * Example:
+ * xTextElt *elt;
+ * BufAlloc (xTextElt *, elt, nbytes)
+ */
+
+#define BufAlloc(type, ptr, n) \
+ if (dpy->bufptr + (n) > dpy->bufmax) \
+ _XFlush (dpy); \
+ ptr = (type) dpy->bufptr; \
+ memset(ptr, '\0', n); \
+ dpy->bufptr += (n);
+
+#ifdef WORD64
+#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len)
+#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
+#else
+#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len))
+#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len))
+#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len))
+#ifdef LONG64
+#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
+extern int _XData32(
+ Display *dpy,
+ register long *data,
+ unsigned len
+);
+extern void _XRead32(
+ Display *dpy,
+ register long *data,
+ long len
+);
+#else
+#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len))
+#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len))
+#endif
+#endif /* not WORD64 */
+
+#define PackData16(dpy,data,len) Data16 (dpy, data, len)
+#define PackData32(dpy,data,len) Data32 (dpy, data, len)
+
+/* Xlib manual is bogus */
+#define PackData(dpy,data,len) PackData16 (dpy, data, len)
+
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+
+#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
+ (((cs)->rbearing|(cs)->lbearing| \
+ (cs)->ascent|(cs)->descent) == 0))
+
+/*
+ * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit
+ * character. If the character is in the column and exists, then return the
+ * appropriate metrics (note that fonts with common per-character metrics will
+ * return min_bounds). If none of these hold true, try again with the default
+ * char.
+ */
+#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \
+{ \
+ cs = def; \
+ if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
+ if (fs->per_char == NULL) { \
+ cs = &fs->min_bounds; \
+ } else { \
+ cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
+ if (CI_NONEXISTCHAR(cs)) cs = def; \
+ } \
+ } \
+}
+
+#define CI_GET_DEFAULT_INFO_1D(fs,cs) \
+ CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs)
+
+
+
+/*
+ * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
+ * column. This is used for fonts that have more than row zero.
+ */
+#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \
+{ \
+ cs = def; \
+ if (row >= fs->min_byte1 && row <= fs->max_byte1 && \
+ col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
+ if (fs->per_char == NULL) { \
+ cs = &fs->min_bounds; \
+ } else { \
+ cs = &fs->per_char[((row - fs->min_byte1) * \
+ (fs->max_char_or_byte2 - \
+ fs->min_char_or_byte2 + 1)) + \
+ (col - fs->min_char_or_byte2)]; \
+ if (CI_NONEXISTCHAR(cs)) cs = def; \
+ } \
+ } \
+}
+
+#define CI_GET_DEFAULT_INFO_2D(fs,cs) \
+{ \
+ unsigned int r = (fs->default_char >> 8); \
+ unsigned int c = (fs->default_char & 0xff); \
+ CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \
+}
+
+
+#ifdef MUSTCOPY
+
+/* for when 32-bit alignment is not good enough */
+#define OneDataCard32(dpy,dstaddr,srcvar) \
+ { dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); }
+
+#else
+
+/* srcvar must be a variable for large architecture version */
+#define OneDataCard32(dpy,dstaddr,srcvar) \
+ { *(CARD32 *)(dstaddr) = (srcvar); }
+
+#endif /* MUSTCOPY */
+
+typedef struct _XInternalAsync {
+ struct _XInternalAsync *next;
+ /*
+ * handler arguments:
+ * rep is the generic reply that caused this handler
+ * to be invoked. It must also be passed to _XGetAsyncReply.
+ * buf and len are opaque values that must be passed to
+ * _XGetAsyncReply or _XGetAsyncData.
+ * data is the closure stored in this struct.
+ * The handler returns True iff it handled this reply.
+ */
+ Bool (*handler)(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ XPointer /* data */
+ );
+ XPointer data;
+} _XAsyncHandler;
+
+typedef struct _XAsyncEState {
+ unsigned long min_sequence_number;
+ unsigned long max_sequence_number;
+ unsigned char error_code;
+ unsigned char major_opcode;
+ unsigned short minor_opcode;
+ unsigned char last_error_received;
+ int error_count;
+} _XAsyncErrorState;
+
+extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler);
+#define DeqAsyncHandler(dpy,handler) { \
+ if (dpy->async_handlers == (handler)) \
+ dpy->async_handlers = (handler)->next; \
+ else \
+ _XDeqAsyncHandler(dpy, handler); \
+ }
+
+typedef void (*FreeFuncType) (
+ Display* /* display */
+);
+
+typedef int (*FreeModmapType) (
+ XModifierKeymap* /* modmap */
+);
+
+/*
+ * This structure is private to the library.
+ */
+typedef struct _XFreeFuncs {
+ FreeFuncType atoms; /* _XFreeAtomTable */
+ FreeModmapType modifiermap; /* XFreeModifiermap */
+ FreeFuncType key_bindings; /* _XFreeKeyBindings */
+ FreeFuncType context_db; /* _XFreeContextDB */
+ FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */
+ FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */
+ FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */
+ FreeFuncType im_filters; /* _XFreeIMFilters */
+ FreeFuncType xkb; /* _XkbFreeInfo */
+} _XFreeFuncRec;
+
+/* types for InitExt.c */
+typedef int (*CreateGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CopyGCType)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FlushGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FreeGCType) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CreateFontType) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*FreeFontType) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*CloseDisplayType) (
+ Display* /* display */,
+ XExtCodes* /* codes */
+);
+
+typedef int (*ErrorType) (
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+);
+
+typedef char* (*ErrorStringType) (
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+);
+
+typedef void (*PrintErrorType)(
+ Display* /* display */,
+ XErrorEvent* /* ev */,
+ void* /* fp */
+);
+
+typedef void (*BeforeFlushType)(
+ Display* /* display */,
+ XExtCodes* /* codes */,
+ _Xconst char* /* data */,
+ long /* len */
+);
+
+/*
+ * This structure is private to the library.
+ */
+typedef struct _XExten { /* private to extension mechanism */
+ struct _XExten *next; /* next in list */
+ XExtCodes codes; /* public information, all extension told */
+ CreateGCType create_GC; /* routine to call when GC created */
+ CopyGCType copy_GC; /* routine to call when GC copied */
+ FlushGCType flush_GC; /* routine to call when GC flushed */
+ FreeGCType free_GC; /* routine to call when GC freed */
+ CreateFontType create_Font; /* routine to call when Font created */
+ FreeFontType free_Font; /* routine to call when Font freed */
+ CloseDisplayType close_display; /* routine to call when connection closed */
+ ErrorType error; /* who to call when an error occurs */
+ ErrorStringType error_string; /* routine to supply error string */
+ char *name; /* name of this extension */
+ PrintErrorType error_values; /* routine to supply error values */
+ BeforeFlushType before_flush; /* routine to call when sending data */
+ struct _XExten *next_flush; /* next in list of those with flushes */
+} _XExtension;
+
+/* Temporary definition until we can depend on an xproto release with it */
+#ifdef _X_COLD
+# define _XLIB_COLD _X_COLD
+#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */
+# define _XLIB_COLD __attribute__((__cold__))
+#else
+# define _XLIB_COLD /* nothing */
+#endif
+
+/* extension hooks */
+
+#ifdef DataRoutineIsProcedure
+extern void Data(Display *dpy, char *data, long len);
+#endif
+extern int _XError(
+ Display* /* dpy */,
+ xError* /* rep */
+);
+extern int _XIOError(
+ Display* /* dpy */
+) _X_NORETURN;
+extern int (*_XIOErrorFunction)(
+ Display* /* dpy */
+);
+extern int (*_XErrorFunction)(
+ Display* /* dpy */,
+ XErrorEvent* /* error_event */
+);
+extern void _XEatData(
+ Display* /* dpy */,
+ unsigned long /* n */
+) _XLIB_COLD;
+#ifdef XLIB_WANT_XEATDATAWORDS
+extern void _XEatDataWords(
+ Display* /* dpy */,
+ unsigned long /* n */
+) _XLIB_COLD _X_HIDDEN;
+#endif
+#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */
+# pragma rarely_called(_XEatData, _XEatDataWords)
+#endif
+extern char *_XAllocScratch(
+ Display* /* dpy */,
+ unsigned long /* nbytes */
+);
+extern char *_XAllocTemp(
+ Display* /* dpy */,
+ unsigned long /* nbytes */
+);
+extern void _XFreeTemp(
+ Display* /* dpy */,
+ char* /* buf */,
+ unsigned long /* nbytes */
+);
+extern Visual *_XVIDtoVisual(
+ Display* /* dpy */,
+ VisualID /* id */
+);
+extern unsigned long _XSetLastRequestRead(
+ Display* /* dpy */,
+ xGenericReply* /* rep */
+);
+extern int _XGetHostname(
+ char* /* buf */,
+ int /* maxlen */
+);
+extern Screen *_XScreenOfWindow(
+ Display* /* dpy */,
+ Window /* w */
+);
+extern Bool _XAsyncErrorHandler(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ XPointer /* data */
+);
+extern char *_XGetAsyncReply(
+ Display* /* dpy */,
+ char* /* replbuf */,
+ xReply* /* rep */,
+ char* /* buf */,
+ int /* len */,
+ int /* extra */,
+ Bool /* discard */
+);
+extern void _XGetAsyncData(
+ Display* /* dpy */,
+ char * /* data */,
+ char * /* buf */,
+ int /* len */,
+ int /* skip */,
+ int /* datalen */,
+ int /* discardtotal */
+);
+extern void _XFlush(
+ Display* /* dpy */
+);
+extern int _XEventsQueued(
+ Display* /* dpy */,
+ int /* mode */
+);
+extern void _XReadEvents(
+ Display* /* dpy */
+);
+extern int _XRead(
+ Display* /* dpy */,
+ char* /* data */,
+ long /* size */
+);
+extern void _XReadPad(
+ Display* /* dpy */,
+ char* /* data */,
+ long /* size */
+);
+extern void _XSend(
+ Display* /* dpy */,
+ _Xconst char* /* data */,
+ long /* size */
+);
+extern Status _XReply(
+ Display* /* dpy */,
+ xReply* /* rep */,
+ int /* extra */,
+ Bool /* discard */
+);
+extern void _XEnq(
+ Display* /* dpy */,
+ xEvent* /* event */
+);
+extern void _XDeq(
+ Display* /* dpy */,
+ _XQEvent* /* prev */,
+ _XQEvent* /* qelt */
+);
+
+extern Bool _XUnknownWireEvent(
+ Display* /* dpy */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+
+extern Bool _XUnknownWireEventCookie(
+ Display* /* dpy */,
+ XGenericEventCookie* /* re */,
+ xEvent* /* event */
+);
+
+extern Bool _XUnknownCopyEventCookie(
+ Display* /* dpy */,
+ XGenericEventCookie* /* in */,
+ XGenericEventCookie* /* out */
+);
+
+extern Status _XUnknownNativeEvent(
+ Display* /* dpy */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+
+extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event);
+extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we);
+extern Bool _XPollfdCacheInit(Display *dpy);
+extern void _XPollfdCacheAdd(Display *dpy, int fd);
+extern void _XPollfdCacheDel(Display *dpy, int fd);
+extern XID _XAllocID(Display *dpy);
+extern void _XAllocIDs(Display *dpy, XID *ids, int count);
+
+extern int _XFreeExtData(
+ XExtData* /* extension */
+);
+
+extern int (*XESetCreateGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetCopyGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetFlushGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetFreeGC(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, GC, XExtCodes*
+);
+
+extern int (*XESetCreateFont(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XFontStruct*, XExtCodes*
+);
+
+extern int (*XESetFreeFont(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XFontStruct*, XExtCodes*
+);
+
+extern int (*XESetCloseDisplay(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ XExtCodes* /* codes */
+ ) /* proc */
+))(
+ Display*, XExtCodes*
+);
+
+extern int (*XESetError(
+ Display* /* display */,
+ int /* extension */,
+ int (*) (
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+ ) /* proc */
+))(
+ Display*, xError*, XExtCodes*, int*
+);
+
+extern char* (*XESetErrorString(
+ Display* /* display */,
+ int /* extension */,
+ char* (*) (
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+ ) /* proc */
+))(
+ Display*, int, XExtCodes*, char*, int
+);
+
+extern void (*XESetPrintErrorValues (
+ Display* /* display */,
+ int /* extension */,
+ void (*)(
+ Display* /* display */,
+ XErrorEvent* /* ev */,
+ void* /* fp */
+ ) /* proc */
+))(
+ Display*, XErrorEvent*, void*
+);
+
+extern Bool (*XESetWireToEvent(
+ Display* /* display */,
+ int /* event_number */,
+ Bool (*) (
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XEvent*, xEvent*
+);
+
+extern Bool (*XESetWireToEventCookie(
+ Display* /* display */,
+ int /* extension */,
+ Bool (*) (
+ Display* /* display */,
+ XGenericEventCookie* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XGenericEventCookie*, xEvent*
+);
+
+extern Bool (*XESetCopyEventCookie(
+ Display* /* display */,
+ int /* extension */,
+ Bool (*) (
+ Display* /* display */,
+ XGenericEventCookie* /* in */,
+ XGenericEventCookie* /* out */
+ ) /* proc */
+))(
+ Display*, XGenericEventCookie*, XGenericEventCookie*
+);
+
+
+extern Status (*XESetEventToWire(
+ Display* /* display */,
+ int /* event_number */,
+ Status (*) (
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+ ) /* proc */
+))(
+ Display*, XEvent*, xEvent*
+);
+
+extern Bool (*XESetWireToError(
+ Display* /* display */,
+ int /* error_number */,
+ Bool (*) (
+ Display* /* display */,
+ XErrorEvent* /* he */,
+ xError* /* we */
+ ) /* proc */
+))(
+ Display*, XErrorEvent*, xError*
+);
+
+extern void (*XESetBeforeFlush(
+ Display* /* display */,
+ int /* error_number */,
+ void (*) (
+ Display* /* display */,
+ XExtCodes* /* codes */,
+ _Xconst char* /* data */,
+ long /* len */
+ ) /* proc */
+))(
+ Display*, XExtCodes*, _Xconst char*, long
+);
+
+/* internal connections for IMs */
+
+typedef void (*_XInternalConnectionProc)(
+ Display* /* dpy */,
+ int /* fd */,
+ XPointer /* call_data */
+);
+
+
+extern Status _XRegisterInternalConnection(
+ Display* /* dpy */,
+ int /* fd */,
+ _XInternalConnectionProc /* callback */,
+ XPointer /* call_data */
+);
+
+extern void _XUnregisterInternalConnection(
+ Display* /* dpy */,
+ int /* fd */
+);
+
+extern void _XProcessInternalConnection(
+ Display* /* dpy */,
+ struct _XConnectionInfo* /* conn_info */
+);
+
+/* Display structure has pointers to these */
+
+struct _XConnectionInfo { /* info from _XRegisterInternalConnection */
+ int fd;
+ _XInternalConnectionProc read_callback;
+ XPointer call_data;
+ XPointer *watch_data; /* set/used by XConnectionWatchProc */
+ struct _XConnectionInfo *next;
+};
+
+struct _XConnWatchInfo { /* info from XAddConnectionWatch */
+ XConnectionWatchProc fn;
+ XPointer client_data;
+ struct _XConnWatchInfo *next;
+};
+
+#ifdef __UNIXOS2__
+extern char* __XOS2RedirRoot(
+ char*
+);
+#endif
+
+extern int _XTextHeight(
+ XFontStruct* /* font_struct */,
+ _Xconst char* /* string */,
+ int /* count */
+);
+
+extern int _XTextHeight16(
+ XFontStruct* /* font_struct */,
+ _Xconst XChar2b* /* string */,
+ int /* count */
+);
+
+#if defined(WIN32)
+
+extern int _XOpenFile(
+ _Xconst char* /* path */,
+ int /* flags */
+);
+
+extern int _XOpenFileMode(
+ _Xconst char* /* path */,
+ int /* flags */,
+ mode_t /* mode */
+);
+
+extern void* _XFopenFile(
+ _Xconst char* /* path */,
+ _Xconst char* /* mode */
+);
+
+extern int _XAccessFile(
+ _Xconst char* /* path */
+);
+#else
+#define _XOpenFile(path,flags) open(path,flags)
+#define _XOpenFileMode(path,flags,mode) open(path,flags,mode)
+#define _XFopenFile(path,mode) fopen(path,mode)
+#endif
+
+/* EvToWire.c */
+extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event);
+
+extern int _XF86LoadQueryLocaleFont(
+ Display* /* dpy */,
+ _Xconst char* /* name*/,
+ XFontStruct** /* xfp*/,
+ Font* /* fidp */
+);
+
+extern void _XProcessWindowAttributes (
+ register Display *dpy,
+ xChangeWindowAttributesReq *req,
+ register unsigned long valuemask,
+ register XSetWindowAttributes *attributes);
+
+extern int _XDefaultError(
+ Display *dpy,
+ XErrorEvent *event);
+
+extern int _XDefaultIOError(
+ Display *dpy);
+
+extern void _XSetClipRectangles (
+ register Display *dpy,
+ GC gc,
+ int clip_x_origin, int clip_y_origin,
+ XRectangle *rectangles,
+ int n,
+ int ordering);
+
+Status _XGetWindowAttributes(
+ register Display *dpy,
+ Window w,
+ XWindowAttributes *attr);
+
+int _XPutBackEvent (
+ register Display *dpy,
+ register XEvent *event);
+
+extern Bool _XIsEventCookie(
+ Display *dpy,
+ XEvent *ev);
+
+extern void _XFreeEventCookies(
+ Display *dpy);
+
+extern void _XStoreEventCookie(
+ Display *dpy,
+ XEvent *ev);
+
+extern Bool _XFetchEventCookie(
+ Display *dpy,
+ XGenericEventCookie *ev);
+
+extern Bool _XCopyEventCookie(
+ Display *dpy,
+ XGenericEventCookie *in,
+ XGenericEventCookie *out);
+
+/* lcFile.c */
+
+extern void xlocaledir(
+ char *buf,
+ int buf_len
+);
+
+_XFUNCPROTOEND
+
+#endif /* _X11_XLIBINT_H_ */
diff --git a/system/include/X11/Xmd.h b/system/include/X11/Xmd.h
new file mode 100644
index 00000000..f3868b36
--- /dev/null
+++ b/system/include/X11/Xmd.h
@@ -0,0 +1,185 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+#ifndef XMD_H
+# define XMD_H 1
+/*
+ * Xmd.h: MACHINE DEPENDENT DECLARATIONS.
+ */
+
+/*
+ * Special per-machine configuration flags.
+ */
+# if defined(__sun) && defined(__SVR4)
+# include <sys/isa_defs.h> /* Solaris: defines _LP64 if necessary */
+# endif
+
+# if defined (_LP64) || defined(__LP64__) || \
+ defined(__alpha) || defined(__alpha__) || \
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+ defined(__amd64__) || defined(amd64) || \
+ defined(__powerpc64__)
+# define LONG64 /* 32/64-bit architecture */
+# endif
+
+/*
+ * Stuff to handle large architecture machines; the constants were generated
+ * on a 32-bit machine and must correspond to the protocol.
+ */
+# ifdef WORD64
+# define MUSTCOPY
+# endif /* WORD64 */
+
+
+/*
+ * Definition of macro used to set constants for size of network structures;
+ * machines with preprocessors that can't handle all of the sz_ symbols
+ * can define this macro to be sizeof(x) if and only if their compiler doesn't
+ * pad out structures (esp. the xTextElt structure which contains only two
+ * one-byte fields). Network structures should always define sz_symbols.
+ *
+ * The sz_ prefix is used instead of something more descriptive so that the
+ * symbols are no more than 32 characters long (which causes problems for some
+ * compilers and preprocessors).
+ *
+ * The extra indirection is to get macro arguments to expand correctly before
+ * the concatenation, rather than afterward.
+ */
+# define _SIZEOF(x) sz_##x
+# define SIZEOF(x) _SIZEOF(x)
+
+/*
+ * Bitfield suffixes for the protocol structure elements, if you
+ * need them. Note that bitfields are not guaranteed to be signed
+ * (or even unsigned) according to ANSI C.
+ */
+# ifdef WORD64
+typedef long INT64;
+typedef unsigned long CARD64;
+# define B32 :32
+# define B16 :16
+# ifdef UNSIGNEDBITFIELDS
+typedef unsigned int INT32;
+typedef unsigned int INT16;
+# else
+typedef signed int INT32;
+typedef signed int INT16;
+# endif
+# else
+# define B32
+# define B16
+# ifdef LONG64
+typedef long INT64;
+typedef int INT32;
+# else
+typedef long INT32;
+# endif
+typedef short INT16;
+# endif
+
+typedef signed char INT8;
+
+# ifdef LONG64
+typedef unsigned long CARD64;
+typedef unsigned int CARD32;
+# else
+typedef unsigned long CARD32;
+# endif
+# if !defined(WORD64) && !defined(LONG64)
+typedef unsigned long long CARD64;
+# endif
+typedef unsigned short CARD16;
+typedef unsigned char CARD8;
+
+typedef CARD32 BITS32;
+typedef CARD16 BITS16;
+
+typedef CARD8 BYTE;
+typedef CARD8 BOOL;
+
+/*
+ * definitions for sign-extending bitfields on 64-bit architectures
+ */
+# if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+# define cvtINT8toInt(val) (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
+# define cvtINT16toInt(val) (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
+# define cvtINT32toInt(val) (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
+# define cvtINT8toShort(val) cvtINT8toInt(val)
+# define cvtINT16toShort(val) cvtINT16toInt(val)
+# define cvtINT32toShort(val) cvtINT32toInt(val)
+# define cvtINT8toLong(val) cvtINT8toInt(val)
+# define cvtINT16toLong(val) cvtINT16toInt(val)
+# define cvtINT32toLong(val) cvtINT32toInt(val)
+# else
+# define cvtINT8toInt(val) (val)
+# define cvtINT16toInt(val) (val)
+# define cvtINT32toInt(val) (val)
+# define cvtINT8toShort(val) (val)
+# define cvtINT16toShort(val) (val)
+# define cvtINT32toShort(val) (val)
+# define cvtINT8toLong(val) (val)
+# define cvtINT16toLong(val) (val)
+# define cvtINT32toLong(val) (val)
+# endif /* WORD64 and UNSIGNEDBITFIELDS */
+
+
+
+# ifdef MUSTCOPY
+/*
+ * This macro must not cast or else pointers will get aligned and be wrong
+ */
+# define NEXTPTR(p,t) (((char *) p) + SIZEOF(t))
+# else /* else not MUSTCOPY, this is used for 32-bit machines */
+/*
+ * this version should leave result of type (t *), but that should only be
+ * used when not in MUSTCOPY
+ */
+# define NEXTPTR(p,t) (((t *)(p)) + 1)
+# endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
+
+#endif /* XMD_H */
diff --git a/system/include/X11/Xproto.h b/system/include/X11/Xproto.h
new file mode 100644
index 00000000..495d4419
--- /dev/null
+++ b/system/include/X11/Xproto.h
@@ -0,0 +1,2157 @@
+/* Definitions for the X window system used by server and c bindings */
+
+/*
+ * This packet-construction scheme makes the following assumptions:
+ *
+ * 1. The compiler is able
+ * to generate code which addresses one- and two-byte quantities.
+ * In the worst case, this would be done with bit-fields. If bit-fields
+ * are used it may be necessary to reorder the request fields in this file,
+ * depending on the order in which the machine assigns bit fields to
+ * machine words. There may also be a problem with sign extension,
+ * as K+R specify that bitfields are always unsigned.
+ *
+ * 2. 2- and 4-byte fields in packet structures must be ordered by hand
+ * such that they are naturally-aligned, so that no compiler will ever
+ * insert padding bytes.
+ *
+ * 3. All packets are hand-padded to a multiple of 4 bytes, for
+ * the same reason.
+ */
+
+#ifndef XPROTO_H
+#define XPROTO_H
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#include <X11/Xmd.h>
+#include <X11/Xprotostr.h>
+
+/*
+ * Define constants for the sizes of the network packets. The sz_ prefix is
+ * used instead of something more descriptive so that the symbols are no more
+ * than 32 characters in length (which causes problems for some compilers).
+ */
+#define sz_xSegment 8
+#define sz_xPoint 4
+#define sz_xRectangle 8
+#define sz_xArc 12
+#define sz_xConnClientPrefix 12
+#define sz_xConnSetupPrefix 8
+#define sz_xConnSetup 32
+#define sz_xPixmapFormat 8
+#define sz_xDepth 8
+#define sz_xVisualType 24
+#define sz_xWindowRoot 40
+#define sz_xTimecoord 8
+#define sz_xHostEntry 4
+#define sz_xCharInfo 12
+#define sz_xFontProp 8
+#define sz_xTextElt 2
+#define sz_xColorItem 12
+#define sz_xrgb 8
+#define sz_xGenericReply 32
+#define sz_xGetWindowAttributesReply 44
+#define sz_xGetGeometryReply 32
+#define sz_xQueryTreeReply 32
+#define sz_xInternAtomReply 32
+#define sz_xGetAtomNameReply 32
+#define sz_xGetPropertyReply 32
+#define sz_xListPropertiesReply 32
+#define sz_xGetSelectionOwnerReply 32
+#define sz_xGrabPointerReply 32
+#define sz_xQueryPointerReply 32
+#define sz_xGetMotionEventsReply 32
+#define sz_xTranslateCoordsReply 32
+#define sz_xGetInputFocusReply 32
+#define sz_xQueryKeymapReply 40
+#define sz_xQueryFontReply 60
+#define sz_xQueryTextExtentsReply 32
+#define sz_xListFontsReply 32
+#define sz_xGetFontPathReply 32
+#define sz_xGetImageReply 32
+#define sz_xListInstalledColormapsReply 32
+#define sz_xAllocColorReply 32
+#define sz_xAllocNamedColorReply 32
+#define sz_xAllocColorCellsReply 32
+#define sz_xAllocColorPlanesReply 32
+#define sz_xQueryColorsReply 32
+#define sz_xLookupColorReply 32
+#define sz_xQueryBestSizeReply 32
+#define sz_xQueryExtensionReply 32
+#define sz_xListExtensionsReply 32
+#define sz_xSetMappingReply 32
+#define sz_xGetKeyboardControlReply 52
+#define sz_xGetPointerControlReply 32
+#define sz_xGetScreenSaverReply 32
+#define sz_xListHostsReply 32
+#define sz_xSetModifierMappingReply 32
+#define sz_xError 32
+#define sz_xEvent 32
+#define sz_xKeymapEvent 32
+#define sz_xReq 4
+#define sz_xResourceReq 8
+#define sz_xCreateWindowReq 32
+#define sz_xChangeWindowAttributesReq 12
+#define sz_xChangeSaveSetReq 8
+#define sz_xReparentWindowReq 16
+#define sz_xConfigureWindowReq 12
+#define sz_xCirculateWindowReq 8
+#define sz_xInternAtomReq 8
+#define sz_xChangePropertyReq 24
+#define sz_xDeletePropertyReq 12
+#define sz_xGetPropertyReq 24
+#define sz_xSetSelectionOwnerReq 16
+#define sz_xConvertSelectionReq 24
+#define sz_xSendEventReq 44
+#define sz_xGrabPointerReq 24
+#define sz_xGrabButtonReq 24
+#define sz_xUngrabButtonReq 12
+#define sz_xChangeActivePointerGrabReq 16
+#define sz_xGrabKeyboardReq 16
+#define sz_xGrabKeyReq 16
+#define sz_xUngrabKeyReq 12
+#define sz_xAllowEventsReq 8
+#define sz_xGetMotionEventsReq 16
+#define sz_xTranslateCoordsReq 16
+#define sz_xWarpPointerReq 24
+#define sz_xSetInputFocusReq 12
+#define sz_xOpenFontReq 12
+#define sz_xQueryTextExtentsReq 8
+#define sz_xListFontsReq 8
+#define sz_xSetFontPathReq 8
+#define sz_xCreatePixmapReq 16
+#define sz_xCreateGCReq 16
+#define sz_xChangeGCReq 12
+#define sz_xCopyGCReq 16
+#define sz_xSetDashesReq 12
+#define sz_xSetClipRectanglesReq 12
+#define sz_xCopyAreaReq 28
+#define sz_xCopyPlaneReq 32
+#define sz_xPolyPointReq 12
+#define sz_xPolySegmentReq 12
+#define sz_xFillPolyReq 16
+#define sz_xPutImageReq 24
+#define sz_xGetImageReq 20
+#define sz_xPolyTextReq 16
+#define sz_xImageTextReq 16
+#define sz_xCreateColormapReq 16
+#define sz_xCopyColormapAndFreeReq 12
+#define sz_xAllocColorReq 16
+#define sz_xAllocNamedColorReq 12
+#define sz_xAllocColorCellsReq 12
+#define sz_xAllocColorPlanesReq 16
+#define sz_xFreeColorsReq 12
+#define sz_xStoreColorsReq 8
+#define sz_xStoreNamedColorReq 16
+#define sz_xQueryColorsReq 8
+#define sz_xLookupColorReq 12
+#define sz_xCreateCursorReq 32
+#define sz_xCreateGlyphCursorReq 32
+#define sz_xRecolorCursorReq 20
+#define sz_xQueryBestSizeReq 12
+#define sz_xQueryExtensionReq 8
+#define sz_xChangeKeyboardControlReq 8
+#define sz_xBellReq 4
+#define sz_xChangePointerControlReq 12
+#define sz_xSetScreenSaverReq 12
+#define sz_xChangeHostsReq 8
+#define sz_xListHostsReq 4
+#define sz_xChangeModeReq 4
+#define sz_xRotatePropertiesReq 12
+#define sz_xReply 32
+#define sz_xGrabKeyboardReply 32
+#define sz_xListFontsWithInfoReply 60
+#define sz_xSetPointerMappingReply 32
+#define sz_xGetKeyboardMappingReply 32
+#define sz_xGetPointerMappingReply 32
+#define sz_xGetModifierMappingReply 32
+#define sz_xListFontsWithInfoReq 8
+#define sz_xPolyLineReq 12
+#define sz_xPolyArcReq 12
+#define sz_xPolyRectangleReq 12
+#define sz_xPolyFillRectangleReq 12
+#define sz_xPolyFillArcReq 12
+#define sz_xPolyText8Req 16
+#define sz_xPolyText16Req 16
+#define sz_xImageText8Req 16
+#define sz_xImageText16Req 16
+#define sz_xSetPointerMappingReq 4
+#define sz_xForceScreenSaverReq 4
+#define sz_xSetCloseDownModeReq 4
+#define sz_xClearAreaReq 16
+#define sz_xSetAccessControlReq 4
+#define sz_xGetKeyboardMappingReq 8
+#define sz_xSetModifierMappingReq 4
+#define sz_xPropIconSize 24
+#define sz_xChangeKeyboardMappingReq 8
+
+
+/* For the purpose of the structure definitions in this file,
+we must redefine the following types in terms of Xmd.h's types, which may
+include bit fields. All of these are #undef'd at the end of this file,
+restoring the definitions in X.h. */
+
+#define Window CARD32
+#define Drawable CARD32
+#define Font CARD32
+#define Pixmap CARD32
+#define Cursor CARD32
+#define Colormap CARD32
+#define GContext CARD32
+#define Atom CARD32
+#define VisualID CARD32
+#define Time CARD32
+#define KeyCode CARD8
+#define KeySym CARD32
+
+#define X_TCP_PORT 6000 /* add display number */
+
+#define xTrue 1
+#define xFalse 0
+
+
+typedef CARD16 KeyButMask;
+
+/*****************
+ connection setup structure. This is followed by
+ numRoots xWindowRoot structs.
+*****************/
+
+typedef struct {
+ CARD8 byteOrder;
+ BYTE pad;
+ CARD16 majorVersion B16, minorVersion B16;
+ CARD16 nbytesAuthProto B16; /* Authorization protocol */
+ CARD16 nbytesAuthString B16; /* Authorization string */
+ CARD16 pad2 B16;
+} xConnClientPrefix;
+
+typedef struct {
+ CARD8 success;
+ BYTE lengthReason; /*num bytes in string following if failure */
+ CARD16 majorVersion B16,
+ minorVersion B16;
+ CARD16 length B16; /* 1/4 additional bytes in setup info */
+} xConnSetupPrefix;
+
+
+typedef struct {
+ CARD32 release B32;
+ CARD32 ridBase B32,
+ ridMask B32;
+ CARD32 motionBufferSize B32;
+ CARD16 nbytesVendor B16; /* number of bytes in vendor string */
+ CARD16 maxRequestSize B16;
+ CARD8 numRoots; /* number of roots structs to follow */
+ CARD8 numFormats; /* number of pixmap formats */
+ CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
+ CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
+ CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
+ bitmapScanlinePad; /* 8, 16, 32 */
+ KeyCode minKeyCode, maxKeyCode;
+ CARD32 pad2 B32;
+} xConnSetup;
+
+typedef struct {
+ CARD8 depth;
+ CARD8 bitsPerPixel;
+ CARD8 scanLinePad;
+ CARD8 pad1;
+ CARD32 pad2 B32;
+} xPixmapFormat;
+
+/* window root */
+
+typedef struct {
+ CARD8 depth;
+ CARD8 pad1;
+ CARD16 nVisuals B16; /* number of xVisualType structures following */
+ CARD32 pad2 B32;
+ } xDepth;
+
+typedef struct {
+ VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 bitsPerRGB;
+ CARD16 colormapEntries B16;
+ CARD32 redMask B32, greenMask B32, blueMask B32;
+ CARD32 pad B32;
+ } xVisualType;
+
+typedef struct {
+ Window windowId B32;
+ Colormap defaultColormap B32;
+ CARD32 whitePixel B32, blackPixel B32;
+ CARD32 currentInputMask B32;
+ CARD16 pixWidth B16, pixHeight B16;
+ CARD16 mmWidth B16, mmHeight B16;
+ CARD16 minInstalledMaps B16, maxInstalledMaps B16;
+ VisualID rootVisualID B32;
+ CARD8 backingStore;
+ BOOL saveUnders;
+ CARD8 rootDepth;
+ CARD8 nDepths; /* number of xDepth structures following */
+} xWindowRoot;
+
+
+/*****************************************************************
+ * Structure Defns
+ * Structures needed for replies
+ *****************************************************************/
+
+/* Used in GetMotionEvents */
+
+typedef struct {
+ CARD32 time B32;
+ INT16 x B16, y B16;
+} xTimecoord;
+
+typedef struct {
+ CARD8 family;
+ BYTE pad;
+ CARD16 length B16;
+} xHostEntry;
+
+typedef struct {
+ INT16 leftSideBearing B16,
+ rightSideBearing B16,
+ characterWidth B16,
+ ascent B16,
+ descent B16;
+ CARD16 attributes B16;
+} xCharInfo;
+
+typedef struct {
+ Atom name B32;
+ CARD32 value B32;
+} xFontProp;
+
+/*
+ * non-aligned big-endian font ID follows this struct
+ */
+typedef struct { /* followed by string */
+ CARD8 len; /* number of *characters* in string, or FontChange (255)
+ for font change, or 0 if just delta given */
+ INT8 delta;
+} xTextElt;
+
+
+typedef struct {
+ CARD32 pixel B32;
+ CARD16 red B16, green B16, blue B16;
+ CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
+ CARD8 pad;
+} xColorItem;
+
+
+typedef struct {
+ CARD16 red B16, green B16, blue B16, pad B16;
+} xrgb;
+
+typedef CARD8 KEYCODE;
+
+
+/*****************
+ * XRep:
+ * meant to be 32 byte quantity
+ *****************/
+
+/* GenericReply is the common format of all replies. The "data" items
+ are specific to each individual reply type. */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE data1; /* depends on reply type */
+ CARD16 sequenceNumber B16; /* of last request received by server */
+ CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
+ CARD32 data00 B32;
+ CARD32 data01 B32;
+ CARD32 data02 B32;
+ CARD32 data03 B32;
+ CARD32 data04 B32;
+ CARD32 data05 B32;
+ } xGenericReply;
+
+/* Individual reply formats. */
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 backingStore;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* NOT 0; this is an extra-large reply */
+ VisualID visualID B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ CARD8 bitGravity;
+ CARD8 winGravity;
+ CARD32 backingBitPlanes B32;
+ CARD32 backingPixel B32;
+ BOOL saveUnder;
+ BOOL mapInstalled;
+ CARD8 mapState;
+ BOOL override;
+ Colormap colormap B32;
+ CARD32 allEventMasks B32;
+ CARD32 yourEventMask B32;
+ CARD16 doNotPropagateMask B16;
+ CARD16 pad B16;
+ } xGetWindowAttributesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window root B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD16 borderWidth B16;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xGetGeometryReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ Window root B32, parent B32;
+ CARD16 nChildren B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xQueryTreeReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Atom atom B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xInternAtomReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* of additional bytes */
+ CARD16 nameLength B16; /* # of characters in name */
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetAtomNameReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 format;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* of additional bytes */
+ Atom propertyType B32;
+ CARD32 bytesAfter B32;
+ CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xGetPropertyReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nProperties B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListPropertiesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window owner B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetSelectionOwnerReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE status;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGrabPointerReply;
+
+typedef xGrabPointerReply xGrabKeyboardReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL sameScreen;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window root B32, child B32;
+ INT16 rootX B16, rootY B16, winX B16, winY B16;
+ CARD16 mask B16;
+ CARD16 pad1 B16;
+ CARD32 pad B32;
+ } xQueryPointerReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nEvents B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetMotionEventsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL sameScreen;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window child B32;
+ INT16 dstX B16, dstY B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xTranslateCoordsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 revertTo;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ Window focus B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xGetInputFocusReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */
+ BYTE map[32];
+ } xQueryKeymapReply;
+
+/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
+typedef struct _xQueryFontReply {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
+ xCharInfo minBounds;
+#ifndef WORD64
+ CARD32 walign1 B32;
+#endif
+ xCharInfo maxBounds;
+#ifndef WORD64
+ CARD32 walign2 B32;
+#endif
+ CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+ CARD16 defaultChar B16;
+ CARD16 nFontProps B16; /* followed by this many xFontProp structures */
+ CARD8 drawDirection;
+ CARD8 minByte1, maxByte1;
+ BOOL allCharsExist;
+ INT16 fontAscent B16, fontDescent B16;
+ CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
+} xQueryFontReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 drawDirection;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ INT16 fontAscent B16, fontDescent B16;
+ INT16 overallAscent B16, overallDescent B16;
+ INT32 overallWidth B32, overallLeft B32, overallRight B32;
+ CARD32 pad B32;
+ } xQueryTextExtentsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nFonts B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListFontsReply;
+
+/* Warning: this MUST match (up to component renaming) xQueryFontReply */
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nameLength; /* 0 indicates end-of-reply-sequence */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
+ xCharInfo minBounds;
+#ifndef WORD64
+ CARD32 walign1 B32;
+#endif
+ xCharInfo maxBounds;
+#ifndef WORD64
+ CARD32 walign2 B32;
+#endif
+ CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
+ CARD16 defaultChar B16;
+ CARD16 nFontProps B16; /* followed by this many xFontProp structures */
+ CARD8 drawDirection;
+ CARD8 minByte1, maxByte1;
+ BOOL allCharsExist;
+ INT16 fontAscent B16, fontDescent B16;
+ CARD32 nReplies B32; /* hint as to how many more replies might be coming */
+} xListFontsWithInfoReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPaths B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetFontPathReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 depth;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ VisualID visual B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetImageReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nColormaps B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListInstalledColormapsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 red B16, green B16, blue B16;
+ CARD16 pad2 B16;
+ CARD32 pixel B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xAllocColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD32 pixel B32;
+ CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+ CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ } xAllocNamedColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPixels B16, nMasks B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xAllocColorCellsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nPixels B16;
+ CARD16 pad2 B16;
+ CARD32 redMask B32, greenMask B32, blueMask B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ } xAllocColorPlanesReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nColors B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryColorsReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 exactRed B16, exactGreen B16, exactBlue B16;
+ CARD16 screenRed B16, screenGreen B16, screenBlue B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ } xLookupColorReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 width B16, height B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryBestSizeReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ BOOL present;
+ CARD8 major_opcode;
+ CARD8 first_event;
+ CARD8 first_error;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xQueryExtensionReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nExtensions;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListExtensionsReply;
+
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 success;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xSetMappingReply;
+typedef xSetMappingReply xSetPointerMappingReply;
+typedef xSetMappingReply xSetModifierMappingReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ CARD8 nElts; /* how many elements does the map have */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xGetPointerMappingReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 keySymsPerKeyCode;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGetKeyboardMappingReply;
+
+typedef struct {
+ BYTE type;
+ CARD8 numKeyPerModifier;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 pad1 B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetModifierMappingReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL globalAutoRepeat;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 5 */
+ CARD32 ledMask B32;
+ CARD8 keyClickPercent, bellPercent;
+ CARD16 bellPitch B16, bellDuration B16;
+ CARD16 pad B16;
+ BYTE map[32]; /* bit masks start here */
+ } xGetKeyboardControlReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 accelNumerator B16, accelDenominator B16;
+ CARD16 threshold B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetPointerControlReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD16 timeout B16, interval B16;
+ BOOL preferBlanking;
+ BOOL allowExposures;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ } xGetScreenSaverReply;
+
+typedef struct {
+ BYTE type; /* X_Reply */
+ BOOL enabled;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 nHosts B16;
+ CARD16 pad1 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+ } xListHostsReply;
+
+
+
+
+/*****************************************************************
+ * Xerror
+ * All errors are 32 bytes
+ *****************************************************************/
+
+typedef struct {
+ BYTE type; /* X_Error */
+ BYTE errorCode;
+ CARD16 sequenceNumber B16; /* the nth request from this client */
+ CARD32 resourceID B32;
+ CARD16 minorCode B16;
+ CARD8 majorCode;
+ BYTE pad1;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xError;
+
+/*****************************************************************
+ * xEvent
+ * All events are 32 bytes
+ *****************************************************************/
+
+typedef struct _xEvent {
+ union {
+ struct {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ } u;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BOOL sameScreen;
+ BYTE pad1;
+ } keyButtonPointer;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window root B32, event B32, child B32;
+ INT16 rootX B16, rootY B16, eventX B16, eventY B16;
+ KeyButMask state B16;
+ BYTE mode; /* really XMode */
+ BYTE flags; /* sameScreen and focus booleans, packed together */
+#define ELFlagFocus (1<<0)
+#define ELFlagSameScreen (1<<1)
+ } enterLeave;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ BYTE mode; /* really XMode */
+ BYTE pad1, pad2, pad3;
+ } focus;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD16 x B16, y B16, width B16, height B16;
+ CARD16 count B16;
+ CARD16 pad2 B16;
+ } expose;
+ struct {
+ CARD32 pad00 B32;
+ Drawable drawable B32;
+ CARD16 x B16, y B16, width B16, height B16;
+ CARD16 minorEvent B16;
+ CARD16 count B16;
+ BYTE majorEvent;
+ BYTE pad1, pad2, pad3;
+ } graphicsExposure;
+ struct {
+ CARD32 pad00 B32;
+ Drawable drawable B32;
+ CARD16 minorEvent B16;
+ BYTE majorEvent;
+ BYTE bpad;
+ } noExposure;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD8 state;
+ BYTE pad1, pad2, pad3;
+ } visibility;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ BOOL override;
+ BYTE bpad;
+ } createNotify;
+/*
+ * The event fields in the structures for DestroyNotify, UnmapNotify,
+ * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
+ * must be at the same offset because server internal code is depending upon
+ * this to patch up the events before they are delivered.
+ * Also note that MapRequest, ConfigureRequest and CirculateRequest have
+ * the same offset for the event window.
+ */
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ } destroyNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ BOOL fromConfigure;
+ BYTE pad1, pad2, pad3;
+ } unmapNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ BOOL override;
+ BYTE pad1, pad2, pad3;
+ } mapNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32;
+ } mapRequest;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32, parent B32;
+ INT16 x B16, y B16;
+ BOOL override;
+ BYTE pad1, pad2, pad3;
+ } reparent;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32, aboveSibling B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ BOOL override;
+ BYTE bpad;
+ } configureNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window parent B32, window B32, sibling B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+ CARD16 valueMask B16;
+ CARD32 pad1 B32;
+ } configureRequest;
+ struct {
+ CARD32 pad00 B32;
+ Window event B32, window B32;
+ INT16 x B16, y B16;
+ CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
+ } gravity;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ CARD16 width B16, height B16;
+ } resizeRequest;
+ struct {
+/* The event field in the circulate record is really the parent when this
+ is used as a CirculateRequest instead of a CirculateNotify */
+ CARD32 pad00 B32;
+ Window event B32, window B32, parent B32;
+ BYTE place; /* Top or Bottom */
+ BYTE pad1, pad2, pad3;
+ } circulate;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ Atom atom B32;
+ Time time B32;
+ BYTE state; /* NewValue or Deleted */
+ BYTE pad1;
+ CARD16 pad2 B16;
+ } property;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window window B32;
+ Atom atom B32;
+ } selectionClear;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window owner B32, requestor B32;
+ Atom selection B32, target B32, property B32;
+ } selectionRequest;
+ struct {
+ CARD32 pad00 B32;
+ Time time B32;
+ Window requestor B32;
+ Atom selection B32, target B32, property B32;
+ } selectionNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ Colormap colormap B32;
+#if defined(__cplusplus) || defined(c_plusplus)
+ BOOL c_new;
+#else
+ BOOL new;
+#endif
+ BYTE state; /* Installed or UnInstalled */
+ BYTE pad1, pad2;
+ } colormap;
+ struct {
+ CARD32 pad00 B32;
+ CARD8 request;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+ } mappingNotify;
+ struct {
+ CARD32 pad00 B32;
+ Window window B32;
+ union {
+ struct {
+ Atom type B32;
+ INT32 longs0 B32;
+ INT32 longs1 B32;
+ INT32 longs2 B32;
+ INT32 longs3 B32;
+ INT32 longs4 B32;
+ } l;
+ struct {
+ Atom type B32;
+ INT16 shorts0 B16;
+ INT16 shorts1 B16;
+ INT16 shorts2 B16;
+ INT16 shorts3 B16;
+ INT16 shorts4 B16;
+ INT16 shorts5 B16;
+ INT16 shorts6 B16;
+ INT16 shorts7 B16;
+ INT16 shorts8 B16;
+ INT16 shorts9 B16;
+ } s;
+ struct {
+ Atom type B32;
+ INT8 bytes[20];
+ } b;
+ } u;
+ } clientMessage;
+ } u;
+} xEvent;
+
+/*********************************************************
+ *
+ * Generic event
+ *
+ * Those events are not part of the core protocol spec and can be used by
+ * various extensions.
+ * type is always GenericEvent
+ * extension is the minor opcode of the extension the event belongs to.
+ * evtype is the actual event type, unique __per extension__.
+ *
+ * GenericEvents can be longer than 32 bytes, with the length field
+ * specifying the number of 4 byte blocks after the first 32 bytes.
+ *
+ *
+ */
+typedef struct
+{
+ BYTE type;
+ CARD8 extension;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 evtype B16;
+ CARD16 pad2 B16;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+ CARD32 pad7 B32;
+} xGenericEvent;
+
+
+
+/* KeymapNotify events are not included in the above union because they
+ are different from all other events: they do not have a "detail"
+ or "sequenceNumber", so there is room for a 248-bit key mask. */
+
+typedef struct {
+ BYTE type;
+ BYTE map[31];
+ } xKeymapEvent;
+
+#define XEventSize (sizeof(xEvent))
+
+/* XReply is the union of all the replies above whose "fixed part"
+fits in 32 bytes. It does NOT include GetWindowAttributesReply,
+QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply
+ListFontsWithInfoReply */
+
+typedef union {
+ xGenericReply generic;
+ xGetGeometryReply geom;
+ xQueryTreeReply tree;
+ xInternAtomReply atom;
+ xGetAtomNameReply atomName;
+ xGetPropertyReply property;
+ xListPropertiesReply listProperties;
+ xGetSelectionOwnerReply selection;
+ xGrabPointerReply grabPointer;
+ xGrabKeyboardReply grabKeyboard;
+ xQueryPointerReply pointer;
+ xGetMotionEventsReply motionEvents;
+ xTranslateCoordsReply coords;
+ xGetInputFocusReply inputFocus;
+ xQueryTextExtentsReply textExtents;
+ xListFontsReply fonts;
+ xGetFontPathReply fontPath;
+ xGetImageReply image;
+ xListInstalledColormapsReply colormaps;
+ xAllocColorReply allocColor;
+ xAllocNamedColorReply allocNamedColor;
+ xAllocColorCellsReply colorCells;
+ xAllocColorPlanesReply colorPlanes;
+ xQueryColorsReply colors;
+ xLookupColorReply lookupColor;
+ xQueryBestSizeReply bestSize;
+ xQueryExtensionReply extension;
+ xListExtensionsReply extensions;
+ xSetModifierMappingReply setModifierMapping;
+ xGetModifierMappingReply getModifierMapping;
+ xSetPointerMappingReply setPointerMapping;
+ xGetKeyboardMappingReply getKeyboardMapping;
+ xGetPointerMappingReply getPointerMapping;
+ xGetPointerControlReply pointerControl;
+ xGetScreenSaverReply screenSaver;
+ xListHostsReply hosts;
+ xError error;
+ xEvent event;
+} xReply;
+
+
+
+/*****************************************************************
+ * REQUESTS
+ *****************************************************************/
+
+
+/* Request structure */
+
+typedef struct _xReq {
+ CARD8 reqType;
+ CARD8 data; /* meaning depends on request type */
+ CARD16 length B16; /* length in 4 bytes quantities
+ of whole request, including this header */
+} xReq;
+
+/*****************************************************************
+ * structures that follow request.
+ *****************************************************************/
+
+/* ResourceReq is used for any request which has a resource ID
+ (or Atom or Time) as its one and only argument. */
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */
+ } xResourceReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 depth;
+ CARD16 length B16;
+ Window wid B32, parent B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16, borderWidth B16;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD16 c_class B16;
+#else
+ CARD16 class B16;
+#endif
+ VisualID visual B32;
+ CARD32 mask B32;
+} xCreateWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD32 valueMask B32;
+} xChangeWindowAttributesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ Window window B32;
+} xChangeSaveSetReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32, parent B32;
+ INT16 x B16, y B16;
+} xReparentWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD16 mask B16;
+ CARD16 pad2 B16;
+} xConfigureWindowReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 direction;
+ CARD16 length B16;
+ Window window B32;
+} xCirculateWindowReq;
+
+typedef struct { /* followed by padded string */
+ CARD8 reqType;
+ BOOL onlyIfExists;
+ CARD16 length B16;
+ CARD16 nbytes B16; /* number of bytes in string */
+ CARD16 pad B16;
+} xInternAtomReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 mode;
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32, type B32;
+ CARD8 format;
+ BYTE pad[3];
+ CARD32 nUnits B32; /* length of stuff following, depends on format */
+} xChangePropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32;
+} xDeletePropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+ BOOL c_delete;
+#else
+ BOOL delete;
+#endif
+ CARD16 length B16;
+ Window window B32;
+ Atom property B32, type B32;
+ CARD32 longOffset B32;
+ CARD32 longLength B32;
+} xGetPropertyReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Atom selection B32;
+ Time time B32;
+} xSetSelectionOwnerReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window requestor B32;
+ Atom selection B32, target B32, property B32;
+ Time time B32;
+ } xConvertSelectionReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL propagate;
+ CARD16 length B16;
+ Window destination B32;
+ CARD32 eventMask B32;
+#ifdef WORD64
+ /* the structure should have been quad-aligned */
+ BYTE eventdata[SIZEOF(xEvent)];
+#else
+ xEvent event;
+#endif /* WORD64 */
+} xSendEventReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 eventMask B16;
+ BYTE pointerMode, keyboardMode;
+ Window confineTo B32;
+ Cursor cursor B32;
+ Time time B32;
+} xGrabPointerReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 eventMask B16;
+ BYTE pointerMode, keyboardMode;
+ Window confineTo B32;
+ Cursor cursor B32;
+ CARD8 button;
+ BYTE pad;
+ CARD16 modifiers B16;
+} xGrabButtonReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 button;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD16 pad B16;
+} xUngrabButtonReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cursor B32;
+ Time time B32;
+ CARD16 eventMask B16;
+ CARD16 pad2 B16;
+} xChangeActivePointerGrabReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ Time time B32;
+ BYTE pointerMode, keyboardMode;
+ CARD16 pad B16;
+} xGrabKeyboardReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL ownerEvents;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 key;
+ BYTE pointerMode, keyboardMode;
+ BYTE pad1, pad2, pad3;
+} xGrabKeyReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 key;
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD16 pad B16;
+} xUngrabKeyReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 mode;
+ CARD16 length B16;
+ Time time B32;
+} xAllowEventsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ Time start B32, stop B32;
+} xGetMotionEventsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window srcWid B32, dstWid B32;
+ INT16 srcX B16, srcY B16;
+} xTranslateCoordsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window srcWid B32, dstWid B32;
+ INT16 srcX B16, srcY B16;
+ CARD16 srcWidth B16, srcHeight B16;
+ INT16 dstX B16, dstY B16;
+} xWarpPointerReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 revertTo;
+ CARD16 length B16;
+ Window focus B32;
+ Time time B32;
+} xSetInputFocusReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Font fid B32;
+ CARD16 nbytes B16;
+ BYTE pad1, pad2; /* string follows on word boundary */
+} xOpenFontReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL oddLength;
+ CARD16 length B16;
+ Font fid B32;
+ } xQueryTextExtentsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 maxNames B16;
+ CARD16 nbytes B16; /* followed immediately by string bytes */
+} xListFontsReq;
+
+typedef xListFontsReq xListFontsWithInfoReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 nFonts B16;
+ BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */
+} xSetFontPathReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 depth;
+ CARD16 length B16;
+ Pixmap pid B32;
+ Drawable drawable B32;
+ CARD16 width B16, height B16;
+} xCreatePixmapReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ Drawable drawable B32;
+ CARD32 mask B32;
+} xCreateGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ CARD32 mask B32;
+} xChangeGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext srcGC B32, dstGC B32;
+ CARD32 mask B32;
+} xCopyGCReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ GContext gc B32;
+ CARD16 dashOffset B16;
+ CARD16 nDashes B16; /* length LISTofCARD8 of values following */
+} xSetDashesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE ordering;
+ CARD16 length B16;
+ GContext gc B32;
+ INT16 xOrigin B16, yOrigin B16;
+} xSetClipRectanglesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL exposures;
+ CARD16 length B16;
+ Window window B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+} xClearAreaReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable srcDrawable B32, dstDrawable B32;
+ GContext gc B32;
+ INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+ CARD16 width B16, height B16;
+} xCopyAreaReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable srcDrawable B32, dstDrawable B32;
+ GContext gc B32;
+ INT16 srcX B16, srcY B16, dstX B16, dstY B16;
+ CARD16 width B16, height B16;
+ CARD32 bitPlane B32;
+} xCopyPlaneReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE coordMode;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+} xPolyPointReq;
+
+typedef xPolyPointReq xPolyLineReq; /* same request structure */
+
+/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+} xPolySegmentReq;
+
+typedef xPolySegmentReq xPolyArcReq;
+typedef xPolySegmentReq xPolyRectangleReq;
+typedef xPolySegmentReq xPolyFillRectangleReq;
+typedef xPolySegmentReq xPolyFillArcReq;
+
+typedef struct _FillPolyReq {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ BYTE shape;
+ BYTE coordMode;
+ CARD16 pad1 B16;
+} xFillPolyReq;
+
+
+typedef struct _PutImageReq {
+ CARD8 reqType;
+ CARD8 format;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ CARD16 width B16, height B16;
+ INT16 dstX B16, dstY B16;
+ CARD8 leftPad;
+ CARD8 depth;
+ CARD16 pad B16;
+} xPutImageReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 format;
+ CARD16 length B16;
+ Drawable drawable B32;
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ CARD32 planeMask B32;
+} xGetImageReq;
+
+/* the following used by PolyText8 and PolyText16 */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 pad;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ INT16 x B16, y B16; /* items (xTextElt) start after struct */
+} xPolyTextReq;
+
+typedef xPolyTextReq xPolyText8Req;
+typedef xPolyTextReq xPolyText16Req;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE nChars;
+ CARD16 length B16;
+ Drawable drawable B32;
+ GContext gc B32;
+ INT16 x B16, y B16;
+} xImageTextReq;
+
+typedef xImageTextReq xImageText8Req;
+typedef xImageTextReq xImageText16Req;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE alloc;
+ CARD16 length B16;
+ Colormap mid B32;
+ Window window B32;
+ VisualID visual B32;
+} xCreateColormapReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap mid B32;
+ Colormap srcCmap B32;
+} xCopyColormapAndFreeReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 red B16, green B16, blue B16;
+ CARD16 pad2 B16;
+} xAllocColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 nbytes B16; /* followed by structure */
+ BYTE pad1, pad2;
+} xAllocNamedColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL contiguous;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 colors B16, planes B16;
+} xAllocColorCellsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BOOL contiguous;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 colors B16, red B16, green B16, blue B16;
+} xAllocColorPlanesReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD32 planeMask B32;
+} xFreeColorsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+} xStoreColorsReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD32 pixel B32;
+ CARD16 nbytes B16; /* number of name string bytes following structure */
+ BYTE pad1, pad2;
+ } xStoreNamedColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+} xQueryColorsReq;
+
+typedef struct { /* followed by string of length len */
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Colormap cmap B32;
+ CARD16 nbytes B16; /* number of string bytes following structure*/
+ BYTE pad1, pad2;
+} xLookupColorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cid B32;
+ Pixmap source B32, mask B32;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+ CARD16 x B16, y B16;
+} xCreateCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cid B32;
+ Font source B32, mask B32;
+ CARD16 sourceChar B16, maskChar B16;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+} xCreateGlyphCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Cursor cursor B32;
+ CARD16 foreRed B16, foreGreen B16, foreBlue B16;
+ CARD16 backRed B16, backGreen B16, backBlue B16;
+} xRecolorCursorReq;
+
+typedef struct {
+ CARD8 reqType;
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD16 length B16;
+ Drawable drawable B32;
+ CARD16 width B16, height B16;
+} xQueryBestSizeReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD16 nbytes B16; /* number of string bytes following structure */
+ BYTE pad1, pad2;
+} xQueryExtensionReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 numKeyPerModifier;
+ CARD16 length B16;
+} xSetModifierMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 nElts; /* how many elements in the map */
+ CARD16 length B16;
+} xSetPointerMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ CARD16 pad1 B16;
+} xGetKeyboardMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 keyCodes;
+ CARD16 length B16;
+ KeyCode firstKeyCode;
+ CARD8 keySymsPerKeyCode;
+ CARD16 pad1 B16;
+} xChangeKeyboardMappingReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ CARD32 mask B32;
+} xChangeKeyboardControlReq;
+
+typedef struct {
+ CARD8 reqType;
+ INT8 percent; /* -100 to 100 */
+ CARD16 length B16;
+} xBellReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ INT16 accelNum B16, accelDenum B16;
+ INT16 threshold B16;
+ BOOL doAccel, doThresh;
+} xChangePointerControlReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ INT16 timeout B16, interval B16;
+ BYTE preferBlank, allowExpose;
+ CARD16 pad2 B16;
+} xSetScreenSaverReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ CARD8 hostFamily;
+ BYTE pad;
+ CARD16 hostLength B16;
+} xChangeHostsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ } xListHostsReq;
+
+typedef struct {
+ CARD8 reqType;
+ BYTE mode;
+ CARD16 length B16;
+ } xChangeModeReq;
+
+typedef xChangeModeReq xSetAccessControlReq;
+typedef xChangeModeReq xSetCloseDownModeReq;
+typedef xChangeModeReq xForceScreenSaverReq;
+
+typedef struct { /* followed by LIST of ATOM */
+ CARD8 reqType;
+ BYTE pad;
+ CARD16 length B16;
+ Window window B32;
+ CARD16 nAtoms B16;
+ INT16 nPositions B16;
+ } xRotatePropertiesReq;
+
+
+
+/* Reply codes */
+
+#define X_Reply 1 /* Normal reply */
+#define X_Error 0 /* Error */
+
+/* Request codes */
+
+#define X_CreateWindow 1
+#define X_ChangeWindowAttributes 2
+#define X_GetWindowAttributes 3
+#define X_DestroyWindow 4
+#define X_DestroySubwindows 5
+#define X_ChangeSaveSet 6
+#define X_ReparentWindow 7
+#define X_MapWindow 8
+#define X_MapSubwindows 9
+#define X_UnmapWindow 10
+#define X_UnmapSubwindows 11
+#define X_ConfigureWindow 12
+#define X_CirculateWindow 13
+#define X_GetGeometry 14
+#define X_QueryTree 15
+#define X_InternAtom 16
+#define X_GetAtomName 17
+#define X_ChangeProperty 18
+#define X_DeleteProperty 19
+#define X_GetProperty 20
+#define X_ListProperties 21
+#define X_SetSelectionOwner 22
+#define X_GetSelectionOwner 23
+#define X_ConvertSelection 24
+#define X_SendEvent 25
+#define X_GrabPointer 26
+#define X_UngrabPointer 27
+#define X_GrabButton 28
+#define X_UngrabButton 29
+#define X_ChangeActivePointerGrab 30
+#define X_GrabKeyboard 31
+#define X_UngrabKeyboard 32
+#define X_GrabKey 33
+#define X_UngrabKey 34
+#define X_AllowEvents 35
+#define X_GrabServer 36
+#define X_UngrabServer 37
+#define X_QueryPointer 38
+#define X_GetMotionEvents 39
+#define X_TranslateCoords 40
+#define X_WarpPointer 41
+#define X_SetInputFocus 42
+#define X_GetInputFocus 43
+#define X_QueryKeymap 44
+#define X_OpenFont 45
+#define X_CloseFont 46
+#define X_QueryFont 47
+#define X_QueryTextExtents 48
+#define X_ListFonts 49
+#define X_ListFontsWithInfo 50
+#define X_SetFontPath 51
+#define X_GetFontPath 52
+#define X_CreatePixmap 53
+#define X_FreePixmap 54
+#define X_CreateGC 55
+#define X_ChangeGC 56
+#define X_CopyGC 57
+#define X_SetDashes 58
+#define X_SetClipRectangles 59
+#define X_FreeGC 60
+#define X_ClearArea 61
+#define X_CopyArea 62
+#define X_CopyPlane 63
+#define X_PolyPoint 64
+#define X_PolyLine 65
+#define X_PolySegment 66
+#define X_PolyRectangle 67
+#define X_PolyArc 68
+#define X_FillPoly 69
+#define X_PolyFillRectangle 70
+#define X_PolyFillArc 71
+#define X_PutImage 72
+#define X_GetImage 73
+#define X_PolyText8 74
+#define X_PolyText16 75
+#define X_ImageText8 76
+#define X_ImageText16 77
+#define X_CreateColormap 78
+#define X_FreeColormap 79
+#define X_CopyColormapAndFree 80
+#define X_InstallColormap 81
+#define X_UninstallColormap 82
+#define X_ListInstalledColormaps 83
+#define X_AllocColor 84
+#define X_AllocNamedColor 85
+#define X_AllocColorCells 86
+#define X_AllocColorPlanes 87
+#define X_FreeColors 88
+#define X_StoreColors 89
+#define X_StoreNamedColor 90
+#define X_QueryColors 91
+#define X_LookupColor 92
+#define X_CreateCursor 93
+#define X_CreateGlyphCursor 94
+#define X_FreeCursor 95
+#define X_RecolorCursor 96
+#define X_QueryBestSize 97
+#define X_QueryExtension 98
+#define X_ListExtensions 99
+#define X_ChangeKeyboardMapping 100
+#define X_GetKeyboardMapping 101
+#define X_ChangeKeyboardControl 102
+#define X_GetKeyboardControl 103
+#define X_Bell 104
+#define X_ChangePointerControl 105
+#define X_GetPointerControl 106
+#define X_SetScreenSaver 107
+#define X_GetScreenSaver 108
+#define X_ChangeHosts 109
+#define X_ListHosts 110
+#define X_SetAccessControl 111
+#define X_SetCloseDownMode 112
+#define X_KillClient 113
+#define X_RotateProperties 114
+#define X_ForceScreenSaver 115
+#define X_SetPointerMapping 116
+#define X_GetPointerMapping 117
+#define X_SetModifierMapping 118
+#define X_GetModifierMapping 119
+#define X_NoOperation 127
+
+/* restore these definitions back to the typedefs in X.h */
+#undef Window
+#undef Drawable
+#undef Font
+#undef Pixmap
+#undef Cursor
+#undef Colormap
+#undef GContext
+#undef Atom
+#undef VisualID
+#undef Time
+#undef KeyCode
+#undef KeySym
+
+#endif /* XPROTO_H */
diff --git a/system/include/X11/Xprotostr.h b/system/include/X11/Xprotostr.h
new file mode 100644
index 00000000..a9e854d3
--- /dev/null
+++ b/system/include/X11/Xprotostr.h
@@ -0,0 +1,77 @@
+#ifndef XPROTOSTRUCTS_H
+#define XPROTOSTRUCTS_H
+
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+#include <X11/Xmd.h>
+
+/* Used by PolySegment */
+
+typedef struct _xSegment {
+ INT16 x1 B16, y1 B16, x2 B16, y2 B16;
+} xSegment;
+
+/* POINT */
+
+typedef struct _xPoint {
+ INT16 x B16, y B16;
+} xPoint;
+
+typedef struct _xRectangle {
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+} xRectangle;
+
+/* ARC */
+
+typedef struct _xArc {
+ INT16 x B16, y B16;
+ CARD16 width B16, height B16;
+ INT16 angle1 B16, angle2 B16;
+} xArc;
+
+#endif /* XPROTOSTRUCTS_H */
diff --git a/system/include/X11/cursorfont.h b/system/include/X11/cursorfont.h
new file mode 100644
index 00000000..c69d508f
--- /dev/null
+++ b/system/include/X11/cursorfont.h
@@ -0,0 +1,111 @@
+/*
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifndef _X11_CURSORFONT_H_
+#define _X11_CURSORFONT_H_
+
+#define XC_num_glyphs 154
+#define XC_X_cursor 0
+#define XC_arrow 2
+#define XC_based_arrow_down 4
+#define XC_based_arrow_up 6
+#define XC_boat 8
+#define XC_bogosity 10
+#define XC_bottom_left_corner 12
+#define XC_bottom_right_corner 14
+#define XC_bottom_side 16
+#define XC_bottom_tee 18
+#define XC_box_spiral 20
+#define XC_center_ptr 22
+#define XC_circle 24
+#define XC_clock 26
+#define XC_coffee_mug 28
+#define XC_cross 30
+#define XC_cross_reverse 32
+#define XC_crosshair 34
+#define XC_diamond_cross 36
+#define XC_dot 38
+#define XC_dotbox 40
+#define XC_double_arrow 42
+#define XC_draft_large 44
+#define XC_draft_small 46
+#define XC_draped_box 48
+#define XC_exchange 50
+#define XC_fleur 52
+#define XC_gobbler 54
+#define XC_gumby 56
+#define XC_hand1 58
+#define XC_hand2 60
+#define XC_heart 62
+#define XC_icon 64
+#define XC_iron_cross 66
+#define XC_left_ptr 68
+#define XC_left_side 70
+#define XC_left_tee 72
+#define XC_leftbutton 74
+#define XC_ll_angle 76
+#define XC_lr_angle 78
+#define XC_man 80
+#define XC_middlebutton 82
+#define XC_mouse 84
+#define XC_pencil 86
+#define XC_pirate 88
+#define XC_plus 90
+#define XC_question_arrow 92
+#define XC_right_ptr 94
+#define XC_right_side 96
+#define XC_right_tee 98
+#define XC_rightbutton 100
+#define XC_rtl_logo 102
+#define XC_sailboat 104
+#define XC_sb_down_arrow 106
+#define XC_sb_h_double_arrow 108
+#define XC_sb_left_arrow 110
+#define XC_sb_right_arrow 112
+#define XC_sb_up_arrow 114
+#define XC_sb_v_double_arrow 116
+#define XC_shuttle 118
+#define XC_sizing 120
+#define XC_spider 122
+#define XC_spraycan 124
+#define XC_star 126
+#define XC_target 128
+#define XC_tcross 130
+#define XC_top_left_arrow 132
+#define XC_top_left_corner 134
+#define XC_top_right_corner 136
+#define XC_top_side 138
+#define XC_top_tee 140
+#define XC_trek 142
+#define XC_ul_angle 144
+#define XC_umbrella 146
+#define XC_ur_angle 148
+#define XC_watch 150
+#define XC_xterm 152
+
+#endif /* _X11_CURSORFONT_H_ */
diff --git a/system/include/X11/extensions/XKB.h b/system/include/X11/extensions/XKB.h
new file mode 100644
index 00000000..ee4f7407
--- /dev/null
+++ b/system/include/X11/extensions/XKB.h
@@ -0,0 +1,786 @@
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _XKB_H_
+#define _XKB_H_
+
+ /*
+ * XKB request codes, used in:
+ * - xkbReqType field of all requests
+ * - requestMinor field of some events
+ */
+#define X_kbUseExtension 0
+#define X_kbSelectEvents 1
+#define X_kbBell 3
+#define X_kbGetState 4
+#define X_kbLatchLockState 5
+#define X_kbGetControls 6
+#define X_kbSetControls 7
+#define X_kbGetMap 8
+#define X_kbSetMap 9
+#define X_kbGetCompatMap 10
+#define X_kbSetCompatMap 11
+#define X_kbGetIndicatorState 12
+#define X_kbGetIndicatorMap 13
+#define X_kbSetIndicatorMap 14
+#define X_kbGetNamedIndicator 15
+#define X_kbSetNamedIndicator 16
+#define X_kbGetNames 17
+#define X_kbSetNames 18
+#define X_kbGetGeometry 19
+#define X_kbSetGeometry 20
+#define X_kbPerClientFlags 21
+#define X_kbListComponents 22
+#define X_kbGetKbdByName 23
+#define X_kbGetDeviceInfo 24
+#define X_kbSetDeviceInfo 25
+#define X_kbSetDebuggingFlags 101
+
+ /*
+ * In the X sense, XKB reports only one event.
+ * The type field of all XKB events is XkbEventCode
+ */
+#define XkbEventCode 0
+#define XkbNumberEvents (XkbEventCode+1)
+
+ /*
+ * XKB has a minor event code so it can use one X event code for
+ * multiple purposes.
+ * - reported in the xkbType field of all XKB events.
+ * - XkbSelectEventDetails: Indicates the event for which event details
+ * are being changed
+ */
+#define XkbNewKeyboardNotify 0
+#define XkbMapNotify 1
+#define XkbStateNotify 2
+#define XkbControlsNotify 3
+#define XkbIndicatorStateNotify 4
+#define XkbIndicatorMapNotify 5
+#define XkbNamesNotify 6
+#define XkbCompatMapNotify 7
+#define XkbBellNotify 8
+#define XkbActionMessage 9
+#define XkbAccessXNotify 10
+#define XkbExtensionDeviceNotify 11
+
+ /*
+ * Event Mask:
+ * - XkbSelectEvents: Specifies event interest.
+ */
+#define XkbNewKeyboardNotifyMask (1L << 0)
+#define XkbMapNotifyMask (1L << 1)
+#define XkbStateNotifyMask (1L << 2)
+#define XkbControlsNotifyMask (1L << 3)
+#define XkbIndicatorStateNotifyMask (1L << 4)
+#define XkbIndicatorMapNotifyMask (1L << 5)
+#define XkbNamesNotifyMask (1L << 6)
+#define XkbCompatMapNotifyMask (1L << 7)
+#define XkbBellNotifyMask (1L << 8)
+#define XkbActionMessageMask (1L << 9)
+#define XkbAccessXNotifyMask (1L << 10)
+#define XkbExtensionDeviceNotifyMask (1L << 11)
+#define XkbAllEventsMask (0xFFF)
+
+ /*
+ * NewKeyboardNotify event details:
+ */
+#define XkbNKN_KeycodesMask (1L << 0)
+#define XkbNKN_GeometryMask (1L << 1)
+#define XkbNKN_DeviceIDMask (1L << 2)
+#define XkbAllNewKeyboardEventsMask (0x7)
+
+ /*
+ * AccessXNotify event types:
+ * - The 'what' field of AccessXNotify events reports the
+ * reason that the event was generated.
+ */
+#define XkbAXN_SKPress 0
+#define XkbAXN_SKAccept 1
+#define XkbAXN_SKReject 2
+#define XkbAXN_SKRelease 3
+#define XkbAXN_BKAccept 4
+#define XkbAXN_BKReject 5
+#define XkbAXN_AXKWarning 6
+
+ /*
+ * AccessXNotify details:
+ * - Used as an event detail mask to limit the conditions under which
+ * AccessXNotify events are reported
+ */
+#define XkbAXN_SKPressMask (1L << 0)
+#define XkbAXN_SKAcceptMask (1L << 1)
+#define XkbAXN_SKRejectMask (1L << 2)
+#define XkbAXN_SKReleaseMask (1L << 3)
+#define XkbAXN_BKAcceptMask (1L << 4)
+#define XkbAXN_BKRejectMask (1L << 5)
+#define XkbAXN_AXKWarningMask (1L << 6)
+#define XkbAllAccessXEventsMask (0x7f)
+
+ /*
+ * Miscellaneous event details:
+ * - event detail masks for assorted events that don't reall
+ * have any details.
+ */
+#define XkbAllStateEventsMask XkbAllStateComponentsMask
+#define XkbAllMapEventsMask XkbAllMapComponentsMask
+#define XkbAllControlEventsMask XkbAllControlsMask
+#define XkbAllIndicatorEventsMask XkbAllIndicatorsMask
+#define XkbAllNameEventsMask XkbAllNamesMask
+#define XkbAllCompatMapEventsMask XkbAllCompatMask
+#define XkbAllBellEventsMask (1L << 0)
+#define XkbAllActionMessagesMask (1L << 0)
+
+ /*
+ * XKB reports one error: BadKeyboard
+ * A further reason for the error is encoded into to most significant
+ * byte of the resourceID for the error:
+ * XkbErr_BadDevice - the device in question was not found
+ * XkbErr_BadClass - the device was found but it doesn't belong to
+ * the appropriate class.
+ * XkbErr_BadId - the device was found and belongs to the right
+ * class, but not feedback with a matching id was
+ * found.
+ * The low byte of the resourceID for this error contains the device
+ * id, class specifier or feedback id that failed.
+ */
+#define XkbKeyboard 0
+#define XkbNumberErrors 1
+
+#define XkbErr_BadDevice 0xff
+#define XkbErr_BadClass 0xfe
+#define XkbErr_BadId 0xfd
+
+ /*
+ * Keyboard Components Mask:
+ * - Specifies the components that follow a GetKeyboardByNameReply
+ */
+#define XkbClientMapMask (1L << 0)
+#define XkbServerMapMask (1L << 1)
+#define XkbCompatMapMask (1L << 2)
+#define XkbIndicatorMapMask (1L << 3)
+#define XkbNamesMask (1L << 4)
+#define XkbGeometryMask (1L << 5)
+#define XkbControlsMask (1L << 6)
+#define XkbAllComponentsMask (0x7f)
+
+ /*
+ * State detail mask:
+ * - The 'changed' field of StateNotify events reports which of
+ * the keyboard state components have changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which StateNotify events are reported.
+ */
+#define XkbModifierStateMask (1L << 0)
+#define XkbModifierBaseMask (1L << 1)
+#define XkbModifierLatchMask (1L << 2)
+#define XkbModifierLockMask (1L << 3)
+#define XkbGroupStateMask (1L << 4)
+#define XkbGroupBaseMask (1L << 5)
+#define XkbGroupLatchMask (1L << 6)
+#define XkbGroupLockMask (1L << 7)
+#define XkbCompatStateMask (1L << 8)
+#define XkbGrabModsMask (1L << 9)
+#define XkbCompatGrabModsMask (1L << 10)
+#define XkbLookupModsMask (1L << 11)
+#define XkbCompatLookupModsMask (1L << 12)
+#define XkbPointerButtonMask (1L << 13)
+#define XkbAllStateComponentsMask (0x3fff)
+
+ /*
+ * Controls detail masks:
+ * The controls specified in XkbAllControlsMask:
+ * - The 'changed' field of ControlsNotify events reports which of
+ * the keyboard controls have changed.
+ * - The 'changeControls' field of the SetControls request specifies
+ * the controls for which values are to be changed.
+ * - Used as an event detail mask to limit the conditions under
+ * which ControlsNotify events are reported.
+ *
+ * The controls specified in the XkbAllBooleanCtrlsMask:
+ * - The 'enabledControls' field of ControlsNotify events reports the
+ * current status of the boolean controls.
+ * - The 'enabledControlsChanges' field of ControlsNotify events reports
+ * any boolean controls that have been turned on or off.
+ * - The 'affectEnabledControls' and 'enabledControls' fields of the
+ * kbSetControls request change the set of enabled controls.
+ * - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
+ * an XkbControlsRec specify the controls to be changed if the keyboard
+ * times out and the values to which they should be changed.
+ * - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags
+ * request specifies the specify the controls to be reset when the
+ * client exits and the values to which they should be reset.
+ * - The 'ctrls' field of an indicator map specifies the controls
+ * that drive the indicator.
+ * - Specifies the boolean controls affected by the SetControls and
+ * LockControls key actions.
+ */
+#define XkbRepeatKeysMask (1L << 0)
+#define XkbSlowKeysMask (1L << 1)
+#define XkbBounceKeysMask (1L << 2)
+#define XkbStickyKeysMask (1L << 3)
+#define XkbMouseKeysMask (1L << 4)
+#define XkbMouseKeysAccelMask (1L << 5)
+#define XkbAccessXKeysMask (1L << 6)
+#define XkbAccessXTimeoutMask (1L << 7)
+#define XkbAccessXFeedbackMask (1L << 8)
+#define XkbAudibleBellMask (1L << 9)
+#define XkbOverlay1Mask (1L << 10)
+#define XkbOverlay2Mask (1L << 11)
+#define XkbIgnoreGroupLockMask (1L << 12)
+#define XkbGroupsWrapMask (1L << 27)
+#define XkbInternalModsMask (1L << 28)
+#define XkbIgnoreLockModsMask (1L << 29)
+#define XkbPerKeyRepeatMask (1L << 30)
+#define XkbControlsEnabledMask (1L << 31)
+
+#define XkbAccessXOptionsMask (XkbStickyKeysMask|XkbAccessXFeedbackMask)
+
+#define XkbAllBooleanCtrlsMask (0x00001FFF)
+#define XkbAllControlsMask (0xF8001FFF)
+#define XkbAllControlEventsMask XkbAllControlsMask
+
+ /*
+ * AccessX Options Mask
+ * - The 'accessXOptions' field of an XkbControlsRec specifies the
+ * AccessX options that are currently in effect.
+ * - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
+ * fields of an XkbControlsRec specify the Access X options to be
+ * changed if the keyboard times out and the values to which they
+ * should be changed.
+ */
+#define XkbAX_SKPressFBMask (1L << 0)
+#define XkbAX_SKAcceptFBMask (1L << 1)
+#define XkbAX_FeatureFBMask (1L << 2)
+#define XkbAX_SlowWarnFBMask (1L << 3)
+#define XkbAX_IndicatorFBMask (1L << 4)
+#define XkbAX_StickyKeysFBMask (1L << 5)
+#define XkbAX_TwoKeysMask (1L << 6)
+#define XkbAX_LatchToLockMask (1L << 7)
+#define XkbAX_SKReleaseFBMask (1L << 8)
+#define XkbAX_SKRejectFBMask (1L << 9)
+#define XkbAX_BKRejectFBMask (1L << 10)
+#define XkbAX_DumbBellFBMask (1L << 11)
+#define XkbAX_FBOptionsMask (0xF3F)
+#define XkbAX_SKOptionsMask (0x0C0)
+#define XkbAX_AllOptionsMask (0xFFF)
+
+ /*
+ * XkbUseCoreKbd is used to specify the core keyboard without having
+ * to look up its X input extension identifier.
+ * XkbUseCorePtr is used to specify the core pointer without having
+ * to look up its X input extension identifier.
+ * XkbDfltXIClass is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * device class.
+ * XkbDfltXIId is used to specify "don't care" any place that the
+ * XKB protocol is looking for an X Input Extension
+ * feedback identifier.
+ * XkbAllXIClasses is used to get information about all device indicators,
+ * whether they're part of the indicator feedback class
+ * or the keyboard feedback class.
+ * XkbAllXIIds is used to get information about all device indicator
+ * feedbacks without having to list them.
+ * XkbXINone is used to indicate that no class or id has been specified.
+ * XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs
+ * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
+ * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
+ * XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class
+ * XkbExplicitXIId(c) True if 'i' explicitly specifies a device id
+ * XkbSingleXIClass(c) True if 'c' specifies exactly one device class,
+ * including the default.
+ * XkbSingleXIId(i) True if 'i' specifies exactly one device
+ * identifier, including the default.
+ */
+#define XkbUseCoreKbd 0x0100
+#define XkbUseCorePtr 0x0200
+#define XkbDfltXIClass 0x0300
+#define XkbDfltXIId 0x0400
+#define XkbAllXIClasses 0x0500
+#define XkbAllXIIds 0x0600
+#define XkbXINone 0xff00
+
+#define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==LedFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||\
+ ((c)==BellFeedbackClass)||\
+ ((c)==XkbDfltXIClass)||\
+ ((c)==XkbAllXIClasses))
+#define XkbExplicitXIDevice(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIClass(c) (((c)&(~0xff))==0)
+#define XkbExplicitXIId(c) (((c)&(~0xff))==0)
+#define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass))
+#define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId))
+
+#define XkbNoModifier 0xff
+#define XkbNoShiftLevel 0xff
+#define XkbNoShape 0xff
+#define XkbNoIndicator 0xff
+
+#define XkbNoModifierMask 0
+#define XkbAllModifiersMask 0xff
+#define XkbAllVirtualModsMask 0xffff
+
+#define XkbNumKbdGroups 4
+#define XkbMaxKbdGroup (XkbNumKbdGroups-1)
+
+#define XkbMaxMouseKeysBtn 4
+
+ /*
+ * Group Index and Mask:
+ * - Indices into the kt_index array of a key type.
+ * - Mask specifies types to be changed for XkbChangeTypesOfKey
+ */
+#define XkbGroup1Index 0
+#define XkbGroup2Index 1
+#define XkbGroup3Index 2
+#define XkbGroup4Index 3
+#define XkbAnyGroup 254
+#define XkbAllGroups 255
+
+#define XkbGroup1Mask (1<<0)
+#define XkbGroup2Mask (1<<1)
+#define XkbGroup3Mask (1<<2)
+#define XkbGroup4Mask (1<<3)
+#define XkbAnyGroupMask (1<<7)
+#define XkbAllGroupsMask (0xf)
+
+ /*
+ * BuildCoreState: Given a keyboard group and a modifier state,
+ * construct the value to be reported an event.
+ * GroupForCoreState: Given the state reported in an event,
+ * determine the keyboard group.
+ * IsLegalGroup: Returns TRUE if 'g' is a valid group index.
+ */
+#define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff))
+#define XkbGroupForCoreState(s) (((s)>>13)&0x3)
+#define XkbIsLegalGroup(g) (((g)>=0)&&((g)<XkbNumKbdGroups))
+
+ /*
+ * GroupsWrap values:
+ * - The 'groupsWrap' field of an XkbControlsRec specifies the
+ * treatment of out of range groups.
+ * - Bits 6 and 7 of the group info field of a key symbol map
+ * specify the interpretation of out of range groups for the
+ * corresponding key.
+ */
+#define XkbWrapIntoRange (0x00)
+#define XkbClampIntoRange (0x40)
+#define XkbRedirectIntoRange (0x80)
+
+ /*
+ * Action flags: Reported in the 'flags' field of most key actions.
+ * Interpretation depends on the type of the action; not all actions
+ * accept all flags.
+ *
+ * Option Used for Actions
+ * ------ ----------------
+ * ClearLocks SetMods, LatchMods, SetGroup, LatchGroup
+ * LatchToLock SetMods, LatchMods, SetGroup, LatchGroup
+ * LockNoLock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * LockNoUnlock LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
+ * UseModMapMods SetMods, LatchMods, LockMods, ISOLock
+ * GroupAbsolute SetGroup, LatchGroup, LockGroup, ISOLock
+ * UseDfltButton PtrBtn, LockPtrBtn
+ * NoAcceleration MovePtr
+ * MoveAbsoluteX MovePtr
+ * MoveAbsoluteY MovePtr
+ * ISODfltIsGroup ISOLock
+ * ISONoAffectMods ISOLock
+ * ISONoAffectGroup ISOLock
+ * ISONoAffectPtr ISOLock
+ * ISONoAffectCtrls ISOLock
+ * MessageOnPress ActionMessage
+ * MessageOnRelease ActionMessage
+ * MessageGenKeyEvent ActionMessage
+ * AffectDfltBtn SetPtrDflt
+ * DfltBtnAbsolute SetPtrDflt
+ * SwitchApplication SwitchScreen
+ * SwitchAbsolute SwitchScreen
+ */
+
+#define XkbSA_ClearLocks (1L << 0)
+#define XkbSA_LatchToLock (1L << 1)
+
+#define XkbSA_LockNoLock (1L << 0)
+#define XkbSA_LockNoUnlock (1L << 1)
+
+#define XkbSA_UseModMapMods (1L << 2)
+
+#define XkbSA_GroupAbsolute (1L << 2)
+#define XkbSA_UseDfltButton 0
+
+#define XkbSA_NoAcceleration (1L << 0)
+#define XkbSA_MoveAbsoluteX (1L << 1)
+#define XkbSA_MoveAbsoluteY (1L << 2)
+
+#define XkbSA_ISODfltIsGroup (1L << 7)
+#define XkbSA_ISONoAffectMods (1L << 6)
+#define XkbSA_ISONoAffectGroup (1L << 5)
+#define XkbSA_ISONoAffectPtr (1L << 4)
+#define XkbSA_ISONoAffectCtrls (1L << 3)
+#define XkbSA_ISOAffectMask (0x78)
+
+#define XkbSA_MessageOnPress (1L << 0)
+#define XkbSA_MessageOnRelease (1L << 1)
+#define XkbSA_MessageGenKeyEvent (1L << 2)
+
+#define XkbSA_AffectDfltBtn 1
+#define XkbSA_DfltBtnAbsolute (1L << 2)
+
+#define XkbSA_SwitchApplication (1L << 0)
+#define XkbSA_SwitchAbsolute (1L << 2)
+
+ /*
+ * The following values apply to the SA_DeviceValuator
+ * action only. Valuator operations specify the action
+ * to be taken. Values specified in the action are
+ * multiplied by 2^scale before they are applied.
+ */
+#define XkbSA_IgnoreVal (0x00)
+#define XkbSA_SetValMin (0x10)
+#define XkbSA_SetValCenter (0x20)
+#define XkbSA_SetValMax (0x30)
+#define XkbSA_SetValRelative (0x40)
+#define XkbSA_SetValAbsolute (0x50)
+#define XkbSA_ValOpMask (0x70)
+#define XkbSA_ValScaleMask (0x07)
+#define XkbSA_ValOp(a) ((a)&XkbSA_ValOpMask)
+#define XkbSA_ValScale(a) ((a)&XkbSA_ValScaleMask)
+
+ /*
+ * Action types: specifies the type of a key action. Reported in the
+ * type field of all key actions.
+ */
+#define XkbSA_NoAction 0x00
+#define XkbSA_SetMods 0x01
+#define XkbSA_LatchMods 0x02
+#define XkbSA_LockMods 0x03
+#define XkbSA_SetGroup 0x04
+#define XkbSA_LatchGroup 0x05
+#define XkbSA_LockGroup 0x06
+#define XkbSA_MovePtr 0x07
+#define XkbSA_PtrBtn 0x08
+#define XkbSA_LockPtrBtn 0x09
+#define XkbSA_SetPtrDflt 0x0a
+#define XkbSA_ISOLock 0x0b
+#define XkbSA_Terminate 0x0c
+#define XkbSA_SwitchScreen 0x0d
+#define XkbSA_SetControls 0x0e
+#define XkbSA_LockControls 0x0f
+#define XkbSA_ActionMessage 0x10
+#define XkbSA_RedirectKey 0x11
+#define XkbSA_DeviceBtn 0x12
+#define XkbSA_LockDeviceBtn 0x13
+#define XkbSA_DeviceValuator 0x14
+#define XkbSA_LastAction XkbSA_DeviceValuator
+#define XkbSA_NumActions (XkbSA_LastAction+1)
+
+#define XkbSA_XFree86Private 0x86
+
+ /*
+ * Specifies the key actions that clear latched groups or modifiers.
+ */
+#define XkbSA_BreakLatch \
+ ((1<<XkbSA_NoAction)|(1<<XkbSA_PtrBtn)|(1<<XkbSA_LockPtrBtn)|\
+ (1<<XkbSA_Terminate)|(1<<XkbSA_SwitchScreen)|(1<<XkbSA_SetControls)|\
+ (1<<XkbSA_LockControls)|(1<<XkbSA_ActionMessage)|\
+ (1<<XkbSA_RedirectKey)|(1<<XkbSA_DeviceBtn)|(1<<XkbSA_LockDeviceBtn))
+
+ /*
+ * Macros to classify key actions
+ */
+#define XkbIsModAction(a) (((a)->type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods))
+#define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup))
+#define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt))
+
+
+ /*
+ * Key Behavior Qualifier:
+ * KB_Permanent indicates that the behavior describes an unalterable
+ * characteristic of the keyboard, not an XKB software-simulation of
+ * the listed behavior.
+ * Key Behavior Types:
+ * Specifies the behavior of the underlying key.
+ */
+#define XkbKB_Permanent 0x80
+#define XkbKB_OpMask 0x7f
+
+#define XkbKB_Default 0x00
+#define XkbKB_Lock 0x01
+#define XkbKB_RadioGroup 0x02
+#define XkbKB_Overlay1 0x03
+#define XkbKB_Overlay2 0x04
+
+#define XkbKB_RGAllowNone 0x80
+
+ /*
+ * Various macros which describe the range of legal keycodes.
+ */
+#define XkbMinLegalKeyCode 8
+#define XkbMaxLegalKeyCode 255
+#define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1)
+#define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8)
+/* Seems kinda silly to check that an unsigned char is <= 255... */
+#define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode)
+
+ /*
+ * Assorted constants and limits.
+ */
+#define XkbNumModifiers 8
+#define XkbNumVirtualMods 16
+#define XkbNumIndicators 32
+#define XkbAllIndicatorsMask (0xffffffff)
+#define XkbMaxRadioGroups 32
+#define XkbAllRadioGroupsMask (0xffffffff)
+#define XkbMaxShiftLevel 63
+#define XkbMaxSymsPerKey (XkbMaxShiftLevel*XkbNumKbdGroups)
+#define XkbRGMaxMembers 12
+#define XkbActionMessageLength 6
+#define XkbKeyNameLength 4
+#define XkbMaxRedirectCount 8
+
+#define XkbGeomPtsPerMM 10
+#define XkbGeomMaxColors 32
+#define XkbGeomMaxLabelColors 3
+#define XkbGeomMaxPriority 255
+
+ /*
+ * Key Type index and mask for the four standard key types.
+ */
+#define XkbOneLevelIndex 0
+#define XkbTwoLevelIndex 1
+#define XkbAlphabeticIndex 2
+#define XkbKeypadIndex 3
+#define XkbLastRequiredType XkbKeypadIndex
+#define XkbNumRequiredTypes (XkbLastRequiredType+1)
+#define XkbMaxKeyTypes 255
+
+#define XkbOneLevelMask (1<<0)
+#define XkbTwoLevelMask (1<<1)
+#define XkbAlphabeticMask (1<<2)
+#define XkbKeypadMask (1<<3)
+#define XkbAllRequiredTypes (0xf)
+
+#define XkbShiftLevel(n) ((n)-1)
+#define XkbShiftLevelMask(n) (1<<((n)-1))
+
+ /*
+ * Extension name and version information
+ */
+#define XkbName "XKEYBOARD"
+#define XkbMajorVersion 1
+#define XkbMinorVersion 0
+
+ /*
+ * Explicit map components:
+ * - Used in the 'explicit' field of an XkbServerMap. Specifies
+ * the keyboard components that should _not_ be updated automatically
+ * in response to core protocol keyboard mapping requests.
+ */
+#define XkbExplicitKeyTypesMask (0x0f)
+#define XkbExplicitKeyType1Mask (1<<0)
+#define XkbExplicitKeyType2Mask (1<<1)
+#define XkbExplicitKeyType3Mask (1<<2)
+#define XkbExplicitKeyType4Mask (1<<3)
+#define XkbExplicitInterpretMask (1<<4)
+#define XkbExplicitAutoRepeatMask (1<<5)
+#define XkbExplicitBehaviorMask (1<<6)
+#define XkbExplicitVModMapMask (1<<7)
+#define XkbAllExplicitMask (0xff)
+
+ /*
+ * Map components masks:
+ * Those in AllMapComponentsMask:
+ * - Specifies the individual fields to be loaded or changed for the
+ * GetMap and SetMap requests.
+ * Those in ClientInfoMask:
+ * - Specifies the components to be allocated by XkbAllocClientMap.
+ * Those in ServerInfoMask:
+ * - Specifies the components to be allocated by XkbAllocServerMap.
+ */
+#define XkbKeyTypesMask (1<<0)
+#define XkbKeySymsMask (1<<1)
+#define XkbModifierMapMask (1<<2)
+#define XkbExplicitComponentsMask (1<<3)
+#define XkbKeyActionsMask (1<<4)
+#define XkbKeyBehaviorsMask (1<<5)
+#define XkbVirtualModsMask (1<<6)
+#define XkbVirtualModMapMask (1<<7)
+
+#define XkbAllClientInfoMask (XkbKeyTypesMask|XkbKeySymsMask|XkbModifierMapMask)
+#define XkbAllServerInfoMask (XkbExplicitComponentsMask|XkbKeyActionsMask|XkbKeyBehaviorsMask|XkbVirtualModsMask|XkbVirtualModMapMask)
+#define XkbAllMapComponentsMask (XkbAllClientInfoMask|XkbAllServerInfoMask)
+
+ /*
+ * Symbol interpretations flags:
+ * - Used in the flags field of a symbol interpretation
+ */
+#define XkbSI_AutoRepeat (1<<0)
+#define XkbSI_LockingKey (1<<1)
+
+ /*
+ * Symbol interpretations match specification:
+ * - Used in the match field of a symbol interpretation to specify
+ * the conditions under which an interpretation is used.
+ */
+#define XkbSI_LevelOneOnly (0x80)
+#define XkbSI_OpMask (0x7f)
+#define XkbSI_NoneOf (0)
+#define XkbSI_AnyOfOrNone (1)
+#define XkbSI_AnyOf (2)
+#define XkbSI_AllOf (3)
+#define XkbSI_Exactly (4)
+
+ /*
+ * Indicator map flags:
+ * - Used in the flags field of an indicator map to indicate the
+ * conditions under which and indicator can be changed and the
+ * effects of changing the indicator.
+ */
+#define XkbIM_NoExplicit (1L << 7)
+#define XkbIM_NoAutomatic (1L << 6)
+#define XkbIM_LEDDrivesKB (1L << 5)
+
+ /*
+ * Indicator map component specifications:
+ * - Used by the 'which_groups' and 'which_mods' fields of an indicator
+ * map to specify which keyboard components should be used to drive
+ * the indicator.
+ */
+#define XkbIM_UseBase (1L << 0)
+#define XkbIM_UseLatched (1L << 1)
+#define XkbIM_UseLocked (1L << 2)
+#define XkbIM_UseEffective (1L << 3)
+#define XkbIM_UseCompat (1L << 4)
+
+#define XkbIM_UseNone 0
+#define XkbIM_UseAnyGroup (XkbIM_UseBase|XkbIM_UseLatched|XkbIM_UseLocked\
+ |XkbIM_UseEffective)
+#define XkbIM_UseAnyMods (XkbIM_UseAnyGroup|XkbIM_UseCompat)
+
+ /*
+ * Compatibility Map Compontents:
+ * - Specifies the components to be allocated in XkbAllocCompatMap.
+ */
+#define XkbSymInterpMask (1<<0)
+#define XkbGroupCompatMask (1<<1)
+#define XkbAllCompatMask (0x3)
+
+ /*
+ * Names component mask:
+ * - Specifies the names to be loaded or changed for the GetNames and
+ * SetNames requests.
+ * - Specifies the names that have changed in a NamesNotify event.
+ * - Specifies the names components to be allocated by XkbAllocNames.
+ */
+#define XkbKeycodesNameMask (1<<0)
+#define XkbGeometryNameMask (1<<1)
+#define XkbSymbolsNameMask (1<<2)
+#define XkbPhysSymbolsNameMask (1<<3)
+#define XkbTypesNameMask (1<<4)
+#define XkbCompatNameMask (1<<5)
+#define XkbKeyTypeNamesMask (1<<6)
+#define XkbKTLevelNamesMask (1<<7)
+#define XkbIndicatorNamesMask (1<<8)
+#define XkbKeyNamesMask (1<<9)
+#define XkbKeyAliasesMask (1<<10)
+#define XkbVirtualModNamesMask (1<<11)
+#define XkbGroupNamesMask (1<<12)
+#define XkbRGNamesMask (1<<13)
+#define XkbComponentNamesMask (0x3f)
+#define XkbAllNamesMask (0x3fff)
+
+ /*
+ * GetByName components:
+ * - Specifies desired or necessary components to GetKbdByName request.
+ * - Reports the components that were found in a GetKbdByNameReply
+ */
+#define XkbGBN_TypesMask (1L << 0)
+#define XkbGBN_CompatMapMask (1L << 1)
+#define XkbGBN_ClientSymbolsMask (1L << 2)
+#define XkbGBN_ServerSymbolsMask (1L << 3)
+#define XkbGBN_SymbolsMask (XkbGBN_ClientSymbolsMask|XkbGBN_ServerSymbolsMask)
+#define XkbGBN_IndicatorMapMask (1L << 4)
+#define XkbGBN_KeyNamesMask (1L << 5)
+#define XkbGBN_GeometryMask (1L << 6)
+#define XkbGBN_OtherNamesMask (1L << 7)
+#define XkbGBN_AllComponentsMask (0xff)
+
+ /*
+ * ListComponents flags
+ */
+#define XkbLC_Hidden (1L << 0)
+#define XkbLC_Default (1L << 1)
+#define XkbLC_Partial (1L << 2)
+
+#define XkbLC_AlphanumericKeys (1L << 8)
+#define XkbLC_ModifierKeys (1L << 9)
+#define XkbLC_KeypadKeys (1L << 10)
+#define XkbLC_FunctionKeys (1L << 11)
+#define XkbLC_AlternateGroup (1L << 12)
+
+ /*
+ * X Input Extension Interactions
+ * - Specifies the possible interactions between XKB and the X input
+ * extension
+ * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
+ * XKB information about an extension device.
+ * - Reports the list of supported optional features in the reply to
+ * XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
+ * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
+ * events to indicate an attempt to use an unsupported feature.
+ */
+#define XkbXI_KeyboardsMask (1L << 0)
+#define XkbXI_ButtonActionsMask (1L << 1)
+#define XkbXI_IndicatorNamesMask (1L << 2)
+#define XkbXI_IndicatorMapsMask (1L << 3)
+#define XkbXI_IndicatorStateMask (1L << 4)
+#define XkbXI_UnsupportedFeatureMask (1L << 15)
+#define XkbXI_AllFeaturesMask (0x001f)
+#define XkbXI_AllDeviceFeaturesMask (0x001e)
+
+#define XkbXI_IndicatorsMask (0x001c)
+#define XkbAllExtensionDeviceEventsMask (0x801f)
+
+ /*
+ * Per-Client Flags:
+ * - Specifies flags to be changed by the PerClientFlags request.
+ */
+#define XkbPCF_DetectableAutoRepeatMask (1L << 0)
+#define XkbPCF_GrabsUseXKBStateMask (1L << 1)
+#define XkbPCF_AutoResetControlsMask (1L << 2)
+#define XkbPCF_LookupStateWhenGrabbed (1L << 3)
+#define XkbPCF_SendEventUsesXKBState (1L << 4)
+#define XkbPCF_AllFlagsMask (0x1F)
+
+ /*
+ * Debugging flags and controls
+ */
+#define XkbDF_DisableLocks (1<<0)
+
+#endif /* _XKB_H_ */
diff --git a/system/include/X11/extensions/XKBstr.h b/system/include/X11/extensions/XKBstr.h
new file mode 100644
index 00000000..e519e657
--- /dev/null
+++ b/system/include/X11/extensions/XKBstr.h
@@ -0,0 +1,613 @@
+/************************************************************
+Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
+
+Permission to use, copy, modify, and distribute this
+software and its documentation for any purpose and without
+fee is hereby granted, provided that the above copyright
+notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
+of the software without specific prior written permission.
+Silicon Graphics makes no representation about the suitability
+of this software for any purpose. It is provided "as is"
+without any express or implied warranty.
+
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+********************************************************/
+
+#ifndef _XKBSTR_H_
+#define _XKBSTR_H_
+
+#include <X11/extensions/XKB.h>
+
+#define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
+#define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))
+
+#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
+#define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)):\
+ (int)(((h)<<8)|(l)&0x7fff))
+#else
+#define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l)))
+#endif
+
+ /*
+ * Common data structures and access macros
+ */
+
+typedef struct _XkbStateRec {
+ unsigned char group;
+ unsigned char locked_group;
+ unsigned short base_group;
+ unsigned short latched_group;
+ unsigned char mods;
+ unsigned char base_mods;
+ unsigned char latched_mods;
+ unsigned char locked_mods;
+ unsigned char compat_state;
+ unsigned char grab_mods;
+ unsigned char compat_grab_mods;
+ unsigned char lookup_mods;
+ unsigned char compat_lookup_mods;
+ unsigned short ptr_buttons;
+} XkbStateRec,*XkbStatePtr;
+#define XkbModLocks(s) ((s)->locked_mods)
+#define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s))
+#define XkbGroupLock(s) ((s)->locked_group)
+#define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s))
+#define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
+#define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
+
+typedef struct _XkbMods {
+ unsigned char mask; /* effective mods */
+ unsigned char real_mods;
+ unsigned short vmods;
+} XkbModsRec,*XkbModsPtr;
+
+typedef struct _XkbKTMapEntry {
+ Bool active;
+ unsigned char level;
+ XkbModsRec mods;
+} XkbKTMapEntryRec,*XkbKTMapEntryPtr;
+
+typedef struct _XkbKeyType {
+ XkbModsRec mods;
+ unsigned char num_levels;
+ unsigned char map_count;
+ XkbKTMapEntryPtr map;
+ XkbModsPtr preserve;
+ Atom name;
+ Atom * level_names;
+} XkbKeyTypeRec, *XkbKeyTypePtr;
+
+#define XkbNumGroups(g) ((g)&0x0f)
+#define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
+#define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
+#define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
+#define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
+#define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
+
+ /*
+ * Structures and access macros used primarily by the server
+ */
+
+typedef struct _XkbBehavior {
+ unsigned char type;
+ unsigned char data;
+} XkbBehavior;
+
+#define XkbAnyActionDataSize 7
+typedef struct _XkbAnyAction {
+ unsigned char type;
+ unsigned char data[XkbAnyActionDataSize];
+} XkbAnyAction;
+
+typedef struct _XkbModAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbModAction;
+#define XkbModActionVMods(a) \
+ ((short)(((a)->vmods1<<8)|((a)->vmods2)))
+#define XkbSetModActionVMods(a,v) \
+ (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff))
+
+typedef struct _XkbGroupAction {
+ unsigned char type;
+ unsigned char flags;
+ char group_XXX;
+} XkbGroupAction;
+#define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX))
+#define XkbSASetGroup(a,g) ((a)->group_XXX=(g))
+
+typedef struct _XkbISOAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char mask;
+ unsigned char real_mods;
+ char group_XXX;
+ unsigned char affect;
+ unsigned char vmods1;
+ unsigned char vmods2;
+} XkbISOAction;
+
+typedef struct _XkbPtrAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char high_XXX;
+ unsigned char low_XXX;
+ unsigned char high_YYY;
+ unsigned char low_YYY;
+} XkbPtrAction;
+#define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
+#define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
+#define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
+#define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
+
+typedef struct _XkbPtrBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+} XkbPtrBtnAction;
+
+typedef struct _XkbPtrDfltAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char affect;
+ char valueXXX;
+} XkbPtrDfltAction;
+#define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX))
+#define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff))
+
+typedef struct _XkbSwitchScreenAction {
+ unsigned char type;
+ unsigned char flags;
+ char screenXXX;
+} XkbSwitchScreenAction;
+#define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX))
+#define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff))
+
+typedef struct _XkbCtrlsAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char ctrls3;
+ unsigned char ctrls2;
+ unsigned char ctrls1;
+ unsigned char ctrls0;
+} XkbCtrlsAction;
+#define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),\
+ ((a)->ctrls2=(((c)>>16)&0xff)),\
+ ((a)->ctrls1=(((c)>>8)&0xff)),\
+ ((a)->ctrls0=((c)&0xff)))
+#define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\
+ (((unsigned int)(a)->ctrls2)<<16)|\
+ (((unsigned int)(a)->ctrls1)<<8)|\
+ ((unsigned int)((a)->ctrls0)))
+
+typedef struct _XkbMessageAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char message[6];
+} XkbMessageAction;
+
+typedef struct _XkbRedirectKeyAction {
+ unsigned char type;
+ unsigned char new_key;
+ unsigned char mods_mask;
+ unsigned char mods;
+ unsigned char vmods_mask0;
+ unsigned char vmods_mask1;
+ unsigned char vmods0;
+ unsigned char vmods1;
+} XkbRedirectKeyAction;
+
+#define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\
+ ((unsigned int)(a)->vmods0))
+#define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+#define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\
+ ((unsigned int)(a)->vmods_mask0))
+#define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\
+ ((a)->vmods_mask0=((m)&0xff)))
+
+typedef struct _XkbDeviceBtnAction {
+ unsigned char type;
+ unsigned char flags;
+ unsigned char count;
+ unsigned char button;
+ unsigned char device;
+} XkbDeviceBtnAction;
+
+typedef struct _XkbDeviceValuatorAction {
+ unsigned char type;
+ unsigned char device;
+ unsigned char v1_what;
+ unsigned char v1_ndx;
+ unsigned char v1_value;
+ unsigned char v2_what;
+ unsigned char v2_ndx;
+ unsigned char v2_value;
+} XkbDeviceValuatorAction;
+
+typedef union _XkbAction {
+ XkbAnyAction any;
+ XkbModAction mods;
+ XkbGroupAction group;
+ XkbISOAction iso;
+ XkbPtrAction ptr;
+ XkbPtrBtnAction btn;
+ XkbPtrDfltAction dflt;
+ XkbSwitchScreenAction screen;
+ XkbCtrlsAction ctrls;
+ XkbMessageAction msg;
+ XkbRedirectKeyAction redirect;
+ XkbDeviceBtnAction devbtn;
+ XkbDeviceValuatorAction devval;
+ unsigned char type;
+} XkbAction;
+
+typedef struct _XkbControls {
+ unsigned char mk_dflt_btn;
+ unsigned char num_groups;
+ unsigned char groups_wrap;
+ XkbModsRec internal;
+ XkbModsRec ignore_lock;
+ unsigned int enabled_ctrls;
+ unsigned short repeat_delay;
+ unsigned short repeat_interval;
+ unsigned short slow_keys_delay;
+ unsigned short debounce_delay;
+ unsigned short mk_delay;
+ unsigned short mk_interval;
+ unsigned short mk_time_to_max;
+ unsigned short mk_max_speed;
+ short mk_curve;
+ unsigned short ax_options;
+ unsigned short ax_timeout;
+ unsigned short axt_opts_mask;
+ unsigned short axt_opts_values;
+ unsigned int axt_ctrls_mask;
+ unsigned int axt_ctrls_values;
+ unsigned char per_key_repeat[XkbPerKeyBitArraySize];
+} XkbControlsRec, *XkbControlsPtr;
+
+#define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask)
+#define XkbAX_NeedOption(c,w) ((c)->ax_options&(w))
+#define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w))
+
+typedef struct _XkbServerMapRec {
+ unsigned short num_acts;
+ unsigned short size_acts;
+ XkbAction *acts;
+
+ XkbBehavior *behaviors;
+ unsigned short *key_acts;
+#if defined(__cplusplus) || defined(c_plusplus)
+ /* explicit is a C++ reserved word */
+ unsigned char *c_explicit;
+#else
+ unsigned char *explicit;
+#endif
+ unsigned char vmods[XkbNumVirtualMods];
+ unsigned short *vmodmap;
+} XkbServerMapRec, *XkbServerMapPtr;
+
+#define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
+
+ /*
+ * Structures and access macros used primarily by clients
+ */
+
+typedef struct _XkbSymMapRec {
+ unsigned char kt_index[XkbNumKbdGroups];
+ unsigned char group_info;
+ unsigned char width;
+ unsigned short offset;
+} XkbSymMapRec, *XkbSymMapPtr;
+
+typedef struct _XkbClientMapRec {
+ unsigned char size_types;
+ unsigned char num_types;
+ XkbKeyTypePtr types;
+
+ unsigned short size_syms;
+ unsigned short num_syms;
+ KeySym *syms;
+ XkbSymMapPtr key_sym_map;
+
+ unsigned char *modmap;
+} XkbClientMapRec, *XkbClientMapPtr;
+
+#define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info)
+#define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info))
+#define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
+#define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
+#define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
+#define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
+#define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
+#define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
+#define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
+
+ /*
+ * Compatibility structures and access macros
+ */
+
+typedef struct _XkbSymInterpretRec {
+ KeySym sym;
+ unsigned char flags;
+ unsigned char match;
+ unsigned char mods;
+ unsigned char virtual_mod;
+ XkbAnyAction act;
+} XkbSymInterpretRec,*XkbSymInterpretPtr;
+
+typedef struct _XkbCompatMapRec {
+ XkbSymInterpretPtr sym_interpret;
+ XkbModsRec groups[XkbNumKbdGroups];
+ unsigned short num_si;
+ unsigned short size_si;
+} XkbCompatMapRec, *XkbCompatMapPtr;
+
+typedef struct _XkbIndicatorMapRec {
+ unsigned char flags;
+ unsigned char which_groups;
+ unsigned char groups;
+ unsigned char which_mods;
+ XkbModsRec mods;
+ unsigned int ctrls;
+} XkbIndicatorMapRec, *XkbIndicatorMapPtr;
+
+#define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&\
+ (((i)->which_groups&&(i)->groups)||\
+ ((i)->which_mods&&(i)->mods.mask)||\
+ ((i)->ctrls)))
+#define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||\
+ ((i)->which_mods)||((i)->ctrls))
+
+
+typedef struct _XkbIndicatorRec {
+ unsigned long phys_indicators;
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbIndicatorRec,*XkbIndicatorPtr;
+
+typedef struct _XkbKeyNameRec {
+ char name[XkbKeyNameLength];
+} XkbKeyNameRec,*XkbKeyNamePtr;
+
+typedef struct _XkbKeyAliasRec {
+ char real[XkbKeyNameLength];
+ char alias[XkbKeyNameLength];
+} XkbKeyAliasRec,*XkbKeyAliasPtr;
+
+ /*
+ * Names for everything
+ */
+typedef struct _XkbNamesRec {
+ Atom keycodes;
+ Atom geometry;
+ Atom symbols;
+ Atom types;
+ Atom compat;
+ Atom vmods[XkbNumVirtualMods];
+ Atom indicators[XkbNumIndicators];
+ Atom groups[XkbNumKbdGroups];
+ XkbKeyNamePtr keys;
+ XkbKeyAliasPtr key_aliases;
+ Atom *radio_groups;
+ Atom phys_symbols;
+
+ unsigned char num_keys;
+ unsigned char num_key_aliases;
+ unsigned short num_rg;
+} XkbNamesRec,*XkbNamesPtr;
+
+typedef struct _XkbGeometry *XkbGeometryPtr;
+ /*
+ * Tie it all together into one big keyboard description
+ */
+typedef struct _XkbDesc {
+ struct _XDisplay * dpy;
+ unsigned short flags;
+ unsigned short device_spec;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+
+ XkbControlsPtr ctrls;
+ XkbServerMapPtr server;
+ XkbClientMapPtr map;
+ XkbIndicatorPtr indicators;
+ XkbNamesPtr names;
+ XkbCompatMapPtr compat;
+ XkbGeometryPtr geom;
+} XkbDescRec, *XkbDescPtr;
+#define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
+#define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
+#define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
+#define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
+#define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
+#define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
+#define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
+#define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
+#define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
+#define XkbKeySymEntry(d,k,sl,g) \
+ (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
+#define XkbKeyAction(d,k,n) \
+ (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
+#define XkbKeyActionEntry(d,k,sl,g) \
+ (XkbKeyHasActions(d,k)?\
+ XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
+
+#define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
+#define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
+#define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
+#define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\
+ ((k)<=(d)->max_key_code))
+#define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
+
+
+ /*
+ * The following structures can be used to track changes
+ * to a keyboard device
+ */
+typedef struct _XkbMapChanges {
+ unsigned short changed;
+ KeyCode min_key_code;
+ KeyCode max_key_code;
+ unsigned char first_type;
+ unsigned char num_types;
+ KeyCode first_key_sym;
+ unsigned char num_key_syms;
+ KeyCode first_key_act;
+ unsigned char num_key_acts;
+ KeyCode first_key_behavior;
+ unsigned char num_key_behaviors;
+ KeyCode first_key_explicit;
+ unsigned char num_key_explicit;
+ KeyCode first_modmap_key;
+ unsigned char num_modmap_keys;
+ KeyCode first_vmodmap_key;
+ unsigned char num_vmodmap_keys;
+ unsigned char pad;
+ unsigned short vmods;
+} XkbMapChangesRec,*XkbMapChangesPtr;
+
+typedef struct _XkbControlsChanges {
+ unsigned int changed_ctrls;
+ unsigned int enabled_ctrls_changes;
+ Bool num_groups_changed;
+} XkbControlsChangesRec,*XkbControlsChangesPtr;
+
+typedef struct _XkbIndicatorChanges {
+ unsigned int state_changes;
+ unsigned int map_changes;
+} XkbIndicatorChangesRec,*XkbIndicatorChangesPtr;
+
+typedef struct _XkbNameChanges {
+ unsigned int changed;
+ unsigned char first_type;
+ unsigned char num_types;
+ unsigned char first_lvl;
+ unsigned char num_lvls;
+ unsigned char num_aliases;
+ unsigned char num_rg;
+ unsigned char first_key;
+ unsigned char num_keys;
+ unsigned short changed_vmods;
+ unsigned long changed_indicators;
+ unsigned char changed_groups;
+} XkbNameChangesRec,*XkbNameChangesPtr;
+
+typedef struct _XkbCompatChanges {
+ unsigned char changed_groups;
+ unsigned short first_si;
+ unsigned short num_si;
+} XkbCompatChangesRec,*XkbCompatChangesPtr;
+
+typedef struct _XkbChanges {
+ unsigned short device_spec;
+ unsigned short state_changes;
+ XkbMapChangesRec map;
+ XkbControlsChangesRec ctrls;
+ XkbIndicatorChangesRec indicators;
+ XkbNameChangesRec names;
+ XkbCompatChangesRec compat;
+} XkbChangesRec, *XkbChangesPtr;
+
+ /*
+ * These data structures are used to construct a keymap from
+ * a set of components or to list components in the server
+ * database.
+ */
+typedef struct _XkbComponentNames {
+ char * keymap;
+ char * keycodes;
+ char * types;
+ char * compat;
+ char * symbols;
+ char * geometry;
+} XkbComponentNamesRec, *XkbComponentNamesPtr;
+
+typedef struct _XkbComponentName {
+ unsigned short flags;
+ char * name;
+} XkbComponentNameRec,*XkbComponentNamePtr;
+
+typedef struct _XkbComponentList {
+ int num_keymaps;
+ int num_keycodes;
+ int num_types;
+ int num_compat;
+ int num_symbols;
+ int num_geometry;
+ XkbComponentNamePtr keymaps;
+ XkbComponentNamePtr keycodes;
+ XkbComponentNamePtr types;
+ XkbComponentNamePtr compat;
+ XkbComponentNamePtr symbols;
+ XkbComponentNamePtr geometry;
+} XkbComponentListRec, *XkbComponentListPtr;
+
+ /*
+ * The following data structures describe and track changes to a
+ * non-keyboard extension device
+ */
+typedef struct _XkbDeviceLedInfo {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int phys_indicators;
+ unsigned int maps_present;
+ unsigned int names_present;
+ unsigned int state;
+ Atom names[XkbNumIndicators];
+ XkbIndicatorMapRec maps[XkbNumIndicators];
+} XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr;
+
+typedef struct _XkbDeviceInfo {
+ char * name;
+ Atom type;
+ unsigned short device_spec;
+ Bool has_own_state;
+ unsigned short supported;
+ unsigned short unsupported;
+
+ unsigned short num_btns;
+ XkbAction * btn_acts;
+
+ unsigned short sz_leds;
+ unsigned short num_leds;
+ unsigned short dflt_kbd_fb;
+ unsigned short dflt_led_fb;
+ XkbDeviceLedInfoPtr leds;
+} XkbDeviceInfoRec,*XkbDeviceInfoPtr;
+
+#define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL))
+#define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns))
+#define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL))
+
+typedef struct _XkbDeviceLedChanges {
+ unsigned short led_class;
+ unsigned short led_id;
+ unsigned int defined; /* names or maps changed */
+ struct _XkbDeviceLedChanges *next;
+} XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr;
+
+typedef struct _XkbDeviceChanges {
+ unsigned int changed;
+ unsigned short first_btn;
+ unsigned short num_btns;
+ XkbDeviceLedChangesRec leds;
+} XkbDeviceChangesRec,*XkbDeviceChangesPtr;
+
+#endif /* _XKBSTR_H_ */
diff --git a/system/include/X11/extensions/XShm.h b/system/include/X11/extensions/XShm.h
new file mode 100644
index 00000000..23f06511
--- /dev/null
+++ b/system/include/X11/extensions/XShm.h
@@ -0,0 +1,135 @@
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _XSHM_H_
+#define _XSHM_H_
+
+#include <X11/Xfuncproto.h>
+#include <X11/extensions/shm.h>
+
+#ifndef _XSHM_SERVER_
+typedef unsigned long ShmSeg;
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came frome a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Drawable drawable; /* drawable of request */
+ int major_code; /* ShmReqCode */
+ int minor_code; /* X_ShmPutImage */
+ ShmSeg shmseg; /* the ShmSeg used in the request */
+ unsigned long offset; /* the offset into ShmSeg used in the request */
+} XShmCompletionEvent;
+
+typedef struct {
+ ShmSeg shmseg; /* resource id */
+ int shmid; /* kernel id */
+ char *shmaddr; /* address in client */
+ Bool readOnly; /* how the server should attach it */
+} XShmSegmentInfo;
+
+_XFUNCPROTOBEGIN
+
+Bool XShmQueryExtension(
+ Display* /* dpy */
+);
+
+int XShmGetEventBase(
+ Display* /* dpy */
+);
+
+Bool XShmQueryVersion(
+ Display* /* dpy */,
+ int* /* majorVersion */,
+ int* /* minorVersion */,
+ Bool* /* sharedPixmaps */
+);
+
+int XShmPixmapFormat(
+ Display* /* dpy */
+);
+
+Bool XShmAttach(
+ Display* /* dpy */,
+ XShmSegmentInfo* /* shminfo */
+);
+
+Bool XShmDetach(
+ Display* /* dpy */,
+ XShmSegmentInfo* /* shminfo */
+);
+
+Bool XShmPutImage(
+ Display* /* dpy */,
+ Drawable /* d */,
+ GC /* gc */,
+ XImage* /* image */,
+ int /* src_x */,
+ int /* src_y */,
+ int /* dst_x */,
+ int /* dst_y */,
+ unsigned int /* src_width */,
+ unsigned int /* src_height */,
+ Bool /* send_event */
+);
+
+Bool XShmGetImage(
+ Display* /* dpy */,
+ Drawable /* d */,
+ XImage* /* image */,
+ int /* x */,
+ int /* y */,
+ unsigned long /* plane_mask */
+);
+
+XImage *XShmCreateImage(
+ Display* /* dpy */,
+ Visual* /* visual */,
+ unsigned int /* depth */,
+ int /* format */,
+ char* /* data */,
+ XShmSegmentInfo* /* shminfo */,
+ unsigned int /* width */,
+ unsigned int /* height */
+);
+
+Pixmap XShmCreatePixmap(
+ Display* /* dpy */,
+ Drawable /* d */,
+ char* /* data */,
+ XShmSegmentInfo* /* shminfo */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* depth */
+);
+
+_XFUNCPROTOEND
+#endif /* _XSHM_SERVER_ */
+
+#endif
diff --git a/system/include/X11/extensions/Xext.h b/system/include/X11/extensions/Xext.h
new file mode 100644
index 00000000..858592b7
--- /dev/null
+++ b/system/include/X11/extensions/Xext.h
@@ -0,0 +1,53 @@
+/*
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ */
+
+#ifndef _XEXT_H_
+#define _XEXT_H_
+
+#include <X11/Xfuncproto.h>
+
+_XFUNCPROTOBEGIN
+
+typedef int (*XextErrorHandler) (
+ Display * /* dpy */,
+ _Xconst char* /* ext_name */,
+ _Xconst char* /* reason */
+);
+
+extern XextErrorHandler XSetExtensionErrorHandler(
+ XextErrorHandler /* handler */
+);
+
+extern int XMissingExtension(
+ Display* /* dpy */,
+ _Xconst char* /* ext_name */
+);
+
+_XFUNCPROTOEND
+
+#define X_EXTENSION_UNKNOWN "unknown"
+#define X_EXTENSION_MISSING "missing"
+
+#endif /* _XEXT_H_ */
diff --git a/system/include/X11/extensions/extutil.h b/system/include/X11/extensions/extutil.h
new file mode 100644
index 00000000..29404d5a
--- /dev/null
+++ b/system/include/X11/extensions/extutil.h
@@ -0,0 +1,190 @@
+/*
+ *
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * Author: Jim Fulton, MIT The Open Group
+ *
+ * Xlib Extension-Writing Utilities
+ *
+ * This package contains utilities for writing the client API for various
+ * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
+ * ARE SUBJECT TO CHANGE!
+ */
+
+#ifndef _EXTUTIL_H_
+#define _EXTUTIL_H_
+
+#include <X11/extensions/Xext.h>
+
+/*
+ * We need to keep a list of open displays since the Xlib display list isn't
+ * public. We also have to per-display info in a separate block since it isn't
+ * stored directly in the Display structure.
+ */
+typedef struct _XExtDisplayInfo {
+ struct _XExtDisplayInfo *next; /* keep a linked list */
+ Display *display; /* which display this is */
+ XExtCodes *codes; /* the extension protocol codes */
+ XPointer data; /* extra data for extension to use */
+} XExtDisplayInfo;
+
+typedef struct _XExtensionInfo {
+ XExtDisplayInfo *head; /* start of list */
+ XExtDisplayInfo *cur; /* most recently used */
+ int ndisplays; /* number of displays */
+} XExtensionInfo;
+
+typedef struct _XExtensionHooks {
+ int (*create_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*copy_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*flush_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*free_gc)(
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+);
+ int (*create_font)(
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+ int (*free_font)(
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+);
+ int (*close_display)(
+ Display* /* display */,
+ XExtCodes* /* codes */
+);
+ Bool (*wire_to_event)(
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+ Status (*event_to_wire)(
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+);
+ int (*error)(
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+);
+ char *(*error_string)(
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+);
+} XExtensionHooks;
+
+extern XExtensionInfo *XextCreateExtension(
+ void
+);
+extern void XextDestroyExtension(
+ XExtensionInfo* /* info */
+);
+extern XExtDisplayInfo *XextAddDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */,
+ _Xconst char* /* ext_name */,
+ XExtensionHooks* /* hooks */,
+ int /* nevents */,
+ XPointer /* data */
+);
+extern int XextRemoveDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+);
+extern XExtDisplayInfo *XextFindDisplay(
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+);
+
+#define XextHasExtension(i) ((i) && ((i)->codes))
+#define XextCheckExtension(dpy,i,name,val) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
+#define XextSimpleCheckExtension(dpy,i,name) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
+
+
+/*
+ * helper macros to generate code that is common to all extensions; caller
+ * should prefix it with static if extension source is in one file; this
+ * could be a utility function, but have to stack 6 unused arguments for
+ * something that is called many, many times would be bad.
+ */
+#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
+XExtDisplayInfo *proc (Display *dpy) \
+{ \
+ XExtDisplayInfo *dpyinfo; \
+ if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
+ if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
+ dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
+ return dpyinfo; \
+}
+
+#define XEXT_FIND_DISPLAY_PROTO(proc) \
+ XExtDisplayInfo *proc(Display *dpy)
+
+#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
+int proc (Display *dpy, XExtCodes *codes) \
+{ \
+ return XextRemoveDisplay (extinfo, dpy); \
+}
+
+#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
+ int proc(Display *dpy, XExtCodes *codes)
+
+#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
+char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
+{ \
+ code -= codes->first_error; \
+ if (code >= 0 && code < nerr) { \
+ char tmp[256]; \
+ sprintf (tmp, "%s.%d", extname, code); \
+ XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
+ return buf; \
+ } \
+ return (char *)0; \
+}
+
+#define XEXT_ERROR_STRING_PROTO(proc) \
+ char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
+#endif
diff --git a/system/include/X11/extensions/shm.h b/system/include/X11/extensions/shm.h
new file mode 100644
index 00000000..e076402a
--- /dev/null
+++ b/system/include/X11/extensions/shm.h
@@ -0,0 +1,44 @@
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _SHM_H_
+#define _SHM_H_
+
+#define SHMNAME "MIT-SHM"
+
+#define SHM_MAJOR_VERSION 1 /* current version numbers */
+#define SHM_MINOR_VERSION 1
+
+#define ShmCompletion 0
+#define ShmNumberEvents (ShmCompletion + 1)
+
+#define BadShmSeg 0
+#define ShmNumberErrors (BadShmSeg + 1)
+
+
+#endif /* _SHM_H_ */
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 403d8084..390533f3 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -17,6 +17,8 @@ namespace emscripten {
BY_EMVAL = 2,
};
+#define EMSCRIPTEN_ALWAYS_INLINE __attribute__((always_inline))
+
namespace internal {
typedef long GenericEnumValue;
@@ -533,6 +535,8 @@ namespace emscripten {
template<typename ClassType>
class value_array : public internal::noncopyable {
public:
+ typedef ClassType class_type;
+
value_array(const char* name) {
using namespace internal;
_embind_register_value_array(
@@ -605,6 +609,8 @@ namespace emscripten {
template<typename ClassType>
class value_object : public internal::noncopyable {
public:
+ typedef ClassType class_type;
+
value_object(const char* name) {
using namespace internal;
_embind_register_value_object(
@@ -689,6 +695,10 @@ namespace emscripten {
static void* share(void* v) {
return 0; // no sharing
}
+
+ static PointerType* construct_null() {
+ return new PointerType;
+ }
};
// specialize if you have a different pointer type
@@ -720,6 +730,10 @@ namespace emscripten {
val_deleter(val::take_ownership(v)));
}
+ static PointerType* construct_null() {
+ return new PointerType;
+ }
+
private:
class val_deleter {
public:
@@ -745,6 +759,8 @@ namespace emscripten {
template<typename T>
class wrapper : public T {
public:
+ typedef T class_type;
+
explicit wrapper(val&& wrapped)
: wrapped(std::forward<val>(wrapped))
{}
@@ -794,13 +810,14 @@ namespace emscripten {
// NOTE: this returns the class type, not the pointer type
template<typename T>
inline TYPEID getActualType(T* ptr) {
- assert(ptr);
return reinterpret_cast<TYPEID>(&typeid(*ptr));
};
}
template<typename BaseClass>
struct base {
+ typedef BaseClass class_type;
+
template<typename ClassType>
static void verify() {
static_assert(!std::is_same<ClassType, BaseClass>::value, "Base must not have same type as class");
@@ -847,6 +864,9 @@ namespace emscripten {
template<typename ClassType, typename BaseSpecifier = internal::NoBaseClass>
class class_ {
public:
+ typedef ClassType class_type;
+ typedef BaseSpecifier base_specifier;
+
class_() = delete;
explicit class_(const char* name) {
@@ -867,7 +887,7 @@ namespace emscripten {
}
template<typename PointerType>
- class_& smart_ptr() {
+ const class_& smart_ptr() const {
using namespace internal;
typedef smart_ptr_trait<PointerType> PointerTrait;
@@ -881,21 +901,21 @@ namespace emscripten {
typeid(PointerType).name(),
PointerTrait::get_sharing_policy(),
reinterpret_cast<GenericFunction>(&PointerTrait::get),
- reinterpret_cast<GenericFunction>(&operator_new<PointerType>),
+ reinterpret_cast<GenericFunction>(&PointerTrait::construct_null),
reinterpret_cast<GenericFunction>(&PointerTrait::share),
reinterpret_cast<GenericFunction>(&raw_destructor<PointerType>));
return *this;
};
template<typename... ConstructorArgs, typename... Policies>
- class_& constructor(Policies... policies) {
+ const class_& constructor(Policies... policies) const {
return constructor(
&internal::operator_new<ClassType, ConstructorArgs...>,
policies...);
}
template<typename... Args, typename ReturnType, typename... Policies>
- class_& constructor(ReturnType (*factory)(Args...), Policies...) {
+ const class_& constructor(ReturnType (*factory)(Args...), Policies...) const {
using namespace internal;
// TODO: allows all raw pointers... policies need a rethink
@@ -910,7 +930,7 @@ namespace emscripten {
}
template<typename SmartPtr, typename... Args, typename... Policies>
- class_& smart_ptr_constructor(SmartPtr (*factory)(Args...), Policies...) {
+ const class_& smart_ptr_constructor(SmartPtr (*factory)(Args...), Policies...) const {
using namespace internal;
smart_ptr<SmartPtr>();
@@ -926,7 +946,7 @@ namespace emscripten {
}
template<typename WrapperType, typename PointerType = WrapperType*>
- class_& allow_subclass() {
+ const class_& allow_subclass() const {
using namespace internal;
auto cls = class_<WrapperType, base<ClassType>>(typeid(WrapperType).name())
@@ -940,7 +960,7 @@ namespace emscripten {
}
template<typename ReturnType, typename... Args, typename... Policies>
- class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...), Policies...) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...), Policies...) const {
using namespace internal;
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<ClassType>, Args...> args;
@@ -955,7 +975,7 @@ namespace emscripten {
}
template<typename ReturnType, typename... Args, typename... Policies>
- class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...) const, Policies...) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (ClassType::*memberFunction)(Args...) const, Policies...) const {
using namespace internal;
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<const ClassType>, Args...> args;
@@ -970,7 +990,7 @@ namespace emscripten {
}
template<typename ReturnType, typename ThisType, typename... Args, typename... Policies>
- class_& function(const char* methodName, ReturnType (*function)(ThisType, Args...), Policies...) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& function(const char* methodName, ReturnType (*function)(ThisType, Args...), Policies...) const {
using namespace internal;
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, ThisType, Args...> args;
@@ -985,7 +1005,7 @@ namespace emscripten {
}
template<typename FieldType, typename = typename std::enable_if<!std::is_function<FieldType>::value>::type>
- class_& property(const char* fieldName, const FieldType ClassType::*field) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, const FieldType ClassType::*field) const {
using namespace internal;
_embind_register_class_property(
@@ -1001,7 +1021,7 @@ namespace emscripten {
}
template<typename FieldType, typename = typename std::enable_if<!std::is_function<FieldType>::value>::type>
- class_& property(const char* fieldName, FieldType ClassType::*field) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, FieldType ClassType::*field) const {
using namespace internal;
_embind_register_class_property(
@@ -1017,7 +1037,7 @@ namespace emscripten {
}
template<typename Getter>
- class_& property(const char* fieldName, Getter getter) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, Getter getter) const {
using namespace internal;
typedef GetterPolicy<Getter> GP;
_embind_register_class_property(
@@ -1033,7 +1053,7 @@ namespace emscripten {
}
template<typename Getter, typename Setter>
- class_& property(const char* fieldName, Getter getter, Setter setter) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& property(const char* fieldName, Getter getter, Setter setter) const {
using namespace internal;
typedef GetterPolicy<Getter> GP;
typedef SetterPolicy<Setter> SP;
@@ -1050,7 +1070,7 @@ namespace emscripten {
}
template<typename ReturnType, typename... Args, typename... Policies>
- class_& class_function(const char* methodName, ReturnType (*classMethod)(Args...), Policies...) {
+ EMSCRIPTEN_ALWAYS_INLINE const class_& class_function(const char* methodName, ReturnType (*classMethod)(Args...), Policies...) const {
using namespace internal;
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, Args...> args;
@@ -1157,6 +1177,8 @@ namespace emscripten {
template<typename EnumType>
class enum_ {
public:
+ typedef EnumType enum_type;
+
enum_(const char* name) {
_embind_register_enum(
internal::TypeID<EnumType>::get(),
@@ -1199,7 +1221,7 @@ namespace emscripten {
_embind_register_constant(
name,
TypeID<const ConstantType&>::get(),
- asGenericValue(BindingType<const ConstantType&>::toWireType(v)));
+ asGenericValue(BT::toWireType(v)));
}
}
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 918059f2..7a2b8175 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -14,7 +14,7 @@
extern "C" {
#endif
-#if !EMSCRIPTEN
+#if !__EMSCRIPTEN__
#include <SDL/SDL.h> /* for SDL_Delay in async_call */
#endif
@@ -40,28 +40,34 @@ extern "C" {
#define EM_ASM(...) emscripten_asm_const(#__VA_ARGS__)
/*
- * Input-output versions of EM_ASM. EM_ASM_INT receives arguments of
- * either int or double type and returns an int; EM_ASM_DOUBLE
- * receives similar arguments (int or double) but returns a double.
- * Arguments arrive as $0, $1 etc; output value should be returned:
+ * Input-output versions of EM_ASM.
+ *
+ * EM_ASM_ (an extra _ is added) allows sending values (ints
+ * or doubles) into the code. If you also want a return value,
+ * EM_ASM_INT receives arguments (of int or double type)
+ * and returns an int; EM_ASM_DOUBLE does the same and returns
+ * a double.
+ *
+ * Arguments arrive as $0, $1 etc. The output value should be returned:
*
* int x = EM_ASM_INT({
* console.log('I received: ' + [$0, $1]);
* return $0 + $1;
* }, calc(), otherCalc());
*
- * Note the {,}
+ * Note the { and }. If you just want to receive an output value
+ * (int or double) but *not* to pass any values, you can use
+ * EM_ASM_INT_V and EM_ASM_DOUBLE_V respectively.
*/
+#define EM_ASM_(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
#define EM_ASM_INT(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
#define EM_ASM_DOUBLE(code, ...) emscripten_asm_const_double(#code, __VA_ARGS__)
+#define EM_ASM_INT_V(code) emscripten_asm_const_int(#code)
+#define EM_ASM_DOUBLE_V(code) emscripten_asm_const_double(#code)
/*
- * Forces LLVM to not dead-code-eliminate a function. Note that
- * you still need to use EXPORTED_FUNCTIONS so it stays alive
- * in JS, e.g.
- * emcc -s EXPORTED_FUNCTIONS=["_main", "_myfunc"]
- * and in the source file
- * void EMSCRIPTEN_KEEPALIVE myfunc() {..}
+ * Forces LLVM to not dead-code-eliminate a function. This also
+ * exports the function, as if you added it to EXPORTED_FUNCTIONS.
*/
#define EMSCRIPTEN_KEEPALIVE __attribute__((used))
@@ -96,7 +102,13 @@ extern void emscripten_async_load_script(const char *script, void (*onload)(), v
* Set a C function as the main event loop. The JS environment
* will call that function at a specified number of frames per
* second. Setting 0 or a negative value as the fps will use
- * the browser's requestAnimationFrame mechanism.
+ * the browser's requestAnimationFrame mechanism. This is
+ * *HIGHLY* recommended if you are doing rendering, as
+ * the browser's requestAnimationFrame will make sure you
+ * render at a proper smooth rate that lines up with the
+ * the browser and monitor in a proper way. (If you do not
+ * render at all in your application, then you should pick a
+ * specific frame rate that makes sense for your code.)
*
* Pausing and resuming the main loop is useful if your app
* needs to perform some synchronous operation, for example
@@ -106,6 +118,9 @@ extern void emscripten_async_load_script(const char *script, void (*onload)(), v
* asynchronous callbacks, but you must pause the main
* loop until they complete.
*
+ * If you want your main loop function to receive a void*
+ * argument, use emscripten_set_main_loop_arg.
+
* @simulate_infinite_loop If true, this function will throw an
* exception in order to stop execution of the caller. This
* will lead to the main loop being entered instead of code
@@ -122,8 +137,9 @@ extern void emscripten_async_load_script(const char *script, void (*onload)(), v
* you created an object on the stack, it will be cleaned up
* before the main loop will be called the first time.
*/
-#if EMSCRIPTEN
+#if __EMSCRIPTEN__
extern void emscripten_set_main_loop(void (*func)(), int fps, int simulate_infinite_loop);
+extern void emscripten_set_main_loop_arg(void (*func)(void*), void *arg, int fps, int simulate_infinite_loop);
extern void emscripten_pause_main_loop();
extern void emscripten_resume_main_loop();
extern void emscripten_cancel_main_loop();
@@ -146,7 +162,7 @@ extern void emscripten_cancel_main_loop();
* are not counted, do not block the main loop, and can fire
* at specific time in the future.
*/
-#if EMSCRIPTEN
+#if __EMSCRIPTEN__
extern void _emscripten_push_main_loop_blocker(void (*func)(void *), void *arg, const char *name);
extern void _emscripten_push_uncounted_main_loop_blocker(void (*func)(void *), void *arg, const char *name);
#else
@@ -168,7 +184,7 @@ inline void _emscripten_push_uncounted_main_loop_blocker(void (*func)(void *), v
* to 10, then push 10 blockers, as they complete the user will
* see x/10 and so forth.
*/
-#if EMSCRIPTEN
+#if __EMSCRIPTEN__
extern void emscripten_set_main_loop_expected_blockers(int num);
#else
inline void emscripten_set_main_loop_expected_blockers(int num) {}
@@ -183,7 +199,7 @@ inline void emscripten_set_main_loop_expected_blockers(int num) {}
* If millis is negative, the browser's requestAnimationFrame
* mechanism is used.
*/
-#if EMSCRIPTEN
+#if __EMSCRIPTEN__
extern void emscripten_async_call(void (*func)(void *), void *arg, int millis);
#else
inline void emscripten_async_call(void (*func)(void *), void *arg, int millis) {
@@ -227,7 +243,14 @@ void emscripten_get_canvas_size(int *width, int *height, int *isFullscreen);
* absolute time, and is only meaningful in comparison to
* other calls to this function. The unit is ms.
*/
+#if __EMSCRIPTEN__
double emscripten_get_now();
+#else
+#include <time.h>
+double emscripten_get_now() {
+ return (1000*clock())/(double)CLOCKS_PER_SEC;
+}
+#endif
/*
* Simple random number generation in [0, 1), maps to Math.random().
@@ -408,6 +431,27 @@ int emscripten_get_worker_queue_size(worker_handle worker);
#define EMSCRIPTEN_NETWORK_WEBRTC 1
void emscripten_set_network_backend(int backend);
+/*
+ * Returns the value of a compiler setting. For example
+ *
+ * emscripten_get_compiler_setting("PRECISE_F32")
+ *
+ * will return an integer representing the value of
+ * PRECISE_F32 during compilation. For values containing
+ * anything other than an integer, a string is returned
+ * (you will need to cast the int return value to a char*).
+ *
+ * Some useful things this can do is provide the
+ * version of emscripten ("EMSCRIPTEN_VERSION"), the optimization
+ * level ("OPT_LEVEL"), debug level ("DEBUG_LEVEL"), etc.
+ *
+ * For this command to work, you must build with
+ * -s RETAIN_COMPILER_SETTINGS=1
+ * as otherwise we do not want to increase the build size
+ * with this metadata.
+ */
+int emscripten_get_compiler_setting(const char *name);
+
/* Internal APIs. Be careful with these. */
/*
diff --git a/system/include/emscripten/html5.h b/system/include/emscripten/html5.h
new file mode 100644
index 00000000..6109d87f
--- /dev/null
+++ b/system/include/emscripten/html5.h
@@ -0,0 +1,635 @@
+#ifndef __emscripten_events_h__
+#define __emscripten_events_h__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This file defines Emscripten low-level glue bindings for interfacing with the following HTML5 APIs:
+ * - DOM Level 3 Events: Keyboard, Mouse, Mouse Wheel, Resize, Scroll, Focus. See https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html
+ * - DeviceOrientation Events for gyro and accelerometer. See http://www.w3.org/TR/orientation-event/
+ * - Screen Orientation Events for portrait/landscape handling. See https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html
+ * - Fullscreen Events for browser canvas fullscreen modes transitioning. See https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
+ * - Pointer Lock Events for relative-mode mouse motion control. See http://www.w3.org/TR/pointerlock/
+ * - Vibration API for mobile device haptic vibration feedback control. See http://dev.w3.org/2009/dap/vibration/
+ * - Page Visibility Events for power management control. See http://www.w3c-test.org/webperf/specs/PageVisibility/
+ * - Touch Events. See http://www.w3.org/TR/touch-events/
+ * - Gamepad API. See http://www.w3.org/TR/gamepad/
+ * - Beforeunload event. See http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#beforeunloadevent
+ * - WebGL context events. See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+ *
+ * Most web APIs are event-based, which means that the functionality is accessed by registering a callback function to be called when the event occurs. The
+ * Gamepad API is currently an exception, for which only a polling API is available. For some APIs, both an event-based and a polling-based API is exposed.
+ *
+ * Calling a callback registration function with a null pointer function causes an unregistration of that callback from the given target element. All event
+ * handlers are also automatically unregistered when the C exit() function is invoked during the atexit handler pass. Use either the function
+ * emscripten_set_main_loop() or set Module.noExitRuntime = true; to make sure that leaving main() will not immediately cause an exit() and clean up the
+ * event handlers.
+ *
+ * Throughout this file, the function signatures have a 'target' parameter. This parameter allows specifying the HTML Element ID to which the callback
+ * registration is to be applied to. This field has the following special meanings:
+ * - 0 or NULL: A default element is chosen automatically based on the event type, which should be reasonable most of the time.
+ * - "#window": The event listener is applied to the JS 'window' object.
+ * - "#document": The event listener is applied to the JS 'document' object.
+ * - "#screen": The event listener is applied to the JS 'window.screen' object.
+ * - "#canvas": The event listener is applied to the Emscripten default WebGL canvas element.
+ * - Any other string without a leading hash "#" sign: The event listener is applied to the element by the given ID on the page.
+ *
+ * The callback hook functions also take in a 'userData' parameter. This is a custom user-defineable value that will be carried through unchanged to all
+ * invocations of the registered event callback. Use this e.g. to pass a pointer to a C++ class or similar to enclose the C API in a clean object-oriented manner.
+ *
+ * Callback handlers that return an EM_BOOL may return nonzero to signal that the default action for that event is to be suppressed. This will call
+ * the .preventDefault(); member on the event. Returning zero will cause the default browser event action to be carried out.
+ *
+ * Most functions return the result using the type EMSCRIPTEN_RESULT. Nonzero and positive values denote success. Negative values
+ * signal failure. None of the functions fail or abort by throwing a JS or C++ exception. If a particular browser does not support the given feature,
+ * the value EMSCRIPTEN_RESULT_NOT_SUPPORTED will be returned at the time the callback is registered.
+ *
+ * Due to web security purposes, the pointer lock and fullscreen requests can only be invoked from inside an user-originated event handler. Such requests
+ * are automatically deferred until the user presses a keyboard or mouse button the next time.
+ */
+
+#define EMSCRIPTEN_EVENT_KEYPRESS 1
+#define EMSCRIPTEN_EVENT_KEYDOWN 2
+#define EMSCRIPTEN_EVENT_KEYUP 3
+#define EMSCRIPTEN_EVENT_CLICK 4
+#define EMSCRIPTEN_EVENT_MOUSEDOWN 5
+#define EMSCRIPTEN_EVENT_MOUSEUP 6
+#define EMSCRIPTEN_EVENT_DBLCLICK 7
+#define EMSCRIPTEN_EVENT_MOUSEMOVE 8
+#define EMSCRIPTEN_EVENT_WHEEL 9
+#define EMSCRIPTEN_EVENT_RESIZE 10
+#define EMSCRIPTEN_EVENT_SCROLL 11
+#define EMSCRIPTEN_EVENT_BLUR 12
+#define EMSCRIPTEN_EVENT_FOCUS 13
+#define EMSCRIPTEN_EVENT_FOCUSIN 14
+#define EMSCRIPTEN_EVENT_FOCUSOUT 15
+#define EMSCRIPTEN_EVENT_DEVICEORIENTATION 16
+#define EMSCRIPTEN_EVENT_DEVICEMOTION 17
+#define EMSCRIPTEN_EVENT_ORIENTATIONCHANGE 18
+#define EMSCRIPTEN_EVENT_FULLSCREENCHANGE 19
+#define EMSCRIPTEN_EVENT_POINTERLOCKCHANGE 20
+#define EMSCRIPTEN_EVENT_VISIBILITYCHANGE 21
+#define EMSCRIPTEN_EVENT_TOUCHSTART 22
+#define EMSCRIPTEN_EVENT_TOUCHEND 23
+#define EMSCRIPTEN_EVENT_TOUCHMOVE 24
+#define EMSCRIPTEN_EVENT_TOUCHCANCEL 25
+#define EMSCRIPTEN_EVENT_GAMEPADCONNECTED 26
+#define EMSCRIPTEN_EVENT_GAMEPADDISCONNECTED 27
+#define EMSCRIPTEN_EVENT_BEFOREUNLOAD 28
+#define EMSCRIPTEN_EVENT_BATTERYCHARGINGCHANGE 29
+#define EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE 30
+#define EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST 31
+#define EMSCRIPTEN_EVENT_WEBGLCONTEXTRESTORED 32
+
+#define EMSCRIPTEN_RESULT int
+
+// The operation succeeded
+#define EMSCRIPTEN_RESULT_SUCCESS 0
+
+// For web security reasons, the requested operation cannot be completed now, but was deferred for completion in the next event handler.
+#define EMSCRIPTEN_RESULT_DEFERRED 1
+
+// The given operation is not supported by this browser or the target element.
+#define EMSCRIPTEN_RESULT_NOT_SUPPORTED -1
+
+// For web security reasons, the requested operation could not be completed now, and it failed since the user requested the operation to not be deferred.
+#define EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED -2
+
+// The given target element for the operation is invalid.
+#define EMSCRIPTEN_RESULT_INVALID_TARGET -3
+
+// The given target element for the operation was not found.
+#define EMSCRIPTEN_RESULT_UNKNOWN_TARGET -4
+
+// An invalid parameter was passed to the function.
+#define EMSCRIPTEN_RESULT_INVALID_PARAM -5
+
+// The operation failed due to some generic reason.
+#define EMSCRIPTEN_RESULT_FAILED -6
+
+// Operation failed since no data is currently available.
+#define EMSCRIPTEN_RESULT_NO_DATA -7
+
+#define EM_BOOL int
+#define EM_UTF8 char
+
+#define DOM_KEY_LOCATION int
+#define DOM_KEY_LOCATION_STANDARD 0x00
+#define DOM_KEY_LOCATION_LEFT 0x01
+#define DOM_KEY_LOCATION_RIGHT 0x02
+#define DOM_KEY_LOCATION_NUMPAD 0x03
+
+/*
+ * The event structure passed in keyboard events keypress, keydown and keyup.
+ * https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#keys
+ */
+typedef struct EmscriptenKeyboardEvent {
+ // The printed representation of the pressed key.
+ EM_UTF8 key[32];
+ // A string that identifies the physical key being pressed. The value is not affected by the current keyboard
+ // layout or modifier state, so a particular key will always return the same value.
+ EM_UTF8 code[32];
+ // Indicates the location of the key on the keyboard. One of the DOM_KEY_LOCATION_ values.
+ unsigned long location;
+ // Specifies which modifiers were active during the key event.
+ EM_BOOL ctrlKey;
+ EM_BOOL shiftKey;
+ EM_BOOL altKey;
+ EM_BOOL metaKey;
+ // Specifies if this keyboard event represents a repeated press.
+ EM_BOOL repeat;
+ // A locale string indicating the locale the keyboard is configured for. This may be the empty string if the
+ // browser or device doesn't know the keyboard's locale.
+ EM_UTF8 locale[32];
+ // The following fields are values from previous versions of the DOM key events specifications.
+ // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent?redirectlocale=en-US&redirectslug=DOM%2FKeyboardEvent
+ // The character representation of the key.
+ EM_UTF8 charValue[32];
+ // The Unicode reference number of the key; this attribute is used only by the keypress event. For keys whose char attribute
+ // contains multiple characters, this is the Unicode value of the first character in that attribute.
+ unsigned long charCode;
+ // A system and implementation dependent numerical code identifying the unmodified value of the pressed key.
+ unsigned long keyCode;
+ // A system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as keyCode.
+ unsigned long which;
+} EmscriptenKeyboardEvent;
+
+/*
+ * Registers a callback function for receiving browser-generated keyboard input events.
+ * See https://developer.mozilla.org/en/DOM/Event/UIEvent/KeyEvent
+ * and http://www.javascriptkit.com/jsref/eventkeyboardmouse.shtml
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_keypress_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_keydown_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_keyup_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData));
+
+/*
+ * The event structure passed in mouse events click, mousedown, mouseup, dblclick and mousemove.
+ * https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-MouseEvent
+ */
+typedef struct EmscriptenMouseEvent {
+ // A timestamp of when this data was generated by the browser. This is an absolute wallclock time in milliseconds.
+ double timestamp;
+ // The coordinate relative to the browser screen coordinate system.
+ long screenX;
+ long screenY;
+ // The coordinate relative to the viewport associate with the event.
+ long clientX;
+ long clientY;
+ // Specifies which modifiers were active during the mouse event.
+ EM_BOOL ctrlKey;
+ EM_BOOL shiftKey;
+ EM_BOOL altKey;
+ EM_BOOL metaKey;
+ // Which pointer device button changed state.
+ unsigned short button;
+ // A bitmask that indicates which combinations of mouse buttons were being held down at the time of the event.
+ unsigned short buttons;
+ // If pointer lock is active, these two extra fields give relative mouse movement since the last event.
+ long movementX;
+ long movementY;
+ // Emscripten-specific extension: These fields give the mouse coordinates mapped to the Emscripten canvas client area.
+ long canvasX;
+ long canvasY;
+ // Pad this struct to multiple of 8 bytes to make WheelEvent unambiguously align to 8 bytes.
+ long padding;
+} EmscriptenMouseEvent;
+
+/*
+ * Registers a callback function for receiving browser-generated mouse input events.
+ * See https://developer.mozilla.org/en/DOM/MouseEvent
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_click_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_mousedown_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_mouseup_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_dblclick_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_mousemove_callback(const char *target, void *userData, int useCapture, int (*func)(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData));
+/*
+ * Returns the most recently received mouse event state. Note that for this function call to succeed, emscripten_set_xx_callback must have first
+ * been called with one of the mouse event types and a non-zero callback function pointer to enable the Mouse state capture.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_mouse_status(EmscriptenMouseEvent *mouseState);
+
+#define DOM_DELTA_PIXEL 0x00
+#define DOM_DELTA_LINE 0x01
+#define DOM_DELTA_PAGE 0x02
+
+/*
+ * The event structure passed in mouse wheelevent.
+ * https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-WheelEvent
+ */
+typedef struct EmscriptenWheelEvent {
+ // Specifies general mouse information related to this event.
+ EmscriptenMouseEvent mouse;
+ // Measures along different axes the movement of the wheel.
+ double deltaX;
+ double deltaY;
+ double deltaZ;
+ // One of the DOM_DELTA_ values that indicates the units of measurement for the delta values.
+ unsigned long deltaMode;
+} EmscriptenWheelEvent;
+
+/*
+ * Registers a callback function for receiving browser-generated mouse wheel events.
+ * See http://www.w3.org/TR/DOM-Level-3-Events/#event-type-wheel
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_wheel_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenWheelEvent *wheelEvent, void *userData));
+
+/*
+ * The event structure passed in DOM element resize and scroll events.
+ * https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-UIEvent
+ */
+typedef struct EmscriptenUiEvent {
+ // Specifies detail information about this event.
+ long detail;
+ // The clientWidth/clientHeight of the document.body element.
+ int documentBodyClientWidth;
+ int documentBodyClientHeight;
+ // The innerWidth/innerHeight of the window element.
+ int windowInnerWidth;
+ int windowInnerHeight;
+ // The outerWidth/outerHeight of the window element.
+ int windowOuterWidth;
+ int windowOuterHeight;
+ // The page scroll position.
+ int scrollTop;
+ int scrollLeft;
+} EmscriptenUiEvent;
+
+/*
+ * Registers a callback function for receiving DOM element resize and scroll events.
+ * See https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-resize
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_resize_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenUiEvent *uiEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_scroll_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenUiEvent *uiEvent, void *userData));
+
+/*
+ * The event structure passed in DOM element blur, focus, focusin and focusout events.
+ * https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-FocusEvent
+ */
+typedef struct EmscriptenFocusEvent {
+ // The nodeName of the target HTML Element. See https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeName
+ EM_UTF8 nodeName[128];
+ // The HTML Element ID of the target element.
+ EM_UTF8 id[128];
+} EmscriptenFocusEvent;
+
+/*
+ * Registers a callback function for receiving DOM element blur, focus, focusin and focusout events.
+ * See https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-blur
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_blur_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_focus_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_focusin_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_focusout_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenFocusEvent *focusEvent, void *userData));
+
+/*
+ * The event structure passed in the deviceorientation event.
+ * http://dev.w3.org/geo/api/spec-source-orientation.html#deviceorientation
+ */
+typedef struct EmscriptenDeviceOrientationEvent {
+ // Absolute wallclock time in msec units of when the event occurred.
+ double timestamp;
+ // The orientation of the device in terms of the transformation from a coordinate frame fixed on the Earth to a coordinate frame fixed in the device.
+ double alpha;
+ double beta;
+ double gamma;
+ // If false, the orientation is only relative to some other bas orinetation, not to the fixed coordinate frame.
+ EM_BOOL absolute;
+} EmscriptenDeviceOrientationEvent;
+
+/*
+ * Registers a callback function for receiving the deviceorientation event.
+ * See http://dev.w3.org/geo/api/spec-source-orientation.html
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_deviceorientation_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenDeviceOrientationEvent *orientationEvent, void *userData));
+/*
+ * Returns the most recently received deviceorientation event state. Note that for this function call to succeed, emscripten_set_deviceorientation_callback
+ * must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the Device Orientation state capture.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_deviceorientation_status(EmscriptenDeviceOrientationEvent *orientationState);
+
+/*
+ * The event structure passed in the devicemotion event.
+ * http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
+ */
+typedef struct EmscriptenDeviceMotionEvent {
+ // Absolute wallclock time in msec units of when the event occurred.
+ double timestamp;
+ // Acceleration of the device excluding gravity.
+ double accelerationX;
+ double accelerationY;
+ double accelerationZ;
+ // Acceleration of the device including gravity.
+ double accelerationIncludingGravityX;
+ double accelerationIncludingGravityY;
+ double accelerationIncludingGravityZ;
+ // The rotational delta of the device.
+ double rotationRateAlpha;
+ double rotationRateBeta;
+ double rotationRateGamma;
+} EmscriptenDeviceMotionEvent;
+
+/*
+ * Registers a callback function for receiving the devicemotion event.
+ * See http://dev.w3.org/geo/api/spec-source-orientation.html
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_devicemotion_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenDeviceMotionEvent *motionEvent, void *userData));
+/*
+ * Returns the most recently received deviceomotion event state. Note that for this function call to succeed, emscripten_set_devicemotion_callback
+ * must have first been called with one of the mouse event types and a non-zero callback function pointer to enable the Device Motion state capture.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_devicemotion_status(EmscriptenDeviceMotionEvent *motionState);
+
+#define EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY 1
+#define EMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY 2
+#define EMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY 4
+#define EMSCRIPTEN_ORIENTATION_LANDSCAPE_SECONDARY 8
+
+/*
+ * The event structure passed in the orientationchange event.
+ * https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html
+ */
+typedef struct EmscriptenOrientationChangeEvent {
+ // One of EM_ORIENTATION_PORTRAIT_xx fields, or -1 if unknown.
+ int orientationIndex;
+ // Emscripten-specific extension: Some browsers refer to 'window.orientation', so report that as well.
+ // Orientation angle in degrees. 0: "default orientation", i.e. default upright orientation to hold the mobile device in. Could be either landscape or portrait.
+ int orientationAngle;
+} EmscriptenOrientationChangeEvent;
+
+/*
+ * Registers a callback function for receiving the orientationchange event.
+ * https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_orientationchange_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenOrientationChangeEvent *orientationChangeEvent, void *userData));
+/*
+ * Returns the current device orientation state.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_orientation_status(EmscriptenOrientationChangeEvent *orientationStatus);
+/*
+ * Locks the screen orientation to the given set of allowed orientations.
+ * allowedOrientations: A bitfield set of EM_ORIENTATION_xx flags.
+ */
+extern EMSCRIPTEN_RESULT emscripten_lock_orientation(int allowedOrientations);
+/*
+ * Allows the screen to turn again into any orientation.
+ */
+extern EMSCRIPTEN_RESULT emscripten_unlock_orientation();
+
+/*
+ * The event structure passed in the fullscreenchange event.
+ * https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
+ */
+typedef struct EmscriptenFullscreenChangeEvent {
+ // Specifies whether an element on the browser page is currently fullscreen.
+ EM_BOOL isFullscreen;
+ // Specifies if the current page has the ability to display elements fullscreen.
+ EM_BOOL fullscreenEnabled;
+ // The nodeName of the target HTML Element that is in full screen mode. See https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeName
+ // If isFullscreen is false, then nodeName, id and elementWidth/Height specify information about the element that just exited fullscreen mode.
+ EM_UTF8 nodeName[128];
+ // The HTML Element ID of the target HTML element that is in full screen mode.
+ EM_UTF8 id[128];
+ // The new pixel size of the element that changed fullscreen status.
+ int elementWidth;
+ int elementHeight;
+ // The size of the whole screen, in pixels.
+ int screenWidth;
+ int screenHeight;
+} EmscriptenFullscreenChangeEvent;
+
+/*
+ * Registers a callback function for receiving the fullscreenchange event.
+ * https://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_fullscreenchange_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenFullscreenChangeEvent *fullscreenChangeEvent, void *userData));
+/*
+ * Returns the current page fullscreen state.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_fullscreen_status(EmscriptenFullscreenChangeEvent *fullscreenStatus);
+/*
+ * Requests the given target element to transition to full screen mode.
+ * Note: This function can only run inside a user-generated JavaScript event handler.
+ * deferUntilInEventHandler: If true and you called this function outside an event callback, this request will
+ * be queued to be executed the next time a JS event handler runs. If false, this
+ * function will instead fail if not running inside a JS event handler.
+ */
+extern EMSCRIPTEN_RESULT emscripten_request_fullscreen(const char *target, int deferUntilInEventHandler);
+/*
+ * Returns back to windowed browsing mode.
+ */
+extern EMSCRIPTEN_RESULT emscripten_exit_fullscreen();
+
+/*
+ * The event structure passed in the pointerlockchange event.
+ * http://www.w3.org/TR/pointerlock/
+ */
+typedef struct EmscriptenPointerlockChangeEvent {
+ // Specifies whether an element on the browser page currently has pointer lock enabled.
+ EM_BOOL isActive;
+ // The nodeName of the target HTML Element that has the pointer lock active. See https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeName
+ EM_UTF8 nodeName[128];
+ // The HTML Element ID of the target HTML element that has the pointer lock active.
+ EM_UTF8 id[128];
+} EmscriptenPointerlockChangeEvent;
+
+/*
+ * Registers a callback function for receiving the pointerlockchange event.
+ * Pointer lock hides the mouse cursor and exclusively gives the target element relative mouse movement events via the mousemove event.
+ * http://www.w3.org/TR/pointerlock/
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_pointerlockchange_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenPointerlockChangeEvent *pointerlockChangeEvent, void *userData));
+/*
+ * Returns the current page pointerlock state.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_pointerlock_status(EmscriptenPointerlockChangeEvent *pointerlockStatus);
+/*
+ * Requests the given target element to grab pointerlock.
+ * Note: This function can only run inside a user-generated JavaScript event handler.
+ * deferUntilInEventHandler: If true and you called this function outside an event callback, this request will
+ * be queued to be executed the next time a JS event handler runs. If false, this
+ * function will instead fail if not running inside a JS event handler.
+ */
+extern EMSCRIPTEN_RESULT emscripten_request_pointerlock(const char *target, int deferUntilInEventHandler);
+/*
+ * Exits pointer lock state and restores the mouse cursor to be visible again.
+ */
+extern EMSCRIPTEN_RESULT emscripten_exit_pointerlock();
+
+#define EMSCRIPTEN_VISIBILITY_HIDDEN 0
+#define EMSCRIPTEN_VISIBILITY_VISIBLE 1
+#define EMSCRIPTEN_VISIBILITY_PRERENDER 2
+#define EMSCRIPTEN_VISIBILITY_UNLOADED 3
+
+/*
+ * The event structure passed in the visibilitychange event.
+ * http://www.w3c-test.org/webperf/specs/PageVisibility/
+ */
+typedef struct EmscriptenVisibilityChangeEvent {
+ // If true, the current browser page is now hidden.
+ EM_BOOL hidden;
+ // Specifies a more fine-grained state of the current page visibility status. One of the EMSCRIPTEN_VISIBILITY_ values.
+ int visibilityState;
+} EmscriptenVisibilityChangeEvent;
+
+/*
+ * Registers a callback function for receiving the visibilitychange event.
+ * http://www.w3c-test.org/webperf/specs/PageVisibility/
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_visibilitychange_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenVisibilityChangeEvent *visibilityChangeEvent, void *userData));
+/*
+ * Returns the current page visibility state.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_visibility_status(EmscriptenVisibilityChangeEvent *visibilityStatus);
+
+/*
+ * Specifies the status of a single touch point on the page.
+ * See http://www.w3.org/TR/touch-events/#touch-interface
+ */
+typedef struct EmscriptenTouchPoint
+{
+ // An identification number for each touch point.
+ long identifier;
+ // The touch coordinate relative to the whole screen origin, in pixels.
+ long screenX;
+ long screenY;
+ // The touch coordinate relative to the viewport, in pixels.
+ long clientX;
+ long clientY;
+ // The touch coordinate relative to the viewport, in pixels, and including any scroll offset.
+ long pageX;
+ long pageY;
+ // Specifies whether this touch point changed during this event.
+ EM_BOOL isChanged;
+ // Specifies whether this touch point is still above the original target on which it was initially pressed against.
+ EM_BOOL onTarget;
+ // The touch coordinates mapped to the Emscripten canvas client area, in pixels.
+ long canvasX;
+ long canvasY;
+} EmscriptenTouchPoint;
+
+/*
+ * Specifies the data of a single touch event.
+ * See http://www.w3.org/TR/touch-events/#touchevent-interface
+ */
+typedef struct EmscriptenTouchEvent {
+ // The number of valid elements in the touches array.
+ int numTouches;
+ // Specifies which modifiers were active during the key event.
+ EM_BOOL ctrlKey;
+ EM_BOOL shiftKey;
+ EM_BOOL altKey;
+ EM_BOOL metaKey;
+ // An array of currently active touches, one for each finger.
+ EmscriptenTouchPoint touches[32];
+} EmscriptenTouchEvent;
+
+/*
+ * Registers a callback function for receiving the touchstart, touchend, touchmove and touchcancel events.
+ * http://www.w3.org/TR/touch-events/
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_touchstart_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_touchend_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_touchmove_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_touchcancel_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenTouchEvent *touchEvent, void *userData));
+
+/*
+ * Represents the current snapshot state of a gamepad.
+ * http://www.w3.org/TR/gamepad/#gamepad-interface
+ */
+typedef struct EmscriptenGamepadEvent {
+ // Absolute wallclock time in msec units of when the data was recorded.
+ double timestamp;
+ // The number of valid axes entries in the axis array.
+ int numAxes;
+ // The number of valid button entries in the analogButton and digitalButton arrays.
+ int numButtons;
+ // The analog state of the gamepad axes, in the range [-1, 1].
+ double axis[64];
+ // The analog state of the gamepad buttons, in the range [0, 1].
+ double analogButton[64];
+ // The digital state of the gamepad buttons, either 0 or 1.
+ EM_BOOL digitalButton[64];
+ // Specifies whether this gamepad is connected to the browser page.
+ EM_BOOL connected;
+ // An ordinal associated with this gamepad, zero-based.
+ long index;
+ // An ID for the brand or style of the connected gamepad device. Typically, this will include the USB vendor and a product ID.
+ EM_UTF8 id[64];
+ // A string that identifies the layout or control mapping of this device.
+ EM_UTF8 mapping[64];
+} EmscriptenGamepadEvent;
+
+/*
+ * Registers a callback function for receiving the gamepadconnected and gamepaddisconnected events.
+ * http://www.w3.org/TR/gamepad/
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_gamepadconnected_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_gamepaddisconnected_callback(void *userData, int useCapture, EM_BOOL (*func)(int eventType, const EmscriptenGamepadEvent *gamepadEvent, void *userData));
+
+/*
+ * Returns the number of gamepads connected to the system or EMSCRIPTEN_RESULT_NOT_SUPPORTED if the current browser does not support gamepads.
+ * Note: A gamepad does not show up as connected until a button on it is pressed.
+ */
+extern int emscripten_get_num_gamepads();
+/*
+ * Returns a snapshot of the current gamepad state.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_gamepad_status(int index, EmscriptenGamepadEvent *gamepadState);
+
+/*
+ * The event structure passed in the battery chargingchange and levelchange event.
+ * http://www.w3.org/TR/battery-status/#batterymanager-interface
+ */
+typedef struct EmscriptenBatteryEvent {
+ double chargingTime;
+ double dischargingTime;
+ double level;
+ EM_BOOL charging;
+} EmscriptenBatteryEvent;
+
+/*
+ * Registers a callback function for receiving the battery chargingchange and levelchange events.
+ * http://www.w3.org/TR/battery-status/
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_batterychargingchange_callback(void *userData, EM_BOOL (*func)(int eventType, const EmscriptenBatteryEvent *batteryEvent, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_batterylevelchange_callback(void *userData, EM_BOOL (*func)(int eventType, const EmscriptenBatteryEvent *batteryEvent, void *userData));
+/*
+ * Returns the current battery status.
+ */
+extern EMSCRIPTEN_RESULT emscripten_get_battery_status(EmscriptenBatteryEvent *batteryState);
+
+/*
+ * Produces a vibration feedback for given msecs.
+ * http://dev.w3.org/2009/dap/vibration/
+ */
+extern EMSCRIPTEN_RESULT emscripten_vibrate(int msecs);
+/*
+ * Produces a complex vibration feedback pattern.
+ * msecsArray: An array of timing entries [on, off, on, off, on, off, ...] where every second one specifies a duration of vibration, and
+ * every other one specifies a duration of silence.
+ * numEntries: The number of integers in the array msecsArray.
+ */
+extern EMSCRIPTEN_RESULT emscripten_vibrate_pattern(int *msecsArray, int numEntries);
+
+/*
+ * Registers a callback function for receiving the page beforeunload event.
+ * Hook onto this event to perform process right prior to page close, and/or display a confirmation notification asking if the user really wants to leave the page.
+ * http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#beforeunloadevent
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_beforeunload_callback(void *userData, const char *(*func)(int eventType, const void *reserved, void *userData));
+
+/*
+ * Registers a callback function for the canvas webgl context webglcontextlost and webglcontextrestored events.
+ * See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+ */
+extern EMSCRIPTEN_RESULT emscripten_set_webglcontextlost_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const void *reserved, void *userData));
+extern EMSCRIPTEN_RESULT emscripten_set_webglcontextrestored_callback(const char *target, void *userData, int useCapture, EM_BOOL (*func)(int eventType, const void *reserved, void *userData));
+
+#ifdef __cplusplus
+} // ~extern "C"
+#endif
+
+#endif
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h
index b712d164..19b1beb1 100644
--- a/system/include/emscripten/val.h
+++ b/system/include/emscripten/val.h
@@ -11,10 +11,18 @@ namespace emscripten {
void _emval_register_symbol(const char*);
typedef struct _EM_VAL* EM_VAL;
+ typedef struct _EM_DESTRUCTORS* EM_DESTRUCTORS;
+
+ // TODO: functions returning this are reinterpret_cast
+ // into the correct return type. this needs some thought
+ // for asm.js.
+ typedef void _POLYMORPHIC_RESULT;
void _emval_incref(EM_VAL value);
void _emval_decref(EM_VAL value);
+ void _emval_run_destructors(EM_DESTRUCTORS handle);
+
EM_VAL _emval_new_array();
EM_VAL _emval_new_object();
EM_VAL _emval_undefined();
@@ -32,7 +40,8 @@ namespace emscripten {
EM_VAL _emval_get_module_property(const char* name);
EM_VAL _emval_get_property(EM_VAL object, EM_VAL key);
void _emval_set_property(EM_VAL object, EM_VAL key, EM_VAL value);
- void _emval_as(EM_VAL value, TYPEID returnType);
+ _POLYMORPHIC_RESULT _emval_as(EM_VAL value, TYPEID returnType, EM_DESTRUCTORS* runDestructors);
+
EM_VAL _emval_call(
EM_VAL value,
unsigned argCount,
@@ -57,7 +66,11 @@ namespace emscripten {
template<typename ReturnType, typename... Args>
struct Signature {
- typedef typename BindingType<ReturnType>::WireType (*MethodCaller)(EM_VAL value, const char* methodName, typename BindingType<Args>::WireType...);
+ typedef typename BindingType<ReturnType>::WireType (*MethodCaller)(
+ EM_VAL value,
+ const char* methodName,
+ EM_DESTRUCTORS* destructors,
+ typename BindingType<Args>::WireType...);
static MethodCaller get_method_caller() {
static MethodCaller fp = reinterpret_cast<MethodCaller>(init_method_caller());
@@ -71,15 +84,34 @@ namespace emscripten {
}
};
+ struct DestructorsRunner {
+ public:
+ explicit DestructorsRunner(EM_DESTRUCTORS d)
+ : destructors(d)
+ {}
+ ~DestructorsRunner() {
+ _emval_run_destructors(destructors);
+ }
+
+ DestructorsRunner(const DestructorsRunner&) = delete;
+ void operator=(const DestructorsRunner&) = delete;
+
+ private:
+ EM_DESTRUCTORS destructors;
+ };
+
template<typename ReturnType, typename... Args>
struct MethodCaller {
static ReturnType call(EM_VAL handle, const char* methodName, Args&&... args) {
auto caller = Signature<ReturnType, Args...>::get_method_caller();
+
+ EM_DESTRUCTORS destructors;
auto wireType = caller(
handle,
methodName,
+ &destructors,
toWireType(std::forward<Args>(args))...);
- WireDeleter<ReturnType> deleter(wireType);
+ DestructorsRunner rd(destructors);
return BindingType<ReturnType>::fromWireType(wireType);
}
};
@@ -88,10 +120,15 @@ namespace emscripten {
struct MethodCaller<void, Args...> {
static void call(EM_VAL handle, const char* methodName, Args&&... args) {
auto caller = Signature<void, Args...>::get_method_caller();
- return caller(
+
+ EM_DESTRUCTORS destructors;
+ caller(
handle,
methodName,
+ &destructors,
toWireType(std::forward<Args>(args))...);
+ DestructorsRunner rd(destructors);
+ // void requires no translation
}
};
}
@@ -262,11 +299,13 @@ namespace emscripten {
typedef typename BT::WireType (*TypedAs)(
EM_VAL value,
- TYPEID returnType);
+ TYPEID returnType,
+ EM_DESTRUCTORS* runDestructors);
TypedAs typedAs = reinterpret_cast<TypedAs>(&_emval_as);
- typename BT::WireType wt = typedAs(handle, TypeID<T>::get());
- WireDeleter<T> deleter(wt);
+ EM_DESTRUCTORS destructors;
+ typename BT::WireType wt = typedAs(handle, TypeID<T>::get(), &destructors);
+ DestructorsRunner dr(destructors);
return BT::fromWireType(wt);
}
@@ -292,8 +331,6 @@ namespace emscripten {
static val fromWireType(WireType v) {
return val::take_ownership(v);
}
- static void destroy(WireType v) {
- }
};
}
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h
index a5892216..c3ce8dd0 100644
--- a/system/include/emscripten/wire.h
+++ b/system/include/emscripten/wire.h
@@ -7,6 +7,7 @@
//
// We'll call the on-the-wire type WireType.
+#include <stdio.h>
#include <cstdlib>
#include <memory>
#include <string>
@@ -130,8 +131,6 @@ namespace emscripten {
constexpr static type fromWireType(WireType v) { \
return v; \
} \
- static void destroy(WireType) { \
- } \
}
EMSCRIPTEN_DEFINE_NATIVE_BINDING_TYPE(char);
@@ -160,8 +159,6 @@ namespace emscripten {
static bool fromWireType(WireType wt) {
return wt;
}
- static void destroy(WireType) {
- }
};
template<>
@@ -179,9 +176,6 @@ namespace emscripten {
static std::string fromWireType(WireType v) {
return std::string(v->data, v->length);
}
- static void destroy(WireType v) {
- free(v);
- }
};
template<>
@@ -199,9 +193,6 @@ namespace emscripten {
static std::wstring fromWireType(WireType v) {
return std::wstring(v->data, v->length);
}
- static void destroy(WireType v) {
- free(v);
- }
};
template<typename T>
@@ -254,10 +245,6 @@ namespace emscripten {
static ActualT& fromWireType(WireType p) {
return *p;
}
-
- static void destroy(WireType p) {
- delete p;
- }
};
// Is this necessary?
@@ -280,8 +267,6 @@ namespace emscripten {
static Enum fromWireType(WireType v) {
return v;
}
- static void destroy(WireType) {
- }
};
// catch-all generic binding
@@ -296,21 +281,6 @@ namespace emscripten {
auto toWireType(T&& v) -> typename BindingType<T>::WireType {
return BindingType<T>::toWireType(std::forward<T>(v));
}
-
- template<typename T>
- struct WireDeleter {
- typedef typename BindingType<T>::WireType WireType;
-
- WireDeleter(WireType wt)
- : wt(wt)
- {}
-
- ~WireDeleter() {
- BindingType<T>::destroy(wt);
- }
-
- WireType wt;
- };
}
struct memory_view {
diff --git a/system/include/execinfo.h b/system/include/execinfo.h
deleted file mode 100644
index 17cda148..00000000
--- a/system/include/execinfo.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2003 Maxim Sobolev <sobomax@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id: execinfo.h,v 1.2 2004/07/19 05:20:29 sobomax Exp $
- */
-
-#ifndef COMPAT_EXECINFO_H_INCLUDED
-#define COMPAT_EXECINFO_H_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int backtrace(void **, int);
-char ** backtrace_symbols(void *const *, int);
-void backtrace_symbols_fd(void *const *, int, int);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* COMPAT_EXECINFO_H_INCLUDED */
diff --git a/system/include/gc.h b/system/include/gc.h
index a21fd410..affa615f 100644
--- a/system/include/gc.h
+++ b/system/include/gc.h
@@ -1,5 +1,7 @@
/*
* Boehm-compatible GC API
+ *
+ * WARNING: this is deprecated. You should just build Boehm from source, it is much faster than the toy version written in emscripten
*/
#ifndef _GC_H_INCLUDED
#define _GC_H_INCLUDED
diff --git a/system/include/jansson.h b/system/include/jansson.h
index 04c345e9..53715fcc 100644
--- a/system/include/jansson.h
+++ b/system/include/jansson.h
@@ -82,7 +82,7 @@ typedef long long json_int_t;
typedef long json_int_t;
#endif /* JSON_INTEGER_IS_LONG_LONG */
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
extern "C" bool json_typeof(const void *object);
extern "C" bool json_is_object(const void *object);
extern "C" bool json_is_array(const void *object);
diff --git a/system/include/libc/unistd.h b/system/include/libc/unistd.h
index ef6ba3b3..995a84ea 100644
--- a/system/include/libc/unistd.h
+++ b/system/include/libc/unistd.h
@@ -7,9 +7,9 @@ extern "C" {
#include <features.h>
-#define STDIN_FILENO 1
-#define STDOUT_FILENO 2
-#define STDERR_FILENO 3
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
#define SEEK_SET 0
#define SEEK_CUR 1
diff --git a/system/include/libcxx/exception b/system/include/libcxx/exception
index ddd75bd4..cad802e0 100644
--- a/system/include/libcxx/exception
+++ b/system/include/libcxx/exception
@@ -91,8 +91,8 @@ class _LIBCPP_EXCEPTION_ABI exception
{
public:
_LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
- virtual ~exception() _NOEXCEPT {} // XXX EMSCRIPTEN - implement in header
- virtual const char* what() const _NOEXCEPT { return "std::exception"; } // XXX EMSCRIPTEN - implement in header
+ virtual ~exception() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
};
class _LIBCPP_EXCEPTION_ABI bad_exception
diff --git a/system/include/unwind.h b/system/include/unwind.h
deleted file mode 100644
index f8d43d0d..00000000
--- a/system/include/unwind.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* libunwind - a platform-independent unwind library
- Copyright (C) 2003 Hewlett-Packard Co
- Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
-
-This file is part of libunwind.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-#ifndef _UNWIND_H
-#define _UNWIND_H
-
-/* For uint64_t */
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Minimal interface as per C++ ABI draft standard:
-
- http://www.codesourcery.com/cxx-abi/abi-eh.html */
-
-typedef enum
- {
- _URC_NO_REASON = 0,
- _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
- _URC_FATAL_PHASE2_ERROR = 2,
- _URC_FATAL_PHASE1_ERROR = 3,
- _URC_NORMAL_STOP = 4,
- _URC_END_OF_STACK = 5,
- _URC_HANDLER_FOUND = 6,
- _URC_INSTALL_CONTEXT = 7,
- _URC_CONTINUE_UNWIND = 8
- }
-_Unwind_Reason_Code;
-
-typedef int _Unwind_Action;
-
-#define _UA_SEARCH_PHASE 1
-#define _UA_CLEANUP_PHASE 2
-#define _UA_HANDLER_FRAME 4
-#define _UA_FORCE_UNWIND 8
-
-struct _Unwind_Context; /* opaque data-structure */
-struct _Unwind_Exception; /* forward-declaration */
-
-typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
- struct _Unwind_Exception *);
-
-typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
- uint64_t,
- struct _Unwind_Exception *,
- struct _Unwind_Context *,
- void *);
-
-/* The C++ ABI requires exception_class, private_1, and private_2 to
- be of type uint64 and the entire structure to be
- double-word-aligned. Please note that exception_class stays 64-bit
- even on 32-bit machines for gcc compatibility. */
-struct _Unwind_Exception
- {
- uint64_t exception_class;
- _Unwind_Exception_Cleanup_Fn exception_cleanup;
- unsigned long private_1;
- unsigned long private_2;
- } __attribute__((__aligned__));
-
-extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
-extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
- _Unwind_Stop_Fn, void *);
-extern void _Unwind_Resume (struct _Unwind_Exception *);
-extern void _Unwind_DeleteException (struct _Unwind_Exception *);
-extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
-extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
-extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
-extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
-extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
-extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
-extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
-
-#ifdef _GNU_SOURCE
-
-/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
- if the callback returns any value other than _URC_NO_REASON. */
-typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
- void *);
-
-/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
- _UA_END_OF_STACK exists. */
-# define _UA_END_OF_STACK 16
-
-/* If the unwind was initiated due to a forced unwind, resume that
- operation, else re-raise the exception. This is used by
- __cxa_rethrow(). */
-extern _Unwind_Reason_Code
- _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
-
-/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
- _Unwind_GetBSP() exists. */
-extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
-
-/* Return the "canonical frame address" for the given context.
- This is used by NPTL... */
-extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
-
-/* Return the base-address for data references. */
-extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
-
-/* Return the base-address for text references. */
-extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
-
-/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
- cleanup. The first frame for which the callback is invoked is the
- one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
- returns _URC_END_OF_STACK when the backtrace stopped due to
- reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
- stops for any other reason. */
-extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
-
-/* Find the start-address of the procedure containing the specified IP
- or NULL if it cannot be found (e.g., because the function has no
- unwind info). Note: there is not necessarily a one-to-one
- correspondence between source-level functions and procedures: some
- functions don't have unwind-info and others are split into multiple
- procedures. */
-extern void *_Unwind_FindEnclosingFunction (void *);
-
-/* See also Linux Standard Base Spec:
- http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
-
-#endif /* _GNU_SOURCE */
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _UNWIND_H */
diff --git a/system/lib/compiler-rt/int_endianness.h b/system/lib/compiler-rt/int_endianness.h
index 17905355..fa294c49 100644
--- a/system/lib/compiler-rt/int_endianness.h
+++ b/system/lib/compiler-rt/int_endianness.h
@@ -100,7 +100,7 @@
#endif /* Windows */
-#if defined(EMSCRIPTEN)
+#if defined(__EMSCRIPTEN__)
#define _YUGA_LITTLE_ENDIAN 1
#define _YUGA_BIG_ENDIAN 0
diff --git a/system/lib/dlmalloc.c b/system/lib/dlmalloc.c
index ce2c25f1..04e9e47b 100644
--- a/system/lib/dlmalloc.c
+++ b/system/lib/dlmalloc.c
@@ -1,6 +1,6 @@
/* XXX Emscripten XXX */
-#if EMSCRIPTEN
+#if __EMSCRIPTEN__
#define DLMALLOC_EXPORT __attribute__((__weak__, __visibility__("default")))
/* mmap uses malloc, so malloc can't use mmap */
#define HAVE_MMAP 0
diff --git a/system/lib/gl.c b/system/lib/gl.c
new file mode 100644
index 00000000..bbc77437
--- /dev/null
+++ b/system/lib/gl.c
@@ -0,0 +1,1731 @@
+// GL proc address retrieval
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#define GL_GLEXT_PROTOTYPES
+#include <GL/gl.h>
+#include <GL/glext.h>
+
+// Define emscripten_ versions of gl functions, to avoid name collisions
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY emscripten_glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY emscripten_glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY emscripten_glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY emscripten_glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY emscripten_glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY emscripten_glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY emscripten_glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY emscripten_glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY emscripten_glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY emscripten_glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY emscripten_glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY emscripten_glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY emscripten_glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY emscripten_glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY emscripten_glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY emscripten_glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY emscripten_glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY emscripten_glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY emscripten_glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY emscripten_glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY emscripten_glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY emscripten_glIsEnabled( GLenum cap );
+
+
+GLAPI void GLAPIENTRY emscripten_glEnableClientState( GLenum cap ); /* 1.1 */
+
+GLAPI void GLAPIENTRY emscripten_glDisableClientState( GLenum cap ); /* 1.1 */
+
+
+GLAPI void GLAPIENTRY emscripten_glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY emscripten_glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY emscripten_glPopAttrib( void );
+
+
+GLAPI void GLAPIENTRY emscripten_glPushClientAttrib( GLbitfield mask ); /* 1.1 */
+
+GLAPI void GLAPIENTRY emscripten_glPopClientAttrib( void ); /* 1.1 */
+
+
+GLAPI GLint GLAPIENTRY emscripten_glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY emscripten_glGetError( void );
+
+GLAPI const GLubyte * GLAPIENTRY emscripten_glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY emscripten_glFinish( void );
+
+GLAPI void GLAPIENTRY emscripten_glFlush( void );
+
+GLAPI void GLAPIENTRY emscripten_glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY emscripten_glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY emscripten_glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY emscripten_glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY emscripten_glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY emscripten_glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY emscripten_glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY emscripten_glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY emscripten_glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY emscripten_glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY emscripten_glPushMatrix( void );
+
+GLAPI void GLAPIENTRY emscripten_glPopMatrix( void );
+
+GLAPI void GLAPIENTRY emscripten_glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY emscripten_glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY emscripten_glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY emscripten_glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY emscripten_glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY emscripten_glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY emscripten_glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY emscripten_glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY emscripten_glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY emscripten_glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY emscripten_glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY emscripten_glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY emscripten_glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY emscripten_glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY emscripten_glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glEndList( void );
+
+GLAPI void GLAPIENTRY emscripten_glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY emscripten_glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY emscripten_glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY emscripten_glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glEnd( void );
+
+
+GLAPI void GLAPIENTRY emscripten_glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY emscripten_glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY emscripten_glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY emscripten_glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY emscripten_glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY emscripten_glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY emscripten_glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY emscripten_glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY emscripten_glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY emscripten_glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY emscripten_glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY emscripten_glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY emscripten_glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY emscripten_glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY emscripten_glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY emscripten_glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY emscripten_glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY emscripten_glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY emscripten_glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY emscripten_glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY emscripten_glIndexi( GLint c );
+GLAPI void GLAPIENTRY emscripten_glIndexs( GLshort c );
+GLAPI void GLAPIENTRY emscripten_glIndexub( GLubyte c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY emscripten_glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY emscripten_glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY emscripten_glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY emscripten_glIndexsv( const GLshort *c );
+GLAPI void GLAPIENTRY emscripten_glIndexubv( const GLubyte *c ); /* 1.1 */
+
+GLAPI void GLAPIENTRY emscripten_glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY emscripten_glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY emscripten_glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY emscripten_glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY emscripten_glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY emscripten_glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY emscripten_glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY emscripten_glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY emscripten_glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY emscripten_glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY emscripten_glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY emscripten_glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY emscripten_glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY emscripten_glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY emscripten_glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY emscripten_glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY emscripten_glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY emscripten_glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY emscripten_glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY emscripten_glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY emscripten_glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY emscripten_glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY emscripten_glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY emscripten_glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY emscripten_glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY emscripten_glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY emscripten_glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY emscripten_glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Vertex Arrays (1.1)
+ */
+
+GLAPI void GLAPIENTRY emscripten_glVertexPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glNormalPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glColorPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glIndexPointer( GLenum type, GLsizei stride,
+ const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glTexCoordPointer( GLint size, GLenum type,
+ GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+
+GLAPI void GLAPIENTRY emscripten_glGetPointerv( GLenum pname, GLvoid **params );
+
+GLAPI void GLAPIENTRY emscripten_glArrayElement( GLint i );
+
+GLAPI void GLAPIENTRY emscripten_glDrawArrays( GLenum mode, GLint first, GLsizei count );
+
+GLAPI void GLAPIENTRY emscripten_glDrawElements( GLenum mode, GLsizei count,
+ GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY emscripten_glInterleavedArrays( GLenum format, GLsizei stride,
+ const GLvoid *pointer );
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY emscripten_glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY emscripten_glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY emscripten_glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY emscripten_glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY emscripten_glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY emscripten_glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glPixelMapfv( GLenum map, GLsizei mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY emscripten_glPixelMapuiv( GLenum map, GLsizei mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY emscripten_glPixelMapusv( GLenum map, GLsizei mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY emscripten_glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY emscripten_glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY emscripten_glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY emscripten_glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY emscripten_glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY emscripten_glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY emscripten_glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY emscripten_glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY emscripten_glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY emscripten_glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY emscripten_glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY emscripten_glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY emscripten_glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY emscripten_glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY emscripten_glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY emscripten_glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY emscripten_glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY emscripten_glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY emscripten_glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY emscripten_glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/* 1.1 functions */
+
+GLAPI void GLAPIENTRY emscripten_glGenTextures( GLsizei n, GLuint *textures );
+
+GLAPI void GLAPIENTRY emscripten_glDeleteTextures( GLsizei n, const GLuint *textures);
+
+GLAPI void GLAPIENTRY emscripten_glBindTexture( GLenum target, GLuint texture );
+
+GLAPI void GLAPIENTRY emscripten_glPrioritizeTextures( GLsizei n,
+ const GLuint *textures,
+ const GLclampf *priorities );
+
+GLAPI GLboolean GLAPIENTRY emscripten_glAreTexturesResident( GLsizei n,
+ const GLuint *textures,
+ GLboolean *residences );
+
+GLAPI GLboolean GLAPIENTRY emscripten_glIsTexture( GLuint texture );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY emscripten_glTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+
+GLAPI void GLAPIENTRY emscripten_glCopyTexImage1D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLint border );
+
+
+GLAPI void GLAPIENTRY emscripten_glCopyTexImage2D( GLenum target, GLint level,
+ GLenum internalformat,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLint border );
+
+
+GLAPI void GLAPIENTRY emscripten_glCopyTexSubImage1D( GLenum target, GLint level,
+ GLint xoffset, GLint x, GLint y,
+ GLsizei width );
+
+
+GLAPI void GLAPIENTRY emscripten_glCopyTexSubImage2D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY emscripten_glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY emscripten_glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY emscripten_glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY emscripten_glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY emscripten_glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY emscripten_glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY emscripten_glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY emscripten_glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY emscripten_glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY emscripten_glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY emscripten_glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY emscripten_glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY emscripten_glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY emscripten_glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY emscripten_glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY emscripten_glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY emscripten_glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY emscripten_glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY emscripten_glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY emscripten_glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY emscripten_glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY emscripten_glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY emscripten_glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY emscripten_glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY emscripten_glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY emscripten_glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY emscripten_glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY emscripten_glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY emscripten_glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY emscripten_glInitNames( void );
+
+GLAPI void GLAPIENTRY emscripten_glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY emscripten_glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY emscripten_glPopName( void );
+
+
+GLAPI void GLAPIENTRY emscripten_glDrawRangeElements( GLenum mode, GLuint start,
+ GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
+
+GLAPI void GLAPIENTRY emscripten_glTexImage3D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY emscripten_glTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format,
+ GLenum type, const GLvoid *pixels);
+
+GLAPI void GLAPIENTRY emscripten_glCopyTexSubImage3D( GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLint x,
+ GLint y, GLsizei width,
+ GLsizei height );
+
+
+GLAPI void GLAPIENTRY emscripten_glColorTable( GLenum target, GLenum internalformat,
+ GLsizei width, GLenum format,
+ GLenum type, const GLvoid *table );
+
+GLAPI void GLAPIENTRY emscripten_glColorSubTable( GLenum target,
+ GLsizei start, GLsizei count,
+ GLenum format, GLenum type,
+ const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glColorTableParameteriv(GLenum target, GLenum pname,
+ const GLint *params);
+
+GLAPI void GLAPIENTRY emscripten_glColorTableParameterfv(GLenum target, GLenum pname,
+ const GLfloat *params);
+
+GLAPI void GLAPIENTRY emscripten_glCopyColorSubTable( GLenum target, GLsizei start,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY emscripten_glCopyColorTable( GLenum target, GLenum internalformat,
+ GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY emscripten_glGetColorTable( GLenum target, GLenum format,
+ GLenum type, GLvoid *table );
+
+GLAPI void GLAPIENTRY emscripten_glGetColorTableParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetColorTableParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glBlendEquation( GLenum mode );
+
+GLAPI void GLAPIENTRY emscripten_glBlendColor( GLclampf red, GLclampf green,
+ GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY emscripten_glHistogram( GLenum target, GLsizei width,
+ GLenum internalformat, GLboolean sink );
+
+GLAPI void GLAPIENTRY emscripten_glResetHistogram( GLenum target );
+
+GLAPI void GLAPIENTRY emscripten_glGetHistogram( GLenum target, GLboolean reset,
+ GLenum format, GLenum type,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY emscripten_glGetHistogramParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetHistogramParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glMinmax( GLenum target, GLenum internalformat,
+ GLboolean sink );
+
+GLAPI void GLAPIENTRY emscripten_glResetMinmax( GLenum target );
+
+GLAPI void GLAPIENTRY emscripten_glGetMinmax( GLenum target, GLboolean reset,
+ GLenum format, GLenum types,
+ GLvoid *values );
+
+GLAPI void GLAPIENTRY emscripten_glGetMinmaxParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetMinmaxParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLsizei width, GLenum format, GLenum type,
+ const GLvoid *image );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *image );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionParameterf( GLenum target, GLenum pname,
+ GLfloat params );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionParameteri( GLenum target, GLenum pname,
+ GLint params );
+
+GLAPI void GLAPIENTRY emscripten_glConvolutionParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glCopyConvolutionFilter1D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width );
+
+GLAPI void GLAPIENTRY emscripten_glCopyConvolutionFilter2D( GLenum target,
+ GLenum internalformat, GLint x, GLint y, GLsizei width,
+ GLsizei height);
+
+GLAPI void GLAPIENTRY emscripten_glGetConvolutionFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *image );
+
+GLAPI void GLAPIENTRY emscripten_glGetConvolutionParameterfv( GLenum target, GLenum pname,
+ GLfloat *params );
+
+GLAPI void GLAPIENTRY emscripten_glGetConvolutionParameteriv( GLenum target, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY emscripten_glSeparableFilter2D( GLenum target,
+ GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
+ GLenum type, const GLvoid *row, const GLvoid *column );
+
+GLAPI void GLAPIENTRY emscripten_glGetSeparableFilter( GLenum target, GLenum format,
+ GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
+
+
+GLAPI void GLAPIENTRY emscripten_glActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY emscripten_glClientActiveTexture( GLenum texture );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
+
+GLAPI void GLAPIENTRY emscripten_glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1d( GLenum target, GLdouble s );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1f( GLenum target, GLfloat s );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1i( GLenum target, GLint s );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1s( GLenum target, GLshort s );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2i( GLenum target, GLint s, GLint t );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3sv( GLenum target, const GLshort *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4dv( GLenum target, const GLdouble *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4fv( GLenum target, const GLfloat *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4iv( GLenum target, const GLint *v );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4sv( GLenum target, const GLshort *v );
+
+
+GLAPI void GLAPIENTRY emscripten_glLoadTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY emscripten_glLoadTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY emscripten_glMultTransposeMatrixd( const GLdouble m[16] );
+
+GLAPI void GLAPIENTRY emscripten_glMultTransposeMatrixf( const GLfloat m[16] );
+
+GLAPI void GLAPIENTRY emscripten_glSampleCoverage( GLclampf value, GLboolean invert );
+
+
+GLAPI void GLAPIENTRY emscripten_glActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY emscripten_glClientActiveTextureARB(GLenum texture);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1dARB(GLenum target, GLdouble s);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1fARB(GLenum target, GLfloat s);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1iARB(GLenum target, GLint s);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1sARB(GLenum target, GLshort s);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord1svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord2svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord3svARB(GLenum target, const GLshort *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4ivARB(GLenum target, const GLint *v);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void GLAPIENTRY emscripten_glMultiTexCoord4svARB(GLenum target, const GLshort *v);
+
+
+GLAPI void APIENTRY emscripten_glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GLAPI void APIENTRY emscripten_glBlendEquation (GLenum mode);
+GLAPI void APIENTRY emscripten_glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+GLAPI void APIENTRY emscripten_glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY emscripten_glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+GLAPI void APIENTRY emscripten_glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+
+
+GLAPI void APIENTRY emscripten_glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+GLAPI void APIENTRY emscripten_glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY emscripten_glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY emscripten_glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY emscripten_glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table);
+GLAPI void APIENTRY emscripten_glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY emscripten_glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY emscripten_glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+GLAPI void APIENTRY emscripten_glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params);
+GLAPI void APIENTRY emscripten_glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY emscripten_glConvolutionParameteri (GLenum target, GLenum pname, GLint params);
+GLAPI void APIENTRY emscripten_glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY emscripten_glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+GLAPI void APIENTRY emscripten_glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY emscripten_glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image);
+GLAPI void APIENTRY emscripten_glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+GLAPI void APIENTRY emscripten_glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+GLAPI void APIENTRY emscripten_glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY emscripten_glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+GLAPI void APIENTRY emscripten_glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY emscripten_glMinmax (GLenum target, GLenum internalformat, GLboolean sink);
+GLAPI void APIENTRY emscripten_glResetHistogram (GLenum target);
+GLAPI void APIENTRY emscripten_glResetMinmax (GLenum target);
+
+
+GLAPI void APIENTRY emscripten_glActiveTexture (GLenum texture);
+GLAPI void APIENTRY emscripten_glSampleCoverage (GLclampf value, GLboolean invert);
+GLAPI void APIENTRY emscripten_glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img);
+
+
+GLAPI void APIENTRY emscripten_glClientActiveTexture (GLenum texture);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1d (GLenum target, GLdouble s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1f (GLenum target, GLfloat s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1i (GLenum target, GLint s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1s (GLenum target, GLshort s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2i (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2s (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4dv (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4fv (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4iv (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4sv (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glLoadTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY emscripten_glLoadTransposeMatrixd (const GLdouble *m);
+GLAPI void APIENTRY emscripten_glMultTransposeMatrixf (const GLfloat *m);
+GLAPI void APIENTRY emscripten_glMultTransposeMatrixd (const GLdouble *m);
+
+
+GLAPI void APIENTRY emscripten_glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GLAPI void APIENTRY emscripten_glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY emscripten_glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+GLAPI void APIENTRY emscripten_glPointParameterf (GLenum pname, GLfloat param);
+GLAPI void APIENTRY emscripten_glPointParameterfv (GLenum pname, const GLfloat *params);
+GLAPI void APIENTRY emscripten_glPointParameteri (GLenum pname, GLint param);
+GLAPI void APIENTRY emscripten_glPointParameteriv (GLenum pname, const GLint *params);
+
+
+GLAPI void APIENTRY emscripten_glFogCoordf (GLfloat coord);
+GLAPI void APIENTRY emscripten_glFogCoordfv (const GLfloat *coord);
+GLAPI void APIENTRY emscripten_glFogCoordd (GLdouble coord);
+GLAPI void APIENTRY emscripten_glFogCoorddv (const GLdouble *coord);
+GLAPI void APIENTRY emscripten_glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY emscripten_glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3bv (const GLbyte *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3dv (const GLdouble *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3fv (const GLfloat *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3i (GLint red, GLint green, GLint blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3iv (const GLint *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3s (GLshort red, GLshort green, GLshort blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3sv (const GLshort *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3ubv (const GLubyte *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3uiv (const GLuint *v);
+GLAPI void APIENTRY emscripten_glSecondaryColor3us (GLushort red, GLushort green, GLushort blue);
+GLAPI void APIENTRY emscripten_glSecondaryColor3usv (const GLushort *v);
+GLAPI void APIENTRY emscripten_glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY emscripten_glWindowPos2d (GLdouble x, GLdouble y);
+GLAPI void APIENTRY emscripten_glWindowPos2dv (const GLdouble *v);
+GLAPI void APIENTRY emscripten_glWindowPos2f (GLfloat x, GLfloat y);
+GLAPI void APIENTRY emscripten_glWindowPos2fv (const GLfloat *v);
+GLAPI void APIENTRY emscripten_glWindowPos2i (GLint x, GLint y);
+GLAPI void APIENTRY emscripten_glWindowPos2iv (const GLint *v);
+GLAPI void APIENTRY emscripten_glWindowPos2s (GLshort x, GLshort y);
+GLAPI void APIENTRY emscripten_glWindowPos2sv (const GLshort *v);
+GLAPI void APIENTRY emscripten_glWindowPos3d (GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY emscripten_glWindowPos3dv (const GLdouble *v);
+GLAPI void APIENTRY emscripten_glWindowPos3f (GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY emscripten_glWindowPos3fv (const GLfloat *v);
+GLAPI void APIENTRY emscripten_glWindowPos3i (GLint x, GLint y, GLint z);
+GLAPI void APIENTRY emscripten_glWindowPos3iv (const GLint *v);
+GLAPI void APIENTRY emscripten_glWindowPos3s (GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY emscripten_glWindowPos3sv (const GLshort *v);
+
+
+GLAPI void APIENTRY emscripten_glGenQueries (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY emscripten_glDeleteQueries (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY emscripten_glIsQuery (GLuint id);
+GLAPI void APIENTRY emscripten_glBeginQuery (GLenum target, GLuint id);
+GLAPI void APIENTRY emscripten_glEndQuery (GLenum target);
+GLAPI void APIENTRY emscripten_glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GLAPI void APIENTRY emscripten_glBindBuffer (GLenum target, GLuint buffer);
+GLAPI void APIENTRY emscripten_glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY emscripten_glGenBuffers (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY emscripten_glIsBuffer (GLuint buffer);
+GLAPI void APIENTRY emscripten_glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY emscripten_glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+GLAPI GLvoid* APIENTRY emscripten_glMapBuffer (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY emscripten_glUnmapBuffer (GLenum target);
+GLAPI void APIENTRY emscripten_glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params);
+
+
+GLAPI void APIENTRY emscripten_glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GLAPI void APIENTRY emscripten_glDrawBuffers (GLsizei n, const GLenum *bufs);
+GLAPI void APIENTRY emscripten_glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GLAPI void APIENTRY emscripten_glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GLAPI void APIENTRY emscripten_glStencilMaskSeparate (GLenum face, GLuint mask);
+GLAPI void APIENTRY emscripten_glAttachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY emscripten_glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GLAPI void APIENTRY emscripten_glCompileShader (GLuint shader);
+GLAPI GLuint APIENTRY emscripten_glCreateProgram (void);
+GLAPI GLuint APIENTRY emscripten_glCreateShader (GLenum type);
+GLAPI void APIENTRY emscripten_glDeleteProgram (GLuint program);
+GLAPI void APIENTRY emscripten_glDeleteShader (GLuint shader);
+GLAPI void APIENTRY emscripten_glDetachShader (GLuint program, GLuint shader);
+GLAPI void APIENTRY emscripten_glDisableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY emscripten_glEnableVertexAttribArray (GLuint index);
+GLAPI void APIENTRY emscripten_glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY emscripten_glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY emscripten_glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+GLAPI GLint APIENTRY emscripten_glGetAttribLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY emscripten_glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY emscripten_glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GLAPI void APIENTRY emscripten_glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GLAPI GLint APIENTRY emscripten_glGetUniformLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY emscripten_glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetUniformiv (GLuint program, GLint location, GLint *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY emscripten_glIsProgram (GLuint program);
+GLAPI GLboolean APIENTRY emscripten_glIsShader (GLuint shader);
+GLAPI void APIENTRY emscripten_glLinkProgram (GLuint program);
+GLAPI void APIENTRY emscripten_glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+GLAPI void APIENTRY emscripten_glUseProgram (GLuint program);
+GLAPI void APIENTRY emscripten_glUniform1f (GLint location, GLfloat v0);
+GLAPI void APIENTRY emscripten_glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY emscripten_glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY emscripten_glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY emscripten_glUniform1i (GLint location, GLint v0);
+GLAPI void APIENTRY emscripten_glUniform2i (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY emscripten_glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY emscripten_glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY emscripten_glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glValidateProgram (GLuint program);
+GLAPI void APIENTRY emscripten_glVertexAttrib1d (GLuint index, GLdouble x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib1f (GLuint index, GLfloat x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib1s (GLuint index, GLshort x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2s (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nbv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Niv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nsv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nuiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4Nusv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4dv (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY emscripten_glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+
+
+GLAPI void APIENTRY emscripten_glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+
+
+GLAPI void APIENTRY emscripten_glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY emscripten_glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY emscripten_glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY emscripten_glEnablei (GLenum target, GLuint index);
+GLAPI void APIENTRY emscripten_glDisablei (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY emscripten_glIsEnabledi (GLenum target, GLuint index);
+GLAPI void APIENTRY emscripten_glBeginTransformFeedback (GLenum primitiveMode);
+GLAPI void APIENTRY emscripten_glEndTransformFeedback (void);
+GLAPI void APIENTRY emscripten_glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY emscripten_glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY emscripten_glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+GLAPI void APIENTRY emscripten_glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY emscripten_glClampColor (GLenum target, GLenum clamp);
+GLAPI void APIENTRY emscripten_glBeginConditionalRender (GLuint id, GLenum mode);
+GLAPI void APIENTRY emscripten_glEndConditionalRender (void);
+GLAPI void APIENTRY emscripten_glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY emscripten_glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GLAPI void APIENTRY emscripten_glVertexAttribI1i (GLuint index, GLint x);
+GLAPI void APIENTRY emscripten_glVertexAttribI2i (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY emscripten_glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY emscripten_glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY emscripten_glVertexAttribI1ui (GLuint index, GLuint x);
+GLAPI void APIENTRY emscripten_glVertexAttribI2ui (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY emscripten_glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY emscripten_glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY emscripten_glVertexAttribI1iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI2iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI3iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4iv (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI1uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI2uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI3uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4bv (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4sv (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4ubv (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttribI4usv (GLuint index, const GLushort *v);
+GLAPI void APIENTRY emscripten_glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY emscripten_glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY emscripten_glGetFragDataLocation (GLuint program, const GLchar *name);
+GLAPI void APIENTRY emscripten_glUniform1ui (GLint location, GLuint v0);
+GLAPI void APIENTRY emscripten_glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY emscripten_glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY emscripten_glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY emscripten_glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY emscripten_glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY emscripten_glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY emscripten_glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY emscripten_glTexParameterIiv (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY emscripten_glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY emscripten_glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY emscripten_glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GLAPI void APIENTRY emscripten_glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GLAPI void APIENTRY emscripten_glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+
+
+GLAPI void APIENTRY emscripten_glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY emscripten_glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+GLAPI void APIENTRY emscripten_glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer);
+GLAPI void APIENTRY emscripten_glPrimitiveRestartIndex (GLuint index);
+
+
+GLAPI void APIENTRY emscripten_glActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY emscripten_glClientActiveTextureARB (GLenum texture);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1dARB (GLenum target, GLdouble s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1fARB (GLenum target, GLfloat s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1iARB (GLenum target, GLint s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1sARB (GLenum target, GLshort s);
+GLAPI void APIENTRY emscripten_glMultiTexCoord1svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2iARB (GLenum target, GLint s, GLint t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t);
+GLAPI void APIENTRY emscripten_glMultiTexCoord2svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r);
+GLAPI void APIENTRY emscripten_glMultiTexCoord3svARB (GLenum target, const GLshort *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4dvARB (GLenum target, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4fvARB (GLenum target, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4ivARB (GLenum target, const GLint *v);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+GLAPI void APIENTRY emscripten_glMultiTexCoord4svARB (GLenum target, const GLshort *v);
+
+
+GLAPI void APIENTRY emscripten_glLoadTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY emscripten_glLoadTransposeMatrixdARB (const GLdouble *m);
+GLAPI void APIENTRY emscripten_glMultTransposeMatrixfARB (const GLfloat *m);
+GLAPI void APIENTRY emscripten_glMultTransposeMatrixdARB (const GLdouble *m);
+
+
+GLAPI void APIENTRY emscripten_glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img);
+
+
+GLAPI void APIENTRY emscripten_glVertexAttrib1dARB (GLuint index, GLdouble x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib1fARB (GLuint index, GLfloat x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib1sARB (GLuint index, GLshort x);
+GLAPI void APIENTRY emscripten_glVertexAttrib1svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y);
+GLAPI void APIENTRY emscripten_glVertexAttrib2svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z);
+GLAPI void APIENTRY emscripten_glVertexAttrib3svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NbvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NsvARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NuivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4NusvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4bvARB (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4dvARB (GLuint index, const GLdouble *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4fvARB (GLuint index, const GLfloat *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4ivARB (GLuint index, const GLint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+GLAPI void APIENTRY emscripten_glVertexAttrib4svARB (GLuint index, const GLshort *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4ubvARB (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4uivARB (GLuint index, const GLuint *v);
+GLAPI void APIENTRY emscripten_glVertexAttrib4usvARB (GLuint index, const GLushort *v);
+GLAPI void APIENTRY emscripten_glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY emscripten_glEnableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY emscripten_glDisableVertexAttribArrayARB (GLuint index);
+GLAPI void APIENTRY emscripten_glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+GLAPI void APIENTRY emscripten_glBindProgramARB (GLenum target, GLuint program);
+GLAPI void APIENTRY emscripten_glDeleteProgramsARB (GLsizei n, const GLuint *programs);
+GLAPI void APIENTRY emscripten_glGenProgramsARB (GLsizei n, GLuint *programs);
+GLAPI void APIENTRY emscripten_glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY emscripten_glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY emscripten_glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY emscripten_glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY emscripten_glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+GLAPI void APIENTRY emscripten_glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params);
+GLAPI void APIENTRY emscripten_glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GLAPI void APIENTRY emscripten_glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY emscripten_glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params);
+GLAPI void APIENTRY emscripten_glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetProgramivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string);
+GLAPI void APIENTRY emscripten_glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer);
+GLAPI GLboolean APIENTRY emscripten_glIsProgramARB (GLuint program);
+
+
+GLAPI void APIENTRY emscripten_glBindBufferARB (GLenum target, GLuint buffer);
+GLAPI void APIENTRY emscripten_glDeleteBuffersARB (GLsizei n, const GLuint *buffers);
+GLAPI void APIENTRY emscripten_glGenBuffersARB (GLsizei n, GLuint *buffers);
+GLAPI GLboolean APIENTRY emscripten_glIsBufferARB (GLuint buffer);
+GLAPI void APIENTRY emscripten_glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+GLAPI void APIENTRY emscripten_glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+GLAPI void APIENTRY emscripten_glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+GLAPI GLvoid* APIENTRY emscripten_glMapBufferARB (GLenum target, GLenum access);
+GLAPI GLboolean APIENTRY emscripten_glUnmapBufferARB (GLenum target);
+GLAPI void APIENTRY emscripten_glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params);
+
+
+GLAPI void APIENTRY emscripten_glGenQueriesARB (GLsizei n, GLuint *ids);
+GLAPI void APIENTRY emscripten_glDeleteQueriesARB (GLsizei n, const GLuint *ids);
+GLAPI GLboolean APIENTRY emscripten_glIsQueryARB (GLuint id);
+GLAPI void APIENTRY emscripten_glBeginQueryARB (GLenum target, GLuint id);
+GLAPI void APIENTRY emscripten_glEndQueryARB (GLenum target);
+GLAPI void APIENTRY emscripten_glGetQueryivARB (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params);
+
+
+GLAPI void APIENTRY emscripten_glDeleteObjectARB (GLhandleARB obj);
+GLAPI GLhandleARB APIENTRY emscripten_glGetHandleARB (GLenum pname);
+GLAPI void APIENTRY emscripten_glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj);
+GLAPI GLhandleARB APIENTRY emscripten_glCreateShaderObjectARB (GLenum shaderType);
+GLAPI void APIENTRY emscripten_glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+GLAPI void APIENTRY emscripten_glCompileShaderARB (GLhandleARB shaderObj);
+GLAPI GLhandleARB APIENTRY emscripten_glCreateProgramObjectARB (void);
+GLAPI void APIENTRY emscripten_glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj);
+GLAPI void APIENTRY emscripten_glLinkProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY emscripten_glUseProgramObjectARB (GLhandleARB programObj);
+GLAPI void APIENTRY emscripten_glValidateProgramARB (GLhandleARB programObj);
+GLAPI void APIENTRY emscripten_glUniform1fARB (GLint location, GLfloat v0);
+GLAPI void APIENTRY emscripten_glUniform2fARB (GLint location, GLfloat v0, GLfloat v1);
+GLAPI void APIENTRY emscripten_glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GLAPI void APIENTRY emscripten_glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GLAPI void APIENTRY emscripten_glUniform1iARB (GLint location, GLint v0);
+GLAPI void APIENTRY emscripten_glUniform2iARB (GLint location, GLint v0, GLint v1);
+GLAPI void APIENTRY emscripten_glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2);
+GLAPI void APIENTRY emscripten_glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GLAPI void APIENTRY emscripten_glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniform1ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform2ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform3ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniform4ivARB (GLint location, GLsizei count, const GLint *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GLAPI void APIENTRY emscripten_glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+GLAPI void APIENTRY emscripten_glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+GLAPI GLint APIENTRY emscripten_glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name);
+GLAPI void APIENTRY emscripten_glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI void APIENTRY emscripten_glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params);
+GLAPI void APIENTRY emscripten_glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params);
+GLAPI void APIENTRY emscripten_glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+
+
+GLAPI void APIENTRY emscripten_glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+GLAPI void APIENTRY emscripten_glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+GLAPI GLint APIENTRY emscripten_glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name);
+
+
+GLAPI void APIENTRY emscripten_glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY emscripten_glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+
+
+GLAPI GLboolean APIENTRY emscripten_glIsRenderbuffer (GLuint renderbuffer);
+GLAPI void APIENTRY emscripten_glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GLAPI void APIENTRY emscripten_glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GLAPI void APIENTRY emscripten_glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GLAPI void APIENTRY emscripten_glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY emscripten_glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GLAPI GLboolean APIENTRY emscripten_glIsFramebuffer (GLuint framebuffer);
+GLAPI void APIENTRY emscripten_glBindFramebuffer (GLenum target, GLuint framebuffer);
+GLAPI void APIENTRY emscripten_glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GLAPI void APIENTRY emscripten_glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GLAPI GLenum APIENTRY emscripten_glCheckFramebufferStatus (GLenum target);
+GLAPI void APIENTRY emscripten_glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY emscripten_glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GLAPI void APIENTRY emscripten_glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+GLAPI void APIENTRY emscripten_glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GLAPI void APIENTRY emscripten_glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGenerateMipmap (GLenum target);
+GLAPI void APIENTRY emscripten_glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GLAPI void APIENTRY emscripten_glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY emscripten_glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+
+
+GLAPI void APIENTRY emscripten_glBindVertexArray (GLuint array);
+GLAPI void APIENTRY emscripten_glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GLAPI void APIENTRY emscripten_glGenVertexArrays (GLsizei n, GLuint *arrays);
+GLAPI GLboolean APIENTRY emscripten_glIsVertexArray (GLuint array);
+
+
+GLAPI void APIENTRY emscripten_glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
+GLAPI void APIENTRY emscripten_glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+GLAPI GLuint APIENTRY emscripten_glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GLAPI void APIENTRY emscripten_glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GLAPI void APIENTRY emscripten_glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GLAPI void APIENTRY emscripten_glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+
+GLAPI void APIENTRY emscripten_glReleaseShaderCompiler (void);
+GLAPI void APIENTRY emscripten_glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length);
+GLAPI void APIENTRY emscripten_glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GLAPI void APIENTRY emscripten_glDepthRangef (GLclampf n, GLclampf f);
+GLAPI void APIENTRY emscripten_glClearDepthf (GLclampf d);
+
+
+GLAPI void APIENTRY emscripten_glVertexAttribDivisor (GLuint index, GLuint divisor);
+
+
+void* emscripten_GetProcAddress(const char *name_) {
+ char *name = malloc(strlen(name_)+1);
+ strcpy(name, name_);
+ // remove EXT|ARB|OES suffixes
+ char *end = strstr(name, "EXT");
+ if (end) *end = 0;
+ end = strstr(name, "ARB");
+ if (end) *end = 0;
+ end = strstr(name, "OES");
+ if (end) *end = 0;
+ // misc renamings
+ if (!strcmp(name, "glCreateProgramObject")) name = "glCreateProgram";
+ else if (!strcmp(name, "glUseProgramObject")) name = "glUseProgram";
+ else if (!strcmp(name, "glCreateShaderObject")) name = "glCreateShader";
+ else if (!strcmp(name, "glAttachObject")) name = "glAttachShader";
+ else if (!strcmp(name, "glDetachObject")) name = "glDetachShader";
+ // main list
+ if (!strcmp(name, "glPixelStorei")) return emscripten_glPixelStorei;
+ else if (!strcmp(name, "glGetString")) return emscripten_glGetString;
+ else if (!strcmp(name, "glGetIntegerv")) return emscripten_glGetIntegerv;
+ else if (!strcmp(name, "glGetFloatv")) return emscripten_glGetFloatv;
+ else if (!strcmp(name, "glGetBooleanv")) return emscripten_glGetBooleanv;
+ else if (!strcmp(name, "glGenTextures")) return emscripten_glGenTextures;
+ else if (!strcmp(name, "glDeleteTextures")) return emscripten_glDeleteTextures;
+ else if (!strcmp(name, "glCompressedTexImage2D")) return emscripten_glCompressedTexImage2D;
+ else if (!strcmp(name, "glCompressedTexSubImage2D")) return emscripten_glCompressedTexSubImage2D;
+ else if (!strcmp(name, "glTexImage2D")) return emscripten_glTexImage2D;
+ else if (!strcmp(name, "glTexSubImage2D")) return emscripten_glTexSubImage2D;
+ else if (!strcmp(name, "glReadPixels")) return emscripten_glReadPixels;
+ else if (!strcmp(name, "glBindTexture")) return emscripten_glBindTexture;
+ else if (!strcmp(name, "glGetTexParameterfv")) return emscripten_glGetTexParameterfv;
+ else if (!strcmp(name, "glGetTexParameteriv")) return emscripten_glGetTexParameteriv;
+ else if (!strcmp(name, "glTexParameterfv")) return emscripten_glTexParameterfv;
+ else if (!strcmp(name, "glTexParameteriv")) return emscripten_glTexParameteriv;
+ else if (!strcmp(name, "glIsTexture")) return emscripten_glIsTexture;
+ else if (!strcmp(name, "glGenBuffers")) return emscripten_glGenBuffers;
+ else if (!strcmp(name, "glDeleteBuffers")) return emscripten_glDeleteBuffers;
+ else if (!strcmp(name, "glGetBufferParameteriv")) return emscripten_glGetBufferParameteriv;
+ else if (!strcmp(name, "glBufferData")) return emscripten_glBufferData;
+ else if (!strcmp(name, "glBufferSubData")) return emscripten_glBufferSubData;
+ else if (!strcmp(name, "glIsBuffer")) return emscripten_glIsBuffer;
+ else if (!strcmp(name, "glGenRenderbuffers")) return emscripten_glGenRenderbuffers;
+ else if (!strcmp(name, "glDeleteRenderbuffers")) return emscripten_glDeleteRenderbuffers;
+ else if (!strcmp(name, "glBindRenderbuffer")) return emscripten_glBindRenderbuffer;
+ else if (!strcmp(name, "glGetRenderbufferParameteriv")) return emscripten_glGetRenderbufferParameteriv;
+ else if (!strcmp(name, "glIsRenderbuffer")) return emscripten_glIsRenderbuffer;
+ else if (!strcmp(name, "glGetUniformfv")) return emscripten_glGetUniformfv;
+ else if (!strcmp(name, "glGetUniformiv")) return emscripten_glGetUniformiv;
+ else if (!strcmp(name, "glGetUniformLocation")) return emscripten_glGetUniformLocation;
+ else if (!strcmp(name, "glGetVertexAttribfv")) return emscripten_glGetVertexAttribfv;
+ else if (!strcmp(name, "glGetVertexAttribiv")) return emscripten_glGetVertexAttribiv;
+ else if (!strcmp(name, "glGetVertexAttribPointerv")) return emscripten_glGetVertexAttribPointerv;
+ else if (!strcmp(name, "glGetActiveUniform")) return emscripten_glGetActiveUniform;
+ else if (!strcmp(name, "glUniform1f")) return emscripten_glUniform1f;
+ else if (!strcmp(name, "glUniform2f")) return emscripten_glUniform2f;
+ else if (!strcmp(name, "glUniform3f")) return emscripten_glUniform3f;
+ else if (!strcmp(name, "glUniform4f")) return emscripten_glUniform4f;
+ else if (!strcmp(name, "glUniform1i")) return emscripten_glUniform1i;
+ else if (!strcmp(name, "glUniform2i")) return emscripten_glUniform2i;
+ else if (!strcmp(name, "glUniform3i")) return emscripten_glUniform3i;
+ else if (!strcmp(name, "glUniform4i")) return emscripten_glUniform4i;
+ else if (!strcmp(name, "glUniform1iv")) return emscripten_glUniform1iv;
+ else if (!strcmp(name, "glUniform2iv")) return emscripten_glUniform2iv;
+ else if (!strcmp(name, "glUniform3iv")) return emscripten_glUniform3iv;
+ else if (!strcmp(name, "glUniform4iv")) return emscripten_glUniform4iv;
+ else if (!strcmp(name, "glUniform1fv")) return emscripten_glUniform1fv;
+ else if (!strcmp(name, "glUniform2fv")) return emscripten_glUniform2fv;
+ else if (!strcmp(name, "glUniform3fv")) return emscripten_glUniform3fv;
+ else if (!strcmp(name, "glUniform4fv")) return emscripten_glUniform4fv;
+ else if (!strcmp(name, "glUniformMatrix2fv")) return emscripten_glUniformMatrix2fv;
+ else if (!strcmp(name, "glUniformMatrix3fv")) return emscripten_glUniformMatrix3fv;
+ else if (!strcmp(name, "glUniformMatrix4fv")) return emscripten_glUniformMatrix4fv;
+ else if (!strcmp(name, "glBindBuffer")) return emscripten_glBindBuffer;
+ else if (!strcmp(name, "glVertexAttrib1fv")) return emscripten_glVertexAttrib1fv;
+ else if (!strcmp(name, "glVertexAttrib2fv")) return emscripten_glVertexAttrib2fv;
+ else if (!strcmp(name, "glVertexAttrib3fv")) return emscripten_glVertexAttrib3fv;
+ else if (!strcmp(name, "glVertexAttrib4fv")) return emscripten_glVertexAttrib4fv;
+ else if (!strcmp(name, "glGetAttribLocation")) return emscripten_glGetAttribLocation;
+ else if (!strcmp(name, "glGetActiveAttrib")) return emscripten_glGetActiveAttrib;
+ else if (!strcmp(name, "glCreateShader")) return emscripten_glCreateShader;
+ else if (!strcmp(name, "glDeleteShader")) return emscripten_glDeleteShader;
+ else if (!strcmp(name, "glGetAttachedShaders")) return emscripten_glGetAttachedShaders;
+ else if (!strcmp(name, "glShaderSource")) return emscripten_glShaderSource;
+ else if (!strcmp(name, "glGetShaderSource")) return emscripten_glGetShaderSource;
+ else if (!strcmp(name, "glCompileShader")) return emscripten_glCompileShader;
+ else if (!strcmp(name, "glGetShaderInfoLog")) return emscripten_glGetShaderInfoLog;
+ else if (!strcmp(name, "glGetShaderiv")) return emscripten_glGetShaderiv;
+ else if (!strcmp(name, "glGetProgramiv")) return emscripten_glGetProgramiv;
+ else if (!strcmp(name, "glIsShader")) return emscripten_glIsShader;
+ else if (!strcmp(name, "glCreateProgram")) return emscripten_glCreateProgram;
+ else if (!strcmp(name, "glDeleteProgram")) return emscripten_glDeleteProgram;
+ else if (!strcmp(name, "glAttachShader")) return emscripten_glAttachShader;
+ else if (!strcmp(name, "glDetachShader")) return emscripten_glDetachShader;
+ else if (!strcmp(name, "glGetShaderPrecisionFormat")) return emscripten_glGetShaderPrecisionFormat;
+ else if (!strcmp(name, "glLinkProgram")) return emscripten_glLinkProgram;
+ else if (!strcmp(name, "glGetProgramInfoLog")) return emscripten_glGetProgramInfoLog;
+ else if (!strcmp(name, "glUseProgram")) return emscripten_glUseProgram;
+ else if (!strcmp(name, "glValidateProgram")) return emscripten_glValidateProgram;
+ else if (!strcmp(name, "glIsProgram")) return emscripten_glIsProgram;
+ else if (!strcmp(name, "glBindAttribLocation")) return emscripten_glBindAttribLocation;
+ else if (!strcmp(name, "glBindFramebuffer")) return emscripten_glBindFramebuffer;
+ else if (!strcmp(name, "glGenFramebuffers")) return emscripten_glGenFramebuffers;
+ else if (!strcmp(name, "glDeleteFramebuffers")) return emscripten_glDeleteFramebuffers;
+ else if (!strcmp(name, "glFramebufferRenderbuffer")) return emscripten_glFramebufferRenderbuffer;
+ else if (!strcmp(name, "glFramebufferTexture2D")) return emscripten_glFramebufferTexture2D;
+ else if (!strcmp(name, "glGetFramebufferAttachmentParameteriv")) return emscripten_glGetFramebufferAttachmentParameteriv;
+ else if (!strcmp(name, "glIsFramebuffer")) return emscripten_glIsFramebuffer;
+ else if (!strcmp(name, "glDeleteObject")) return emscripten_glDeleteObjectARB;
+ else if (!strcmp(name, "glGetObjectParameteriv")) return emscripten_glGetObjectParameterivARB;
+ else if (!strcmp(name, "glGetInfoLog")) return emscripten_glGetInfoLogARB;
+ else if (!strcmp(name, "glBindProgram")) return emscripten_glBindProgramARB;
+ else if (!strcmp(name, "glGetPointerv")) return emscripten_glGetPointerv;
+ else if (!strcmp(name, "glDrawRangeElements")) return emscripten_glDrawRangeElements;
+ else if (!strcmp(name, "glEnableClientState")) return emscripten_glEnableClientState;
+ else if (!strcmp(name, "glVertexPointer")) return emscripten_glVertexPointer;
+ else if (!strcmp(name, "glTexCoordPointer")) return emscripten_glTexCoordPointer;
+ else if (!strcmp(name, "glNormalPointer")) return emscripten_glNormalPointer;
+ else if (!strcmp(name, "glColorPointer")) return emscripten_glColorPointer;
+ else if (!strcmp(name, "glClientActiveTexture")) return emscripten_glClientActiveTexture;
+ else if (!strcmp(name, "glGenVertexArrays")) return emscripten_glGenVertexArrays;
+ else if (!strcmp(name, "glDeleteVertexArrays")) return emscripten_glDeleteVertexArrays;
+ else if (!strcmp(name, "glBindVertexArray")) return emscripten_glBindVertexArray;
+ else if (!strcmp(name, "glMatrixMode")) return emscripten_glMatrixMode;
+ else if (!strcmp(name, "glLoadIdentity")) return emscripten_glLoadIdentity;
+ else if (!strcmp(name, "glLoadMatrixf")) return emscripten_glLoadMatrixf;
+ else if (!strcmp(name, "glFrustum")) return emscripten_glFrustum;
+ else if (!strcmp(name, "glRotatef")) return emscripten_glRotatef;
+ else if (!strcmp(name, "glVertexAttribPointer")) return emscripten_glVertexAttribPointer;
+ else if (!strcmp(name, "glEnableVertexAttribArray")) return emscripten_glEnableVertexAttribArray;
+ else if (!strcmp(name, "glDisableVertexAttribArray")) return emscripten_glDisableVertexAttribArray;
+ else if (!strcmp(name, "glDrawArrays")) return emscripten_glDrawArrays;
+ else if (!strcmp(name, "glDrawElements")) return emscripten_glDrawElements;
+ else if (!strcmp(name, "glShaderBinary")) return emscripten_glShaderBinary;
+ else if (!strcmp(name, "glReleaseShaderCompiler")) return emscripten_glReleaseShaderCompiler;
+ else if (!strcmp(name, "glGetError")) return emscripten_glGetError;
+ else if (!strcmp(name, "glVertexAttribDivisor")) return emscripten_glVertexAttribDivisor;
+ else if (!strcmp(name, "glDrawArraysInstanced")) return emscripten_glDrawArraysInstanced;
+ else if (!strcmp(name, "glDrawElementsInstanced")) return emscripten_glDrawElementsInstanced;
+ else if (!strcmp(name, "glFinish")) return emscripten_glFinish;
+ else if (!strcmp(name, "glFlush")) return emscripten_glFlush;
+ else if (!strcmp(name, "glClearDepth")) return emscripten_glClearDepth;
+ else if (!strcmp(name, "glClearDepthf")) return emscripten_glClearDepthf;
+ else if (!strcmp(name, "glDepthFunc")) return emscripten_glDepthFunc;
+ else if (!strcmp(name, "glEnable")) return emscripten_glEnable;
+ else if (!strcmp(name, "glDisable")) return emscripten_glDisable;
+ else if (!strcmp(name, "glFrontFace")) return emscripten_glFrontFace;
+ else if (!strcmp(name, "glCullFace")) return emscripten_glCullFace;
+ else if (!strcmp(name, "glClear")) return emscripten_glClear;
+ else if (!strcmp(name, "glLineWidth")) return emscripten_glLineWidth;
+ else if (!strcmp(name, "glClearStencil")) return emscripten_glClearStencil;
+ else if (!strcmp(name, "glDepthMask")) return emscripten_glDepthMask;
+ else if (!strcmp(name, "glStencilMask")) return emscripten_glStencilMask;
+ else if (!strcmp(name, "glCheckFramebufferStatus")) return emscripten_glCheckFramebufferStatus;
+ else if (!strcmp(name, "glGenerateMipmap")) return emscripten_glGenerateMipmap;
+ else if (!strcmp(name, "glActiveTexture")) return emscripten_glActiveTexture;
+ else if (!strcmp(name, "glBlendEquation")) return emscripten_glBlendEquation;
+ else if (!strcmp(name, "glIsEnabled")) return emscripten_glIsEnabled;
+ else if (!strcmp(name, "glBlendFunc")) return emscripten_glBlendFunc;
+ else if (!strcmp(name, "glBlendEquationSeparate")) return emscripten_glBlendEquationSeparate;
+ else if (!strcmp(name, "glDepthRange")) return emscripten_glDepthRange;
+ else if (!strcmp(name, "glDepthRangef")) return emscripten_glDepthRangef;
+ else if (!strcmp(name, "glStencilMaskSeparate")) return emscripten_glStencilMaskSeparate;
+ else if (!strcmp(name, "glHint")) return emscripten_glHint;
+ else if (!strcmp(name, "glPolygonOffset")) return emscripten_glPolygonOffset;
+ else if (!strcmp(name, "glVertexAttrib1f")) return emscripten_glVertexAttrib1f;
+ else if (!strcmp(name, "glSampleCoverage")) return emscripten_glSampleCoverage;
+ else if (!strcmp(name, "glTexParameteri")) return emscripten_glTexParameteri;
+ else if (!strcmp(name, "glTexParameterf")) return emscripten_glTexParameterf;
+ else if (!strcmp(name, "glVertexAttrib2f")) return emscripten_glVertexAttrib2f;
+ else if (!strcmp(name, "glStencilFunc")) return emscripten_glStencilFunc;
+ else if (!strcmp(name, "glStencilOp")) return emscripten_glStencilOp;
+ else if (!strcmp(name, "glViewport")) return emscripten_glViewport;
+ else if (!strcmp(name, "glClearColor")) return emscripten_glClearColor;
+ else if (!strcmp(name, "glScissor")) return emscripten_glScissor;
+ else if (!strcmp(name, "glVertexAttrib3f")) return emscripten_glVertexAttrib3f;
+ else if (!strcmp(name, "glColorMask")) return emscripten_glColorMask;
+ else if (!strcmp(name, "glRenderbufferStorage")) return emscripten_glRenderbufferStorage;
+ else if (!strcmp(name, "glBlendFuncSeparate")) return emscripten_glBlendFuncSeparate;
+ else if (!strcmp(name, "glBlendColor")) return emscripten_glBlendColor;
+ else if (!strcmp(name, "glStencilFuncSeparate")) return emscripten_glStencilFuncSeparate;
+ else if (!strcmp(name, "glStencilOpSeparate")) return emscripten_glStencilOpSeparate;
+ else if (!strcmp(name, "glVertexAttrib4f")) return emscripten_glVertexAttrib4f;
+ else if (!strcmp(name, "glCopyTexImage2D")) return emscripten_glCopyTexImage2D;
+ else if (!strcmp(name, "glCopyTexSubImage2D")) return emscripten_glCopyTexSubImage2D;
+
+ fprintf(stderr, "bad name in getProcAddress: %s | %s\n", name_, name);
+ return 0;
+}
+
diff --git a/system/lib/gl.symbols b/system/lib/gl.symbols
new file mode 100644
index 00000000..8ba8d6f7
--- /dev/null
+++ b/system/lib/gl.symbols
@@ -0,0 +1 @@
+ T emscripten_GetProcAddress
diff --git a/system/lib/libc.symbols b/system/lib/libc.symbols
index 6f80ef90..53a27082 100644
--- a/system/lib/libc.symbols
+++ b/system/lib/libc.symbols
@@ -72,7 +72,16 @@
W realloc_in_place
T scalbn
T scalbnl
+ T memcmp
+ T memcpy
T strtod
+ T strcoll
+ T __strcoll_l
+ W strcoll_l
+ T strcmp
+ T strncmp
+ T strcasecmp
+ T strncasecmp
T strtod_l
T strtof
T strtof_l
diff --git a/system/lib/libc/musl/src/locale/strcoll.c b/system/lib/libc/musl/src/locale/strcoll.c
new file mode 100644
index 00000000..39ea1123
--- /dev/null
+++ b/system/lib/libc/musl/src/locale/strcoll.c
@@ -0,0 +1,15 @@
+#include <string.h>
+#include <locale.h>
+#include "libc.h"
+
+int __strcoll_l(const char *l, const char *r, locale_t loc)
+{
+ return strcmp(l, r);
+}
+
+int strcoll(const char *l, const char *r)
+{
+ return __strcoll_l(l, r, 0);
+}
+
+weak_alias(__strcoll_l, strcoll_l);
diff --git a/system/lib/libc/musl/src/regex/fnmatch.c b/system/lib/libc/musl/src/regex/fnmatch.c
new file mode 100644
index 00000000..ffd3ea0d
--- /dev/null
+++ b/system/lib/libc/musl/src/regex/fnmatch.c
@@ -0,0 +1,299 @@
+/*
+ * An implementation of what I call the "Sea of Stars" algorithm for
+ * POSIX fnmatch(). The basic idea is that we factor the pattern into
+ * a head component (which we match first and can reject without ever
+ * measuring the length of the string), an optional tail component
+ * (which only exists if the pattern contains at least one star), and
+ * an optional "sea of stars", a set of star-separated components
+ * between the head and tail. After the head and tail matches have
+ * been removed from the input string, the components in the "sea of
+ * stars" are matched sequentially by searching for their first
+ * occurrence past the end of the previous match.
+ *
+ * - Rich Felker, April 2012
+ */
+
+#include <string.h>
+#include <fnmatch.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#define END -1
+#define UNMATCHABLE -2
+#define BRACKET -3
+#define QUESTION -4
+#define STAR -5
+
+static int str_next(const char *str, size_t n, size_t *step)
+{
+ if (!n) {
+ *step = 0;
+ return 0;
+ }
+ if (str[0] >= 128U) {
+ wchar_t wc;
+ int k = mbtowc(&wc, str, n);
+ if (k<0) {
+ *step = 1;
+ return -1;
+ }
+ *step = k;
+ return wc;
+ }
+ *step = 1;
+ return str[0];
+}
+
+static int pat_next(const char *pat, size_t m, size_t *step, int flags)
+{
+ int esc = 0;
+ if (!m || !*pat) {
+ *step = 0;
+ return END;
+ }
+ *step = 1;
+ if (pat[0]=='\\' && !(flags & FNM_NOESCAPE)) {
+ *step = 2;
+ pat++;
+ esc = 1;
+ goto escaped;
+ }
+ if (pat[0]=='[') {
+ size_t k = 1;
+ if (k<m) if (pat[k] == '^' || pat[k] == '!') k++;
+ if (k<m) if (pat[k] == ']') k++;
+ for (; k<m && pat[k] && pat[k]!=']'; k++) {
+ if (k+1<m && pat[k+1] && pat[k]=='[' && (pat[k+1]==':' || pat[k+1]=='.' || pat[k+1]=='=')) {
+ int z = pat[k+1];
+ k+=2;
+ if (k<m && pat[k]) k++;
+ while (k<m && pat[k] && (pat[k-1]!=z || pat[k]!=']')) k++;
+ if (k==m || !pat[k]) break;
+ }
+ }
+ if (k==m || !pat[k]) {
+ *step = 1;
+ return '[';
+ }
+ *step = k+1;
+ return BRACKET;
+ }
+ if (pat[0] == '*')
+ return STAR;
+ if (pat[0] == '?')
+ return QUESTION;
+escaped:
+ if (pat[0] >= 128U) {
+ wchar_t wc;
+ int k = mbtowc(&wc, pat, m);
+ if (k<0) {
+ *step = 0;
+ return UNMATCHABLE;
+ }
+ *step = k + esc;
+ return wc;
+ }
+ return pat[0];
+}
+
+static int match_bracket(const char *p, int k)
+{
+ wchar_t wc;
+ int inv = 0;
+ p++;
+ if (*p=='^' || *p=='!') {
+ inv = 1;
+ p++;
+ }
+ if (*p==']') {
+ if (k==']') return !inv;
+ p++;
+ } else if (*p=='-') {
+ if (k=='-') return !inv;
+ p++;
+ }
+ wc = p[-1];
+ for (; *p != ']'; p++) {
+ if (p[0]=='-' && p[1]!=']') {
+ wchar_t wc2;
+ int l = mbtowc(&wc2, p+1, 4);
+ if (l < 0) return 0;
+ if (wc<=wc2 && (unsigned)k-wc <= wc2-wc) return !inv;
+ p += l-1;
+ continue;
+ }
+ if (p[0]=='[' && (p[1]==':' || p[1]=='.' || p[1]=='=')) {
+ const char *p0 = p+2;
+ int z = p[1];
+ p+=3;
+ while (p[-1]!=z || p[0]!=']') p++;
+ if (z == ':' && p-1-p0 < 16) {
+ char buf[16];
+ memcpy(buf, p0, p-1-p0);
+ buf[p-1-p0] = 0;
+ if (iswctype(k, wctype(buf))) return !inv;
+ }
+ continue;
+ }
+ if (*p < 128U) {
+ wc = (unsigned char)*p;
+ } else {
+ int l = mbtowc(&wc, p, 4);
+ if (l < 0) return 0;
+ p += l-1;
+ }
+ if (wc==k) return !inv;
+ }
+ return inv;
+}
+
+static int fnmatch_internal(const char *pat, size_t m, const char *str, size_t n, int flags)
+{
+ const char *p, *ptail, *endpat;
+ const char *s, *stail, *endstr;
+ size_t pinc, sinc, tailcnt=0;
+ int c, k;
+
+ if (flags & FNM_PERIOD) {
+ if (*str == '.' && *pat != '.')
+ return FNM_NOMATCH;
+ }
+ for (;;) {
+ switch ((c = pat_next(pat, m, &pinc, flags))) {
+ case UNMATCHABLE:
+ return FNM_NOMATCH;
+ case STAR:
+ pat++;
+ m--;
+ break;
+ default:
+ k = str_next(str, n, &sinc);
+ if (k <= 0)
+ return (c==END) ? 0 : FNM_NOMATCH;
+ str += sinc;
+ n -= sinc;
+ if (c == BRACKET) {
+ if (!match_bracket(pat, k))
+ return FNM_NOMATCH;
+ } else if (c != QUESTION && k != c) {
+ return FNM_NOMATCH;
+ }
+ pat+=pinc;
+ m-=pinc;
+ continue;
+ }
+ break;
+ }
+
+ /* Compute real pat length if it was initially unknown/-1 */
+ m = strnlen(pat, m);
+ endpat = pat + m;
+
+ /* Find the last * in pat and count chars needed after it */
+ for (p=ptail=pat; p<endpat; p+=pinc) {
+ switch (pat_next(p, endpat-p, &pinc, flags)) {
+ case UNMATCHABLE:
+ return FNM_NOMATCH;
+ case STAR:
+ tailcnt=0;
+ ptail = p+1;
+ break;
+ default:
+ tailcnt++;
+ break;
+ }
+ }
+
+ /* Past this point we need not check for UNMATCHABLE in pat,
+ * because all of pat has already been parsed once. */
+
+ /* Compute real str length if it was initially unknown/-1 */
+ n = strnlen(str, n);
+ endstr = str + n;
+ if (n < tailcnt) return FNM_NOMATCH;
+
+ /* Find the final tailcnt chars of str, accounting for UTF-8.
+ * On illegal sequences we may get it wrong, but in that case
+ * we necessarily have a matching failure anyway. */
+ for (s=endstr; s>str && tailcnt; tailcnt--) {
+ if (s[-1] < 128U) s--;
+ else while ((unsigned char)*--s-0x80U<0x40 && s>str);
+ }
+ if (tailcnt) return FNM_NOMATCH;
+ stail = s;
+
+ /* Check that the pat and str tails match */
+ p = ptail;
+ for (;;) {
+ c = pat_next(p, endpat-p, &pinc, flags);
+ p += pinc;
+ if ((k = str_next(s, endstr-s, &sinc)) <= 0) {
+ if (c != END) return FNM_NOMATCH;
+ break;
+ }
+ s += sinc;
+ if (c == BRACKET) {
+ if (!match_bracket(p-pinc, k))
+ return FNM_NOMATCH;
+ } else if (c != QUESTION && k != c) {
+ return FNM_NOMATCH;
+ }
+ }
+
+ /* We're all done with the tails now, so throw them out */
+ endstr = stail;
+ endpat = ptail;
+
+ /* Match pattern components until there are none left */
+ while (pat<endpat) {
+ p = pat;
+ s = str;
+ for (;;) {
+ c = pat_next(p, endpat-p, &pinc, flags);
+ p += pinc;
+ /* Encountering * completes/commits a component */
+ if (c == STAR) {
+ pat = p;
+ str = s;
+ break;
+ }
+ k = str_next(s, endstr-s, &sinc);
+ if (!k)
+ return FNM_NOMATCH;
+ if (c == BRACKET) {
+ if (!match_bracket(p-pinc, k))
+ break;
+ } else if (c != QUESTION && k != c) {
+ break;
+ }
+ s += sinc;
+ }
+ if (c == STAR) continue;
+ /* If we failed, advance str, by 1 char if it's a valid
+ * char, or past all invalid bytes otherwise. */
+ k = str_next(str, endstr-str, &sinc);
+ if (k > 0) str += sinc;
+ else for (str++; str_next(str, endstr-str, &sinc)<0; str++);
+ }
+
+ return 0;
+}
+
+int fnmatch(const char *pat, const char *str, int flags)
+{
+ const char *s, *p;
+ size_t inc;
+ int c;
+ if (flags & FNM_PATHNAME) for (;;) {
+ for (s=str; *s && *s!='/'; s++);
+ for (p=pat; (c=pat_next(p, -1, &inc, flags))!=END && c!='/'; p+=inc);
+ if (*s && *p!=*s) return FNM_NOMATCH;
+ if (fnmatch_internal(pat, p-pat, str, s-str, flags))
+ return FNM_NOMATCH;
+ if (!*s && c==END) return 0;
+ str = s+1;
+ pat = p+1;
+ }
+ return fnmatch_internal(pat, -1, str, -1, flags);
+}
diff --git a/system/lib/libc/musl/src/string/memcmp.c b/system/lib/libc/musl/src/string/memcmp.c
new file mode 100644
index 00000000..bdbce9f0
--- /dev/null
+++ b/system/lib/libc/musl/src/string/memcmp.c
@@ -0,0 +1,8 @@
+#include <string.h>
+
+int memcmp(const void *vl, const void *vr, size_t n)
+{
+ const unsigned char *l=vl, *r=vr;
+ for (; n && *l == *r; n--, l++, r++);
+ return n ? *l-*r : 0;
+}
diff --git a/system/lib/libc/musl/src/string/strcasecmp.c b/system/lib/libc/musl/src/string/strcasecmp.c
new file mode 100644
index 00000000..02fd5f8c
--- /dev/null
+++ b/system/lib/libc/musl/src/string/strcasecmp.c
@@ -0,0 +1,9 @@
+#include <strings.h>
+#include <ctype.h>
+
+int strcasecmp(const char *_l, const char *_r)
+{
+ const unsigned char *l=(void *)_l, *r=(void *)_r;
+ for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
+ return tolower(*l) - tolower(*r);
+}
diff --git a/system/lib/libc/musl/src/string/strcmp.c b/system/lib/libc/musl/src/string/strcmp.c
new file mode 100644
index 00000000..91eb7404
--- /dev/null
+++ b/system/lib/libc/musl/src/string/strcmp.c
@@ -0,0 +1,7 @@
+#include <string.h>
+
+int strcmp(const char *l, const char *r)
+{
+ for (; *l==*r && *l && *r; l++, r++);
+ return *(unsigned char *)l - *(unsigned char *)r;
+}
diff --git a/system/lib/libc/musl/src/string/strncasecmp.c b/system/lib/libc/musl/src/string/strncasecmp.c
new file mode 100644
index 00000000..24659721
--- /dev/null
+++ b/system/lib/libc/musl/src/string/strncasecmp.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+#include <ctype.h>
+
+int strncasecmp(const char *_l, const char *_r, size_t n)
+{
+ const unsigned char *l=(void *)_l, *r=(void *)_r;
+ if (!n--) return 0;
+ for (; *l && *r && n && (*l == *r || tolower(*l) == tolower(*r)); l++, r++, n--);
+ return tolower(*l) - tolower(*r);
+}
diff --git a/system/lib/libc/musl/src/string/strncmp.c b/system/lib/libc/musl/src/string/strncmp.c
new file mode 100644
index 00000000..e228843f
--- /dev/null
+++ b/system/lib/libc/musl/src/string/strncmp.c
@@ -0,0 +1,9 @@
+#include <string.h>
+
+int strncmp(const char *_l, const char *_r, size_t n)
+{
+ const unsigned char *l=(void *)_l, *r=(void *)_r;
+ if (!n--) return 0;
+ for (; *l && *r && n && *l == *r ; l++, r++, n--);
+ return *l - *r;
+}
diff --git a/system/lib/libcextra.symbols b/system/lib/libcextra.symbols
index 6f1039f1..54176b1d 100644
--- a/system/lib/libcextra.symbols
+++ b/system/lib/libcextra.symbols
@@ -187,3 +187,4 @@
T wmemmove
T wmemset
T wprintf
+ T fnmatch
diff --git a/system/lib/sdl.cpp b/system/lib/sdl.cpp
deleted file mode 100644
index 7038cdb1..00000000
--- a/system/lib/sdl.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-
-#include <stdlib.h>
-
-// force malloc&free to be included in from libc
-struct Force {
- Force() {
- void *x = malloc(10);
- free(x);
- }
-};
-
-static Force f;
-
diff --git a/system/lib/sdl.symbols b/system/lib/sdl.symbols
deleted file mode 100644
index c2c0af42..00000000
--- a/system/lib/sdl.symbols
+++ /dev/null
@@ -1 +0,0 @@
- W SDL_Init
diff --git a/tests/799.cpp b/tests/799.cpp
index 6c4c9b18..aa3213af 100644
--- a/tests/799.cpp
+++ b/tests/799.cpp
@@ -6,7 +6,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <arpa/inet.h>
#endif
diff --git a/tests/aniso.c b/tests/aniso.c
index 443e50aa..b925149d 100644
--- a/tests/aniso.c
+++ b/tests/aniso.c
@@ -208,7 +208,7 @@ int main(int argc, char *argv[])
*/
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(2000);
#endif
diff --git a/tests/asmjs-unknown-emscripten.c b/tests/asmjs-unknown-emscripten.c
new file mode 100644
index 00000000..36071964
--- /dev/null
+++ b/tests/asmjs-unknown-emscripten.c
@@ -0,0 +1,98 @@
+#ifndef __EMSCRIPTEN__
+#error __EMSCRIPTEN__ is not defined
+#endif
+#ifndef __asmjs__
+#error __asmjs__ is not defined
+#endif
+#ifdef __cplusplus
+#ifndef _GNU_SOURCE
+#error _GNU_SOURCE is not defined in C++
+#endif
+#endif
+#ifndef __unix__
+#error __unix__ is not defined
+#endif
+#ifndef __LITTLE_ENDIAN__
+#error __LITTLE_ENDIAN__ is not defined
+#endif
+
+#ifdef __clang__
+#if __has_feature(pnacl)
+#error has feature pnacl
+#endif
+#endif
+
+#ifdef __native_client__
+#error __native_client__ is defined
+#endif
+#ifdef __pnacl__
+#error __pnacl__ is defined
+#endif
+#ifdef __ELF__
+#error __ELF__ is defined
+#endif
+#ifdef __i386__
+#error __i386__ is defined
+#endif
+#ifdef __i386
+#error __i386 is defined
+#endif
+#ifdef i386
+#error i386 is defined
+#endif
+#ifdef __SSE__
+#error __SSE__ is defined
+#endif
+#ifdef __SSE2__
+#error __SSE2__ is defined
+#endif
+#ifdef __SSE_MATH__
+#error __SSE_MATH__ is defined
+#endif
+#ifdef __SSE2_MATH__
+#error __SSE2_MATH__ is defined
+#endif
+#ifdef __MMX__
+#error __MMX__ is defined
+#endif
+#ifdef __APPLE__
+#error __APPLE__ is defined
+#endif
+#ifdef __linux__
+#error __linux__ is defined
+#endif
+#ifdef __BIG_ENDIAN__
+#error __BIG_ENDIAN__ is defined
+#endif
+#ifdef __LP64__
+#error __LP64__ is defined
+#endif
+
+// We prefer to use __EMSCRIPTEN__, but for compatibility, we define
+// EMSCRIPTEN too.
+#ifndef EMSCRIPTEN
+#error EMSCRIPTEN is not defined
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include <string.h>
+#include <assert.h>
+
+#define STRINGIZE_HELPER(x) #x
+#define STRINGIZE(x) STRINGIZE_HELPER(x)
+
+int main() {
+ assert(sizeof(void*) == 4);
+ assert(sizeof(long) == 4);
+ assert(sizeof(intmax_t) == 8);
+ assert(__alignof(double) == 8);
+ assert(sizeof(long double) == 8);
+ assert(__alignof(long double) == 8);
+ assert(sizeof(intptr_t) == 4);
+ assert(sizeof(size_t) == 4);
+ assert(sizeof(ptrdiff_t) == 4);
+ assert(__FLT_EVAL_METHOD__ == 0);
+ assert(strcmp(STRINGIZE(__USER_LABEL_PREFIX__), "") == 0);
+ return 0;
+}
diff --git a/tests/box2d/Benchmark.cpp b/tests/box2d/Benchmark.cpp
index 0db1d4be..6c9b3c5b 100644
--- a/tests/box2d/Benchmark.cpp
+++ b/tests/box2d/Benchmark.cpp
@@ -25,6 +25,10 @@ typedef struct {
#include <time.h>
#include <math.h>
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+
#include "Box2D/Box2D.h"
using namespace std;
@@ -52,6 +56,14 @@ result_t measure(clock_t *times) {
return r;
}
+b2World *world;
+clock_t *times, minn = CLOCKS_PER_SEC * 1000 * 100, maxx = -1;
+b2Body* topBody;
+int32 frameCounter = 0;
+int responsive_main_loop;
+
+void iter();
+
int main(int argc, char **argv) {
int arg = argc > 1 ? argv[1][0] - '0' : 3;
switch(arg) {
@@ -64,24 +76,28 @@ int main(int argc, char **argv) {
default: printf("error: %d\\n", arg); return -1;
}
+ // do not split out warmup, do not ignore initial stalls
+ FRAMES += WARMUP;
+ WARMUP = 0;
+
+ times = new clock_t[FRAMES];
+
// Define the gravity vector.
b2Vec2 gravity(0.0f, -10.0f);
// Construct a world object, which will hold and simulate the rigid bodies.
- b2World world(gravity);
- world.SetAllowSleeping(false);
+ world = new b2World(gravity);
+ world->SetAllowSleeping(false);
{
b2BodyDef bd;
- b2Body* ground = world.CreateBody(&bd);
+ b2Body* ground = world->CreateBody(&bd);
b2EdgeShape shape;
shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f));
ground->CreateFixture(&shape, 0.0f);
}
- b2Body* topBody;
-
{
float32 a = 0.5f;
b2PolygonShape shape;
@@ -99,7 +115,7 @@ int main(int argc, char **argv) {
b2BodyDef bd;
bd.type = b2_dynamicBody;
bd.position = y;
- b2Body* body = world.CreateBody(&bd);
+ b2Body* body = world->CreateBody(&bd);
body->CreateFixture(&shape, 5.0f);
topBody = body;
@@ -112,25 +128,54 @@ int main(int argc, char **argv) {
}
for (int32 i = 0; i < WARMUP; ++i) {
- world.Step(1.0f/60.0f, 3, 3);
+ world->Step(1.0f/60.0f, 3, 3);
+ }
+
+#ifdef __EMSCRIPTEN__
+ responsive_main_loop = argc > 2 ? argv[2][0] - '0' : 0;
+ if (responsive_main_loop) {
+ printf("responsive main loop\n");
+ emscripten_set_main_loop(iter, 60, 1);
+ } else {
+#endif
+ do {
+ iter();
+ } while (frameCounter <= FRAMES);
+#ifdef __EMSCRIPTEN__
}
+#endif
- clock_t times[FRAMES];
- for (int32 i = 0; i < FRAMES; ++i) {
- clock_t start = clock();
- world.Step(1.0f/60.0f, 3, 3);
- clock_t end = clock();
- times[i] = end - start;
+ return 0;
+}
+
+void iter() {
+ if (frameCounter < FRAMES) {
+ clock_t start = clock();
+ world->Step(1.0f/60.0f, 3, 3);
+ clock_t end = clock();
+ clock_t curr = end - start;
+ times[frameCounter] = curr;
+ if (curr < minn) minn = curr;
+ if (curr > maxx) maxx = curr;
#if DEBUG
printf("%f :: ", topBody->GetPosition().y);
- printf("%f\n", (float32)(end - start) / CLOCKS_PER_SEC * 1000);
+ printf("%f\n", (float32)(end - start) / CLOCKS_PER_SEC * 1000);
#endif
- }
+ frameCounter++;
+ return;
+ }
+
+ // that's it!
+
+ frameCounter++;
result_t result = measure(times);
- printf("frame averages: %.3f +- %.3f\n", result.mean, result.stddev);
+ printf("frame averages: %.3f +- %.3f, range: %.3f to %.3f \n", result.mean, result.stddev, float(minn)/CLOCKS_PER_SEC * 1000, float(maxx)/CLOCKS_PER_SEC * 1000);
- return 0;
+#ifdef __EMSCRIPTEN__
+ emscripten_run_script("if (Module.reportCompletion) Module.reportCompletion()");
+ if (responsive_main_loop) emscripten_cancel_main_loop();
+#endif
}
diff --git a/tests/cases/2xi40.ll b/tests/cases/2xi40.ll
index 592f1ba4..03c918c8 100644
--- a/tests/cases/2xi40.ll
+++ b/tests/cases/2xi40.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.pair = type { [5 x i8], [5 x i8] }
diff --git a/tests/cases/514_ta2.ll b/tests/cases/514_ta2.ll
index ab363242..d435cac1 100644
--- a/tests/cases/514_ta2.ll
+++ b/tests/cases/514_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpxFUbAg/test_emcc1.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.c_s = type { i8, float, i32 }
diff --git a/tests/cases/aliasbitcast.ll b/tests/cases/aliasbitcast.ll
index 5e5f13aa..de46cdd4 100644
--- a/tests/cases/aliasbitcast.ll
+++ b/tests/cases/aliasbitcast.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/emscripten/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]
diff --git a/tests/cases/aliasbitcast2_noasm.ll b/tests/cases/aliasbitcast2_noasm.ll
index 8537e272..5387f2c0 100644
--- a/tests/cases/aliasbitcast2_noasm.ll
+++ b/tests/cases/aliasbitcast2_noasm.ll
@@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return
return: ; preds = %entry
diff --git a/tests/cases/aliasbitcast3_noasm.ll b/tests/cases/aliasbitcast3_noasm.ll
index 4ff969e3..19d3ff14 100644
--- a/tests/cases/aliasbitcast3_noasm.ll
+++ b/tests/cases/aliasbitcast3_noasm.ll
@@ -11,7 +11,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return
return: ; preds = %entry
@@ -24,6 +24,6 @@ declare i32 @puts(i8*)
; [#uses=0]
define i32 @main() {
entry:
- call void @thriceremoved()
+ call void @thriceremoved(i32 0)
ret i32 0
}
diff --git a/tests/cases/aliasbitcastdollar_noasm.ll b/tests/cases/aliasbitcastdollar_noasm.ll
index 1ecf6047..558289b7 100644
--- a/tests/cases/aliasbitcastdollar_noasm.ll
+++ b/tests/cases/aliasbitcastdollar_noasm.ll
@@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @original() {
entry:
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return
return: ; preds = %entry
diff --git a/tests/cases/atomicrmw.ll b/tests/cases/atomicrmw.ll
index 31529250..abbcc7a6 100644
--- a/tests/cases/atomicrmw.ll
+++ b/tests/cases/atomicrmw.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/atomicrmw_dec.ll b/tests/cases/atomicrmw_dec.ll
new file mode 100644
index 00000000..edb5bd8f
--- /dev/null
+++ b/tests/cases/atomicrmw_dec.ll
@@ -0,0 +1,21 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %t = alloca i32, align 4 ; [#uses=2 type=i32**]
+ store i32 50, i32* %t, align 4
+ %0 = load i32* %t
+ %1 = atomicrmw sub i32* %t, i32 3 seq_cst ; [#uses=0 type=i32] [debug line = 21:12]
+ %2 = load i32* %t
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %2) ; [#uses=0 type=i32]
+ %3 = atomicrmw volatile add i32* %t, i32 3 seq_cst ; [#uses=0 type=i32] [debug line = 21:12]
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/atomicrmw_dec.txt b/tests/cases/atomicrmw_dec.txt
new file mode 100644
index 00000000..e8dcb406
--- /dev/null
+++ b/tests/cases/atomicrmw_dec.txt
@@ -0,0 +1 @@
+hello, 50,47!
diff --git a/tests/cases/atomicrmw_unaligned.ll b/tests/cases/atomicrmw_unaligned.ll
index 31529250..abbcc7a6 100644
--- a/tests/cases/atomicrmw_unaligned.ll
+++ b/tests/cases/atomicrmw_unaligned.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/bigdouble.ll b/tests/cases/bigdouble.ll
new file mode 100644
index 00000000..e96b10af
--- /dev/null
+++ b/tests/cases/bigdouble.ll
@@ -0,0 +1,17 @@
+; ModuleID = '/tmp/tmpijH2sB/a.out.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
+
+; Function Attrs: nounwind
+define i32 @main() #0 {
+ %1 = fmul double 0x370000000000000, 1.0e+300
+ %2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i32 0, i32 0), double %1)
+ ret i32 0
+}
+
+; Function Attrs: nounwind
+declare i32 @printf(i8* nocapture, ...) #0
+
+attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/tests/cases/bigdouble.txt b/tests/cases/bigdouble.txt
new file mode 100644
index 00000000..689709cd
--- /dev/null
+++ b/tests/cases/bigdouble.txt
@@ -0,0 +1 @@
+400833672.001795
diff --git a/tests/cases/boolret_fastcomp.ll b/tests/cases/boolret_fastcomp.ll
new file mode 100644
index 00000000..1b968778
--- /dev/null
+++ b/tests/cases/boolret_fastcomp.ll
@@ -0,0 +1,31 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [15 x i8] c"helloworld%d.\0A\00", align 1
+
+define i1 @boolretter() {
+ ret i1 -1
+}
+
+define i8 @smallretter() {
+ ret i8 -1
+}
+
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ store i32 0, i32* %retval
+ %bool = call i1 ()* @boolretter()
+ %combined = xor i1 %bool, 1
+ %int = select i1 %combined, i32 20, i32 30
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 %int)
+ %small = call i8 ()* @smallretter()
+ %bcombined = xor i8 %small, 1
+ %bcheck = icmp eq i8 %bcombined, 255
+ %bint = select i1 %bcheck, i32 20, i32 30
+ %bcall = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 %bint)
+ ret i32 1
+}
+
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/boolret_fastcomp.txt b/tests/cases/boolret_fastcomp.txt
new file mode 100644
index 00000000..e1ad61ab
--- /dev/null
+++ b/tests/cases/boolret_fastcomp.txt
@@ -0,0 +1,2 @@
+helloworld30.
+helloworld30.
diff --git a/tests/cases/breakinthemiddle.ll b/tests/cases/breakinthemiddle.ll
index 6e05b853..4c43bbd0 100644
--- a/tests/cases/breakinthemiddle.ll
+++ b/tests/cases/breakinthemiddle.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1]
diff --git a/tests/cases/breakinthemiddle2.ll b/tests/cases/breakinthemiddle2.ll
index 2f8c1c91..301b62c3 100644
--- a/tests/cases/breakinthemiddle2.ll
+++ b/tests/cases/breakinthemiddle2.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1]
diff --git a/tests/cases/caall.ll b/tests/cases/caall.ll
index 2cc231ec..ffbf29d8 100644
--- a/tests/cases/caall.ll
+++ b/tests/cases/caall.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/callwithstructural64_ta2.ll b/tests/cases/callwithstructural64_ta2.ll
index d16b0e87..56b0442c 100644
--- a/tests/cases/callwithstructural64_ta2.ll
+++ b/tests/cases/callwithstructural64_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'foo.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%ac = type { i8*, i64 }
diff --git a/tests/cases/callwithstructural_ta2.ll b/tests/cases/callwithstructural_ta2.ll
index bc6f852a..88a3d755 100644
--- a/tests/cases/callwithstructural_ta2.ll
+++ b/tests/cases/callwithstructural_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'foo.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%ac = type { i8*, i32 }
diff --git a/tests/cases/complexphi.ll b/tests/cases/complexphi.ll
index e79e6f1b..0d1677f3 100644
--- a/tests/cases/complexphi.ll
+++ b/tests/cases/complexphi.ll
@@ -1,6 +1,6 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
@_dispatchTable = internal global i64 0
diff --git a/tests/cases/ctors_cast.ll b/tests/cases/ctors_cast.ll
index d94b1d63..707b5528 100644
--- a/tests/cases/ctors_cast.ll
+++ b/tests/cases/ctors_cast.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpHcVUBJ/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.Other = type { i8 }
diff --git a/tests/cases/dash.ll b/tests/cases/dash.ll
index 6833a42e..6f727820 100644
--- a/tests/cases/dash.ll
+++ b/tests/cases/dash.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpqfApGD/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@other-name = alias i32 ()* @main
diff --git a/tests/cases/dollar.ll b/tests/cases/dollar.ll
new file mode 100644
index 00000000..8f0c1dd7
--- /dev/null
+++ b/tests/cases/dollar.ll
@@ -0,0 +1,22 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
+
+define void @"dollar$"() {
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32]
+ ret void
+}
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ store i32 0, i32* %retval
+ call void ()* @"dollar$"()
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/emptyalloca.ll b/tests/cases/emptyalloca.ll
index f12a4161..0c03c645 100644
--- a/tests/cases/emptyalloca.ll
+++ b/tests/cases/emptyalloca.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpjSNiky/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [30 x i8] c"Module.print('hello, world!')\00", align 1
diff --git a/tests/cases/emptyasm_le32.ll b/tests/cases/emptyasm_aue.ll
index 8f6b606e..65d9e213 100644
--- a/tests/cases/emptyasm_le32.ll
+++ b/tests/cases/emptyasm_aue.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
; ModuleID = 'tests/hello_world.bc'
diff --git a/tests/cases/emptystruct.ll b/tests/cases/emptystruct.ll
index ecf0e295..b32ac803 100644
--- a/tests/cases/emptystruct.ll
+++ b/tests/cases/emptystruct.ll
@@ -13,7 +13,7 @@ entry:
%z = alloca %struct.s, align 4
%0 = bitcast %struct.s* %z to i8*
call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 4, i32 4, i1 false)
- %1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
ret i32 0
}
diff --git a/tests/cases/entry3.ll b/tests/cases/entry3.ll
index 6888d0a8..7e154e2c 100644
--- a/tests/cases/entry3.ll
+++ b/tests/cases/entry3.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpKnA2D3/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [11 x i8] c"getgid=%d\0A\00", align 1
@.str1 = private unnamed_addr constant [6 x i8] c"f=%d\0A\00", align 1
diff --git a/tests/cases/extendedprecision.ll b/tests/cases/extendedprecision.ll
index 6f1b2626..150e8bb4 100644
--- a/tests/cases/extendedprecision.ll
+++ b/tests/cases/extendedprecision.ll
@@ -7,7 +7,7 @@ target triple = "i386-pc-linux-gnu"
; [#uses=2]
define void @"\01_Z5hellov"(x86_fp80 %waka) {
entry:
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return
return: ; preds = %entry
@@ -23,7 +23,7 @@ entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @"\01_Z5hellov"(x86_fp80 0x00000000000000000000)
+ call void @"\01_Z5hellov"(x86_fp80 0xK00000000000000000000)
store i32 0, i32* %0, align 4
%1 = load i32* %0, align 4 ; [#uses=1]
store i32 %1, i32* %retval, align 4
diff --git a/tests/cases/fptosi.ll b/tests/cases/fptosi.ll
new file mode 100644
index 00000000..caf9b754
--- /dev/null
+++ b/tests/cases/fptosi.ll
@@ -0,0 +1,28 @@
+; ModuleID = '/dev/shm/tmp/src.cpp.o'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [8 x i8] c"*%.3f*\0A\00", align 1 ; [#uses=1 type=[8 x i8]*]
+@.str2 = private unnamed_addr constant [6 x i8] c"*%d*\0A\00", align 1 ; [#uses=1 type=[6 x i8]*]
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %f = fadd float 1.000, 0.500
+ %d = fadd double 3.333, 0.444
+ %fd = fpext float %f to double
+ %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), double %fd) ; [#uses=0 type=i32]
+ %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8]* @.str, i32 0, i32 0), double %d) ; [#uses=0 type=i32]
+ %fs = fptosi float %f to i64
+ %fu = fptoui float %f to i64
+ %ds = fptosi double %d to i64
+ %du = fptoui double %d to i64
+ %call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i64 %fs) ; [#uses=0 type=i32]
+ %call4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i64 %fu) ; [#uses=0 type=i32]
+ %call5 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i64 %ds) ; [#uses=0 type=i32]
+ %call6 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i64 %du) ; [#uses=0 type=i32]
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/fptosi.txt b/tests/cases/fptosi.txt
new file mode 100644
index 00000000..eea925c4
--- /dev/null
+++ b/tests/cases/fptosi.txt
@@ -0,0 +1,6 @@
+*1.500*
+*3.777*
+*1*
+*1*
+*3*
+*3*
diff --git a/tests/cases/funcptr.ll b/tests/cases/funcptr.ll
index ef869c33..ffc1ad1d 100644
--- a/tests/cases/funcptr.ll
+++ b/tests/cases/funcptr.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [17 x i8] c"hello %d world!\0A\00", align 1 ; [#uses=1 type=[17 x i8]*]
diff --git a/tests/cases/fuzz6_ta2.ll b/tests/cases/fuzz6_ta2.ll
new file mode 100644
index 00000000..225493f9
--- /dev/null
+++ b/tests/cases/fuzz6_ta2.ll
@@ -0,0 +1,3306 @@
+; ModuleID = 'emcc-0-basebc.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+%struct.S3 = type { i32, i32 }
+%struct.S1 = type { i32, i32, i8, i16 }
+%union.U4 = type { i32 }
+%struct.S2 = type { [2 x i8], [2 x i8] }
+%struct.S0 = type { i32, [4 x i8], [4 x i8], [4 x i8], i8, [7 x i8] }
+
+@.str = private unnamed_addr constant [2 x i8] c"1\00", align 1
+@g_5 = internal unnamed_addr global i32 -1, align 4
+@.str1 = private unnamed_addr constant [4 x i8] c"g_5\00", align 1
+@g_25 = internal global %struct.S3 { i32 1301409902, i32 1607156808 }, align 8
+@.str2 = private unnamed_addr constant [8 x i8] c"g_25.f0\00", align 1
+@.str3 = private unnamed_addr constant [8 x i8] c"g_25.f1\00", align 1
+@g_49 = internal global [9 x %struct.S3] [%struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }, %struct.S3 { i32 -8, i32 -762592976 }], align 8
+@.str4 = private unnamed_addr constant [11 x i8] c"g_49[i].f0\00", align 1
+@.str5 = private unnamed_addr constant [11 x i8] c"g_49[i].f1\00", align 1
+@.str6 = private unnamed_addr constant [14 x i8] c"index = [%d]\0A\00", align 1
+@g_52 = internal global i32 2110022177, align 4
+@.str7 = private unnamed_addr constant [5 x i8] c"g_52\00", align 1
+@.str8 = private unnamed_addr constant [5 x i8] c"g_82\00", align 1
+@g_90 = internal global i32 888749341, align 4
+@.str9 = private unnamed_addr constant [5 x i8] c"g_90\00", align 1
+@g_92 = internal unnamed_addr global i8 -97, align 1
+@.str10 = private unnamed_addr constant [5 x i8] c"g_92\00", align 1
+@g_96 = internal global i8 -23, align 1
+@.str11 = private unnamed_addr constant [5 x i8] c"g_96\00", align 1
+@g_99 = internal global %struct.S1 { i32 -845795437, i32 0, i8 0, i16 4 }, align 4
+@.str12 = private unnamed_addr constant [8 x i8] c"g_99.f0\00", align 1
+@.str13 = private unnamed_addr constant [8 x i8] c"g_99.f1\00", align 1
+@.str14 = private unnamed_addr constant [8 x i8] c"g_99.f2\00", align 1
+@.str15 = private unnamed_addr constant [8 x i8] c"g_99.f3\00", align 1
+@g_103 = internal unnamed_addr global i16 23707, align 2
+@.str16 = private unnamed_addr constant [6 x i8] c"g_103\00", align 1
+@.str17 = private unnamed_addr constant [9 x i8] c"g_108.f0\00", align 1
+@.str18 = private unnamed_addr constant [9 x i8] c"g_108.f1\00", align 1
+@.str19 = private unnamed_addr constant [9 x i8] c"g_108.f2\00", align 1
+@.str20 = private unnamed_addr constant [9 x i8] c"g_108.f3\00", align 1
+@.str21 = private unnamed_addr constant [9 x i8] c"g_108.f4\00", align 1
+@.str22 = private unnamed_addr constant [9 x i8] c"g_108.f5\00", align 1
+@.str23 = private unnamed_addr constant [9 x i8] c"g_108.f6\00", align 1
+@.str24 = private unnamed_addr constant [9 x i8] c"g_109.f0\00", align 1
+@.str25 = private unnamed_addr constant [9 x i8] c"g_110.f0\00", align 1
+@g_183 = internal global %union.U4 zeroinitializer, align 4
+@.str26 = private unnamed_addr constant [9 x i8] c"g_183.f0\00", align 1
+@.str27 = private unnamed_addr constant [9 x i8] c"g_218.f0\00", align 1
+@g_258 = internal unnamed_addr global i8 -11, align 1
+@.str28 = private unnamed_addr constant [6 x i8] c"g_258\00", align 1
+@g_332 = internal unnamed_addr global i16 1, align 2
+@.str29 = private unnamed_addr constant [6 x i8] c"g_332\00", align 1
+@g_345 = internal global [10 x [1 x %union.U4]] [[1 x %union.U4] [%union.U4 { i32 -9 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -9 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -9 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -8 }], [1 x %union.U4] [%union.U4 { i32 -9 }]], align 4
+@.str30 = private unnamed_addr constant [15 x i8] c"g_345[i][j].f0\00", align 1
+@.str31 = private unnamed_addr constant [18 x i8] c"index = [%d][%d]\0A\00", align 1
+@.str32 = private unnamed_addr constant [9 x i8] c"g_393[i]\00", align 1
+@g_395 = internal global i16 -7025, align 2
+@.str33 = private unnamed_addr constant [6 x i8] c"g_395\00", align 1
+@.str34 = private unnamed_addr constant [6 x i8] c"g_398\00", align 1
+@g_404 = internal constant [9 x [3 x [7 x %struct.S1]]] [[3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 -4, i32 1, i8 1, i16 -28668 }, %struct.S1 { i32 -7, i32 759214664, i8 9, i16 -4 }, %struct.S1 { i32 1, i32 349068844, i8 -1, i16 0 }, %struct.S1 { i32 -3, i32 9, i8 -61, i16 -1 }, %struct.S1 { i32 9, i32 0, i8 -11, i16 -30413 }, %struct.S1 { i32 1861205821, i32 110616061, i8 40, i16 -9 }, %struct.S1 { i32 -7, i32 759214664, i8 9, i16 -4 }], [7 x %struct.S1] [%struct.S1 { i32 -244445179, i32 1776214206, i8 -2, i16 1 }, %struct.S1 { i32 1543082949, i32 -1355807875, i8 6, i16 -31022 }, %struct.S1 { i32 1025177860, i32 6, i8 9, i16 9090 }, %struct.S1 { i32 -244445179, i32 1776214206, i8 -2, i16 1 }, %struct.S1 { i32 0, i32 8, i8 63, i16 -15114 }, %struct.S1 { i32 -237948286, i32 -602674988, i8 9, i16 -23496 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }], [7 x %struct.S1] [%struct.S1 { i32 -1258444377, i32 0, i8 -3, i16 -18764 }, %struct.S1 { i32 -4, i32 1865801250, i8 1, i16 -5 }, %struct.S1 { i32 -1411946461, i32 1547736314, i8 -89, i16 29618 }, %struct.S1 { i32 -624352579, i32 -2, i8 109, i16 -10276 }, %struct.S1 { i32 -2023789489, i32 -902579792, i8 -1, i16 1 }, %struct.S1 { i32 -41003017, i32 1569787914, i8 -6, i16 18403 }, %struct.S1 { i32 -41003017, i32 1569787914, i8 -6, i16 18403 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 -4, i32 -392352954, i8 -1, i16 14048 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }, %struct.S1 { i32 -917235207, i32 -237206527, i8 -2, i16 0 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }, %struct.S1 { i32 -4, i32 -392352954, i8 -1, i16 14048 }, %struct.S1 { i32 0, i32 -270755058, i8 -10, i16 -6 }, %struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }], [7 x %struct.S1] [%struct.S1 { i32 1, i32 276540291, i8 -118, i16 -1 }, %struct.S1 { i32 2060359313, i32 0, i8 0, i16 -4 }, %struct.S1 { i32 -1, i32 60410192, i8 -105, i16 0 }, %struct.S1 { i32 -1832135439, i32 -117259837, i8 -1, i16 -1 }, %struct.S1 { i32 -7, i32 1258034932, i8 1, i16 -1 }, %struct.S1 { i32 -1718057571, i32 0, i8 0, i16 -8992 }, %struct.S1 { i32 9, i32 0, i8 -11, i16 -30413 }], [7 x %struct.S1] [%struct.S1 { i32 1025177860, i32 6, i8 9, i16 9090 }, %struct.S1 { i32 -1959266718, i32 1, i8 0, i16 -9111 }, %struct.S1 { i32 -1, i32 781657959, i8 57, i16 22085 }, %struct.S1 { i32 -2076059332, i32 -1205200163, i8 55, i16 -3996 }, %struct.S1 { i32 -1959266718, i32 1, i8 0, i16 -9111 }, %struct.S1 { i32 1, i32 1260336922, i8 116, i16 13140 }, %struct.S1 { i32 -1, i32 -263772962, i8 0, i16 1 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 1, i32 276540291, i8 -118, i16 -1 }, %struct.S1 { i32 -1832135439, i32 -117259837, i8 -1, i16 -1 }, %struct.S1 { i32 1861205821, i32 110616061, i8 40, i16 -9 }, %struct.S1 { i32 -513205, i32 -1424064346, i8 -59, i16 5 }, %struct.S1 { i32 1184341626, i32 -1, i8 76, i16 1 }, %struct.S1 { i32 -1784578731, i32 -650939753, i8 7, i16 -13401 }, %struct.S1 { i32 -4, i32 1, i8 1, i16 -28668 }], [7 x %struct.S1] [%struct.S1 { i32 -4, i32 -392352954, i8 -1, i16 14048 }, %struct.S1 { i32 0, i32 1, i8 -23, i16 1 }, %struct.S1 { i32 1543082949, i32 -1355807875, i8 6, i16 -31022 }, %struct.S1 { i32 -1, i32 -358692379, i8 0, i16 1 }, %struct.S1 { i32 1, i32 1260336922, i8 116, i16 13140 }, %struct.S1 { i32 -10, i32 1571736142, i8 8, i16 -9 }, %struct.S1 { i32 -4, i32 -392352954, i8 -1, i16 14048 }], [7 x %struct.S1] [%struct.S1 { i32 -1258444377, i32 0, i8 -3, i16 -18764 }, %struct.S1 { i32 -4, i32 1, i8 1, i16 -28668 }, %struct.S1 { i32 -624352579, i32 -2, i8 109, i16 -10276 }, %struct.S1 { i32 -7, i32 1258034932, i8 1, i16 -1 }, %struct.S1 { i32 1774264700, i32 1743797768, i8 -12, i16 0 }, %struct.S1 { i32 -1258444377, i32 0, i8 -3, i16 -18764 }, %struct.S1 { i32 -637055085, i32 -947781708, i8 4, i16 -6808 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 -244445179, i32 1776214206, i8 -2, i16 1 }, %struct.S1 { i32 -267149299, i32 -1636597397, i8 7, i16 13475 }, %struct.S1 { i32 2018342595, i32 -68458340, i8 -1, i16 -13443 }, %struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }, %struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }, %struct.S1 { i32 2018342595, i32 -68458340, i8 -1, i16 -13443 }, %struct.S1 { i32 -267149299, i32 -1636597397, i8 7, i16 13475 }], [7 x %struct.S1] [%struct.S1 { i32 -4, i32 1, i8 1, i16 -28668 }, %struct.S1 { i32 2060359313, i32 0, i8 0, i16 -4 }, %struct.S1 { i32 -1, i32 6, i8 57, i16 1 }, %struct.S1 { i32 -1357864411, i32 8, i8 91, i16 0 }, %struct.S1 { i32 1538544702, i32 -1554648331, i8 0, i16 -1 }, %struct.S1 { i32 -7, i32 1258034932, i8 1, i16 -1 }, %struct.S1 { i32 1184341626, i32 -1, i8 76, i16 1 }], [7 x %struct.S1] [%struct.S1 { i32 506767331, i32 2, i8 53, i16 -3 }, %struct.S1 { i32 2128045624, i32 0, i8 -127, i16 -13358 }, %struct.S1 { i32 1025177860, i32 6, i8 9, i16 9090 }, %struct.S1 { i32 -237948286, i32 -602674988, i8 9, i16 -23496 }, %struct.S1 { i32 -267149299, i32 -1636597397, i8 7, i16 13475 }, %struct.S1 { i32 1338273418, i32 -692826440, i8 -5, i16 -6354 }, %struct.S1 { i32 1543082949, i32 -1355807875, i8 6, i16 -31022 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 -4, i32 1865801250, i8 1, i16 -5 }, %struct.S1 { i32 1774264700, i32 1743797768, i8 -12, i16 0 }, %struct.S1 { i32 1861205821, i32 110616061, i8 40, i16 -9 }, %struct.S1 { i32 -1357864411, i32 8, i8 91, i16 0 }, %struct.S1 { i32 -2023789489, i32 -902579792, i8 -1, i16 1 }, %struct.S1 { i32 -124134025, i32 -1549553076, i8 1, i16 -3 }, %struct.S1 { i32 -10, i32 2023506657, i8 6, i16 -1 }], [7 x %struct.S1] [%struct.S1 { i32 -1, i32 2138051897, i8 -48, i16 -1 }, %struct.S1 { i32 1543082949, i32 -1355807875, i8 6, i16 -31022 }, %struct.S1 { i32 -2076059332, i32 -1205200163, i8 55, i16 -3996 }, %struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }, %struct.S1 { i32 0, i32 -1, i8 11, i16 26719 }, %struct.S1 { i32 0, i32 1, i8 -23, i16 1 }, %struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }], [7 x %struct.S1] [%struct.S1 { i32 759088742, i32 -2109967385, i8 -108, i16 5309 }, %struct.S1 { i32 9, i32 0, i8 -11, i16 -30413 }, %struct.S1 { i32 -1718057571, i32 0, i8 0, i16 -8992 }, %struct.S1 { i32 -7, i32 1258034932, i8 1, i16 -1 }, %struct.S1 { i32 -1832135439, i32 -117259837, i8 -1, i16 -1 }, %struct.S1 { i32 -1, i32 60410192, i8 -105, i16 0 }, %struct.S1 { i32 2060359313, i32 0, i8 0, i16 -4 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 823728956, i32 -762967062, i8 -7, i16 -13824 }, %struct.S1 { i32 -1959266718, i32 1, i8 0, i16 -9111 }, %struct.S1 { i32 -917235207, i32 -237206527, i8 -2, i16 0 }, %struct.S1 { i32 -1, i32 -358692379, i8 0, i16 1 }, %struct.S1 { i32 -1865005823, i32 1247557675, i8 9, i16 -1 }, %struct.S1 { i32 -837942276, i32 -10, i8 -4, i16 -6 }, %struct.S1 { i32 -1865005823, i32 1247557675, i8 9, i16 -1 }], [7 x %struct.S1] [%struct.S1 { i32 -513205, i32 -1424064346, i8 -59, i16 5 }, %struct.S1 { i32 -637055085, i32 -947781708, i8 4, i16 -6808 }, %struct.S1 { i32 -637055085, i32 -947781708, i8 4, i16 -6808 }, %struct.S1 { i32 -513205, i32 -1424064346, i8 -59, i16 5 }, %struct.S1 { i32 1538544702, i32 -1554648331, i8 0, i16 -1 }, %struct.S1 { i32 759088742, i32 -2109967385, i8 -108, i16 5309 }, %struct.S1 { i32 -2023789489, i32 -902579792, i8 -1, i16 1 }], [7 x %struct.S1] [%struct.S1 { i32 -10, i32 1571736142, i8 8, i16 -9 }, %struct.S1 { i32 -1923318042, i32 1, i8 -50, i16 -29192 }, %struct.S1 { i32 1, i32 1260336922, i8 116, i16 13140 }, %struct.S1 { i32 -2076059332, i32 -1205200163, i8 55, i16 -3996 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }, %struct.S1 { i32 -10, i32 1571736142, i8 8, i16 -9 }, %struct.S1 { i32 0, i32 1, i8 -23, i16 1 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 1774264700, i32 1743797768, i8 -12, i16 0 }, %struct.S1 { i32 -2023789489, i32 -902579792, i8 -1, i16 1 }, %struct.S1 { i32 1, i32 349068844, i8 -1, i16 0 }, %struct.S1 { i32 -1832135439, i32 -117259837, i8 -1, i16 -1 }, %struct.S1 { i32 -10, i32 2023506657, i8 6, i16 -1 }, %struct.S1 { i32 -124134025, i32 -1549553076, i8 1, i16 -3 }, %struct.S1 { i32 -2023789489, i32 -902579792, i8 -1, i16 1 }], [7 x %struct.S1] [%struct.S1 { i32 -244445179, i32 1776214206, i8 -2, i16 1 }, %struct.S1 { i32 -1, i32 -263772962, i8 0, i16 1 }, %struct.S1 { i32 506767331, i32 2, i8 53, i16 -3 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }, %struct.S1 { i32 1, i32 1260336922, i8 116, i16 13140 }, %struct.S1 { i32 -237948286, i32 -602674988, i8 9, i16 -23496 }, %struct.S1 { i32 -1865005823, i32 1247557675, i8 9, i16 -1 }], [7 x %struct.S1] [%struct.S1 { i32 -1411946461, i32 1547736314, i8 -89, i16 29618 }, %struct.S1 { i32 -7, i32 759214664, i8 9, i16 -4 }, %struct.S1 { i32 -1, i32 6, i8 57, i16 1 }, %struct.S1 { i32 -624352579, i32 -2, i8 109, i16 -10276 }, %struct.S1 { i32 -7, i32 759214664, i8 9, i16 -4 }, %struct.S1 { i32 -637055085, i32 -947781708, i8 4, i16 -6808 }, %struct.S1 { i32 2060359313, i32 0, i8 0, i16 -4 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 968381354, i32 -4, i8 -127, i16 -14432 }, %struct.S1 { i32 0, i32 1, i8 -66, i16 -1 }, %struct.S1 { i32 -837942276, i32 -10, i8 -4, i16 -6 }, %struct.S1 { i32 -244445179, i32 1776214206, i8 -2, i16 1 }, %struct.S1 { i32 -267149299, i32 -1636597397, i8 7, i16 13475 }, %struct.S1 { i32 1, i32 -5, i8 -10, i16 13038 }, %struct.S1 { i32 506767331, i32 2, i8 53, i16 -3 }], [7 x %struct.S1] [%struct.S1 { i32 -1411946461, i32 1547736314, i8 -89, i16 29618 }, %struct.S1 { i32 1861205821, i32 110616061, i8 40, i16 -9 }, %struct.S1 { i32 -1, i32 -6, i8 -4, i16 2 }, %struct.S1 { i32 -1024677174, i32 -1, i8 -126, i16 -10239 }, %struct.S1 { i32 -1, i32 -6, i8 -4, i16 2 }, %struct.S1 { i32 1861205821, i32 110616061, i8 40, i16 -9 }, %struct.S1 { i32 -1411946461, i32 1547736314, i8 -89, i16 29618 }], [7 x %struct.S1] [%struct.S1 { i32 -1223483863, i32 -1578792888, i8 -22, i16 1 }, %struct.S1 { i32 506767331, i32 2, i8 53, i16 -3 }, %struct.S1 { i32 0, i32 5, i8 -6, i16 19467 }, %struct.S1 { i32 1, i32 -1042812290, i8 -97, i16 -20099 }, %struct.S1 { i32 1025177860, i32 6, i8 9, i16 9090 }, %struct.S1 { i32 1525253711, i32 -1607228738, i8 1, i16 -392 }, %struct.S1 { i32 2018342595, i32 -68458340, i8 -1, i16 -13443 }]], [3 x [7 x %struct.S1]] [[7 x %struct.S1] [%struct.S1 { i32 -1, i32 6, i8 57, i16 1 }, %struct.S1 { i32 -1258444377, i32 0, i8 -3, i16 -18764 }, %struct.S1 { i32 -3, i32 9, i8 -61, i16 -1 }, %struct.S1 { i32 -1718057571, i32 0, i8 0, i16 -8992 }, %struct.S1 { i32 -1, i32 60410192, i8 -105, i16 0 }, %struct.S1 { i32 -3, i32 9, i8 -61, i16 -1 }, %struct.S1 { i32 0, i32 -866224393, i8 -65, i16 24132 }], [7 x %struct.S1] [%struct.S1 { i32 1338273418, i32 -692826440, i8 -5, i16 -6354 }, %struct.S1 { i32 0, i32 -270755058, i8 -10, i16 -6 }, %struct.S1 { i32 0, i32 5, i8 -6, i16 19467 }, %struct.S1 { i32 -1, i32 -263772962, i8 0, i16 1 }, %struct.S1 { i32 2, i32 -137424052, i8 1, i16 11792 }, %struct.S1 { i32 708881223, i32 670081913, i8 -53, i16 12097 }, %struct.S1 { i32 0, i32 1, i8 -23, i16 1 }], [7 x %struct.S1] [%struct.S1 { i32 1361878214, i32 -1, i8 115, i16 7 }, %struct.S1 { i32 -1, i32 60410192, i8 -105, i16 0 }, %struct.S1 { i32 -1, i32 -6, i8 -4, i16 2 }, %struct.S1 { i32 -992507318, i32 8, i8 90, i16 -12692 }, %struct.S1 { i32 0, i32 -866224393, i8 -65, i16 24132 }, %struct.S1 { i32 1361878214, i32 -1, i8 115, i16 7 }, %struct.S1 { i32 -1784578731, i32 -650939753, i8 7, i16 -13401 }]]], align 4
+@.str35 = private unnamed_addr constant [18 x i8] c"g_404[i][j][k].f0\00", align 1
+@.str36 = private unnamed_addr constant [18 x i8] c"g_404[i][j][k].f1\00", align 1
+@.str37 = private unnamed_addr constant [18 x i8] c"g_404[i][j][k].f2\00", align 1
+@.str38 = private unnamed_addr constant [18 x i8] c"g_404[i][j][k].f3\00", align 1
+@.str39 = private unnamed_addr constant [22 x i8] c"index = [%d][%d][%d]\0A\00", align 1
+@g_452 = internal unnamed_addr global i1 false
+@.str40 = private unnamed_addr constant [6 x i8] c"g_452\00", align 1
+@.str41 = private unnamed_addr constant [6 x i8] c"g_454\00", align 1
+@g_455 = internal unnamed_addr global [1 x i16] [i16 -21015], align 2
+@.str42 = private unnamed_addr constant [9 x i8] c"g_455[i]\00", align 1
+@g_465 = internal global i32 1537435609, align 4
+@.str43 = private unnamed_addr constant [6 x i8] c"g_465\00", align 1
+@.str44 = private unnamed_addr constant [6 x i8] c"g_466\00", align 1
+@g_467 = internal unnamed_addr global i8 -1, align 1
+@.str45 = private unnamed_addr constant [6 x i8] c"g_467\00", align 1
+@.str46 = private unnamed_addr constant [6 x i8] c"g_518\00", align 1
+@.str47 = private unnamed_addr constant [9 x i8] c"g_525.f0\00", align 1
+@.str48 = private unnamed_addr constant [9 x i8] c"g_525.f1\00", align 1
+@.str49 = private unnamed_addr constant [9 x i8] c"g_525.f2\00", align 1
+@.str50 = private unnamed_addr constant [9 x i8] c"g_525.f3\00", align 1
+@.str51 = private unnamed_addr constant [6 x i8] c"g_531\00", align 1
+@g_532 = internal global i32 -4, align 4
+@.str52 = private unnamed_addr constant [6 x i8] c"g_532\00", align 1
+@g_534 = internal unnamed_addr global i16 -12709, align 2
+@.str53 = private unnamed_addr constant [6 x i8] c"g_534\00", align 1
+@g_535 = internal unnamed_addr global [3 x [6 x [4 x i16]]] [[6 x [4 x i16]] [[4 x i16] [i16 1, i16 -5, i16 1, i16 0], [4 x i16] [i16 -5, i16 1, i16 -18349, i16 3093], [4 x i16] [i16 6, i16 1, i16 -5, i16 -24951], [4 x i16] [i16 7, i16 -9, i16 -1, i16 0], [4 x i16] [i16 0, i16 -3322, i16 0, i16 17466], [4 x i16] [i16 27553, i16 0, i16 3881, i16 0]], [6 x [4 x i16]] [[4 x i16] [i16 -3322, i16 -23234, i16 -24951, i16 3881], [4 x i16] [i16 1, i16 6, i16 -5, i16 1], [4 x i16] [i16 -1, i16 1, i16 0, i16 6914], [4 x i16] [i16 -1, i16 -3322, i16 -5, i16 -1], [4 x i16] [i16 1, i16 6914, i16 -24951, i16 0], [4 x i16] [i16 -3322, i16 -30274, i16 3881, i16 3093]], [6 x [4 x i16]] [[4 x i16] [i16 27553, i16 1, i16 0, i16 1], [4 x i16] [i16 0, i16 -23234, i16 -1, i16 0], [4 x i16] [i16 1, i16 17466, i16 17466, i16 1], [4 x i16] [i16 6914, i16 -1, i16 -10, i16 -1], [4 x i16] [i16 17466, i16 0, i16 -9, i16 11044], [4 x i16] [i16 -5, i16 0, i16 1, i16 11044]]], align 2
+@.str54 = private unnamed_addr constant [15 x i8] c"g_535[i][j][k]\00", align 1
+@g_538 = internal unnamed_addr global i16 9, align 2
+@.str55 = private unnamed_addr constant [6 x i8] c"g_538\00", align 1
+@g_557 = internal unnamed_addr global i16 15797, align 2
+@.str56 = private unnamed_addr constant [6 x i8] c"g_557\00", align 1
+@g_575 = internal unnamed_addr global i8 -5, align 1
+@.str57 = private unnamed_addr constant [6 x i8] c"g_575\00", align 1
+@g_591 = internal global [10 x [8 x %union.U4]] [[8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }], [8 x %union.U4] [%union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }, %union.U4 { i32 1 }, %union.U4 { i32 62345350 }]], align 4
+@.str58 = private unnamed_addr constant [15 x i8] c"g_591[i][j].f0\00", align 1
+@.str59 = private unnamed_addr constant [9 x i8] c"g_623.f0\00", align 1
+@.str60 = private unnamed_addr constant [9 x i8] c"g_623.f1\00", align 1
+@.str61 = private unnamed_addr constant [9 x i8] c"g_623.f2\00", align 1
+@.str62 = private unnamed_addr constant [9 x i8] c"g_623.f3\00", align 1
+@.str63 = private unnamed_addr constant [9 x i8] c"g_623.f4\00", align 1
+@.str64 = private unnamed_addr constant [9 x i8] c"g_623.f5\00", align 1
+@.str65 = private unnamed_addr constant [9 x i8] c"g_623.f6\00", align 1
+@g_815 = internal unnamed_addr constant [4 x [3 x i8]] [[3 x i8] c"\F6\F6\F6", [3 x i8] c"\F6\F6\F6", [3 x i8] c"\F6\F6\F6", [3 x i8] c"\F6\F6\F6"], align 1
+@.str66 = private unnamed_addr constant [12 x i8] c"g_815[i][j]\00", align 1
+@.str67 = private unnamed_addr constant [9 x i8] c"g_901.f0\00", align 1
+@.str68 = private unnamed_addr constant [7 x i8] c"g_1054\00", align 1
+@g_1055 = internal global i32 -1754892444, align 4
+@.str69 = private unnamed_addr constant [7 x i8] c"g_1055\00", align 1
+@g_1057 = internal unnamed_addr global [4 x [5 x i32]] [[5 x i32] [i32 1, i32 569906689, i32 569906689, i32 1, i32 1], [5 x i32] [i32 1, i32 1140362115, i32 1140362115, i32 1, i32 2], [5 x i32] [i32 1, i32 569906689, i32 569906689, i32 1, i32 1], [5 x i32] [i32 1, i32 1140362115, i32 1140362115, i32 1, i32 2]], align 4
+@.str70 = private unnamed_addr constant [13 x i8] c"g_1057[i][j]\00", align 1
+@crc32_context = internal unnamed_addr global i32 -1, align 4
+@.str71 = private unnamed_addr constant [15 x i8] c"checksum = %X\0A\00", align 1
+@g_901 = internal unnamed_addr constant { i8, i8, [2 x i8] } { i8 9, i8 0, [2 x i8] undef }, align 4
+@g_623 = internal global { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -98308741, i8 21, i8 1, i8 0, i8 undef, i8 -107, i8 -8, i8 -1, i8 undef, i8 93, i8 1, i8 0, i8 0, i8 1, i8 -122, i8 9, i8 0, i8 72, i8 79, i8 0, i8 0 }, align 4
+@g_110 = internal global { i8, i8, [2 x i8] } { i8 123, i8 0, [2 x i8] undef }, align 4
+@g_108 = internal global { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 126, i8 -4, i8 15, i8 undef, i8 20, i8 -3, i8 -1, i8 undef, i8 -13, i8 27, i8 0, i8 0, i8 -52, i8 21, i8 4, i8 0, i8 69, i8 69, i8 0, i8 0 }, align 4
+@.str72 = private unnamed_addr constant [36 x i8] c"...checksum after hashing %s : %lX\0A\00", align 1
+@crc32_tab = internal unnamed_addr global [256 x i32] zeroinitializer, align 4
+@func_1.l_1252 = private unnamed_addr constant %struct.S3 { i32 -1, i32 2063360091 }, align 4
+@func_2.l_1232 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -128, i8 3, i8 0, i8 undef, i8 -119, i8 13, i8 0, i8 undef, i8 12, i8 15, i8 0, i8 0, i8 74, i8 80, i8 12, i8 0, i8 119, i8 18, i8 0, i8 0 }, align 4
+@func_2.l_1235 = private unnamed_addr constant [3 x [7 x i32]] [[7 x i32] [i32 439875158, i32 1, i32 0, i32 2, i32 1, i32 2, i32 0], [7 x i32] [i32 1, i32 1, i32 0, i32 1694927858, i32 -3, i32 0, i32 -3], [7 x i32] [i32 1694927858, i32 0, i32 0, i32 1694927858, i32 2, i32 439875158, i32 1694927858]], align 4
+@g_192 = internal global [6 x [10 x %struct.S2*]] [[10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)], [10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)], [10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)], [10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)], [10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)], [10 x %struct.S2*] [%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*), %struct.S2* bitcast ({ i8, i8, [2 x i8] }* @g_110 to %struct.S2*)]], align 4
+@func_2.l_1247 = private unnamed_addr constant [10 x %struct.S3] [%struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }, %struct.S3 { i32 -1, i32 -1 }], align 4
+@g_1182 = internal unnamed_addr global i32*** @g_1183, align 4
+@func_2.l_1249 = private unnamed_addr constant %struct.S3 { i32 -1, i32 1 }, align 4
+@func_45.l_152 = private unnamed_addr constant <{ { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] } }> <{ { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef }, { i8, i8, [2 x i8] } { i8 -119, i8 0, [2 x i8] undef } }>, align 4
+@func_45.l_154 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1335375908, i8 -31, i8 -3, i8 15, i8 undef, i8 -17, i8 11, i8 0, i8 undef, i8 -61, i8 13, i8 0, i8 0, i8 8, i8 100, i8 2, i8 0, i8 17, i8 13, i8 0, i8 0 }, align 4
+@func_45.l_81 = private unnamed_addr constant [8 x [5 x i32]] [[5 x i32] [i32 -7, i32 -1414374823, i32 -632497018, i32 -10, i32 -10], [5 x i32] [i32 -10, i32 -1642393851, i32 -10, i32 -8, i32 1286323839], [5 x i32] [i32 -632497018, i32 -1414374823, i32 -7, i32 0, i32 1286323839], [5 x i32] [i32 -1471816903, i32 4, i32 4, i32 -1471816903, i32 -10], [5 x i32] [i32 1490958412, i32 -1471816903, i32 -7, i32 1286323839, i32 -1414374823], [5 x i32] [i32 1490958412, i32 -7, i32 -10, i32 -7, i32 1490958412], [5 x i32] [i32 -1471816903, i32 0, i32 -632497018, i32 1286323839, i32 4], [5 x i32] [i32 -632497018, i32 0, i32 -1471816903, i32 -1471816903, i32 0]], align 4
+@func_45.l_74 = private unnamed_addr constant [9 x i8] c"K\C8\C8K\C8\C8K\C8\C8", align 1
+@func_45.l_126 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -10, i8 50, i8 3, i8 0, i8 undef, i8 103, i8 -1, i8 -1, i8 undef, i8 -101, i8 6, i8 0, i8 0, i8 1, i8 -70, i8 14, i8 0, i8 80, i8 74, i8 0, i8 0 }, align 4
+@func_45.l_130 = private unnamed_addr constant %struct.S3 { i32 0, i32 -1 }, align 4
+@func_45.l_149 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1318996756, i8 -89, i8 1, i8 0, i8 undef, i8 103, i8 3, i8 0, i8 undef, i8 -42, i8 3, i8 0, i8 0, i8 60, i8 -36, i8 3, i8 0, i8 -116, i8 24, i8 0, i8 0 }, align 4
+@func_34.l_409 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 93, i8 127, [2 x i8] undef }, align 4
+@g_1183 = internal global i32** getelementptr inbounds ([3 x [9 x i32*]]* @g_680, i32 0, i32 2, i32 7), align 4
+@g_680 = internal global [3 x [9 x i32*]] [[9 x i32*] [i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90], [9 x i32*] zeroinitializer, [9 x i32*] [i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90, i32* @g_90]], align 4
+@func_26.l_486 = private unnamed_addr constant %union.U4 { i32 -1830168395 }, align 4
+@func_26.l_488 = private unnamed_addr constant %struct.S1 { i32 -1750699628, i32 0, i8 -10, i16 -14848 }, align 4
+@func_26.l_489 = private unnamed_addr constant %struct.S3 { i32 -277744967, i32 878104721 }, align 4
+@func_26.l_504 = private unnamed_addr constant [8 x [3 x [4 x i32]]] [[3 x [4 x i32]] [[4 x i32] [i32 -1525661844, i32 -1, i32 265542515, i32 -1], [4 x i32] [i32 -329602546, i32 3, i32 0, i32 -1525661844], [4 x i32] [i32 424579621, i32 0, i32 -1, i32 1972604273]], [3 x [4 x i32]] [[4 x i32] [i32 0, i32 -329602546, i32 4, i32 4], [4 x i32] [i32 0, i32 0, i32 -1, i32 0], [4 x i32] [i32 424579621, i32 4, i32 0, i32 0]], [3 x [4 x i32]] [[4 x i32] [i32 -329602546, i32 0, i32 265542515, i32 0], [4 x i32] [i32 -1525661844, i32 0, i32 -1525661844, i32 0], [4 x i32] [i32 0, i32 4, i32 -1983181016, i32 0]], [3 x [4 x i32]] [[4 x i32] [i32 0, i32 0, i32 -329602546, i32 4], [4 x i32] [i32 1972604273, i32 -329602546, i32 -329602546, i32 1972604273], [4 x i32] [i32 0, i32 0, i32 -1983181016, i32 -1525661844]], [3 x [4 x i32]] [[4 x i32] [i32 0, i32 3, i32 -1525661844, i32 -1], [4 x i32] [i32 -1525661844, i32 -1, i32 265542515, i32 -1], [4 x i32] [i32 -329602546, i32 3, i32 0, i32 -1525661844]], [3 x [4 x i32]] [[4 x i32] [i32 424579621, i32 0, i32 -1, i32 1972604273], [4 x i32] [i32 0, i32 -329602546, i32 4, i32 4], [4 x i32] [i32 0, i32 0, i32 -1, i32 0]], [3 x [4 x i32]] [[4 x i32] [i32 424579621, i32 4, i32 0, i32 0], [4 x i32] [i32 -329602546, i32 0, i32 265542515, i32 0], [4 x i32] [i32 -1525661844, i32 0, i32 -1525661844, i32 0]], [3 x [4 x i32]] [[4 x i32] [i32 0, i32 4, i32 -1983181016, i32 0], [4 x i32] [i32 0, i32 0, i32 -329602546, i32 4], [4 x i32] [i32 1972604273, i32 -329602546, i32 -329602546, i32 1972604273]]], align 4
+@func_26.l_550 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 102, i8 0, [2 x i8] undef }, align 4
+@func_26.l_478 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 -122, i8 0, [2 x i8] undef }, align 4
+@func_26.l_546 = private unnamed_addr constant <{ <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }>, <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }>, <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }> }> <{ <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }> <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 } }> }>, <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }> <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -7, i8 106, i8 -4, i8 15, i8 undef, i8 102, i8 12, i8 0, i8 undef, i8 -24, i8 14, i8 0, i8 0, i8 92, i8 85, i8 1, i8 0, i8 -23, i8 61, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1835773250, i8 108, i8 0, i8 0, i8 undef, i8 28, i8 -15, i8 -1, i8 undef, i8 109, i8 20, i8 0, i8 0, i8 30, i8 114, i8 6, i8 0, i8 -90, i8 12, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1729945884, i8 12, i8 2, i8 0, i8 undef, i8 -95, i8 14, i8 0, i8 undef, i8 -123, i8 25, i8 0, i8 0, i8 0, i8 41, i8 3, i8 0, i8 22, i8 51, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 6, i8 58, i8 -1, i8 15, i8 undef, i8 98, i8 -1, i8 -1, i8 undef, i8 115, i8 14, i8 0, i8 0, i8 25, i8 -77, i8 14, i8 0, i8 18, i8 8, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1, i8 -68, i8 -2, i8 15, i8 undef, i8 -97, i8 2, i8 0, i8 undef, i8 -108, i8 23, i8 0, i8 0, i8 24, i8 -25, i8 2, i8 0, i8 -125, i8 88, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1256296454, i8 -103, i8 -3, i8 15, i8 undef, i8 -101, i8 8, i8 0, i8 undef, i8 -100, i8 3, i8 0, i8 0, i8 28, i8 -71, i8 3, i8 0, i8 -93, i8 76, i8 0, i8 0 } }> }>, <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> }> <{ <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -99, i8 -4, i8 15, i8 undef, i8 -126, i8 -3, i8 -1, i8 undef, i8 -58, i8 20, i8 0, i8 0, i8 48, i8 27, i8 0, i8 0, i8 110, i8 37, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 49, i8 -2, i8 15, i8 undef, i8 -32, i8 13, i8 0, i8 undef, i8 -127, i8 18, i8 0, i8 0, i8 9, i8 60, i8 13, i8 0, i8 -77, i8 21, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 49, i8 -2, i8 15, i8 undef, i8 -32, i8 13, i8 0, i8 undef, i8 -127, i8 18, i8 0, i8 0, i8 9, i8 60, i8 13, i8 0, i8 -77, i8 21, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1181053651, i8 111, i8 2, i8 0, i8 undef, i8 -2, i8 0, i8 0, i8 undef, i8 -4, i8 25, i8 0, i8 0, i8 0, i8 -76, i8 10, i8 0, i8 -93, i8 23, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1796036025, i8 18, i8 3, i8 0, i8 undef, i8 65, i8 13, i8 0, i8 undef, i8 -86, i8 14, i8 0, i8 0, i8 -101, i8 14, i8 9, i8 0, i8 -81, i8 63, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1796036025, i8 18, i8 3, i8 0, i8 undef, i8 65, i8 13, i8 0, i8 undef, i8 -86, i8 14, i8 0, i8 0, i8 -101, i8 14, i8 9, i8 0, i8 -81, i8 63, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1181053651, i8 111, i8 2, i8 0, i8 undef, i8 -2, i8 0, i8 0, i8 undef, i8 -4, i8 25, i8 0, i8 0, i8 0, i8 -76, i8 10, i8 0, i8 -93, i8 23, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -99, i8 -4, i8 15, i8 undef, i8 -126, i8 -3, i8 -1, i8 undef, i8 -58, i8 20, i8 0, i8 0, i8 48, i8 27, i8 0, i8 0, i8 110, i8 37, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -99, i8 -4, i8 15, i8 undef, i8 -126, i8 -3, i8 -1, i8 undef, i8 -58, i8 20, i8 0, i8 0, i8 48, i8 27, i8 0, i8 0, i8 110, i8 37, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 49, i8 -2, i8 15, i8 undef, i8 -32, i8 13, i8 0, i8 undef, i8 -127, i8 18, i8 0, i8 0, i8 9, i8 60, i8 13, i8 0, i8 -77, i8 21, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 49, i8 -2, i8 15, i8 undef, i8 -32, i8 13, i8 0, i8 undef, i8 -127, i8 18, i8 0, i8 0, i8 9, i8 60, i8 13, i8 0, i8 -77, i8 21, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1181053651, i8 111, i8 2, i8 0, i8 undef, i8 -2, i8 0, i8 0, i8 undef, i8 -4, i8 25, i8 0, i8 0, i8 0, i8 -76, i8 10, i8 0, i8 -93, i8 23, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1796036025, i8 18, i8 3, i8 0, i8 undef, i8 65, i8 13, i8 0, i8 undef, i8 -86, i8 14, i8 0, i8 0, i8 -101, i8 14, i8 9, i8 0, i8 -81, i8 63, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1796036025, i8 18, i8 3, i8 0, i8 undef, i8 65, i8 13, i8 0, i8 undef, i8 -86, i8 14, i8 0, i8 0, i8 -101, i8 14, i8 9, i8 0, i8 -81, i8 63, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1181053651, i8 111, i8 2, i8 0, i8 undef, i8 -2, i8 0, i8 0, i8 undef, i8 -4, i8 25, i8 0, i8 0, i8 0, i8 -76, i8 10, i8 0, i8 -93, i8 23, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 83317218, i8 -42, i8 -4, i8 15, i8 undef, i8 123, i8 9, i8 0, i8 undef, i8 -121, i8 21, i8 0, i8 0, i8 -121, i8 -73, i8 5, i8 0, i8 -98, i8 27, i8 0, i8 0 } }>, <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -99, i8 -4, i8 15, i8 undef, i8 -126, i8 -3, i8 -1, i8 undef, i8 -58, i8 20, i8 0, i8 0, i8 48, i8 27, i8 0, i8 0, i8 110, i8 37, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 0, i8 -99, i8 -4, i8 15, i8 undef, i8 -126, i8 -3, i8 -1, i8 undef, i8 -58, i8 20, i8 0, i8 0, i8 48, i8 27, i8 0, i8 0, i8 110, i8 37, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -96548638, i8 65, i8 -1, i8 15, i8 undef, i8 -31, i8 -2, i8 -1, i8 undef, i8 49, i8 29, i8 0, i8 0, i8 -31, i8 -60, i8 12, i8 0, i8 110, i8 75, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1016053414, i8 -114, i8 -2, i8 15, i8 undef, i8 -43, i8 -9, i8 -1, i8 undef, i8 -83, i8 10, i8 0, i8 0, i8 110, i8 8, i8 15, i8 0, i8 -96, i8 28, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 9, i8 -46, i8 -3, i8 15, i8 undef, i8 116, i8 8, i8 0, i8 undef, i8 88, i8 31, i8 0, i8 0, i8 -2, i8 -8, i8 4, i8 0, i8 -59, i8 18, i8 0, i8 0 } }> }> }>, align 4
+@g_304 = internal global i32* @g_52, align 4
+@func_26.l_545 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 59, i8 0, [2 x i8] undef }, align 4
+@func_26.l_555 = private unnamed_addr constant %struct.S1 { i32 0, i32 385064286, i8 1, i16 6 }, align 4
+@func_26.l_556 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 116, i8 127, [2 x i8] undef }, align 4
+@func_26.l_519 = private unnamed_addr constant [3 x [8 x [7 x i16]]] [[8 x [7 x i16]] [[7 x i16] [i16 1, i16 29750, i16 2870, i16 -1, i16 4901, i16 -1, i16 6254], [7 x i16] [i16 0, i16 -1, i16 21433, i16 -26659, i16 -9861, i16 -6, i16 0], [7 x i16] [i16 -17574, i16 -5, i16 2870, i16 -26602, i16 -4, i16 -1, i16 3424], [7 x i16] [i16 -4228, i16 -19682, i16 -1, i16 -12043, i16 -23978, i16 6254, i16 0], [7 x i16] [i16 -12017, i16 0, i16 -26659, i16 -11464, i16 21433, i16 9, i16 -19572], [7 x i16] [i16 0, i16 9, i16 1, i16 0, i16 0, i16 -1, i16 1], [7 x i16] [i16 2870, i16 26454, i16 -19682, i16 9, i16 0, i16 1, i16 -9861], [7 x i16] [i16 14396, i16 6, i16 0, i16 -3602, i16 4, i16 1, i16 -17583]], [8 x [7 x i16]] [[7 x i16] [i16 -6, i16 29079, i16 4901, i16 1, i16 -18681, i16 -1, i16 26360], [7 x i16] [i16 -4, i16 -1, i16 0, i16 1, i16 -5, i16 9, i16 -1], [7 x i16] [i16 1, i16 0, i16 2174, i16 -1, i16 -4, i16 -19343, i16 9], [7 x i16] [i16 0, i16 -5, i16 -22340, i16 -22340, i16 -5, i16 0, i16 5640], [7 x i16] [i16 -26659, i16 -8480, i16 9, i16 -9861, i16 2174, i16 -5, i16 0], [7 x i16] [i16 -1, i16 -1, i16 -6, i16 1, i16 3424, i16 12084, i16 -1], [7 x i16] [i16 6, i16 -8480, i16 -17583, i16 -3, i16 -7, i16 9, i16 -5], [7 x i16] [i16 -3602, i16 -5, i16 0, i16 6254, i16 -1, i16 4, i16 -17574]], [8 x [7 x i16]] [[7 x i16] [i16 -1, i16 -22340, i16 -7, i16 14396, i16 -1, i16 -3602, i16 1], [7 x i16] [i16 -31686, i16 12084, i16 -4228, i16 1, i16 -19841, i16 -8480, i16 0], [7 x i16] [i16 0, i16 -1, i16 1, i16 -3, i16 -17515, i16 1, i16 -32701], [7 x i16] [i16 -1, i16 6, i16 -3, i16 -32701, i16 -17515, i16 0, i16 0], [7 x i16] [i16 1, i16 -1, i16 26360, i16 -23978, i16 -19841, i16 2174, i16 -1], [7 x i16] [i16 0, i16 -3602, i16 1, i16 -7, i16 -1, i16 1, i16 0], [7 x i16] [i16 0, i16 0, i16 1, i16 -19841, i16 -1, i16 -11464, i16 -11464], [7 x i16] [i16 -7, i16 -30008, i16 3424, i16 -30008, i16 -7, i16 -4770, i16 26360]]], align 2
+@func_26.l_522 = private unnamed_addr constant %struct.S1 { i32 1684909689, i32 -8, i8 1, i16 -26127 }, align 4
+@g_524 = internal unnamed_addr global [2 x [8 x [6 x %struct.S1*]]] [[8 x [6 x %struct.S1*]] [[6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)]], [8 x [6 x %struct.S1*]] [[6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)], [6 x %struct.S1*] [%struct.S1* null, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* @g_99, %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 1236) to %struct.S1*), %struct.S1* bitcast (i8* getelementptr (i8* bitcast ([9 x [3 x [7 x %struct.S1]]]* @g_404 to i8*), i64 912) to %struct.S1*)]]], align 4
+@func_26.l_548 = private unnamed_addr constant [5 x i16] [i16 -1728, i16 -1728, i16 -1728, i16 -1728, i16 -1728], align 2
+@func_26.l_543 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 91, i8 0, [2 x i8] undef }, align 4
+@func_10.l_1026 = private unnamed_addr constant %union.U4 { i32 -10 }, align 4
+@func_10.l_1189 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -313965653, i8 5, i8 -3, i8 15, i8 undef, i8 34, i8 -3, i8 -1, i8 undef, i8 -96, i8 16, i8 0, i8 0, i8 -60, i8 -101, i8 12, i8 0, i8 -31, i8 6, i8 0, i8 0 }, align 4
+@func_10.l_1033 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 -70, i8 2, i8 0, i8 undef, i8 -123, i8 3, i8 0, i8 undef, i8 -45, i8 4, i8 0, i8 0, i8 -20, i8 115, i8 1, i8 0, i8 83, i8 66, i8 0, i8 0 }, align 4
+@func_10.l_1050 = private unnamed_addr constant [4 x i32] [i32 400752475, i32 400752475, i32 400752475, i32 400752475], align 4
+@func_10.l_1075 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 83, i8 0, [2 x i8] undef }, align 4
+@func_10.l_1143 = private unnamed_addr constant %struct.S1 { i32 1162530280, i32 0, i8 -63, i16 -1 }, align 4
+@func_10.l_1044 = private unnamed_addr constant [5 x i32*] [i32* @g_465, i32* @g_465, i32* @g_465, i32* @g_465, i32* @g_465], align 4
+@func_31.l_43 = private unnamed_addr constant %struct.S3 { i32 1332693062, i32 1 }, align 4
+@func_31.l_50 = private unnamed_addr constant %struct.S3 { i32 4, i32 -7 }, align 4
+@func_31.l_406 = private unnamed_addr constant [7 x %union.U4] [%union.U4 { i32 -3 }, %union.U4 { i32 -1216898264 }, %union.U4 { i32 -3 }, %union.U4 { i32 -3 }, %union.U4 { i32 -1216898264 }, %union.U4 { i32 -3 }, %union.U4 { i32 -3 }], align 4
+@func_31.l_167 = internal constant %struct.S1 { i32 1017613823, i32 -1908625821, i8 1, i16 0 }, align 4
+@func_38.l_176 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 87, i8 127, [2 x i8] undef }, align 4
+@func_38.l_262 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1043958261, i8 -54, i8 -1, i8 15, i8 undef, i8 -70, i8 8, i8 0, i8 undef, i8 -64, i8 13, i8 0, i8 0, i8 0, i8 -22, i8 10, i8 0, i8 92, i8 1, i8 0, i8 0 }, align 8
+@func_38.l_293 = private unnamed_addr constant %struct.S3 { i32 -183694793, i32 -5 }, align 4
+@func_38.l_378 = private unnamed_addr constant [4 x i32] [i32 -1651091075, i32 -1651091075, i32 -1651091075, i32 -1651091075], align 4
+@func_38.l_217 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1664524927, i8 39, i8 -4, i8 15, i8 undef, i8 20, i8 -6, i8 -1, i8 undef, i8 -28, i8 27, i8 0, i8 0, i8 -87, i8 -19, i8 8, i8 0, i8 -73, i8 43, i8 0, i8 0 }, align 8
+@func_38.l_259 = private unnamed_addr constant [5 x [5 x [8 x i32]]] [[5 x [8 x i32]] [[8 x i32] [i32 1078268908, i32 1, i32 223410181, i32 -3, i32 223410181, i32 1, i32 1078268908, i32 1702862848], [8 x i32] [i32 -1, i32 -8, i32 1, i32 -1117972742, i32 -339602607, i32 223410181, i32 -601140634, i32 -99824884], [8 x i32] [i32 1, i32 0, i32 -1610789521, i32 -2, i32 -339602607, i32 1078268908, i32 1727150236, i32 -3], [8 x i32] [i32 -1, i32 7, i32 0, i32 -99824884, i32 223410181, i32 449187001, i32 1, i32 1], [8 x i32] [i32 1078268908, i32 1, i32 -8, i32 -339602607, i32 4, i32 1, i32 -1762498432, i32 449187001]], [5 x [8 x i32]] [[8 x i32] [i32 591018478, i32 -1509313059, i32 -99824884, i32 -638114951, i32 -1355867497, i32 6, i32 7, i32 -1], [8 x i32] [i32 -8, i32 -8, i32 1, i32 0, i32 -1, i32 -4, i32 -4, i32 -2], [8 x i32] [i32 -4, i32 -8, i32 -8, i32 -4, i32 449187001, i32 -1117972742, i32 -1762498432, i32 1770112494], [8 x i32] [i32 1, i32 -1610789521, i32 -1, i32 -99824884, i32 -1, i32 -1739949486, i32 551870971, i32 1], [8 x i32] [i32 -1, i32 -1610789521, i32 1, i32 -1509313059, i32 -8, i32 -1117972742, i32 1, i32 -259527796]], [5 x [8 x i32]] [[8 x i32] [i32 -3, i32 -8, i32 6, i32 -1, i32 -1, i32 -4, i32 -1355867497, i32 0], [8 x i32] [i32 -601140634, i32 1206242802, i32 4, i32 1, i32 1, i32 1262780235, i32 -8, i32 223410181], [8 x i32] [i32 -548640644, i32 -4, i32 -1610789521, i32 -3, i32 1206242802, i32 0, i32 -1, i32 -99824884], [8 x i32] [i32 -8, i32 -638114951, i32 591018478, i32 -1332204189, i32 0, i32 -1332204189, i32 591018478, i32 -638114951], [8 x i32] [i32 1702862848, i32 -966943802, i32 2016316978, i32 1262780235, i32 -1, i32 -1, i32 1770112494, i32 -8]], [5 x [8 x i32]] [[8 x i32] [i32 707900158, i32 1727150236, i32 -1, i32 223410181, i32 1702862848, i32 0, i32 1770112494, i32 2016316978], [8 x i32] [i32 0, i32 223410181, i32 2016316978, i32 -1, i32 -1610789521, i32 1, i32 591018478, i32 -548640644], [8 x i32] [i32 -1610789521, i32 1, i32 591018478, i32 -548640644, i32 -966943802, i32 -1, i32 -1, i32 1702862848], [8 x i32] [i32 1840137829, i32 -99824884, i32 -1610789521, i32 1, i32 -1117972742, i32 -8, i32 -8, i32 1], [8 x i32] [i32 -1509313059, i32 0, i32 4, i32 -638114951, i32 1078268908, i32 1, i32 -1355867497, i32 -1355867497]], [5 x [8 x i32]] [[8 x i32] [i32 1770112494, i32 1, i32 6, i32 6, i32 1, i32 1770112494, i32 1, i32 8], [8 x i32] [i32 -966943802, i32 707900158, i32 1, i32 1, i32 -1509313059, i32 1, i32 551870971, i32 -1117972742], [8 x i32] [i32 6, i32 1, i32 -1, i32 1, i32 -3, i32 2016316978, i32 -1762498432, i32 8], [8 x i32] [i32 0, i32 -3, i32 -8, i32 6, i32 -1, i32 -1, i32 -4, i32 -1355867497], [8 x i32] [i32 -259527796, i32 0, i32 1, i32 -638114951, i32 1840137829, i32 -1, i32 -966943802, i32 1]]], align 4
+@func_38.l_235 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 -27, i8 127, [2 x i8] undef }, align 4
+@func_38.l_292 = private unnamed_addr constant [2 x [4 x %struct.S3*]] [[4 x %struct.S3*] [%struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*)], [4 x %struct.S3*] [%struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*), %struct.S3* bitcast (i8* getelementptr (i8* bitcast ([9 x %struct.S3]* @g_49 to i8*), i64 24) to %struct.S3*)]], align 4
+@func_38.l_349 = private unnamed_addr constant [3 x [6 x i32**]] [[6 x i32**] [i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304], [6 x i32**] [i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304], [6 x i32**] [i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304, i32** @g_304]], align 4
+@func_38.l_321 = private unnamed_addr constant [6 x [7 x i32]] [[7 x i32] [i32 -5, i32 -5, i32 -692510939, i32 4, i32 -1, i32 4, i32 -692510939], [7 x i32] [i32 -1397227185, i32 -1397227185, i32 1054299477, i32 -1098985294, i32 1, i32 -1098985294, i32 1054299477], [7 x i32] [i32 -5, i32 -5, i32 -692510939, i32 -362345779, i32 -3, i32 -362345779, i32 -5], [7 x i32] [i32 1, i32 1, i32 -1397227185, i32 0, i32 -1801226716, i32 0, i32 -1397227185], [7 x i32] [i32 -1, i32 -1, i32 -5, i32 -362345779, i32 -3, i32 -362345779, i32 -5], [7 x i32] [i32 1, i32 1, i32 -1397227185, i32 0, i32 -1801226716, i32 0, i32 -1397227185]], align 4
+@func_38.l_392 = private unnamed_addr constant [1 x [2 x [8 x i32]]] [[2 x [8 x i32]] [[8 x i32] [i32 -1758527188, i32 0, i32 0, i32 -1758527188, i32 0, i32 0, i32 -1758527188, i32 0], [8 x i32] [i32 -1758527188, i32 -1758527188, i32 -8, i32 -1758527188, i32 -1758527188, i32 -8, i32 -1758527188, i32 -1758527188]]], align 4
+@func_19.l_603 = private unnamed_addr constant <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }> <{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 1, i8 -1, i8 15, i8 undef, i8 -73, i8 11, i8 0, i8 undef, i8 13, i8 10, i8 0, i8 0, i8 0, i8 -82, i8 6, i8 0, i8 100, i8 77, i8 0, i8 0 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 1, i8 1, i8 -1, i8 15, i8 undef, i8 -73, i8 11, i8 0, i8 undef, i8 13, i8 10, i8 0, i8 0, i8 0, i8 -82, i8 6, i8 0, i8 100, i8 77, i8 0, i8 0 } }>, align 4
+@func_19.l_598 = private unnamed_addr constant [4 x i16*] [i16* @g_395, i16* @g_395, i16* @g_395, i16* @g_395], align 4
+@func_19.l_617 = private unnamed_addr constant [7 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 -1], [3 x i32] [i32 3, i32 2, i32 -1], [3 x i32] [i32 2, i32 3, i32 -1], [3 x i32] [i32 1, i32 1, i32 -1], [3 x i32] [i32 3, i32 2, i32 -1], [3 x i32] [i32 2, i32 3, i32 -1], [3 x i32] [i32 1, i32 1, i32 1]], align 4
+@func_19.l_622 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -1881615275, i8 -42, i8 1, i8 0, i8 undef, i8 -113, i8 3, i8 0, i8 undef, i8 4, i8 5, i8 0, i8 0, i8 1, i8 53, i8 7, i8 0, i8 90, i8 42, i8 0, i8 0 }, align 4
+@func_15.l_789 = private unnamed_addr constant [6 x %union.U4] [%union.U4 { i32 -1636516384 }, %union.U4 { i32 958775946 }, %union.U4 { i32 -1636516384 }, %union.U4 { i32 -1636516384 }, %union.U4 { i32 958775946 }, %union.U4 { i32 -1636516384 }], align 4
+@func_15.l_814 = private unnamed_addr constant [8 x [1 x [4 x i32]]] [[1 x [4 x i32]] [[4 x i32] [i32 -6, i32 6, i32 1822782642, i32 1]], [1 x [4 x i32]] [[4 x i32] [i32 -6, i32 1822782642, i32 -6, i32 0]], [1 x [4 x i32]] [[4 x i32] [i32 6, i32 1, i32 0, i32 0]], [1 x [4 x i32]] [[4 x i32] [i32 1822782642, i32 1822782642, i32 557110867, i32 1]], [1 x [4 x i32]] [[4 x i32] [i32 1, i32 6, i32 557110867, i32 6]], [1 x [4 x i32]] [[4 x i32] [i32 1822782642, i32 -6, i32 0, i32 557110867]], [1 x [4 x i32]] [[4 x i32] [i32 6, i32 -6, i32 -6, i32 6]], [1 x [4 x i32]] [[4 x i32] [i32 -6, i32 6, i32 1822782642, i32 1]]], align 4
+@func_15.l_963 = private unnamed_addr constant %struct.S1 { i32 8, i32 0, i8 -8, i16 1 }, align 4
+@func_15.l_765 = private unnamed_addr constant [7 x i32*] [i32* @g_465, i32* @g_465, i32* @g_532, i32* @g_465, i32* @g_465, i32* @g_532, i32* @g_465], align 4
+@func_15.l_773 = private unnamed_addr constant [10 x [2 x [1 x i8*]]] [[2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] [[1 x i8*] [i8* @g_96], [1 x i8*] zeroinitializer], [2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] [[1 x i8*] zeroinitializer, [1 x i8*] [i8* @g_96]], [2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] [[1 x i8*] [i8* @g_96], [1 x i8*] zeroinitializer], [2 x [1 x i8*]] zeroinitializer, [2 x [1 x i8*]] [[1 x i8*] zeroinitializer, [1 x i8*] [i8* @g_96]]], align 4
+@func_15.l_826 = private unnamed_addr constant { i8, i8, [2 x i8] } { i8 -115, i8 127, [2 x i8] undef }, align 4
+@func_15.l_915 = private unnamed_addr constant { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } { i32 -2073639257, i8 53, i8 -1, i8 15, i8 undef, i8 32, i8 14, i8 0, i8 undef, i8 -99, i8 31, i8 0, i8 0, i8 -2, i8 12, i8 10, i8 0, i8 76, i8 56, i8 0, i8 0 }, align 4
+
+; Function Attrs: nounwind
+define i32 @main(i32 %argc, i8** nocapture %argv) #0 {
+ %1 = alloca %struct.S3, align 4
+ call void @llvm.dbg.value(metadata !{i32 %argc}, i64 0, metadata !302), !dbg !303
+ call void @llvm.dbg.value(metadata !{i8** %argv}, i64 0, metadata !304), !dbg !303
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !305), !dbg !306
+ %2 = icmp eq i32 %argc, 2, !dbg !307
+ br i1 %2, label %3, label %8, !dbg !307
+
+; <label>:3 ; preds = %0
+ %4 = getelementptr inbounds i8** %argv, i32 1, !dbg !307
+ %5 = load i8** %4, align 4, !dbg !307
+ %6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0)) #3, !dbg !307
+ %7 = icmp eq i32 %6, 0, !dbg !307
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !305), !dbg !307
+ %. = zext i1 %7 to i32, !dbg !307
+ br label %8, !dbg !307
+
+; <label>:8 ; preds = %3, %0
+ %print_hash_value.0 = phi i32 [ 0, %0 ], [ %., %3 ]
+ call fastcc void @crc32_gentab(), !dbg !309
+ call fastcc void @func_1(%struct.S3* sret %1), !dbg !310
+ %9 = load i32* @g_5, align 4, !dbg !311
+ %10 = sext i32 %9 to i64, !dbg !311
+ call fastcc void @transparent_crc(i64 %10, i8* getelementptr inbounds ([4 x i8]* @.str1, i32 0, i32 0), i32 %print_hash_value.0), !dbg !311
+ %11 = load i32* getelementptr inbounds (%struct.S3* @g_25, i32 0, i32 0), align 8, !dbg !312
+ %12 = zext i32 %11 to i64, !dbg !312
+ call fastcc void @transparent_crc(i64 %12, i8* getelementptr inbounds ([8 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0), !dbg !312
+ %13 = load i32* getelementptr inbounds (%struct.S3* @g_25, i32 0, i32 1), align 4, !dbg !313
+ %14 = zext i32 %13 to i64, !dbg !313
+ call fastcc void @transparent_crc(i64 %14, i8* getelementptr inbounds ([8 x i8]* @.str3, i32 0, i32 0), i32 %print_hash_value.0), !dbg !313
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !315
+ %15 = icmp eq i32 %print_hash_value.0, 0, !dbg !317
+ br label %16, !dbg !315
+
+; <label>:16 ; preds = %25, %8
+ %i.028 = phi i32 [ 0, %8 ], [ %26, %25 ]
+ %17 = getelementptr inbounds [9 x %struct.S3]* @g_49, i32 0, i32 %i.028, i32 0, !dbg !319
+ %18 = load i32* %17, align 8, !dbg !319
+ %19 = zext i32 %18 to i64, !dbg !319
+ call fastcc void @transparent_crc(i64 %19, i8* getelementptr inbounds ([11 x i8]* @.str4, i32 0, i32 0), i32 %print_hash_value.0), !dbg !319
+ %20 = getelementptr inbounds [9 x %struct.S3]* @g_49, i32 0, i32 %i.028, i32 1, !dbg !320
+ %21 = load i32* %20, align 4, !dbg !320
+ %22 = zext i32 %21 to i64, !dbg !320
+ call fastcc void @transparent_crc(i64 %22, i8* getelementptr inbounds ([11 x i8]* @.str5, i32 0, i32 0), i32 %print_hash_value.0), !dbg !320
+ br i1 %15, label %25, label %23, !dbg !317
+
+; <label>:23 ; preds = %16
+ %24 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 %i.028) #3, !dbg !317
+ br label %25, !dbg !317
+
+; <label>:25 ; preds = %23, %16
+ %26 = add nsw i32 %i.028, 1, !dbg !315
+ call void @llvm.dbg.value(metadata !{i32 %26}, i64 0, metadata !314), !dbg !315
+ %27 = icmp slt i32 %26, 9, !dbg !315
+ br i1 %27, label %16, label %28, !dbg !315
+
+; <label>:28 ; preds = %25
+ %29 = load i32* @g_52, align 4, !dbg !321
+ %30 = sext i32 %29 to i64, !dbg !321
+ call fastcc void @transparent_crc(i64 %30, i8* getelementptr inbounds ([5 x i8]* @.str7, i32 0, i32 0), i32 %print_hash_value.0), !dbg !321
+ call fastcc void @transparent_crc(i64 -56, i8* getelementptr inbounds ([5 x i8]* @.str8, i32 0, i32 0), i32 %print_hash_value.0), !dbg !322
+ %31 = load i32* @g_90, align 4, !dbg !323
+ %32 = sext i32 %31 to i64, !dbg !323
+ call fastcc void @transparent_crc(i64 %32, i8* getelementptr inbounds ([5 x i8]* @.str9, i32 0, i32 0), i32 %print_hash_value.0), !dbg !323
+ %33 = load i8* @g_92, align 1, !dbg !324
+ %34 = sext i8 %33 to i64, !dbg !324
+ call fastcc void @transparent_crc(i64 %34, i8* getelementptr inbounds ([5 x i8]* @.str10, i32 0, i32 0), i32 %print_hash_value.0), !dbg !324
+ %35 = load i8* @g_96, align 1, !dbg !325
+ %36 = zext i8 %35 to i64, !dbg !325
+ call fastcc void @transparent_crc(i64 %36, i8* getelementptr inbounds ([5 x i8]* @.str11, i32 0, i32 0), i32 %print_hash_value.0), !dbg !325
+ %37 = load i32* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 0), align 4, !dbg !326
+ %38 = zext i32 %37 to i64, !dbg !326
+ call fastcc void @transparent_crc(i64 %38, i8* getelementptr inbounds ([8 x i8]* @.str12, i32 0, i32 0), i32 %print_hash_value.0), !dbg !326
+ %39 = load i32* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 1), align 4, !dbg !327
+ %40 = zext i32 %39 to i64, !dbg !327
+ call fastcc void @transparent_crc(i64 %40, i8* getelementptr inbounds ([8 x i8]* @.str13, i32 0, i32 0), i32 %print_hash_value.0), !dbg !327
+ %41 = load i8* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 2), align 4, !dbg !328
+ %42 = zext i8 %41 to i64, !dbg !328
+ call fastcc void @transparent_crc(i64 %42, i8* getelementptr inbounds ([8 x i8]* @.str14, i32 0, i32 0), i32 %print_hash_value.0), !dbg !328
+ %43 = load i16* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 3), align 2, !dbg !329
+ %44 = sext i16 %43 to i64, !dbg !329
+ call fastcc void @transparent_crc(i64 %44, i8* getelementptr inbounds ([8 x i8]* @.str15, i32 0, i32 0), i32 %print_hash_value.0), !dbg !329
+ %45 = load i16* @g_103, align 2, !dbg !330
+ %46 = zext i16 %45 to i64, !dbg !330
+ call fastcc void @transparent_crc(i64 %46, i8* getelementptr inbounds ([6 x i8]* @.str16, i32 0, i32 0), i32 %print_hash_value.0), !dbg !330
+ %47 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !331
+ %48 = sext i32 %47 to i64, !dbg !331
+ call fastcc void @transparent_crc(i64 %48, i8* getelementptr inbounds ([9 x i8]* @.str17, i32 0, i32 0), i32 %print_hash_value.0), !dbg !331
+ %49 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 1) to i32*), align 4, !dbg !332
+ %50 = shl i32 %49, 12, !dbg !332
+ %51 = ashr exact i32 %50, 12, !dbg !332
+ %52 = sext i32 %51 to i64, !dbg !332
+ call fastcc void @transparent_crc(i64 %52, i8* getelementptr inbounds ([9 x i8]* @.str18, i32 0, i32 0), i32 %print_hash_value.0), !dbg !332
+ %53 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 5) to i32*), align 4, !dbg !333
+ %54 = shl i32 %53, 8, !dbg !333
+ %55 = ashr exact i32 %54, 8, !dbg !333
+ %56 = sext i32 %55 to i64, !dbg !333
+ call fastcc void @transparent_crc(i64 %56, i8* getelementptr inbounds ([9 x i8]* @.str19, i32 0, i32 0), i32 %print_hash_value.0), !dbg !333
+ %57 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 9) to i32*), align 4, !dbg !334
+ %58 = and i32 %57, 67108863, !dbg !334
+ %59 = zext i32 %58 to i64, !dbg !334
+ call fastcc void @transparent_crc(i64 %59, i8* getelementptr inbounds ([9 x i8]* @.str20, i32 0, i32 0), i32 %print_hash_value.0), !dbg !334
+ %60 = load i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 13), align 4, !dbg !335
+ %61 = sext i8 %60 to i64, !dbg !335
+ call fastcc void @transparent_crc(i64 %61, i8* getelementptr inbounds ([9 x i8]* @.str21, i32 0, i32 0), i32 %print_hash_value.0), !dbg !335
+ %62 = load i56* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 14) to i56*), align 1, !dbg !336
+ %.tr = trunc i56 %62 to i32, !dbg !336
+ %63 = and i32 %.tr, 16777215, !dbg !336
+ %64 = zext i32 %63 to i64, !dbg !336
+ call fastcc void @transparent_crc(i64 %64, i8* getelementptr inbounds ([9 x i8]* @.str22, i32 0, i32 0), i32 %print_hash_value.0), !dbg !336
+ %65 = load i56* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 14) to i56*), align 1, !dbg !337
+ %66 = lshr i56 %65, 24, !dbg !337
+ %.tr1 = trunc i56 %66 to i32, !dbg !337
+ %67 = and i32 %.tr1, 536870911, !dbg !337
+ %68 = zext i32 %67 to i64, !dbg !337
+ call fastcc void @transparent_crc(i64 %68, i8* getelementptr inbounds ([9 x i8]* @.str23, i32 0, i32 0), i32 %print_hash_value.0), !dbg !337
+ call fastcc void @transparent_crc(i64 762265952, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0), !dbg !338
+ %69 = load i16* bitcast ({ i8, i8, [2 x i8] }* @g_110 to i16*), align 4, !dbg !339
+ %70 = shl i16 %69, 1, !dbg !339
+ %71 = ashr exact i16 %70, 1, !dbg !339
+ %72 = sext i16 %71 to i64, !dbg !339
+ call fastcc void @transparent_crc(i64 %72, i8* getelementptr inbounds ([9 x i8]* @.str25, i32 0, i32 0), i32 %print_hash_value.0), !dbg !339
+ %73 = load i32* getelementptr inbounds (%union.U4* @g_183, i32 0, i32 0), align 4, !dbg !340
+ %74 = sext i32 %73 to i64, !dbg !340
+ call fastcc void @transparent_crc(i64 %74, i8* getelementptr inbounds ([9 x i8]* @.str26, i32 0, i32 0), i32 %print_hash_value.0), !dbg !340
+ call fastcc void @transparent_crc(i64 169, i8* getelementptr inbounds ([9 x i8]* @.str27, i32 0, i32 0), i32 %print_hash_value.0), !dbg !341
+ %75 = load i8* @g_258, align 1, !dbg !342
+ %76 = sext i8 %75 to i64, !dbg !342
+ call fastcc void @transparent_crc(i64 %76, i8* getelementptr inbounds ([6 x i8]* @.str28, i32 0, i32 0), i32 %print_hash_value.0), !dbg !342
+ %77 = load i16* @g_332, align 2, !dbg !343
+ %78 = zext i16 %77 to i64, !dbg !343
+ call fastcc void @transparent_crc(i64 %78, i8* getelementptr inbounds ([6 x i8]* @.str29, i32 0, i32 0), i32 %print_hash_value.0), !dbg !343
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !344
+ %79 = icmp eq i32 %print_hash_value.0, 0, !dbg !346
+ br label %.preheader25, !dbg !344
+
+.preheader25: ; preds = %85, %28
+ %i.127 = phi i32 [ 0, %28 ], [ %86, %85 ]
+ %80 = getelementptr inbounds [10 x [1 x %union.U4]]* @g_345, i32 0, i32 %i.127, i32 0, i32 0, !dbg !350
+ %81 = load i32* %80, align 4, !dbg !350
+ %82 = sext i32 %81 to i64, !dbg !350
+ call fastcc void @transparent_crc(i64 %82, i8* getelementptr inbounds ([15 x i8]* @.str30, i32 0, i32 0), i32 %print_hash_value.0), !dbg !350
+ br i1 %79, label %85, label %83, !dbg !346
+
+; <label>:83 ; preds = %.preheader25
+ %84 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.127, i32 0) #3, !dbg !346
+ br label %85, !dbg !346
+
+; <label>:85 ; preds = %83, %.preheader25
+ %86 = add nsw i32 %i.127, 1, !dbg !344
+ call void @llvm.dbg.value(metadata !{i32 %86}, i64 0, metadata !314), !dbg !344
+ %87 = icmp slt i32 %86, 10, !dbg !344
+ br i1 %87, label %.preheader25, label %88, !dbg !344
+
+; <label>:88 ; preds = %85
+ %89 = icmp eq i32 %print_hash_value.0, 0, !dbg !351
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ br i1 %89, label %.thread32, label %341, !dbg !351
+
+.thread32: ; preds = %88
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ br label %348, !dbg !351
+
+.preheader18: ; preds = %348, %338
+ %i.322 = phi i32 [ 0, %348 ], [ %339, %338 ]
+ br label %90, !dbg !356
+
+; <label>:90 ; preds = %105, %.preheader18
+ %k.019 = phi i32 [ 0, %.preheader18 ], [ %106, %105 ]
+ %91 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 0, i32 %k.019, i32 0, !dbg !362
+ %92 = load i32* %91, align 4, !dbg !362
+ %93 = zext i32 %92 to i64, !dbg !362
+ call fastcc void @transparent_crc(i64 %93, i8* getelementptr inbounds ([18 x i8]* @.str35, i32 0, i32 0), i32 %print_hash_value.0), !dbg !362
+ %94 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 0, i32 %k.019, i32 1, !dbg !364
+ %95 = load i32* %94, align 4, !dbg !364
+ %96 = zext i32 %95 to i64, !dbg !364
+ call fastcc void @transparent_crc(i64 %96, i8* getelementptr inbounds ([18 x i8]* @.str36, i32 0, i32 0), i32 %print_hash_value.0), !dbg !364
+ %97 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 0, i32 %k.019, i32 2, !dbg !365
+ %98 = load i8* %97, align 4, !dbg !365
+ %99 = zext i8 %98 to i64, !dbg !365
+ call fastcc void @transparent_crc(i64 %99, i8* getelementptr inbounds ([18 x i8]* @.str37, i32 0, i32 0), i32 %print_hash_value.0), !dbg !365
+ %100 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 0, i32 %k.019, i32 3, !dbg !366
+ %101 = load i16* %100, align 2, !dbg !366
+ %102 = sext i16 %101 to i64, !dbg !366
+ call fastcc void @transparent_crc(i64 %102, i8* getelementptr inbounds ([18 x i8]* @.str38, i32 0, i32 0), i32 %print_hash_value.0), !dbg !366
+ br i1 %351, label %105, label %103, !dbg !367
+
+; <label>:103 ; preds = %90
+ %104 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.322, i32 0, i32 %k.019) #3, !dbg !367
+ br label %105, !dbg !367
+
+; <label>:105 ; preds = %103, %90
+ %106 = add nsw i32 %k.019, 1, !dbg !356
+ call void @llvm.dbg.value(metadata !{i32 %106}, i64 0, metadata !368), !dbg !356
+ %107 = icmp slt i32 %106, 7, !dbg !356
+ br i1 %107, label %90, label %.preheader18.1, !dbg !356
+
+; <label>:108 ; preds = %338
+ %.b = load i1* @g_452, align 1
+ %109 = select i1 %.b, i64 4, i64 7, !dbg !369
+ call fastcc void @transparent_crc(i64 %109, i8* getelementptr inbounds ([6 x i8]* @.str40, i32 0, i32 0), i32 %print_hash_value.0), !dbg !369
+ call fastcc void @transparent_crc(i64 -1300072605, i8* getelementptr inbounds ([6 x i8]* @.str41, i32 0, i32 0), i32 %print_hash_value.0), !dbg !370
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !371
+ %110 = icmp eq i32 %print_hash_value.0, 0, !dbg !373
+ %111 = load i16* getelementptr inbounds ([1 x i16]* @g_455, i32 0, i32 0), align 2, !dbg !375
+ %112 = zext i16 %111 to i64, !dbg !375
+ call fastcc void @transparent_crc(i64 %112, i8* getelementptr inbounds ([9 x i8]* @.str42, i32 0, i32 0), i32 %print_hash_value.0), !dbg !375
+ br i1 %110, label %115, label %113, !dbg !373
+
+; <label>:113 ; preds = %108
+ %114 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 0) #3, !dbg !373
+ br label %115, !dbg !373
+
+; <label>:115 ; preds = %113, %108
+ %116 = load i32* @g_465, align 4, !dbg !376
+ %117 = sext i32 %116 to i64, !dbg !376
+ call fastcc void @transparent_crc(i64 %117, i8* getelementptr inbounds ([6 x i8]* @.str43, i32 0, i32 0), i32 %print_hash_value.0), !dbg !376
+ call fastcc void @transparent_crc(i64 8, i8* getelementptr inbounds ([6 x i8]* @.str44, i32 0, i32 0), i32 %print_hash_value.0), !dbg !377
+ %118 = load i8* @g_467, align 1, !dbg !378
+ %119 = zext i8 %118 to i64, !dbg !378
+ call fastcc void @transparent_crc(i64 %119, i8* getelementptr inbounds ([6 x i8]* @.str45, i32 0, i32 0), i32 %print_hash_value.0), !dbg !378
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([6 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0), !dbg !379
+ call fastcc void @transparent_crc(i64 3359972097, i8* getelementptr inbounds ([9 x i8]* @.str47, i32 0, i32 0), i32 %print_hash_value.0), !dbg !380
+ call fastcc void @transparent_crc(i64 6, i8* getelementptr inbounds ([9 x i8]* @.str48, i32 0, i32 0), i32 %print_hash_value.0), !dbg !381
+ call fastcc void @transparent_crc(i64 144, i8* getelementptr inbounds ([9 x i8]* @.str49, i32 0, i32 0), i32 %print_hash_value.0), !dbg !382
+ call fastcc void @transparent_crc(i64 1, i8* getelementptr inbounds ([9 x i8]* @.str50, i32 0, i32 0), i32 %print_hash_value.0), !dbg !383
+ call fastcc void @transparent_crc(i64 87, i8* getelementptr inbounds ([6 x i8]* @.str51, i32 0, i32 0), i32 %print_hash_value.0), !dbg !384
+ %120 = load i32* @g_532, align 4, !dbg !385
+ %121 = sext i32 %120 to i64, !dbg !385
+ call fastcc void @transparent_crc(i64 %121, i8* getelementptr inbounds ([6 x i8]* @.str52, i32 0, i32 0), i32 %print_hash_value.0), !dbg !385
+ %122 = load i16* @g_534, align 2, !dbg !386
+ %123 = sext i16 %122 to i64, !dbg !386
+ call fastcc void @transparent_crc(i64 %123, i8* getelementptr inbounds ([6 x i8]* @.str53, i32 0, i32 0), i32 %print_hash_value.0), !dbg !386
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !387
+ %124 = icmp eq i32 %print_hash_value.0, 0, !dbg !389
+ br label %.preheader14, !dbg !387
+
+.preheader14: ; preds = %134, %115
+ %i.516 = phi i32 [ 0, %115 ], [ %135, %134 ]
+ br label %.preheader12, !dbg !395
+
+.preheader12: ; preds = %301, %.preheader14
+ %j.215 = phi i32 [ 0, %.preheader14 ], [ %302, %301 ]
+ %125 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 0, !dbg !396
+ %126 = load i16* %125, align 2, !dbg !396
+ %127 = zext i16 %126 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %127, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ br i1 %124, label %.critedge, label %128, !dbg !389
+
+; <label>:128 ; preds = %.preheader12
+ %129 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.516, i32 %j.215, i32 0) #3, !dbg !389
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %130 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 1, !dbg !396
+ %131 = load i16* %130, align 2, !dbg !396
+ %132 = zext i16 %131 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %132, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ %133 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.516, i32 %j.215, i32 1) #3, !dbg !389
+ br label %288, !dbg !389
+
+; <label>:134 ; preds = %301
+ %135 = add nsw i32 %i.516, 1, !dbg !387
+ call void @llvm.dbg.value(metadata !{i32 %135}, i64 0, metadata !314), !dbg !387
+ %136 = icmp slt i32 %135, 3, !dbg !387
+ br i1 %136, label %.preheader14, label %137, !dbg !387
+
+; <label>:137 ; preds = %134
+ %138 = load i16* @g_538, align 2, !dbg !398
+ %139 = zext i16 %138 to i64, !dbg !398
+ call fastcc void @transparent_crc(i64 %139, i8* getelementptr inbounds ([6 x i8]* @.str55, i32 0, i32 0), i32 %print_hash_value.0), !dbg !398
+ %140 = load i16* @g_557, align 2, !dbg !399
+ %141 = sext i16 %140 to i64, !dbg !399
+ call fastcc void @transparent_crc(i64 %141, i8* getelementptr inbounds ([6 x i8]* @.str56, i32 0, i32 0), i32 %print_hash_value.0), !dbg !399
+ %142 = load i8* @g_575, align 1, !dbg !400
+ %143 = zext i8 %142 to i64, !dbg !400
+ call fastcc void @transparent_crc(i64 %143, i8* getelementptr inbounds ([6 x i8]* @.str57, i32 0, i32 0), i32 %print_hash_value.0), !dbg !400
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !401
+ %144 = icmp eq i32 %print_hash_value.0, 0, !dbg !403
+ br label %.preheader9, !dbg !401
+
+.preheader9: ; preds = %282, %137
+ %i.611 = phi i32 [ 0, %137 ], [ %283, %282 ]
+ %145 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 0, i32 0, !dbg !407
+ %146 = load i32* %145, align 4, !dbg !407
+ %147 = sext i32 %146 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %147, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br i1 %144, label %.critedge33, label %148, !dbg !403
+
+; <label>:148 ; preds = %.preheader9
+ %149 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 0) #3, !dbg !403
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %150 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 1, i32 0, !dbg !407
+ %151 = load i32* %150, align 4, !dbg !407
+ %152 = sext i32 %151 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %152, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ %153 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 1) #3, !dbg !403
+ br label %243, !dbg !403
+
+; <label>:154 ; preds = %282
+ %155 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 0), align 4, !dbg !410
+ %156 = sext i32 %155 to i64, !dbg !410
+ call fastcc void @transparent_crc(i64 %156, i8* getelementptr inbounds ([9 x i8]* @.str59, i32 0, i32 0), i32 %print_hash_value.0), !dbg !410
+ %157 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 1) to i32*), align 4, !dbg !411
+ %158 = shl i32 %157, 12, !dbg !411
+ %159 = ashr exact i32 %158, 12, !dbg !411
+ %160 = sext i32 %159 to i64, !dbg !411
+ call fastcc void @transparent_crc(i64 %160, i8* getelementptr inbounds ([9 x i8]* @.str60, i32 0, i32 0), i32 %print_hash_value.0), !dbg !411
+ %161 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 5) to i32*), align 4, !dbg !412
+ %162 = shl i32 %161, 8, !dbg !412
+ %163 = ashr exact i32 %162, 8, !dbg !412
+ %164 = sext i32 %163 to i64, !dbg !412
+ call fastcc void @transparent_crc(i64 %164, i8* getelementptr inbounds ([9 x i8]* @.str61, i32 0, i32 0), i32 %print_hash_value.0), !dbg !412
+ %165 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 9) to i32*), align 4, !dbg !413
+ %166 = and i32 %165, 67108863, !dbg !413
+ %167 = zext i32 %166 to i64, !dbg !413
+ call fastcc void @transparent_crc(i64 %167, i8* getelementptr inbounds ([9 x i8]* @.str62, i32 0, i32 0), i32 %print_hash_value.0), !dbg !413
+ %168 = load i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 13), align 4, !dbg !414
+ %169 = sext i8 %168 to i64, !dbg !414
+ call fastcc void @transparent_crc(i64 %169, i8* getelementptr inbounds ([9 x i8]* @.str63, i32 0, i32 0), i32 %print_hash_value.0), !dbg !414
+ %170 = load i56* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 14) to i56*), align 1, !dbg !415
+ %.tr2 = trunc i56 %170 to i32, !dbg !415
+ %171 = and i32 %.tr2, 16777215, !dbg !415
+ %172 = zext i32 %171 to i64, !dbg !415
+ call fastcc void @transparent_crc(i64 %172, i8* getelementptr inbounds ([9 x i8]* @.str64, i32 0, i32 0), i32 %print_hash_value.0), !dbg !415
+ %173 = load i56* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 14) to i56*), align 1, !dbg !416
+ %174 = lshr i56 %173, 24, !dbg !416
+ %.tr3 = trunc i56 %174 to i32, !dbg !416
+ %175 = and i32 %.tr3, 536870911, !dbg !416
+ %176 = zext i32 %175 to i64, !dbg !416
+ call fastcc void @transparent_crc(i64 %176, i8* getelementptr inbounds ([9 x i8]* @.str65, i32 0, i32 0), i32 %print_hash_value.0), !dbg !416
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !417
+ %177 = icmp eq i32 %print_hash_value.0, 0, !dbg !419
+ br label %.preheader6, !dbg !417
+
+.preheader6: ; preds = %237, %154
+ %i.78 = phi i32 [ 0, %154 ], [ %238, %237 ]
+ %178 = getelementptr inbounds [4 x [3 x i8]]* @g_815, i32 0, i32 %i.78, i32 0, !dbg !423
+ %179 = load i8* %178, align 1, !dbg !423
+ %180 = sext i8 %179 to i64, !dbg !423
+ call fastcc void @transparent_crc(i64 %180, i8* getelementptr inbounds ([12 x i8]* @.str66, i32 0, i32 0), i32 %print_hash_value.0), !dbg !423
+ br i1 %177, label %.critedge34, label %181, !dbg !419
+
+; <label>:181 ; preds = %.preheader6
+ %182 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.78, i32 0) #3, !dbg !419
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !424
+ %183 = getelementptr inbounds [4 x [3 x i8]]* @g_815, i32 0, i32 %i.78, i32 1, !dbg !423
+ %184 = load i8* %183, align 1, !dbg !423
+ %185 = sext i8 %184 to i64, !dbg !423
+ call fastcc void @transparent_crc(i64 %185, i8* getelementptr inbounds ([12 x i8]* @.str66, i32 0, i32 0), i32 %print_hash_value.0), !dbg !423
+ %186 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.78, i32 1) #3, !dbg !419
+ br label %231, !dbg !419
+
+; <label>:187 ; preds = %237
+ call fastcc void @transparent_crc(i64 9, i8* getelementptr inbounds ([9 x i8]* @.str67, i32 0, i32 0), i32 %print_hash_value.0), !dbg !425
+ call fastcc void @transparent_crc(i64 -13, i8* getelementptr inbounds ([7 x i8]* @.str68, i32 0, i32 0), i32 %print_hash_value.0), !dbg !426
+ %188 = load i32* @g_1055, align 4, !dbg !427
+ %189 = sext i32 %188 to i64, !dbg !427
+ call fastcc void @transparent_crc(i64 %189, i8* getelementptr inbounds ([7 x i8]* @.str69, i32 0, i32 0), i32 %print_hash_value.0), !dbg !427
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !428
+ %190 = icmp eq i32 %print_hash_value.0, 0, !dbg !430
+ br label %.preheader, !dbg !428
+
+.preheader: ; preds = %225, %187
+ %i.85 = phi i32 [ 0, %187 ], [ %226, %225 ]
+ %191 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 0, !dbg !434
+ %192 = load i32* %191, align 4, !dbg !434
+ %193 = zext i32 %192 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %193, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ br i1 %190, label %.critedge35, label %194, !dbg !430
+
+; <label>:194 ; preds = %.preheader
+ %195 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.85, i32 0) #3, !dbg !430
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %196 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 1, !dbg !434
+ %197 = load i32* %196, align 4, !dbg !434
+ %198 = zext i32 %197 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %198, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ %199 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.85, i32 1) #3, !dbg !430
+ br label %206, !dbg !430
+
+; <label>:200 ; preds = %225
+ %201 = load i32* @crc32_context, align 4, !dbg !436
+ %202 = xor i32 %201, -1, !dbg !436
+ call fastcc void @platform_main_end(i32 %202), !dbg !436
+ ret i32 0, !dbg !437
+
+.critedge35: ; preds = %.preheader
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %203 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 1, !dbg !434
+ %204 = load i32* %203, align 4, !dbg !434
+ %205 = zext i32 %204 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %205, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ br label %206
+
+; <label>:206 ; preds = %.critedge35, %194
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %207 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 2, !dbg !434
+ %208 = load i32* %207, align 4, !dbg !434
+ %209 = zext i32 %208 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %209, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ br i1 %190, label %.critedge37, label %210, !dbg !430
+
+; <label>:210 ; preds = %206
+ %211 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.85, i32 2) #3, !dbg !430
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %212 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 3, !dbg !434
+ %213 = load i32* %212, align 4, !dbg !434
+ %214 = zext i32 %213 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %214, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ %215 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.85, i32 3) #3, !dbg !430
+ br label %219, !dbg !430
+
+.critedge37: ; preds = %206
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %216 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 3, !dbg !434
+ %217 = load i32* %216, align 4, !dbg !434
+ %218 = zext i32 %217 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %218, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ br label %219
+
+; <label>:219 ; preds = %.critedge37, %210
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %220 = getelementptr inbounds [4 x [5 x i32]]* @g_1057, i32 0, i32 %i.85, i32 4, !dbg !434
+ %221 = load i32* %220, align 4, !dbg !434
+ %222 = zext i32 %221 to i64, !dbg !434
+ call fastcc void @transparent_crc(i64 %222, i8* getelementptr inbounds ([13 x i8]* @.str70, i32 0, i32 0), i32 %print_hash_value.0), !dbg !434
+ br i1 %190, label %225, label %223, !dbg !430
+
+; <label>:223 ; preds = %219
+ %224 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.85, i32 4) #3, !dbg !430
+ br label %225, !dbg !430
+
+; <label>:225 ; preds = %223, %219
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !435
+ %226 = add nsw i32 %i.85, 1, !dbg !428
+ call void @llvm.dbg.value(metadata !{i32 %226}, i64 0, metadata !314), !dbg !428
+ %227 = icmp slt i32 %226, 4, !dbg !428
+ br i1 %227, label %.preheader, label %200, !dbg !428
+
+.critedge34: ; preds = %.preheader6
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !424
+ %228 = getelementptr inbounds [4 x [3 x i8]]* @g_815, i32 0, i32 %i.78, i32 1, !dbg !423
+ %229 = load i8* %228, align 1, !dbg !423
+ %230 = sext i8 %229 to i64, !dbg !423
+ call fastcc void @transparent_crc(i64 %230, i8* getelementptr inbounds ([12 x i8]* @.str66, i32 0, i32 0), i32 %print_hash_value.0), !dbg !423
+ br label %231
+
+; <label>:231 ; preds = %.critedge34, %181
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !424
+ %232 = getelementptr inbounds [4 x [3 x i8]]* @g_815, i32 0, i32 %i.78, i32 2, !dbg !423
+ %233 = load i8* %232, align 1, !dbg !423
+ %234 = sext i8 %233 to i64, !dbg !423
+ call fastcc void @transparent_crc(i64 %234, i8* getelementptr inbounds ([12 x i8]* @.str66, i32 0, i32 0), i32 %print_hash_value.0), !dbg !423
+ br i1 %177, label %237, label %235, !dbg !419
+
+; <label>:235 ; preds = %231
+ %236 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.78, i32 2) #3, !dbg !419
+ br label %237, !dbg !419
+
+; <label>:237 ; preds = %235, %231
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !424
+ %238 = add nsw i32 %i.78, 1, !dbg !417
+ call void @llvm.dbg.value(metadata !{i32 %238}, i64 0, metadata !314), !dbg !417
+ %239 = icmp slt i32 %238, 4, !dbg !417
+ br i1 %239, label %.preheader6, label %187, !dbg !417
+
+.critedge33: ; preds = %.preheader9
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %240 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 1, i32 0, !dbg !407
+ %241 = load i32* %240, align 4, !dbg !407
+ %242 = sext i32 %241 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %242, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br label %243
+
+; <label>:243 ; preds = %.critedge33, %148
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %244 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 2, i32 0, !dbg !407
+ %245 = load i32* %244, align 4, !dbg !407
+ %246 = sext i32 %245 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %246, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br i1 %144, label %.critedge41, label %247, !dbg !403
+
+; <label>:247 ; preds = %243
+ %248 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 2) #3, !dbg !403
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %249 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 3, i32 0, !dbg !407
+ %250 = load i32* %249, align 4, !dbg !407
+ %251 = sext i32 %250 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %251, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ %252 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 3) #3, !dbg !403
+ br label %256, !dbg !403
+
+.critedge41: ; preds = %243
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %253 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 3, i32 0, !dbg !407
+ %254 = load i32* %253, align 4, !dbg !407
+ %255 = sext i32 %254 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %255, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br label %256
+
+; <label>:256 ; preds = %.critedge41, %247
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %257 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 4, i32 0, !dbg !407
+ %258 = load i32* %257, align 4, !dbg !407
+ %259 = sext i32 %258 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %259, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br i1 %144, label %.critedge43, label %260, !dbg !403
+
+; <label>:260 ; preds = %256
+ %261 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 4) #3, !dbg !403
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %262 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 5, i32 0, !dbg !407
+ %263 = load i32* %262, align 4, !dbg !407
+ %264 = sext i32 %263 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %264, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ %265 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 5) #3, !dbg !403
+ br label %269, !dbg !403
+
+.critedge43: ; preds = %256
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %266 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 5, i32 0, !dbg !407
+ %267 = load i32* %266, align 4, !dbg !407
+ %268 = sext i32 %267 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %268, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br label %269
+
+; <label>:269 ; preds = %.critedge43, %260
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %270 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 6, i32 0, !dbg !407
+ %271 = load i32* %270, align 4, !dbg !407
+ %272 = sext i32 %271 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %272, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br i1 %144, label %.critedge45, label %273, !dbg !403
+
+; <label>:273 ; preds = %269
+ %274 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 6) #3, !dbg !403
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %275 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 7, i32 0, !dbg !407
+ %276 = load i32* %275, align 4, !dbg !407
+ %277 = sext i32 %276 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %277, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ %278 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str31, i32 0, i32 0), i32 %i.611, i32 7) #3, !dbg !403
+ br label %282, !dbg !403
+
+.critedge45: ; preds = %269
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %279 = getelementptr inbounds [10 x [8 x %union.U4]]* @g_591, i32 0, i32 %i.611, i32 7, i32 0, !dbg !407
+ %280 = load i32* %279, align 4, !dbg !407
+ %281 = sext i32 %280 to i64, !dbg !407
+ call fastcc void @transparent_crc(i64 %281, i8* getelementptr inbounds ([15 x i8]* @.str58, i32 0, i32 0), i32 %print_hash_value.0), !dbg !407
+ br label %282
+
+; <label>:282 ; preds = %.critedge45, %273
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !409
+ %283 = add nsw i32 %i.611, 1, !dbg !401
+ call void @llvm.dbg.value(metadata !{i32 %283}, i64 0, metadata !314), !dbg !401
+ %284 = icmp slt i32 %283, 10, !dbg !401
+ br i1 %284, label %.preheader9, label %154, !dbg !401
+
+.critedge: ; preds = %.preheader12
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %285 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 1, !dbg !396
+ %286 = load i16* %285, align 2, !dbg !396
+ %287 = zext i16 %286 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %287, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ br label %288
+
+; <label>:288 ; preds = %.critedge, %128
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %289 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 2, !dbg !396
+ %290 = load i16* %289, align 2, !dbg !396
+ %291 = zext i16 %290 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %291, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ br i1 %124, label %.critedge47, label %292, !dbg !389
+
+; <label>:292 ; preds = %288
+ %293 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.516, i32 %j.215, i32 2) #3, !dbg !389
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %294 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 3, !dbg !396
+ %295 = load i16* %294, align 2, !dbg !396
+ %296 = zext i16 %295 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %296, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ %297 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.516, i32 %j.215, i32 3) #3, !dbg !389
+ br label %301, !dbg !389
+
+.critedge47: ; preds = %288
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %298 = getelementptr inbounds [3 x [6 x [4 x i16]]]* @g_535, i32 0, i32 %i.516, i32 %j.215, i32 3, !dbg !396
+ %299 = load i16* %298, align 2, !dbg !396
+ %300 = zext i16 %299 to i64, !dbg !396
+ call fastcc void @transparent_crc(i64 %300, i8* getelementptr inbounds ([15 x i8]* @.str54, i32 0, i32 0), i32 %print_hash_value.0), !dbg !396
+ br label %301
+
+; <label>:301 ; preds = %.critedge47, %292
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !368), !dbg !397
+ %302 = add nsw i32 %j.215, 1, !dbg !395
+ call void @llvm.dbg.value(metadata !{i32 %302}, i64 0, metadata !408), !dbg !395
+ %303 = icmp slt i32 %302, 6, !dbg !395
+ br i1 %303, label %.preheader12, label %134, !dbg !395
+
+.preheader18.1: ; preds = %318, %105
+ %k.019.1 = phi i32 [ %319, %318 ], [ 0, %105 ]
+ %304 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 1, i32 %k.019.1, i32 0, !dbg !362
+ %305 = load i32* %304, align 4, !dbg !362
+ %306 = zext i32 %305 to i64, !dbg !362
+ call fastcc void @transparent_crc(i64 %306, i8* getelementptr inbounds ([18 x i8]* @.str35, i32 0, i32 0), i32 %print_hash_value.0), !dbg !362
+ %307 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 1, i32 %k.019.1, i32 1, !dbg !364
+ %308 = load i32* %307, align 4, !dbg !364
+ %309 = zext i32 %308 to i64, !dbg !364
+ call fastcc void @transparent_crc(i64 %309, i8* getelementptr inbounds ([18 x i8]* @.str36, i32 0, i32 0), i32 %print_hash_value.0), !dbg !364
+ %310 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 1, i32 %k.019.1, i32 2, !dbg !365
+ %311 = load i8* %310, align 4, !dbg !365
+ %312 = zext i8 %311 to i64, !dbg !365
+ call fastcc void @transparent_crc(i64 %312, i8* getelementptr inbounds ([18 x i8]* @.str37, i32 0, i32 0), i32 %print_hash_value.0), !dbg !365
+ %313 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 1, i32 %k.019.1, i32 3, !dbg !366
+ %314 = load i16* %313, align 2, !dbg !366
+ %315 = sext i16 %314 to i64, !dbg !366
+ call fastcc void @transparent_crc(i64 %315, i8* getelementptr inbounds ([18 x i8]* @.str38, i32 0, i32 0), i32 %print_hash_value.0), !dbg !366
+ br i1 %351, label %318, label %316, !dbg !367
+
+; <label>:316 ; preds = %.preheader18.1
+ %317 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.322, i32 1, i32 %k.019.1) #3, !dbg !367
+ br label %318, !dbg !367
+
+; <label>:318 ; preds = %316, %.preheader18.1
+ %319 = add nsw i32 %k.019.1, 1, !dbg !356
+ call void @llvm.dbg.value(metadata !{i32 %106}, i64 0, metadata !368), !dbg !356
+ %320 = icmp slt i32 %319, 7, !dbg !356
+ br i1 %320, label %.preheader18.1, label %.preheader18.2, !dbg !356
+
+.preheader18.2: ; preds = %335, %318
+ %k.019.2 = phi i32 [ %336, %335 ], [ 0, %318 ]
+ %321 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 2, i32 %k.019.2, i32 0, !dbg !362
+ %322 = load i32* %321, align 4, !dbg !362
+ %323 = zext i32 %322 to i64, !dbg !362
+ call fastcc void @transparent_crc(i64 %323, i8* getelementptr inbounds ([18 x i8]* @.str35, i32 0, i32 0), i32 %print_hash_value.0), !dbg !362
+ %324 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 2, i32 %k.019.2, i32 1, !dbg !364
+ %325 = load i32* %324, align 4, !dbg !364
+ %326 = zext i32 %325 to i64, !dbg !364
+ call fastcc void @transparent_crc(i64 %326, i8* getelementptr inbounds ([18 x i8]* @.str36, i32 0, i32 0), i32 %print_hash_value.0), !dbg !364
+ %327 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 2, i32 %k.019.2, i32 2, !dbg !365
+ %328 = load i8* %327, align 4, !dbg !365
+ %329 = zext i8 %328 to i64, !dbg !365
+ call fastcc void @transparent_crc(i64 %329, i8* getelementptr inbounds ([18 x i8]* @.str37, i32 0, i32 0), i32 %print_hash_value.0), !dbg !365
+ %330 = getelementptr inbounds [9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 %i.322, i32 2, i32 %k.019.2, i32 3, !dbg !366
+ %331 = load i16* %330, align 2, !dbg !366
+ %332 = sext i16 %331 to i64, !dbg !366
+ call fastcc void @transparent_crc(i64 %332, i8* getelementptr inbounds ([18 x i8]* @.str38, i32 0, i32 0), i32 %print_hash_value.0), !dbg !366
+ br i1 %351, label %335, label %333, !dbg !367
+
+; <label>:333 ; preds = %.preheader18.2
+ %334 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str39, i32 0, i32 0), i32 %i.322, i32 2, i32 %k.019.2) #3, !dbg !367
+ br label %335, !dbg !367
+
+; <label>:335 ; preds = %333, %.preheader18.2
+ %336 = add nsw i32 %k.019.2, 1, !dbg !356
+ call void @llvm.dbg.value(metadata !{i32 %106}, i64 0, metadata !368), !dbg !356
+ %337 = icmp slt i32 %336, 7, !dbg !356
+ br i1 %337, label %.preheader18.2, label %338, !dbg !356
+
+; <label>:338 ; preds = %335
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !408), !dbg !438
+ %339 = add nsw i32 %i.322, 1, !dbg !439
+ call void @llvm.dbg.value(metadata !{i32 %339}, i64 0, metadata !314), !dbg !439
+ %340 = icmp slt i32 %339, 9, !dbg !439
+ br i1 %340, label %.preheader18, label %108, !dbg !439
+
+; <label>:341 ; preds = %88
+ %342 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 0) #3, !dbg !351
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ %343 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 1) #3, !dbg !351
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ %344 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 2) #3, !dbg !351
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ %345 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 3) #3, !dbg !351
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ %346 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 4) #3, !dbg !351
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ call fastcc void @transparent_crc(i64 0, i8* getelementptr inbounds ([9 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0), !dbg !354
+ %347 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str6, i32 0, i32 0), i32 5) #3, !dbg !351
+ br label %348, !dbg !351
+
+; <label>:348 ; preds = %341, %.thread32
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !314), !dbg !355
+ %349 = load i16* @g_395, align 2, !dbg !440
+ %350 = zext i16 %349 to i64, !dbg !440
+ call fastcc void @transparent_crc(i64 %350, i8* getelementptr inbounds ([6 x i8]* @.str33, i32 0, i32 0), i32 %print_hash_value.0), !dbg !440
+ call fastcc void @transparent_crc(i64 18, i8* getelementptr inbounds ([6 x i8]* @.str34, i32 0, i32 0), i32 %print_hash_value.0), !dbg !441
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !314), !dbg !439
+ %351 = icmp eq i32 %print_hash_value.0, 0, !dbg !367
+ br label %.preheader18, !dbg !439
+}
+
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.declare(metadata, metadata) #1
+
+; Function Attrs: nounwind readonly
+declare i32 @strcmp(i8* nocapture, i8* nocapture) #2
+
+; Function Attrs: nounwind
+define internal fastcc void @crc32_gentab() #0 {
+ tail call void @llvm.dbg.value(metadata !442, i64 0, metadata !443), !dbg !445
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !446), !dbg !447
+ br label %.preheader, !dbg !447
+
+.preheader: ; preds = %.preheader, %0
+ %i.03 = phi i32 [ 0, %0 ], [ %34, %.preheader ]
+ %1 = and i32 %i.03, 1, !dbg !449
+ %2 = icmp eq i32 %1, 0, !dbg !449
+ %3 = lshr i32 %i.03, 1, !dbg !453
+ %4 = xor i32 %3, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1 = select i1 %2, i32 %3, i32 %4, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %5 = and i32 %crc.1, 1, !dbg !449
+ %6 = icmp eq i32 %5, 0, !dbg !449
+ %7 = lshr i32 %crc.1, 1, !dbg !453
+ %8 = xor i32 %7, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.1 = select i1 %6, i32 %7, i32 %8, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %9 = and i32 %crc.1.1, 1, !dbg !449
+ %10 = icmp eq i32 %9, 0, !dbg !449
+ %11 = lshr i32 %crc.1.1, 1, !dbg !453
+ %12 = xor i32 %11, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.2 = select i1 %10, i32 %11, i32 %12, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %13 = and i32 %crc.1.2, 1, !dbg !449
+ %14 = icmp eq i32 %13, 0, !dbg !449
+ %15 = lshr i32 %crc.1.2, 1, !dbg !453
+ %16 = xor i32 %15, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.3 = select i1 %14, i32 %15, i32 %16, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %17 = and i32 %crc.1.3, 1, !dbg !449
+ %18 = icmp eq i32 %17, 0, !dbg !449
+ %19 = lshr i32 %crc.1.3, 1, !dbg !453
+ %20 = xor i32 %19, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.4 = select i1 %18, i32 %19, i32 %20, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %21 = and i32 %crc.1.4, 1, !dbg !449
+ %22 = icmp eq i32 %21, 0, !dbg !449
+ %23 = lshr i32 %crc.1.4, 1, !dbg !453
+ %24 = xor i32 %23, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.5 = select i1 %22, i32 %23, i32 %24, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %25 = and i32 %crc.1.5, 1, !dbg !449
+ %26 = icmp eq i32 %25, 0, !dbg !449
+ %27 = lshr i32 %crc.1.5, 1, !dbg !453
+ %28 = xor i32 %27, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.6 = select i1 %26, i32 %27, i32 %28, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %29 = and i32 %crc.1.6, 1, !dbg !449
+ %30 = icmp eq i32 %29, 0, !dbg !449
+ %31 = lshr i32 %crc.1.6, 1, !dbg !453
+ %32 = xor i32 %31, -306674912, !dbg !453
+ tail call void @llvm.dbg.value(metadata !{i32 %4}, i64 0, metadata !455), !dbg !453
+ %crc.1.7 = select i1 %30, i32 %31, i32 %32, !dbg !449
+ tail call void @llvm.dbg.value(metadata !456, i64 0, metadata !457), !dbg !458
+ %33 = getelementptr inbounds [256 x i32]* @crc32_tab, i32 0, i32 %i.03, !dbg !459
+ store i32 %crc.1.7, i32* %33, align 4, !dbg !459
+ %34 = add nsw i32 %i.03, 1, !dbg !447
+ tail call void @llvm.dbg.value(metadata !{i32 %34}, i64 0, metadata !446), !dbg !447
+ %35 = icmp slt i32 %34, 256, !dbg !447
+ br i1 %35, label %.preheader, label %36, !dbg !447
+
+; <label>:36 ; preds = %.preheader
+ ret void, !dbg !460
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_1(%struct.S3* noalias nocapture sret %agg.result) #0 {
+ tail call void @llvm.dbg.value(metadata !461, i64 0, metadata !462), !dbg !464
+ tail call void @llvm.dbg.declare(metadata !465, metadata !466), !dbg !467
+ %1 = load i32* @g_5, align 4, !dbg !468
+ %2 = trunc i32 %1 to i8, !dbg !468
+ %3 = tail call fastcc i32 @func_2(i8 zeroext %2), !dbg !468
+ store i32 %3, i32* @g_465, align 4, !dbg !468
+ %4 = bitcast %struct.S3* %agg.result to i64*, !dbg !469
+ store i64 8862064115011551231, i64* %4, align 4, !dbg !469
+ ret void, !dbg !469
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @transparent_crc(i64 %val, i8* %vname, i32 %flag) #0 {
+ tail call void @llvm.dbg.value(metadata !{i64 %val}, i64 0, metadata !470), !dbg !471
+ tail call void @llvm.dbg.value(metadata !{i8* %vname}, i64 0, metadata !472), !dbg !471
+ tail call void @llvm.dbg.value(metadata !{i32 %flag}, i64 0, metadata !473), !dbg !471
+ tail call fastcc void @crc32_8bytes(i64 %val), !dbg !474
+ %1 = icmp eq i32 %flag, 0, !dbg !476
+ br i1 %1, label %6, label %2, !dbg !476
+
+; <label>:2 ; preds = %0
+ %3 = load i32* @crc32_context, align 4, !dbg !477
+ %4 = xor i32 %3, -1, !dbg !477
+ %5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([36 x i8]* @.str72, i32 0, i32 0), i8* %vname, i32 %4) #3, !dbg !477
+ br label %6, !dbg !479
+
+; <label>:6 ; preds = %2, %0
+ ret void, !dbg !480
+}
+
+; Function Attrs: nounwind
+declare i32 @printf(i8* nocapture, ...) #0
+
+; Function Attrs: nounwind
+define internal fastcc void @platform_main_end(i32 %crc) #0 {
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !481), !dbg !482
+ %1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str71, i32 0, i32 0), i32 %crc) #3, !dbg !483
+ ret void, !dbg !485
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @crc32_8bytes(i64 %val) #0 {
+ tail call void @llvm.dbg.value(metadata !{i64 %val}, i64 0, metadata !486), !dbg !487
+ %1 = trunc i64 %val to i8, !dbg !488
+ tail call fastcc void @crc32_byte(i8 zeroext %1), !dbg !488
+ %2 = lshr i64 %val, 8, !dbg !489
+ %3 = trunc i64 %2 to i8, !dbg !489
+ tail call fastcc void @crc32_byte(i8 zeroext %3), !dbg !489
+ %4 = lshr i64 %val, 16, !dbg !490
+ %5 = trunc i64 %4 to i8, !dbg !490
+ tail call fastcc void @crc32_byte(i8 zeroext %5), !dbg !490
+ %6 = lshr i64 %val, 24, !dbg !491
+ %7 = trunc i64 %6 to i8, !dbg !491
+ tail call fastcc void @crc32_byte(i8 zeroext %7), !dbg !491
+ %8 = lshr i64 %val, 32, !dbg !492
+ %9 = trunc i64 %8 to i8, !dbg !492
+ tail call fastcc void @crc32_byte(i8 zeroext %9), !dbg !492
+ %10 = lshr i64 %val, 40, !dbg !493
+ %11 = trunc i64 %10 to i8, !dbg !493
+ tail call fastcc void @crc32_byte(i8 zeroext %11), !dbg !493
+ %12 = lshr i64 %val, 48, !dbg !494
+ %13 = trunc i64 %12 to i8, !dbg !494
+ tail call fastcc void @crc32_byte(i8 zeroext %13), !dbg !494
+ %14 = lshr i64 %val, 56, !dbg !495
+ %15 = trunc i64 %14 to i8, !dbg !495
+ tail call fastcc void @crc32_byte(i8 zeroext %15), !dbg !495
+ ret void, !dbg !496
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @crc32_byte(i8 zeroext %b) #0 {
+ tail call void @llvm.dbg.value(metadata !{i8 %b}, i64 0, metadata !497), !dbg !498
+ %1 = load i32* @crc32_context, align 4, !dbg !499
+ %2 = lshr i32 %1, 8, !dbg !499
+ %3 = zext i8 %b to i32, !dbg !499
+ %.masked = and i32 %1, 255, !dbg !499
+ %4 = xor i32 %.masked, %3, !dbg !499
+ %5 = getelementptr inbounds [256 x i32]* @crc32_tab, i32 0, i32 %4, !dbg !499
+ %6 = load i32* %5, align 4, !dbg !499
+ %7 = xor i32 %2, %6, !dbg !499
+ store i32 %7, i32* @crc32_context, align 4, !dbg !499
+ ret void, !dbg !500
+}
+
+; Function Attrs: nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) #3
+
+; Function Attrs: nounwind
+define internal fastcc i32 @func_2(i8 zeroext %p_3) #0 {
+ %1 = alloca %struct.S0, align 4
+ %2 = alloca %struct.S3, align 4
+ call void @llvm.dbg.value(metadata !501, i64 0, metadata !502), !dbg !503
+ call void @llvm.dbg.value(metadata !504, i64 0, metadata !505), !dbg !506
+ call void @llvm.dbg.declare(metadata !507, metadata !508), !dbg !509
+ call void @llvm.dbg.value(metadata !510, i64 0, metadata !511), !dbg !512
+ call void @llvm.dbg.value(metadata !513, i64 0, metadata !514), !dbg !516
+ call void @llvm.dbg.value(metadata !517, i64 0, metadata !518), !dbg !519
+ call void @llvm.dbg.value(metadata !520, i64 0, metadata !521), !dbg !522
+ call void @llvm.dbg.value(metadata !523, i64 0, metadata !524), !dbg !525
+ call void @llvm.dbg.declare(metadata !526, metadata !527), !dbg !528
+ call void @llvm.dbg.declare(metadata !529, metadata !530), !dbg !533
+ call void @llvm.dbg.value(metadata !534, i64 0, metadata !535), !dbg !536
+ call void @llvm.dbg.declare(metadata !537, metadata !538), !dbg !541
+ call void @llvm.dbg.value(metadata !542, i64 0, metadata !543), !dbg !544
+ %3 = zext i8 %p_3 to i32, !dbg !545
+ call fastcc void @func_10(%struct.S0* sret %1, i8 zeroext -3), !dbg !545
+ %4 = call fastcc i32 @safe_unary_minus_func_int32_t_s(i32 %3), !dbg !545
+ %not. = icmp ne i32 %4, 0, !dbg !545
+ %. = zext i1 %not. to i32, !dbg !545
+ %5 = call fastcc i32 @safe_mod_func_int32_t_s_s(i32 %., i32 %3)
+ store i32 %5, i32* @g_465, align 4
+ call void @llvm.dbg.value(metadata !517, i64 0, metadata !518), !dbg !519
+ call void @llvm.dbg.value(metadata !517, i64 0, metadata !521), !dbg !522
+ %6 = load i16* @g_103, align 2, !dbg !546
+ %7 = zext i16 %6 to i32, !dbg !546
+ %8 = call fastcc signext i8 @safe_mul_func_int8_t_s_s(i8 signext 0, i8 signext 1), !dbg !546
+ %9 = sext i8 %8 to i32, !dbg !546
+ %10 = load i32* @g_1055, align 4, !dbg !546
+ %11 = xor i32 %10, %9, !dbg !546
+ store i32 %11, i32* @g_1055, align 4, !dbg !546
+ %12 = and i32 %7, 18676, !dbg !546
+ call fastcc void @func_26(%struct.S3* sret %2, i32 %12, i32* @g_1055), !dbg !546
+ %13 = load i32* @g_1055, align 4, !dbg !546
+ %14 = icmp eq i32 %13, 0, !dbg !546
+ br i1 %14, label %26, label %15, !dbg !546
+
+; <label>:15 ; preds = %0
+ call void @llvm.dbg.value(metadata !547, i64 0, metadata !548), !dbg !552
+ call void @llvm.dbg.value(metadata !553, i64 0, metadata !554), !dbg !555
+ call void @llvm.dbg.value(metadata !556, i64 0, metadata !557), !dbg !558
+ store i16 -15853, i16* @g_103, align 2
+ %16 = call fastcc signext i8 @safe_lshift_func_int8_t_s_s(i8 signext 19, i32 5)
+ %17 = sext i8 %16 to i32
+ %18 = load i32* @g_465, align 4
+ %19 = and i32 %18, %17
+ store i32 %19, i32* @g_465, align 4
+ %20 = call fastcc i32* @func_45(i32* @g_1055, %struct.S3* byval getelementptr inbounds ([10 x %struct.S3]* @func_2.l_1247, i32 0, i32 3)), !dbg !559
+ %21 = call fastcc i32* @func_34(%union.U4* byval getelementptr inbounds ([10 x [1 x %union.U4]]* @g_345, i32 0, i32 5, i32 0), i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 0)), !dbg !559
+ %22 = call fastcc i32* @func_34(%union.U4* byval getelementptr inbounds ([10 x [8 x %union.U4]]* @g_591, i32 0, i32 3, i32 4), i32* %21), !dbg !559
+ %23 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 0), align 4, !dbg !560
+ %24 = load i32* @g_1055, align 4, !dbg !560
+ %25 = xor i32 %24, %23, !dbg !560
+ store i32 %25, i32* @g_1055, align 4, !dbg !560
+ br label %27, !dbg !561
+
+; <label>:26 ; preds = %0
+ call void @llvm.dbg.declare(metadata !562, metadata !563), !dbg !565
+ call void @llvm.dbg.value(metadata !566, i64 0, metadata !567), !dbg !568
+ call void @llvm.dbg.declare(metadata !569, metadata !570), !dbg !573
+ store i64 8589934591, i64* bitcast (%struct.S3* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 4) to i64*), align 8, !dbg !574
+ br label %27
+
+; <label>:27 ; preds = %26, %15
+ %28 = load i32* @g_465, align 4, !dbg !575
+ ret i32 %28, !dbg !575
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @safe_mod_func_int32_t_s_s(i32 %si1, i32 %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i32 %si1}, i64 0, metadata !576), !dbg !577
+ tail call void @llvm.dbg.value(metadata !{i32 %si2}, i64 0, metadata !578), !dbg !577
+ %1 = icmp eq i32 %si2, 0, !dbg !579
+ br i1 %1, label %7, label %2, !dbg !579
+
+; <label>:2 ; preds = %0
+ %3 = icmp eq i32 %si1, -2147483648, !dbg !579
+ %4 = icmp eq i32 %si2, -1, !dbg !579
+ %or.cond = and i1 %3, %4, !dbg !579
+ br i1 %or.cond, label %7, label %5, !dbg !579
+
+; <label>:5 ; preds = %2
+ %6 = srem i32 %si1, %si2, !dbg !579
+ br label %7, !dbg !579
+
+; <label>:7 ; preds = %5, %2, %0
+ %8 = phi i32 [ %6, %5 ], [ %si1, %2 ], [ %si1, %0 ], !dbg !579
+ ret i32 %8, !dbg !579
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @safe_unary_minus_func_int32_t_s(i32 %si) #4 {
+ tail call void @llvm.dbg.value(metadata !{i32 %si}, i64 0, metadata !580), !dbg !581
+ %1 = sub nsw i32 0, %si, !dbg !582
+ ret i32 %1, !dbg !582
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_10(%struct.S0* noalias nocapture sret %agg.result, i8 zeroext %p_11) #0 {
+.preheader9:
+ %l_14 = alloca i16, align 2, !dbg !584
+ %tmpcast = bitcast i16* %l_14 to [2 x i8]*, !dbg !584
+ %l_1179 = alloca i32**, align 4
+ %0 = alloca %struct.S3, align 4
+ %l_1143 = alloca %struct.S1, align 4
+ %l_1169 = alloca [1 x [2 x i16]], align 2
+ %1 = alloca %struct.S3, align 4
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !587), !dbg !588
+ call void @llvm.dbg.declare(metadata !{[2 x i8]* %tmpcast}, metadata !589), !dbg !592
+ call void @llvm.dbg.value(metadata !593, i64 0, metadata !594), !dbg !595
+ call void @llvm.dbg.declare(metadata !596, metadata !597), !dbg !598
+ call void @llvm.dbg.value(metadata !599, i64 0, metadata !600), !dbg !601
+ call void @llvm.dbg.value(metadata !602, i64 0, metadata !603), !dbg !604
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !605), !dbg !606
+ call void @llvm.dbg.value(metadata !607, i64 0, metadata !608), !dbg !609
+ call void @llvm.dbg.value(metadata !607, i64 0, metadata !610), !dbg !611
+ call void @llvm.dbg.value(metadata !612, i64 0, metadata !613), !dbg !614
+ call void @llvm.dbg.value(metadata !615, i64 0, metadata !616), !dbg !617
+ call void @llvm.dbg.value(metadata !618, i64 0, metadata !619), !dbg !620
+ call void @llvm.dbg.value(metadata !621, i64 0, metadata !622), !dbg !623
+ call void @llvm.dbg.value(metadata !621, i64 0, metadata !622), !dbg !624
+ call void @llvm.dbg.value(metadata !621, i64 0, metadata !628), !dbg !629
+ store i32** null, i32*** %l_1179, align 4, !dbg !629
+ call void @llvm.dbg.value(metadata !{i32*** %l_1179}, i64 0, metadata !630), !dbg !631
+ call void @llvm.dbg.value(metadata !{i32*** %l_1179}, i64 0, metadata !632), !dbg !633
+ call void @llvm.dbg.declare(metadata !634, metadata !635), !dbg !638
+ call void @llvm.dbg.value(metadata !639, i64 0, metadata !640), !dbg !641
+ call void @llvm.dbg.value(metadata !642, i64 0, metadata !643), !dbg !645
+ call void @llvm.dbg.declare(metadata !646, metadata !647), !dbg !648
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !649), !dbg !650
+ store i16 0, i16* %l_14, align 2, !dbg !584
+ br label %2, !dbg !651
+
+; <label>:2 ; preds = %2, %.preheader9
+ %.010 = phi i32 [ 0, %.preheader9 ], [ %9, %2 ]
+ store i16 0, i16* %l_14, align 2, !dbg !653
+ store i32 2, i32* @g_5, align 4, !dbg !657
+ %3 = getelementptr inbounds [2 x i8]* %tmpcast, i32 0, i32 %.010, !dbg !658
+ %4 = load i8* %3, align 1, !dbg !658
+ %5 = zext i8 %4 to i32, !dbg !658
+ %6 = call fastcc zeroext i8 @func_31(), !dbg !658
+ store i8 %6, i8* @g_96, align 1, !dbg !658
+ call fastcc void @func_26(%struct.S3* sret %0, i32 %5, i32* @g_465), !dbg !658
+ call fastcc void @func_19(%struct.S3* byval @g_25), !dbg !658
+ %7 = load i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 13), align 4, !dbg !658
+ %8 = sext i8 %7 to i32, !dbg !658
+ call fastcc void @func_15(i32 %8), !dbg !658
+ call void @llvm.dbg.value(metadata !520, i64 0, metadata !659), !dbg !658
+ %9 = add i32 %.010, 1, !dbg !651
+ call void @llvm.dbg.value(metadata !660, i64 0, metadata !587), !dbg !651
+ %10 = icmp ult i32 %9, 2, !dbg !651
+ br i1 %10, label %2, label %11, !dbg !651
+
+; <label>:11 ; preds = %2
+ store i32 0, i32* @g_465, align 4, !dbg !661
+ %12 = load i16* @g_103, align 2, !dbg !662
+ %13 = zext i8 %p_11 to i32, !dbg !662
+ %14 = call fastcc zeroext i16 @safe_mod_func_uint16_t_u_u(i16 zeroext %12, i16 zeroext %12), !dbg !662
+ %15 = icmp eq i16 %14, 0, !dbg !662
+ br i1 %15, label %17, label %16, !dbg !662
+
+; <label>:16 ; preds = %11
+ store i1 true, i1* @g_452, align 1
+ br label %53, !dbg !663
+
+; <label>:17 ; preds = %11
+ call void @llvm.dbg.value(metadata !599, i64 0, metadata !666), !dbg !667
+ call void @llvm.dbg.value(metadata !668, i64 0, metadata !669), !dbg !670
+ call void @llvm.dbg.value(metadata !671, i64 0, metadata !672), !dbg !673
+ call void @llvm.dbg.value(metadata !674, i64 0, metadata !675), !dbg !676
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !677), !dbg !678
+ call void @llvm.dbg.declare(metadata !679, metadata !680), !dbg !683
+ call void @llvm.dbg.declare(metadata !684, metadata !685), !dbg !686
+ call void @llvm.dbg.value(metadata !687, i64 0, metadata !688), !dbg !689
+ call void @llvm.dbg.declare(metadata !{%struct.S1* %l_1143}, metadata !690), !dbg !691
+ %18 = bitcast %struct.S1* %l_1143 to i8*, !dbg !691
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %18, i8* bitcast (%struct.S1* @func_10.l_1143 to i8*), i32 12, i32 4, i1 false), !dbg !691
+ call void @llvm.dbg.value(metadata !621, i64 0, metadata !692), !dbg !694
+ store i8 -8, i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 13), align 4, !dbg !695
+ %19 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !697
+ %20 = icmp eq i32 %19, 0, !dbg !697
+ br i1 %20, label %43, label %21, !dbg !697
+
+; <label>:21 ; preds = %17
+ call void @llvm.dbg.value(metadata !698, i64 0, metadata !699), !dbg !701
+ call void @llvm.dbg.value(metadata !599, i64 0, metadata !702), !dbg !703
+ call void @llvm.dbg.value(metadata !542, i64 0, metadata !704), !dbg !705
+ call void @llvm.dbg.value(metadata !698, i64 0, metadata !706), !dbg !707
+ call void @llvm.dbg.value(metadata !698, i64 0, metadata !708), !dbg !709
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !710), !dbg !711
+ call void @llvm.dbg.declare(metadata !712, metadata !713), !dbg !716
+ call void @llvm.dbg.value(metadata !717, i64 0, metadata !718), !dbg !720
+ call void @llvm.dbg.value(metadata !721, i64 0, metadata !722), !dbg !724
+ call void @llvm.dbg.value(metadata !725, i64 0, metadata !726), !dbg !727
+ %22 = load i32* getelementptr inbounds ([4 x [5 x i32]]* @g_1057, i32 0, i32 2, i32 2), align 4, !dbg !728
+ %23 = add i32 %22, 1, !dbg !728
+ store i32 %23, i32* getelementptr inbounds ([4 x [5 x i32]]* @g_1057, i32 0, i32 2, i32 2), align 4, !dbg !728
+ %24 = load i32* @g_465, align 4, !dbg !729
+ %25 = load i8* @g_258, align 1, !dbg !729
+ %26 = zext i8 %25 to i32, !dbg !729
+ %27 = and i32 %26, %24, !dbg !729
+ %28 = trunc i32 %27 to i8, !dbg !729
+ store i8 %28, i8* @g_258, align 1, !dbg !729
+ %29 = icmp eq i8 %28, 0, !dbg !729
+ %30 = zext i1 %29 to i8, !dbg !729
+ %31 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !729
+ %32 = trunc i32 %31 to i16, !dbg !729
+ %33 = call fastcc zeroext i16 @safe_mul_func_uint16_t_u_u(i16 zeroext 2, i16 zeroext %32), !dbg !729
+ %34 = trunc i16 %33 to i8, !dbg !729
+ %35 = call fastcc signext i8 @safe_mul_func_int8_t_s_s(i8 signext %30, i8 signext %34), !dbg !729
+ %36 = sext i8 %35 to i32, !dbg !729
+ store i32 %36, i32* getelementptr inbounds (%struct.S3* @g_25, i32 0, i32 0), align 8, !dbg !729
+ %37 = load i32* getelementptr inbounds ([4 x [5 x i32]]* @g_1057, i32 0, i32 2, i32 1), align 4, !dbg !729
+ %38 = and i32 %37, %36, !dbg !729
+ store i32 %38, i32* getelementptr inbounds ([4 x [5 x i32]]* @g_1057, i32 0, i32 2, i32 1), align 4, !dbg !729
+ %39 = call fastcc signext i16 @safe_add_func_int16_t_s_s(i16 signext 1, i16 signext 2)
+ %40 = sext i16 %39 to i32
+ %41 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 0), align 4
+ %42 = and i32 %41, %40
+ store i32 %42, i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 0), align 4
+ store i32 %42, i32* @g_465, align 4
+ br label %53, !dbg !730
+
+; <label>:43 ; preds = %17
+ %44 = getelementptr inbounds [1 x [2 x i16]]* %l_1169, i32 0, i32 0, i32 0, !dbg !731
+ store i16 5, i16* %44, align 2, !dbg !731
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !735), !dbg !736
+ %45 = getelementptr inbounds [1 x [2 x i16]]* %l_1169, i32 0, i32 0, i32 1, !dbg !731
+ store i16 5, i16* %45, align 2, !dbg !731
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !735), !dbg !736
+ call void @llvm.dbg.value(metadata !621, i64 0, metadata !692), !dbg !624
+ call fastcc void @func_26(%struct.S3* sret %1, i32 0, i32* @g_465), !dbg !624
+ %46 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, i32 0, i32 9) to i32*), align 4, !dbg !624
+ %47 = and i32 %46, 67108863, !dbg !624
+ %48 = call fastcc zeroext i8 @safe_rshift_func_uint8_t_u_s(i8 zeroext 1, i32 %47), !dbg !624
+ %49 = zext i8 %48 to i16, !dbg !624
+ %50 = getelementptr inbounds [1 x [2 x i16]]* %l_1169, i32 0, i32 0, i32 0, !dbg !624
+ %51 = load i16* %50, align 2, !dbg !624
+ %52 = or i16 %51, %49, !dbg !624
+ store i16 %52, i16* %50, align 2, !dbg !624
+ call void @llvm.dbg.value(metadata !{%struct.S1* %l_1143}, i64 0, metadata !690), !dbg !737
+ store %struct.S1* %l_1143, %struct.S1** getelementptr inbounds ([2 x [8 x [6 x %struct.S1*]]]* @g_524, i32 0, i32 1, i32 2, i32 3), align 4, !dbg !737
+ store %struct.S2* null, %struct.S2** getelementptr inbounds ([6 x [10 x %struct.S2*]]* @g_192, i32 0, i32 3, i32 4), align 4, !dbg !738
+ br label %53
+
+; <label>:53 ; preds = %43, %21, %16
+ call void @llvm.dbg.value(metadata !{i32*** %l_1179}, i64 0, metadata !630), !dbg !739
+ call void @llvm.dbg.value(metadata !{i32*** %l_1179}, i64 0, metadata !628), !dbg !739
+ store i32*** %l_1179, i32**** @g_1182, align 4, !dbg !739
+ store i8 109, i8* @g_96, align 1, !dbg !739
+ %54 = call fastcc zeroext i8 @safe_mul_func_uint8_t_u_u(i8 zeroext 109, i8 zeroext %p_11), !dbg !739
+ %55 = zext i8 %54 to i32, !dbg !739
+ %56 = load i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !739
+ %57 = or i32 %56, %55, !dbg !739
+ store i32 %57, i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !739
+ %58 = icmp sgt i32 %57, 238, !dbg !739
+ %59 = zext i1 %58 to i16, !dbg !739
+ store i16 %59, i16* @g_534, align 2, !dbg !739
+ %60 = call fastcc signext i16 @safe_add_func_int16_t_s_s(i16 signext 0, i16 signext %59), !dbg !739
+ %61 = sext i16 %60 to i32, !dbg !739
+ %62 = icmp sge i32 %61, %13, !dbg !739
+ %63 = zext i1 %62 to i32, !dbg !739
+ %64 = load i32* @g_465, align 4, !dbg !739
+ %65 = or i32 %63, %64, !dbg !739
+ store i32 %65, i32* @g_465, align 4, !dbg !739
+ %66 = bitcast %struct.S0* %agg.result to i8*, !dbg !740
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %66, i8* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @func_10.l_1189 to i8*), i32 24, i32 4, i1 false), !dbg !740
+ ret void, !dbg !741
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_sub_func_uint16_t_u_u(i16 zeroext %ui1, i16 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %ui1}, i64 0, metadata !742), !dbg !743
+ tail call void @llvm.dbg.value(metadata !{i16 %ui2}, i64 0, metadata !744), !dbg !743
+ %1 = sub i16 %ui1, %ui2, !dbg !745
+ ret i16 %1, !dbg !745
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @safe_mul_func_uint8_t_u_u(i8 zeroext %ui1, i8 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %ui1}, i64 0, metadata !746), !dbg !747
+ tail call void @llvm.dbg.value(metadata !{i8 %ui2}, i64 0, metadata !748), !dbg !747
+ %1 = mul i8 %ui2, %ui1, !dbg !749
+ ret i8 %1, !dbg !749
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @safe_lshift_func_int8_t_s_s(i8 signext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %left}, i64 0, metadata !750), !dbg !751
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !752), !dbg !751
+ %1 = sext i8 %left to i32, !dbg !753
+ %2 = icmp slt i8 %left, 0, !dbg !753
+ %3 = icmp ugt i32 %right, 31, !dbg !753
+ %or.cond = or i1 %2, %3, !dbg !753
+ %4 = lshr i32 127, %right, !dbg !753
+ %5 = icmp sgt i32 %1, %4, !dbg !753
+ %or.cond4 = or i1 %or.cond, %5, !dbg !753
+ br i1 %or.cond4, label %8, label %6, !dbg !753
+
+; <label>:6 ; preds = %0
+ %7 = shl i32 %1, %right, !dbg !753
+ %extract.t2 = trunc i32 %7 to i8, !dbg !753
+ br label %8, !dbg !753
+
+; <label>:8 ; preds = %6, %0
+ %.off0 = phi i8 [ %extract.t2, %6 ], [ %left, %0 ]
+ ret i8 %.off0, !dbg !753
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_rshift_func_uint16_t_u_s(i16 zeroext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %left}, i64 0, metadata !754), !dbg !755
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !756), !dbg !755
+ %1 = icmp ugt i32 %right, 31, !dbg !757
+ br i1 %1, label %5, label %2, !dbg !757
+
+; <label>:2 ; preds = %0
+ %3 = zext i16 %left to i32, !dbg !757
+ %4 = lshr i32 %3, %right, !dbg !757
+ %extract.t = trunc i32 %4 to i16, !dbg !757
+ br label %5, !dbg !757
+
+; <label>:5 ; preds = %2, %0
+ %.off0 = phi i16 [ %extract.t, %2 ], [ %left, %0 ]
+ ret i16 %.off0, !dbg !757
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @safe_mod_func_uint32_t_u_u(i32 %ui1, i32 %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i32 %ui1}, i64 0, metadata !758), !dbg !759
+ tail call void @llvm.dbg.value(metadata !{i32 %ui2}, i64 0, metadata !760), !dbg !759
+ %1 = icmp eq i32 %ui2, 0, !dbg !761
+ br i1 %1, label %4, label %2, !dbg !761
+
+; <label>:2 ; preds = %0
+ %3 = urem i32 %ui1, %ui2, !dbg !761
+ br label %4, !dbg !761
+
+; <label>:4 ; preds = %2, %0
+ %5 = phi i32 [ %3, %2 ], [ %ui1, %0 ], !dbg !761
+ ret i32 %5, !dbg !761
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @safe_sub_func_int32_t_s_s(i32 %si1, i32 %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i32 %si1}, i64 0, metadata !762), !dbg !763
+ tail call void @llvm.dbg.value(metadata !{i32 %si2}, i64 0, metadata !764), !dbg !763
+ %1 = xor i32 %si2, %si1, !dbg !765
+ %2 = and i32 %1, -2147483648, !dbg !765
+ %3 = xor i32 %2, %si1, !dbg !765
+ %4 = sub nsw i32 %3, %si2, !dbg !765
+ %5 = xor i32 %4, %si2, !dbg !765
+ %6 = and i32 %5, %1, !dbg !765
+ %7 = icmp slt i32 %6, 0, !dbg !765
+ %8 = select i1 %7, i32 0, i32 %si2, !dbg !765
+ %si1. = sub nsw i32 %si1, %8, !dbg !765
+ ret i32 %si1., !dbg !765
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_26(%struct.S3* noalias nocapture sret %agg.result, i32 %p_27, i32* nocapture %p_28) #0 {
+ tail call void @llvm.dbg.value(metadata !{i32 %p_27}, i64 0, metadata !766), !dbg !767
+ tail call void @llvm.dbg.value(metadata !{i32* %p_28}, i64 0, metadata !768), !dbg !767
+ tail call void @llvm.dbg.value(metadata !769, i64 0, metadata !770), !dbg !772
+ tail call void @llvm.dbg.value(metadata !773, i64 0, metadata !774), !dbg !775
+ tail call void @llvm.dbg.value(metadata !776, i64 0, metadata !777), !dbg !778
+ tail call void @llvm.dbg.declare(metadata !779, metadata !780), !dbg !781
+ tail call void @llvm.dbg.declare(metadata !782, metadata !783), !dbg !784
+ tail call void @llvm.dbg.declare(metadata !785, metadata !786), !dbg !787
+ tail call void @llvm.dbg.declare(metadata !788, metadata !789), !dbg !792
+ tail call void @llvm.dbg.value(metadata !793, i64 0, metadata !794), !dbg !795
+ tail call void @llvm.dbg.declare(metadata !796, metadata !797), !dbg !798
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !800), !dbg !801
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !803), !dbg !804
+ tail call void @llvm.dbg.value(metadata !520, i64 0, metadata !805), !dbg !806
+ tail call void @llvm.dbg.value(metadata !520, i64 0, metadata !807), !dbg !808
+ tail call void @llvm.dbg.value(metadata !698, i64 0, metadata !809), !dbg !810
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !811), !dbg !812
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !813), !dbg !814
+ tail call void @llvm.dbg.value(metadata !599, i64 0, metadata !815), !dbg !816
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !817), !dbg !818
+ tail call void @llvm.dbg.value(metadata !520, i64 0, metadata !819), !dbg !820
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !821), !dbg !822
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !823), !dbg !824
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !825), !dbg !826
+ store i16 0, i16* @g_395, align 2, !dbg !828
+ store i32 247, i32* %p_28, align 4, !dbg !830
+ %1 = tail call fastcc signext i16 @safe_rshift_func_int16_t_s_s(i16 signext 247, i32 134), !dbg !830
+ %2 = sext i16 %1 to i32, !dbg !830
+ tail call void @llvm.dbg.value(metadata !{i32 %2}, i64 0, metadata !777), !dbg !830
+ %3 = tail call fastcc i32 @safe_sub_func_int32_t_s_s(i32 %2, i32 134), !dbg !830
+ %4 = icmp eq i32 %3, 247, !dbg !830
+ br i1 %4, label %5, label %11, !dbg !830
+
+; <label>:5 ; preds = %0
+ tail call void @llvm.dbg.value(metadata !832, i64 0, metadata !833), !dbg !835
+ tail call void @llvm.dbg.declare(metadata !836, metadata !837), !dbg !839
+ %6 = tail call fastcc i32* @func_34(%union.U4* byval @func_26.l_486, i32* @g_465), !dbg !840
+ %7 = tail call fastcc i32* @func_45(i32* %6, %struct.S3* byval @func_26.l_489), !dbg !840
+ %8 = tail call fastcc i32* @func_34(%union.U4* byval getelementptr inbounds ([10 x [1 x %union.U4]]* @g_345, i32 0, i32 7, i32 0), i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0)), !dbg !840
+ store i32* %8, i32** @g_304, align 4, !dbg !840
+ store i8 1, i8* @g_96, align 1, !dbg !841
+ %9 = bitcast %struct.S3* %agg.result to i64*, !dbg !843
+ %10 = load i64* bitcast (%struct.S3* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 1) to i64*), align 8, !dbg !843
+ store i64 %10, i64* %9, align 4, !dbg !843
+ br label %22, !dbg !843
+
+; <label>:11 ; preds = %0
+ tail call void @llvm.dbg.value(metadata !845, i64 0, metadata !846), !dbg !848
+ tail call void @llvm.dbg.value(metadata !849, i64 0, metadata !850), !dbg !851
+ tail call void @llvm.dbg.value(metadata !852, i64 0, metadata !853), !dbg !854
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !855), !dbg !856
+ tail call void @llvm.dbg.value(metadata !857, i64 0, metadata !858), !dbg !859
+ tail call void @llvm.dbg.value(metadata !860, i64 0, metadata !861), !dbg !862
+ tail call void @llvm.dbg.value(metadata !863, i64 0, metadata !864), !dbg !865
+ tail call void @llvm.dbg.value(metadata !866, i64 0, metadata !867), !dbg !868
+ tail call void @llvm.dbg.declare(metadata !869, metadata !870), !dbg !871
+ tail call void @llvm.dbg.declare(metadata !872, metadata !873), !dbg !874
+ store i16 0, i16* @g_103, align 2, !dbg !875
+ tail call void @llvm.dbg.value(metadata !877, i64 0, metadata !878), !dbg !880
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !881), !dbg !882
+ tail call void @llvm.dbg.value(metadata !599, i64 0, metadata !883), !dbg !884
+ tail call void @llvm.dbg.value(metadata !885, i64 0, metadata !886), !dbg !887
+ tail call void @llvm.dbg.declare(metadata !888, metadata !889), !dbg !892
+ tail call void @llvm.dbg.value(metadata !893, i64 0, metadata !894), !dbg !896
+ tail call void @llvm.dbg.value(metadata !897, i64 0, metadata !794), !dbg !898
+ tail call void @llvm.dbg.value(metadata !308, i64 0, metadata !777), !dbg !899
+ tail call void @llvm.dbg.value(metadata !901, i64 0, metadata !902), !dbg !904
+ tail call void @llvm.dbg.declare(metadata !905, metadata !906), !dbg !909
+ tail call void @llvm.dbg.declare(metadata !910, metadata !911), !dbg !912
+ %12 = tail call fastcc signext i8 @safe_rshift_func_int8_t_s_u(i8 signext 1, i32 %p_27), !dbg !913
+ %13 = sext i8 %12 to i32, !dbg !913
+ %14 = load i32* %p_28, align 4, !dbg !913
+ %15 = and i32 %14, %13, !dbg !913
+ store i32 %15, i32* %p_28, align 4, !dbg !913
+ %16 = load i16* @g_395, align 2, !dbg !914
+ %17 = zext i16 %16 to i32, !dbg !914
+ %18 = getelementptr inbounds [9 x %struct.S3]* @g_49, i32 0, i32 %17, !dbg !914
+ %19 = bitcast %struct.S3* %18 to i64*, !dbg !914
+ %20 = bitcast %struct.S3* %agg.result to i64*, !dbg !914
+ %21 = load i64* %19, align 8, !dbg !914
+ store i64 %21, i64* %20, align 4, !dbg !914
+ br label %22, !dbg !914
+
+; <label>:22 ; preds = %11, %5
+ ret void, !dbg !915
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @safe_mul_func_int8_t_s_s(i8 signext %si1, i8 signext %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %si1}, i64 0, metadata !916), !dbg !917
+ tail call void @llvm.dbg.value(metadata !{i8 %si2}, i64 0, metadata !918), !dbg !917
+ %1 = mul i8 %si2, %si1, !dbg !919
+ ret i8 %1, !dbg !919
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_div_func_uint16_t_u_u(i16 zeroext %ui1, i16 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %ui1}, i64 0, metadata !920), !dbg !921
+ tail call void @llvm.dbg.value(metadata !{i16 %ui2}, i64 0, metadata !922), !dbg !921
+ %1 = icmp eq i16 %ui2, 0, !dbg !923
+ br i1 %1, label %3, label %2, !dbg !923
+
+; <label>:2 ; preds = %0
+ %div = udiv i16 %ui1, %ui2, !dbg !923
+ br label %3, !dbg !923
+
+; <label>:3 ; preds = %2, %0
+ %.in = phi i16 [ %div, %2 ], [ %ui1, %0 ]
+ ret i16 %.in, !dbg !923
+}
+
+; Function Attrs: nounwind
+define internal fastcc i32* @func_34(%union.U4* byval nocapture %p_36, i32* %p_37) #0 {
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !924), !dbg !925
+ tail call void @llvm.dbg.declare(metadata !796, metadata !926), !dbg !928
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !929), !dbg !930
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !931), !dbg !932
+ tail call void @llvm.dbg.value(metadata !933, i64 0, metadata !934), !dbg !935
+ tail call void @llvm.dbg.value(metadata !936, i64 0, metadata !937), !dbg !938
+ tail call void @llvm.dbg.value(metadata !556, i64 0, metadata !939), !dbg !940
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !941), !dbg !942
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !943), !dbg !944
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !945), !dbg !946
+ tail call void @llvm.dbg.value(metadata !599, i64 0, metadata !947), !dbg !948
+ tail call void @llvm.dbg.declare(metadata !949, metadata !950), !dbg !953
+ tail call void @llvm.dbg.value(metadata !954, i64 0, metadata !955), !dbg !956
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !957), !dbg !958
+ %1 = getelementptr inbounds %union.U4* %p_36, i32 0, i32 0, !dbg !960
+ %2 = load i32* %1, align 4, !dbg !960
+ %3 = icmp eq i32 %2, 0, !dbg !960
+ br i1 %3, label %12, label %4, !dbg !960
+
+; <label>:4 ; preds = %0
+ %5 = load i32* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 3, i32 1), align 4, !dbg !960
+ %6 = add i32 %5, -1, !dbg !960
+ store i32 %6, i32* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 3, i32 1), align 4, !dbg !960
+ %7 = tail call fastcc signext i16 @safe_mul_func_int16_t_s_s(i16 signext -13853, i16 signext 1), !dbg !960
+ %8 = trunc i16 %7 to i8, !dbg !960
+ %9 = tail call fastcc zeroext i8 @safe_lshift_func_uint8_t_u_u(i8 zeroext %8, i32 0), !dbg !960
+ %10 = load i8* @g_258, align 1, !dbg !960
+ %11 = xor i8 %10, %9, !dbg !960
+ store i8 %11, i8* @g_258, align 1, !dbg !960
+ br label %12
+
+; <label>:12 ; preds = %4, %0
+ %13 = load i16* getelementptr inbounds ([1 x i16]* @g_455, i32 0, i32 0), align 2, !dbg !961
+ %14 = add i16 %13, 1, !dbg !961
+ store i16 %14, i16* getelementptr inbounds ([1 x i16]* @g_455, i32 0, i32 0), align 2, !dbg !961
+ ret i32* %p_37, !dbg !962
+}
+
+; Function Attrs: nounwind
+define internal fastcc i32* @func_45(i32* %p_46, %struct.S3* byval nocapture %p_47) #0 {
+ tail call void @llvm.dbg.value(metadata !{i32* %p_46}, i64 0, metadata !963), !dbg !964
+ tail call void @llvm.dbg.declare(metadata !{%struct.S3* %p_47}, metadata !965), !dbg !964
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !966), !dbg !967
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !968), !dbg !969
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !970), !dbg !971
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !972), !dbg !973
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !974), !dbg !975
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !976), !dbg !977
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !978), !dbg !979
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !980), !dbg !981
+ tail call void @llvm.dbg.value(metadata !982, i64 0, metadata !983), !dbg !984
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !985), !dbg !986
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !987), !dbg !988
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !989), !dbg !990
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !991), !dbg !992
+ tail call void @llvm.dbg.value(metadata !993, i64 0, metadata !994), !dbg !995
+ tail call void @llvm.dbg.declare(metadata !996, metadata !997), !dbg !998
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !999), !dbg !1000
+ tail call void @llvm.dbg.value(metadata !1001, i64 0, metadata !1002), !dbg !1003
+ tail call void @llvm.dbg.value(metadata !1004, i64 0, metadata !1005), !dbg !1006
+ tail call void @llvm.dbg.declare(metadata !1007, metadata !1008), !dbg !1011
+ tail call void @llvm.dbg.declare(metadata !1012, metadata !1013), !dbg !1014
+ tail call void @llvm.dbg.value(metadata !1015, i64 0, metadata !994), !dbg !1016
+ store i16 13, i16* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 3), align 2, !dbg !1017
+ ret i32* %p_46, !dbg !1019
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @safe_add_func_uint8_t_u_u(i8 zeroext %ui1) #4 {
+ tail call void @llvm.dbg.value(metadata !1020, i64 0, metadata !1021), !dbg !1022
+ %1 = add i8 %ui1, -22, !dbg !1023
+ ret i8 %1, !dbg !1023
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @safe_add_func_int16_t_s_s(i16 signext %si1, i16 signext %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %si1}, i64 0, metadata !1024), !dbg !1025
+ tail call void @llvm.dbg.value(metadata !{i16 %si2}, i64 0, metadata !1026), !dbg !1025
+ %1 = add i16 %si2, %si1, !dbg !1027
+ ret i16 %1, !dbg !1027
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_lshift_func_uint16_t_u_s(i16 zeroext %left) #4 {
+ tail call void @llvm.dbg.value(metadata !1028, i64 0, metadata !1029), !dbg !1030
+ %1 = icmp ugt i16 %left, 4095, !dbg !1031
+ %2 = shl i16 %left, 4, !dbg !1031
+ %.off0 = select i1 %1, i16 %left, i16 %2, !dbg !1031
+ ret i16 %.off0, !dbg !1031
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_rshift_func_uint16_t_u_u(i16 zeroext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %left}, i64 0, metadata !1032), !dbg !1033
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1034), !dbg !1033
+ %1 = icmp ugt i32 %right, 31, !dbg !1035
+ br i1 %1, label %5, label %2, !dbg !1035
+
+; <label>:2 ; preds = %0
+ %3 = zext i16 %left to i32, !dbg !1035
+ %4 = lshr i32 %3, %right, !dbg !1035
+ %extract.t = trunc i32 %4 to i16, !dbg !1035
+ br label %5, !dbg !1035
+
+; <label>:5 ; preds = %2, %0
+ %.off0 = phi i16 [ %extract.t, %2 ], [ %left, %0 ]
+ ret i16 %.off0, !dbg !1035
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_lshift_func_uint8_t_u_s() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @safe_div_func_int32_t_s_s(i32 %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !1036), !dbg !1037
+ ret i32 0, !dbg !1038
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @safe_rshift_func_int8_t_s_u(i8 signext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %left}, i64 0, metadata !1039), !dbg !1040
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1041), !dbg !1040
+ %1 = icmp slt i8 %left, 0, !dbg !1042
+ %2 = icmp ugt i32 %right, 31, !dbg !1042
+ %or.cond = or i1 %1, %2, !dbg !1042
+ br i1 %or.cond, label %6, label %3, !dbg !1042
+
+; <label>:3 ; preds = %0
+ %4 = sext i8 %left to i32, !dbg !1042
+ %5 = ashr i32 %4, %right, !dbg !1042
+ %extract.t1 = trunc i32 %5 to i8, !dbg !1042
+ br label %6, !dbg !1042
+
+; <label>:6 ; preds = %3, %0
+ %.off0 = phi i8 [ %extract.t1, %3 ], [ %left, %0 ]
+ ret i8 %.off0, !dbg !1042
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @safe_lshift_func_uint8_t_u_u(i8 zeroext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %left}, i64 0, metadata !1043), !dbg !1044
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1045), !dbg !1044
+ %1 = icmp ugt i32 %right, 31, !dbg !1046
+ br i1 %1, label %8, label %2, !dbg !1046
+
+; <label>:2 ; preds = %0
+ %3 = zext i8 %left to i32, !dbg !1046
+ %4 = lshr i32 255, %right, !dbg !1046
+ %5 = icmp sgt i32 %3, %4, !dbg !1046
+ br i1 %5, label %8, label %6, !dbg !1046
+
+; <label>:6 ; preds = %2
+ %7 = shl i32 %3, %right, !dbg !1046
+ %extract.t1 = trunc i32 %7 to i8, !dbg !1046
+ br label %8, !dbg !1046
+
+; <label>:8 ; preds = %6, %2, %0
+ %.off0 = phi i8 [ %extract.t1, %6 ], [ %left, %2 ], [ %left, %0 ]
+ ret i8 %.off0, !dbg !1046
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @safe_mul_func_int16_t_s_s(i16 signext %si1, i16 signext %si2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %si1}, i64 0, metadata !1047), !dbg !1048
+ tail call void @llvm.dbg.value(metadata !{i16 %si2}, i64 0, metadata !1049), !dbg !1048
+ %1 = mul i16 %si2, %si1, !dbg !1050
+ ret i16 %1, !dbg !1050
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_mod_func_uint16_t_u_u(i16 zeroext %ui1, i16 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %ui1}, i64 0, metadata !1051), !dbg !1052
+ tail call void @llvm.dbg.value(metadata !{i16 %ui2}, i64 0, metadata !1053), !dbg !1052
+ %1 = icmp eq i16 %ui2, 0, !dbg !1054
+ br i1 %1, label %4, label %2, !dbg !1054
+
+; <label>:2 ; preds = %0
+ %3 = urem i16 %ui1, %ui2, !dbg !1054
+ br label %4, !dbg !1054
+
+; <label>:4 ; preds = %2, %0
+ %.in = phi i16 [ %3, %2 ], [ %ui1, %0 ]
+ ret i16 %.in, !dbg !1054
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_add_func_uint16_t_u_u(i16 zeroext %ui1, i16 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %ui1}, i64 0, metadata !1055), !dbg !1056
+ tail call void @llvm.dbg.value(metadata !{i16 %ui2}, i64 0, metadata !1057), !dbg !1056
+ %1 = add i16 %ui2, %ui1, !dbg !1058
+ ret i16 %1, !dbg !1058
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @safe_rshift_func_int16_t_s_s(i16 signext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %left}, i64 0, metadata !1060), !dbg !1061
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1062), !dbg !1061
+ %1 = icmp slt i16 %left, 0, !dbg !1063
+ %2 = icmp ugt i32 %right, 31, !dbg !1063
+ %or.cond = or i1 %1, %2, !dbg !1063
+ br i1 %or.cond, label %6, label %3, !dbg !1063
+
+; <label>:3 ; preds = %0
+ %4 = sext i16 %left to i32, !dbg !1063
+ %5 = ashr i32 %4, %right, !dbg !1063
+ %extract.t2 = trunc i32 %5 to i16, !dbg !1063
+ br label %6, !dbg !1063
+
+; <label>:6 ; preds = %3, %0
+ %.off0 = phi i16 [ %extract.t2, %3 ], [ %left, %0 ]
+ ret i16 %.off0, !dbg !1063
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_15(i32 %p_17) #0 {
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !1065), !dbg !1066
+ tail call void @llvm.dbg.value(metadata !1067, i64 0, metadata !1068), !dbg !1066
+ tail call void @llvm.dbg.value(metadata !1069, i64 0, metadata !1070), !dbg !1072
+ tail call void @llvm.dbg.value(metadata !593, i64 0, metadata !1073), !dbg !1074
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !1075), !dbg !1076
+ tail call void @llvm.dbg.declare(metadata !1077, metadata !1078), !dbg !1080
+ tail call void @llvm.dbg.value(metadata !520, i64 0, metadata !1081), !dbg !1082
+ tail call void @llvm.dbg.value(metadata !1083, i64 0, metadata !1084), !dbg !1085
+ tail call void @llvm.dbg.value(metadata !1086, i64 0, metadata !1087), !dbg !1088
+ tail call void @llvm.dbg.value(metadata !1089, i64 0, metadata !1090), !dbg !1091
+ tail call void @llvm.dbg.declare(metadata !1092, metadata !1093), !dbg !1096
+ tail call void @llvm.dbg.value(metadata !1067, i64 0, metadata !1097), !dbg !1098
+ tail call void @llvm.dbg.value(metadata !1099, i64 0, metadata !1100), !dbg !1101
+ tail call void @llvm.dbg.declare(metadata !1102, metadata !1103), !dbg !1107
+ tail call void @llvm.dbg.value(metadata !1108, i64 0, metadata !1109), !dbg !1112
+ tail call void @llvm.dbg.declare(metadata !1113, metadata !1114), !dbg !1115
+ tail call void @llvm.dbg.value(metadata !556, i64 0, metadata !1116), !dbg !1117
+ tail call void @llvm.dbg.value(metadata !1118, i64 0, metadata !1119), !dbg !1121
+ tail call void @llvm.dbg.declare(metadata !1122, metadata !1123), !dbg !1128
+ tail call void @llvm.dbg.value(metadata !2, i64 0, metadata !1129), !dbg !1130
+ store i32 0, i32* @g_52, align 4, !dbg !1132
+ store i16 -5, i16* @g_103, align 2, !dbg !1134
+ tail call void @llvm.dbg.value(metadata !1135, i64 0, metadata !1068), !dbg !1134
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_19(%struct.S3* byval nocapture %p_21) #0 {
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !1136), !dbg !1137
+ tail call void @llvm.dbg.value(metadata !802, i64 0, metadata !1138), !dbg !1137
+ tail call void @llvm.dbg.value(metadata !520, i64 0, metadata !1139), !dbg !1137
+ tail call void @llvm.dbg.value(metadata !1140, i64 0, metadata !1141), !dbg !1143
+ tail call void @llvm.dbg.value(metadata !513, i64 0, metadata !1144), !dbg !1145
+ tail call void @llvm.dbg.value(metadata !799, i64 0, metadata !1146), !dbg !1147
+ tail call void @llvm.dbg.declare(metadata !1148, metadata !1149), !dbg !1151
+ tail call void @llvm.dbg.value(metadata !556, i64 0, metadata !1152), !dbg !1153
+ tail call void @llvm.dbg.value(metadata !1154, i64 0, metadata !1155), !dbg !1156
+ tail call void @llvm.dbg.value(metadata !1157, i64 0, metadata !1158), !dbg !1159
+ tail call void @llvm.dbg.value(metadata !1160, i64 0, metadata !1161), !dbg !1162
+ tail call void @llvm.dbg.value(metadata !1163, i64 0, metadata !1164), !dbg !1165
+ tail call void @llvm.dbg.value(metadata !1140, i64 0, metadata !1141), !dbg !1166
+ tail call void @llvm.dbg.value(metadata !513, i64 0, metadata !1144), !dbg !1167
+ store i32 1, i32* @g_532, align 4, !dbg !1168
+ %1 = load i32* @g_52, align 4, !dbg !1168
+ %2 = xor i32 %1, 1, !dbg !1168
+ store i32 %2, i32* @g_52, align 4, !dbg !1168
+ %3 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 5) to i32*), align 4
+ %4 = shl i32 %3, 8
+ %5 = icmp slt i32 %4, 256
+ %6 = zext i1 %5 to i32
+ %g_532.promoted = load i32* @g_532, align 4
+ %7 = and i32 %6, %g_532.promoted
+ store i32 %7, i32* @g_532, align 4
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc zeroext i8 @func_31() #0 {
+.preheader:
+ %l_33 = alloca [2 x i32], align 4
+ %0 = alloca i64, align 8, !dbg !1169
+ call void @llvm.dbg.value(metadata !802, i64 0, metadata !1173), !dbg !1174
+ call void @llvm.dbg.declare(metadata !{[2 x i32]* %l_33}, metadata !1175), !dbg !1177
+ call void @llvm.dbg.declare(metadata !1178, metadata !1179), !dbg !1180
+ call void @llvm.dbg.declare(metadata !1181, metadata !1182), !dbg !1184
+ call void @llvm.dbg.value(metadata !556, i64 0, metadata !1185), !dbg !1186
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !1187), !dbg !1188
+ %1 = getelementptr inbounds [2 x i32]* %l_33, i32 0, i32 0, !dbg !1190
+ store i32 -10, i32* %1, align 4, !dbg !1190
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !1187), !dbg !1188
+ %2 = getelementptr inbounds [2 x i32]* %l_33, i32 0, i32 1, !dbg !1190
+ store i32 -10, i32* %2, align 4, !dbg !1190
+ call void @llvm.dbg.value(metadata !308, i64 0, metadata !1187), !dbg !1188
+ %tmpcast = bitcast i64* %0 to %struct.S3*, !dbg !1169
+ store i32 1, i32* @g_5, align 4, !dbg !1191
+ br label %3, !dbg !1191
+
+; <label>:3 ; preds = %3, %.preheader
+ %storemerge2 = phi i32 [ 1, %.preheader ], [ %10, %3 ]
+ call void @llvm.dbg.value(metadata !1178, i64 0, metadata !1192), !dbg !1193
+ call void @llvm.dbg.value(metadata !593, i64 0, metadata !1194), !dbg !1195
+ call void @llvm.dbg.value(metadata !1196, i64 0, metadata !1197), !dbg !1198
+ call void @llvm.dbg.value(metadata !1199, i64 0, metadata !1200), !dbg !1202
+ %4 = getelementptr inbounds [2 x i32]* %l_33, i32 0, i32 %storemerge2, !dbg !1169
+ %5 = load i32* %4, align 4, !dbg !1169
+ %6 = load i64* bitcast (%struct.S3* @g_25 to i64*), align 8, !dbg !1169
+ store i64 %6, i64* bitcast (%struct.S3* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 3) to i64*), align 8, !dbg !1169
+ store i64 %6, i64* %0, align 8, !dbg !1169
+ %7 = call fastcc i32* @func_45(i32* null, %struct.S3* byval %tmpcast), !dbg !1169
+ call fastcc void @func_38(%struct.S3* byval @func_31.l_43, i32 %5, i32* %7, %struct.S1* byval @func_31.l_167), !dbg !1169
+ %8 = call fastcc i32* @func_34(%union.U4* byval getelementptr inbounds ([7 x %union.U4]* @func_31.l_406, i32 0, i32 3), i32* null), !dbg !1169
+ store i32* %8, i32** @g_304, align 4, !dbg !1169
+ store i8 2, i8* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 2), align 4, !dbg !1203
+ %9 = load i32* @g_5, align 4, !dbg !1191
+ %10 = add nsw i32 %9, -1, !dbg !1191
+ store i32 %10, i32* @g_5, align 4, !dbg !1191
+ %11 = icmp sgt i32 %9, 0, !dbg !1191
+ br i1 %11, label %3, label %12, !dbg !1191
+
+; <label>:12 ; preds = %3
+ %13 = load i8* @g_467, align 1, !dbg !1205
+ %14 = add i8 %13, 1, !dbg !1205
+ store i8 %14, i8* @g_467, align 1, !dbg !1205
+ ret i8 %14, !dbg !1206
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @safe_mul_func_uint16_t_u_u(i16 zeroext %ui1, i16 zeroext %ui2) #4 {
+ tail call void @llvm.dbg.value(metadata !{i16 %ui1}, i64 0, metadata !1207), !dbg !1208
+ tail call void @llvm.dbg.value(metadata !{i16 %ui2}, i64 0, metadata !1209), !dbg !1208
+ %1 = mul i16 %ui2, %ui1, !dbg !1210
+ ret i16 %1, !dbg !1210
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_div_func_int16_t_s_s() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_lshift_func_int16_t_s_s() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_add_func_uint32_t_u_u() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_unary_minus_func_uint32_t_u() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_div_func_uint32_t_u_u() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @safe_rshift_func_uint8_t_u_s(i8 zeroext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %left}, i64 0, metadata !1211), !dbg !1212
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1213), !dbg !1212
+ %1 = icmp ugt i32 %right, 31, !dbg !1214
+ br i1 %1, label %5, label %2, !dbg !1214
+
+; <label>:2 ; preds = %0
+ %3 = zext i8 %left to i32, !dbg !1214
+ %4 = lshr i32 %3, %right, !dbg !1214
+ %extract.t = trunc i32 %4 to i8, !dbg !1214
+ br label %5, !dbg !1214
+
+; <label>:5 ; preds = %2, %0
+ %.off0 = phi i8 [ %extract.t, %2 ], [ %left, %0 ]
+ ret i8 %.off0, !dbg !1214
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @func_38(%struct.S3* byval nocapture %p_39, i32 %p_40, i32* %p_41, %struct.S1* byval nocapture %p_42) #0 {
+ call void @llvm.dbg.value(metadata !{i32* %p_41}, i64 0, metadata !1215), !dbg !1216
+ call void @llvm.dbg.value(metadata !1217, i64 0, metadata !1218), !dbg !1219
+ call void @llvm.dbg.value(metadata !802, i64 0, metadata !1220), !dbg !1221
+ call void @llvm.dbg.value(metadata !1222, i64 0, metadata !1223), !dbg !1224
+ call void @llvm.dbg.declare(metadata !1225, metadata !1226), !dbg !1227
+ call void @llvm.dbg.value(metadata !1228, i64 0, metadata !1229), !dbg !1231
+ call void @llvm.dbg.value(metadata !1232, i64 0, metadata !1233), !dbg !1234
+ call void @llvm.dbg.value(metadata !1235, i64 0, metadata !1236), !dbg !1237
+ call void @llvm.dbg.value(metadata !1238, i64 0, metadata !1239), !dbg !1240
+ call void @llvm.dbg.value(metadata !1241, i64 0, metadata !1242), !dbg !1243
+ call void @llvm.dbg.declare(metadata !1244, metadata !1245), !dbg !1246
+ call void @llvm.dbg.declare(metadata !1247, metadata !1248), !dbg !1249
+ call void @llvm.dbg.value(metadata !1250, i64 0, metadata !1251), !dbg !1252
+ call void @llvm.dbg.value(metadata !1253, i64 0, metadata !1254), !dbg !1255
+ call void @llvm.dbg.declare(metadata !679, metadata !1256), !dbg !1258
+ call void @llvm.dbg.value(metadata !1259, i64 0, metadata !1260), !dbg !1261
+ call void @llvm.dbg.value(metadata !2, i64 0, metadata !1262), !dbg !1263
+ %1 = getelementptr inbounds %struct.S3* %p_39, i32 0, i32 0, !dbg !1265
+ %2 = load i32* %1, align 4, !dbg !1265
+ %3 = trunc i32 %2 to i16, !dbg !1265
+ %4 = load i32* @g_52, align 4, !dbg !1265
+ %5 = load i32* bitcast (i8* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 5) to i32*), align 4, !dbg !1265
+ %6 = shl i32 %5, 8, !dbg !1265
+ %7 = ashr exact i32 %6, 8, !dbg !1265
+ %8 = icmp sle i32 %4, %7, !dbg !1265
+ %9 = zext i1 %8 to i16, !dbg !1265
+ %10 = call fastcc zeroext i16 @safe_add_func_uint16_t_u_u(i16 zeroext %3, i16 zeroext %9), !dbg !1265
+ %11 = trunc i16 %10 to i8, !dbg !1265
+ %12 = call fastcc signext i8 @safe_rshift_func_int8_t_s_u(i8 signext %11, i32 5), !dbg !1265
+ %13 = icmp eq i8 %12, 0, !dbg !1265
+ br i1 %13, label %14, label %17, !dbg !1265
+
+; <label>:14 ; preds = %0
+ %15 = load i16* @g_103, align 2, !dbg !1265
+ %16 = icmp ne i16 %15, 0, !dbg !1265
+ %phitmp = zext i1 %16 to i32, !dbg !1265
+ br label %17, !dbg !1265
+
+; <label>:17 ; preds = %14, %0
+ %18 = phi i32 [ 1, %0 ], [ %phitmp, %14 ]
+ store i32 %18, i32* getelementptr inbounds ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, i32 0, i32 0), align 4, !dbg !1265
+ %19 = getelementptr inbounds %struct.S1* %p_42, i32 0, i32 0, !dbg !1266
+ %20 = load i32* %19, align 4, !dbg !1266
+ %21 = trunc i32 %20 to i8, !dbg !1266
+ store i8 %21, i8* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 2), align 4, !dbg !1266
+ call void @llvm.dbg.value(metadata !1267, i64 0, metadata !1268), !dbg !1270
+ call void @llvm.dbg.value(metadata !1271, i64 0, metadata !1272), !dbg !1273
+ call void @llvm.dbg.value(metadata !901, i64 0, metadata !1274), !dbg !1275
+ call void @llvm.dbg.declare(metadata !1244, metadata !1276), !dbg !1277
+ call void @llvm.dbg.declare(metadata !1278, metadata !1279), !dbg !1282
+ br label %.backedge, !dbg !1283
+
+.backedge: ; preds = %.backedge, %17
+ store i32 0, i32* @g_52, align 4, !dbg !1284
+ %22 = load i32* getelementptr inbounds (%union.U4* @g_183, i32 0, i32 0), align 4, !dbg !1286
+ %23 = icmp eq i32 %22, 0, !dbg !1286
+ br i1 %23, label %24, label %.backedge, !dbg !1286
+
+; <label>:24 ; preds = %.backedge
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @safe_div_func_uint8_t_u_u() #0 {
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @safe_lshift_func_int8_t_s_u(i8 signext %left, i32 %right) #4 {
+ tail call void @llvm.dbg.value(metadata !{i8 %left}, i64 0, metadata !1287), !dbg !1288
+ tail call void @llvm.dbg.value(metadata !{i32 %right}, i64 0, metadata !1289), !dbg !1288
+ %1 = sext i8 %left to i32, !dbg !1290
+ %2 = icmp slt i8 %left, 0, !dbg !1290
+ %3 = icmp ugt i32 %right, 31, !dbg !1290
+ %or.cond = or i1 %2, %3, !dbg !1290
+ %4 = lshr i32 127, %right, !dbg !1290
+ %5 = icmp sgt i32 %1, %4, !dbg !1290
+ %or.cond3 = or i1 %or.cond, %5, !dbg !1290
+ br i1 %or.cond3, label %8, label %6, !dbg !1290
+
+; <label>:6 ; preds = %0
+ %7 = shl i32 %1, %right, !dbg !1290
+ %extract.t1 = trunc i32 %7 to i8, !dbg !1290
+ br label %8, !dbg !1290
+
+; <label>:8 ; preds = %6, %0
+ %.off0 = phi i8 [ %extract.t1, %6 ], [ %left, %0 ]
+ ret i8 %.off0, !dbg !1290
+}
+
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata) #1
+
+attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone }
+attributes #2 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #3 = { nounwind }
+attributes #4 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!llvm.dbg.cu = !{!0}
+
+!0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.3 (https://chromium.googlesource.com/native_client/pnacl-clang a963b803407c9d1cac644cc425004e0ccd28fa45) (https://chromium.googlesource.com/native_client/pnacl-llvm git@github.com:kripken/emscripten-fastcomp.git eea5cbe96fc5c5c2796c3ab3ea64f50fe350f75b)", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !180, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c] [DW_LANG_C99]
+!1 = metadata !{metadata !"newfail1.c", metadata !"/home/alon/Dev/emscripten/tests/fuzz"}
+!2 = metadata !{i32 0}
+!3 = metadata !{metadata !4, metadata !12, metadata !20, metadata !26, metadata !29, metadata !34, metadata !41, metadata !47, metadata !51, metadata !56, metadata !61, metadata !62, metadata !65, metadata !68, metadata !71, metadata !74, metadata !79, metadata !82, metadata !89, metadata !92, metadata !93, metadata !94, metadata !95, metadata !98, metadata !99, metadata !102, metadata !105, metadata !106, metadata !107, metadata !108, metadata !111, metadata !114, metadata !117, metadata !118, metadata !119, metadata !120, metadata !121, metadata !122, metadata !123, metadata !124, metadata !125, metadata !137, metadata !138, metadata !139, metadata !140, metadata !143, metadata !144, metadata !145, metadata !146, metadata !147, metadata !148, metadata !151, metadata !162, metadata !163, metadata !164, metadata !168, metadata !169, metadata !172, metadata !175, metadata !176, metadata !179}
+!4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"main", metadata !"main", metadata !"", i32 1057, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32, i8**)* @main, null, null, metadata !2, i32 1058} ; [ DW_TAG_subprogram ] [line 1057] [def] [scope 1058] [main]
+!5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!6 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !7, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!7 = metadata !{metadata !8, metadata !8, metadata !9}
+!8 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
+!9 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!10 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !11} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from char]
+!11 = metadata !{i32 786468, null, null, metadata !"char", i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
+!12 = metadata !{i32 786478, metadata !13, metadata !14, metadata !"platform_main_end", metadata !"platform_main_end", metadata !"", i32 50, metadata !15, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i32)* @platform_main_end, null, null, metadata !2, i32 51} ; [ DW_TAG_subprogram ] [line 50] [local] [def] [scope 51] [platform_main_end]
+!13 = metadata !{metadata !"./platform_generic.h", metadata !"/home/alon/Dev/emscripten/tests/fuzz"}
+!14 = metadata !{i32 786473, metadata !13} ; [ DW_TAG_file_type ] [/home/alon/Dev/emscripten/tests/fuzz/./platform_generic.h]
+!15 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !16, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!16 = metadata !{null, metadata !17, metadata !8}
+!17 = metadata !{i32 786454, metadata !18, null, metadata !"uint32_t", i32 182, i64 0, i64 0, i64 0, i32 0, metadata !19} ; [ DW_TAG_typedef ] [uint32_t] [line 182, size 0, align 0, offset 0] [from unsigned int]
+!18 = metadata !{metadata !"./csmith.h", metadata !"/home/alon/Dev/emscripten/tests/fuzz"}
+!19 = metadata !{i32 786468, null, null, metadata !"unsigned int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] [unsigned int] [line 0, size 32, align 32, offset 0, enc DW_ATE_unsigned]
+!20 = metadata !{i32 786478, metadata !18, metadata !21, metadata !"transparent_crc", metadata !"transparent_crc", metadata !"", i32 108, metadata !22, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i64, i8*, i32)* @transparent_crc, null, null, metadata !2, i32 109} ; [ DW_TAG_subprogram ] [line 108] [local] [def] [scope 109] [transparent_crc]
+!21 = metadata !{i32 786473, metadata !18} ; [ DW_TAG_file_type ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!22 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !23, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!23 = metadata !{null, metadata !24, metadata !10, metadata !8}
+!24 = metadata !{i32 786454, metadata !18, null, metadata !"uint64_t", i32 187, i64 0, i64 0, i64 0, i32 0, metadata !25} ; [ DW_TAG_typedef ] [uint64_t] [line 187, size 0, align 0, offset 0] [from long long unsigned int]
+!25 = metadata !{i32 786468, null, null, metadata !"long long unsigned int", i32 0, i64 64, i64 64, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] [long long unsigned int] [line 0, size 64, align 64, offset 0, enc DW_ATE_unsigned]
+!26 = metadata !{i32 786478, metadata !18, metadata !21, metadata !"crc32_8bytes", metadata !"crc32_8bytes", metadata !"", i32 95, metadata !27, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i64)* @crc32_8bytes, null, null, metadata !2, i32 96} ; [ DW_TAG_subprogram ] [line 95] [local] [def] [scope 96] [crc32_8bytes]
+!27 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !28, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!28 = metadata !{null, metadata !24}
+!29 = metadata !{i32 786478, metadata !18, metadata !21, metadata !"crc32_byte", metadata !"crc32_byte", metadata !"", i32 69, metadata !30, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i8)* @crc32_byte, null, null, metadata !2, i32 69} ; [ DW_TAG_subprogram ] [line 69] [local] [def] [crc32_byte]
+!30 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !31, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!31 = metadata !{null, metadata !32}
+!32 = metadata !{i32 786454, metadata !1, null, metadata !"uint8_t", i32 172, i64 0, i64 0, i64 0, i32 0, metadata !33} ; [ DW_TAG_typedef ] [uint8_t] [line 172, size 0, align 0, offset 0] [from unsigned char]
+!33 = metadata !{i32 786468, null, null, metadata !"unsigned char", i32 0, i64 8, i64 8, i64 0, i32 0, i32 8} ; [ DW_TAG_base_type ] [unsigned char] [line 0, size 8, align 8, offset 0, enc DW_ATE_unsigned_char]
+!34 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_1", metadata !"func_1", metadata !"", i32 130, metadata !35, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.S3*)* @func_1, null, null, metadata !2, i32 131} ; [ DW_TAG_subprogram ] [line 130] [local] [def] [scope 131] [func_1]
+!35 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !36, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!36 = metadata !{metadata !37}
+!37 = metadata !{i32 786451, metadata !1, null, metadata !"S3", i32 39, i64 64, i64 32, i32 0, i32 0, null, metadata !38, i32 0, null, null} ; [ DW_TAG_structure_type ] [S3] [line 39, size 64, align 32, offset 0] [from ]
+!38 = metadata !{metadata !39, metadata !40}
+!39 = metadata !{i32 786445, metadata !1, metadata !37, metadata !"f0", i32 40, i64 32, i64 32, i64 0, i32 0, metadata !17} ; [ DW_TAG_member ] [f0] [line 40, size 32, align 32, offset 0] [from uint32_t]
+!40 = metadata !{i32 786445, metadata !1, metadata !37, metadata !"f1", i32 41, i64 32, i64 32, i64 32, i32 0, metadata !17} ; [ DW_TAG_member ] [f1] [line 41, size 32, align 32, offset 32] [from uint32_t]
+!41 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_2", metadata !"func_2", metadata !"", i32 144, metadata !42, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i8)* @func_2, null, null, metadata !2, i32 145} ; [ DW_TAG_subprogram ] [line 144] [local] [def] [scope 145] [func_2]
+!42 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !43, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!43 = metadata !{metadata !44, metadata !32, metadata !45}
+!44 = metadata !{i32 786454, metadata !1, null, metadata !"int32_t", i32 157, i64 0, i64 0, i64 0, i32 0, metadata !8} ; [ DW_TAG_typedef ] [int32_t] [line 157, size 0, align 0, offset 0] [from int]
+!45 = metadata !{i32 786454, metadata !1, null, metadata !"uint16_t", i32 177, i64 0, i64 0, i64 0, i32 0, metadata !46} ; [ DW_TAG_typedef ] [uint16_t] [line 177, size 0, align 0, offset 0] [from unsigned short]
+!46 = metadata !{i32 786468, null, null, metadata !"unsigned short", i32 0, i64 16, i64 16, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ] [unsigned short] [line 0, size 16, align 16, offset 0, enc DW_ATE_unsigned]
+!47 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_45", metadata !"func_45", metadata !"", i32 933, metadata !48, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32* (i32*, %struct.S3*)* @func_45, null, null, metadata !2, i32 934} ; [ DW_TAG_subprogram ] [line 933] [local] [def] [scope 934] [func_45]
+!48 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !49, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!49 = metadata !{metadata !50, metadata !50, metadata !37}
+!50 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !44} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from int32_t]
+!51 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_uint32_t_u_u", metadata !"safe_sub_func_uint32_t_u_u", metadata !"", i32 757, metadata !54, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 758} ; [ DW_TAG_subprogram ] [line 757] [local] [def] [scope 758] [safe_sub_func_uint32_t_u_u]
+!52 = metadata !{metadata !"./safe_math.h", metadata !"/home/alon/Dev/emscripten/tests/fuzz"}
+!53 = metadata !{i32 786473, metadata !52} ; [ DW_TAG_file_type ] [/home/alon/Dev/emscripten/tests/fuzz/./safe_math.h]
+!54 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !55, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!55 = metadata !{metadata !17, metadata !17, metadata !17}
+!56 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_int8_t_s_s", metadata !"safe_div_func_int8_t_s_s", metadata !"", i32 82, metadata !57, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 83} ; [ DW_TAG_subprogram ] [line 82] [local] [def] [scope 83] [safe_div_func_int8_t_s_s]
+!57 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !58, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!58 = metadata !{metadata !59, metadata !59, metadata !59}
+!59 = metadata !{i32 786454, metadata !1, null, metadata !"int8_t", i32 147, i64 0, i64 0, i64 0, i32 0, metadata !60} ; [ DW_TAG_typedef ] [int8_t] [line 147, size 0, align 0, offset 0] [from signed char]
+!60 = metadata !{i32 786468, null, null, metadata !"signed char", i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] [signed char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
+!61 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_int8_t_s_s", metadata !"safe_sub_func_int8_t_s_s", metadata !"", i32 42, metadata !57, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 43} ; [ DW_TAG_subprogram ] [line 42] [local] [def] [scope 43] [safe_sub_func_int8_t_s_s]
+!62 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_int32_t_s_s", metadata !"safe_div_func_int32_t_s_s", metadata !"", i32 342, metadata !63, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @safe_div_func_int32_t_s_s, null, null, metadata !2, i32 343} ; [ DW_TAG_subprogram ] [line 342] [local] [def] [scope 343] [safe_div_func_int32_t_s_s]
+!63 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !64, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!64 = metadata !{metadata !44, metadata !44, metadata !44}
+!65 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_uint8_t_u_s", metadata !"safe_lshift_func_uint8_t_u_s", metadata !"", i32 591, metadata !66, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_lshift_func_uint8_t_u_s, null, null, metadata !2, i32 592} ; [ DW_TAG_subprogram ] [line 591] [local] [def] [scope 592] [safe_lshift_func_uint8_t_u_s]
+!66 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !67, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!67 = metadata !{metadata !32, metadata !32, metadata !8}
+!68 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_uint16_t_u_u", metadata !"safe_rshift_func_uint16_t_u_u", metadata !"", i32 729, metadata !69, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i32)* @safe_rshift_func_uint16_t_u_u, null, null, metadata !2, i32 730} ; [ DW_TAG_subprogram ] [line 729] [local] [def] [scope 730] [safe_rshift_func_uint16_t_u_u]
+!69 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !70, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!70 = metadata !{metadata !45, metadata !45, metadata !19}
+!71 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_uint16_t_u_s", metadata !"safe_lshift_func_uint16_t_u_s", metadata !"", i32 693, metadata !72, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16)* @safe_lshift_func_uint16_t_u_s, null, null, metadata !2, i32 694} ; [ DW_TAG_subprogram ] [line 693] [local] [def] [scope 694] [safe_lshift_func_uint16_t_u_s]
+!72 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !73, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!73 = metadata !{metadata !45, metadata !45, metadata !8}
+!74 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_int16_t_s_s", metadata !"safe_add_func_int16_t_s_s", metadata !"", i32 158, metadata !75, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_add_func_int16_t_s_s, null, null, metadata !2, i32 159} ; [ DW_TAG_subprogram ] [line 158] [local] [def] [scope 159] [safe_add_func_int16_t_s_s]
+!75 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !76, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!76 = metadata !{metadata !77, metadata !77, metadata !77}
+!77 = metadata !{i32 786454, metadata !1, null, metadata !"int16_t", i32 152, i64 0, i64 0, i64 0, i32 0, metadata !78} ; [ DW_TAG_typedef ] [int16_t] [line 152, size 0, align 0, offset 0] [from short]
+!78 = metadata !{i32 786468, null, null, metadata !"short", i32 0, i64 16, i64 16, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [short] [line 0, size 16, align 16, offset 0, enc DW_ATE_signed]
+!79 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_uint8_t_u_u", metadata !"safe_add_func_uint8_t_u_u", metadata !"", i32 546, metadata !80, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8)* @safe_add_func_uint8_t_u_u, null, null, metadata !2, i32 547} ; [ DW_TAG_subprogram ] [line 546] [local] [def] [scope 547] [safe_add_func_uint8_t_u_u]
+!80 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !81, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!81 = metadata !{metadata !32, metadata !32, metadata !32}
+!82 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_34", metadata !"func_34", metadata !"", i32 653, metadata !83, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32* (%union.U4*, i32*)* @func_34, null, null, metadata !2, i32 654} ; [ DW_TAG_subprogram ] [line 653] [local] [def] [scope 654] [func_34]
+!83 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !84, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!84 = metadata !{metadata !50, metadata !50, metadata !85, metadata !50}
+!85 = metadata !{i32 786455, metadata !1, null, metadata !"U4", i32 44, i64 32, i64 32, i64 0, i32 0, null, metadata !86, i32 0, i32 0, null} ; [ DW_TAG_union_type ] [U4] [line 44, size 32, align 32, offset 0] [from ]
+!86 = metadata !{metadata !87}
+!87 = metadata !{i32 786445, metadata !1, metadata !85, metadata !"f0", i32 45, i64 32, i64 32, i64 0, i32 0, metadata !88} ; [ DW_TAG_member ] [f0] [line 45, size 32, align 32, offset 0] [from ]
+!88 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !44} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from int32_t]
+!89 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_uint16_t_u_u", metadata !"safe_add_func_uint16_t_u_u", metadata !"", i32 648, metadata !90, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_add_func_uint16_t_u_u, null, null, metadata !2, i32 649} ; [ DW_TAG_subprogram ] [line 648] [local] [def] [scope 649] [safe_add_func_uint16_t_u_u]
+!90 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !91, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!91 = metadata !{metadata !45, metadata !45, metadata !45}
+!92 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_uint16_t_u_u", metadata !"safe_lshift_func_uint16_t_u_u", metadata !"", i32 705, metadata !69, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 706} ; [ DW_TAG_subprogram ] [line 705] [local] [def] [scope 706] [safe_lshift_func_uint16_t_u_u]
+!93 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_uint16_t_u_u", metadata !"safe_mod_func_uint16_t_u_u", metadata !"", i32 669, metadata !90, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_mod_func_uint16_t_u_u, null, null, metadata !2, i32 670} ; [ DW_TAG_subprogram ] [line 669] [local] [def] [scope 670] [safe_mod_func_uint16_t_u_u]
+!94 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mul_func_int16_t_s_s", metadata !"safe_mul_func_int16_t_s_s", metadata !"", i32 186, metadata !75, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_mul_func_int16_t_s_s, null, null, metadata !2, i32 187} ; [ DW_TAG_subprogram ] [line 186] [local] [def] [scope 187] [safe_mul_func_int16_t_s_s]
+!95 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_uint8_t_u_u", metadata !"safe_lshift_func_uint8_t_u_u", metadata !"", i32 603, metadata !96, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i32)* @safe_lshift_func_uint8_t_u_u, null, null, metadata !2, i32 604} ; [ DW_TAG_subprogram ] [line 603] [local] [def] [scope 604] [safe_lshift_func_uint8_t_u_u]
+!96 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !97, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!97 = metadata !{metadata !32, metadata !32, metadata !19}
+!98 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_uint8_t_u_u", metadata !"safe_mod_func_uint8_t_u_u", metadata !"", i32 567, metadata !80, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 568} ; [ DW_TAG_subprogram ] [line 567] [local] [def] [scope 568] [safe_mod_func_uint8_t_u_u]
+!99 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_int16_t_s_u", metadata !"safe_rshift_func_int16_t_s_u", metadata !"", i32 260, metadata !100, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 261} ; [ DW_TAG_subprogram ] [line 260] [local] [def] [scope 261] [safe_rshift_func_int16_t_s_u]
+!100 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !101, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!101 = metadata !{metadata !77, metadata !77, metadata !19}
+!102 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_int8_t_s_u", metadata !"safe_rshift_func_int8_t_s_u", metadata !"", i32 130, metadata !103, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i32)* @safe_rshift_func_int8_t_s_u, null, null, metadata !2, i32 131} ; [ DW_TAG_subprogram ] [line 130] [local] [def] [scope 131] [safe_rshift_func_int8_t_s_u]
+!103 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !104, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!104 = metadata !{metadata !59, metadata !59, metadata !19}
+!105 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_uint16_t_u_u", metadata !"safe_div_func_uint16_t_u_u", metadata !"", i32 681, metadata !90, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_div_func_uint16_t_u_u, null, null, metadata !2, i32 682} ; [ DW_TAG_subprogram ] [line 681] [local] [def] [scope 682] [safe_div_func_uint16_t_u_u]
+!106 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_int8_t_s_s", metadata !"safe_mod_func_int8_t_s_s", metadata !"", i32 70, metadata !57, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 71} ; [ DW_TAG_subprogram ] [line 70] [local] [def] [scope 71] [safe_mod_func_int8_t_s_s]
+!107 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mul_func_int8_t_s_s", metadata !"safe_mul_func_int8_t_s_s", metadata !"", i32 56, metadata !57, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i8)* @safe_mul_func_int8_t_s_s, null, null, metadata !2, i32 57} ; [ DW_TAG_subprogram ] [line 56] [local] [def] [scope 57] [safe_mul_func_int8_t_s_s]
+!108 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_int8_t_s_s", metadata !"safe_rshift_func_int8_t_s_s", metadata !"", i32 118, metadata !109, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 119} ; [ DW_TAG_subprogram ] [line 118] [local] [def] [scope 119] [safe_rshift_func_int8_t_s_s]
+!109 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !110, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!110 = metadata !{metadata !59, metadata !59, metadata !8}
+!111 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_26", metadata !"func_26", metadata !"", i32 461, metadata !112, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.S3*, i32, i32*)* @func_26, null, null, metadata !2, i32 462} ; [ DW_TAG_subprogram ] [line 461] [local] [def] [scope 462] [func_26]
+!112 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !113, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!113 = metadata !{metadata !37, metadata !44, metadata !50}
+!114 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_int16_t_s_s", metadata !"safe_rshift_func_int16_t_s_s", metadata !"", i32 248, metadata !115, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i32)* @safe_rshift_func_int16_t_s_s, null, null, metadata !2, i32 249} ; [ DW_TAG_subprogram ] [line 248] [local] [def] [scope 249] [safe_rshift_func_int16_t_s_s]
+!115 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !116, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!116 = metadata !{metadata !77, metadata !77, metadata !8}
+!117 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_int32_t_s_s", metadata !"safe_sub_func_int32_t_s_s", metadata !"", i32 302, metadata !63, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32, i32)* @safe_sub_func_int32_t_s_s, null, null, metadata !2, i32 303} ; [ DW_TAG_subprogram ] [line 302] [local] [def] [scope 303] [safe_sub_func_int32_t_s_s]
+!118 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_uint32_t_u_u", metadata !"safe_mod_func_uint32_t_u_u", metadata !"", i32 771, metadata !54, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32, i32)* @safe_mod_func_uint32_t_u_u, null, null, metadata !2, i32 772} ; [ DW_TAG_subprogram ] [line 771] [local] [def] [scope 772] [safe_mod_func_uint32_t_u_u]
+!119 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_uint16_t_u_s", metadata !"safe_rshift_func_uint16_t_u_s", metadata !"", i32 717, metadata !72, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i32)* @safe_rshift_func_uint16_t_u_s, null, null, metadata !2, i32 718} ; [ DW_TAG_subprogram ] [line 717] [local] [def] [scope 718] [safe_rshift_func_uint16_t_u_s]
+!120 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_int8_t_s_s", metadata !"safe_lshift_func_int8_t_s_s", metadata !"", i32 94, metadata !109, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i32)* @safe_lshift_func_int8_t_s_s, null, null, metadata !2, i32 95} ; [ DW_TAG_subprogram ] [line 94] [local] [def] [scope 95] [safe_lshift_func_int8_t_s_s]
+!121 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_int16_t_s_s", metadata !"safe_mod_func_int16_t_s_s", metadata !"", i32 200, metadata !75, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 201} ; [ DW_TAG_subprogram ] [line 200] [local] [def] [scope 201] [safe_mod_func_int16_t_s_s]
+!122 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_int32_t_s_s", metadata !"safe_add_func_int32_t_s_s", metadata !"", i32 288, metadata !63, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 289} ; [ DW_TAG_subprogram ] [line 288] [local] [def] [scope 289] [safe_add_func_int32_t_s_s]
+!123 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mul_func_uint8_t_u_u", metadata !"safe_mul_func_uint8_t_u_u", metadata !"", i32 560, metadata !80, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i8)* @safe_mul_func_uint8_t_u_u, null, null, metadata !2, i32 561} ; [ DW_TAG_subprogram ] [line 560] [local] [def] [scope 561] [safe_mul_func_uint8_t_u_u]
+!124 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_uint16_t_u_u", metadata !"safe_sub_func_uint16_t_u_u", metadata !"", i32 655, metadata !90, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_sub_func_uint16_t_u_u, null, null, metadata !2, i32 656} ; [ DW_TAG_subprogram ] [line 655] [local] [def] [scope 656] [safe_sub_func_uint16_t_u_u]
+!125 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_10", metadata !"func_10", metadata !"", i32 194, metadata !126, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.S0*, i8)* @func_10, null, null, metadata !2, i32 195} ; [ DW_TAG_subprogram ] [line 194] [local] [def] [scope 195] [func_10]
+!126 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !127, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!127 = metadata !{metadata !128, metadata !32, metadata !17}
+!128 = metadata !{i32 786451, metadata !1, null, metadata !"S0", i32 16, i64 192, i64 32, i32 0, i32 0, null, metadata !129, i32 0, null, null} ; [ DW_TAG_structure_type ] [S0] [line 16, size 192, align 32, offset 0] [from ]
+!129 = metadata !{metadata !130, metadata !131, metadata !132, metadata !133, metadata !134, metadata !135, metadata !136}
+!130 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f0", i32 17, i64 32, i64 32, i64 0, i32 0, metadata !44} ; [ DW_TAG_member ] [f0] [line 17, size 32, align 32, offset 0] [from int32_t]
+!131 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f1", i32 18, i64 20, i64 32, i64 32, i32 0, metadata !8} ; [ DW_TAG_member ] [f1] [line 18, size 20, align 32, offset 32] [from int]
+!132 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f2", i32 19, i64 24, i64 32, i64 64, i32 0, metadata !8} ; [ DW_TAG_member ] [f2] [line 19, size 24, align 32, offset 64] [from int]
+!133 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f3", i32 20, i64 26, i64 32, i64 96, i32 0, metadata !19} ; [ DW_TAG_member ] [f3] [line 20, size 26, align 32, offset 96] [from unsigned int]
+!134 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f4", i32 21, i64 8, i64 8, i64 128, i32 0, metadata !59} ; [ DW_TAG_member ] [f4] [line 21, size 8, align 8, offset 128] [from int8_t]
+!135 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f5", i32 22, i64 24, i64 32, i64 136, i32 0, metadata !19} ; [ DW_TAG_member ] [f5] [line 22, size 24, align 32, offset 136] [from unsigned int]
+!136 = metadata !{i32 786445, metadata !1, metadata !128, metadata !"f6", i32 23, i64 29, i64 32, i64 160, i32 0, metadata !19} ; [ DW_TAG_member ] [f6] [line 23, size 29, align 32, offset 160] [from unsigned int]
+!137 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_int16_t_s_s", metadata !"safe_sub_func_int16_t_s_s", metadata !"", i32 172, metadata !75, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 173} ; [ DW_TAG_subprogram ] [line 172] [local] [def] [scope 173] [safe_sub_func_int16_t_s_s]
+!138 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_rshift_func_uint8_t_u_s", metadata !"safe_rshift_func_uint8_t_u_s", metadata !"", i32 615, metadata !66, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i32)* @safe_rshift_func_uint8_t_u_s, null, null, metadata !2, i32 616} ; [ DW_TAG_subprogram ] [line 615] [local] [def] [scope 616] [safe_rshift_func_uint8_t_u_s]
+!139 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_uint32_t_u_u", metadata !"safe_div_func_uint32_t_u_u", metadata !"", i32 783, metadata !54, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_div_func_uint32_t_u_u, null, null, metadata !2, i32 784} ; [ DW_TAG_subprogram ] [line 783] [local] [def] [scope 784] [safe_div_func_uint32_t_u_u]
+!140 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_unary_minus_func_uint32_t_u", metadata !"safe_unary_minus_func_uint32_t_u", metadata !"", i32 743, metadata !141, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_unary_minus_func_uint32_t_u, null, null, metadata !2, i32 744} ; [ DW_TAG_subprogram ] [line 743] [local] [def] [scope 744] [safe_unary_minus_func_uint32_t_u]
+!141 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !142, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!142 = metadata !{metadata !17, metadata !17}
+!143 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_uint32_t_u_u", metadata !"safe_add_func_uint32_t_u_u", metadata !"", i32 750, metadata !54, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_add_func_uint32_t_u_u, null, null, metadata !2, i32 751} ; [ DW_TAG_subprogram ] [line 750] [local] [def] [scope 751] [safe_add_func_uint32_t_u_u]
+!144 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_int16_t_s_s", metadata !"safe_lshift_func_int16_t_s_s", metadata !"", i32 224, metadata !115, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_lshift_func_int16_t_s_s, null, null, metadata !2, i32 225} ; [ DW_TAG_subprogram ] [line 224] [local] [def] [scope 225] [safe_lshift_func_int16_t_s_s]
+!145 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_int16_t_s_s", metadata !"safe_div_func_int16_t_s_s", metadata !"", i32 212, metadata !75, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_div_func_int16_t_s_s, null, null, metadata !2, i32 213} ; [ DW_TAG_subprogram ] [line 212] [local] [def] [scope 213] [safe_div_func_int16_t_s_s]
+!146 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mul_func_uint16_t_u_u", metadata !"safe_mul_func_uint16_t_u_u", metadata !"", i32 662, metadata !90, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i16 (i16, i16)* @safe_mul_func_uint16_t_u_u, null, null, metadata !2, i32 663} ; [ DW_TAG_subprogram ] [line 662] [local] [def] [scope 663] [safe_mul_func_uint16_t_u_u]
+!147 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_add_func_int8_t_s_s", metadata !"safe_add_func_int8_t_s_s", metadata !"", i32 28, metadata !57, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 29} ; [ DW_TAG_subprogram ] [line 28] [local] [def] [scope 29] [safe_add_func_int8_t_s_s]
+!148 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_31", metadata !"func_31", metadata !"", i32 612, metadata !149, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 ()* @func_31, null, null, metadata !2, i32 613} ; [ DW_TAG_subprogram ] [line 612] [local] [def] [scope 613] [func_31]
+!149 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !150, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!150 = metadata !{metadata !32, metadata !50}
+!151 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_38", metadata !"func_38", metadata !"", i32 685, metadata !152, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.S3*, i32, i32*, %struct.S1*)* @func_38, null, null, metadata !2, i32 686} ; [ DW_TAG_subprogram ] [line 685] [local] [def] [scope 686] [func_38]
+!152 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !153, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!153 = metadata !{metadata !50, metadata !37, metadata !17, metadata !50, metadata !154}
+!154 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !155} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from S1]
+!155 = metadata !{i32 786451, metadata !1, null, metadata !"S1", i32 27, i64 96, i64 32, i32 0, i32 0, null, metadata !156, i32 0, null, null} ; [ DW_TAG_structure_type ] [S1] [line 27, size 96, align 32, offset 0] [from ]
+!156 = metadata !{metadata !157, metadata !159, metadata !160, metadata !161}
+!157 = metadata !{i32 786445, metadata !1, metadata !155, metadata !"f0", i32 28, i64 32, i64 32, i64 0, i32 0, metadata !158} ; [ DW_TAG_member ] [f0] [line 28, size 32, align 32, offset 0] [from ]
+!158 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !17} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from uint32_t]
+!159 = metadata !{i32 786445, metadata !1, metadata !155, metadata !"f1", i32 29, i64 32, i64 32, i64 32, i32 0, metadata !158} ; [ DW_TAG_member ] [f1] [line 29, size 32, align 32, offset 32] [from ]
+!160 = metadata !{i32 786445, metadata !1, metadata !155, metadata !"f2", i32 30, i64 8, i64 8, i64 64, i32 0, metadata !32} ; [ DW_TAG_member ] [f2] [line 30, size 8, align 8, offset 64] [from uint8_t]
+!161 = metadata !{i32 786445, metadata !1, metadata !155, metadata !"f3", i32 31, i64 16, i64 16, i64 80, i32 0, metadata !77} ; [ DW_TAG_member ] [f3] [line 31, size 16, align 16, offset 80] [from int16_t]
+!162 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_div_func_uint8_t_u_u", metadata !"safe_div_func_uint8_t_u_u", metadata !"", i32 579, metadata !80, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @safe_div_func_uint8_t_u_u, null, null, metadata !2, i32 580} ; [ DW_TAG_subprogram ] [line 579] [local] [def] [scope 580] [safe_div_func_uint8_t_u_u]
+!163 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_sub_func_uint8_t_u_u", metadata !"safe_sub_func_uint8_t_u_u", metadata !"", i32 553, metadata !80, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 554} ; [ DW_TAG_subprogram ] [line 553] [local] [def] [scope 554] [safe_sub_func_uint8_t_u_u]
+!164 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_19", metadata !"func_19", metadata !"", i32 414, metadata !165, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.S3*)* @func_19, null, null, metadata !2, i32 415} ; [ DW_TAG_subprogram ] [line 414] [local] [def] [scope 415] [func_19]
+!165 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !166, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!166 = metadata !{metadata !50, metadata !50, metadata !37, metadata !167, metadata !50}
+!167 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !88} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!168 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_lshift_func_int8_t_s_u", metadata !"safe_lshift_func_int8_t_s_u", metadata !"", i32 106, metadata !103, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i8 (i8, i32)* @safe_lshift_func_int8_t_s_u, null, null, metadata !2, i32 107} ; [ DW_TAG_subprogram ] [line 106] [local] [def] [scope 107] [safe_lshift_func_int8_t_s_u]
+!169 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"func_15", metadata !"func_15", metadata !"", i32 357, metadata !170, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (i32)* @func_15, null, null, metadata !2, i32 358} ; [ DW_TAG_subprogram ] [line 357] [local] [def] [scope 358] [func_15]
+!170 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !171, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!171 = metadata !{metadata !50, metadata !167, metadata !17, metadata !45}
+!172 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_unary_minus_func_int32_t_s", metadata !"safe_unary_minus_func_int32_t_s", metadata !"", i32 274, metadata !173, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @safe_unary_minus_func_int32_t_s, null, null, metadata !2, i32 275} ; [ DW_TAG_subprogram ] [line 274] [local] [def] [scope 275] [safe_unary_minus_func_int32_t_s]
+!173 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !174, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!174 = metadata !{metadata !44, metadata !44}
+!175 = metadata !{i32 786478, metadata !52, metadata !53, metadata !"safe_mod_func_int32_t_s_s", metadata !"safe_mod_func_int32_t_s_s", metadata !"", i32 330, metadata !63, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32, i32)* @safe_mod_func_int32_t_s_s, null, null, metadata !2, i32 331} ; [ DW_TAG_subprogram ] [line 330] [local] [def] [scope 331] [safe_mod_func_int32_t_s_s]
+!176 = metadata !{i32 786478, metadata !18, metadata !21, metadata !"crc32_gentab", metadata !"crc32_gentab", metadata !"", i32 49, metadata !177, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @crc32_gentab, null, null, metadata !2, i32 50} ; [ DW_TAG_subprogram ] [line 49] [local] [def] [scope 50] [crc32_gentab]
+!177 = metadata !{i32 786453, i32 0, i32 0, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !178, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!178 = metadata !{null}
+!179 = metadata !{i32 786478, metadata !13, metadata !14, metadata !"platform_main_begin", metadata !"platform_main_begin", metadata !"", i32 44, metadata !177, i1 true, i1 true, i32 0, i32 0, null, i32 256, i1 false, null, null, null, metadata !2, i32 45} ; [ DW_TAG_subprogram ] [line 44] [local] [def] [scope 45] [platform_main_begin]
+!180 = metadata !{metadata !181, metadata !182, metadata !187, metadata !188, metadata !189, metadata !193, metadata !197, metadata !198, metadata !203, metadata !204, metadata !205, metadata !206, metadata !210, metadata !211, metadata !212, metadata !213, metadata !214, metadata !215, metadata !216, metadata !217, metadata !218, metadata !222, metadata !223, metadata !224, metadata !229, metadata !230, metadata !231, metadata !234, metadata !237, metadata !238, metadata !239, metadata !241, metadata !242, metadata !243, metadata !245, metadata !246, metadata !247, metadata !248, metadata !249, metadata !250, metadata !251, metadata !252, metadata !253, metadata !256, metadata !257, metadata !258, metadata !262, metadata !263, metadata !265, metadata !268, metadata !269, metadata !272, metadata !274, metadata !279, metadata !280, metadata !281, metadata !284, metadata !287, metadata !289, metadata !291, metadata !292, metadata !292, metadata !292, metadata !292, metadata !292, metadata !292, metadata !293, metadata !293, metadata !293, metadata !293, metadata !294, metadata !298, metadata !301}
+!181 = metadata !{i32 786484, i32 0, null, metadata !"crc32_context", metadata !"crc32_context", metadata !"", metadata !21, i32 46, metadata !17, i32 1, i32 1, i32* @crc32_context, null} ; [ DW_TAG_variable ] [crc32_context] [line 46] [local] [def]
+!182 = metadata !{i32 786484, i32 0, null, metadata !"g_1057", metadata !"g_1057", metadata !"", metadata !5, i32 103, metadata !183, i32 1, i32 1, [4 x [5 x i32]]* @g_1057, null} ; [ DW_TAG_variable ] [g_1057] [line 103] [local] [def]
+!183 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 640, i64 32, i32 0, i32 0, metadata !17, metadata !184, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 640, align 32, offset 0] [from uint32_t]
+!184 = metadata !{metadata !185, metadata !186}
+!185 = metadata !{i32 786465, i64 0, i64 4} ; [ DW_TAG_subrange_type ] [0, 3]
+!186 = metadata !{i32 786465, i64 0, i64 5} ; [ DW_TAG_subrange_type ] [0, 4]
+!187 = metadata !{i32 786484, i32 0, null, metadata !"g_1055", metadata !"g_1055", metadata !"", metadata !5, i32 102, metadata !44, i32 1, i32 1, i32* @g_1055, null} ; [ DW_TAG_variable ] [g_1055] [line 102] [local] [def]
+!188 = metadata !{i32 786484, i32 0, null, metadata !"g_1054", metadata !"g_1054", metadata !"", metadata !5, i32 101, metadata !59, i32 1, i32 1, null, null}
+!189 = metadata !{i32 786484, i32 0, null, metadata !"g_901", metadata !"g_901", metadata !"", metadata !5, i32 98, metadata !190, i32 1, i32 1, { i8, i8, [2 x i8] }* @g_901, null} ; [ DW_TAG_variable ] [g_901] [line 98] [local] [def]
+!190 = metadata !{i32 786451, metadata !1, null, metadata !"S2", i32 34, i64 32, i64 32, i32 0, i32 0, null, metadata !191, i32 0, null, null} ; [ DW_TAG_structure_type ] [S2] [line 34, size 32, align 32, offset 0] [from ]
+!191 = metadata !{metadata !192}
+!192 = metadata !{i32 786445, metadata !1, metadata !190, metadata !"f0", i32 35, i64 15, i64 32, i64 0, i32 0, metadata !8} ; [ DW_TAG_member ] [f0] [line 35, size 15, align 32, offset 0] [from int]
+!193 = metadata !{i32 786484, i32 0, null, metadata !"g_815", metadata !"g_815", metadata !"", metadata !5, i32 97, metadata !194, i32 1, i32 1, [4 x [3 x i8]]* @g_815, null} ; [ DW_TAG_variable ] [g_815] [line 97] [local] [def]
+!194 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 96, i64 8, i32 0, i32 0, metadata !59, metadata !195, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 96, align 8, offset 0] [from int8_t]
+!195 = metadata !{metadata !185, metadata !196}
+!196 = metadata !{i32 786465, i64 0, i64 3} ; [ DW_TAG_subrange_type ] [0, 2]
+!197 = metadata !{i32 786484, i32 0, null, metadata !"g_623", metadata !"g_623", metadata !"", metadata !5, i32 92, metadata !128, i32 1, i32 1, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623, null} ; [ DW_TAG_variable ] [g_623] [line 92] [local] [def]
+!198 = metadata !{i32 786484, i32 0, null, metadata !"g_591", metadata !"g_591", metadata !"", metadata !5, i32 91, metadata !199, i32 1, i32 1, [10 x [8 x %union.U4]]* @g_591, null} ; [ DW_TAG_variable ] [g_591] [line 91] [local] [def]
+!199 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 2560, i64 32, i32 0, i32 0, metadata !85, metadata !200, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 2560, align 32, offset 0] [from U4]
+!200 = metadata !{metadata !201, metadata !202}
+!201 = metadata !{i32 786465, i64 0, i64 10} ; [ DW_TAG_subrange_type ] [0, 9]
+!202 = metadata !{i32 786465, i64 0, i64 8} ; [ DW_TAG_subrange_type ] [0, 7]
+!203 = metadata !{i32 786484, i32 0, null, metadata !"g_575", metadata !"g_575", metadata !"", metadata !5, i32 90, metadata !32, i32 1, i32 1, i8* @g_575, null} ; [ DW_TAG_variable ] [g_575] [line 90] [local] [def]
+!204 = metadata !{i32 786484, i32 0, null, metadata !"g_557", metadata !"g_557", metadata !"", metadata !5, i32 89, metadata !77, i32 1, i32 1, i16* @g_557, null} ; [ DW_TAG_variable ] [g_557] [line 89] [local] [def]
+!205 = metadata !{i32 786484, i32 0, null, metadata !"g_538", metadata !"g_538", metadata !"", metadata !5, i32 88, metadata !45, i32 1, i32 1, i16* @g_538, null} ; [ DW_TAG_variable ] [g_538] [line 88] [local] [def]
+!206 = metadata !{i32 786484, i32 0, null, metadata !"g_535", metadata !"g_535", metadata !"", metadata !5, i32 87, metadata !207, i32 1, i32 1, [3 x [6 x [4 x i16]]]* @g_535, null} ; [ DW_TAG_variable ] [g_535] [line 87] [local] [def]
+!207 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 1152, i64 16, i32 0, i32 0, metadata !45, metadata !208, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 1152, align 16, offset 0] [from uint16_t]
+!208 = metadata !{metadata !196, metadata !209, metadata !185}
+!209 = metadata !{i32 786465, i64 0, i64 6} ; [ DW_TAG_subrange_type ] [0, 5]
+!210 = metadata !{i32 786484, i32 0, null, metadata !"g_534", metadata !"g_534", metadata !"", metadata !5, i32 86, metadata !77, i32 1, i32 1, i16* @g_534, null} ; [ DW_TAG_variable ] [g_534] [line 86] [local] [def]
+!211 = metadata !{i32 786484, i32 0, null, metadata !"g_532", metadata !"g_532", metadata !"", metadata !5, i32 85, metadata !44, i32 1, i32 1, i32* @g_532, null} ; [ DW_TAG_variable ] [g_532] [line 85] [local] [def]
+!212 = metadata !{i32 786484, i32 0, null, metadata !"g_531", metadata !"g_531", metadata !"", metadata !5, i32 84, metadata !59, i32 1, i32 1, null, null}
+!213 = metadata !{i32 786484, i32 0, null, metadata !"g_525", metadata !"g_525", metadata !"", metadata !5, i32 82, metadata !155, i32 1, i32 1, null, null}
+!214 = metadata !{i32 786484, i32 0, null, metadata !"g_518", metadata !"g_518", metadata !"", metadata !5, i32 81, metadata !45, i32 1, i32 1, null, null}
+!215 = metadata !{i32 786484, i32 0, null, metadata !"g_467", metadata !"g_467", metadata !"", metadata !5, i32 80, metadata !32, i32 1, i32 1, i8* @g_467, null} ; [ DW_TAG_variable ] [g_467] [line 80] [local] [def]
+!216 = metadata !{i32 786484, i32 0, null, metadata !"g_466", metadata !"g_466", metadata !"", metadata !5, i32 79, metadata !59, i32 1, i32 1, null, null}
+!217 = metadata !{i32 786484, i32 0, null, metadata !"g_465", metadata !"g_465", metadata !"", metadata !5, i32 78, metadata !44, i32 1, i32 1, i32* @g_465, null} ; [ DW_TAG_variable ] [g_465] [line 78] [local] [def]
+!218 = metadata !{i32 786484, i32 0, null, metadata !"g_455", metadata !"g_455", metadata !"", metadata !5, i32 77, metadata !219, i32 1, i32 1, [1 x i16]* @g_455, null} ; [ DW_TAG_variable ] [g_455] [line 77] [local] [def]
+!219 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 16, i64 16, i32 0, i32 0, metadata !45, metadata !220, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 16, align 16, offset 0] [from uint16_t]
+!220 = metadata !{metadata !221}
+!221 = metadata !{i32 786465, i64 0, i64 1} ; [ DW_TAG_subrange_type ] [0, 0]
+!222 = metadata !{i32 786484, i32 0, null, metadata !"g_454", metadata !"g_454", metadata !"", metadata !5, i32 76, metadata !44, i32 1, i32 1, null, null}
+!223 = metadata !{i32 786484, i32 0, null, metadata !"g_452", metadata !"g_452", metadata !"", metadata !5, i32 75, metadata !59, i32 1, i32 1, null, null}
+!224 = metadata !{i32 786484, i32 0, null, metadata !"g_404", metadata !"g_404", metadata !"", metadata !5, i32 74, metadata !225, i32 1, i32 1, [9 x [3 x [7 x %struct.S1]]]* @g_404, null} ; [ DW_TAG_variable ] [g_404] [line 74] [local] [def]
+!225 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 18144, i64 32, i32 0, i32 0, metadata !154, metadata !226, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 18144, align 32, offset 0] [from ]
+!226 = metadata !{metadata !227, metadata !196, metadata !228}
+!227 = metadata !{i32 786465, i64 0, i64 9} ; [ DW_TAG_subrange_type ] [0, 8]
+!228 = metadata !{i32 786465, i64 0, i64 7} ; [ DW_TAG_subrange_type ] [0, 6]
+!229 = metadata !{i32 786484, i32 0, null, metadata !"g_398", metadata !"g_398", metadata !"", metadata !5, i32 73, metadata !32, i32 1, i32 1, null, null}
+!230 = metadata !{i32 786484, i32 0, null, metadata !"g_395", metadata !"g_395", metadata !"", metadata !5, i32 72, metadata !45, i32 1, i32 1, i16* @g_395, null} ; [ DW_TAG_variable ] [g_395] [line 72] [local] [def]
+!231 = metadata !{i32 786484, i32 0, null, metadata !"g_393", metadata !"g_393", metadata !"", metadata !5, i32 71, metadata !232, i32 1, i32 1, null, null}
+!232 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 48, i64 8, i32 0, i32 0, metadata !59, metadata !233, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 48, align 8, offset 0] [from int8_t]
+!233 = metadata !{metadata !209}
+!234 = metadata !{i32 786484, i32 0, null, metadata !"g_345", metadata !"g_345", metadata !"", metadata !5, i32 70, metadata !235, i32 1, i32 1, [10 x [1 x %union.U4]]* @g_345, null} ; [ DW_TAG_variable ] [g_345] [line 70] [local] [def]
+!235 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 320, i64 32, i32 0, i32 0, metadata !85, metadata !236, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 320, align 32, offset 0] [from U4]
+!236 = metadata !{metadata !201, metadata !221}
+!237 = metadata !{i32 786484, i32 0, null, metadata !"g_332", metadata !"g_332", metadata !"", metadata !5, i32 69, metadata !45, i32 1, i32 1, i16* @g_332, null} ; [ DW_TAG_variable ] [g_332] [line 69] [local] [def]
+!238 = metadata !{i32 786484, i32 0, null, metadata !"g_258", metadata !"g_258", metadata !"", metadata !5, i32 67, metadata !59, i32 1, i32 1, i8* @g_258, null} ; [ DW_TAG_variable ] [g_258] [line 67] [local] [def]
+!239 = metadata !{i32 786484, i32 0, null, metadata !"g_218", metadata !"g_218", metadata !"", metadata !5, i32 66, metadata !240, i32 1, i32 1, null, null}
+!240 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !190} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from S2]
+!241 = metadata !{i32 786484, i32 0, null, metadata !"g_183", metadata !"g_183", metadata !"", metadata !5, i32 63, metadata !85, i32 1, i32 1, %union.U4* @g_183, null} ; [ DW_TAG_variable ] [g_183] [line 63] [local] [def]
+!242 = metadata !{i32 786484, i32 0, null, metadata !"g_110", metadata !"g_110", metadata !"", metadata !5, i32 61, metadata !190, i32 1, i32 1, { i8, i8, [2 x i8] }* @g_110, null} ; [ DW_TAG_variable ] [g_110] [line 61] [local] [def]
+!243 = metadata !{i32 786484, i32 0, null, metadata !"g_109", metadata !"g_109", metadata !"", metadata !5, i32 60, metadata !244, i32 1, i32 1, null, null}
+!244 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !85} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from U4]
+!245 = metadata !{i32 786484, i32 0, null, metadata !"g_108", metadata !"g_108", metadata !"", metadata !5, i32 59, metadata !128, i32 1, i32 1, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108, null} ; [ DW_TAG_variable ] [g_108] [line 59] [local] [def]
+!246 = metadata !{i32 786484, i32 0, null, metadata !"g_103", metadata !"g_103", metadata !"", metadata !5, i32 58, metadata !45, i32 1, i32 1, i16* @g_103, null} ; [ DW_TAG_variable ] [g_103] [line 58] [local] [def]
+!247 = metadata !{i32 786484, i32 0, null, metadata !"g_99", metadata !"g_99", metadata !"", metadata !5, i32 57, metadata !155, i32 1, i32 1, %struct.S1* @g_99, null} ; [ DW_TAG_variable ] [g_99] [line 57] [local] [def]
+!248 = metadata !{i32 786484, i32 0, null, metadata !"g_96", metadata !"g_96", metadata !"", metadata !5, i32 56, metadata !32, i32 1, i32 1, i8* @g_96, null} ; [ DW_TAG_variable ] [g_96] [line 56] [local] [def]
+!249 = metadata !{i32 786484, i32 0, null, metadata !"g_92", metadata !"g_92", metadata !"", metadata !5, i32 55, metadata !59, i32 1, i32 1, i8* @g_92, null} ; [ DW_TAG_variable ] [g_92] [line 55] [local] [def]
+!250 = metadata !{i32 786484, i32 0, null, metadata !"g_90", metadata !"g_90", metadata !"", metadata !5, i32 54, metadata !44, i32 1, i32 1, i32* @g_90, null} ; [ DW_TAG_variable ] [g_90] [line 54] [local] [def]
+!251 = metadata !{i32 786484, i32 0, null, metadata !"g_82", metadata !"g_82", metadata !"", metadata !5, i32 53, metadata !59, i32 1, i32 1, null, null}
+!252 = metadata !{i32 786484, i32 0, null, metadata !"g_52", metadata !"g_52", metadata !"", metadata !5, i32 52, metadata !44, i32 1, i32 1, i32* @g_52, null} ; [ DW_TAG_variable ] [g_52] [line 52] [local] [def]
+!253 = metadata !{i32 786484, i32 0, null, metadata !"g_49", metadata !"g_49", metadata !"", metadata !5, i32 51, metadata !254, i32 1, i32 1, [9 x %struct.S3]* @g_49, null} ; [ DW_TAG_variable ] [g_49] [line 51] [local] [def]
+!254 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 576, i64 32, i32 0, i32 0, metadata !37, metadata !255, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 576, align 32, offset 0] [from S3]
+!255 = metadata !{metadata !227}
+!256 = metadata !{i32 786484, i32 0, null, metadata !"g_25", metadata !"g_25", metadata !"", metadata !5, i32 50, metadata !37, i32 1, i32 1, %struct.S3* @g_25, null} ; [ DW_TAG_variable ] [g_25] [line 50] [local] [def]
+!257 = metadata !{i32 786484, i32 0, null, metadata !"g_5", metadata !"g_5", metadata !"", metadata !5, i32 49, metadata !44, i32 1, i32 1, i32* @g_5, null} ; [ DW_TAG_variable ] [g_5] [line 49] [local] [def]
+!258 = metadata !{i32 786484, i32 0, null, metadata !"crc32_tab", metadata !"crc32_tab", metadata !"", metadata !21, i32 45, metadata !259, i32 1, i32 1, [256 x i32]* @crc32_tab, null} ; [ DW_TAG_variable ] [crc32_tab] [line 45] [local] [def]
+!259 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 8192, i64 32, i32 0, i32 0, metadata !17, metadata !260, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 8192, align 32, offset 0] [from uint32_t]
+!260 = metadata !{metadata !261}
+!261 = metadata !{i32 786465, i64 0, i64 256} ; [ DW_TAG_subrange_type ] [0, 255]
+!262 = metadata !{i32 786484, i32 0, null, metadata !"g_692", metadata !"g_692", metadata !"", metadata !5, i32 96, metadata !50, i32 1, i32 1, null, null}
+!263 = metadata !{i32 786484, i32 0, metadata !41, metadata !"l_1216", metadata !"l_1216", metadata !"", metadata !5, i32 151, metadata !264, i32 1, i32 1, null, null}
+!264 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 192, i64 32, i32 0, i32 0, metadata !240, metadata !233, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 192, align 32, offset 0] [from ]
+!265 = metadata !{i32 786484, i32 0, null, metadata !"g_1182", metadata !"g_1182", metadata !"", metadata !5, i32 107, metadata !266, i32 1, i32 1, i32**** @g_1182, null} ; [ DW_TAG_variable ] [g_1182] [line 107] [local] [def]
+!266 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !267} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!267 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !50} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!268 = metadata !{i32 786484, i32 0, null, metadata !"g_1183", metadata !"g_1183", metadata !"", metadata !5, i32 106, metadata !267, i32 1, i32 1, i32*** @g_1183, null} ; [ DW_TAG_variable ] [g_1183] [line 106] [local] [def]
+!269 = metadata !{i32 786484, i32 0, null, metadata !"g_680", metadata !"g_680", metadata !"", metadata !5, i32 93, metadata !270, i32 1, i32 1, [3 x [9 x i32*]]* @g_680, null} ; [ DW_TAG_variable ] [g_680] [line 93] [local] [def]
+!270 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 864, i64 32, i32 0, i32 0, metadata !50, metadata !271, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 864, align 32, offset 0] [from ]
+!271 = metadata !{metadata !196, metadata !227}
+!272 = metadata !{i32 786484, i32 0, null, metadata !"g_165", metadata !"g_165", metadata !"", metadata !5, i32 62, metadata !273, i32 1, i32 1, null, null}
+!273 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !45} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from uint16_t]
+!274 = metadata !{i32 786484, i32 0, null, metadata !"g_524", metadata !"g_524", metadata !"", metadata !5, i32 83, metadata !275, i32 1, i32 1, [2 x [8 x [6 x %struct.S1*]]]* @g_524, null} ; [ DW_TAG_variable ] [g_524] [line 83] [local] [def]
+!275 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 3072, i64 32, i32 0, i32 0, metadata !276, metadata !277, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 3072, align 32, offset 0] [from ]
+!276 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !154} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!277 = metadata !{metadata !278, metadata !202, metadata !209}
+!278 = metadata !{i32 786465, i64 0, i64 2} ; [ DW_TAG_subrange_type ] [0, 1]
+!279 = metadata !{i32 786484, i32 0, null, metadata !"g_304", metadata !"g_304", metadata !"", metadata !5, i32 68, metadata !50, i32 1, i32 1, i32** @g_304, null} ; [ DW_TAG_variable ] [g_304] [line 68] [local] [def]
+!280 = metadata !{i32 786484, i32 0, null, metadata !"g_1184", metadata !"g_1184", metadata !"", metadata !5, i32 108, metadata !266, i32 1, i32 1, null, null}
+!281 = metadata !{i32 786484, i32 0, null, metadata !"g_1175", metadata !"g_1175", metadata !"", metadata !5, i32 105, metadata !282, i32 1, i32 1, null, null}
+!282 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !283} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!283 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !267} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from ]
+!284 = metadata !{i32 786484, i32 0, null, metadata !"g_191", metadata !"g_191", metadata !"", metadata !5, i32 65, metadata !285, i32 1, i32 1, null, null}
+!285 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !286} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!286 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !240} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!287 = metadata !{i32 786484, i32 0, null, metadata !"g_1170", metadata !"g_1170", metadata !"", metadata !5, i32 104, metadata !288, i32 1, i32 1, null, null}
+!288 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !37} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from S3]
+!289 = metadata !{i32 786484, i32 0, null, metadata !"g_966", metadata !"g_966", metadata !"", metadata !5, i32 99, metadata !290, i32 1, i32 1, null, null}
+!290 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !288} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from ]
+!291 = metadata !{i32 786484, i32 0, metadata !148, metadata !"l_167", metadata !"l_167", metadata !"", metadata !5, i32 630, metadata !154, i32 1, i32 1, %struct.S1* @func_31.l_167, null} ; [ DW_TAG_variable ] [l_167] [line 630] [local] [def]
+!292 = metadata !{i32 786484, i32 0, metadata !5, metadata !"l_242", metadata !"l_242", metadata !"l_242", metadata !5, i32 749, metadata !88, i32 1, i32 1, i32 0, null} ; [ DW_TAG_variable ] [l_242] [line 749] [local] [def]
+!293 = metadata !{i32 786484, i32 0, metadata !5, metadata !"l_374", metadata !"l_374", metadata !"l_374", metadata !5, i32 886, metadata !88, i32 1, i32 1, i32 388483030, null} ; [ DW_TAG_variable ] [l_374] [line 886] [local] [def]
+!294 = metadata !{i32 786484, i32 0, metadata !169, metadata !"l_830", metadata !"l_830", metadata !"", metadata !5, i32 370, metadata !295, i32 1, i32 1, null, null}
+!295 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 192, i64 32, i32 0, i32 0, metadata !296, metadata !233, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 192, align 32, offset 0] [from ]
+!296 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !297} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from ]
+!297 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !273} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!298 = metadata !{i32 786484, i32 0, null, metadata !"g_192", metadata !"g_192", metadata !"", metadata !5, i32 64, metadata !299, i32 1, i32 1, [6 x [10 x %struct.S2*]]* @g_192, null} ; [ DW_TAG_variable ] [g_192] [line 64] [local] [def]
+!299 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 1920, i64 32, i32 0, i32 0, metadata !286, metadata !300, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 1920, align 32, offset 0] [from ]
+!300 = metadata !{metadata !209, metadata !201}
+!301 = metadata !{i32 786484, i32 0, metadata !21, metadata !"poly", metadata !"poly", metadata !"poly", metadata !21, i32 52, metadata !158, i32 1, i32 1, i32 -306674912, null} ; [ DW_TAG_variable ] [poly] [line 52] [local] [def]
+!302 = metadata !{i32 786689, metadata !4, metadata !"argc", metadata !5, i32 16778273, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [argc] [line 1057]
+!303 = metadata !{i32 1057, i32 0, metadata !4, null}
+!304 = metadata !{i32 786689, metadata !4, metadata !"argv", metadata !5, i32 33555489, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [argv] [line 1057]
+!305 = metadata !{i32 786688, metadata !4, metadata !"print_hash_value", metadata !5, i32 1060, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [print_hash_value] [line 1060]
+!306 = metadata !{i32 1060, i32 0, metadata !4, null}
+!307 = metadata !{i32 1061, i32 0, metadata !4, null}
+!308 = metadata !{i32 1}
+!309 = metadata !{i32 1063, i32 0, metadata !4, null}
+!310 = metadata !{i32 1064, i32 0, metadata !4, null}
+!311 = metadata !{i32 1065, i32 0, metadata !4, null}
+!312 = metadata !{i32 1066, i32 0, metadata !4, null}
+!313 = metadata !{i32 1067, i32 0, metadata !4, null}
+!314 = metadata !{i32 786688, metadata !4, metadata !"i", metadata !5, i32 1059, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 1059]
+!315 = metadata !{i32 1068, i32 0, metadata !316, null}
+!316 = metadata !{i32 786443, metadata !1, metadata !4, i32 1068, i32 0, i32 0} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!317 = metadata !{i32 1072, i32 0, metadata !318, null}
+!318 = metadata !{i32 786443, metadata !1, metadata !316, i32 1069, i32 0, i32 1} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!319 = metadata !{i32 1070, i32 0, metadata !318, null}
+!320 = metadata !{i32 1071, i32 0, metadata !318, null}
+!321 = metadata !{i32 1075, i32 0, metadata !4, null}
+!322 = metadata !{i32 1076, i32 0, metadata !4, null}
+!323 = metadata !{i32 1077, i32 0, metadata !4, null}
+!324 = metadata !{i32 1078, i32 0, metadata !4, null}
+!325 = metadata !{i32 1079, i32 0, metadata !4, null}
+!326 = metadata !{i32 1080, i32 0, metadata !4, null}
+!327 = metadata !{i32 1081, i32 0, metadata !4, null}
+!328 = metadata !{i32 1082, i32 0, metadata !4, null}
+!329 = metadata !{i32 1083, i32 0, metadata !4, null}
+!330 = metadata !{i32 1084, i32 0, metadata !4, null}
+!331 = metadata !{i32 1085, i32 0, metadata !4, null}
+!332 = metadata !{i32 1086, i32 0, metadata !4, null}
+!333 = metadata !{i32 1087, i32 0, metadata !4, null}
+!334 = metadata !{i32 1088, i32 0, metadata !4, null}
+!335 = metadata !{i32 1089, i32 0, metadata !4, null}
+!336 = metadata !{i32 1090, i32 0, metadata !4, null}
+!337 = metadata !{i32 1091, i32 0, metadata !4, null}
+!338 = metadata !{i32 1092, i32 0, metadata !4, null}
+!339 = metadata !{i32 1093, i32 0, metadata !4, null}
+!340 = metadata !{i32 1094, i32 0, metadata !4, null}
+!341 = metadata !{i32 1095, i32 0, metadata !4, null}
+!342 = metadata !{i32 1096, i32 0, metadata !4, null}
+!343 = metadata !{i32 1097, i32 0, metadata !4, null}
+!344 = metadata !{i32 1098, i32 0, metadata !345, null}
+!345 = metadata !{i32 786443, metadata !1, metadata !4, i32 1098, i32 0, i32 2} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!346 = metadata !{i32 1103, i32 0, metadata !347, null}
+!347 = metadata !{i32 786443, metadata !1, metadata !348, i32 1101, i32 0, i32 5} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!348 = metadata !{i32 786443, metadata !1, metadata !349, i32 1100, i32 0, i32 4} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!349 = metadata !{i32 786443, metadata !1, metadata !345, i32 1099, i32 0, i32 3} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!350 = metadata !{i32 1102, i32 0, metadata !347, null}
+!351 = metadata !{i32 1110, i32 0, metadata !352, null}
+!352 = metadata !{i32 786443, metadata !1, metadata !353, i32 1108, i32 0, i32 7} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!353 = metadata !{i32 786443, metadata !1, metadata !4, i32 1107, i32 0, i32 6} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!354 = metadata !{i32 1109, i32 0, metadata !352, null}
+!355 = metadata !{i32 1107, i32 0, metadata !353, null}
+!356 = metadata !{i32 1119, i32 0, metadata !357, null}
+!357 = metadata !{i32 786443, metadata !1, metadata !358, i32 1119, i32 0, i32 12} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!358 = metadata !{i32 786443, metadata !1, metadata !359, i32 1118, i32 0, i32 11} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!359 = metadata !{i32 786443, metadata !1, metadata !360, i32 1117, i32 0, i32 10} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!360 = metadata !{i32 786443, metadata !1, metadata !361, i32 1116, i32 0, i32 9} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!361 = metadata !{i32 786443, metadata !1, metadata !4, i32 1115, i32 0, i32 8} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!362 = metadata !{i32 1121, i32 0, metadata !363, null}
+!363 = metadata !{i32 786443, metadata !1, metadata !357, i32 1120, i32 0, i32 13} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!364 = metadata !{i32 1122, i32 0, metadata !363, null}
+!365 = metadata !{i32 1123, i32 0, metadata !363, null}
+!366 = metadata !{i32 1124, i32 0, metadata !363, null}
+!367 = metadata !{i32 1125, i32 0, metadata !363, null}
+!368 = metadata !{i32 786688, metadata !4, metadata !"k", metadata !5, i32 1059, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [k] [line 1059]
+!369 = metadata !{i32 1130, i32 0, metadata !4, null}
+!370 = metadata !{i32 1131, i32 0, metadata !4, null}
+!371 = metadata !{i32 1132, i32 0, metadata !372, null}
+!372 = metadata !{i32 786443, metadata !1, metadata !4, i32 1132, i32 0, i32 14} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!373 = metadata !{i32 1135, i32 0, metadata !374, null}
+!374 = metadata !{i32 786443, metadata !1, metadata !372, i32 1133, i32 0, i32 15} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!375 = metadata !{i32 1134, i32 0, metadata !374, null}
+!376 = metadata !{i32 1138, i32 0, metadata !4, null}
+!377 = metadata !{i32 1139, i32 0, metadata !4, null}
+!378 = metadata !{i32 1140, i32 0, metadata !4, null}
+!379 = metadata !{i32 1141, i32 0, metadata !4, null}
+!380 = metadata !{i32 1142, i32 0, metadata !4, null}
+!381 = metadata !{i32 1143, i32 0, metadata !4, null}
+!382 = metadata !{i32 1144, i32 0, metadata !4, null}
+!383 = metadata !{i32 1145, i32 0, metadata !4, null}
+!384 = metadata !{i32 1146, i32 0, metadata !4, null}
+!385 = metadata !{i32 1147, i32 0, metadata !4, null}
+!386 = metadata !{i32 1148, i32 0, metadata !4, null}
+!387 = metadata !{i32 1149, i32 0, metadata !388, null}
+!388 = metadata !{i32 786443, metadata !1, metadata !4, i32 1149, i32 0, i32 16} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!389 = metadata !{i32 1156, i32 0, metadata !390, null}
+!390 = metadata !{i32 786443, metadata !1, metadata !391, i32 1154, i32 0, i32 21} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!391 = metadata !{i32 786443, metadata !1, metadata !392, i32 1153, i32 0, i32 20} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!392 = metadata !{i32 786443, metadata !1, metadata !393, i32 1152, i32 0, i32 19} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!393 = metadata !{i32 786443, metadata !1, metadata !394, i32 1151, i32 0, i32 18} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!394 = metadata !{i32 786443, metadata !1, metadata !388, i32 1150, i32 0, i32 17} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!395 = metadata !{i32 1151, i32 0, metadata !393, null}
+!396 = metadata !{i32 1155, i32 0, metadata !390, null}
+!397 = metadata !{i32 1153, i32 0, metadata !391, null}
+!398 = metadata !{i32 1161, i32 0, metadata !4, null}
+!399 = metadata !{i32 1162, i32 0, metadata !4, null}
+!400 = metadata !{i32 1163, i32 0, metadata !4, null}
+!401 = metadata !{i32 1164, i32 0, metadata !402, null}
+!402 = metadata !{i32 786443, metadata !1, metadata !4, i32 1164, i32 0, i32 22} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!403 = metadata !{i32 1169, i32 0, metadata !404, null}
+!404 = metadata !{i32 786443, metadata !1, metadata !405, i32 1167, i32 0, i32 25} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!405 = metadata !{i32 786443, metadata !1, metadata !406, i32 1166, i32 0, i32 24} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!406 = metadata !{i32 786443, metadata !1, metadata !402, i32 1165, i32 0, i32 23} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!407 = metadata !{i32 1168, i32 0, metadata !404, null}
+!408 = metadata !{i32 786688, metadata !4, metadata !"j", metadata !5, i32 1059, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [j] [line 1059]
+!409 = metadata !{i32 1166, i32 0, metadata !405, null}
+!410 = metadata !{i32 1173, i32 0, metadata !4, null}
+!411 = metadata !{i32 1174, i32 0, metadata !4, null}
+!412 = metadata !{i32 1175, i32 0, metadata !4, null}
+!413 = metadata !{i32 1176, i32 0, metadata !4, null}
+!414 = metadata !{i32 1177, i32 0, metadata !4, null}
+!415 = metadata !{i32 1178, i32 0, metadata !4, null}
+!416 = metadata !{i32 1179, i32 0, metadata !4, null}
+!417 = metadata !{i32 1180, i32 0, metadata !418, null}
+!418 = metadata !{i32 786443, metadata !1, metadata !4, i32 1180, i32 0, i32 26} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!419 = metadata !{i32 1185, i32 0, metadata !420, null}
+!420 = metadata !{i32 786443, metadata !1, metadata !421, i32 1183, i32 0, i32 29} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!421 = metadata !{i32 786443, metadata !1, metadata !422, i32 1182, i32 0, i32 28} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!422 = metadata !{i32 786443, metadata !1, metadata !418, i32 1181, i32 0, i32 27} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!423 = metadata !{i32 1184, i32 0, metadata !420, null}
+!424 = metadata !{i32 1182, i32 0, metadata !421, null}
+!425 = metadata !{i32 1189, i32 0, metadata !4, null}
+!426 = metadata !{i32 1190, i32 0, metadata !4, null}
+!427 = metadata !{i32 1191, i32 0, metadata !4, null}
+!428 = metadata !{i32 1192, i32 0, metadata !429, null}
+!429 = metadata !{i32 786443, metadata !1, metadata !4, i32 1192, i32 0, i32 30} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!430 = metadata !{i32 1197, i32 0, metadata !431, null}
+!431 = metadata !{i32 786443, metadata !1, metadata !432, i32 1195, i32 0, i32 33} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!432 = metadata !{i32 786443, metadata !1, metadata !433, i32 1194, i32 0, i32 32} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!433 = metadata !{i32 786443, metadata !1, metadata !429, i32 1193, i32 0, i32 31} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!434 = metadata !{i32 1196, i32 0, metadata !431, null}
+!435 = metadata !{i32 1194, i32 0, metadata !432, null}
+!436 = metadata !{i32 1201, i32 0, metadata !4, null}
+!437 = metadata !{i32 1202, i32 0, metadata !4, null}
+!438 = metadata !{i32 1117, i32 0, metadata !359, null}
+!439 = metadata !{i32 1115, i32 0, metadata !361, null}
+!440 = metadata !{i32 1113, i32 0, metadata !4, null}
+!441 = metadata !{i32 1114, i32 0, metadata !4, null}
+!442 = metadata !{i32 -306674912}
+!443 = metadata !{i32 786688, metadata !444, metadata !"poly", metadata !21, i32 52, metadata !158, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [poly] [line 52]
+!444 = metadata !{i32 786443, metadata !18, metadata !176} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!445 = metadata !{i32 52, i32 0, metadata !444, null}
+!446 = metadata !{i32 786688, metadata !444, metadata !"i", metadata !21, i32 53, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 53]
+!447 = metadata !{i32 55, i32 0, metadata !448, null}
+!448 = metadata !{i32 786443, metadata !18, metadata !444, i32 55, i32 0, i32 165} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!449 = metadata !{i32 58, i32 0, metadata !450, null} ; [ DW_TAG_imported_module ]
+!450 = metadata !{i32 786443, metadata !18, metadata !451, i32 57, i32 0, i32 168} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!451 = metadata !{i32 786443, metadata !18, metadata !452, i32 57, i32 0, i32 167} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!452 = metadata !{i32 786443, metadata !18, metadata !448, i32 55, i32 0, i32 166} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!453 = metadata !{i32 59, i32 0, metadata !454, null}
+!454 = metadata !{i32 786443, metadata !18, metadata !450, i32 58, i32 0, i32 169} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!455 = metadata !{i32 786688, metadata !444, metadata !"crc", metadata !21, i32 51, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [crc] [line 51]
+!456 = metadata !{i32 7}
+!457 = metadata !{i32 786688, metadata !444, metadata !"j", metadata !21, i32 53, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [j] [line 53]
+!458 = metadata !{i32 57, i32 0, metadata !451, null}
+!459 = metadata !{i32 64, i32 0, metadata !452, null}
+!460 = metadata !{i32 66, i32 0, metadata !444, null}
+!461 = metadata !{i32 1101644307}
+!462 = metadata !{i32 786688, metadata !463, metadata !"l_6", metadata !5, i32 132, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_6] [line 132]
+!463 = metadata !{i32 786443, metadata !1, metadata !34} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!464 = metadata !{i32 132, i32 0, metadata !463, null}
+!465 = metadata !{%struct.S3* @func_1.l_1252}
+!466 = metadata !{i32 786688, metadata !463, metadata !"l_1252", metadata !5, i32 133, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1252] [line 133]
+!467 = metadata !{i32 133, i32 0, metadata !463, null}
+!468 = metadata !{i32 134, i32 0, metadata !463, null}
+!469 = metadata !{i32 135, i32 0, metadata !463, null}
+!470 = metadata !{i32 786689, metadata !20, metadata !"val", metadata !21, i32 16777324, metadata !24, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [val] [line 108]
+!471 = metadata !{i32 108, i32 0, metadata !20, null}
+!472 = metadata !{i32 786689, metadata !20, metadata !"vname", metadata !21, i32 33554540, metadata !10, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [vname] [line 108]
+!473 = metadata !{i32 786689, metadata !20, metadata !"flag", metadata !21, i32 50331756, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [flag] [line 108]
+!474 = metadata !{i32 110, i32 0, metadata !475, null}
+!475 = metadata !{i32 786443, metadata !18, metadata !20} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!476 = metadata !{i32 111, i32 0, metadata !475, null}
+!477 = metadata !{i32 112, i32 0, metadata !478, null}
+!478 = metadata !{i32 786443, metadata !18, metadata !475, i32 111, i32 0, i32 34} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./csmith.h]
+!479 = metadata !{i32 113, i32 0, metadata !478, null}
+!480 = metadata !{i32 114, i32 0, metadata !475, null}
+!481 = metadata !{i32 786689, metadata !12, metadata !"flag", metadata !14, i32 33554482, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [flag] [line 50]
+!482 = metadata !{i32 50, i32 0, metadata !12, null}
+!483 = metadata !{i32 55, i32 0, metadata !484, null}
+!484 = metadata !{i32 786443, metadata !13, metadata !12} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./platform_generic.h]
+!485 = metadata !{i32 117, i32 0, metadata !484, null}
+!486 = metadata !{i32 786689, metadata !26, metadata !"val", metadata !21, i32 16777311, metadata !24, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [val] [line 95]
+!487 = metadata !{i32 95, i32 0, metadata !26, null}
+!488 = metadata !{i32 97, i32 0, metadata !26, null}
+!489 = metadata !{i32 98, i32 0, metadata !26, null}
+!490 = metadata !{i32 99, i32 0, metadata !26, null}
+!491 = metadata !{i32 100, i32 0, metadata !26, null}
+!492 = metadata !{i32 101, i32 0, metadata !26, null}
+!493 = metadata !{i32 102, i32 0, metadata !26, null}
+!494 = metadata !{i32 103, i32 0, metadata !26, null}
+!495 = metadata !{i32 104, i32 0, metadata !26, null}
+!496 = metadata !{i32 105, i32 0, metadata !26, null}
+!497 = metadata !{i32 786689, metadata !29, metadata !"b", metadata !21, i32 16777285, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [b] [line 69]
+!498 = metadata !{i32 69, i32 0, metadata !29, null}
+!499 = metadata !{i32 70, i32 0, metadata !29, null}
+!500 = metadata !{i32 73, i32 0, metadata !29, null}
+!501 = metadata !{i16 -15853}
+!502 = metadata !{i32 786689, metadata !41, metadata !"p_4", metadata !5, i32 33554576, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_4] [line 144]
+!503 = metadata !{i32 144, i32 0, metadata !41, null}
+!504 = metadata !{i32 -3}
+!505 = metadata !{i32 786688, metadata !41, metadata !"l_13", metadata !5, i32 146, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_13] [line 146]
+!506 = metadata !{i32 146, i32 0, metadata !41, null}
+!507 = metadata !{%struct.S1* undef}
+!508 = metadata !{i32 786688, metadata !41, metadata !"l_1192", metadata !5, i32 147, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1192] [line 147]
+!509 = metadata !{i32 147, i32 0, metadata !41, null}
+!510 = metadata !{i32 -883922836}
+!511 = metadata !{i32 786688, metadata !41, metadata !"l_1195", metadata !5, i32 148, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1195] [line 148]
+!512 = metadata !{i32 148, i32 0, metadata !41, null}
+!513 = metadata !{%union.U4* getelementptr inbounds ([10 x [1 x %union.U4]]* @g_345, i32 0, i32 6, i32 0)}
+!514 = metadata !{i32 786688, metadata !41, metadata !"l_1201", metadata !5, i32 149, metadata !515, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1201] [line 149]
+!515 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !85} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from U4]
+!516 = metadata !{i32 149, i32 0, metadata !41, null}
+!517 = metadata !{i32* @g_1055}
+!518 = metadata !{i32 786688, metadata !41, metadata !"l_1217", metadata !5, i32 152, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1217] [line 152]
+!519 = metadata !{i32 152, i32 0, metadata !41, null}
+!520 = metadata !{i32* @g_532}
+!521 = metadata !{i32 786688, metadata !41, metadata !"l_1219", metadata !5, i32 154, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1219] [line 154]
+!522 = metadata !{i32 154, i32 0, metadata !41, null}
+!523 = metadata !{i32* @g_90}
+!524 = metadata !{i32 786688, metadata !41, metadata !"l_1225", metadata !5, i32 155, metadata !167, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1225] [line 155]
+!525 = metadata !{i32 155, i32 0, metadata !41, null}
+!526 = metadata !{%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @func_2.l_1232 to %struct.S0*)}
+!527 = metadata !{i32 786688, metadata !41, metadata !"l_1232", metadata !5, i32 159, metadata !128, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1232] [line 159]
+!528 = metadata !{i32 159, i32 0, metadata !41, null}
+!529 = metadata !{[3 x [7 x i32]]* undef}
+!530 = metadata !{i32 786688, metadata !41, metadata !"l_1235", metadata !5, i32 160, metadata !531, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1235] [line 160]
+!531 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 672, i64 32, i32 0, i32 0, metadata !17, metadata !532, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 672, align 32, offset 0] [from uint32_t]
+!532 = metadata !{metadata !196, metadata !228}
+!533 = metadata !{i32 160, i32 0, metadata !41, null}
+!534 = metadata !{i32 -1251538840}
+!535 = metadata !{i32 786688, metadata !41, metadata !"l_1244", metadata !5, i32 162, metadata !88, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1244] [line 162]
+!536 = metadata !{i32 162, i32 0, metadata !41, null}
+!537 = metadata !{[10 x %struct.S3]* @func_2.l_1247}
+!538 = metadata !{i32 786688, metadata !41, metadata !"l_1247", metadata !5, i32 163, metadata !539, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1247] [line 163]
+!539 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 640, i64 32, i32 0, i32 0, metadata !37, metadata !540, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 640, align 32, offset 0] [from S3]
+!540 = metadata !{metadata !201}
+!541 = metadata !{i32 163, i32 0, metadata !41, null}
+!542 = metadata !{i32* getelementptr inbounds (%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_623 to %struct.S0*), i32 0, i32 0)}
+!543 = metadata !{i32 786688, metadata !41, metadata !"l_1248", metadata !5, i32 164, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1248] [line 164]
+!544 = metadata !{i32 164, i32 0, metadata !41, null}
+!545 = metadata !{i32 166, i32 0, metadata !41, null}
+!546 = metadata !{i32 168, i32 0, metadata !41, null}
+!547 = metadata !{%struct.S2** null}
+!548 = metadata !{i32 786688, metadata !549, metadata !"l_1243", metadata !5, i32 170, metadata !550, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1243] [line 170]
+!549 = metadata !{i32 786443, metadata !1, metadata !41, i32 169, i32 0, i32 35} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!550 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !551} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!551 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !190} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from S2]
+!552 = metadata !{i32 170, i32 0, metadata !549, null}
+!553 = metadata !{%union.U4* getelementptr inbounds ([10 x [8 x %union.U4]]* @g_591, i32 0, i32 3, i32 4)}
+!554 = metadata !{i32 786688, metadata !549, metadata !"l_1245", metadata !5, i32 171, metadata !515, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1245] [line 171]
+!555 = metadata !{i32 171, i32 0, metadata !549, null}
+!556 = metadata !{i32 -1}
+!557 = metadata !{i32 786688, metadata !549, metadata !"l_1246", metadata !5, i32 172, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1246] [line 172]
+!558 = metadata !{i32 172, i32 0, metadata !549, null}
+!559 = metadata !{i32 174, i32 0, metadata !549, null}
+!560 = metadata !{i32 175, i32 0, metadata !549, null}
+!561 = metadata !{i32 176, i32 0, metadata !549, null}
+!562 = metadata !{%struct.S3* @func_2.l_1249}
+!563 = metadata !{i32 786688, metadata !564, metadata !"l_1249", metadata !5, i32 179, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1249] [line 179]
+!564 = metadata !{i32 786443, metadata !1, metadata !41, i32 178, i32 0, i32 36} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!565 = metadata !{i32 179, i32 0, metadata !564, null}
+!566 = metadata !{%struct.S3* null}
+!567 = metadata !{i32 786688, metadata !564, metadata !"l_1250", metadata !5, i32 180, metadata !288, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1250] [line 180]
+!568 = metadata !{i32 180, i32 0, metadata !564, null}
+!569 = metadata !{[7 x [8 x [1 x %struct.S3*]]]* undef}
+!570 = metadata !{i32 786688, metadata !564, metadata !"l_1251", metadata !5, i32 181, metadata !571, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1251] [line 181]
+!571 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 1792, i64 32, i32 0, i32 0, metadata !288, metadata !572, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 1792, align 32, offset 0] [from ]
+!572 = metadata !{metadata !228, metadata !202, metadata !221}
+!573 = metadata !{i32 181, i32 0, metadata !564, null}
+!574 = metadata !{i32 183, i32 0, metadata !564, null}
+!575 = metadata !{i32 185, i32 0, metadata !41, null}
+!576 = metadata !{i32 786689, metadata !175, metadata !"si1", metadata !53, i32 16777546, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 330]
+!577 = metadata !{i32 330, i32 0, metadata !175, null}
+!578 = metadata !{i32 786689, metadata !175, metadata !"si2", metadata !53, i32 33554762, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si2] [line 330]
+!579 = metadata !{i32 333, i32 0, metadata !175, null}
+!580 = metadata !{i32 786689, metadata !172, metadata !"si", metadata !53, i32 16777490, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si] [line 274]
+!581 = metadata !{i32 274, i32 0, metadata !172, null}
+!582 = metadata !{i32 277, i32 0, metadata !583, null}
+!583 = metadata !{i32 786443, metadata !52, metadata !172} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./safe_math.h]
+!584 = metadata !{i32 218, i32 0, metadata !585, null}
+!585 = metadata !{i32 786443, metadata !1, metadata !586, i32 217, i32 0, i32 79} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!586 = metadata !{i32 786443, metadata !1, metadata !125} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!587 = metadata !{i32 786689, metadata !125, metadata !"p_12", metadata !5, i32 33554626, metadata !17, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_12] [line 194]
+!588 = metadata !{i32 194, i32 0, metadata !125, null}
+!589 = metadata !{i32 786688, metadata !586, metadata !"l_14", metadata !5, i32 196, metadata !590, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_14] [line 196]
+!590 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 16, i64 8, i32 0, i32 0, metadata !32, metadata !591, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 16, align 8, offset 0] [from uint8_t]
+!591 = metadata !{metadata !278}
+!592 = metadata !{i32 196, i32 0, metadata !586, null}
+!593 = metadata !{%struct.S3* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 3)}
+!594 = metadata !{i32 786688, metadata !586, metadata !"l_1025", metadata !5, i32 197, metadata !288, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1025] [line 197]
+!595 = metadata !{i32 197, i32 0, metadata !586, null}
+!596 = metadata !{%union.U4* @func_10.l_1026}
+!597 = metadata !{i32 786688, metadata !586, metadata !"l_1026", metadata !5, i32 199, metadata !85, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1026] [line 199]
+!598 = metadata !{i32 199, i32 0, metadata !586, null}
+!599 = metadata !{i32* getelementptr inbounds (%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108 to %struct.S0*), i32 0, i32 0)}
+!600 = metadata !{i32 786688, metadata !586, metadata !"l_1037", metadata !5, i32 200, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1037] [line 200]
+!601 = metadata !{i32 200, i32 0, metadata !586, null}
+!602 = metadata !{i32 -1677573085}
+!603 = metadata !{i32 786688, metadata !586, metadata !"l_1049", metadata !5, i32 201, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1049] [line 201]
+!604 = metadata !{i32 201, i32 0, metadata !586, null}
+!605 = metadata !{i32 786688, metadata !586, metadata !"l_1051", metadata !5, i32 202, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1051] [line 202]
+!606 = metadata !{i32 202, i32 0, metadata !586, null}
+!607 = metadata !{i32 6}
+!608 = metadata !{i32 786688, metadata !586, metadata !"l_1052", metadata !5, i32 203, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1052] [line 203]
+!609 = metadata !{i32 203, i32 0, metadata !586, null}
+!610 = metadata !{i32 786688, metadata !586, metadata !"l_1053", metadata !5, i32 204, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1053] [line 204]
+!611 = metadata !{i32 204, i32 0, metadata !586, null}
+!612 = metadata !{i32 -10}
+!613 = metadata !{i32 786688, metadata !586, metadata !"l_1056", metadata !5, i32 205, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1056] [line 205]
+!614 = metadata !{i32 205, i32 0, metadata !586, null}
+!615 = metadata !{i32 5}
+!616 = metadata !{i32 786688, metadata !586, metadata !"l_1080", metadata !5, i32 206, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1080] [line 206]
+!617 = metadata !{i32 206, i32 0, metadata !586, null}
+!618 = metadata !{i16 8759}
+!619 = metadata !{i32 786688, metadata !586, metadata !"l_1149", metadata !5, i32 207, metadata !77, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1149] [line 207]
+!620 = metadata !{i32 207, i32 0, metadata !586, null}
+!621 = metadata !{i32** null}
+!622 = metadata !{i32 786688, metadata !586, metadata !"l_1152", metadata !5, i32 208, metadata !283, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1152] [line 208]
+!623 = metadata !{i32 208, i32 0, metadata !586, null}
+!624 = metadata !{i32 340, i32 0, metadata !625, null}
+!625 = metadata !{i32 786443, metadata !1, metadata !626, i32 322, i32 0, i32 101} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!626 = metadata !{i32 786443, metadata !1, metadata !627, i32 277, i32 0, i32 91} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!627 = metadata !{i32 786443, metadata !1, metadata !586, i32 244, i32 0, i32 87} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!628 = metadata !{i32 786688, metadata !586, metadata !"l_1179", metadata !5, i32 209, metadata !267, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1179] [line 209]
+!629 = metadata !{i32 209, i32 0, metadata !586, null}
+!630 = metadata !{i32 786688, metadata !586, metadata !"l_1178", metadata !5, i32 210, metadata !266, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1178] [line 210]
+!631 = metadata !{i32 210, i32 0, metadata !586, null}
+!632 = metadata !{i32 786688, metadata !586, metadata !"l_1181", metadata !5, i32 211, metadata !266, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1181] [line 211]
+!633 = metadata !{i32 211, i32 0, metadata !586, null}
+!634 = metadata !{[9 x i32****]* undef}
+!635 = metadata !{i32 786688, metadata !586, metadata !"l_1180", metadata !5, i32 212, metadata !636, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1180] [line 212]
+!636 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 288, i64 32, i32 0, i32 0, metadata !637, metadata !255, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 288, align 32, offset 0] [from ]
+!637 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !266} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!638 = metadata !{i32 212, i32 0, metadata !586, null}
+!639 = metadata !{i8 -8}
+!640 = metadata !{i32 786688, metadata !586, metadata !"l_1187", metadata !5, i32 213, metadata !59, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1187] [line 213]
+!641 = metadata !{i32 213, i32 0, metadata !586, null}
+!642 = metadata !{i16* null}
+!643 = metadata !{i32 786688, metadata !586, metadata !"l_1188", metadata !5, i32 214, metadata !644, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1188] [line 214]
+!644 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !77} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from int16_t]
+!645 = metadata !{i32 214, i32 0, metadata !586, null}
+!646 = metadata !{%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @func_10.l_1189 to %struct.S0*)}
+!647 = metadata !{i32 786688, metadata !586, metadata !"l_1189", metadata !5, i32 215, metadata !128, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1189] [line 215]
+!648 = metadata !{i32 215, i32 0, metadata !586, null}
+!649 = metadata !{i32 786688, metadata !586, metadata !"i", metadata !5, i32 216, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 216]
+!650 = metadata !{i32 217, i32 0, metadata !585, null}
+!651 = metadata !{i32 219, i32 0, metadata !652, null}
+!652 = metadata !{i32 786443, metadata !1, metadata !586, i32 219, i32 0, i32 80} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!653 = metadata !{i32 227, i32 0, metadata !654, null}
+!654 = metadata !{i32 786443, metadata !1, metadata !655, i32 226, i32 0, i32 83} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!655 = metadata !{i32 786443, metadata !1, metadata !656, i32 225, i32 0, i32 82} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!656 = metadata !{i32 786443, metadata !1, metadata !652, i32 220, i32 0, i32 81} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!657 = metadata !{i32 225, i32 0, metadata !655, null}
+!658 = metadata !{i32 229, i32 0, metadata !656, null}
+!659 = metadata !{i32 786688, metadata !656, metadata !"l_24", metadata !5, i32 221, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_24] [line 221]
+!660 = metadata !{i32 2}
+!661 = metadata !{i32 234, i32 0, metadata !586, null}
+!662 = metadata !{i32 235, i32 0, metadata !586, null}
+!663 = metadata !{i32 237, i32 0, metadata !664, null}
+!664 = metadata !{i32 786443, metadata !1, metadata !665, i32 237, i32 0, i32 85} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!665 = metadata !{i32 786443, metadata !1, metadata !586, i32 236, i32 0, i32 84} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!666 = metadata !{i32 786688, metadata !627, metadata !"l_1036", metadata !5, i32 245, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1036] [line 245]
+!667 = metadata !{i32 245, i32 0, metadata !627, null}
+!668 = metadata !{i32 -1530573517}
+!669 = metadata !{i32 786688, metadata !627, metadata !"l_1045", metadata !5, i32 246, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1045] [line 246]
+!670 = metadata !{i32 246, i32 0, metadata !627, null}
+!671 = metadata !{i32 -2046861780}
+!672 = metadata !{i32 786688, metadata !627, metadata !"l_1046", metadata !5, i32 247, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1046] [line 247]
+!673 = metadata !{i32 247, i32 0, metadata !627, null}
+!674 = metadata !{i32 -1684490856}
+!675 = metadata !{i32 786688, metadata !627, metadata !"l_1047", metadata !5, i32 248, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1047] [line 248]
+!676 = metadata !{i32 248, i32 0, metadata !627, null}
+!677 = metadata !{i32 786688, metadata !627, metadata !"l_1048", metadata !5, i32 249, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1048] [line 249]
+!678 = metadata !{i32 249, i32 0, metadata !627, null}
+!679 = metadata !{[4 x i32]* undef}
+!680 = metadata !{i32 786688, metadata !627, metadata !"l_1050", metadata !5, i32 250, metadata !681, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1050] [line 250]
+!681 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 128, i64 32, i32 0, i32 0, metadata !44, metadata !682, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 128, align 32, offset 0] [from int32_t]
+!682 = metadata !{metadata !185}
+!683 = metadata !{i32 250, i32 0, metadata !627, null}
+!684 = metadata !{%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @func_10.l_1075 to %struct.S2*)}
+!685 = metadata !{i32 786688, metadata !627, metadata !"l_1075", metadata !5, i32 251, metadata !190, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1075] [line 251]
+!686 = metadata !{i32 251, i32 0, metadata !627, null}
+!687 = metadata !{i16 -28090}
+!688 = metadata !{i32 786688, metadata !627, metadata !"l_1081", metadata !5, i32 252, metadata !77, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1081] [line 252]
+!689 = metadata !{i32 252, i32 0, metadata !627, null}
+!690 = metadata !{i32 786688, metadata !627, metadata !"l_1143", metadata !5, i32 253, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1143] [line 253]
+!691 = metadata !{i32 253, i32 0, metadata !627, null}
+!692 = metadata !{i32 786688, metadata !627, metadata !"l_1150", metadata !5, i32 254, metadata !693, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1150] [line 254]
+!693 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !167} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!694 = metadata !{i32 254, i32 0, metadata !627, null}
+!695 = metadata !{i32 256, i32 0, metadata !696, null}
+!696 = metadata !{i32 786443, metadata !1, metadata !627, i32 256, i32 0, i32 88} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!697 = metadata !{i32 260, i32 0, metadata !627, null}
+!698 = metadata !{i32* @g_465}
+!699 = metadata !{i32 786688, metadata !700, metadata !"l_1038", metadata !5, i32 262, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1038] [line 262]
+!700 = metadata !{i32 786443, metadata !1, metadata !627, i32 261, i32 0, i32 90} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!701 = metadata !{i32 262, i32 0, metadata !700, null}
+!702 = metadata !{i32 786688, metadata !700, metadata !"l_1039", metadata !5, i32 263, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1039] [line 263]
+!703 = metadata !{i32 263, i32 0, metadata !700, null}
+!704 = metadata !{i32 786688, metadata !700, metadata !"l_1040", metadata !5, i32 264, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1040] [line 264]
+!705 = metadata !{i32 264, i32 0, metadata !700, null}
+!706 = metadata !{i32 786688, metadata !700, metadata !"l_1041", metadata !5, i32 265, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1041] [line 265]
+!707 = metadata !{i32 265, i32 0, metadata !700, null}
+!708 = metadata !{i32 786688, metadata !700, metadata !"l_1042", metadata !5, i32 266, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1042] [line 266]
+!709 = metadata !{i32 266, i32 0, metadata !700, null}
+!710 = metadata !{i32 786688, metadata !700, metadata !"l_1043", metadata !5, i32 267, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1043] [line 267]
+!711 = metadata !{i32 267, i32 0, metadata !700, null}
+!712 = metadata !{[5 x i32*]* @func_10.l_1044}
+!713 = metadata !{i32 786688, metadata !700, metadata !"l_1044", metadata !5, i32 268, metadata !714, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1044] [line 268]
+!714 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 160, i64 32, i32 0, i32 0, metadata !50, metadata !715, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 160, align 32, offset 0] [from ]
+!715 = metadata !{metadata !186}
+!716 = metadata !{i32 268, i32 0, metadata !700, null}
+!717 = metadata !{i8* @g_258}
+!718 = metadata !{i32 786688, metadata !700, metadata !"l_1074", metadata !5, i32 269, metadata !719, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1074] [line 269]
+!719 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !59} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from int8_t]
+!720 = metadata !{i32 269, i32 0, metadata !700, null}
+!721 = metadata !{i32* getelementptr inbounds (%struct.S3* @g_25, i32 0, i32 0)}
+!722 = metadata !{i32 786688, metadata !700, metadata !"l_1078", metadata !5, i32 270, metadata !723, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1078] [line 270]
+!723 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !17} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from uint32_t]
+!724 = metadata !{i32 270, i32 0, metadata !700, null}
+!725 = metadata !{i32* getelementptr inbounds ([4 x [5 x i32]]* @g_1057, i32 0, i32 2, i32 1)}
+!726 = metadata !{i32 786688, metadata !700, metadata !"l_1079", metadata !5, i32 271, metadata !723, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1079] [line 271]
+!727 = metadata !{i32 271, i32 0, metadata !700, null}
+!728 = metadata !{i32 273, i32 0, metadata !700, null}
+!729 = metadata !{i32 274, i32 0, metadata !700, null}
+!730 = metadata !{i32 275, i32 0, metadata !700, null}
+!731 = metadata !{i32 336, i32 0, metadata !732, null}
+!732 = metadata !{i32 786443, metadata !1, metadata !733, i32 335, i32 0, i32 105} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!733 = metadata !{i32 786443, metadata !1, metadata !734, i32 334, i32 0, i32 104} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!734 = metadata !{i32 786443, metadata !1, metadata !625, i32 333, i32 0, i32 103} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!735 = metadata !{i32 786688, metadata !625, metadata !"j", metadata !5, i32 330, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [j] [line 330]
+!736 = metadata !{i32 335, i32 0, metadata !732, null}
+!737 = metadata !{i32 342, i32 0, metadata !625, null}
+!738 = metadata !{i32 344, i32 0, metadata !626, null}
+!739 = metadata !{i32 347, i32 0, metadata !586, null}
+!740 = metadata !{i32 348, i32 0, metadata !586, null}
+!741 = metadata !{i32 349, i32 0, metadata !586, null}
+!742 = metadata !{i32 786689, metadata !124, metadata !"ui1", metadata !53, i32 16777871, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 655]
+!743 = metadata !{i32 655, i32 0, metadata !124, null}
+!744 = metadata !{i32 786689, metadata !124, metadata !"ui2", metadata !53, i32 33555087, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 655]
+!745 = metadata !{i32 658, i32 0, metadata !124, null}
+!746 = metadata !{i32 786689, metadata !123, metadata !"ui1", metadata !53, i32 16777776, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 560]
+!747 = metadata !{i32 560, i32 0, metadata !123, null}
+!748 = metadata !{i32 786689, metadata !123, metadata !"ui2", metadata !53, i32 33554992, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 560]
+!749 = metadata !{i32 563, i32 0, metadata !123, null}
+!750 = metadata !{i32 786689, metadata !120, metadata !"left", metadata !53, i32 16777310, metadata !59, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 94]
+!751 = metadata !{i32 94, i32 0, metadata !120, null}
+!752 = metadata !{i32 786689, metadata !120, metadata !"right", metadata !53, i32 33554526, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 94]
+!753 = metadata !{i32 97, i32 0, metadata !120, null}
+!754 = metadata !{i32 786689, metadata !119, metadata !"left", metadata !53, i32 16777933, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 717]
+!755 = metadata !{i32 717, i32 0, metadata !119, null}
+!756 = metadata !{i32 786689, metadata !119, metadata !"right", metadata !53, i32 33555149, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 717]
+!757 = metadata !{i32 720, i32 0, metadata !119, null}
+!758 = metadata !{i32 786689, metadata !118, metadata !"ui1", metadata !53, i32 16777987, metadata !17, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 771]
+!759 = metadata !{i32 771, i32 0, metadata !118, null}
+!760 = metadata !{i32 786689, metadata !118, metadata !"ui2", metadata !53, i32 33555203, metadata !17, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 771]
+!761 = metadata !{i32 774, i32 0, metadata !118, null}
+!762 = metadata !{i32 786689, metadata !117, metadata !"si1", metadata !53, i32 16777518, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 302]
+!763 = metadata !{i32 302, i32 0, metadata !117, null}
+!764 = metadata !{i32 786689, metadata !117, metadata !"si2", metadata !53, i32 33554734, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si2] [line 302]
+!765 = metadata !{i32 305, i32 0, metadata !117, null}
+!766 = metadata !{i32 786689, metadata !111, metadata !"p_27", metadata !5, i32 16777677, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_27] [line 461]
+!767 = metadata !{i32 461, i32 0, metadata !111, null}
+!768 = metadata !{i32 786689, metadata !111, metadata !"p_28", metadata !5, i32 33554893, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_28] [line 461]
+!769 = metadata !{i8 -9}
+!770 = metadata !{i32 786688, metadata !771, metadata !"l_483", metadata !5, i32 463, metadata !32, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_483] [line 463]
+!771 = metadata !{i32 786443, metadata !1, metadata !111} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!772 = metadata !{i32 463, i32 0, metadata !771, null}
+!773 = metadata !{i16* @g_332}
+!774 = metadata !{i32 786688, metadata !771, metadata !"l_484", metadata !5, i32 464, metadata !273, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_484] [line 464]
+!775 = metadata !{i32 464, i32 0, metadata !771, null}
+!776 = metadata !{i32 -1730445716}
+!777 = metadata !{i32 786688, metadata !771, metadata !"l_485", metadata !5, i32 465, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_485] [line 465]
+!778 = metadata !{i32 465, i32 0, metadata !771, null}
+!779 = metadata !{%union.U4* @func_26.l_486}
+!780 = metadata !{i32 786688, metadata !771, metadata !"l_486", metadata !5, i32 466, metadata !85, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_486] [line 466]
+!781 = metadata !{i32 466, i32 0, metadata !771, null}
+!782 = metadata !{%struct.S1* @func_26.l_488}
+!783 = metadata !{i32 786688, metadata !771, metadata !"l_488", metadata !5, i32 467, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_488] [line 467]
+!784 = metadata !{i32 467, i32 0, metadata !771, null}
+!785 = metadata !{%struct.S3* @func_26.l_489}
+!786 = metadata !{i32 786688, metadata !771, metadata !"l_489", metadata !5, i32 468, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_489] [line 468]
+!787 = metadata !{i32 468, i32 0, metadata !771, null}
+!788 = metadata !{[8 x [3 x [4 x i32]]]* @func_26.l_504}
+!789 = metadata !{i32 786688, metadata !771, metadata !"l_504", metadata !5, i32 469, metadata !790, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_504] [line 469]
+!790 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 3072, i64 32, i32 0, i32 0, metadata !44, metadata !791, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 3072, align 32, offset 0] [from int32_t]
+!791 = metadata !{metadata !202, metadata !196, metadata !185}
+!792 = metadata !{i32 469, i32 0, metadata !771, null}
+!793 = metadata !{i32 1685967616}
+!794 = metadata !{i32 786688, metadata !771, metadata !"l_507", metadata !5, i32 470, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_507] [line 470]
+!795 = metadata !{i32 470, i32 0, metadata !771, null}
+!796 = metadata !{%struct.S2* undef}
+!797 = metadata !{i32 786688, metadata !771, metadata !"l_550", metadata !5, i32 471, metadata !190, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_550] [line 471]
+!798 = metadata !{i32 471, i32 0, metadata !771, null}
+!799 = metadata !{i32* @g_52}
+!800 = metadata !{i32 786688, metadata !771, metadata !"l_558", metadata !5, i32 472, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_558] [line 472]
+!801 = metadata !{i32 472, i32 0, metadata !771, null}
+!802 = metadata !{i32* null}
+!803 = metadata !{i32 786688, metadata !771, metadata !"l_560", metadata !5, i32 474, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_560] [line 474]
+!804 = metadata !{i32 474, i32 0, metadata !771, null}
+!805 = metadata !{i32 786688, metadata !771, metadata !"l_561", metadata !5, i32 475, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_561] [line 475]
+!806 = metadata !{i32 475, i32 0, metadata !771, null}
+!807 = metadata !{i32 786688, metadata !771, metadata !"l_562", metadata !5, i32 476, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_562] [line 476]
+!808 = metadata !{i32 476, i32 0, metadata !771, null}
+!809 = metadata !{i32 786688, metadata !771, metadata !"l_563", metadata !5, i32 477, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_563] [line 477]
+!810 = metadata !{i32 477, i32 0, metadata !771, null}
+!811 = metadata !{i32 786688, metadata !771, metadata !"l_564", metadata !5, i32 478, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_564] [line 478]
+!812 = metadata !{i32 478, i32 0, metadata !771, null}
+!813 = metadata !{i32 786688, metadata !771, metadata !"l_565", metadata !5, i32 479, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_565] [line 479]
+!814 = metadata !{i32 479, i32 0, metadata !771, null}
+!815 = metadata !{i32 786688, metadata !771, metadata !"l_566", metadata !5, i32 480, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_566] [line 480]
+!816 = metadata !{i32 480, i32 0, metadata !771, null}
+!817 = metadata !{i32 786688, metadata !771, metadata !"l_568", metadata !5, i32 482, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_568] [line 482]
+!818 = metadata !{i32 482, i32 0, metadata !771, null}
+!819 = metadata !{i32 786688, metadata !771, metadata !"l_570", metadata !5, i32 484, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_570] [line 484]
+!820 = metadata !{i32 484, i32 0, metadata !771, null}
+!821 = metadata !{i32 786688, metadata !771, metadata !"l_571", metadata !5, i32 485, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_571] [line 485]
+!822 = metadata !{i32 485, i32 0, metadata !771, null}
+!823 = metadata !{i32 786688, metadata !771, metadata !"l_573", metadata !5, i32 487, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_573] [line 487]
+!824 = metadata !{i32 487, i32 0, metadata !771, null}
+!825 = metadata !{i32 786688, metadata !771, metadata !"i", metadata !5, i32 489, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 489]
+!826 = metadata !{i32 490, i32 0, metadata !827, null}
+!827 = metadata !{i32 786443, metadata !1, metadata !771, i32 490, i32 0, i32 55} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!828 = metadata !{i32 492, i32 0, metadata !829, null}
+!829 = metadata !{i32 786443, metadata !1, metadata !771, i32 492, i32 0, i32 56} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!830 = metadata !{i32 502, i32 0, metadata !831, null}
+!831 = metadata !{i32 786443, metadata !1, metadata !829, i32 493, i32 0, i32 57} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!832 = metadata !{i32 -896393958}
+!833 = metadata !{i32 786688, metadata !834, metadata !"l_487", metadata !5, i32 504, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_487] [line 504]
+!834 = metadata !{i32 786443, metadata !1, metadata !831, i32 503, i32 0, i32 59} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!835 = metadata !{i32 504, i32 0, metadata !834, null}
+!836 = metadata !{[4 x [3 x i32**]]* undef}
+!837 = metadata !{i32 786688, metadata !834, metadata !"l_491", metadata !5, i32 505, metadata !838, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_491] [line 505]
+!838 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 384, i64 32, i32 0, i32 0, metadata !267, metadata !195, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 384, align 32, offset 0] [from ]
+!839 = metadata !{i32 505, i32 0, metadata !834, null}
+!840 = metadata !{i32 507, i32 0, metadata !834, null}
+!841 = metadata !{i32 596, i32 0, metadata !842, null}
+!842 = metadata !{i32 786443, metadata !1, metadata !831, i32 596, i32 0, i32 77} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!843 = metadata !{i32 599, i32 0, metadata !844, null}
+!844 = metadata !{i32 786443, metadata !1, metadata !842, i32 597, i32 0, i32 78} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!845 = metadata !{i8 -10}
+!846 = metadata !{i32 786688, metadata !847, metadata !"l_492", metadata !5, i32 511, metadata !59, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_492] [line 511]
+!847 = metadata !{i32 786443, metadata !1, metadata !831, i32 510, i32 0, i32 60} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!848 = metadata !{i32 511, i32 0, metadata !847, null}
+!849 = metadata !{i32 -1895868394}
+!850 = metadata !{i32 786688, metadata !847, metadata !"l_493", metadata !5, i32 512, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_493] [line 512]
+!851 = metadata !{i32 512, i32 0, metadata !847, null}
+!852 = metadata !{i32 -1012628145}
+!853 = metadata !{i32 786688, metadata !847, metadata !"l_502", metadata !5, i32 513, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_502] [line 513]
+!854 = metadata !{i32 513, i32 0, metadata !847, null}
+!855 = metadata !{i32 786688, metadata !847, metadata !"l_503", metadata !5, i32 514, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_503] [line 514]
+!856 = metadata !{i32 514, i32 0, metadata !847, null}
+!857 = metadata !{i32 -2}
+!858 = metadata !{i32 786688, metadata !847, metadata !"l_505", metadata !5, i32 515, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_505] [line 515]
+!859 = metadata !{i32 515, i32 0, metadata !847, null}
+!860 = metadata !{i32 -1827152685}
+!861 = metadata !{i32 786688, metadata !847, metadata !"l_506", metadata !5, i32 516, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_506] [line 516]
+!862 = metadata !{i32 516, i32 0, metadata !847, null}
+!863 = metadata !{i32 1005329122}
+!864 = metadata !{i32 786688, metadata !847, metadata !"l_530", metadata !5, i32 517, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_530] [line 517]
+!865 = metadata !{i32 517, i32 0, metadata !847, null}
+!866 = metadata !{i32 -958636775}
+!867 = metadata !{i32 786688, metadata !847, metadata !"l_533", metadata !5, i32 518, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_533] [line 518]
+!868 = metadata !{i32 518, i32 0, metadata !847, null}
+!869 = metadata !{%struct.S1* @func_26.l_555}
+!870 = metadata !{i32 786688, metadata !847, metadata !"l_555", metadata !5, i32 520, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_555] [line 520]
+!871 = metadata !{i32 520, i32 0, metadata !847, null}
+!872 = metadata !{%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @func_26.l_556 to %struct.S2*)}
+!873 = metadata !{i32 786688, metadata !847, metadata !"l_556", metadata !5, i32 521, metadata !190, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_556] [line 521]
+!874 = metadata !{i32 521, i32 0, metadata !847, null}
+!875 = metadata !{i32 522, i32 0, metadata !876, null}
+!876 = metadata !{i32 786443, metadata !1, metadata !847, i32 522, i32 0, i32 61} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!877 = metadata !{i32 -9}
+!878 = metadata !{i32 786688, metadata !879, metadata !"l_496", metadata !5, i32 526, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_496] [line 526]
+!879 = metadata !{i32 786443, metadata !1, metadata !876, i32 523, i32 0, i32 62} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!880 = metadata !{i32 526, i32 0, metadata !879, null}
+!881 = metadata !{i32 786688, metadata !879, metadata !"l_497", metadata !5, i32 527, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_497] [line 527]
+!882 = metadata !{i32 527, i32 0, metadata !879, null}
+!883 = metadata !{i32 786688, metadata !879, metadata !"l_499", metadata !5, i32 529, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_499] [line 529]
+!884 = metadata !{i32 529, i32 0, metadata !879, null}
+!885 = metadata !{i32 1885145111}
+!886 = metadata !{i32 786688, metadata !879, metadata !"l_500", metadata !5, i32 530, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_500] [line 530]
+!887 = metadata !{i32 530, i32 0, metadata !879, null}
+!888 = metadata !{[9 x [7 x i32*]]* undef}
+!889 = metadata !{i32 786688, metadata !879, metadata !"l_501", metadata !5, i32 531, metadata !890, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_501] [line 531]
+!890 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 2016, i64 32, i32 0, i32 0, metadata !50, metadata !891, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 2016, align 32, offset 0] [from ]
+!891 = metadata !{metadata !227, metadata !228}
+!892 = metadata !{i32 531, i32 0, metadata !879, null}
+!893 = metadata !{%struct.S1** null}
+!894 = metadata !{i32 786688, metadata !879, metadata !"l_523", metadata !5, i32 532, metadata !895, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_523] [line 532]
+!895 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !276} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!896 = metadata !{i32 532, i32 0, metadata !879, null}
+!897 = metadata !{i32 1685967615}
+!898 = metadata !{i32 534, i32 0, metadata !879, null}
+!899 = metadata !{i32 535, i32 0, metadata !900, null}
+!900 = metadata !{i32 786443, metadata !1, metadata !879, i32 535, i32 0, i32 63} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!901 = metadata !{i32* getelementptr inbounds ([9 x %struct.S3]* @g_49, i32 0, i32 3, i32 0)}
+!902 = metadata !{i32 786688, metadata !903, metadata !"l_514", metadata !5, i32 537, metadata !723, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_514] [line 537]
+!903 = metadata !{i32 786443, metadata !1, metadata !900, i32 536, i32 0, i32 64} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!904 = metadata !{i32 537, i32 0, metadata !903, null}
+!905 = metadata !{[3 x [8 x [7 x i16]]]* @func_26.l_519}
+!906 = metadata !{i32 786688, metadata !903, metadata !"l_519", metadata !5, i32 539, metadata !907, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_519] [line 539]
+!907 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 2688, i64 16, i32 0, i32 0, metadata !77, metadata !908, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 2688, align 16, offset 0] [from int16_t]
+!908 = metadata !{metadata !196, metadata !202, metadata !228}
+!909 = metadata !{i32 539, i32 0, metadata !903, null}
+!910 = metadata !{%struct.S1* @func_26.l_522}
+!911 = metadata !{i32 786688, metadata !903, metadata !"l_522", metadata !5, i32 540, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_522] [line 540]
+!912 = metadata !{i32 540, i32 0, metadata !903, null}
+!913 = metadata !{i32 542, i32 0, metadata !903, null}
+!914 = metadata !{i32 543, i32 0, metadata !903, null}
+!915 = metadata !{i32 604, i32 0, metadata !771, null}
+!916 = metadata !{i32 786689, metadata !107, metadata !"si1", metadata !53, i32 16777272, metadata !59, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 56]
+!917 = metadata !{i32 56, i32 0, metadata !107, null}
+!918 = metadata !{i32 786689, metadata !107, metadata !"si2", metadata !53, i32 33554488, metadata !59, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si2] [line 56]
+!919 = metadata !{i32 59, i32 0, metadata !107, null}
+!920 = metadata !{i32 786689, metadata !105, metadata !"ui1", metadata !53, i32 16777897, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 681]
+!921 = metadata !{i32 681, i32 0, metadata !105, null}
+!922 = metadata !{i32 786689, metadata !105, metadata !"ui2", metadata !53, i32 33555113, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 681]
+!923 = metadata !{i32 684, i32 0, metadata !105, null}
+!924 = metadata !{i32 786689, metadata !82, metadata !"p_35", metadata !5, i32 16777869, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_35] [line 653]
+!925 = metadata !{i32 653, i32 0, metadata !82, null}
+!926 = metadata !{i32 786688, metadata !927, metadata !"l_409", metadata !5, i32 655, metadata !190, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_409] [line 655]
+!927 = metadata !{i32 786443, metadata !1, metadata !82} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!928 = metadata !{i32 655, i32 0, metadata !927, null}
+!929 = metadata !{i32 786688, metadata !927, metadata !"l_416", metadata !5, i32 656, metadata !723, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_416] [line 656]
+!930 = metadata !{i32 656, i32 0, metadata !927, null}
+!931 = metadata !{i32 786688, metadata !927, metadata !"l_418", metadata !5, i32 658, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_418] [line 658]
+!932 = metadata !{i32 658, i32 0, metadata !927, null}
+!933 = metadata !{i32 -2107753489}
+!934 = metadata !{i32 786688, metadata !927, metadata !"l_419", metadata !5, i32 659, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_419] [line 659]
+!935 = metadata !{i32 659, i32 0, metadata !927, null}
+!936 = metadata !{i32 85591085}
+!937 = metadata !{i32 786688, metadata !927, metadata !"l_420", metadata !5, i32 660, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_420] [line 660]
+!938 = metadata !{i32 660, i32 0, metadata !927, null}
+!939 = metadata !{i32 786688, metadata !927, metadata !"l_443", metadata !5, i32 661, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_443] [line 661]
+!940 = metadata !{i32 661, i32 0, metadata !927, null}
+!941 = metadata !{i32 786688, metadata !927, metadata !"l_445", metadata !5, i32 663, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_445] [line 663]
+!942 = metadata !{i32 663, i32 0, metadata !927, null}
+!943 = metadata !{i32 786688, metadata !927, metadata !"l_446", metadata !5, i32 664, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_446] [line 664]
+!944 = metadata !{i32 664, i32 0, metadata !927, null}
+!945 = metadata !{i32 786688, metadata !927, metadata !"l_447", metadata !5, i32 665, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_447] [line 665]
+!946 = metadata !{i32 665, i32 0, metadata !927, null}
+!947 = metadata !{i32 786688, metadata !927, metadata !"l_449", metadata !5, i32 667, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_449] [line 667]
+!948 = metadata !{i32 667, i32 0, metadata !927, null}
+!949 = metadata !{[2 x [10 x i32*]]* undef}
+!950 = metadata !{i32 786688, metadata !927, metadata !"l_451", metadata !5, i32 669, metadata !951, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_451] [line 669]
+!951 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 640, i64 32, i32 0, i32 0, metadata !50, metadata !952, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 640, align 32, offset 0] [from ]
+!952 = metadata !{metadata !278, metadata !201}
+!953 = metadata !{i32 669, i32 0, metadata !927, null}
+!954 = metadata !{i8 -6}
+!955 = metadata !{i32 786688, metadata !927, metadata !"l_453", metadata !5, i32 670, metadata !59, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_453] [line 670]
+!956 = metadata !{i32 670, i32 0, metadata !927, null}
+!957 = metadata !{i32 786688, metadata !927, metadata !"i", metadata !5, i32 671, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 671]
+!958 = metadata !{i32 672, i32 0, metadata !959, null}
+!959 = metadata !{i32 786443, metadata !1, metadata !927, i32 672, i32 0, i32 54} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!960 = metadata !{i32 674, i32 0, metadata !927, null}
+!961 = metadata !{i32 675, i32 0, metadata !927, null}
+!962 = metadata !{i32 676, i32 0, metadata !927, null}
+!963 = metadata !{i32 786689, metadata !47, metadata !"p_46", metadata !5, i32 16778149, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_46] [line 933]
+!964 = metadata !{i32 933, i32 0, metadata !47, null}
+!965 = metadata !{i32 786689, metadata !47, metadata !"p_47", metadata !5, i32 33555365, metadata !37, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_47] [line 933]
+!966 = metadata !{i32 786688, metadata !47, metadata !"l_51", metadata !5, i32 935, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_51] [line 935]
+!967 = metadata !{i32 935, i32 0, metadata !47, null}
+!968 = metadata !{i32 786688, metadata !47, metadata !"l_53", metadata !5, i32 936, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_53] [line 936]
+!969 = metadata !{i32 936, i32 0, metadata !47, null}
+!970 = metadata !{i32 786688, metadata !47, metadata !"l_54", metadata !5, i32 937, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_54] [line 937]
+!971 = metadata !{i32 937, i32 0, metadata !47, null}
+!972 = metadata !{i32 786688, metadata !47, metadata !"l_55", metadata !5, i32 938, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_55] [line 938]
+!973 = metadata !{i32 938, i32 0, metadata !47, null}
+!974 = metadata !{i32 786688, metadata !47, metadata !"l_56", metadata !5, i32 939, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_56] [line 939]
+!975 = metadata !{i32 939, i32 0, metadata !47, null}
+!976 = metadata !{i32 786688, metadata !47, metadata !"l_57", metadata !5, i32 940, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_57] [line 940]
+!977 = metadata !{i32 940, i32 0, metadata !47, null}
+!978 = metadata !{i32 786688, metadata !47, metadata !"l_58", metadata !5, i32 941, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_58] [line 941]
+!979 = metadata !{i32 941, i32 0, metadata !47, null}
+!980 = metadata !{i32 786688, metadata !47, metadata !"l_59", metadata !5, i32 942, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_59] [line 942]
+!981 = metadata !{i32 942, i32 0, metadata !47, null}
+!982 = metadata !{i32 1915037093}
+!983 = metadata !{i32 786688, metadata !47, metadata !"l_60", metadata !5, i32 943, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_60] [line 943]
+!984 = metadata !{i32 943, i32 0, metadata !47, null}
+!985 = metadata !{i32 786688, metadata !47, metadata !"l_61", metadata !5, i32 944, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_61] [line 944]
+!986 = metadata !{i32 944, i32 0, metadata !47, null}
+!987 = metadata !{i32 786688, metadata !47, metadata !"l_62", metadata !5, i32 945, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_62] [line 945]
+!988 = metadata !{i32 945, i32 0, metadata !47, null}
+!989 = metadata !{i32 786688, metadata !47, metadata !"l_63", metadata !5, i32 946, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_63] [line 946]
+!990 = metadata !{i32 946, i32 0, metadata !47, null}
+!991 = metadata !{i32 786688, metadata !47, metadata !"l_65", metadata !5, i32 948, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_65] [line 948]
+!992 = metadata !{i32 948, i32 0, metadata !47, null}
+!993 = metadata !{i8 93}
+!994 = metadata !{i32 786688, metadata !47, metadata !"l_66", metadata !5, i32 949, metadata !32, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_66] [line 949]
+!995 = metadata !{i32 949, i32 0, metadata !47, null}
+!996 = metadata !{%struct.S3* undef}
+!997 = metadata !{i32 786688, metadata !47, metadata !"l_76", metadata !5, i32 950, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_76] [line 950]
+!998 = metadata !{i32 950, i32 0, metadata !47, null}
+!999 = metadata !{i32 786688, metadata !47, metadata !"l_93", metadata !5, i32 951, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_93] [line 951]
+!1000 = metadata !{i32 951, i32 0, metadata !47, null}
+!1001 = metadata !{i32 -865668630}
+!1002 = metadata !{i32 786688, metadata !47, metadata !"l_95", metadata !5, i32 952, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_95] [line 952]
+!1003 = metadata !{i32 952, i32 0, metadata !47, null}
+!1004 = metadata !{i16* @g_103}
+!1005 = metadata !{i32 786688, metadata !47, metadata !"l_123", metadata !5, i32 953, metadata !273, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_123] [line 953]
+!1006 = metadata !{i32 953, i32 0, metadata !47, null}
+!1007 = metadata !{[7 x %struct.S2]* bitcast (<{ { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] }, { i8, i8, [2 x i8] } }>* @func_45.l_152 to [7 x %struct.S2]*)}
+!1008 = metadata !{i32 786688, metadata !47, metadata !"l_152", metadata !5, i32 954, metadata !1009, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_152] [line 954]
+!1009 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 224, i64 32, i32 0, i32 0, metadata !190, metadata !1010, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 224, align 32, offset 0] [from S2]
+!1010 = metadata !{metadata !228}
+!1011 = metadata !{i32 954, i32 0, metadata !47, null}
+!1012 = metadata !{%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @func_45.l_154 to %struct.S0*)}
+!1013 = metadata !{i32 786688, metadata !47, metadata !"l_154", metadata !5, i32 955, metadata !128, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_154] [line 955]
+!1014 = metadata !{i32 955, i32 0, metadata !47, null}
+!1015 = metadata !{i8 94}
+!1016 = metadata !{i32 957, i32 0, metadata !47, null}
+!1017 = metadata !{i32 990, i32 0, metadata !1018, null}
+!1018 = metadata !{i32 786443, metadata !1, metadata !47, i32 990, i32 0, i32 41} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1019 = metadata !{i32 1051, i32 0, metadata !47, null}
+!1020 = metadata !{i8 -22}
+!1021 = metadata !{i32 786689, metadata !79, metadata !"ui2", metadata !53, i32 33554978, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 546]
+!1022 = metadata !{i32 546, i32 0, metadata !79, null}
+!1023 = metadata !{i32 549, i32 0, metadata !79, null}
+!1024 = metadata !{i32 786689, metadata !74, metadata !"si1", metadata !53, i32 16777374, metadata !77, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 158]
+!1025 = metadata !{i32 158, i32 0, metadata !74, null}
+!1026 = metadata !{i32 786689, metadata !74, metadata !"si2", metadata !53, i32 33554590, metadata !77, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si2] [line 158]
+!1027 = metadata !{i32 161, i32 0, metadata !74, null}
+!1028 = metadata !{i32 4}
+!1029 = metadata !{i32 786689, metadata !71, metadata !"right", metadata !53, i32 33555125, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 693]
+!1030 = metadata !{i32 693, i32 0, metadata !71, null}
+!1031 = metadata !{i32 696, i32 0, metadata !71, null}
+!1032 = metadata !{i32 786689, metadata !68, metadata !"left", metadata !53, i32 16777945, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 729]
+!1033 = metadata !{i32 729, i32 0, metadata !68, null}
+!1034 = metadata !{i32 786689, metadata !68, metadata !"right", metadata !53, i32 33555161, metadata !19, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 729]
+!1035 = metadata !{i32 732, i32 0, metadata !68, null}
+!1036 = metadata !{i32 786689, metadata !62, metadata !"si1", metadata !53, i32 16777558, metadata !44, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 342]
+!1037 = metadata !{i32 342, i32 0, metadata !62, null}
+!1038 = metadata !{i32 345, i32 0, metadata !62, null}
+!1039 = metadata !{i32 786689, metadata !102, metadata !"left", metadata !53, i32 16777346, metadata !59, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 130]
+!1040 = metadata !{i32 130, i32 0, metadata !102, null}
+!1041 = metadata !{i32 786689, metadata !102, metadata !"right", metadata !53, i32 33554562, metadata !19, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 130]
+!1042 = metadata !{i32 133, i32 0, metadata !102, null}
+!1043 = metadata !{i32 786689, metadata !95, metadata !"left", metadata !53, i32 16777819, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 603]
+!1044 = metadata !{i32 603, i32 0, metadata !95, null}
+!1045 = metadata !{i32 786689, metadata !95, metadata !"right", metadata !53, i32 33555035, metadata !19, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 603]
+!1046 = metadata !{i32 606, i32 0, metadata !95, null}
+!1047 = metadata !{i32 786689, metadata !94, metadata !"si1", metadata !53, i32 16777402, metadata !77, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si1] [line 186]
+!1048 = metadata !{i32 186, i32 0, metadata !94, null}
+!1049 = metadata !{i32 786689, metadata !94, metadata !"si2", metadata !53, i32 33554618, metadata !77, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [si2] [line 186]
+!1050 = metadata !{i32 189, i32 0, metadata !94, null}
+!1051 = metadata !{i32 786689, metadata !93, metadata !"ui1", metadata !53, i32 16777885, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 669]
+!1052 = metadata !{i32 669, i32 0, metadata !93, null}
+!1053 = metadata !{i32 786689, metadata !93, metadata !"ui2", metadata !53, i32 33555101, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 669]
+!1054 = metadata !{i32 672, i32 0, metadata !93, null}
+!1055 = metadata !{i32 786689, metadata !89, metadata !"ui1", metadata !53, i32 16777864, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 648]
+!1056 = metadata !{i32 648, i32 0, metadata !89, null}
+!1057 = metadata !{i32 786689, metadata !89, metadata !"ui2", metadata !53, i32 33555080, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 648]
+!1058 = metadata !{i32 651, i32 0, metadata !1059, null}
+!1059 = metadata !{i32 786443, metadata !52, metadata !89} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./safe_math.h]
+!1060 = metadata !{i32 786689, metadata !114, metadata !"left", metadata !53, i32 16777464, metadata !77, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 248]
+!1061 = metadata !{i32 248, i32 0, metadata !114, null}
+!1062 = metadata !{i32 786689, metadata !114, metadata !"right", metadata !53, i32 33554680, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 248]
+!1063 = metadata !{i32 251, i32 0, metadata !1064, null}
+!1064 = metadata !{i32 786443, metadata !52, metadata !114} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./safe_math.h]
+!1065 = metadata !{i32 786689, metadata !169, metadata !"p_16", metadata !5, i32 16777573, metadata !167, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_16] [line 357]
+!1066 = metadata !{i32 357, i32 0, metadata !169, null}
+!1067 = metadata !{i16 0}
+!1068 = metadata !{i32 786689, metadata !169, metadata !"p_18", metadata !5, i32 50332005, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_18] [line 357]
+!1069 = metadata !{i16 1}
+!1070 = metadata !{i32 786688, metadata !1071, metadata !"l_766", metadata !5, i32 359, metadata !45, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_766] [line 359]
+!1071 = metadata !{i32 786443, metadata !1, metadata !169} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1072 = metadata !{i32 359, i32 0, metadata !1071, null}
+!1073 = metadata !{i32 786688, metadata !1071, metadata !"l_771", metadata !5, i32 360, metadata !288, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_771] [line 360]
+!1074 = metadata !{i32 360, i32 0, metadata !1071, null}
+!1075 = metadata !{i32 786688, metadata !1071, metadata !"l_774", metadata !5, i32 361, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_774] [line 361]
+!1076 = metadata !{i32 361, i32 0, metadata !1071, null}
+!1077 = metadata !{[6 x %union.U4]* @func_15.l_789}
+!1078 = metadata !{i32 786688, metadata !1071, metadata !"l_789", metadata !5, i32 362, metadata !1079, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_789] [line 362]
+!1079 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 192, i64 32, i32 0, i32 0, metadata !85, metadata !233, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 192, align 32, offset 0] [from U4]
+!1080 = metadata !{i32 362, i32 0, metadata !1071, null}
+!1081 = metadata !{i32 786688, metadata !1071, metadata !"l_795", metadata !5, i32 364, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_795] [line 364]
+!1082 = metadata !{i32 364, i32 0, metadata !1071, null}
+!1083 = metadata !{i16 -17499}
+!1084 = metadata !{i32 786688, metadata !1071, metadata !"l_803", metadata !5, i32 365, metadata !77, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_803] [line 365]
+!1085 = metadata !{i32 365, i32 0, metadata !1071, null}
+!1086 = metadata !{i32 -291298526}
+!1087 = metadata !{i32 786688, metadata !1071, metadata !"l_812", metadata !5, i32 366, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_812] [line 366]
+!1088 = metadata !{i32 366, i32 0, metadata !1071, null}
+!1089 = metadata !{i32 -1504359129}
+!1090 = metadata !{i32 786688, metadata !1071, metadata !"l_813", metadata !5, i32 367, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_813] [line 367]
+!1091 = metadata !{i32 367, i32 0, metadata !1071, null}
+!1092 = metadata !{[8 x [1 x [4 x i32]]]* @func_15.l_814}
+!1093 = metadata !{i32 786688, metadata !1071, metadata !"l_814", metadata !5, i32 368, metadata !1094, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_814] [line 368]
+!1094 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 1024, i64 32, i32 0, i32 0, metadata !44, metadata !1095, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 1024, align 32, offset 0] [from int32_t]
+!1095 = metadata !{metadata !202, metadata !221, metadata !185}
+!1096 = metadata !{i32 368, i32 0, metadata !1071, null}
+!1097 = metadata !{i32 786688, metadata !1071, metadata !"l_816", metadata !5, i32 369, metadata !45, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_816] [line 369]
+!1098 = metadata !{i32 369, i32 0, metadata !1071, null}
+!1099 = metadata !{%union.U4* null}
+!1100 = metadata !{i32 786688, metadata !1071, metadata !"l_920", metadata !5, i32 371, metadata !515, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_920] [line 371]
+!1101 = metadata !{i32 371, i32 0, metadata !1071, null}
+!1102 = metadata !{[4 x [5 x [5 x %union.U4**]]]* undef}
+!1103 = metadata !{i32 786688, metadata !1071, metadata !"l_919", metadata !5, i32 372, metadata !1104, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_919] [line 372]
+!1104 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 3200, i64 32, i32 0, i32 0, metadata !1105, metadata !1106, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 3200, align 32, offset 0] [from ]
+!1105 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !515} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!1106 = metadata !{metadata !185, metadata !186, metadata !186}
+!1107 = metadata !{i32 372, i32 0, metadata !1071, null}
+!1108 = metadata !{%union.U4*** undef}
+!1109 = metadata !{i32 786688, metadata !1071, metadata !"l_918", metadata !5, i32 373, metadata !1110, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_918] [line 373]
+!1110 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !1111} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!1111 = metadata !{i32 786470, null, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, metadata !1105} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from ]
+!1112 = metadata !{i32 373, i32 0, metadata !1071, null}
+!1113 = metadata !{%struct.S1* @func_15.l_963}
+!1114 = metadata !{i32 786688, metadata !1071, metadata !"l_963", metadata !5, i32 374, metadata !155, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_963] [line 374]
+!1115 = metadata !{i32 374, i32 0, metadata !1071, null}
+!1116 = metadata !{i32 786688, metadata !1071, metadata !"l_1004", metadata !5, i32 375, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1004] [line 375]
+!1117 = metadata !{i32 375, i32 0, metadata !1071, null}
+!1118 = metadata !{%struct.S1* @g_99}
+!1119 = metadata !{i32 786688, metadata !1071, metadata !"l_1015", metadata !5, i32 376, metadata !1120, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1015] [line 376]
+!1120 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !155} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from S1]
+!1121 = metadata !{i32 376, i32 0, metadata !1071, null}
+!1122 = metadata !{[1 x [10 x [10 x %struct.S1***]]]* undef}
+!1123 = metadata !{i32 786688, metadata !1071, metadata !"l_1013", metadata !5, i32 378, metadata !1124, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_1013] [line 378]
+!1124 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 3200, i64 32, i32 0, i32 0, metadata !1125, metadata !1127, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 3200, align 32, offset 0] [from ]
+!1125 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !1126} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!1126 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !1120} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from ]
+!1127 = metadata !{metadata !221, metadata !201, metadata !201}
+!1128 = metadata !{i32 378, i32 0, metadata !1071, null}
+!1129 = metadata !{i32 786688, metadata !1071, metadata !"i", metadata !5, i32 380, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 380]
+!1130 = metadata !{i32 381, i32 0, metadata !1131, null}
+!1131 = metadata !{i32 786443, metadata !1, metadata !1071, i32 381, i32 0, i32 162} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1132 = metadata !{i32 383, i32 0, metadata !1133, null}
+!1133 = metadata !{i32 786443, metadata !1, metadata !1071, i32 383, i32 0, i32 163} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1134 = metadata !{i32 404, i32 0, metadata !1071, null}
+!1135 = metadata !{i16 4}
+!1136 = metadata !{i32 786689, metadata !164, metadata !"p_20", metadata !5, i32 16777630, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_20] [line 414]
+!1137 = metadata !{i32 414, i32 0, metadata !164, null}
+!1138 = metadata !{i32 786689, metadata !164, metadata !"p_22", metadata !5, i32 50332062, metadata !167, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_22] [line 414]
+!1139 = metadata !{i32 786689, metadata !164, metadata !"p_23", metadata !5, i32 67109278, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_23] [line 414]
+!1140 = metadata !{%struct.S1* null}
+!1141 = metadata !{i32 786688, metadata !1142, metadata !"l_578", metadata !5, i32 416, metadata !1120, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_578] [line 416]
+!1142 = metadata !{i32 786443, metadata !1, metadata !164} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1143 = metadata !{i32 416, i32 0, metadata !1142, null}
+!1144 = metadata !{i32 786688, metadata !1142, metadata !"l_580", metadata !5, i32 418, metadata !515, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_580] [line 418]
+!1145 = metadata !{i32 418, i32 0, metadata !1142, null}
+!1146 = metadata !{i32 786688, metadata !1142, metadata !"l_582", metadata !5, i32 420, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_582] [line 420]
+!1147 = metadata !{i32 420, i32 0, metadata !1142, null}
+!1148 = metadata !{[2 x %struct.S0]* bitcast (<{ { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }, { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } }>* @func_19.l_603 to [2 x %struct.S0]*)}
+!1149 = metadata !{i32 786688, metadata !1142, metadata !"l_603", metadata !5, i32 421, metadata !1150, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_603] [line 421]
+!1150 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 384, i64 32, i32 0, i32 0, metadata !128, metadata !591, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 384, align 32, offset 0] [from S0]
+!1151 = metadata !{i32 421, i32 0, metadata !1142, null}
+!1152 = metadata !{i32 786688, metadata !1142, metadata !"l_701", metadata !5, i32 422, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_701] [line 422]
+!1153 = metadata !{i32 422, i32 0, metadata !1142, null}
+!1154 = metadata !{i32 1382815450}
+!1155 = metadata !{i32 786688, metadata !1142, metadata !"l_703", metadata !5, i32 423, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_703] [line 423]
+!1156 = metadata !{i32 423, i32 0, metadata !1142, null}
+!1157 = metadata !{i32 -508538292}
+!1158 = metadata !{i32 786688, metadata !1142, metadata !"l_705", metadata !5, i32 424, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_705] [line 424]
+!1159 = metadata !{i32 424, i32 0, metadata !1142, null}
+!1160 = metadata !{i32 836959364}
+!1161 = metadata !{i32 786688, metadata !1142, metadata !"l_706", metadata !5, i32 425, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_706] [line 425]
+!1162 = metadata !{i32 425, i32 0, metadata !1142, null}
+!1163 = metadata !{i32 -593491597}
+!1164 = metadata !{i32 786688, metadata !1142, metadata !"l_707", metadata !5, i32 426, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_707] [line 426]
+!1165 = metadata !{i32 426, i32 0, metadata !1142, null}
+!1166 = metadata !{i32 428, i32 0, metadata !1142, null}
+!1167 = metadata !{i32 429, i32 0, metadata !1142, null}
+!1168 = metadata !{i32 430, i32 0, metadata !1142, null}
+!1169 = metadata !{i32 634, i32 0, metadata !1170, null}
+!1170 = metadata !{i32 786443, metadata !1, metadata !1171, i32 627, i32 0, i32 110} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1171 = metadata !{i32 786443, metadata !1, metadata !1172, i32 626, i32 0, i32 109} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1172 = metadata !{i32 786443, metadata !1, metadata !148} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1173 = metadata !{i32 786689, metadata !148, metadata !"p_32", metadata !5, i32 16777828, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_32] [line 612]
+!1174 = metadata !{i32 612, i32 0, metadata !148, null}
+!1175 = metadata !{i32 786688, metadata !1172, metadata !"l_33", metadata !5, i32 614, metadata !1176, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_33] [line 614]
+!1176 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 64, i64 32, i32 0, i32 0, metadata !17, metadata !591, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 64, align 32, offset 0] [from uint32_t]
+!1177 = metadata !{i32 614, i32 0, metadata !1172, null}
+!1178 = metadata !{%struct.S3* @func_31.l_43}
+!1179 = metadata !{i32 786688, metadata !1172, metadata !"l_43", metadata !5, i32 615, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_43] [line 615]
+!1180 = metadata !{i32 615, i32 0, metadata !1172, null}
+!1181 = metadata !{[7 x %union.U4]* @func_31.l_406}
+!1182 = metadata !{i32 786688, metadata !1172, metadata !"l_406", metadata !5, i32 617, metadata !1183, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_406] [line 617]
+!1183 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 224, i64 32, i32 0, i32 0, metadata !85, metadata !1010, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 224, align 32, offset 0] [from U4]
+!1184 = metadata !{i32 617, i32 0, metadata !1172, null}
+!1185 = metadata !{i32 786688, metadata !1172, metadata !"l_462", metadata !5, i32 618, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_462] [line 618]
+!1186 = metadata !{i32 618, i32 0, metadata !1172, null}
+!1187 = metadata !{i32 786688, metadata !1172, metadata !"i", metadata !5, i32 621, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 621]
+!1188 = metadata !{i32 622, i32 0, metadata !1189, null}
+!1189 = metadata !{i32 786443, metadata !1, metadata !1172, i32 622, i32 0, i32 107} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1190 = metadata !{i32 623, i32 0, metadata !1189, null}
+!1191 = metadata !{i32 626, i32 0, metadata !1171, null}
+!1192 = metadata !{i32 786688, metadata !1170, metadata !"l_44", metadata !5, i32 628, metadata !288, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_44] [line 628]
+!1193 = metadata !{i32 628, i32 0, metadata !1170, null}
+!1194 = metadata !{i32 786688, metadata !1170, metadata !"l_48", metadata !5, i32 629, metadata !288, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_48] [line 629]
+!1195 = metadata !{i32 629, i32 0, metadata !1170, null}
+!1196 = metadata !{i32** @g_304}
+!1197 = metadata !{i32 786688, metadata !1170, metadata !"l_458", metadata !5, i32 631, metadata !267, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_458] [line 631]
+!1198 = metadata !{i32 631, i32 0, metadata !1170, null}
+!1199 = metadata !{%struct.S0* bitcast ({ i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }* @g_108 to %struct.S0*)}
+!1200 = metadata !{i32 786688, metadata !1170, metadata !"l_461", metadata !5, i32 632, metadata !1201, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_461] [line 632]
+!1201 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !128} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from S0]
+!1202 = metadata !{i32 632, i32 0, metadata !1170, null}
+!1203 = metadata !{i32 635, i32 0, metadata !1204, null}
+!1204 = metadata !{i32 786443, metadata !1, metadata !1170, i32 635, i32 0, i32 111} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1205 = metadata !{i32 643, i32 0, metadata !1172, null}
+!1206 = metadata !{i32 644, i32 0, metadata !1172, null}
+!1207 = metadata !{i32 786689, metadata !146, metadata !"ui1", metadata !53, i32 16777878, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui1] [line 662]
+!1208 = metadata !{i32 662, i32 0, metadata !146, null}
+!1209 = metadata !{i32 786689, metadata !146, metadata !"ui2", metadata !53, i32 33555094, metadata !45, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [ui2] [line 662]
+!1210 = metadata !{i32 665, i32 0, metadata !146, null}
+!1211 = metadata !{i32 786689, metadata !138, metadata !"left", metadata !53, i32 16777831, metadata !32, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 615]
+!1212 = metadata !{i32 615, i32 0, metadata !138, null}
+!1213 = metadata !{i32 786689, metadata !138, metadata !"right", metadata !53, i32 33555047, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 615]
+!1214 = metadata !{i32 618, i32 0, metadata !138, null}
+!1215 = metadata !{i32 786689, metadata !151, metadata !"p_41", metadata !5, i32 50332333, metadata !50, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [p_41] [line 685]
+!1216 = metadata !{i32 685, i32 0, metadata !151, null}
+!1217 = metadata !{i8 -1}
+!1218 = metadata !{i32 786688, metadata !151, metadata !"l_172", metadata !5, i32 687, metadata !59, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_172] [line 687]
+!1219 = metadata !{i32 687, i32 0, metadata !151, null}
+!1220 = metadata !{i32 786688, metadata !151, metadata !"l_175", metadata !5, i32 688, metadata !50, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_175] [line 688]
+!1221 = metadata !{i32 688, i32 0, metadata !151, null}
+!1222 = metadata !{i32*** undef}
+!1223 = metadata !{i32 786688, metadata !151, metadata !"l_173", metadata !5, i32 690, metadata !266, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_173] [line 690]
+!1224 = metadata !{i32 690, i32 0, metadata !151, null}
+!1225 = metadata !{%struct.S2* bitcast ({ i8, i8, [2 x i8] }* @func_38.l_176 to %struct.S2*)}
+!1226 = metadata !{i32 786688, metadata !151, metadata !"l_176", metadata !5, i32 691, metadata !190, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_176] [line 691]
+!1227 = metadata !{i32 691, i32 0, metadata !151, null}
+!1228 = metadata !{i8* getelementptr inbounds (%struct.S1* @g_99, i32 0, i32 2)}
+!1229 = metadata !{i32 786688, metadata !151, metadata !"l_177", metadata !5, i32 692, metadata !1230, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_177] [line 692]
+!1230 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 32, i64 32, i64 0, i32 0, metadata !32} ; [ DW_TAG_pointer_type ] [line 0, size 32, align 32, offset 0] [from uint8_t]
+!1231 = metadata !{i32 692, i32 0, metadata !151, null}
+!1232 = metadata !{%union.U4* @g_183}
+!1233 = metadata !{i32 786688, metadata !151, metadata !"l_182", metadata !5, i32 693, metadata !515, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_182] [line 693]
+!1234 = metadata !{i32 693, i32 0, metadata !151, null}
+!1235 = metadata !{%struct.S2* null}
+!1236 = metadata !{i32 786688, metadata !151, metadata !"l_195", metadata !5, i32 694, metadata !551, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_195] [line 694]
+!1237 = metadata !{i32 694, i32 0, metadata !151, null}
+!1238 = metadata !{i32 76507872}
+!1239 = metadata !{i32 786688, metadata !151, metadata !"l_254", metadata !5, i32 696, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_254] [line 696]
+!1240 = metadata !{i32 696, i32 0, metadata !151, null}
+!1241 = metadata !{i8 0}
+!1242 = metadata !{i32 786688, metadata !151, metadata !"l_255", metadata !5, i32 697, metadata !59, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_255] [line 697]
+!1243 = metadata !{i32 697, i32 0, metadata !151, null}
+!1244 = metadata !{%struct.S0* undef}
+!1245 = metadata !{i32 786688, metadata !151, metadata !"l_262", metadata !5, i32 698, metadata !128, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_262] [line 698]
+!1246 = metadata !{i32 698, i32 0, metadata !151, null}
+!1247 = metadata !{%struct.S3* @func_38.l_293}
+!1248 = metadata !{i32 786688, metadata !151, metadata !"l_293", metadata !5, i32 699, metadata !37, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_293] [line 699]
+!1249 = metadata !{i32 699, i32 0, metadata !151, null}
+!1250 = metadata !{i16 -15174}
+!1251 = metadata !{i32 786688, metadata !151, metadata !"l_350", metadata !5, i32 700, metadata !45, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_350] [line 700]
+!1252 = metadata !{i32 700, i32 0, metadata !151, null}
+!1253 = metadata !{i32 613018610}
+!1254 = metadata !{i32 786688, metadata !151, metadata !"l_365", metadata !5, i32 701, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_365] [line 701]
+!1255 = metadata !{i32 701, i32 0, metadata !151, null}
+!1256 = metadata !{i32 786688, metadata !151, metadata !"l_378", metadata !5, i32 702, metadata !1257, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_378] [line 702]
+!1257 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 128, i64 32, i32 0, i32 0, metadata !17, metadata !682, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 128, align 32, offset 0] [from uint32_t]
+!1258 = metadata !{i32 702, i32 0, metadata !151, null}
+!1259 = metadata !{%struct.S1* getelementptr inbounds ([9 x [3 x [7 x %struct.S1]]]* @g_404, i32 0, i32 2, i32 0, i32 0)}
+!1260 = metadata !{i32 786688, metadata !151, metadata !"l_403", metadata !5, i32 703, metadata !276, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_403] [line 703]
+!1261 = metadata !{i32 703, i32 0, metadata !151, null}
+!1262 = metadata !{i32 786688, metadata !151, metadata !"i", metadata !5, i32 704, metadata !8, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [i] [line 704]
+!1263 = metadata !{i32 705, i32 0, metadata !1264, null}
+!1264 = metadata !{i32 786443, metadata !1, metadata !151, i32 705, i32 0, i32 113} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1265 = metadata !{i32 707, i32 0, metadata !151, null}
+!1266 = metadata !{i32 708, i32 0, metadata !151, null}
+!1267 = metadata !{i32 1089739706}
+!1268 = metadata !{i32 786688, metadata !1269, metadata !"l_178", metadata !5, i32 710, metadata !17, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_178] [line 710]
+!1269 = metadata !{i32 786443, metadata !1, metadata !151, i32 709, i32 0, i32 114} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1270 = metadata !{i32 710, i32 0, metadata !1269, null}
+!1271 = metadata !{i32 8}
+!1272 = metadata !{i32 786688, metadata !1269, metadata !"l_179", metadata !5, i32 711, metadata !44, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_179] [line 711]
+!1273 = metadata !{i32 711, i32 0, metadata !1269, null}
+!1274 = metadata !{i32 786688, metadata !1269, metadata !"l_186", metadata !5, i32 712, metadata !723, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_186] [line 712]
+!1275 = metadata !{i32 712, i32 0, metadata !1269, null}
+!1276 = metadata !{i32 786688, metadata !1269, metadata !"l_217", metadata !5, i32 713, metadata !128, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_217] [line 713]
+!1277 = metadata !{i32 713, i32 0, metadata !1269, null}
+!1278 = metadata !{[5 x [5 x [8 x i32]]]* undef}
+!1279 = metadata !{i32 786688, metadata !1269, metadata !"l_259", metadata !5, i32 714, metadata !1280, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [l_259] [line 714]
+!1280 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 6400, i64 32, i32 0, i32 0, metadata !17, metadata !1281, i32 0, i32 0} ; [ DW_TAG_array_type ] [line 0, size 6400, align 32, offset 0] [from uint32_t]
+!1281 = metadata !{metadata !186, metadata !186, metadata !202}
+!1282 = metadata !{i32 714, i32 0, metadata !1269, null}
+!1283 = metadata !{i32 715, i32 0, metadata !1269, null}
+!1284 = metadata !{i32 720, i32 0, metadata !1285, null}
+!1285 = metadata !{i32 786443, metadata !1, metadata !1269, i32 720, i32 0, i32 115} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/newfail1.c]
+!1286 = metadata !{i32 810, i32 0, metadata !1269, null}
+!1287 = metadata !{i32 786689, metadata !168, metadata !"left", metadata !53, i32 16777322, metadata !59, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [left] [line 106]
+!1288 = metadata !{i32 106, i32 0, metadata !168, null}
+!1289 = metadata !{i32 786689, metadata !168, metadata !"right", metadata !53, i32 33554538, metadata !19, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [right] [line 106]
+!1290 = metadata !{i32 109, i32 0, metadata !1291, null}
+!1291 = metadata !{i32 786443, metadata !52, metadata !168} ; [ DW_TAG_lexical_block ] [/home/alon/Dev/emscripten/tests/fuzz/./safe_math.h]
diff --git a/tests/cases/fuzz6_ta2.txt b/tests/cases/fuzz6_ta2.txt
new file mode 100644
index 00000000..00e8a313
--- /dev/null
+++ b/tests/cases/fuzz6_ta2.txt
@@ -0,0 +1 @@
+checksum = F4711189
diff --git a/tests/cases/gepaddoverflow.ll b/tests/cases/gepaddoverflow.ll
index 11246c1d..258e2cc5 100644
--- a/tests/cases/gepaddoverflow.ll
+++ b/tests/cases/gepaddoverflow.ll
@@ -1,6 +1,6 @@
; ModuleID = 'new.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
declare i32 @printf(i8* noalias, ...) nounwind
diff --git a/tests/cases/i24_mem_ta2.ll b/tests/cases/i24_mem_ta2.ll
index 550389fe..995c9f8b 100644
--- a/tests/cases/i24_mem_ta2.ll
+++ b/tests/cases/i24_mem_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [6 x i8] c".%x.\0A\00", align 1 ; [#uses=1 type=[5 x i8]*]
diff --git a/tests/cases/i96_ashr_ta2.ll b/tests/cases/i96_ashr_ta2.ll
new file mode 100644
index 00000000..da6410f9
--- /dev/null
+++ b/tests/cases/i96_ashr_ta2.ll
@@ -0,0 +1,35 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [23 x i8] c"hello..world!%x,%x,%x\0A\00", align 1
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %a = trunc i128 5634002668910802268259393791 to i96
+ %x = trunc i96 %a to i32
+ %y0 = lshr i96 %a, 32
+ %y = trunc i96 %y0 to i32
+ %z0 = lshr i96 %a, 64
+ %z = trunc i96 %z0 to i32
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([23 x i8]* @.str, i32 0, i32 0), i32 %x, i32 %y, i32 %z) ; [#uses=0 type=i32]
+ %b = lshr i96 78981949996569583556032504063, 17
+ %bx = trunc i96 %b to i32
+ %by0 = lshr i96 %b, 32
+ %by = trunc i96 %by0 to i32
+ %bz0 = lshr i96 %b, 64
+ %bz = trunc i96 %bz0 to i32
+ %bcall = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([23 x i8]* @.str, i32 0, i32 0), i32 %bx, i32 %by, i32 %bz) ; [#uses=0 type=i32]
+ %c = ashr i96 78981949996569583556032504063, 17
+ %cx = trunc i96 %c to i32
+ %cy0 = lshr i96 %c, 32
+ %cy = trunc i96 %cy0 to i32
+ %cz0 = lshr i96 %c, 64
+ %cz = trunc i96 %cz0 to i32
+ %ccall = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([23 x i8]* @.str, i32 0, i32 0), i32 %cx, i32 %cy, i32 %cz) ; [#uses=0 type=i32]
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/i96_ashr_ta2.txt b/tests/cases/i96_ashr_ta2.txt
new file mode 100644
index 00000000..dbbcf911
--- /dev/null
+++ b/tests/cases/i96_ashr_ta2.txt
@@ -0,0 +1,3 @@
+hello..world!2468a0ff,abcdefdc,12345678
+hello..world!f7ee1234,2b3c55e6,7f9a
+hello..world!f7ee1234,2b3c55e6,ffffff9a
diff --git a/tests/cases/i96shiftnon32_ta2.ll b/tests/cases/i96shiftnon32_ta2.ll
new file mode 100644
index 00000000..815d71ea
--- /dev/null
+++ b/tests/cases/i96shiftnon32_ta2.ll
@@ -0,0 +1,44 @@
+; ModuleID = '/tmp/tmpxFUbAg/test_emcc1.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+%struct.c_s = type { i8, float, i32 }
+
+@.str = private unnamed_addr constant [12 x i8] c"RESULT: %d\0A\00", align 1
+
+define internal fastcc void @f2(%struct.c_s* noalias nocapture sret %agg.result) nounwind {
+ %agg.result.1 = getelementptr inbounds %struct.c_s* %agg.result, i32 0, i32 1
+ store float 0.000000e+00, float* %agg.result.1, align 4
+ %agg.result.2 = getelementptr inbounds %struct.c_s* %agg.result, i32 0, i32 2
+ store i32 43110, i32* %agg.result.2, align 4
+ ret void
+}
+
+define internal fastcc void @f1(%struct.c_s* nocapture %tp) nounwind {
+ %1 = alloca %struct.c_s, align 8
+ call fastcc void @f2(%struct.c_s* sret %1)
+ %2 = bitcast %struct.c_s* %1 to i96*
+ %srcval1 = load i96* %2, align 8
+ %small = trunc i96 %srcval1 to i64
+ %large = zext i64 %small to i96
+ %return = or i96 %srcval1, %large
+ %3 = lshr i96 %return, 4
+ %4 = shl i96 %3, 2
+ %5 = bitcast %struct.c_s* %tp to i96*
+ store i96 %4, i96* %5, align 4
+ ret void
+}
+
+define i32 @main() nounwind {
+ %t = alloca %struct.c_s, align 4
+ %1 = getelementptr inbounds %struct.c_s* %t, i32 0, i32 1
+ store float 1.000000e+00, float* %1, align 4
+ call fastcc void @f1(%struct.c_s* %t)
+ %2 = getelementptr inbounds %struct.c_s* %t, i32 0, i32 2
+ %3 = load i32* %2, align 4
+ %4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0), i32 %3) nounwind
+ ret i32 0
+}
+
+declare i32 @printf(i8* nocapture, ...) nounwind
+
diff --git a/tests/cases/i96shiftnon32_ta2.txt b/tests/cases/i96shiftnon32_ta2.txt
new file mode 100644
index 00000000..1e26a65f
--- /dev/null
+++ b/tests/cases/i96shiftnon32_ta2.txt
@@ -0,0 +1 @@
+RESULT: 10777
diff --git a/tests/cases/inttoptr.ll b/tests/cases/inttoptr.ll
index c1b40a74..e225336c 100644
--- a/tests/cases/inttoptr.ll
+++ b/tests/cases/inttoptr.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/emscripten/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]
diff --git a/tests/cases/invokebitcast.ll b/tests/cases/invokebitcast.ll
index ec090b0d..634dbca3 100644
--- a/tests/cases/invokebitcast.ll
+++ b/tests/cases/invokebitcast.ll
@@ -1,7 +1,7 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
; Just test for compilation here
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.CPU_Regs = type { [8 x %union.GenReg32] }
%union.GenReg32 = type { [1 x i32] }
@@ -10,7 +10,7 @@ target triple = "le32-unknown-nacl"
@.str = private unnamed_addr constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]
; [#uses=0]
-define i32 @main() {
+define i32 @main(i32 %p) {
entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
@@ -24,13 +24,15 @@ entry:
store i32 %3, i32* %retval, align 4
br label %return
- invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(%struct.CPU_Regs* noalias @cpu_regs, i32 %99)
+ invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(i64* bitcast (%struct.CPU_Regs* @cpu_regs to i64*), i32 %p)
to label %invcont33 unwind label %lpad106
invcont33:
ret i32 %retval1
lpad106:
+ %Z = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ cleanup
ret i32 %retval1
return: ; preds = %entry
@@ -40,3 +42,6 @@ return: ; preds = %entry
; [#uses=1]
declare i32 @puts(i8*)
+
+declare void @_Z8toStringj(i32*, i32)
+declare i32 @__gxx_personality_v0(...)
diff --git a/tests/cases/invokeundef.ll b/tests/cases/invokeundef.ll
index 2f13e7ab..17b14a3f 100644
--- a/tests/cases/invokeundef.ll
+++ b/tests/cases/invokeundef.ll
@@ -1,7 +1,7 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
; Just test for compilation here
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.CPU_Regs = type { [8 x %union.GenReg32] }
%union.GenReg32 = type { [1 x i32] }
diff --git a/tests/cases/legalizer_b_ta2.ll b/tests/cases/legalizer_b_ta2.ll
new file mode 100644
index 00000000..ec5e7506
--- /dev/null
+++ b/tests/cases/legalizer_b_ta2.ll
@@ -0,0 +1,179 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
+@globaliz = global [300 x i8] zeroinitializer
+
+define i64 @retter(i64 %x) {
+ store i128 0, i128* bitcast ([300 x i8]* @globaliz to i128*), align 4 ; wipe it out
+ store i64 %x, i64* bitcast ([300 x i8]* @globaliz to i64*), align 4
+ call i32 (i8*)* @puts(i8* bitcast ([300 x i8]* @globaliz to i8*))
+ ret i64 7017280452245743464
+}
+
+define i32 @main() {
+entry:
+ %buffer = alloca i8, i32 1000, align 4
+ %bundled = bitcast i8* %buffer to i128*
+ store i128 8583909746840200552, i128* %bundled, align 4 ; hello world in there
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ %loaded = load i128* %bundled, align 4 ; save for later
+
+ %backcast = bitcast i128* %bundled to i8*
+ call i32 (i8*)* @puts(i8* %backcast)
+
+ %temp.buffer = bitcast i8* %buffer to [0 x i8]*
+ %buffer1 = getelementptr [0 x i8]* %temp.buffer, i32 0, i32 1
+ %bundled1 = bitcast i8* %buffer1 to i128*
+ store i128 9862834326869351064, i128* %bundled1, align 1 ; unaligned
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; shifts
+ %shifted = lshr i128 %loaded, 16
+ store i128 %shifted, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+ %shifted2 = lshr i128 %loaded, 32
+ store i128 %shifted2, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; store %loaded, make sure has not been modified
+ store i128 %loaded, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ %shifted3 = shl i128 %loaded, 8
+ store i128 %shifted3, i128* %bundled, align 4
+ store i8 113, i8* %buffer ; remove initial 0 ; 'q'
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; trunc
+ %shifted4 = shl i128 %loaded, 64
+ store i128 %shifted4, i128* %bundled, align 4
+ %nonzero64 = trunc i128 %loaded to i64 ; remove initial zeros
+ %bundled64 = bitcast i128* %bundled to i64*
+ store i64 %nonzero64, i64* %bundled64, align 4
+; call i32 (i8*)* @puts(i8* %buffer)
+
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ %small32 = trunc i128 %loaded to i32
+ %buffer32 = bitcast i8* %buffer to i32*
+ store i32 %small32, i32* %buffer32, align 4
+; call i32 (i8*)* @puts(i8* %buffer)
+
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ %small16 = trunc i128 %loaded to i16
+ %buffer16 = bitcast i8* %buffer to i16*
+ store i16 %small16, i16* %buffer16, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ %small64 = trunc i128 %loaded to i64
+ %buffer64 = bitcast i8* %buffer to i64*
+ store i64 %small64, i64* %buffer64, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; zext
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ %pre32 = or i32 6382179, 0
+ %big = zext i32 %pre32 to i128
+ store i128 %big, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ %pre64 = zext i32 1684366951 to i64
+ %post64 = shl i64 %pre64, 32
+ %big64 = or i64 %pre64, %post64
+ %bigb = zext i64 %big64 to i128
+ store i128 %bigb, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; or, and, xor
+ %ored = or i128 %loaded, 107752139522048 ; constant
+ store i128 %ored, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ %ander = bitcast i128 18402271027389267967 to i128
+ %anded = and i128 %loaded, %ander ; variable
+ store i128 %anded, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+ %xored = xor i128 %loaded, 0
+ store i128 %xored, i128* %bundled, align 4
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; unfolding
+ store i128 %loaded, i128* bitcast ([300 x i8]* @globaliz to i128*), align 4
+ %loaded.short = load i96* bitcast ([300 x i8]* @globaliz to i96*), align 4
+ store i128 0, i128* bitcast ([300 x i8]* @globaliz to i128*), align 4
+ store i96 %loaded.short, i96* bitcast ([300 x i8]* @globaliz to i96*), align 4
+ call i32 (i8*)* @puts(i8* bitcast ([300 x i8]* @globaliz to i8*))
+
+; phi
+ %if = trunc i128 %ander to i1
+ %first = trunc i128 %xored to i96
+ br i1 %if, label %a17, label %a26
+
+a17:
+ %second = trunc i128 %loaded to i96
+ br label %a26
+
+a26:
+ %a27 = phi i96 [ %first, %entry ], [ %second, %a17 ]
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ store i96 %a27, i96* bitcast ([300 x i8]* @globaliz to i96*), align 4
+ call i32 (i8*)* @puts(i8* bitcast ([300 x i8]* @globaliz to i8*))
+
+; phi with constants
+ br i1 %if, label %a17b, label %a26b
+
+a17b:
+ br label %a26b
+
+a26b:
+ %a27b = phi i64 [ 55, %a26 ], [ 57, %a17b ]
+ store i128 0, i128* %bundled, align 4 ; wipe it out
+ store i64 %a27b, i64* bitcast ([300 x i8]* @globaliz to i64*), align 4
+ call i32 (i8*)* @puts(i8* bitcast ([300 x i8]* @globaliz to i8*))
+
+ store i128 %ored, i128* %bundled, align 4
+ %iff = zext i1 %if to i64
+ switch i64 %iff, label %a50 [
+ i64 1, label %a30
+ i64 0, label %a40
+ ]
+
+a50:
+ store i128 %xored, i128* %bundled, align 4
+ br label %a40
+
+a30:
+ store i128 %anded, i128* %bundled, align 4
+ br label %a40
+
+a40:
+ call i32 (i8*)* @puts(i8* %buffer)
+
+; invoke return value
+
+ %inv64 = invoke i64 @retter(i64 8174723217654970232)
+ to label %a100 unwind label %a111
+
+a100:
+ store i128 0, i128* bitcast ([300 x i8]* @globaliz to i128*), align 4 ; wipe it out
+ store i64 %inv64, i64* bitcast ([300 x i8]* @globaliz to i64*), align 4
+ call i32 (i8*)* @puts(i8* bitcast ([300 x i8]* @globaliz to i8*))
+ br label %done
+
+a111:
+ %aaaa79 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ cleanup
+ br label %done
+
+done:
+ ret i32 1
+}
+
+declare i32 @puts(i8*)
+declare i32 @__gxx_personality_v0(...)
+declare void @__cxa_throw(i32, i32, i32) ; for asm1, where exceptions are enabled but this test needs a throw to bring in lib stuff
+
diff --git a/tests/cases/legalizer_b_ta2.txt b/tests/cases/legalizer_b_ta2.txt
new file mode 100644
index 00000000..27097159
--- /dev/null
+++ b/tests/cases/legalizer_b_ta2.txt
@@ -0,0 +1,20 @@
+hello, w
+hello, w
+h𚓓𓟈
+llo, w
+o, w
+hello, w
+qhello, w
+he
+hello, w
+cba
+gfedgfed
+hellon w
+hello, w
+hello, w
+hello, w
+hello, w
+9
+hello, w
+xwvutsrq
+hgfedcba
diff --git a/tests/cases/legalizer_ta2.ll b/tests/cases/legalizer_ta2.ll
index 6f153ad2..e7f71f15 100644
--- a/tests/cases/legalizer_ta2.ll
+++ b/tests/cases/legalizer_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@globaliz = global [300 x i8] zeroinitializer
diff --git a/tests/cases/loadbitcastgep.ll b/tests/cases/loadbitcastgep.ll
index cfb88a0d..daba67c4 100644
--- a/tests/cases/loadbitcastgep.ll
+++ b/tests/cases/loadbitcastgep.ll
@@ -1,6 +1,6 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.CPU_Regs = type { [8 x %union.GenReg32] }
%union.GenReg32 = type { [1 x i32] }
diff --git a/tests/cases/longjmp_tiny_invoke.ll b/tests/cases/longjmp_tiny_invoke.ll
index e1a72e00..6f856d49 100644
--- a/tests/cases/longjmp_tiny_invoke.ll
+++ b/tests/cases/longjmp_tiny_invoke.ll
@@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu"
define i32 @main() {
%retval = alloca i32, align 4
store i32 0, i32* %retval
- %call = invoke i32 @setjmp(i16* getelementptr inbounds ([20 x i16]* @_ZL3buf, i32 0, i32 0)) returns_twice, !dbg !20
+ %call = invoke i32 @setjmp(i16* getelementptr inbounds ([20 x i16]* @_ZL3buf, i32 0, i32 0)) returns_twice
to label %allgood unwind label %awful
allgood:
@@ -29,9 +29,13 @@ if.end: ; preds = %if.else, %if.then
ret i32 0, !dbg !28
awful:
+ %Z = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ cleanup
ret i32 1
}
+declare i32 @__gxx_personality_v0(...)
+
declare i32 @setjmp(i16*) returns_twice
declare i32 @printf(i8*, ...)
diff --git a/tests/cases/longjmp_tiny_invoke_phi.ll b/tests/cases/longjmp_tiny_invoke_phi.ll
index 30c43339..0df3f924 100644
--- a/tests/cases/longjmp_tiny_invoke_phi.ll
+++ b/tests/cases/longjmp_tiny_invoke_phi.ll
@@ -35,6 +35,8 @@ if.end: ; preds = %if.else, %if.then
ret i32 0
awful:
+ %Z = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ cleanup
ret i32 1
}
@@ -44,3 +46,5 @@ declare i32 @printf(i8*, ...)
declare void @longjmp(i16*, i32)
+declare i32 @__gxx_personality_v0(...)
+
diff --git a/tests/cases/longjmp_tiny_keepem.ll b/tests/cases/longjmp_tiny_keepem.ll
new file mode 100644
index 00000000..bbf9b3e8
--- /dev/null
+++ b/tests/cases/longjmp_tiny_keepem.ll
@@ -0,0 +1,40 @@
+; ModuleID = '/tmp/emscripten_temp/src.cpp.o'
+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 [13 x i8] c"hello world\0A\00", align 1
+@.str1 = private unnamed_addr constant [6 x i8] c"more\0A\00", align 1
+
+define i32 @main() {
+ %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str1, i32 0, i32 0))
+ br label %middle
+
+middle:
+ %retval = alloca i32, align 4
+ store i32 0, i32* %retval
+ %wimpy = trunc i32 100 to i8
+ %buffy = inttoptr i8 %wimpy to i16*
+ %call = call i32 @setjmp(i16* %buffy) returns_twice ; 20
+ %tobool = icmp ne i32 %call, 0 ; 20
+ br i1 %tobool, label %if.else, label %if.then ; 20
+
+if.then: ; preds = %entry
+ %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) ; 22
+ call void @longjmp(i8 %wimpy, i32 10) ; 24
+ br label %if.end ; 25
+
+if.else: ; preds = %entry
+ %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str1, i32 0, i32 0)) ; 26
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ ret i32 0 ; 28
+}
+
+declare i32 @setjmp(i16*) returns_twice
+
+declare i32 @printf(i8*, ...)
+
+declare void @longjmp(i8, i32)
+
+
diff --git a/tests/cases/longjmp_tiny_keepem.txt b/tests/cases/longjmp_tiny_keepem.txt
new file mode 100644
index 00000000..f828705f
--- /dev/null
+++ b/tests/cases/longjmp_tiny_keepem.txt
@@ -0,0 +1,3 @@
+more
+hello world
+more
diff --git a/tests/cases/longjmp_tiny_keepem_cond.ll b/tests/cases/longjmp_tiny_keepem_cond.ll
new file mode 100644
index 00000000..694ed17f
--- /dev/null
+++ b/tests/cases/longjmp_tiny_keepem_cond.ll
@@ -0,0 +1,41 @@
+; ModuleID = '/tmp/emscripten_temp/src.cpp.o'
+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 [13 x i8] c"hello world\0A\00", align 1
+@.str1 = private unnamed_addr constant [6 x i8] c"more\0A\00", align 1
+
+define i32 @main() {
+ %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str1, i32 0, i32 0))
+ %chak = icmp ne i32 %call0, 12345678
+ br i1 %chak, label %middle, label %if.then
+
+middle:
+ %retval = alloca i32, align 4
+ store i32 0, i32* %retval
+ %wimpy = trunc i32 100 to i8
+ %buffy = inttoptr i8 %wimpy to i16*
+ %call = call i32 @setjmp(i16* %buffy) returns_twice ; 20
+ %tobool = icmp ne i32 %call, 0 ; 20
+ br i1 %tobool, label %if.else, label %if.then ; 20
+
+if.then: ; preds = %entry
+ %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) ; 22
+ call void @longjmp(i8 %wimpy, i32 10) ; 24
+ br label %if.end ; 25
+
+if.else: ; preds = %entry
+ %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str1, i32 0, i32 0)) ; 26
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ ret i32 0 ; 28
+}
+
+declare i32 @setjmp(i16*) returns_twice
+
+declare i32 @printf(i8*, ...)
+
+declare void @longjmp(i8, i32)
+
+
diff --git a/tests/cases/longjmp_tiny_keepem_cond.txt b/tests/cases/longjmp_tiny_keepem_cond.txt
new file mode 100644
index 00000000..f828705f
--- /dev/null
+++ b/tests/cases/longjmp_tiny_keepem_cond.txt
@@ -0,0 +1,3 @@
+more
+hello world
+more
diff --git a/tests/cases/longjmp_tiny_phi.ll b/tests/cases/longjmp_tiny_phi.ll
index cced7cab..21b936dd 100644
--- a/tests/cases/longjmp_tiny_phi.ll
+++ b/tests/cases/longjmp_tiny_phi.ll
@@ -28,7 +28,7 @@ if.else: ; preds = %entry
br label %if.end
if.end: ; preds = %if.else, %if.then
- %aaa = phi i32 [ -1, %if.then ], [ 0, %if.else ], [ 1, %two ], [ 2, %entry ]
+ %aaa = phi i32 [ -1, %if.then ], [ 0, %if.else ]
%call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i32 %aaa), !dbg !26
ret i32 %aaa, !dbg !28
}
diff --git a/tests/cases/longjmp_tiny_phi2.ll b/tests/cases/longjmp_tiny_phi2.ll
index 1d7761c3..88312fc6 100644
--- a/tests/cases/longjmp_tiny_phi2.ll
+++ b/tests/cases/longjmp_tiny_phi2.ll
@@ -24,7 +24,7 @@ if.then: ; preds = %entry
br label %if.end, !dbg !25
if.end: ; preds = %if.else, %if.then
- %aaa = phi i32 [ -1, %if.then ], [ 1, %two ], [ 2, %entry ]
+ %aaa = phi i32 [ -1, %if.then ], [ 1, %two ]
%call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i32 %aaa), !dbg !26
ret i32 %aaa, !dbg !28
}
diff --git a/tests/cases/muli33_ta2.ll b/tests/cases/muli33_ta2.ll
index b33b04f7..7a427731 100644
--- a/tests/cases/muli33_ta2.ll
+++ b/tests/cases/muli33_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpt0JpDh/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [7 x i8] c"20\0A91\0A\00", align 1
@.str1 = private unnamed_addr constant [6 x i8] c"%u %u\00", align 1
diff --git a/tests/cases/oob_ta2.ll b/tests/cases/oob_ta2.ll
index b95d28da..51b622b5 100644
--- a/tests/cases/oob_ta2.ll
+++ b/tests/cases/oob_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%structy = type { [2 x [10 x i8]] }
diff --git a/tests/cases/phi24_ta2.ll b/tests/cases/phi24_ta2.ll
index 18577fee..17edb228 100644
--- a/tests/cases/phi24_ta2.ll
+++ b/tests/cases/phi24_ta2.ll
@@ -1,6 +1,6 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%union.U4 = type { i32 }
%union.U3 = type { i8* }
diff --git a/tests/cases/phicubed.ll b/tests/cases/phicubed.ll
index 5fc3208b..7079dc63 100644
--- a/tests/cases/phicubed.ll
+++ b/tests/cases/phicubed.ll
@@ -1,6 +1,6 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.worker_args = type { i32, %struct.worker_args* }
diff --git a/tests/cases/phientryimplicit.ll b/tests/cases/phientryimplicit.ll
index c237457c..4512b3c2 100644
--- a/tests/cases/phientryimplicit.ll
+++ b/tests/cases/phientryimplicit.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
; Phi nodes can refer to the entry. And the entry might be unnamed, and doesn't even have a consistent implicit name!
@@ -10,14 +10,14 @@ target triple = "le32-unknown-nacl"
define i32 @main() {
%retval = alloca i32, align 4 ; [#uses=1 type=i32*]
%a16 = trunc i32 1 to i1
- br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5]
+ br i1 %a16, label %L17, label %L26
L17:
%a25 = trunc i32 1 to i1
br label %L26
L26:
- %a27 = phi i1 [ false, %1 ], [ %a25, %L17 ] ; [#uses=1 type=i1]
+ %a27 = phi i1 [ false, %0 ], [ %a25, %L17 ] ; [#uses=1 type=i1]
store i32 0, i32* %retval
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32]
%cal2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i1 %a27) ; make sure %27 is used
@@ -27,7 +27,7 @@ L26:
define i32 @main0() {
%retval = alloca i32, align 4 ; [#uses=1 type=i32*]
%a16 = trunc i32 1 to i1
- br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5]
+ br i1 %a16, label %L17, label %L26
L17:
%a25 = trunc i32 1 to i1
diff --git a/tests/cases/phientryimplicitmix.ll b/tests/cases/phientryimplicitmix.ll
index 527c761f..7696f5a9 100644
--- a/tests/cases/phientryimplicitmix.ll
+++ b/tests/cases/phientryimplicitmix.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
; Phi nodes can refer to the entry. And the entry might be unnamed, and doesn't even have a consistent implicit name!
diff --git a/tests/cases/phientryimplicitmoar.ll b/tests/cases/phientryimplicitmoar.ll
index 0f07cc44..eca7276e 100644
--- a/tests/cases/phientryimplicitmoar.ll
+++ b/tests/cases/phientryimplicitmoar.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
@.str2 = private unnamed_addr constant [15 x i8] c"hello!!world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/philoop_ta2.ll b/tests/cases/philoop_ta2.ll
index 5036c7ba..1afec610 100644
--- a/tests/cases/philoop_ta2.ll
+++ b/tests/cases/philoop_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/tmpVIBz29/a.out.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [13 x i8] c"99\0A70\0A26\0A97\0A\00", align 1
@.str1 = private unnamed_addr constant [12 x i8] c"%u %u %u %u\00", align 1
diff --git a/tests/cases/phinonexist.ll b/tests/cases/phinonexist.ll
index 145d2221..75c1cef6 100644
--- a/tests/cases/phinonexist.ll
+++ b/tests/cases/phinonexist.ll
@@ -5,18 +5,19 @@ 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]*]
define i32 @main() {
+entry:
%retval = alloca i32, align 4
%a12 = zext i1 1 to i32
- br label %13
+ br label %label13
-; <label>:13 ; preds = %13, %1
- %a14 = phi i32 [ %a12, %1 ], [ %a15, %135 ]
+label13: ; preds = %13, %1
+ %a14 = phi i32 [ %a12, %entry ], [ %a15, %135 ]
%call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0))
%a15 = add nsw i32 %a14, 2
%a16 = icmp eq i32 %a15, 9
- br label %17
+ br label %label17
-; <label>:17 ; preds = %1
+label17: ; preds = %1
ret i32 1
}
diff --git a/tests/cases/phinonreachable64.ll b/tests/cases/phinonreachable64.ll
new file mode 100644
index 00000000..41aac5f0
--- /dev/null
+++ b/tests/cases/phinonreachable64.ll
@@ -0,0 +1,26 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
+
+define i32 @main() {
+_entry:
+ %retval = alloca i32, align 4
+ %a12 = zext i1 1 to i64
+ br label %_phinode
+
+_nonreachable:
+ %b = zext i32 -1 to i64
+ br label %_phinode
+
+_phinode:
+ %a14 = phi i64 [ %a12, %_entry ], [ %b, %_nonreachable ]
+ %a14s = trunc i64 %a14 to i32
+ %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0))
+ ret i32 %a14s
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
+
diff --git a/tests/cases/phiptrtoint.ll b/tests/cases/phiptrtoint.ll
index d682dc06..617ada49 100644
--- a/tests/cases/phiptrtoint.ll
+++ b/tests/cases/phiptrtoint.ll
@@ -1,7 +1,7 @@
; ModuleID = '/tmp/tmpJctwj0/bug.bc'
; just an asm validation check, no output
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%"class.test::Processor" = type { i32, %"class.test::StateMachine" }
%"class.test::StateMachine" = type { { i32, i32 } }
diff --git a/tests/cases/phiself.ll b/tests/cases/phiself.ll
index 0a06fcca..b61b970f 100644
--- a/tests/cases/phiself.ll
+++ b/tests/cases/phiself.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/emscripten_temp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [7 x i8] c"cheez\0A\00", align 1
@.str1 = private unnamed_addr constant [6 x i8] c"*%d*\0A\00", align 1
diff --git a/tests/cases/ptrtoi64.ll b/tests/cases/ptrtoi64.ll
index 5898f529..09929742 100644
--- a/tests/cases/ptrtoi64.ll
+++ b/tests/cases/ptrtoi64.ll
@@ -1,8 +1,8 @@
; pointer to i64, then to i32
; ModuleID = '/tmp/emscripten/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str2 = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1]
diff --git a/tests/cases/ptrtoint_blockaddr.ll b/tests/cases/ptrtoint_blockaddr.ll
index 68b29300..08370650 100644
--- a/tests/cases/ptrtoint_blockaddr.ll
+++ b/tests/cases/ptrtoint_blockaddr.ll
@@ -1,8 +1,12 @@
+; ModuleID = 'tests/hello_world.bc'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
+
@.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1]
-define linkonce_odr i32* @main() align 2 {
- %199 = trunc i8 1 to i1 ; [#uses=1]
- br i1 %199, label %label555, label %label569
+define linkonce_odr i32 @main() align 2 {
+ %a199 = trunc i8 1 to i1 ; [#uses=1]
+ br i1 %a199, label %label555, label %label569
label555: ; preds = %353
br label %label569
@@ -10,9 +14,9 @@ label555: ; preds = %353
br label %label569
label569: ; preds = %555
- %333 = call i32 @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %a333 = call i32 @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
; this should compile ok
- store i32 ptrtoint (i8* blockaddress(@main, %label569) to i32), i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), align 8
+ store i32 ptrtoint (i8* blockaddress(@main, %label569) to i32), i32* bitcast (i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0) to i32*), align 8
ret i32 0
}
diff --git a/tests/cases/quotedlabel.ll b/tests/cases/quotedlabel.ll
index d32e380a..d4b8639c 100644
--- a/tests/cases/quotedlabel.ll
+++ b/tests/cases/quotedlabel.ll
@@ -13,7 +13,7 @@ entry:
br label %"finish$$$"
"finish$$$": ; preds = %entry
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
ret i32 0
}
diff --git a/tests/cases/sillybitcast.ll b/tests/cases/sillybitcast.ll
index 50a54da9..4486dce8 100644
--- a/tests/cases/sillybitcast.ll
+++ b/tests/cases/sillybitcast.ll
@@ -1,13 +1,13 @@
; ModuleID = '/tmp/emscripten/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]
; [#uses=2]
-define void @"\01_Z5hellov"() {
+define void @"_Z5hellov"() {
entry:
- %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0]
+ %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0]
br label %return
return: ; preds = %entry
@@ -23,7 +23,7 @@ entry:
%retval = alloca i32 ; [#uses=2]
%0 = alloca i32 ; [#uses=2]
%"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @"\01_Z5hellov"()
+ call void @"_Z5hellov"()
store i32 0, i32* %0, align 4
%1 = load i32* %0, align 4 ; [#uses=1]
store i32 %1, i32* %retval, align 4
diff --git a/tests/cases/sillybitcast2.ll b/tests/cases/sillybitcast2.ll
index 02cf8615..275760c5 100644
--- a/tests/cases/sillybitcast2.ll
+++ b/tests/cases/sillybitcast2.ll
@@ -1,6 +1,6 @@
; ModuleID = '/tmp/emscripten/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1]
diff --git a/tests/cases/sillyfuncast.ll b/tests/cases/sillyfuncast.ll
index 33598104..2f2f7fe6 100644
--- a/tests/cases/sillyfuncast.ll
+++ b/tests/cases/sillyfuncast.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/storebigfloat.ll b/tests/cases/storebigfloat.ll
index b940f5ca..a7c6c2da 100644
--- a/tests/cases/storebigfloat.ll
+++ b/tests/cases/storebigfloat.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/storestruct.ll b/tests/cases/storestruct.ll
index 3e996195..1bc0bffb 100644
--- a/tests/cases/storestruct.ll
+++ b/tests/cases/storestruct.ll
@@ -1,6 +1,6 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
; Load and store an entire structure as a whole (and also load as a whole, extract values and save separately, etc.)
diff --git a/tests/cases/structinparam.ll b/tests/cases/structinparam.ll
index d81f5e67..93f486a0 100644
--- a/tests/cases/structinparam.ll
+++ b/tests/cases/structinparam.ll
@@ -1,6 +1,6 @@
; ModuleID = 'min.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%ac = type { i8*, i32 }
diff --git a/tests/cases/structparam.ll b/tests/cases/structparam.ll
index c59ad600..53ee5a93 100644
--- a/tests/cases/structparam.ll
+++ b/tests/cases/structparam.ll
@@ -27,7 +27,7 @@ cond.end: ; preds = %cond.false, %cond.t
%cond = phi { i32, i32 } [ { i32 5, i32 6 }, %entry ], [ zeroinitializer, %cond.null ] ; [#uses=1]
store { i32, i32 } %cond, { i32, i32 }* %comp
%call = call i32 (i32, { i32, i32 })* @doit(i32 1, { i32, i32 } %cond) ;
- store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* getelementptr inbounds ([1 x i64]* @_dispatchTable, i32 0, i32 0, i32 1), align 4
+ store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* bitcast (i64* getelementptr inbounds ([1 x i64]* bitcast (i64* @_dispatchTable to [1 x i64]*), i32 0, i32 0) to { i32, i32 }*), align 4
ret i32 0 ; [debug line = 6:13]
}
diff --git a/tests/cases/structphiparam.ll b/tests/cases/structphiparam.ll
index fadf4d29..b5d05c17 100644
--- a/tests/cases/structphiparam.ll
+++ b/tests/cases/structphiparam.ll
@@ -1,6 +1,6 @@
; ModuleID = '/dev/shm/tmp/src.cpp.o'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, %d %d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
@_dispatchTable = internal global i64 0
diff --git a/tests/cases/sub_11_0.ll b/tests/cases/sub_11_0.ll
index d4094556..59f70c7f 100644
--- a/tests/cases/sub_11_0.ll
+++ b/tests/cases/sub_11_0.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/cases/switch64_ta2.ll b/tests/cases/switch64_ta2.ll
index 1a6d52f3..f30c078f 100644
--- a/tests/cases/switch64_ta2.ll
+++ b/tests/cases/switch64_ta2.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1
diff --git a/tests/cases/switch64b_ta2.ll b/tests/cases/switch64b_ta2.ll
index 4364725f..beb644e0 100644
--- a/tests/cases/switch64b_ta2.ll
+++ b/tests/cases/switch64b_ta2.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1
diff --git a/tests/cases/uadd_overflow_ta2.ll b/tests/cases/uadd_overflow_ta2.ll
index e827cb38..19c2908b 100644
--- a/tests/cases/uadd_overflow_ta2.ll
+++ b/tests/cases/uadd_overflow_ta2.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str2 = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1]
diff --git a/tests/cases/zeroembedded.ll b/tests/cases/zeroembedded.ll
index 167fe278..b1394893 100644
--- a/tests/cases/zeroembedded.ll
+++ b/tests/cases/zeroembedded.ll
@@ -1,5 +1,5 @@
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
%struct.pypy_str = type { i32, [0 x i8] }
%struct.pypy_strval = type { i32, [13 x i8] }
diff --git a/tests/cases/zeroextarg.ll b/tests/cases/zeroextarg.ll
index a3caa74c..ff42741b 100644
--- a/tests/cases/zeroextarg.ll
+++ b/tests/cases/zeroextarg.ll
@@ -1,6 +1,6 @@
; ModuleID = 'tests/hello_world.bc'
-target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
-target triple = "le32-unknown-nacl"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/codemods.cpp b/tests/codemods.cpp
new file mode 100644
index 00000000..26712339
--- /dev/null
+++ b/tests/codemods.cpp
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <math.h>
+#include <emscripten.h>
+
+int main() {
+ volatile int x = 10;
+ float y = 123456789.123456789;
+ while (x-- > 0) {
+ y = (sqrtf(y) + y)/2;
+ }
+ double d = y;
+ double diff = fabs(d - 121376.4609375000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
+ int ok = fabs(diff) < 0.000001;
+ printf("%.20f : %d\n", diff, ok);
+
+ int result;
+ if (ok) result = 1;
+ else result = diff+2; // add two to this >= number to avoid conflicts with 1
+ REPORT_RESULT();
+}
+
diff --git a/tests/core/emscripten_get_compiler_setting.c b/tests/core/emscripten_get_compiler_setting.c
new file mode 100644
index 00000000..41eb8e38
--- /dev/null
+++ b/tests/core/emscripten_get_compiler_setting.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <assert.h>
+#include <emscripten.h>
+
+int main() {
+ printf("QS: %d\n", emscripten_get_compiler_setting("QUANTUM_SIZE"));
+ assert((unsigned)emscripten_get_compiler_setting("OPT_LEVEL") <= 3);
+ assert((unsigned)emscripten_get_compiler_setting("DEBUG_LEVEL") <= 4);
+ printf("EV: %s\n", (char*)emscripten_get_compiler_setting("EMSCRIPTEN_VERSION"));
+}
+
diff --git a/tests/core/emscripten_get_compiler_setting.out b/tests/core/emscripten_get_compiler_setting.out
new file mode 100644
index 00000000..cd520064
--- /dev/null
+++ b/tests/core/emscripten_get_compiler_setting.out
@@ -0,0 +1,2 @@
+QS: 4
+EV: waka
diff --git a/tests/core/fnmatch.c b/tests/core/fnmatch.c
new file mode 100644
index 00000000..ebdb2009
--- /dev/null
+++ b/tests/core/fnmatch.c
@@ -0,0 +1,79 @@
+// Begin test_fnmatch.cpp
+#include <fnmatch.h>
+#include <iostream>
+#include <vector>
+#include <string>
+
+using namespace std;
+
+class TestCase {
+public:
+ TestCase(const string& pattern, const string& testString, int flags, int expected) :
+ pattern(pattern),
+ testString(testString),
+ flags(flags),
+ expected(expected)
+ {}
+ string pattern;
+ string testString;
+ int flags;
+ int expected;
+};
+
+int main()
+{
+ vector<TestCase> testCases;
+
+ testCases.push_back(TestCase("*","anything",0,0));
+ testCases.push_back(TestCase("*.txt","readme.txt",0,0));
+ testCases.push_back(TestCase("*.txt","readme.info",0,FNM_NOMATCH));
+ testCases.push_back(TestCase("*.t?t","readme.txt",0,0));
+ testCases.push_back(TestCase("*.t?t","readme.tot",0,0));
+ testCases.push_back(TestCase("*.t?t","readme.txxt",0,FNM_NOMATCH));
+ testCases.push_back(TestCase("[a-g]1","c1",0,0));
+ testCases.push_back(TestCase("[a-g]1","i1",0,FNM_NOMATCH));
+ testCases.push_back(TestCase("[!a-g]1","i1",0,0));
+ testCases.push_back(TestCase("a\\*","anything",0,FNM_NOMATCH));
+ testCases.push_back(TestCase("a\\*","a*",0,0));
+ testCases.push_back(TestCase("a\\*","a*",FNM_NOESCAPE,FNM_NOMATCH));
+ testCases.push_back(TestCase("a\\*","a\\*",FNM_NOESCAPE,0));
+ testCases.push_back(TestCase("*readme","/etc/readme",0,0));
+ testCases.push_back(TestCase("*readme","/etc/readme",FNM_PATHNAME,FNM_NOMATCH));
+ testCases.push_back(TestCase("/*/readme","/etc/readme",FNM_PATHNAME,0));
+ testCases.push_back(TestCase("*readme","/etc/.readme",0,0));
+ testCases.push_back(TestCase("*readme",".readme",FNM_PERIOD,FNM_NOMATCH));
+ testCases.push_back(TestCase("*.readme","/etc/.readme",FNM_PERIOD,0));
+ testCases.push_back(TestCase("*.readme","/etc/.readme",FNM_PERIOD|FNM_PATHNAME,FNM_NOMATCH));
+ testCases.push_back(TestCase("/*/.readme","/etc/.readme",FNM_PERIOD|FNM_PATHNAME,0));
+ testCases.push_back(TestCase("ReAdME","readme",0,FNM_NOMATCH));
+
+ bool pass = true;
+
+ for (vector<TestCase>::const_iterator it = testCases.begin(); it != testCases.end(); ++it)
+ {
+ int result = fnmatch(it->pattern.c_str(), it->testString.c_str(), it->flags);
+ if (result == it->expected)
+ cout << "Pass: ";
+ else
+ {
+ cout << "Fail: ";
+ pass = false;
+ }
+
+ cout << "fnmatch(" << it->pattern << ", " << it->testString << ", "
+ << it->flags << ") returned " << result << ", expected "
+ << it->expected << endl;
+ }
+
+ if (pass)
+ {
+ cout << "All tests passed." << endl;
+ return 0;
+ }
+ else
+ {
+ cout << "Some tests failed." << endl;
+ return 1;
+ }
+}
+
diff --git a/tests/core/fnmatch.out b/tests/core/fnmatch.out
new file mode 100644
index 00000000..303f7449
--- /dev/null
+++ b/tests/core/fnmatch.out
@@ -0,0 +1,23 @@
+Pass: fnmatch(*, anything, 0) returned 0, expected 0
+Pass: fnmatch(*.txt, readme.txt, 0) returned 0, expected 0
+Pass: fnmatch(*.txt, readme.info, 0) returned 1, expected 1
+Pass: fnmatch(*.t?t, readme.txt, 0) returned 0, expected 0
+Pass: fnmatch(*.t?t, readme.tot, 0) returned 0, expected 0
+Pass: fnmatch(*.t?t, readme.txxt, 0) returned 1, expected 1
+Pass: fnmatch([a-g]1, c1, 0) returned 0, expected 0
+Pass: fnmatch([a-g]1, i1, 0) returned 1, expected 1
+Pass: fnmatch([!a-g]1, i1, 0) returned 0, expected 0
+Pass: fnmatch(a\*, anything, 0) returned 1, expected 1
+Pass: fnmatch(a\*, a*, 0) returned 0, expected 0
+Pass: fnmatch(a\*, a*, 2) returned 1, expected 1
+Pass: fnmatch(a\*, a\*, 2) returned 0, expected 0
+Pass: fnmatch(*readme, /etc/readme, 0) returned 0, expected 0
+Pass: fnmatch(*readme, /etc/readme, 1) returned 1, expected 1
+Pass: fnmatch(/*/readme, /etc/readme, 1) returned 0, expected 0
+Pass: fnmatch(*readme, /etc/.readme, 0) returned 0, expected 0
+Pass: fnmatch(*readme, .readme, 4) returned 1, expected 1
+Pass: fnmatch(*.readme, /etc/.readme, 4) returned 0, expected 0
+Pass: fnmatch(*.readme, /etc/.readme, 5) returned 1, expected 1
+Pass: fnmatch(/*/.readme, /etc/.readme, 5) returned 0, expected 0
+Pass: fnmatch(ReAdME, readme, 0) returned 1, expected 1
+All tests passed.
diff --git a/tests/core/test_alloca.in b/tests/core/test_alloca.in
index bfad3324..d115880f 100644
--- a/tests/core/test_alloca.in
+++ b/tests/core/test_alloca.in
@@ -1,9 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
+#include <assert.h>
-int main() {
- char *pc;
- pc = (char *)alloca(5);
- printf("z:%d*%d*\n", pc > 0, (int)pc);
+int main(int argc, char **argv) {
+ char *pc, *pc2;
+ assert(argc == 1);
+ pc = (char *)alloca(4+argc);
+ assert(((int)pc) % 4 == 0);
+ pc2 = (char *)alloca(4+argc);
+ assert(((int)pc2) % 4 == 0);
+ printf("z:%d*%d*%d*\n", pc > 0, (int)pc, (int)pc2);
return 0;
}
diff --git a/tests/core/test_exception_2.in b/tests/core/test_exceptions_2.in
index 2eae3198..2eae3198 100644
--- a/tests/core/test_exception_2.in
+++ b/tests/core/test_exceptions_2.in
diff --git a/tests/core/test_exception_2.out b/tests/core/test_exceptions_2.out
index aa89c67d..aa89c67d 100644
--- a/tests/core/test_exception_2.out
+++ b/tests/core/test_exceptions_2.out
diff --git a/tests/core/test_exceptions_alias.c b/tests/core/test_exceptions_alias.c
new file mode 100644
index 00000000..0c8cc37a
--- /dev/null
+++ b/tests/core/test_exceptions_alias.c
@@ -0,0 +1,15 @@
+#define _POSIX_SOURCE
+#include <locale.h>
+#include <ctype.h>
+#include <stdio.h>
+
+int main(void) {
+ try {
+ printf("*%i*\n", isdigit('0'));
+ printf("*%i*\n", isdigit_l('0', LC_GLOBAL_LOCALE));
+ }
+ catch (...) {
+ printf("EXCEPTION!\n");
+ }
+}
+
diff --git a/tests/core/test_exceptions_alias.out b/tests/core/test_exceptions_alias.out
new file mode 100644
index 00000000..2f67e501
--- /dev/null
+++ b/tests/core/test_exceptions_alias.out
@@ -0,0 +1,2 @@
+*1*
+*1*
diff --git a/tests/core/test_multiexception.in b/tests/core/test_exceptions_multi.in
index 46acbbf3..5453d11c 100644
--- a/tests/core/test_multiexception.in
+++ b/tests/core/test_exceptions_multi.in
@@ -22,9 +22,9 @@ void setjmp_func(jmp_state* s, int level) {
s->jmp = c_jmp;
setjmp_func(s, level + 1);
}
- catch (int catched_eid) {
- printf("caught %d\n", catched_eid);
- if (catched_eid == c_jmp) {
+ catch (int caught_eid) {
+ printf("caught %d\n", caught_eid);
+ if (caught_eid == c_jmp) {
printf("setjmp exception execution path, level: %d, prev_jmp: %d\n",
level, prev_jmp);
if (prev_jmp != -1) {
diff --git a/tests/core/test_multiexception.out b/tests/core/test_exceptions_multi.out
index 33efe46e..33efe46e 100644
--- a/tests/core/test_multiexception.out
+++ b/tests/core/test_exceptions_multi.out
diff --git a/tests/core/test_std_exception.in b/tests/core/test_exceptions_std.in
index 4b5905d8..3b9f874b 100644
--- a/tests/core/test_std_exception.in
+++ b/tests/core/test_exceptions_std.in
@@ -7,6 +7,7 @@ int main() {
throw e;
}
catch (std::exception e) {
+ printf("what? %s\n", e.what());
printf("caught std::exception\n");
}
return 0;
diff --git a/tests/core/test_exceptions_std.out b/tests/core/test_exceptions_std.out
new file mode 100644
index 00000000..eddab21c
--- /dev/null
+++ b/tests/core/test_exceptions_std.out
@@ -0,0 +1,2 @@
+what? std::exception
+caught std::exception
diff --git a/tests/exceptions/typed.cpp b/tests/core/test_exceptions_typed.in
index a2b77fee..a2b77fee 100644
--- a/tests/exceptions/typed.cpp
+++ b/tests/core/test_exceptions_typed.in
diff --git a/tests/exceptions/output.txt b/tests/core/test_exceptions_typed.out
index 718f189a..718f189a 100644
--- a/tests/exceptions/output.txt
+++ b/tests/core/test_exceptions_typed.out
diff --git a/tests/core/test_white_list_exception.in b/tests/core/test_exceptions_white_list.in
index 2944f9fe..2944f9fe 100644
--- a/tests/core/test_white_list_exception.in
+++ b/tests/core/test_exceptions_white_list.in
diff --git a/tests/core/test_white_list_exception.out b/tests/core/test_exceptions_white_list.out
index 62e1a81c..62e1a81c 100644
--- a/tests/core/test_white_list_exception.out
+++ b/tests/core/test_exceptions_white_list.out
diff --git a/tests/core/test_exceptions_white_list_2.c b/tests/core/test_exceptions_white_list_2.c
new file mode 100644
index 00000000..40d7c56c
--- /dev/null
+++ b/tests/core/test_exceptions_white_list_2.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+void throwhere(void) {
+ throw(1);
+}
+
+void (*funptr)(void) = throwhere;
+
+void nocatch(void) {
+ try {
+ funptr();
+ }
+ catch (...) {
+ printf("ERROR\n");
+ }
+}
+
+int main(void) {
+ try {
+ nocatch();
+ }
+ catch (...) {
+ printf("SUCCESS\n");
+ }
+ return 0;
+}
+
diff --git a/tests/core/test_exceptions_white_list_2.out b/tests/core/test_exceptions_white_list_2.out
new file mode 100644
index 00000000..ff43ca40
--- /dev/null
+++ b/tests/core/test_exceptions_white_list_2.out
@@ -0,0 +1 @@
+SUCCESS
diff --git a/tests/core/test_inlinejs3.in b/tests/core/test_inlinejs3.in
index 3e1913ff..12e31007 100644
--- a/tests/core/test_inlinejs3.in
+++ b/tests/core/test_inlinejs3.in
@@ -3,10 +3,11 @@
int main(int argc, char **argv) {
EM_ASM(Module.print('hello dere1'));
- EM_ASM(Module.print('hello dere2'););
+ EM_ASM("Module.print('hello dere2');");
for (int i = 0; i < 3; i++) {
EM_ASM(Module.print('hello dere3'); Module.print('hello dere' + 4););
}
+ EM_ASM_({ Module.print('hello input ' + $0) }, 123);
int sum = 0;
for (int i = 0; i < argc * 3; i++) {
sum += EM_ASM_INT({
@@ -15,6 +16,9 @@ int main(int argc, char **argv) {
},
i, double(i) / 12);
}
+ EM_ASM_INT({ globalVar = $0 }, sum); // no outputs, just input
+ sum = 0;
+ sum = EM_ASM_INT_V({ return globalVar }); // no inputs, just output
printf("sum: %d\n", sum);
return 0;
}
diff --git a/tests/core/test_inlinejs3.out b/tests/core/test_inlinejs3.out
index c293e80b..1f64a89a 100644
--- a/tests/core/test_inlinejs3.out
+++ b/tests/core/test_inlinejs3.out
@@ -6,6 +6,7 @@ hello dere3
hello dere4
hello dere3
hello dere4
+hello input 123
i: 0,0.00
i: 1,0.08
i: 2,0.17
diff --git a/tests/core/test_longjmp_throw.cpp b/tests/core/test_longjmp_throw.cpp
new file mode 100644
index 00000000..a5b658e8
--- /dev/null
+++ b/tests/core/test_longjmp_throw.cpp
@@ -0,0 +1,38 @@
+#include <stdio.h>
+#include <setjmp.h>
+
+static jmp_buf buf;
+volatile int x = 0;
+
+void second(void) {
+ printf("second\n");
+ if (x == 17) throw 5;
+ else longjmp(buf, -1);
+}
+
+void first(void) {
+ printf("first\n");
+ longjmp(buf, 1);
+}
+
+int main() {
+ int jmpval = setjmp(buf);
+ if (!jmpval) {
+ x++;
+ first();
+ printf("skipped\n");
+ } else if (jmpval == 1) {
+ printf("result: %d %d\n", x, jmpval);
+ x++;
+ try {
+ second();
+ } catch(int a) {
+ x--;
+ second();
+ }
+ } else if (jmpval == -1) {
+ printf("result: %d %d\n", x, jmpval);
+ }
+
+ return 0;
+}
diff --git a/tests/core/test_longjmp_throw.out b/tests/core/test_longjmp_throw.out
new file mode 100644
index 00000000..e9cc7525
--- /dev/null
+++ b/tests/core/test_longjmp_throw.out
@@ -0,0 +1,4 @@
+first
+result: 1 1
+second
+result: 2 -1
diff --git a/tests/core/test_memcpy3.c b/tests/core/test_memcpy3.c
new file mode 100644
index 00000000..1bf47be6
--- /dev/null
+++ b/tests/core/test_memcpy3.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#define TOTAL 10240
+
+#define TEST(size, type) { \
+ for (int i = 0; i < TOTAL; i++) { \
+ buffer[i] = i*seed; \
+ } \
+ memcpy(buffer, buffer+size+1, size*sizeof(type)); \
+ int v = 0; \
+ for (int i = 0; i < TOTAL; i++) { \
+ v += buffer[i]; \
+ } \
+ printf("final %d:%d\n", size, v); \
+}
+
+int main() {
+ #define RUN(type) \
+ { \
+ type buffer[TOTAL]; \
+ volatile int seed = 123; \
+ TEST(1, type); \
+ TEST(2, type); \
+ TEST(3, type); \
+ TEST(4, type); \
+ TEST(5, type); \
+ TEST(6, type); \
+ TEST(7, type); \
+ TEST(8, type); \
+ TEST(9, type); \
+ TEST(10, type); \
+ TEST(16, type); \
+ TEST(32, type); \
+ TEST(64, type); \
+ TEST(128, type); \
+ TEST(256, type); \
+ TEST(512, type); \
+ TEST(1024, type); \
+ for (int x = 10; x < 100; x += 10) { TEST(x, type) }; \
+ }
+ printf("8\n");
+ RUN(unsigned char);
+ printf("16\n");
+ RUN(unsigned short);
+ printf("32\n");
+ RUN(unsigned);
+ return 1;
+}
+
diff --git a/tests/core/test_memcpy3.out b/tests/core/test_memcpy3.out
new file mode 100644
index 00000000..6f39e709
--- /dev/null
+++ b/tests/core/test_memcpy3.out
@@ -0,0 +1,81 @@
+8
+final 1:1305846
+final 2:1305826
+final 3:1305796
+final 4:1305756
+final 5:1305706
+final 6:1305646
+final 7:1305576
+final 8:1305496
+final 9:1305406
+final 10:1305306
+final 16:1305264
+final 32:1305696
+final 64:1305024
+final 128:1305728
+final 256:1305600
+final 512:1305600
+final 1024:1305600
+final 10:1305306
+final 20:1305548
+final 30:1305814
+final 40:1305336
+final 50:1305906
+final 60:1305476
+final 70:1305582
+final 80:1305712
+final 90:1304842
+16
+final 1:332555510
+final 2:332556002
+final 3:332556740
+final 4:332557724
+final 5:332558954
+final 6:332560430
+final 7:332562152
+final 8:332564120
+final 9:332566334
+final 10:332568794
+final 16:332588720
+final 32:332685152
+final 64:333066944
+final 128:334586240
+final 256:340647680
+final 512:332618240
+final 1024:332812288
+final 10:332568794
+final 20:332606924
+final 30:332669654
+final 40:332756984
+final 50:332868914
+final 60:333005444
+final 70:333166574
+final 80:333352304
+final 90:333562634
+32
+final 1:-2141821706
+final 2:-2141821214
+final 3:-2141820476
+final 4:-2141819492
+final 5:-2141818262
+final 6:-2141816786
+final 7:-2141815064
+final 8:-2141813096
+final 9:-2141810882
+final 10:-2141808422
+final 16:-2141788496
+final 32:-2141692064
+final 64:-2141310272
+final 128:-2139790976
+final 256:-2133729536
+final 512:-2109515264
+final 1024:-2012721152
+final 10:-2141808422
+final 20:-2141770292
+final 30:-2141707562
+final 40:-2141620232
+final 50:-2141508302
+final 60:-2141371772
+final 70:-2141210642
+final 80:-2141024912
+final 90:-2140814582
diff --git a/tests/core/test_memset.c b/tests/core/test_memset.c
new file mode 100644
index 00000000..747765f2
--- /dev/null
+++ b/tests/core/test_memset.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#define TOTAL 10240
+
+#define TEST(size, type) { \
+ for (int i = 0; i < TOTAL; i++) { \
+ buffer[i] = i*seed; \
+ } \
+ memset(buffer+size%17, 0xA5, size); \
+ int v = 0; \
+ for (int i = 0; i < TOTAL; i++) { \
+ v += buffer[i]; \
+ } \
+ printf("final %d:%d\n", size, v); \
+}
+
+int main() {
+ #define RUN(type) \
+ { \
+ type buffer[TOTAL]; \
+ volatile int seed = 123; \
+ TEST(1, type); \
+ TEST(2, type); \
+ TEST(3, type); \
+ TEST(4, type); \
+ TEST(5, type); \
+ TEST(6, type); \
+ TEST(7, type); \
+ TEST(8, type); \
+ TEST(9, type); \
+ TEST(10, type); \
+ TEST(16, type); \
+ TEST(32, type); \
+ TEST(64, type); \
+ TEST(128, type); \
+ TEST(256, type); \
+ TEST(512, type); \
+ TEST(1024, type); \
+ for (int x = 10; x < 100; x += 10) { TEST(x, type) }; \
+ }
+ printf("8\n");
+ RUN(unsigned char);
+ printf("16\n");
+ RUN(unsigned short);
+ printf("32\n");
+ RUN(unsigned);
+ return 1;
+}
+
diff --git a/tests/core/test_memset.out b/tests/core/test_memset.out
new file mode 100644
index 00000000..7517e6ba
--- /dev/null
+++ b/tests/core/test_memset.out
@@ -0,0 +1,81 @@
+8
+final 1:1305642
+final 2:1305571
+final 3:1305643
+final 4:1305602
+final 5:1305704
+final 6:1305693
+final 7:1305825
+final 8:1305844
+final 9:1306006
+final 10:1306055
+final 16:1306280
+final 32:1307056
+final 64:1308384
+final 128:1310400
+final 256:1315200
+final 512:1324800
+final 1024:1344000
+final 10:1306055
+final 20:1306310
+final 30:1306867
+final 40:1307060
+final 50:1307463
+final 60:1307850
+final 70:1308037
+final 80:1308424
+final 90:1308805
+16
+final 1:332555306
+final 2:332597423
+final 3:332597229
+final 4:332638967
+final 5:332638793
+final 6:332679896
+final 7:332679486
+final 8:332720210
+final 9:332719820
+final 10:332759909
+final 16:332875316
+final 32:333189464
+final 64:333800048
+final 128:334950368
+final 256:336967616
+final 512:339333248
+final 1024:337924352
+final 10:332759909
+final 20:332970089
+final 30:333154439
+final 40:333365234
+final 50:333529289
+final 60:333740699
+final 70:333957644
+final 80:334096484
+final 90:334314044
+32
+final 1:-2141821910
+final 2:-2141779793
+final 3:-2130966476
+final 4:637274041
+final 5:637273857
+final 6:637315339
+final 7:648128533
+final 8:-878598369
+final 9:-878598523
+final 10:-878557932
+final 16:384620786
+final 32:-1383904756
+final 64:-625991496
+final 128:889823216
+final 256:-373561888
+final 512:1394178624
+final 1024:633133696
+final 10:-878557932
+final 20:-1131244490
+final 30:132010428
+final 40:-120673793
+final 50:1142572023
+final 60:889890139
+final 70:-2141802805
+final 80:1900447306
+final 90:-1131244285
diff --git a/tests/core/test_nl_types.in b/tests/core/test_nl_types.in
new file mode 100644
index 00000000..666920ee
--- /dev/null
+++ b/tests/core/test_nl_types.in
@@ -0,0 +1,8 @@
+#include <nl_types.h>
+#include <stdio.h>
+
+int main(int argc, char ** argv) {
+ nl_catd c = catopen("none", 0);
+ printf("Hello, %s.\n", catgets(c, 0, 0, "world"));
+ return catclose(c);
+}
diff --git a/tests/core/test_nl_types.out b/tests/core/test_nl_types.out
new file mode 100644
index 00000000..f75ba05f
--- /dev/null
+++ b/tests/core/test_nl_types.out
@@ -0,0 +1 @@
+Hello, world.
diff --git a/tests/core/test_sscanf.in b/tests/core/test_sscanf.in
index d5289fe5..55a310c5 100644
--- a/tests/core/test_sscanf.in
+++ b/tests/core/test_sscanf.in
@@ -64,6 +64,7 @@ int main() {
}
char buf1[100], buf2[100], buf3[100], buf4[100];
+ memset(buf4, 0, 100);
int numItems = sscanf("level=4:ref=3", "%255[^:=]=%255[^:]:%255[^=]=%255c",
buf1, buf2, buf3, buf4);
diff --git a/tests/core/test_sscanf_6.in b/tests/core/test_sscanf_6.in
index 63ede53f..e0541670 100644
--- a/tests/core/test_sscanf_6.in
+++ b/tests/core/test_sscanf_6.in
@@ -11,4 +11,18 @@ int main() {
i = sscanf(date, "%d.%d.%3c", &d, &m, c);
printf("date: %s; day %2d, month %2d, year %4d, extra: %s, %d\n", date, d, m,
y, c, i);
+
+ {
+ char *date = "18.07.2013", c;
+ int y, m, d, i;
+ if ((i = sscanf(date, "%d.%d.%4d%c", &d, &m, &y, &c)) == 3)
+ {
+ printf("date: %s; day %2d, month %2d, year %4d \n", date, d, m, y);
+ }
+ else
+ {
+ printf("Error in sscanf: actually parsed %d", i);
+ }
+ }
}
+
diff --git a/tests/core/test_sscanf_6.out b/tests/core/test_sscanf_6.out
index 4aee073e..7256b03b 100644
--- a/tests/core/test_sscanf_6.out
+++ b/tests/core/test_sscanf_6.out
@@ -1,2 +1,3 @@
date: 18.07.2013w; day 18, month 7, year 2013, extra: w, 4
date: 18.07.2013w; day 18, month 7, year 2013, extra: 201, 3
+date: 18.07.2013; day 18, month 7, year 2013
diff --git a/tests/core/test_sscanf_other_whitespace.in b/tests/core/test_sscanf_other_whitespace.in
index 467fa4f0..3ae23d92 100644
--- a/tests/core/test_sscanf_other_whitespace.in
+++ b/tests/core/test_sscanf_other_whitespace.in
@@ -1,8 +1,8 @@
#include <stdio.h>
int main() {
- short int x;
- short int y;
+ int x;
+ int y;
const char* buffer[] = {
"\t2\t3\t", /* TAB - horizontal tab */
diff --git a/tests/core/test_std_exception.out b/tests/core/test_std_exception.out
deleted file mode 100644
index c1660de4..00000000
--- a/tests/core/test_std_exception.out
+++ /dev/null
@@ -1 +0,0 @@
-caught std::exception \ No newline at end of file
diff --git a/tests/core/test_strcmp_uni.out b/tests/core/test_strcmp_uni.out
index 58e237d7..ebfe2c8e 100644
--- a/tests/core/test_strcmp_uni.out
+++ b/tests/core/test_strcmp_uni.out
@@ -1,3 +1,3 @@
-Compare value strncmp is -1
-Compare value strncasecmp is -1
-Compare value memcmp is -1
+Compare value strncmp is -108
+Compare value strncasecmp is -76
+Compare value memcmp is -108
diff --git a/tests/cube_explosion.c b/tests/cube_explosion.c
index 0c6eb674..a899f068 100644
--- a/tests/cube_explosion.c
+++ b/tests/cube_explosion.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
glDeleteTextures(1, &texture);
assert(!glIsTexture(texture)); // but not anymore
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom.c b/tests/cubegeom.c
index e749045b..950439ec 100644
--- a/tests/cubegeom.c
+++ b/tests/cubegeom.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -316,7 +316,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_color.c b/tests/cubegeom_color.c
index ff30e1a9..0d2b6ecb 100644
--- a/tests/cubegeom_color.c
+++ b/tests/cubegeom_color.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -38,7 +38,7 @@ void verify() {
for (int x = 0; x < width*height*4; x++) {
if (x % 4 != 3) sum += x * data[x];
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
int result = sum;
REPORT_RESULT();
#endif
@@ -286,7 +286,7 @@ int main(int argc, char *argv[])
verify();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_color2.c b/tests/cubegeom_color2.c
index 76d71d00..76bbb119 100644
--- a/tests/cubegeom_color2.c
+++ b/tests/cubegeom_color2.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -273,7 +273,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_fog.c b/tests/cubegeom_fog.c
index cae6ca2d..50d2843b 100644
--- a/tests/cubegeom_fog.c
+++ b/tests/cubegeom_fog.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_glew.c b/tests/cubegeom_glew.c
index 210e1c60..96f401c6 100644
--- a/tests/cubegeom_glew.c
+++ b/tests/cubegeom_glew.c
@@ -287,7 +287,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_mt.c b/tests/cubegeom_mt.c
index b4ad28a7..cbfcbfdf 100644
--- a/tests/cubegeom_mt.c
+++ b/tests/cubegeom_mt.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -274,7 +274,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal.c b/tests/cubegeom_normal.c
index 02655edf..e56286fb 100644
--- a/tests/cubegeom_normal.c
+++ b/tests/cubegeom_normal.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -269,7 +269,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap.c b/tests/cubegeom_normal_dap.c
index 752911a8..594aec05 100644
--- a/tests/cubegeom_normal_dap.c
+++ b/tests/cubegeom_normal_dap.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -266,7 +266,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far.c b/tests/cubegeom_normal_dap_far.c
index 35a068d9..da28f775 100644
--- a/tests/cubegeom_normal_dap_far.c
+++ b/tests/cubegeom_normal_dap_far.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#if !defined(__EMSCRIPTEN__)
#define USE_GLEW 1
#endif
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#if !defined(__EMSCRIPTEN__)
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_glda.c b/tests/cubegeom_normal_dap_far_glda.c
index 849245b8..ee381458 100644
--- a/tests/cubegeom_normal_dap_far_glda.c
+++ b/tests/cubegeom_normal_dap_far_glda.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_glda_quad.c b/tests/cubegeom_normal_dap_far_glda_quad.c
index 93c157a4..91f60031 100644
--- a/tests/cubegeom_normal_dap_far_glda_quad.c
+++ b/tests/cubegeom_normal_dap_far_glda_quad.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -254,7 +254,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_normal_dap_far_range.c b/tests/cubegeom_normal_dap_far_range.c
index 17691ce9..3f041668 100644
--- a/tests/cubegeom_normal_dap_far_range.c
+++ b/tests/cubegeom_normal_dap_far_range.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -263,7 +263,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre.c b/tests/cubegeom_pre.c
index 40b03cf7..70e3435f 100644
--- a/tests/cubegeom_pre.c
+++ b/tests/cubegeom_pre.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -283,7 +283,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre2.c b/tests/cubegeom_pre2.c
index df04ae31..88c82541 100644
--- a/tests/cubegeom_pre2.c
+++ b/tests/cubegeom_pre2.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -322,7 +322,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre2_vao.c b/tests/cubegeom_pre2_vao.c
index 733c8fc6..5abe1868 100644
--- a/tests/cubegeom_pre2_vao.c
+++ b/tests/cubegeom_pre2_vao.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -354,7 +354,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre2_vao2.c b/tests/cubegeom_pre2_vao2.c
index 69096833..d2d55597 100644
--- a/tests/cubegeom_pre2_vao2.c
+++ b/tests/cubegeom_pre2_vao2.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -355,7 +355,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre3.c b/tests/cubegeom_pre3.c
index ceaa757e..81c87589 100644
--- a/tests/cubegeom_pre3.c
+++ b/tests/cubegeom_pre3.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -322,7 +322,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_pre_vao.c b/tests/cubegeom_pre_vao.c
index 8c598143..4f7adf9e 100644
--- a/tests/cubegeom_pre_vao.c
+++ b/tests/cubegeom_pre_vao.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -308,7 +308,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/cubegeom_proc.c b/tests/cubegeom_proc.c
new file mode 100644
index 00000000..2dfe85ae
--- /dev/null
+++ b/tests/cubegeom_proc.c
@@ -0,0 +1,331 @@
+/*
+THIS WORK, INCLUDING THE SOURCE CODE, DOCUMENTATION
+AND RELATED MEDIA AND DATA, IS PLACED INTO THE PUBLIC DOMAIN.
+
+THE ORIGINAL AUTHOR IS KYLE FOLEY.
+
+THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY
+OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF
+MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE,
+ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE
+RESULTING FROM THE USE, MODIFICATION, OR
+REDISTRIBUTION OF THIS SOFTWARE.
+*/
+
+#ifndef __EMSCRIPTEN__
+#define USE_GLEW 1
+#endif
+
+#if USE_GLEW
+#include "GL/glew.h"
+#endif
+
+#include "SDL/SDL.h"
+#if !USE_GLEW
+#include "SDL/SDL_opengl.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+extern void *getBindBuffer();
+
+void (*_glBindBuffer)(unsigned, unsigned) = NULL;
+
+int main(int argc, char *argv[])
+{
+ _glBindBuffer = (void (*)(unsigned, unsigned))getBindBuffer();
+ // testing
+ GLint tempInt;
+ GLboolean tempBool;
+ void *tempPtr;
+
+ SDL_Surface *screen;
+ if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
+ printf("Unable to initialize SDL: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+ screen = SDL_SetVideoMode( 640, 480, 24, SDL_OPENGL );
+ if ( !screen ) {
+ printf("Unable to set video mode: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ glClearColor( 0, 0, 0, 0 );
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ // Create a texture
+
+ GLuint boundTex = 123;
+ assert(!glGetError());
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &boundTex);
+ assert(!glGetError());
+ assert(boundTex == 0);
+
+ GLuint texture;
+ glGenTextures( 1, &texture );
+ glBindTexture( GL_TEXTURE_2D, texture );
+
+ assert(!glGetError());
+ glGetIntegerv(GL_TEXTURE_BINDING_2D, &boundTex);
+ assert(!glGetError());
+ assert(boundTex == texture);
+
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ GLubyte textureData[16*16*4];
+ for (int x = 0; x < 16; x++) {
+ for (int y = 0; y < 16; y++) {
+ *((int*)&textureData[(x*16 + y) * 4]) = x*16 + ((y*16) << 8);
+ }
+ }
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, textureData );
+
+ // Create a second texture
+
+ GLuint texture2;
+ glGenTextures( 1, &texture2 );
+ glBindTexture( GL_TEXTURE_2D, texture2 );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ GLubyte texture2Data[] = { 0xff, 0, 0, 0xff,
+ 0, 0xff, 0, 0xaa,
+ 0, 0, 0xff, 0x55,
+ 0x80, 0x90, 0x70, 0 };
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, texture2Data );
+
+ // BEGIN
+
+#if USE_GLEW
+ glewInit();
+#endif
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ // original: glFrustum(-0.6435469817188064, 0.6435469817188064 ,-0.48266022190470925, 0.48266022190470925 ,0.5400000214576721, 2048);
+ glFrustum(-0.6435469817188064, 0.1435469817188064 ,-0.48266022190470925, 0.88266022190470925 ,0.5400000214576721, 2048);
+ glRotatef(-30, 1, 1, 1);
+ //GLfloat pm[] = { 1.372136116027832, 0, 0, 0, 0, 0.7910231351852417, 0, 0, -0.6352481842041016, 0.29297152161598206, -1.0005275011062622, -1, 0, 0, -1.080284833908081, 0 };
+ //glLoadMatrixf(pm);
+
+ glMatrixMode(GL_MODELVIEW);
+ GLfloat matrixData[] = { -1, 0, 0, 0,
+ 0, 0,-1, 0,
+ 0, 1, 0, 0,
+ 0, 0, 0, 1 };
+ glLoadMatrixf(matrixData);
+ //glTranslated(-512,-512,-527); // XXX this should be uncommented, but if it is then nothing is shown
+
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_DEPTH_TEST);
+
+ glClear(GL_DEPTH_BUFFER_BIT);
+
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glActiveTexture(GL_TEXTURE0);
+
+ glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(!tempBool);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);
+
+ GLuint arrayBuffer, elementBuffer;
+ glGenBuffers(1, &arrayBuffer);
+ glGenBuffers(1, &elementBuffer);
+
+ GLubyte arrayData[] = {
+/*
+[0, 0, 0, 67] ==> 128 float
+[0, 0, 128, 67] ==> 256 float
+[0, 0, 0, 68] ==> 512 float
+[0, 0, 128, 68] ==> 1024 float
+
+[vertex x ] [vertex y ] [vertex z ] [nr] [texture u ] [texture v ] [lm u ] [lm v ] [color r,g,b,a ] */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 0
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 1
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 2
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 3
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 4
+ 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, // 5
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 6
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 7
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 8
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 9
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 10
+ 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 11
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 12
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 0, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 13
+ 0, 0, 128, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 14
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 128, 67, 0, 0, 0, 0, 128, 128, 128, 128, // 15
+
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 0, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 128, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128,
+ 0, 0, 128, 68, 0, 0, 128, 68, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128
+ };
+ assert(sizeof(arrayData) == 1408);
+ _glBindBuffer(GL_ARRAY_BUFFER, arrayBuffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(arrayData), arrayData, GL_STATIC_DRAW);
+ _glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ GLushort elementData[] = { 1, 2, 0, 2, 3, 0, 5, 6, 4, 6, 7, 4, 9, 10, 8, 10, 11, 8, 13, 14, 12, 14, 15, 12 };
+ assert(sizeof(elementData) == 48);
+ _glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementBuffer);
+ glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(elementData), elementData, GL_STATIC_DRAW);
+ _glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+
+ _glBindBuffer(GL_ARRAY_BUFFER, arrayBuffer);
+ _glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, elementBuffer);
+
+ // sauer vertex data is apparently 0-12: V3F, 12: N1B, 16-24: T2F, 24-28: T2S, 28-32: C4B
+ glVertexPointer(3, GL_FLOAT, 32, (void*)0); // all these apply to the ARRAY_BUFFER that is bound
+ glTexCoordPointer(2, GL_FLOAT, 32, (void*)16);
+
+ glClientActiveTexture(GL_TEXTURE1); // XXX seems to be ignored in native build
+ glTexCoordPointer(2, GL_SHORT, 32, (void*)24);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &tempInt); assert(tempInt == 2);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &tempInt); assert(tempInt == GL_SHORT);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
+ glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)24);
+
+ glClientActiveTexture(GL_TEXTURE0); // likely not needed, it is a cleanup
+ glNormalPointer(GL_BYTE, 32, (void*)12);
+ glColorPointer(4, GL_UNSIGNED_BYTE, 32, (void*)28);
+
+ glGetPointerv(GL_VERTEX_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)0);
+ glGetPointerv(GL_COLOR_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)28);
+ glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)16);
+ glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &tempInt); assert(tempInt == 3);
+ glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
+ glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
+ glGetIntegerv(GL_COLOR_ARRAY_SIZE, &tempInt); assert(tempInt == 4);
+ glGetIntegerv(GL_COLOR_ARRAY_TYPE, &tempInt); assert(tempInt == GL_UNSIGNED_BYTE);
+ glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &tempInt); assert(tempInt == 2);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
+ glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
+ glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);
+
+ glBindTexture(GL_TEXTURE_2D, texture); // diffuse?
+ glActiveTexture(GL_TEXTURE0);
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture(GL_TEXTURE_2D, texture2); // lightmap?
+ glActiveTexture(GL_TEXTURE0);
+
+ GLint ok;
+
+ const char *vertexShader = "uniform vec4 texgenscroll;\n"
+ "void main(void)\n"
+ "{\n"
+ " gl_Position = ftransform();\n"
+ " gl_TexCoord[0].xy = gl_MultiTexCoord0.xy/100.0 + texgenscroll.xy;\n" // added /100 here
+ " gl_TexCoord[1].xy = gl_MultiTexCoord1.xy/100.0 * 3.051851e-05;\n"
+ "}\n";
+ const char *fragmentShader = "uniform vec4 colorparams;\n"
+ "uniform sampler2D diffusemap, lightmap;\n"
+ "void main(void)\n"
+ "{\n"
+ " vec4 diffuse = texture2D(diffusemap, gl_TexCoord[0].xy);\n"
+ " vec4 lm = texture2D(lightmap, gl_TexCoord[1].xy);\n"
+ " diffuse *= colorparams;\n"
+ " gl_FragColor = diffuse * lm;\n"
+ "}\n";
+
+ GLuint vs = glCreateShader(GL_VERTEX_SHADER);
+ glShaderSource(vs, 1, &vertexShader, NULL);
+ glCompileShader(vs);
+ glGetShaderiv(vs, GL_COMPILE_STATUS, &ok);
+ assert(ok);
+
+ GLuint fs = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fs, 1, &fragmentShader, NULL);
+ glCompileShader(fs);
+ glGetShaderiv(fs, GL_COMPILE_STATUS, &ok);
+ assert(ok);
+
+ GLuint program = glCreateProgram();
+
+ glAttachShader(program, vs);
+ glAttachShader(program, fs);
+ glLinkProgram(program);
+ glGetProgramiv(program, GL_LINK_STATUS, &ok);
+ assert(ok);
+
+ glUseProgram(program);
+
+ GLint lightmapLocation = glGetUniformLocation(program, "lightmap");
+ assert(lightmapLocation >= 0);
+ assert(lightmapLocation == glGetUniformLocation(program, "lightmap")); // must get identical ids
+ glLinkProgram(program);
+ glGetProgramiv(program, GL_LINK_STATUS, &ok);
+ assert(ok);
+ assert(lightmapLocation != glGetUniformLocation(program, "lightmap")); // must NOT get identical ids, we re-linked!
+ lightmapLocation = glGetUniformLocation(program, "lightmap");
+ assert(lightmapLocation == glGetUniformLocation(program, "lightmap")); // must get identical ids
+
+ glUniform1i(lightmapLocation, 1); // sampler2D? Is it the texture unit?
+
+ GLint diffusemapLocation = glGetUniformLocation(program, "diffusemap");
+ assert(diffusemapLocation >= 0);
+ glUniform1i(diffusemapLocation, 0);
+
+ GLint texgenscrollLocation = glGetUniformLocation(program, "texgenscroll");
+ assert(texgenscrollLocation >= 0);
+
+ GLint colorparamsLocation = glGetUniformLocation(program, "colorparams");
+ assert(colorparamsLocation >= 0);
+
+ GLfloat texgenscrollData[] = { 0, 0, 0, 0 };
+ glUniform4fv(texgenscrollLocation, 1, texgenscrollData);
+
+ GLfloat colorparamsData[] = { 2, 2, 2, 1 };
+ glUniform4fv(colorparamsLocation, 1, colorparamsData);
+
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (void*)12);
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (void*) 0);
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (void*)24);
+ glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, (void*)36);
+
+ // END
+
+ SDL_GL_SwapBuffers();
+
+#ifndef __EMSCRIPTEN__
+ SDL_Delay(1500);
+#endif
+
+ SDL_Quit();
+
+ return 0;
+}
diff --git a/tests/cubegeom_texturematrix.c b/tests/cubegeom_texturematrix.c
index abb667eb..21824344 100644
--- a/tests/cubegeom_texturematrix.c
+++ b/tests/cubegeom_texturematrix.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -287,7 +287,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/embind/build_benchmark b/tests/embind/build_benchmark
index 3d5d816b..74239406 100644
--- a/tests/embind/build_benchmark
+++ b/tests/embind/build_benchmark
@@ -1,2 +1,2 @@
#!/bin/bash
-EMCC_LLVM_TARGET=le32-unknown-nacl ../../emcc --minify 0 --bind --post-js embind.benchmark.js -O2 --shell-file shell.html -o embind_benchmark.html embind_benchmark.cpp
+EMCC_LLVM_TARGET=asmjs-unknown-emscripten ../../emcc --minify 0 --bind --post-js embind.benchmark.js -O2 --shell-file shell.html -o embind_benchmark.html embind_benchmark.cpp
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index da81a81e..5ca972be 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -55,7 +55,7 @@ module({
});
});
});
-
+
}
BaseFixture.extend("access to base class members", function() {
@@ -609,7 +609,7 @@ module({
assert.equal("0", cm.unsigned_int_to_string(0));
assert.equal("0", cm.long_to_string(0));
assert.equal("0", cm.unsigned_long_to_string(0));
-
+
// all types should have positive values.
assert.equal("5", cm.char_to_string(5));
assert.equal("5", cm.signed_char_to_string(5));
@@ -650,7 +650,7 @@ module({
assert.equal("-32768", cm.short_to_string(-32768));
assert.equal("-2147483648", cm.int_to_string(-2147483648));
assert.equal("-2147483648", cm.long_to_string(-2147483648));
-
+
// passing out of range values should fail.
assert.throws(TypeError, function() { cm.char_to_string(-129); });
assert.throws(TypeError, function() { cm.char_to_string(128); });
@@ -733,7 +733,7 @@ module({
test("overloading of derived class member functions", function() {
var foo = new cm.MultipleOverloadsDerived();
-
+
// NOTE: In C++, default lookup rules will hide overloads from base class if derived class creates them.
// In JS, we make the base class overloads implicitly available. In C++, they would need to be explicitly
// invoked, like foo.MultipleOverloads::Func(10);
@@ -748,7 +748,7 @@ module({
assert.equal(foo.WhichFuncCalled(), 4);
foo.delete();
});
-
+
test("overloading of class static functions", function() {
assert.equal(cm.MultipleOverloads.StaticFunc(10), 1);
assert.equal(cm.MultipleOverloads.WhichStaticFuncCalled(), 1);
@@ -1441,7 +1441,7 @@ module({
test("repr includes enum value", function() {
assert.equal('<#Enum_ONE {}>', IMVU.repr(cm.Enum.ONE));
assert.equal('<#Enum_TWO {}>', IMVU.repr(cm.Enum.TWO));
- });
+ });
}
test("instanceof", function() {
@@ -1591,7 +1591,7 @@ module({
test("returning a new shared pointer from interfaces implemented in JS code does not leak", function() {
var impl = cm.AbstractClass.implement({
returnsSharedPtr: function() {
- return cm.embind_test_return_smart_derived_ptr();
+ return cm.embind_test_return_smart_derived_ptr().deleteLater();
}
});
cm.callReturnsSharedPtrMethod(impl);
@@ -1644,7 +1644,7 @@ module({
});
if (typeof INVOKED_FROM_EMSCRIPTEN_TEST_RUNNER === "undefined") { // TODO: Enable this to work in Emscripten runner as well!
-
+
BaseFixture.extend("unbound types", function() {
function assertMessage(fn, message) {
var e = assert.throws(cm.UnboundTypeError, fn);
@@ -1689,7 +1689,7 @@ module({
},
'Cannot construct HasConstructorUsingUnboundArgumentAndUnboundBase due to unbound types: 18SecondUnboundClass');
});
-
+
test('class function with unbound argument', function() {
var x = new cm.BoundClass;
assertMessage(
@@ -1719,12 +1719,12 @@ module({
}, 'Cannot access BoundClass.property due to unbound types: 12UnboundClass');
x.delete();
});
-
+
// todo: tuple elements
// todo: tuple element accessors
// todo: struct fields
});
-
+
}
BaseFixture.extend("noncopyable", function() {
@@ -1743,6 +1743,10 @@ module({
BaseFixture.extend("constants", function() {
assert.equal(10, cm.INT_CONSTANT);
+
+ assert.equal(1, cm.STATIC_CONST_INTEGER_VALUE_1);
+ assert.equal(1000, cm.STATIC_CONST_INTEGER_VALUE_1000);
+
assert.equal("some string", cm.STRING_CONSTANT);
assert.deepEqual([1, 2, 3, 4], cm.VALUE_ARRAY_CONSTANT);
assert.deepEqual({x:1,y:2,z:3,w:4}, cm.VALUE_OBJECT_CONSTANT);
@@ -1888,6 +1892,52 @@ module({
sh.delete();
});
});
+
+ BaseFixture.extend("val::as from pointer to value", function() {
+ test("calling as on pointer with value makes a copy", function() {
+ var sh1 = new cm.StringHolder("Hello world");
+ var sh2 = cm.return_StringHolder_copy(sh1);
+ assert.equal("Hello world", sh1.get());
+ assert.equal("Hello world", sh2.get());
+ assert.false(sh1.isAliasOf(sh2));
+ sh2.delete();
+ sh1.delete();
+ });
+
+ test("calling function that returns a StringHolder", function() {
+ var sh1 = new cm.StringHolder("Hello world");
+ var sh2 = cm.call_StringHolder_func(function() {
+ return sh1;
+ });
+ assert.equal("Hello world", sh1.get());
+ assert.equal("Hello world", sh2.get());
+ assert.false(sh1.isAliasOf(sh2));
+ sh2.delete();
+ sh1.delete();
+ });
+ });
+
+ BaseFixture.extend("mixin", function() {
+ test("can call mixin method", function() {
+ var a = new cm.DerivedWithMixin();
+ assert.instanceof(a, cm.Base);
+ assert.equal(10, a.get10());
+ a.delete();
+ });
+ });
+
+ test("returning a cached new shared pointer from interfaces implemented in JS code does not leak", function() {
+ var derived = cm.embind_test_return_smart_derived_ptr();
+ var impl = cm.AbstractClass.implement({
+ returnsSharedPtr: function() {
+ return derived;
+ }
+ });
+ cm.callReturnsSharedPtrMethod(impl);
+ impl.delete();
+ derived.delete();
+ // Let the memory leak test superfixture check that no leaks occurred.
+ });
});
/* global run_all_tests */
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index d6b27bce..4efc4bd8 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -1283,6 +1283,7 @@ std::shared_ptr<HeldBySmartPtr> takesHeldBySmartPtrSharedPtr(std::shared_ptr<Hel
namespace emscripten {
template<typename T>
struct smart_ptr_trait<CustomSmartPtr<T>> {
+ typedef CustomSmartPtr<T> pointer_type;
typedef T element_type;
static sharing_policy get_sharing_policy() {
@@ -1297,6 +1298,10 @@ namespace emscripten {
++ptr->refcount; // implement an adopt API?
return CustomSmartPtr<T>(ptr);
}
+
+ static pointer_type* construct_null() {
+ return new pointer_type;
+ }
};
}
@@ -2210,8 +2215,20 @@ EMSCRIPTEN_BINDINGS(read_only_properties) {
;
}
+struct StaticConstIntStruct {
+ static const int STATIC_CONST_INTEGER_VALUE_1;
+ static const int STATIC_CONST_INTEGER_VALUE_1000;
+};
+
+const int StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1 = 1;
+const int StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1000 = 1000;
+
EMSCRIPTEN_BINDINGS(constants) {
constant("INT_CONSTANT", 10);
+
+ constant("STATIC_CONST_INTEGER_VALUE_1", StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1);
+ constant("STATIC_CONST_INTEGER_VALUE_1000", StaticConstIntStruct::STATIC_CONST_INTEGER_VALUE_1000);
+
constant("STRING_CONSTANT", std::string("some string"));
TupleVector tv(1, 2, 3, 4);
@@ -2243,3 +2260,47 @@ void clear_StringHolder(StringHolder& sh) {
EMSCRIPTEN_BINDINGS(references) {
function("clear_StringHolder", &clear_StringHolder);
}
+
+StringHolder return_StringHolder_copy(val func) {
+ return func.as<StringHolder>();
+}
+
+StringHolder call_StringHolder_func(val func) {
+ return func().as<StringHolder>();
+}
+
+EMSCRIPTEN_BINDINGS(return_values) {
+ function("return_StringHolder_copy", &return_StringHolder_copy);
+ function("call_StringHolder_func", &call_StringHolder_func);
+}
+
+
+struct Mixin {
+ int get10() const {
+ return 10;
+ }
+};
+
+template<typename ClassBinding>
+const ClassBinding& registerMixin(const ClassBinding& binding) {
+ // need a wrapper for implicit conversion from DerivedWithMixin to Mixin
+ struct Local {
+ static int get10(const typename ClassBinding::class_type& self) {
+ return self.get10();
+ }
+ };
+
+ return binding
+ .function("get10", &Local::get10)
+ ;
+}
+
+class DerivedWithMixin : public Base, public Mixin {
+};
+
+EMSCRIPTEN_BINDINGS(mixins) {
+ registerMixin(
+ class_<DerivedWithMixin, base<Base>>("DerivedWithMixin")
+ .constructor<>()
+ );
+}
diff --git a/tests/emscripten_api_browser.cpp b/tests/emscripten_api_browser.cpp
index 18046ca3..a03b71ed 100644
--- a/tests/emscripten_api_browser.cpp
+++ b/tests/emscripten_api_browser.cpp
@@ -31,6 +31,18 @@ void five(void *arg) {
emscripten_resume_main_loop();
}
+void argey(void* arg) {
+ static int counter = 0;
+ assert((int)arg == 17);
+ counter++;
+ printf("argey: %d\n", counter);
+ if (counter == 5) {
+ emscripten_cancel_main_loop();
+ int result = 1;
+ REPORT_RESULT();
+ }
+}
+
void mainey() {
static int counter = 0;
printf("mainey: %d\n", counter++);
@@ -45,8 +57,8 @@ void mainey() {
assert(pre1ed);
assert(pre2ed);
printf("Good!\n");
- int result = 1;
- REPORT_RESULT();
+ emscripten_cancel_main_loop();
+ emscripten_set_main_loop_arg(argey, (void*)17, 0, 0);
}
}
diff --git a/tests/emscripten_log/emscripten_log.cpp b/tests/emscripten_log/emscripten_log.cpp
index a5bb8432..5973e94c 100644
--- a/tests/emscripten_log/emscripten_log.cpp
+++ b/tests/emscripten_log/emscripten_log.cpp
@@ -83,14 +83,14 @@ void __attribute__((noinline)) bar(int = 0, char * = 0, double = 0) // Arbitrary
if ((flags & EM_LOG_C_STACK) != 0)
{
- MYASSERT(!!strstr(callstack, "at bar(int, char*, double) (src.cpp:"), "Callstack was %s!", callstack);
- MYASSERT(!!strstr(callstack, "at void Foo<int>() (src.cpp:"), "Callstack was %s!", callstack);
+ MYASSERT(!!strstr(callstack, ".cpp:"), "Callstack was %s!", callstack);
}
else
{
- MYASSERT(!!strstr(callstack, "at bar(int, char*, double) (src.cpp.o.js:"), "Callstack was %s!", callstack);
- MYASSERT(!!strstr(callstack, "at void Foo<int>() (src.cpp.o.js:"), "Callstack was %s!", callstack);
+ MYASSERT(!!strstr(callstack, ".js:"), "Callstack was %s!", callstack);
}
+ MYASSERT(!!strstr(callstack, "at bar(int, char*, double)"), "Callstack was %s!", callstack);
+ MYASSERT(!!strstr(callstack, "at void Foo<int>()"), "Callstack was %s!", callstack);
// 5. Clean up.
delete[] callstack;
@@ -99,6 +99,14 @@ void __attribute__((noinline)) bar(int = 0, char * = 0, double = 0) // Arbitrary
char str[1024];
emscripten_get_callstack(EM_LOG_NO_PATHS | EM_LOG_JS_STACK, str, 1024);
+ // Test that obtaining a truncated callstack works. (https://github.com/kripken/emscripten/issues/2171)
+ char *buffer = new char[21];
+ buffer[20] = 0x01; // Magic sentinel that should not change its value.
+ emscripten_get_callstack(EM_LOG_C_STACK | EM_LOG_DEMANGLE | EM_LOG_NO_PATHS | EM_LOG_FUNC_PARAMS, buffer, 20);
+ MYASSERT(!!strstr(buffer, "at bar(int,"), "Truncated callstack was %s!", buffer);
+ MYASSERT(buffer[20] == 0x01);
+ delete[] buffer;
+
/* With EM_LOG_JS_STACK, the callstack will be
at __Z3bariPcd (src.cpp.o.js:5394:12)
at __Z3FooIiEvv (src.cpp.o.js:5417:4)
diff --git a/tests/fs/test_mount.c b/tests/fs/test_mount.c
new file mode 100644
index 00000000..b1a337ad
--- /dev/null
+++ b/tests/fs/test_mount.c
@@ -0,0 +1,60 @@
+#include <assert.h>
+#include <stdio.h>
+#include <emscripten.h>
+
+int main() {
+ EM_ASM(
+ var ex;
+
+ // write a file that should be unaffected by this process
+ FS.writeFile('/safe.txt', 'abc');
+
+ // mount it the first time
+ FS.mkdir('/working');
+ FS.mount(MEMFS, {}, '/working');
+ FS.writeFile('/working/waka.txt', 'az');
+
+ // mount to a missing directory
+ try {
+ FS.mount(MEMFS, {}, '/missing');
+ } catch (e) {
+ ex = e;
+ }
+ assert(ex instanceof FS.ErrnoError && ex.errno === ERRNO_CODES.ENOENT);
+
+ // mount to an existing mountpoint
+ try {
+ FS.mount(MEMFS, {}, '/working');
+ } catch (e) {
+ ex = e;
+ }
+ assert(ex instanceof FS.ErrnoError && ex.errno === ERRNO_CODES.EBUSY);
+
+ // unmount
+ FS.unmount('/working');
+
+ // unmount something that's not mounted
+ try {
+ FS.unmount('/working');
+ } catch (e) {
+ ex = e;
+ }
+ assert(ex instanceof FS.ErrnoError && ex.errno === ERRNO_CODES.EINVAL);
+
+ // try to read the file from the old mount
+ try {
+ FS.readFile('/working/waka.txt', { encoding: 'utf8' });
+ } catch (e) {
+ ex = e;
+ }
+ assert(ex instanceof FS.ErrnoError && ex.errno === ERRNO_CODES.ENOENT);
+
+ // check the safe file
+ var contents = FS.readFile('/safe.txt', { encoding: 'utf8' });
+ assert(contents === 'abc');
+ );
+
+ puts("success");
+
+ return 0;
+}
diff --git a/tests/fuzz/11.c b/tests/fuzz/11.c
new file mode 100644
index 00000000..5d5644fe
--- /dev/null
+++ b/tests/fuzz/11.c
@@ -0,0 +1,1570 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-packed-struct --no-math64
+ * Seed: 3982457068
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+struct S0 {
+ const int16_t f0;
+ uint16_t f1;
+ const uint16_t f2;
+ uint16_t f3;
+ const uint8_t f4;
+};
+
+struct S1 {
+ int8_t f0;
+ int32_t f1;
+ uint16_t f2;
+ struct S0 f3;
+ signed : 0;
+ uint16_t f4;
+};
+
+union U2 {
+ int32_t f0;
+ int8_t * f1;
+ uint16_t f2;
+};
+
+/* --- GLOBAL VARIABLES --- */
+static int8_t g_9 = 0L;
+static int8_t *g_10 = &g_9;
+static union U2 g_23 = {5L};
+static uint32_t g_27 = 0x763523E2L;
+static int32_t g_29 = (-10L);
+static int32_t *g_28[8] = {&g_29,&g_29,&g_29,&g_29,&g_29,&g_29,&g_29,&g_29};
+static int32_t g_33 = (-7L);
+static int32_t g_82 = 0x6BCC6B82L;
+static int16_t g_92 = 0x986BL;
+static uint8_t g_94 = 0x71L;
+static uint8_t g_96 = 9UL;
+static const int32_t g_130[8][6] = {{0xBB608825L,0x2773D60BL,(-4L),(-1L),0x16DB7C97L,(-4L)},{0xB3C507C2L,0L,0x16DB7C97L,0x013F98BFL,0x16DB7C97L,0L},{(-1L),0x2773D60BL,1L,0x013F98BFL,0x2773D60BL,0x16DB7C97L},{0xB3C507C2L,0x16DB7C97L,1L,(-1L),0L,0L},{0xBB608825L,0x16DB7C97L,0x16DB7C97L,0xBB608825L,0x2773D60BL,(-4L)},{0xBB608825L,0x2773D60BL,(-4L),(-1L),0x16DB7C97L,(-4L)},{0xB3C507C2L,0L,8L,0x2773D60BL,8L,0x73286A6EL},{(-4L),1L,8L,0x2773D60BL,1L,8L}};
+static const int32_t g_132 = 0xBF8BA2E1L;
+static const int32_t *g_131 = &g_132;
+static const int32_t *g_133[1] = {&g_82};
+static int32_t g_140 = 1L;
+static uint8_t g_141[6][7] = {{0x59L,0x4EL,0x2EL,0xA7L,0xDAL,247UL,0x90L},{246UL,1UL,0x97L,0x54L,247UL,0x54L,0x97L},{247UL,247UL,0xF6L,0xC5L,247UL,0x54L,0x38L},{0x0EL,0xF6L,0x38L,255UL,246UL,247UL,0x4EL},{0x54L,0x6EL,247UL,0x38L,247UL,0x6EL,0x54L},{0xDAL,0x54L,0x59L,0x38L,247UL,0x4EL,255UL}};
+static uint16_t *g_146 = &g_23.f2;
+static struct S0 g_193 = {0L,0UL,65535UL,0x6792L,0xD8L};
+static struct S1 g_203 = {8L,-1L,65531UL,{-8L,0xE92DL,0x7043L,0x3039L,253UL},0xF5C3L};
+static struct S1 *g_202[5][10] = {{&g_203,(void*)0,&g_203,&g_203,&g_203,(void*)0,&g_203,&g_203,(void*)0,(void*)0},{&g_203,(void*)0,(void*)0,&g_203,&g_203,(void*)0,(void*)0,&g_203,(void*)0,&g_203},{(void*)0,(void*)0,&g_203,(void*)0,&g_203,(void*)0,&g_203,(void*)0,(void*)0,&g_203},{&g_203,(void*)0,&g_203,&g_203,(void*)0,(void*)0,&g_203,&g_203,(void*)0,&g_203},{(void*)0,(void*)0,(void*)0,&g_203,(void*)0,&g_203,(void*)0,&g_203,(void*)0,(void*)0}};
+static uint32_t g_275[6][3] = {{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL},{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL},{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL}};
+static int32_t *g_364 = &g_23.f0;
+static int32_t **g_363 = &g_364;
+static int32_t ***g_362[4][6] = {{(void*)0,&g_363,&g_363,&g_363,(void*)0,&g_363},{&g_363,(void*)0,&g_363,&g_363,(void*)0,&g_363},{(void*)0,&g_363,&g_363,(void*)0,&g_363,&g_363},{&g_363,(void*)0,&g_363,&g_363,&g_363,&g_363}};
+static int16_t g_367 = 0x405BL;
+static int8_t g_368[9][8][3] = {{{0x36L,(-4L),0x84L},{3L,(-1L),0L},{0xADL,0x36L,0x84L},{(-1L),0x20L,3L},{8L,(-1L),8L},{1L,0x30L,(-6L)},{0L,0xE3L,0x5BL},{0x30L,0L,0xF6L}},{{(-1L),0x5BL,0xF7L},{0x30L,(-8L),1L},{0L,1L,1L},{1L,0xF6L,(-1L)},{8L,(-1L),0x6DL},{(-1L),0xE6L,0x8CL},{0xADL,(-9L),0x47L},{3L,1L,(-1L)}},{{(-1L),1L,8L},{0x8BL,0x8BL,1L},{0xADL,0x47L,0L},{0xC2L,1L,0x30L},{0L,(-8L),(-1L)},{0xFBL,0xC2L,0x30L},{0xF7L,(-9L),0L},{1L,(-1L),1L}},{{(-4L),0x5BL,8L},{0xE6L,0x0AL,(-1L)},{0x5BL,(-1L),0xADL},{(-1L),(-1L),3L},{0x5BL,0x6DL,0x36L},{0xE6L,0xF6L,0xF6L},{(-4L),0xADL,0x47L},{1L,(-1L),0L}},{{0xF7L,0xBDL,(-2L)},{0xFBL,0xCAL,0x8BL},{0L,0xBDL,(-8L)},{0xC2L,(-1L),0xE6L},{0xADL,0xADL,0xBDL},{0x8BL,0xF6L,(-6L)},{(-1L),0x6DL,(-1L)},{(-6L),(-1L),0xC2L}},{{0L,(-1L),(-1L)},{0x8CL,0x0AL,(-6L)},{0xBDL,0x5BL,0xBDL},{(-8L),(-1L),0xE6L},{8L,(-9L),(-8L)},{(-1L),0xC2L,0x8BL},{1L,(-8L),(-2L)},{(-1L),1L,0L}},{{8L,0x47L,0x47L},{(-8L),0x8BL,0xF6L},{0xBDL,1L,0x36L},{0x8CL,1L,3L},{0L,0x84L,0xADL},{(-6L),1L,(-1L)},{(-1L),1L,8L},{0x8BL,0x8BL,1L}},{{0xADL,0x47L,0L},{0xC2L,1L,0x30L},{0L,(-8L),(-1L)},{0xFBL,0xC2L,0x30L},{0xF7L,(-9L),0L},{1L,(-1L),1L},{(-4L),0x5BL,8L},{0xE6L,0x0AL,(-1L)}},{{0x5BL,(-1L),0xADL},{(-1L),(-1L),3L},{0x5BL,0x6DL,0x36L},{0xE6L,0xF6L,0xF6L},{(-4L),0xADL,0x47L},{1L,(-1L),0L},{0xF7L,0xBDL,(-2L)},{0xFBL,0xCAL,0x8BL}}};
+static struct S1 g_429[4][6][6] = {{{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}}},{{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}}},{{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}}},{{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}}}};
+static int8_t g_448 = (-3L);
+static uint32_t g_491 = 9UL;
+static uint16_t *g_522 = &g_203.f3.f1;
+static struct S0 g_663 = {0xB058L,0xD411L,0UL,0x1BCDL,4UL};
+static int32_t *g_688 = &g_82;
+static uint32_t g_709[9][3] = {{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL}};
+static uint8_t * const g_713 = &g_94;
+static uint8_t * const * const g_712 = &g_713;
+static uint32_t **g_737 = (void*)0;
+static struct S0 *g_803 = (void*)0;
+static struct S0 **g_802 = &g_803;
+static int8_t g_870 = 0xBAL;
+static int32_t g_902 = 0L;
+static uint32_t g_1001 = 0xCE9223C1L;
+static const union U2 g_1007 = {-1L};
+static const union U2 *g_1006 = &g_1007;
+static int8_t *g_1010 = &g_429[3][2][4].f0;
+static union U2 *g_1059 = (void*)0;
+static union U2 **g_1058 = &g_1059;
+static uint8_t *g_1153 = &g_96;
+static const int8_t ***g_1346 = (void*)0;
+static uint32_t g_1359 = 6UL;
+static uint32_t g_1361 = 0UL;
+static uint8_t **g_1455 = &g_1153;
+static int8_t g_1473[9] = {0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L};
+static uint32_t g_1474 = 0x2827E164L;
+static uint32_t g_1492 = 0x98C6FA4DL;
+static uint32_t *g_1707 = (void*)0;
+static uint32_t * const *g_1706 = &g_1707;
+static const int32_t g_1725 = 0xA265A2AFL;
+static uint32_t ****g_1766 = (void*)0;
+static int16_t g_1798 = 0xD17FL;
+static struct S1 ** const g_1899 = (void*)0;
+static const uint32_t *g_1931[2] = {(void*)0,(void*)0};
+static const uint32_t **g_1930 = &g_1931[0];
+static const int32_t *g_1949 = &g_132;
+static int32_t ****g_2039 = &g_362[0][3];
+static uint32_t g_2122 = 18446744073709551612UL;
+static int16_t *g_2213[9][3][4] = {{{&g_92,&g_1798,&g_92,(void*)0},{(void*)0,&g_367,(void*)0,&g_92},{&g_92,&g_367,&g_1798,&g_1798}},{{&g_1798,&g_1798,&g_367,&g_367},{(void*)0,&g_92,&g_367,&g_92},{&g_1798,(void*)0,&g_1798,(void*)0}},{{&g_92,&g_1798,(void*)0,(void*)0},{(void*)0,&g_1798,&g_367,(void*)0},{&g_92,&g_1798,&g_1798,&g_367}},{{&g_1798,&g_1798,&g_1798,(void*)0},{&g_92,&g_367,&g_1798,&g_1798},{&g_1798,&g_1798,&g_92,&g_92}},{{(void*)0,(void*)0,(void*)0,&g_1798},{&g_92,&g_92,&g_1798,(void*)0},{&g_1798,&g_367,&g_1798,&g_1798}},{{&g_367,&g_367,&g_1798,(void*)0},{&g_367,&g_92,(void*)0,&g_1798},{&g_92,(void*)0,(void*)0,&g_92}},{{&g_367,&g_1798,&g_1798,&g_1798},{(void*)0,&g_367,&g_1798,(void*)0},{&g_1798,&g_1798,&g_92,&g_367}},{{(void*)0,&g_1798,(void*)0,(void*)0},{&g_1798,&g_1798,(void*)0,&g_1798},{&g_92,(void*)0,&g_92,&g_1798}},{{(void*)0,&g_1798,&g_92,(void*)0},{&g_1798,&g_92,&g_367,(void*)0},{&g_1798,&g_367,&g_92,&g_92}}};
+static int16_t * const *g_2212 = &g_2213[8][2][2];
+static int16_t g_2341 = 0x2E6AL;
+static union U2 ***g_2562 = &g_1058;
+static union U2 ****g_2561 = &g_2562;
+static uint32_t g_2575 = 0xBF53EBB2L;
+static struct S0 g_2686 = {1L,0UL,1UL,65529UL,0UL};
+static struct S0 *g_2718[3][2] = {{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0}};
+static uint8_t ***g_2741 = &g_1455;
+static const int32_t *g_2749 = &g_1007.f0;
+static const int32_t **g_2748 = &g_2749;
+static const int32_t ***g_2747 = &g_2748;
+static uint32_t g_2898 = 18446744073709551615UL;
+
+
+/* --- FORWARD DECLARATIONS --- */
+static uint16_t func_1(void);
+static int32_t * func_2(int8_t * p_3);
+static int8_t * func_4(uint32_t p_5, int8_t * p_6, int8_t * p_7);
+static int8_t * func_11(uint8_t p_12, int32_t * p_13, struct S0 p_14, int32_t * p_15);
+static int32_t * func_16(struct S1 p_17, uint32_t p_18, int8_t * p_19, union U2 p_20);
+static int32_t func_34(int8_t * p_35, int8_t * p_36, uint16_t p_37);
+static int8_t * func_38(int32_t * p_39);
+static union U2 func_40(int32_t * p_41, int8_t * p_42, struct S0 p_43, int32_t p_44);
+static int32_t * func_45(int8_t * const p_46, int32_t * p_47, int8_t * p_48);
+static int32_t * func_50(uint32_t p_51, int8_t p_52, int8_t p_53, int8_t * p_54, const int32_t p_55);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_10 g_23 g_27 g_28 g_29 g_33 g_688 g_82 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_23.f2 g_9 g_448 g_23.f0 g_193 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803 g_491 g_1725 g_712 g_203.f3.f3 g_902 g_1359 g_1058 g_2341 g_1153 g_1059 g_663.f1 g_1455 g_1492 g_2561 g_1949 g_203.f4 g_2575 g_1010 g_429.f0 g_131 g_2562 g_870 g_92 g_2741 g_2898 g_709
+ * writes: g_27 g_28 g_29 g_33 g_82 g_23 g_94 g_1010 g_202 g_203.f1 g_92 g_275 g_448 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803 g_491 g_367 g_2212 g_203.f3.f1 g_2039 g_203.f3.f3 g_902 g_2213 g_1359 g_1059 g_688 g_1492 g_131 g_203.f4 g_2575 g_737 g_2562 g_10 g_870 g_2898 g_429.f0
+ */
+static uint16_t func_1(void)
+{ /* block id: 0 */
+ int8_t *l_8[3];
+ struct S1 l_21 = {0xF7L,-1L,0x9D9EL,{1L,0x422DL,0xFBA2L,0UL,0xBFL},0xC2F5L};
+ int32_t l_22 = 0xB6930509L;
+ int32_t *l_30 = &l_22;
+ int32_t *l_31 = &g_29;
+ int8_t **l_2633[1][9][5] = {{{(void*)0,(void*)0,&g_10,&g_10,&g_10},{&l_8[0],&l_8[0],&l_8[0],&l_8[2],&g_1010},{&g_10,(void*)0,(void*)0,&l_8[2],&l_8[1]},{&l_8[0],&l_8[0],&l_8[0],&l_8[0],&l_8[0]},{&l_8[0],&l_8[0],(void*)0,&l_8[1],(void*)0},{&l_8[0],&g_10,&l_8[0],&g_10,&l_8[0]},{&l_8[0],&l_8[2],&g_10,&l_8[1],&l_8[1]},{(void*)0,&g_10,&l_8[0],&l_8[0],&g_10},{&g_10,(void*)0,&l_8[0],&l_8[2],&l_8[1]}}};
+ int8_t *l_2634 = &g_203.f0;
+ int32_t **l_2857 = &l_30;
+ int16_t l_2858[2][2];
+ int32_t l_2861 = 0x6E8C1F75L;
+ int32_t l_2862 = (-1L);
+ int32_t l_2863 = 0x3B8928E0L;
+ int32_t l_2864 = 0L;
+ int8_t l_2865[8][9] = {{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L}};
+ int32_t l_2866[7][5] = {{1L,3L,(-8L),(-1L),3L},{0L,3L,(-7L),(-7L),3L},{1L,0L,(-7L),(-1L),0L},{1L,3L,(-8L),(-1L),3L},{0L,3L,(-7L),(-7L),3L},{1L,0L,(-7L),(-1L),0L},{1L,3L,(-8L),(-1L),3L}};
+ uint32_t l_2868 = 6UL;
+ uint32_t **l_2888[1][6][4] = {{{(void*)0,&g_1707,(void*)0,&g_1707},{&g_1707,(void*)0,&g_1707,&g_1707},{(void*)0,(void*)0,&g_1707,&g_1707},{&g_1707,&g_1707,(void*)0,(void*)0},{(void*)0,(void*)0,&g_1707,(void*)0},{&g_1707,(void*)0,(void*)0,(void*)0}}};
+ int32_t l_2889 = (-8L);
+ int16_t l_2890 = 0x4B0FL;
+ uint32_t l_2893 = 0x1C1D9EF6L;
+ struct S0 **l_2894[8][7][1] = {{{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803}},{{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803}},{{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803}},{{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]}}};
+ const int32_t **l_2916 = &g_131;
+ int32_t l_2917 = 0x0EA97E1BL;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ l_8[i] = &g_9;
+ for (i = 0; i < 2; i++)
+ {
+ for (j = 0; j < 2; j++)
+ l_2858[i][j] = 0xD331L;
+ }
+ (*l_2857) = func_2((l_2634 = (g_10 = func_4(((l_8[0] == &g_9) & 0L), g_10, func_11((((g_28[4] = func_16(l_21, l_22, l_8[0], g_23)) != l_30) , 246UL), &g_29, l_21.f3, l_31)))));
+ for (g_92 = 0; (g_92 <= 2); g_92 += 1)
+ { /* block id: 1369 */
+ int32_t *l_2859 = &g_33;
+ int32_t *l_2860[7];
+ int8_t l_2867 = 1L;
+ int32_t l_2891 = 0x72B71305L;
+ const int32_t l_2892 = 0x51C3213CL;
+ struct S0 ***l_2895 = &l_2894[7][4][0];
+ struct S0 l_2907 = {9L,0xF377L,0x63B9L,0x3BAFL,0UL};
+ uint32_t l_2910[1][4];
+ uint16_t l_2914[10] = {3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL};
+ int i, j;
+ for (i = 0; i < 7; i++)
+ l_2860[i] = &g_33;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 4; j++)
+ l_2910[i][j] = 0x60BEB07CL;
+ }
+ --l_2868;
+ if ((**l_2857))
+ break;
+ l_2864 &= (safe_lshift_func_int16_t_s_s((safe_div_func_uint16_t_u_u(((l_2890 |= ((((***g_2741) ^ (((safe_rshift_func_uint8_t_u_s(((((safe_lshift_func_int8_t_s_s(0xB5L, ((safe_lshift_func_uint8_t_u_s((safe_unary_minus_func_uint8_t_u(0UL)), (safe_add_func_uint16_t_u_u((0x77B217B0L >= (*l_30)), (safe_lshift_func_uint8_t_u_s(7UL, 0)))))) > (!(*l_31))))) != (((safe_rshift_func_uint8_t_u_u(((((*l_2859) & (((*l_2859) > 0x42ED6365L) == 1L)) , &g_1707) != l_2888[0][3][2]), (*g_1153))) > (-1L)) == 0x52L)) < (*g_1153)) < (*l_2859)), 0)) == 0L) | l_2889)) , (void*)0) == l_31)) , l_2891), l_2892)), l_2893));
+ (*l_2895) = l_2894[7][4][0];
+ for (g_1359 = 0; (g_1359 <= 2); g_1359 += 1)
+ { /* block id: 1377 */
+ int32_t l_2896 = 0x735C2B59L;
+ int32_t l_2897[2][1][5] = {{{0x220C6B73L,0x220C6B73L,0x220C6B73L,0x220C6B73L,0x220C6B73L}},{{7L,7L,7L,7L,7L}}};
+ int16_t *l_2911 = &g_367;
+ int32_t l_2915 = 0xA181D5A4L;
+ int i, j, k;
+ g_2898--;
+ (*l_2859) ^= (safe_add_func_uint16_t_u_u(((g_709[(g_1359 + 4)][g_1359] < g_203.f4) >= ((safe_add_func_uint32_t_u_u(((*g_146) == (&g_1707 == (l_2907 , l_2888[0][3][2]))), (((*g_1010) = ((safe_sub_func_int16_t_s_s(((*l_2911) ^= (l_2910[0][2] != g_709[(g_1359 + 4)][g_1359])), (l_2914[5] = (safe_mod_func_int32_t_s_s(((l_2897[0][0][3] | l_2897[1][0][1]) , (*g_1949)), (-1L)))))) < 7L)) ^ l_2915))) >= 4294967293UL)), 0x562AL));
+ }
+ }
+ (*l_2916) = &g_130[3][5];
+ return l_2917;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_203.f4 g_368 g_2561 g_2562 g_1058 g_902 g_522 g_203.f3.f1 g_96 g_29 g_870 g_193.f3
+ * writes: g_203.f4 g_902 g_96 g_29 g_870 g_193.f3
+ */
+static int32_t * func_2(int8_t * p_3)
+{ /* block id: 1266 */
+ uint16_t l_2646 = 0UL;
+ union U2 * const *l_2680[10];
+ union U2 * const **l_2679 = &l_2680[2];
+ int32_t l_2717 = 0x771D7A8EL;
+ uint32_t ***** const l_2724 = &g_1766;
+ int32_t l_2787[8][5][6] = {{{(-10L),0xF9A7B154L,(-5L),0x9BBB8C36L,(-1L),0x08AF0ED7L},{(-6L),0x86CA5DE9L,1L,3L,3L,1L},{0x86CA5DE9L,0x86CA5DE9L,0x491AC390L,(-6L),(-1L),(-1L)},{1L,0xF9A7B154L,1L,0x3E0CF12FL,(-5L),0x491AC390L},{0x9BBB8C36L,1L,1L,7L,0x86CA5DE9L,(-1L)}},{{2L,7L,0x491AC390L,3L,(-10L),1L},{3L,(-10L),1L,3L,0x3E0CF12FL,0x08AF0ED7L},{2L,3L,(-5L),0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)},{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL}},{{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)},{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),(-1L),0x3E0CF12FL,0x30B718DFL,(-5L),0xF9A7B154L},{0L,0x8A63E951L,3L,0xD802313DL,0xD802313DL,3L}},{{0x8A63E951L,0x8A63E951L,1L,0L,(-5L),(-10L)},{0x743F44F9L,(-1L),3L,0xF241A0ADL,0x0F0E2B35L,1L},{0x30B718DFL,0x743F44F9L,3L,0x91A2E884L,0x8A63E951L,(-10L)},{0x1D6DE8D3L,0x91A2E884L,1L,0L,(-7L),3L},{0L,(-7L),3L,0L,0xF241A0ADL,0xF9A7B154L}},{{0x1D6DE8D3L,0xD802313DL,0x3E0CF12FL,0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)},{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL},{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)}},{{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),(-1L),0x3E0CF12FL,0x30B718DFL,(-5L),0xF9A7B154L},{0L,0x8A63E951L,3L,0xD802313DL,0xD802313DL,3L},{0x8A63E951L,0x8A63E951L,1L,0L,(-5L),(-10L)},{0x743F44F9L,(-1L),3L,0xF241A0ADL,0x0F0E2B35L,1L}},{{0x30B718DFL,0x743F44F9L,3L,0x91A2E884L,0x8A63E951L,(-10L)},{0x1D6DE8D3L,0x91A2E884L,1L,0L,(-7L),3L},{0L,(-7L),3L,0L,0xF241A0ADL,0xF9A7B154L},{0x1D6DE8D3L,0xD802313DL,0x3E0CF12FL,0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)}},{{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL},{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)},{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),0x05AD1AD2L,0xF241A0ADL,1L,(-4L),(-1L)}}};
+ int16_t l_2789 = 0x673BL;
+ int32_t l_2841 = 0x2CD58772L;
+ int8_t l_2852 = 0L;
+ int i, j, k;
+ for (i = 0; i < 10; i++)
+ l_2680[i] = &g_1059;
+ for (g_203.f4 = 0; (g_203.f4 != 20); g_203.f4++)
+ { /* block id: 1269 */
+ int32_t l_2643 = 1L;
+ int32_t * const l_2644 = &g_902;
+ union U2 l_2645 = {0x1AA6AB60L};
+ (*l_2644) = (g_368[5][5][0] ^ (safe_lshift_func_uint16_t_u_u(((safe_lshift_func_uint16_t_u_s((safe_mod_func_uint8_t_u_u(((l_2643 , l_2644) != &g_130[0][5]), 0x95L)), 9)) ^ (+(((l_2645 , (**g_2561)) != (*g_2562)) != (*l_2644)))), (*g_522))));
+ }
+ l_2646 &= 0xAF285910L;
+ for (g_96 = (-5); (g_96 > 36); g_96 = safe_add_func_int32_t_s_s(g_96, 3))
+ { /* block id: 1275 */
+ int32_t *l_2649 = &g_29;
+ uint32_t *l_2658 = &g_1474;
+ struct S0 l_2659 = {0x69D3L,0x6483L,65534UL,65535UL,0xDBL};
+ union U2 l_2660[6][6] = {{{0x33AAE0C5L},{1L},{-1L},{-1L},{1L},{0x33AAE0C5L}},{{1L},{0x33AAE0C5L},{0x8D8CFE7FL},{1L},{0x8D8CFE7FL},{0x33AAE0C5L}},{{0x8D8CFE7FL},{1L},{-1L},{0xFE9A6640L},{0xFE9A6640L},{-1L}},{{0x8D8CFE7FL},{0x8D8CFE7FL},{0xFE9A6640L},{1L},{0x044F48E9L},{1L}},{{1L},{0x8D8CFE7FL},{1L},{-1L},{0xFE9A6640L},{0xFE9A6640L}},{{0x33AAE0C5L},{1L},{1L},{0x33AAE0C5L},{0x8D8CFE7FL},{1L}}};
+ struct S0 *l_2685 = &g_2686;
+ uint8_t ** const *l_2765 = (void*)0;
+ uint8_t l_2822 = 0x03L;
+ int32_t l_2847 = 0x610288B5L;
+ int32_t l_2848 = 0x0907996FL;
+ int8_t l_2849 = 6L;
+ int32_t l_2850 = 0xE1502438L;
+ uint8_t l_2856 = 0x00L;
+ int i, j;
+ (*l_2649) ^= (l_2660[4][5] , (-2L));
+ for (g_870 = 0; (g_870 >= 1); g_870 = safe_add_func_int8_t_s_s(g_870, 3))
+ { /* block id: 1280 */
+ union U2 ***l_2681[4];
+ uint16_t l_2684 = 65534UL;
+ int32_t l_2733 = 0x838200D5L;
+ uint8_t l_2812 = 0xADL;
+ int32_t *l_2842 = &l_2733;
+ int32_t *l_2843 = &g_902;
+ int32_t *l_2844 = &l_2733;
+ int32_t *l_2845 = &l_2787[4][1][3];
+ int32_t *l_2846[9];
+ int16_t l_2851 = 0x13C2L;
+ uint32_t l_2853[1];
+ int i;
+ for (i = 0; i < 4; i++)
+ l_2681[i] = &g_1058;
+ for (i = 0; i < 9; i++)
+ l_2846[i] = &l_2717;
+ for (i = 0; i < 1; i++)
+ l_2853[i] = 0xA045A241L;
+ for (g_193.f3 = 0; (g_193.f3 <= 0); g_193.f3 += 1)
+ { /* block id: 1283 */
+ struct S0 *l_2664[7][10] = {{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0}};
+ union U2 l_2687 = {6L};
+ const union U2 **l_2699 = &g_1006;
+ int32_t l_2704 = (-1L);
+ uint32_t *** const **l_2725 = (void*)0;
+ int8_t *l_2755 = (void*)0;
+ uint8_t *l_2788 = &g_141[2][3];
+ int16_t l_2790 = 0L;
+ int32_t l_2820 = (-8L);
+ int i, j;
+ }
+ ++l_2853[0];
+ }
+ if (l_2852)
+ break;
+ l_2856 ^= l_2787[1][4][0];
+ }
+ l_2717 ^= l_2787[1][4][0];
+ return &g_902;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static int8_t * func_4(uint32_t p_5, int8_t * p_6, int8_t * p_7)
+{ /* block id: 1262 */
+ return &g_448;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_29 g_33 g_688 g_82 g_23 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_23.f2 g_10 g_9 g_448 g_23.f0 g_193 g_27 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803 g_491 g_1725 g_712 g_203.f3.f3 g_902 g_1359 g_1058 g_2341 g_1153 g_1059 g_28 g_663.f1 g_1455 g_1492 g_2561 g_1949 g_203.f4 g_2575 g_1010 g_429.f0 g_131
+ * writes: g_29 g_33 g_82 g_23 g_94 g_1010 g_202 g_203.f1 g_92 g_275 g_448 g_28 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803 g_491 g_367 g_2212 g_203.f3.f1 g_2039 g_203.f3.f3 g_902 g_2213 g_1359 g_1059 g_27 g_688 g_1492 g_131 g_203.f4 g_2575 g_737 g_2562
+ */
+static int8_t * func_11(uint8_t p_12, int32_t * p_13, struct S0 p_14, int32_t * p_15)
+{ /* block id: 9 */
+ int32_t *l_32 = &g_33;
+ int8_t * const l_49 = (void*)0;
+ struct S1 l_62 = {0xA5L,0xA880E1B4L,2UL,{0xC5A9L,0x5881L,1UL,1UL,0xD0L},0xD52FL};
+ struct S1 l_73 = {0xF3L,-1L,0UL,{0L,65535UL,4UL,65534UL,0x08L},0x1B1EL};
+ int8_t *l_74 = &g_9;
+ union U2 l_980 = {1L};
+ int8_t **l_1316 = &l_74;
+ const int32_t * const l_2258[1][3] = {{&l_62.f1,&l_62.f1,&l_62.f1}};
+ const int32_t * const *l_2257[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+ int16_t *l_2262 = &g_92;
+ int32_t l_2301 = 8L;
+ int32_t l_2303 = (-3L);
+ int32_t l_2306 = 0xEA8C3DEFL;
+ int32_t l_2307 = 0xEA47795FL;
+ int32_t l_2310 = 0x333383BBL;
+ int32_t l_2311 = 1L;
+ uint32_t l_2312 = 0x999F81ACL;
+ int32_t l_2386[5][8][6] = {{{0xEE22978CL,(-3L),0x7AF8184EL,0x0F0D664EL,1L,0x0C8FFBCAL},{(-1L),(-1L),0L,0x0F0D664EL,0x9FE7ED45L,0L},{0xEE22978CL,(-1L),2L,0L,0L,0x09D63F88L},{(-1L),(-1L),0xF204F565L,5L,0x3873AA4BL,0x2D1F59DCL},{0xA34C36F6L,0x724D8378L,(-1L),(-1L),0x8F1CC965L,0x8F1CC965L},{0x47C53492L,0x306D3644L,0x306D3644L,0x47C53492L,(-1L),0x0F0D664EL},{0x724D8378L,1L,0x62D68D50L,0L,0xAD839B02L,0xF204F565L},{0x9FE7ED45L,0x47C53492L,1L,0xEE22978CL,0xAD839B02L,0xA512C38CL}},{{0x8F1CC965L,1L,0x3873AA4BL,(-1L),(-1L),0x8B705FA7L},{1L,0x306D3644L,0xA34C36F6L,0xDDD7E864L,0x8F1CC965L,0L},{0xA512C38CL,0x724D8378L,5L,0x8F1CC965L,0x3873AA4BL,0x306D3644L},{0L,(-1L),0x8B705FA7L,(-1L),0L,0x18B14613L},{1L,1L,0xEE22978CL,0xF79A781AL,0xAD839B02L,1L},{2L,0x0C8FFBCAL,(-1L),1L,0x3873AA4BL,1L},{(-3L),0L,0xEE22978CL,(-1L),(-1L),0x18B14613L},{0x3873AA4BL,0x09D63F88L,(-1L),(-3L),1L,1L}},{{(-1L),0x2D1F59DCL,0xA34C36F6L,1L,1L,0x0F0D664EL},{(-1L),0x8F1CC965L,0x47C53492L,0x47C53492L,0x8F1CC965L,(-1L)},{(-1L),0x0F0D664EL,0x724D8378L,0x09D63F88L,0x8B705FA7L,0x7AF8184EL},{0L,0xF204F565L,0x9FE7ED45L,0x8F1CC965L,1L,0L},{0L,0xA512C38CL,0x8F1CC965L,0x09D63F88L,(-1L),2L},{(-1L),0x8B705FA7L,1L,0x47C53492L,0xEE22978CL,0xF204F565L},{(-1L),0L,0xA512C38CL,1L,0xDDD7E864L,(-1L)},{(-1L),0x306D3644L,0L,(-3L),0L,0x306D3644L}},{{0x3873AA4BL,0x47C53492L,(-1L),(-1L),0x18B14613L,0x62D68D50L},{(-3L),0x7AF8184EL,0x0F0D664EL,1L,0x0C8FFBCAL,1L},{2L,0x7AF8184EL,1L,0xF79A781AL,0x18B14613L,0x3873AA4BL},{1L,0x47C53492L,1L,5L,0L,0xA34C36F6L},{0x0F0D664EL,0x306D3644L,2L,0xF204F565L,0xDDD7E864L,5L},{0x7AF8184EL,0L,0x8B705FA7L,0xEE22978CL,0xEE22978CL,0x8B705FA7L},{0x8B705FA7L,0x8B705FA7L,0x2D1F59DCL,0x0C8FFBCAL,(-1L),0xDDD7E864L},{0xF204F565L,0xA512C38CL,(-3L),(-1L),1L,0x2D1F59DCL}},{{0xAD839B02L,0xF204F565L,(-3L),0x0F0D664EL,0x8B705FA7L,0xDDD7E864L},{(-1L),0x0F0D664EL,0x2D1F59DCL,0x18B14613L,0x8F1CC965L,0x8B705FA7L},{0x18B14613L,0x8F1CC965L,0x8B705FA7L,(-1L),1L,5L},{0x47C53492L,0x2D1F59DCL,2L,0xA34C36F6L,1L,0xA34C36F6L},{1L,0x09D63F88L,1L,0x62D68D50L,(-1L),0x3873AA4BL},{(-1L),0L,1L,2L,0x3873AA4BL,1L},{0xA512C38CL,0x0C8FFBCAL,0x0F0D664EL,2L,0xAD839B02L,0x62D68D50L},{(-1L),1L,(-1L),0x62D68D50L,0x0F0D664EL,0x306D3644L}}};
+ int32_t l_2465 = (-2L);
+ int32_t l_2488 = 1L;
+ uint32_t **l_2543 = &g_1707;
+ int8_t l_2545 = 0L;
+ uint32_t *****l_2548[2][6][5] = {{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}};
+ const int32_t ***l_2557 = (void*)0;
+ union U2 **** const l_2563 = &g_2562;
+ uint8_t ** const l_2629 = (void*)0;
+ int i, j, k;
+ (*l_32) = ((*p_13) = (*p_13));
+ (*p_13) = func_34(((*l_1316) = func_38(&g_33)), &g_368[0][7][2], p_14.f2);
+lbl_2351:
+ (*g_688) = (*p_15);
+ for (g_902 = 3; (g_902 >= 0); g_902 -= 1)
+ { /* block id: 1101 */
+ struct S1 **l_2255 = (void*)0;
+ struct S1 **l_2256[4];
+ int32_t l_2259[9] = {0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL};
+ int16_t **l_2263 = &g_2213[8][2][2];
+ uint16_t l_2289 = 65529UL;
+ union U2 *l_2315 = &l_980;
+ uint32_t l_2330[9][8][1] = {{{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL},{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL}},{{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL},{1UL},{0x610F5ECBL},{1UL},{1UL}},{{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL},{2UL},{1UL}},{{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL},{1UL},{0x610F5ECBL}},{{1UL},{1UL},{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL}},{{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL}},{{1UL},{0x610F5ECBL},{1UL},{1UL},{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL}},{{0xE9A408D8L},{1UL},{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL}},{{2UL},{1UL},{1UL},{0x610F5ECBL},{1UL},{1UL},{2UL},{0xEE99DD9DL}}};
+ uint16_t **l_2378 = (void*)0;
+ uint32_t l_2423 = 4294967293UL;
+ int32_t l_2489 = 0x7F7BAA7EL;
+ int16_t l_2494 = (-2L);
+ uint32_t l_2522 = 0x57A978C3L;
+ int8_t *l_2524 = (void*)0;
+ int32_t *l_2527[9][10] = {{&l_62.f1,&g_203.f1,&g_429[3][2][4].f1,&g_429[3][2][4].f1,&g_203.f1,&l_62.f1,&g_203.f1,&g_140,(void*)0,&g_203.f1},{(void*)0,&g_203.f1,&l_73.f1,&l_980.f0,&g_140,&l_980.f0,&l_73.f1,&g_203.f1,(void*)0,&l_62.f1},{(void*)0,&g_429[3][2][4].f1,&l_2489,&g_203.f1,&l_980.f0,&l_62.f1,&l_62.f1,&l_980.f0,&g_203.f1,&l_2489},{&l_62.f1,&l_62.f1,&l_980.f0,&g_203.f1,&l_2489,&g_429[3][2][4].f1,(void*)0,&g_140,(void*)0,&g_429[3][2][4].f1},{&l_73.f1,&l_980.f0,&g_140,&l_980.f0,&l_73.f1,&g_203.f1,(void*)0,&l_62.f1,(void*)0,(void*)0},{&g_203.f1,&l_62.f1,&g_203.f1,&g_429[3][2][4].f1,&g_429[3][2][4].f1,&g_203.f1,&l_62.f1,&g_203.f1,&g_140,(void*)0},{&g_140,&g_429[3][2][4].f1,&l_62.f1,(void*)0,&l_73.f1,(void*)0,&l_73.f1,(void*)0,&l_62.f1,&g_429[3][2][4].f1},{&g_203.f1,&l_2489,&l_980.f0,&g_429[3][2][4].f1,&g_140,&g_203.f1,(void*)0,(void*)0,&g_203.f1,&g_140},{&l_62.f1,(void*)0,(void*)0,&l_62.f1,(void*)0,&g_203.f1,&l_73.f1,&l_980.f0,&g_140,&l_980.f0}};
+ struct S0 ** const l_2546[4] = {&g_803,&g_803,&g_803,&g_803};
+ uint32_t ** const l_2587 = &g_1707;
+ uint32_t *l_2596 = &l_2312;
+ uint32_t **l_2595 = &l_2596;
+ int8_t *l_2632[2];
+ int i, j, k;
+ for (i = 0; i < 4; i++)
+ l_2256[i] = &g_202[2][4];
+ for (i = 0; i < 2; i++)
+ l_2632[i] = &g_448;
+ g_202[4][9] = &l_62;
+ (*g_688) &= ((*p_15) = ((((l_2257[0] == &l_2258[0][0]) , l_2259[7]) , ((**g_712) = (((l_2259[3] = 0x447DL) ^ ((((void*)0 == &l_32) | (((*l_2263) = l_2262) == l_2262)) || ((void*)0 == &l_73))) , 0x29L))) >= (*l_32)));
+ for (l_62.f2 = 1; (l_62.f2 <= 5); l_62.f2 += 1)
+ { /* block id: 1110 */
+ int32_t l_2264 = 1L;
+ int8_t *l_2280 = (void*)0;
+ int32_t l_2302[5];
+ int32_t l_2408 = 0x81C9B156L;
+ union U2 l_2415 = {0L};
+ uint16_t l_2448 = 0xBC8EL;
+ int16_t l_2466 = 0xFD66L;
+ const int32_t l_2521 = 0x4B7359ADL;
+ union U2 ***l_2624 = &g_1058;
+ int i, j;
+ for (i = 0; i < 5; i++)
+ l_2302[i] = 0xFE7F3AB0L;
+ if (g_141[g_902][l_62.f2])
+ { /* block id: 1111 */
+ for (g_1359 = 0; (g_1359 <= 2); g_1359 += 1)
+ { /* block id: 1114 */
+ return &g_9;
+ }
+ }
+ else
+ { /* block id: 1117 */
+ uint8_t l_2277 = 0xA1L;
+ int32_t l_2279 = 0xC2AC5853L;
+ int32_t l_2294 = 9L;
+ int32_t l_2308 = 0x91F0493EL;
+ int32_t l_2309 = (-7L);
+ struct S1 l_2379 = {-1L,-10L,0x3B90L,{0x3487L,8UL,1UL,65535UL,1UL},65535UL};
+ uint32_t l_2380 = 1UL;
+ int32_t l_2384 = 0x5899C3A7L;
+ int32_t l_2385[10][4][6] = {{{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L},{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL},{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L}},{{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L},{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L},{0L,0L,0L,0L,(-5L),(-8L)}},{{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L},{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL}},{{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L},{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L},{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L}},{{0L,0L,0L,0L,(-5L),(-8L)},{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L}},{{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL},{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L},{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L}},{{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L},{0L,0L,0L,0L,(-5L),(-8L)},{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L}},{{1L,0L,(-7L),(-1L),0L,0x0594ECFCL},{1L,0xE9596E70L,7L,0xB5891EFAL,2L,0x290904F0L},{(-7L),0xA63F859BL,(-1L),0xB5891EFAL,0x130F37B5L,0x06C85D14L},{1L,0xE7D02930L,(-5L),(-1L),0x16FE54D0L,0xD3FD5C8DL}},{{1L,0L,1L,0xB5891EFAL,0x88DA25D8L,1L},{(-7L),0xA980789AL,0x2A735ED7L,0xB5891EFAL,(-1L),0xB5891EFAL},{1L,(-8L),1L,(-1L),0x62ACFAC9L,0x5A705F23L},{1L,0x344D9AE6L,(-4L),0xB5891EFAL,0x1040F8BCL,0xAFA1E74CL}},{{(-7L),0x78B3DEB0L,(-4L),0xB5891EFAL,0L,(-1L)},{1L,0L,(-7L),(-1L),0L,0x0594ECFCL},{1L,0xE9596E70L,7L,0xB5891EFAL,2L,0x290904F0L},{(-7L),0xA63F859BL,(-1L),0xB5891EFAL,0x130F37B5L,0x06C85D14L}}};
+ uint16_t l_2387[8][8][2] = {{{0x1F77L,0x8916L},{0x5EB1L,1UL},{0xD941L,0xD941L},{0xB4D7L,1UL},{0x156AL,0xF827L},{1UL,0UL},{0xF674L,1UL},{0xB773L,0x4CDCL}},{{0xB773L,1UL},{0xF674L,0UL},{1UL,0xF827L},{0x156AL,1UL},{0xB4D7L,0xD941L},{0xD941L,1UL},{0x5EB1L,0x8916L},{0x1F77L,0xF827L}},{{0UL,8UL},{0xDCD7L,0x9ED6L},{0xB773L,0xFBAAL},{65531UL,0xE04EL},{1UL,0UL},{0UL,0xEEC3L},{0UL,0xA55FL},{0xB4D7L,1UL}},{{0xB9FBL,0x9C21L},{8UL,0x8916L},{0x156AL,0xEEC3L},{0x9ED6L,0xB4D7L},{0xDCD7L,1UL},{65531UL,0xE953L},{0UL,0xE04EL},{0xF674L,8UL}},{{0x9ED6L,0x45EEL},{0UL,1UL},{0x5EB1L,0x9C21L},{1UL,0x9C21L},{0x5EB1L,1UL},{0UL,0x45EEL},{0x9ED6L,8UL},{0xF674L,0xE04EL}},{{0UL,0xE953L},{65531UL,1UL},{0xDCD7L,0xB4D7L},{0x9ED6L,0xEEC3L},{0x156AL,0x8916L},{8UL,0x9C21L},{0xB9FBL,1UL},{0xB4D7L,0xA55FL}},{{0UL,0xEEC3L},{0UL,0UL},{1UL,0xE04EL},{65531UL,0xFBAAL},{0xB773L,0x9ED6L},{0xDCD7L,8UL},{0UL,0xF827L},{0x1F77L,0x8916L}},{{0x5EB1L,1UL},{0xD941L,0xD941L},{0xB4D7L,1UL},{0x156AL,0xDCD7L},{65535UL,0xD941L},{0xE4A2L,65535UL},{1UL,0x77A6L},{1UL,65535UL}}};
+ int i, j, k;
+ if ((*l_32))
+ break;
+ if (((0x32L >= (((l_2264 = p_14.f2) , (-5L)) & (safe_lshift_func_int8_t_s_u(p_14.f1, 5)))) < p_12))
+ { /* block id: 1120 */
+ struct S0 *l_2278 = &l_62.f3;
+ if (l_2259[3])
+ break;
+ l_2279 |= (~((*p_15) = (((*p_15) || ((*l_32) != (l_2259[7] || 9L))) > (((safe_lshift_func_int8_t_s_s(((((((safe_sub_func_int32_t_s_s(((*p_13) & 0xD5DB01E4L), (l_2277 = ((l_980 , (((*g_688) = (safe_mod_func_int32_t_s_s((safe_div_func_int8_t_s_s(0L, 8L)), 0xEA115DFCL))) < 5L)) & 0xD3L)))) > (-1L)) && (*l_32)) != p_14.f0) || l_2259[7]) <= p_14.f1), 1)) , l_2278) != &p_14))));
+ return l_2280;
+ }
+ else
+ { /* block id: 1127 */
+ int16_t *l_2295 = &g_1798;
+ int32_t l_2300 = 0L;
+ int32_t l_2304 = 0xE4A6017EL;
+ int32_t l_2305 = 0xBB491C39L;
+ for (g_94 = 0; (g_94 <= 3); g_94 += 1)
+ { /* block id: 1130 */
+ int i, j;
+ (*g_688) = (((safe_add_func_uint16_t_u_u((1UL < (0xCD44D46BL != (safe_add_func_uint8_t_u_u((((p_12 , (safe_lshift_func_uint8_t_u_s((safe_mul_func_int16_t_s_s(l_2289, (safe_lshift_func_int8_t_s_u((0UL != (~((safe_add_func_uint8_t_u_u((g_141[g_94][(g_94 + 3)] = ((3UL == 0x8855L) , (0x099BL ^ l_2279))), 0x5DL)) & l_2259[5]))), l_2294)))), 7))) , 0x6B32L) >= 0x40A0L), 0x1BL)))), 65530UL)) >= 0x84L) < (*p_15));
+ }
+ l_2264 = (*p_13);
+ for (g_29 = 0; (g_29 <= 3); g_29 += 1)
+ { /* block id: 1137 */
+ const int16_t *l_2296 = &g_193.f0;
+ int32_t *l_2297 = (void*)0;
+ int32_t *l_2298 = &l_2259[2];
+ int32_t *l_2299[2][7][6] = {{{&l_2259[7],&g_33,&l_2259[7],&l_2279,&l_2264,&g_82},{&g_82,(void*)0,&g_33,&g_33,(void*)0,&g_82},{&l_2279,&l_2264,&l_2259[7],&g_902,&g_82,&g_29},{(void*)0,&l_2259[7],&g_82,&g_82,&g_82,&l_2259[7]},{(void*)0,&g_29,&g_82,&g_902,&l_2259[7],&l_2264},{&l_2279,&g_82,(void*)0,&g_33,&g_33,(void*)0},{&g_82,&g_82,&l_2264,&l_2279,&l_2259[7],&g_33}},{{&l_2259[7],&g_29,&g_902,&l_2264,&g_82,&l_2264},{&g_902,&l_2259[7],&g_902,&l_2264,&g_82,&g_33},{&l_2259[7],&l_2264,&l_2264,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_2264,&l_2264},{&l_2259[7],&g_33,&g_82,&l_2264,&g_902,&l_2259[7]},{&g_902,&l_2264,&g_82,&l_2264,&g_902,&g_29},{&l_2259[7],&g_33,&l_2259[7],&l_2279,&l_2264,&g_82}}};
+ int i, j, k;
+ (*l_32) = (l_2295 != l_2296);
+ --l_2312;
+ }
+ }
+ if (l_2308)
+ { /* block id: 1142 */
+ int8_t l_2321 = 1L;
+ uint32_t l_2326 = 6UL;
+ int32_t l_2329[4];
+ struct S1 l_2350 = {-1L,1L,0xD5C0L,{0x8AE0L,65528UL,1UL,1UL,255UL},65535UL};
+ int i;
+ for (i = 0; i < 4; i++)
+ l_2329[i] = 3L;
+ (*g_1058) = l_2315;
+ (*p_13) = (*g_688);
+ if ((safe_lshift_func_uint16_t_u_s(p_14.f3, 15)))
+ { /* block id: 1145 */
+ int32_t *l_2318 = &l_2294;
+ int32_t *l_2319 = &l_2259[4];
+ int32_t *l_2320 = (void*)0;
+ int32_t *l_2322 = (void*)0;
+ int32_t *l_2323 = &l_2307;
+ int32_t *l_2324 = &l_2302[0];
+ int32_t *l_2325[5];
+ int i;
+ for (i = 0; i < 5; i++)
+ l_2325[i] = &l_2294;
+ (*l_32) = 8L;
+ --l_2326;
+ l_2330[1][2][0]++;
+ (*l_2318) = ((*p_15) = ((((0x7027L <= 3UL) , (safe_add_func_uint16_t_u_u((l_2262 != (void*)0), p_14.f2))) ^ (safe_rshift_func_uint16_t_u_u(p_14.f1, ((safe_mod_func_uint16_t_u_u((safe_div_func_uint8_t_u_u(((((g_2341 , ((safe_rshift_func_uint16_t_u_s((safe_add_func_uint16_t_u_u(((*p_15) | (*p_13)), 1L)), 15)) || p_12)) & (*p_13)) | p_12) < l_2277), (*g_713))), 0x4026L)) || (-6L))))) ^ (*l_32)));
+ }
+ else
+ { /* block id: 1151 */
+ if ((*p_13))
+ break;
+ }
+ (*p_13) = ((*g_1153) & (((0UL >= l_2330[7][3][0]) | (((*l_32) |= (safe_div_func_uint16_t_u_u((l_2264 >= (l_2259[4] || (safe_sub_func_int32_t_s_s(((!((p_15 == (g_688 = func_16(l_2350, l_2326, &l_2321, (*g_1059)))) < 0xC144L)) | p_14.f2), g_663.f1)))), p_14.f2))) < p_14.f4)) && 65532UL));
+ }
+ else
+ { /* block id: 1157 */
+ int8_t l_2373 = (-1L);
+ int32_t *l_2381 = &l_2302[3];
+ int32_t *l_2382[3][1];
+ int32_t l_2383 = 0xD4D53D12L;
+ int i, j;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 1; j++)
+ l_2382[i][j] = &l_2309;
+ }
+ if (p_12)
+ goto lbl_2351;
+ for (g_663.f1 = 0; (g_663.f1 <= 5); g_663.f1 += 1)
+ { /* block id: 1161 */
+ uint32_t *l_2372 = &g_1492;
+ int i, j;
+ (*g_688) = (((safe_lshift_func_uint8_t_u_s((g_141[g_663.f1][l_62.f2] = 0xA0L), 5)) , l_62) , ((safe_div_func_uint32_t_u_u((safe_rshift_func_uint16_t_u_u((p_14.f4 ^ ((((safe_div_func_int16_t_s_s(g_141[g_663.f1][l_62.f2], 0xF306L)) & ((*g_146) = p_14.f1)) == ((safe_mod_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u((p_14 , (safe_sub_func_uint32_t_u_u(p_14.f1, ((*l_2372) &= ((((safe_mul_func_int16_t_s_s(((*l_2262) = (safe_mul_func_int8_t_s_s((safe_mul_func_uint8_t_u_u(((**g_1455) = (p_14.f3 != (*l_32))), 6UL)), p_12))), p_12)) > (-1L)) < (*p_13)) , p_14.f1))))), 0xC5L)), l_2309)) , 0x0BB3L)) ^ (*p_13))), l_2373)), (*p_15))) <= p_14.f4));
+ (*p_13) |= (!(safe_add_func_uint8_t_u_u((p_14.f0 != (*g_1153)), 0xB4L)));
+ return &g_870;
+ }
+ if ((safe_rshift_func_int16_t_s_s(((void*)0 == l_2378), (l_2379 , p_14.f1))))
+ { /* block id: 1171 */
+ g_131 = &g_33;
+ return &g_1473[8];
+ }
+ else
+ { /* block id: 1174 */
+ if (l_2380)
+ break;
+ }
+ l_2387[3][1][1]++;
+ }
+ }
+ if ((safe_rshift_func_int8_t_s_u((*l_32), 1)))
+ { /* block id: 1180 */
+ uint16_t l_2413 = 1UL;
+ union U2 l_2414[6] = {{0L},{0L},{0L},{0L},{0L},{0L}};
+ int32_t **l_2440 = &g_364;
+ int32_t **l_2441 = &g_364;
+ int i;
+ if ((*p_13))
+ break;
+ for (g_94 = 0; (g_94 <= 3); g_94 += 1)
+ { /* block id: 1184 */
+ union U2 * const *l_2419 = &g_1059;
+ union U2 * const **l_2418 = &l_2419;
+ int32_t l_2420[9][1] = {{0x051709FCL},{1L},{0x051709FCL},{0x051709FCL},{1L},{0x051709FCL},{0x051709FCL},{1L},{0x051709FCL}};
+ int32_t *l_2478 = &g_429[3][2][4].f1;
+ struct S1 l_2520 = {-2L,0L,0x57AFL,{0x21C3L,0x3511L,0x0B52L,65528UL,0xE3L},0x76F0L};
+ int i, j;
+ }
+ return l_2524;
+ }
+ else
+ { /* block id: 1222 */
+ const struct S1 l_2528 = {0x71L,0L,0UL,{0x3E7BL,2UL,0xA362L,0x52B0L,1UL},0x1C93L};
+ uint32_t *l_2544 = &g_27;
+ struct S0 * const *l_2547[6] = {&g_803,&g_803,&g_803,&g_803,&g_803,&g_803};
+ int8_t *l_2549 = (void*)0;
+ int32_t *l_2550 = &g_429[3][2][4].f1;
+ int32_t ***l_2556 = (void*)0;
+ const int32_t ****l_2558 = &l_2557;
+ uint16_t **l_2568 = &g_146;
+ int32_t l_2574[4] = {(-1L),(-1L),(-1L),(-1L)};
+ int8_t l_2588 = 0L;
+ uint32_t l_2600 = 0x9044E83EL;
+ int i;
+ l_2302[3] = (safe_lshift_func_uint16_t_u_s(5UL, ((4L >= p_14.f4) & l_2302[3])));
+ (*p_15) = ((((l_2527[5][4] != (l_2550 = func_16((l_2528 , l_73), (safe_mul_func_uint16_t_u_u((safe_rshift_func_int16_t_s_s(0L, ((safe_rshift_func_int8_t_s_s((p_14.f3 & 0xAEFE28DBL), 3)) & (safe_mod_func_int8_t_s_s((safe_mod_func_uint16_t_u_u((((((((l_2528 , (((safe_lshift_func_int8_t_s_s(((safe_div_func_uint8_t_u_u((((*l_2544) = (&g_1931[0] == l_2543)) != l_2545), 0x12L)) , l_2302[3]), 3)) && (*p_13)) , l_2546[0])) != l_2547[1]) || p_14.f4) == (*p_13)) , p_14.f3) , l_2548[1][3][0]) != &g_1766), (*g_522))), l_2330[1][2][0]))))), l_2415.f0)), l_2549, (*l_2315)))) < 0UL) < (*g_146)) >= 0UL);
+ (*l_32) = (safe_unary_minus_func_int32_t_s(((l_2528.f1 , (((p_14.f0 | ((safe_sub_func_int16_t_s_s((safe_rshift_func_int16_t_s_u(p_14.f0, 10)), (((l_2556 == ((*l_2558) = l_2557)) != (((((safe_mod_func_int16_t_s_s((g_2561 == l_2563), (((((safe_div_func_uint16_t_u_u(((safe_lshift_func_int8_t_s_s((0UL & 9UL), 7)) || p_14.f0), l_2289)) < 0x58L) >= (**g_1455)) < 0L) | 0x365904B0L))) > p_14.f2) , l_2568) != l_2378) < p_14.f2)) ^ l_2423))) != 0xE69B00F3L)) ^ (*g_1949)) || 0x2E1B5BAFL)) > p_14.f3)));
+ for (g_203.f4 = (-21); (g_203.f4 < 26); g_203.f4++)
+ { /* block id: 1231 */
+ int8_t l_2594 = 9L;
+ int32_t * const *l_2599[2];
+ union U2 ***l_2623 = (void*)0;
+ int32_t *l_2630 = &l_2574[3];
+ int32_t *l_2631 = &l_2259[7];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_2599[i] = (void*)0;
+ for (g_1359 = 3; (g_1359 == 40); g_1359 = safe_add_func_int32_t_s_s(g_1359, 8))
+ { /* block id: 1234 */
+ int32_t *l_2573[6][7][6] = {{{&l_2386[3][6][3],&l_2302[4],&l_2259[4],&l_2302[4],&l_2386[3][6][3],&l_2264},{&g_82,&l_2302[3],&g_29,&l_2306,&l_2302[3],(void*)0},{&l_2259[4],&l_2264,&l_2465,&l_2302[3],&g_29,(void*)0},{&l_2259[6],(void*)0,&g_29,&l_2465,&l_2264,&l_2264},{&g_29,&l_2259[4],&l_2259[4],&g_29,&l_2259[6],&l_2307},{&l_2465,&g_29,(void*)0,&l_2259[6],&g_29,&g_29},{&l_2302[3],&l_2465,&l_2264,&l_2259[4],&g_29,&l_2465}},{{&l_2306,&g_29,&l_2302[3],&g_82,&l_2259[6],&g_82},{&l_2302[4],&l_2259[4],&l_2302[4],&l_2386[3][6][3],&l_2264,&g_29},{&g_29,(void*)0,&g_29,&l_2302[3],&g_29,&g_29},{(void*)0,&l_2264,&l_2306,&l_2302[3],&l_2302[3],&l_2386[3][6][3]},{&g_29,&l_2302[3],&l_2259[6],&l_2386[3][6][3],&l_2386[3][6][3],&l_2259[6]},{&l_2311,&l_2311,&l_2465,&l_2302[4],&g_82,&g_29},{&g_29,&l_2306,&g_82,&l_2301,&l_2259[6],&l_2465}},{{&l_2386[3][6][3],&g_29,&g_82,&l_2259[4],&l_2311,&g_29},{&g_29,&l_2259[4],&l_2465,(void*)0,&l_2465,&l_2259[4]},{(void*)0,&l_2465,&l_2259[4],&g_29,&l_2307,(void*)0},{&l_2259[4],&g_82,&g_29,&l_2386[3][6][3],&l_2301,&l_2264},{&l_2301,&g_82,&l_2306,&g_29,&l_2307,&l_2302[3]},{&l_2302[4],&l_2465,&l_2311,&l_2311,&l_2465,&l_2302[4]},{(void*)0,&l_2259[4],&l_2386[3][6][3],&l_2302[3],&l_2311,&g_29}},{{&l_2302[3],&g_29,&l_2488,&g_29,&l_2259[6],&l_2306},{&l_2302[3],&l_2306,&g_29,&l_2302[3],&g_82,&l_2259[6]},{(void*)0,&l_2311,&l_2301,&l_2311,(void*)0,&l_2488},{&l_2302[4],&l_2386[3][6][3],&l_2264,&g_29,&g_29,&g_29},{&l_2301,&l_2488,&l_2302[3],&l_2386[3][6][3],(void*)0,&g_29},{&l_2259[4],&g_29,&l_2264,&g_29,&l_2488,&l_2488},{(void*)0,&l_2301,&l_2301,(void*)0,&l_2259[4],&l_2259[6]}},{{&g_29,&l_2264,&g_29,&l_2259[4],&l_2302[3],&l_2306},{&l_2386[3][6][3],&l_2302[3],&l_2488,&l_2301,&l_2302[3],&g_29},{&g_29,&l_2264,&l_2386[3][6][3],&l_2302[4],&l_2259[4],&l_2302[4]},{&l_2311,&l_2301,&l_2311,(void*)0,&l_2488,&l_2302[3]},{&l_2302[3],&g_29,&l_2306,&l_2302[3],(void*)0,&l_2264},{&g_29,&l_2488,&g_29,&l_2302[3],&g_29,(void*)0},{&l_2302[3],&l_2386[3][6][3],&l_2259[4],(void*)0,(void*)0,&l_2259[4]}},{{&l_2311,&l_2311,&l_2465,&l_2302[4],&g_82,&g_29},{&g_29,&l_2306,&g_82,&l_2301,&l_2259[6],&l_2465},{&l_2386[3][6][3],&g_29,&g_82,&l_2259[4],&l_2311,&g_29},{&g_29,&l_2259[4],&l_2465,(void*)0,&l_2465,&l_2259[4]},{(void*)0,&l_2465,&l_2259[4],&g_29,&l_2307,(void*)0},{&l_2259[4],&g_82,&g_29,&l_2386[3][6][3],&l_2301,&l_2264},{&l_2301,&g_82,&l_2306,&g_29,&l_2307,&l_2302[3]}}};
+ uint32_t **l_2586[7][2] = {{(void*)0,&g_1707},{&g_1707,(void*)0},{&g_1707,&g_1707},{(void*)0,&g_1707},{&g_1707,(void*)0},{&g_1707,(void*)0},{&g_1707,(void*)0}};
+ uint32_t ***l_2597 = &g_737;
+ int32_t **l_2598 = &l_2550;
+ int i, j, k;
+ (*g_802) = (*g_802);
+ --g_2575;
+ (*p_15) = (l_2574[3] , (p_14.f1 , (safe_lshift_func_uint16_t_u_s((((p_14.f3 | ((-3L) < l_2528.f1)) ^ ((safe_unary_minus_func_uint8_t_u((((*g_146) ^= (~((*p_15) == p_14.f4))) != (((safe_unary_minus_func_int8_t_s(p_14.f4)) <= (((!((safe_lshift_func_int16_t_s_u((0x8ED8L > p_14.f0), 1)) , (*l_32))) , l_2586[2][0]) != l_2587)) <= (*l_32))))) != 1UL)) ^ p_12), l_2588))));
+ l_2408 &= (((*l_32) <= (((safe_unary_minus_func_int16_t_s((safe_mul_func_int16_t_s_s(((*l_2262) = (((((*p_13) |= (~(p_14.f3 >= (((l_2594 = (g_193.f2 , (*g_146))) || (((*l_2597) = ((*g_522) , l_2595)) != &l_2596)) == 0x3CF58CB7L)))) || (l_2600 = ((l_2598 != l_2599[0]) , 4294967295UL))) == l_2522) | p_14.f2)), 0UL)))) != p_14.f2) & l_2521)) == l_2415.f0);
+ }
+ (*l_2631) = ((safe_sub_func_uint32_t_u_u(l_2588, ((*l_2544) |= (+(safe_add_func_uint16_t_u_u((safe_sub_func_int32_t_s_s(((*l_2630) &= ((*l_32) = (safe_unary_minus_func_int32_t_s(((*p_13) = (!((safe_rshift_func_int8_t_s_s((safe_mod_func_uint8_t_u_u((safe_unary_minus_func_uint8_t_u(((*g_1153) ^= (safe_sub_func_int8_t_s_s((((safe_div_func_uint8_t_u_u((p_14.f1 <= (safe_mul_func_uint16_t_u_u(((g_193 , (((safe_mul_func_int8_t_s_s((safe_sub_func_uint8_t_u_u(((l_2623 != ((*l_2563) = l_2624)) && ((((safe_div_func_int16_t_s_s((p_14.f0 != ((*g_713) = ((safe_rshift_func_int8_t_s_u(((((l_2629 != (void*)0) || ((0UL != (*g_1949)) , p_14.f0)) <= (*g_1010)) > l_2588), 1)) , 0UL))), 0xFB22L)) | 0xD46AL) && p_12) >= 0xF070L)), l_2594)), l_2594)) || l_2448) ^ 0UL)) ^ p_14.f4), l_2594))), l_2289)) < l_2594) , (*g_10)), 0L))))), l_2448)), 4)) >= 0x577BL))))))), p_14.f3)), p_12)))))) | p_14.f2);
+ if ((*g_131))
+ continue;
+ }
+ }
+ return &g_1473[4];
+ }
+ return l_2632[1];
+ }
+ return &g_870;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_27 g_28
+ * writes: g_27
+ */
+static int32_t * func_16(struct S1 p_17, uint32_t p_18, int8_t * p_19, union U2 p_20)
+{ /* block id: 1 */
+ int32_t l_26[8][6] = {{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L}};
+ int i, j;
+ for (p_17.f4 = 0; (p_17.f4 <= 11); p_17.f4 = safe_add_func_uint16_t_u_u(p_17.f4, 6))
+ { /* block id: 4 */
+ g_27 ^= l_26[5][1];
+ }
+ return g_28[4];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_1725 g_368 g_367 g_522 g_203.f3.f1 g_688 g_82 g_491 g_712 g_713 g_94 g_146 g_23.f2 g_203.f3.f3 g_33
+ * writes: g_491 g_33 g_203.f0 g_367 g_82 g_2212 g_203.f3.f1 g_94 g_2039 g_203.f3.f3
+ */
+static int32_t func_34(int8_t * p_35, int8_t * p_36, uint16_t p_37)
+{ /* block id: 670 */
+ struct S0 l_1321[7][5] = {{{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{-4L,1UL,0x33E9L,65532UL,248UL},{-1L,1UL,8UL,65530UL,2UL},{-4L,1UL,0x33E9L,65532UL,248UL},{-1L,1UL,8UL,65530UL,2UL},{-4L,1UL,0x33E9L,65532UL,248UL}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL}}};
+ int16_t l_1379 = 4L;
+ uint32_t *l_1406 = (void*)0;
+ union U2 l_1407 = {0x4EADE60BL};
+ int32_t l_1421 = 0x102DBB17L;
+ int32_t l_1424 = 0x2B1BCA3FL;
+ int32_t l_1428 = 0xEA818C76L;
+ uint8_t **l_1453 = &g_1153;
+ uint32_t **l_1709 = (void*)0;
+ uint16_t *l_1711 = &g_203.f3.f3;
+ struct S1 l_1720 = {0x40L,0x6FFD7AF9L,8UL,{0x2D4DL,0xA206L,65535UL,0x7873L,5UL},0xD12CL};
+ int32_t ****l_1721 = &g_362[0][2];
+ const int32_t *l_1724 = &g_1725;
+ uint32_t ***l_1768 = (void*)0;
+ uint32_t ****l_1767 = &l_1768;
+ int8_t *l_1795 = &g_203.f0;
+ const int32_t *l_1817 = &g_203.f1;
+ const int32_t **l_1816 = &l_1817;
+ union U2 *** const l_1840 = &g_1058;
+ int32_t l_1879 = 1L;
+ uint16_t l_1880[3][4][4] = {{{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L}},{{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L}},{{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL}}};
+ struct S0 **l_1910 = &g_803;
+ int16_t l_1918 = (-9L);
+ uint32_t l_1946[7] = {0xEE53957CL,0xEE53957CL,0x80BFCBB2L,0xEE53957CL,0xEE53957CL,0x80BFCBB2L,0xEE53957CL};
+ const int8_t *l_2008 = &g_1473[4];
+ const int8_t **l_2007[1][3];
+ int32_t l_2058 = (-1L);
+ int32_t l_2060 = 1L;
+ int32_t l_2062 = 0L;
+ int32_t l_2063 = 2L;
+ int32_t l_2064 = 0x983A5C25L;
+ int32_t l_2066 = (-4L);
+ int32_t l_2068[10] = {0L,(-4L),(-4L),0L,(-4L),(-4L),0L,(-4L),(-4L),0L};
+ int32_t l_2107 = 0xA817EE1CL;
+ uint16_t l_2110 = 5UL;
+ int32_t l_2187[2][1][6] = {{{0xDE7BFC06L,1L,0xDE7BFC06L,0xDE7BFC06L,1L,0xDE7BFC06L}},{{0xDE7BFC06L,1L,0xDE7BFC06L,0xDE7BFC06L,1L,0xDE7BFC06L}}};
+ int16_t * const l_2211 = (void*)0;
+ int16_t * const *l_2210 = &l_2211;
+ uint32_t l_2251 = 1UL;
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 3; j++)
+ l_2007[i][j] = &l_2008;
+ }
+lbl_2200:
+ for (g_491 = 0; (g_491 <= 2); g_491 += 1)
+ { /* block id: 673 */
+ union U2 *** const l_1324 = &g_1058;
+ int32_t l_1338 = 0x5C08166EL;
+ struct S0 l_1356 = {-6L,0x5D1AL,2UL,4UL,255UL};
+ struct S1 l_1369 = {7L,0x11B39F74L,0UL,{0x463DL,1UL,0x5561L,0UL,255UL},0UL};
+ uint16_t *l_1374[2];
+ int32_t l_1422 = 0x6B8C6F9AL;
+ int32_t l_1426[9][1] = {{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L}};
+ uint32_t l_1461 = 1UL;
+ int8_t *l_1605 = &g_368[5][2][0];
+ int32_t *l_1607 = &l_1421;
+ int32_t l_1684 = (-3L);
+ int32_t **** const l_1691 = &g_362[1][1];
+ uint32_t *l_1715 = &g_1474;
+ uint32_t ***l_1733 = &l_1709;
+ uint32_t l_1760 = 0xCBADAB3CL;
+ int32_t **l_1761 = (void*)0;
+ uint8_t l_1804 = 0UL;
+ int16_t *l_1841 = &g_367;
+ int32_t l_1854[2][5] = {{0x57B5A700L,9L,0x57B5A700L,0x57B5A700L,9L},{9L,0x57B5A700L,0x57B5A700L,9L,0x57B5A700L}};
+ int32_t **l_1855 = &l_1607;
+ const union U2 **l_1904 = &g_1006;
+ const union U2 ***l_1903 = &l_1904;
+ int16_t l_1948 = 0xC682L;
+ uint32_t l_2035 = 18446744073709551612UL;
+ int8_t l_2059 = 0x14L;
+ int16_t l_2072 = (-1L);
+ int32_t l_2099 = 1L;
+ struct S1 l_2115 = {0xA4L,0xBD652974L,0x549FL,{0xE04CL,65535UL,0x13F6L,2UL,0xCCL},65531UL};
+ struct S1 **l_2135[6][2];
+ struct S1 **l_2136 = &g_202[4][6];
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_1374[i] = &g_429[3][2][4].f4;
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 2; j++)
+ l_2135[i][j] = (void*)0;
+ }
+ }
+ for (g_33 = (-20); (g_33 == 8); g_33++)
+ { /* block id: 1056 */
+ const uint8_t l_2192 = 0xB9L;
+ int16_t *l_2197 = &g_367;
+ int32_t l_2206 = 0xFE778CABL;
+ int32_t l_2218 = (-1L);
+ int32_t l_2219 = (-6L);
+ int32_t l_2221 = 0x90AE588BL;
+ int32_t l_2222 = 0L;
+ int32_t l_2223 = 1L;
+ int32_t l_2225[1][3];
+ int16_t l_2249[4] = {0xAF2AL,0xAF2AL,0xAF2AL,0xAF2AL};
+ uint32_t l_2250[7] = {0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L};
+ int32_t * const **l_2253 = (void*)0;
+ int32_t * const ***l_2252 = &l_2253;
+ int32_t *l_2254 = &l_2068[2];
+ int i, j;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 3; j++)
+ l_2225[i][j] = 0x74BA6E8EL;
+ }
+ if (l_2187[1][0][2])
+ break;
+ if (((safe_add_func_int8_t_s_s(((((((((safe_rshift_func_int8_t_s_s(((*l_1795) = (l_2192 >= ((0xB0C3E753L || p_37) > (*l_1724)))), 6)) , ((p_37 , 4UL) < (((safe_add_func_uint16_t_u_u(2UL, ((*l_2197) |= ((*l_1724) & ((safe_sub_func_int8_t_s_s(((((l_2058 = (l_2192 , l_2192)) & (*l_1724)) > (*l_1724)) , (-9L)), 1UL)) , (*p_36)))))) , l_2192) , p_37))) != (*p_36)) , (*g_522)) & (*l_1724)) , 4294967295UL) | p_37) | p_37), (*p_35))) || p_37))
+ { /* block id: 1061 */
+ if (p_37)
+ break;
+ }
+ else
+ { /* block id: 1063 */
+ int32_t l_2201 = 5L;
+ int32_t l_2205[8] = {2L,2L,2L,2L,2L,2L,2L,2L};
+ int i;
+ (*g_688) |= p_37;
+ for (l_1720.f4 = 0; (l_1720.f4 != 17); ++l_1720.f4)
+ { /* block id: 1067 */
+ uint32_t l_2207 = 4294967294UL;
+ int32_t l_2217 = 0x44EE3AA8L;
+ int32_t l_2220[6][9] = {{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L}};
+ int8_t l_2224 = 0xF2L;
+ int8_t l_2229 = 8L;
+ int32_t l_2231[8][6][5] = {{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}}};
+ int i, j, k;
+ if (g_491)
+ goto lbl_2200;
+ if (l_2201)
+ break;
+ for (l_1720.f0 = 0; (l_1720.f0 <= 5); l_1720.f0 += 1)
+ { /* block id: 1072 */
+ int32_t *l_2202 = &g_902;
+ int32_t *l_2203 = &l_2060;
+ int32_t *l_2204[9][10][2] = {{{&g_33,&l_2187[1][0][0]},{(void*)0,&l_2060},{&l_2068[6],&l_2066},{&l_2187[0][0][3],&l_1879},{(void*)0,&g_82},{&l_2066,&g_902},{&l_2068[2],&l_1424},{&l_2066,&g_902},{&l_1879,&l_2060},{&l_2187[1][0][0],(void*)0}},{{&g_902,&l_2064},{&g_29,&l_2062},{&l_2062,&l_2062},{&g_29,&l_2068[2]},{&l_2060,&g_29},{&l_2064,&g_902},{&l_2060,&l_2064},{&l_2062,&g_29},{&l_2062,&l_2064},{&l_2060,&g_902}},{{&l_2064,&g_29},{&l_2060,&l_2068[2]},{&g_29,&l_2062},{&l_2062,&l_2062},{&g_29,&l_2064},{&g_902,(void*)0},{&l_2187[1][0][0],&l_2060},{&l_1879,&g_902},{&l_2066,&l_1424},{&l_2068[2],&g_902}},{{&l_2066,&g_82},{(void*)0,&l_1879},{&l_2187[0][0][3],&l_2066},{&l_2068[6],&l_2060},{(void*)0,&l_2187[1][0][0]},{&g_33,&l_2201},{&g_902,&l_2201},{&g_33,&l_2187[1][0][0]},{(void*)0,&l_2062},{&l_2201,(void*)0}},{{&g_29,&g_29},{&l_2063,&l_1424},{(void*)0,&l_2187[1][0][3]},{&g_33,&l_2062},{&l_2187[0][0][3],&g_29},{&g_29,&g_902},{&g_82,&l_2068[2]},{&l_2066,&l_2064},{&g_902,&l_2062},{&g_902,&g_902}},{{&g_902,&g_33},{&g_902,&l_2187[0][0][1]},{(void*)0,&l_2187[1][0][0]},{&l_2062,(void*)0},{&g_82,&g_902},{&g_82,(void*)0},{&l_2062,&l_2187[1][0][0]},{(void*)0,&l_2187[0][0][1]},{&g_902,&g_33},{&g_902,&g_902}},{{&g_902,&l_2062},{&g_902,&l_2064},{&l_2066,&l_2068[2]},{&g_82,&g_902},{&g_29,&g_29},{&l_2187[0][0][3],&l_2062},{&g_33,&l_2187[1][0][3]},{(void*)0,&l_1424},{&l_2063,&g_29},{&g_29,(void*)0}},{{&l_2201,&l_2062},{&l_2060,&g_82},{&l_2066,&l_2060},{&l_2187[1][0][0],&l_2060},{&l_2066,&g_82},{&l_2060,&l_2062},{&l_2201,(void*)0},{&g_29,&g_29},{&l_2063,&l_1424},{(void*)0,&l_2187[1][0][3]}},{{&g_33,&l_2062},{&l_2187[0][0][3],&g_29},{&g_29,&g_902},{&g_82,&l_2068[2]},{&l_2066,&l_2064},{&g_902,&l_2062},{&g_902,&g_902},{&g_902,&g_33},{&g_902,&l_2187[0][0][1]},{(void*)0,&l_2187[1][0][0]}}};
+ int16_t l_2230 = 0xA55CL;
+ uint32_t l_2232 = 0xE71201CAL;
+ int i, j, k;
+ for (l_2107 = 0; (l_2107 <= 5); l_2107 += 1)
+ { /* block id: 1075 */
+ return p_37;
+ }
+ ++l_2207;
+ for (l_2062 = 0; (l_2062 <= 3); l_2062 += 1)
+ { /* block id: 1081 */
+ int8_t l_2214[9][2][1] = {{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}},{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}},{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}}};
+ int32_t l_2215 = (-1L);
+ int32_t l_2216[8][5][6] = {{{0xFD5A2C04L,0L,5L,0x228BFD3AL,(-1L),8L},{0L,0xE3760A9BL,0x89E7159DL,0xA48B00B6L,0x89E7159DL,0xE3760A9BL},{0L,8L,(-1L),0x228BFD3AL,5L,0L},{0xFD5A2C04L,(-1L),0x533CC7D1L,0x4AD7B503L,(-1L),0x533CC7D1L},{0xA48B00B6L,(-1L),0xB16858CAL,0xFD5A2C04L,5L,(-1L)}},{{0x9AB37E89L,8L,0xE1CFE88EL,0xF47BBD48L,0x89E7159DL,0xB16858CAL},{0x228BFD3AL,0xE3760A9BL,0xE1CFE88EL,0x075C4389L,(-1L),(-1L)},{7L,0L,0xB16858CAL,(-3L),0x533CC7D1L,0x533CC7D1L},{(-3L),0x533CC7D1L,0x533CC7D1L,(-3L),0xB16858CAL,0L},{7L,(-1L),(-1L),0x075C4389L,0xE1CFE88EL,0xE3760A9BL}},{{0x228BFD3AL,0xB16858CAL,0x89E7159DL,0xF47BBD48L,0xE1CFE88EL,8L},{0x9AB37E89L,(-1L),5L,0xFD5A2C04L,0x70EF0CBEL,(-1L)},{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L},{0L,0x8D68B320L,2L,0xB16858CAL,2L,0x8D68B320L}},{{0L,0L,(-1L),(-1L),0x115524F0L,(-7L)},{0L,(-1L),0xEADC0E19L,0x533CC7D1L,(-10L),0xEADC0E19L},{0xB16858CAL,(-1L),0x70EF0CBEL,0L,0x115524F0L,(-10L)},{0x7BCB3C11L,0L,(-1L),0xE3760A9BL,2L,0x70EF0CBEL},{(-1L),0x8D68B320L,(-1L),8L,(-1L),(-10L)}},{{0xE1CFE88EL,(-7L),0x70EF0CBEL,(-1L),0xEADC0E19L,0xEADC0E19L},{(-1L),0xEADC0E19L,0xEADC0E19L,(-1L),0x70EF0CBEL,(-7L)},{0xE1CFE88EL,(-10L),(-1L),8L,(-1L),0x8D68B320L},{(-1L),0x70EF0CBEL,2L,0xE3760A9BL,(-1L),0L},{0x7BCB3C11L,(-10L),0x115524F0L,0L,0x70EF0CBEL,(-1L)}},{{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L},{0L,0x8D68B320L,2L,0xB16858CAL,2L,0x8D68B320L},{0L,0L,(-1L),(-1L),0x115524F0L,(-7L)},{0L,(-1L),0xEADC0E19L,0x533CC7D1L,(-10L),0xEADC0E19L}},{{0xB16858CAL,(-1L),0x70EF0CBEL,0L,0x115524F0L,(-10L)},{0x7BCB3C11L,0L,(-1L),0xE3760A9BL,2L,0x70EF0CBEL},{(-1L),0x8D68B320L,(-1L),8L,(-1L),(-10L)},{0xE1CFE88EL,(-7L),0x70EF0CBEL,(-1L),0xEADC0E19L,0xEADC0E19L},{(-1L),0xEADC0E19L,0xEADC0E19L,(-1L),0x70EF0CBEL,(-7L)}},{{0xE1CFE88EL,(-10L),(-1L),8L,(-1L),0x8D68B320L},{(-1L),0x70EF0CBEL,2L,0xE3760A9BL,(-1L),0L},{0x7BCB3C11L,(-10L),0x115524F0L,0L,0x70EF0CBEL,(-1L)},{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L}}};
+ uint16_t l_2226 = 0xF37BL;
+ int i, j, k;
+ g_2212 = l_2210;
+ l_2226--;
+ }
+ ++l_2232;
+ }
+ }
+ }
+ (*l_2254) &= ((((((*g_522) ^= l_2222) != (~l_2218)) & ((*l_1711) ^= (((!((**g_712)--)) < ((g_2039 = l_1721) != ((safe_mod_func_uint16_t_u_u((((safe_rshift_func_uint8_t_u_u(((safe_mod_func_int8_t_s_s((*p_35), p_37)) || (((safe_div_func_int32_t_s_s((!((*g_688) = 0L)), (safe_mul_func_uint8_t_u_u((p_37 > ((safe_sub_func_int16_t_s_s(((void*)0 == l_1453), 0x3F36L)) == p_37)), l_2206)))) && (*l_1724)) > l_2249[1])), p_37)) | l_2250[3]) & l_2251), (*g_146))) , l_2252))) & 0x16L))) & 0xDEL) , (-10L));
+ }
+ return p_37;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_33 g_688 g_82 g_23 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_29 g_23.f2 g_10 g_9 g_448 g_23.f0 g_193 g_27 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803
+ * writes: g_82 g_23 g_94 g_1010 g_202 g_29 g_203.f1 g_92 g_275 g_448 g_28 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803
+ */
+static int8_t * func_38(int32_t * p_39)
+{ /* block id: 461 */
+ union U2 l_983 = {0xA18EBFA4L};
+ uint32_t *l_993[4][4][5] = {{{&g_27,&g_27,&g_491,&g_491,&g_27},{&g_491,&g_27,(void*)0,&g_27,&g_491},{&g_27,&g_491,&g_491,&g_27,&g_27},{&g_491,&g_27,&g_491,&g_491,&g_491}},{{&g_27,&g_27,&g_27,&g_491,&g_27},{&g_491,&g_491,(void*)0,&g_491,&g_491},{&g_27,&g_491,&g_27,&g_27,&g_27},{&g_491,&g_491,&g_491,&g_27,&g_491}},{{&g_27,&g_27,&g_491,&g_491,&g_27},{&g_491,&g_27,(void*)0,&g_27,&g_491},{&g_27,&g_491,&g_491,&g_27,&g_27},{&g_491,&g_27,&g_491,&g_491,&g_491}},{{&g_27,&g_27,&g_27,&g_491,&g_27},{&g_491,&g_491,(void*)0,&g_491,&g_491},{&g_27,&g_491,&g_27,&g_27,&g_27},{&g_491,&g_491,&g_491,&g_27,&g_491}}};
+ uint32_t **l_992 = &l_993[1][2][2];
+ uint32_t *l_994 = &g_275[5][2];
+ int8_t *l_999 = &g_448;
+ int8_t **l_1000 = &l_999;
+ struct S1 l_1002 = {0x00L,1L,0x1C11L,{-1L,0xDCFBL,0UL,0x327FL,0x73L},0x0032L};
+ int32_t l_1003 = 0x037EDC74L;
+ int8_t *l_1004 = &g_9;
+ union U2 *l_1005 = &g_23;
+ uint8_t *l_1008[3];
+ uint32_t l_1020[10][5][5] = {{{0xF2AA9CB4L,0xF2AA9CB4L,0xB9798130L,1UL,0x84C3A2C5L},{9UL,6UL,0xDB4B8351L,0x79CDF276L,18446744073709551612UL},{2UL,1UL,4UL,0xCFC16537L,1UL},{0xED3C58A6L,6UL,18446744073709551615UL,0x05959D90L,0UL},{0x1FE60990L,0xF2AA9CB4L,18446744073709551611UL,2UL,1UL}},{{1UL,0xCE69CB81L,2UL,18446744073709551610UL,7UL},{0xBDDE72C4L,1UL,8UL,0x3AB83C40L,1UL},{6UL,1UL,0x412240A3L,0x38E14851L,0x56FAA21DL},{0xF174B866L,0xCFC16537L,18446744073709551613UL,0UL,0xB9798130L},{0x46E8FA96L,18446744073709551615UL,0x0979A739L,0xDB4B8351L,0x38E14851L}},{{0x23A25F20L,18446744073709551615UL,18446744073709551608UL,18446744073709551615UL,0x23A25F20L},{0xA159F13BL,0x56FAA21DL,18446744073709551610UL,0x255BB07DL,0x0979A739L},{0xA884EFE1L,9UL,0x0C1255E5L,1UL,0xBDDE72C4L},{0UL,0x79CDF276L,6UL,0x56FAA21DL,0x0979A739L},{18446744073709551612UL,1UL,18446744073709551615UL,0UL,0x23A25F20L}},{{0x0979A739L,18446744073709551615UL,0UL,6UL,0x38E14851L},{0UL,4UL,1UL,18446744073709551611UL,0xB9798130L},{1UL,0xA159F13BL,0x46E8FA96L,0x7D73904FL,0x56FAA21DL},{6UL,8UL,0UL,1UL,1UL},{0xDB4B8351L,0x31587566L,18446744073709551615UL,18446744073709551615UL,7UL}},{{3UL,0xED235A89L,0xC4ACEBD6L,1UL,1UL},{0x31587566L,9UL,0x31587566L,18446744073709551608UL,0UL},{0x8530C162L,0xC4ACEBD6L,0xA884EFE1L,0x4D4F19E2L,1UL},{0UL,1UL,18446744073709551608UL,1UL,18446744073709551612UL},{1UL,0x23A25F20L,0xA884EFE1L,1UL,0x84C3A2C5L}},{{0xF30BAE18L,7UL,0x31587566L,0x412240A3L,0xA159F13BL},{0UL,0xA884EFE1L,0xF2AA9CB4L,0xAC889584L,18446744073709551615UL},{1UL,1UL,0x412240A3L,18446744073709551608UL,0x34DC149FL},{0UL,18446744073709551615UL,0UL,0xA4772EFEL,0x2E7448B6L},{6UL,0x79CDF276L,0UL,0xCE69CB81L,18446744073709551615UL}},{{6UL,0x4007BECEL,8UL,18446744073709551613UL,4UL},{1UL,0xED3C58A6L,0x05959D90L,0x05959D90L,0xED3C58A6L},{0xCB204103L,0xC82A66DFL,0x6DA78595L,0x3AB83C40L,0x23A25F20L},{9UL,1UL,0xF30BAE18L,0x412240A3L,0xEDF2696BL},{0x9ADF3501L,0UL,18446744073709551611UL,18446744073709551612UL,1UL}},{{9UL,0x0979A739L,0UL,0x31587566L,1UL},{0xCB204103L,18446744073709551615UL,6UL,0x23A25F20L,0xB970E888L},{1UL,0x28F68007L,0x0281312AL,2UL,18446744073709551608UL},{6UL,0x8530C162L,1UL,18446744073709551607UL,18446744073709551615UL},{6UL,0x71A1A02CL,1UL,0xED3C58A6L,18446744073709551612UL}},{{0UL,0x84C3A2C5L,0xB9798130L,18446744073709551615UL,0UL},{1UL,0x38E14851L,6UL,18446744073709551610UL,0x31587566L},{1UL,1UL,1UL,1UL,18446744073709551608UL},{1UL,0xA159F13BL,0x31587566L,0x255BB07DL,1UL},{0xCFC16537L,18446744073709551612UL,18446744073709551615UL,1UL,18446744073709551615UL}},{{0x0979A739L,18446744073709551610UL,18446744073709551615UL,0x255BB07DL,1UL},{0xC82A66DFL,0xBDDE72C4L,9UL,1UL,0xA884EFE1L},{7UL,1UL,0UL,18446744073709551610UL,0x43467938L},{0xCA5F646AL,0xB970E888L,4UL,18446744073709551615UL,0xAC889584L},{18446744073709551615UL,0x412240A3L,1UL,0xED3C58A6L,18446744073709551610UL}}};
+ int32_t l_1035[1];
+ uint16_t l_1075[7];
+ int8_t l_1104[2][6][3] = {{{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L}},{{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L}}};
+ union U2 *l_1162[3][1];
+ uint32_t l_1163 = 0x33E342EBL;
+ int8_t l_1263[4][4][5];
+ const struct S0 *l_1312 = &g_663;
+ const struct S0 **l_1311 = &l_1312;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ l_1008[i] = &g_141[1][4];
+ for (i = 0; i < 1; i++)
+ l_1035[i] = (-4L);
+ for (i = 0; i < 7; i++)
+ l_1075[i] = 0xB9F4L;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 1; j++)
+ l_1162[i][j] = &l_983;
+ }
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ for (k = 0; k < 5; k++)
+ l_1263[i][j][k] = 5L;
+ }
+ }
+ (*g_688) &= (*p_39);
+ if ((safe_rshift_func_uint8_t_u_u((l_983 , (l_1003 = ((*g_713) = ((((((*l_1005) = (l_983.f2 , g_23)) , &l_983) != g_1006) >= (*g_522)) , 0x0CL)))), 3)))
+ { /* block id: 469 */
+ int8_t **l_1009[4][8][8] = {{{&g_10,&g_10,&l_1004,&l_999,&l_999,&g_10,&l_1004,&l_1004},{&l_999,&g_10,(void*)0,&g_10,&l_999,&g_10,&g_10,&l_1004},{&l_1004,&l_999,&g_10,&g_10,&l_1004,&l_999,&l_1004,(void*)0},{&g_10,&g_10,(void*)0,&l_1004,(void*)0,&l_1004,&l_999,&l_1004},{&l_999,&l_1004,(void*)0,&l_1004,&g_10,&g_10,&g_10,&l_999},{&l_999,(void*)0,&l_1004,&l_1004,&l_1004,(void*)0,&l_999,&l_999},{&g_10,(void*)0,&l_1004,&l_1004,&g_10,&l_999,&g_10,&l_1004},{&l_1004,&g_10,&l_1004,&l_999,(void*)0,&l_999,&g_10,&g_10}},{{(void*)0,&g_10,(void*)0,&l_1004,&g_10,(void*)0,&l_999,&g_10},{(void*)0,(void*)0,&l_1004,(void*)0,&l_999,&l_999,&l_1004,&l_999},{&l_1004,&g_10,&g_10,&g_10,(void*)0,&g_10,&l_1004,&l_999},{(void*)0,&l_999,&l_1004,&l_999,&l_1004,(void*)0,&g_10,(void*)0},{&l_999,&l_999,&l_999,&l_1004,&l_999,&g_10,&g_10,&l_1004},{&g_10,&g_10,&l_999,&g_10,&g_10,(void*)0,&l_1004,&g_10},{&l_999,&l_1004,&g_10,&g_10,&l_999,(void*)0,&l_1004,&g_10},{&l_999,(void*)0,&g_10,&l_999,&l_1004,(void*)0,(void*)0,(void*)0}},{{&g_10,&l_999,&l_1004,&l_999,&g_10,(void*)0,&l_1004,&l_1004},{(void*)0,&l_1004,&l_999,&l_999,&l_1004,(void*)0,&g_10,&l_1004},{&l_999,&l_1004,&l_999,&l_999,&g_10,(void*)0,&l_1004,(void*)0},{&l_1004,&l_1004,&g_10,&l_999,&l_999,&l_1004,&l_1004,&l_1004},{(void*)0,&l_999,&l_1004,&l_999,&g_10,&g_10,(void*)0,&l_1004},{&g_10,(void*)0,&l_1004,&l_999,&l_1004,(void*)0,&g_10,(void*)0},{&l_1004,&g_10,&l_999,&l_999,&g_10,&g_10,&g_10,&g_10},{&l_999,&g_10,(void*)0,&g_10,&l_1004,&l_999,&l_999,&g_10}},{{&l_1004,&g_10,&l_999,&g_10,(void*)0,&l_999,&g_10,&l_1004},{&g_10,&l_1004,&l_999,&l_1004,(void*)0,&g_10,&l_1004,(void*)0},{&l_999,&l_1004,&l_1004,&l_999,&g_10,(void*)0,(void*)0,&l_999},{&l_1004,&l_999,&l_999,&g_10,&g_10,&l_1004,&l_1004,&l_999},{&g_10,&g_10,(void*)0,(void*)0,&l_999,&g_10,&l_999,(void*)0},{&g_10,(void*)0,&g_10,&l_1004,(void*)0,&l_999,&l_1004,&l_1004},{&g_10,&l_1004,(void*)0,&l_1004,(void*)0,&l_1004,&g_10,&l_1004},{&l_999,(void*)0,&g_10,&g_10,(void*)0,&g_10,(void*)0,&l_999}}};
+ int32_t **l_1011 = &g_28[0];
+ int i, j, k;
+ (*l_1011) = func_45((g_1010 = &g_448), &g_29, &g_448);
+ }
+ else
+ { /* block id: 472 */
+ const int16_t l_1021 = (-10L);
+ int32_t l_1032[10][2][6] = {{{1L,8L,3L,3L,8L,1L},{(-1L),1L,3L,1L,(-1L),(-1L)}},{{4L,1L,1L,4L,8L,4L},{4L,8L,4L,1L,1L,4L}},{{(-1L),(-1L),1L,3L,1L,(-1L)},{1L,8L,3L,3L,8L,1L}},{{(-1L),1L,3L,1L,(-1L),(-1L)},{4L,1L,1L,4L,8L,4L}},{{4L,8L,4L,1L,1L,4L},{(-1L),(-1L),1L,3L,1L,(-1L)}},{{1L,8L,3L,3L,8L,1L},{(-1L),1L,3L,1L,(-1L),(-1L)}},{{4L,1L,1L,4L,8L,4L},{4L,8L,4L,1L,1L,4L}},{{(-1L),(-1L),1L,3L,1L,(-1L)},{1L,8L,3L,3L,8L,1L}},{{(-1L),1L,3L,1L,(-1L),(-1L)},{4L,1L,1L,4L,8L,4L}},{{4L,8L,4L,1L,1L,4L},{(-1L),(-1L),1L,3L,1L,(-1L)}}};
+ uint32_t l_1040 = 0x46C4402DL;
+ int32_t l_1048 = (-1L);
+ uint16_t l_1051 = 0xAEDFL;
+ int8_t ***l_1054 = &l_1000;
+ union U2 **l_1057[7];
+ union U2 l_1091 = {0xD559D94EL};
+ struct S1 l_1093 = {0x59L,-10L,0xE7A5L,{0x9AAAL,0x6F3EL,5UL,65533UL,1UL},0x1B19L};
+ int32_t ***l_1137[4] = {(void*)0,(void*)0,(void*)0,(void*)0};
+ int32_t ****l_1138[4];
+ uint8_t **l_1144 = (void*)0;
+ uint8_t ***l_1143 = &l_1144;
+ uint32_t l_1178[3];
+ const uint8_t *l_1224 = (void*)0;
+ const uint8_t **l_1223 = &l_1224;
+ uint32_t l_1264 = 18446744073709551615UL;
+ union U2 l_1304[5] = {{0xC351DB28L},{0xC351DB28L},{0xC351DB28L},{0xC351DB28L},{0xC351DB28L}};
+ int i, j, k;
+ for (i = 0; i < 7; i++)
+ l_1057[i] = &l_1005;
+ for (i = 0; i < 4; i++)
+ l_1138[i] = &l_1137[0];
+ for (i = 0; i < 3; i++)
+ l_1178[i] = 1UL;
+ for (g_193.f3 = 26; (g_193.f3 <= 11); g_193.f3 = safe_sub_func_uint8_t_u_u(g_193.f3, 1))
+ { /* block id: 475 */
+ int16_t l_1033 = 0L;
+ int32_t l_1036 = (-1L);
+ int32_t l_1037[8] = {2L,(-5L),2L,(-5L),2L,(-5L),2L,(-5L)};
+ int i;
+ for (g_9 = 0; (g_9 == (-15)); g_9 = safe_sub_func_uint32_t_u_u(g_9, 4))
+ { /* block id: 478 */
+ int8_t l_1031 = 0x69L;
+ int32_t l_1034 = 0xDBC85C67L;
+ int32_t l_1038[1];
+ int i;
+ for (i = 0; i < 1; i++)
+ l_1038[i] = 0x1432EEBAL;
+ if ((*p_39))
+ break;
+ for (g_663.f1 = 0; (g_663.f1 == 24); g_663.f1 = safe_add_func_uint16_t_u_u(g_663.f1, 7))
+ { /* block id: 482 */
+ int8_t l_1022[10][10][2] = {{{0xA6L,0x74L},{(-3L),0x73L},{0xBAL,(-3L)},{0x73L,0x74L},{0x73L,(-3L)},{0xBAL,0x73L},{(-3L),0x74L},{0xA6L,0xA6L},{0xBAL,0xA6L},{0xA6L,0x74L}},{{(-3L),0x73L},{0xBAL,(-3L)},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L}},{{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L}},{{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L}},{{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L}},{{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L}},{{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L}},{{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL}},{{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL}},{{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L}}};
+ int32_t l_1029 = 0xD4525DBDL;
+ int32_t l_1039 = (-1L);
+ int i, j, k;
+ if ((((safe_rshift_func_uint8_t_u_s(l_1020[0][2][0], 2)) & l_1021) <= l_1022[5][2][1]))
+ { /* block id: 483 */
+ int32_t *l_1023 = &g_82;
+ int32_t *l_1024 = &g_82;
+ int32_t *l_1025 = &g_33;
+ int32_t *l_1026 = &g_33;
+ int32_t *l_1027 = &g_33;
+ int32_t *l_1028 = &g_902;
+ int32_t *l_1030[3][9][6] = {{{(void*)0,(void*)0,&l_1029,&l_1029,&l_1029,(void*)0},{(void*)0,&l_1003,&l_1003,&l_1029,&l_1003,(void*)0},{&g_902,&g_29,&g_29,&g_29,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,&g_29,(void*)0,&l_1029},{(void*)0,&g_82,&l_1003,&g_29,(void*)0,&g_29},{(void*)0,&g_29,&g_82,&g_29,(void*)0,&l_1003},{&l_1029,(void*)0,&g_902,(void*)0,&g_902,(void*)0},{(void*)0,&l_1003,&l_1029,(void*)0,&g_902,(void*)0},{&g_82,&g_29,&g_902,&g_33,&l_1003,&l_1003}},{{&g_902,(void*)0,&g_82,&g_902,&g_82,&g_29},{&g_33,&g_33,&l_1003,&g_82,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,(void*)0,&g_29,&l_1029},{(void*)0,&g_33,&g_902,&l_1029,&g_82,&l_1029},{&g_29,(void*)0,&l_1029,(void*)0,&l_1003,&l_1003},{&g_29,&g_29,&l_1029,(void*)0,&g_902,&g_902},{&g_29,&l_1003,&l_1029,(void*)0,&g_902,&g_33},{&g_29,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_29,&g_29,(void*)0,&l_1029,(void*)0,&l_1003}},{{(void*)0,&g_82,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_82,&g_29,&l_1003},{&g_33,&g_82,(void*)0,&g_902,&l_1029,(void*)0},{&g_902,&l_1029,(void*)0,&g_33,&g_33,&g_33},{&g_82,(void*)0,&l_1029,(void*)0,(void*)0,&g_902},{(void*)0,(void*)0,&l_1029,(void*)0,&g_33,&l_1003},{&l_1029,&l_1029,&l_1029,&g_29,&l_1029,&l_1029},{(void*)0,&g_82,&g_902,&g_29,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,&g_29,(void*)0,&l_1029}}};
+ int i, j, k;
+ ++l_1040;
+ (*l_1023) ^= 0x1C9C1B24L;
+ (*g_802) = (*g_802);
+ }
+ else
+ { /* block id: 487 */
+ return &g_368[5][5][0];
+ }
+ }
+ }
+ }
+ }
+ return &g_368[4][0][2];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_712 g_713 g_94 g_146 g_23.f2 g_10 g_9 g_522 g_203.f3.f1 g_709 g_141 g_193.f3 g_33 g_82 g_29 g_663.f1 g_275 g_27 g_663.f0 g_870 g_368 g_688 g_802 g_663.f3 g_23 g_429.f3.f2
+ * writes: g_33 g_82 g_29 g_709 g_94 g_193.f3 g_663.f1 g_27 g_23.f2 g_203.f3.f1 g_203.f1 g_203.f3.f3 g_28 g_131 g_9 g_803 g_663.f3 g_275
+ */
+static union U2 func_40(int32_t * p_41, int8_t * p_42, struct S0 p_43, int32_t p_44)
+{ /* block id: 368 */
+ int16_t *l_813 = &g_367;
+ int32_t l_816[2];
+ int32_t **l_829 = (void*)0;
+ int32_t **l_830 = (void*)0;
+ uint32_t *l_831 = &g_709[8][1];
+ struct S1 *l_834 = (void*)0;
+ struct S0 l_841 = {-3L,0xA66BL,0x139EL,0x6331L,0x55L};
+ int32_t l_923 = 0xBFDBBFDCL;
+ int32_t ** const l_926[1][9][9] = {{{&g_28[4],(void*)0,&g_28[2],&g_688,&g_688,&g_28[4],&g_28[1],&g_28[4],&g_28[4]},{&g_28[0],&g_688,&g_28[2],&g_688,&g_28[2],&g_688,&g_28[0],&g_688,&g_688},{&g_28[4],&g_28[4],&g_28[5],(void*)0,&g_28[4],&g_688,&g_28[1],(void*)0,&g_28[1]},{&g_688,(void*)0,&g_28[4],&g_28[4],(void*)0,&g_688,&g_688,&g_688,&g_28[0]},{(void*)0,&g_28[2],&g_688,&g_688,&g_28[4],&g_28[1],&g_28[4],&g_28[4],&g_28[4]},{&g_688,&g_28[2],&g_688,&g_28[2],&g_688,&g_28[0],&g_688,&g_688,&g_688},{&g_28[1],(void*)0,&g_28[5],&g_28[1],&g_28[4],&g_688,&g_28[4],&g_688,&g_28[4]},{&g_688,&g_688,&g_688,&g_688,(void*)0,&g_28[0],&g_688,&g_28[4],(void*)0},{&g_28[4],&g_28[2],&g_28[4],&g_28[5],&g_688,&g_28[4],&g_28[4],&g_688,&g_28[5]}}};
+ int32_t l_967 = (-1L);
+ uint8_t *l_974 = &g_96;
+ uint8_t **l_973 = &l_974;
+ uint32_t l_977 = 0xBFD29E8DL;
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ l_816[i] = 1L;
+ (*p_41) = ((0xD2E1L || (safe_add_func_uint8_t_u_u(((&g_92 != l_813) & (**g_712)), ((((*g_146) > 0x6A77L) > (4294967295UL > ((*g_10) >= (safe_mod_func_uint32_t_u_u(((*g_10) < 0xCCL), 0x2EF7E0E9L))))) != l_816[1])))) & (*g_522));
+ if ((((65535UL != (safe_div_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((safe_add_func_uint8_t_u_u((safe_mod_func_int8_t_s_s((safe_add_func_uint32_t_u_u((((&p_41 == ((safe_sub_func_int16_t_s_s(p_44, ((((((!((((**g_712) = (((l_829 = l_829) != l_830) ^ (((*l_831) |= (l_816[1] | l_816[0])) , (~(~(safe_sub_func_int16_t_s_s(p_43.f0, (l_834 == (void*)0)))))))) || 0x4FL) & p_43.f0)) < p_43.f2) == l_816[0]) < 0UL) == 0x4FL) <= 0UL))) , (void*)0)) , p_44) , 0x00332CCCL), p_44)), p_43.f1)), g_141[5][6])), l_816[0])), l_816[1]))) <= (*g_10)) <= l_816[0]))
+ { /* block id: 373 */
+ union U2 *l_835 = &g_23;
+ int32_t l_844 = 0L;
+ int32_t l_845 = 4L;
+ uint32_t *l_849 = &g_709[5][2];
+ int32_t l_861 = 0x2D871063L;
+ int32_t l_874[6][4][7] = {{{0xEBD23C63L,0x86B45C9EL,0xDBC25A38L,9L,0x7306DC66L,0xE137DD82L,0x7306DC66L},{0L,0x708144BCL,0x7DC3FFEAL,(-1L),0xD4CDFA73L,4L,0x2AEFA674L},{(-4L),0xE137DD82L,0x04C8643BL,0x86B45C9EL,0x430DC65CL,1L,1L},{(-4L),0x3D08D363L,0x2AEFA674L,0x60F55FAEL,(-1L),0x60F55FAEL,0x2AEFA674L}},{{0xDBC25A38L,0xDBC25A38L,1L,0x8300C942L,1L,0x352C77AFL,0x7306DC66L},{4L,0x90ADCA77L,0x694C6AD6L,0x708144BCL,(-4L),0x2FF8803EL,0L},{0x352C77AFL,0xA85E05AAL,1L,0x7306DC66L,1L,0xA85E05AAL,0x352C77AFL},{1L,0x60F55FAEL,0L,(-1L),(-1L),(-6L),0x7DC3FFEAL}},{{1L,0x04C8643BL,0xE2858F44L,0x7C754C8AL,0x430DC65CL,0xEBD23C63L,0xEBD23C63L},{0xD4CDFA73L,(-4L),0L,(-4L),0xD4CDFA73L,0L,0x7DD96E50L},{1L,0x8300C942L,1L,0x352C77AFL,0x7306DC66L,0x58C09AECL,0x430DC65CL},{0x8CCDD4F0L,5L,0x694C6AD6L,0xF7130A0DL,0L,(-1L),0L}},{{1L,0x352C77AFL,1L,(-4L),0xE137DD82L,0x04C8643BL,0x86B45C9EL},{0xD4CDFA73L,4L,0x2AEFA674L,0L,0L,0x90ADCA77L,1L},{1L,1L,0x04C8643BL,0xA85E05AAL,0xA85E05AAL,0x04C8643BL,1L},{1L,(-1L),0x7DC3FFEAL,0x92B23D5EL,(-5L),(-1L),(-4L)}},{{0x352C77AFL,0xE2858F44L,0xDBC25A38L,1L,0x86B45C9EL,0x58C09AECL,0x7C754C8AL},{4L,(-6L),(-9L),0x92B23D5EL,0L,0L,(-1L)},{0xDBC25A38L,0x7C754C8AL,1L,0xA85E05AAL,(-4L),0xEBD23C63L,0xE137DD82L},{(-4L),0xF7130A0DL,(-1L),0L,0x694C6AD6L,(-6L),0x694C6AD6L}},{{(-4L),0x7C754C8AL,0x7C754C8AL,(-4L),0xE2858F44L,0xA85E05AAL,0x58C09AECL},{0L,(-6L),1L,0xF7130A0DL,1L,0x2FF8803EL,0L},{0xA8F0C9FCL,0x8300C942L,0x352C77AFL,0x04C8643BL,0xEBD23C63L,0x04C8643BL,0x352C77AFL},{(-4L),0xC335D284L,1L,0x708144BCL,0xD4CDFA73L,5L,(-9L)}}};
+ int8_t l_892 = 0x14L;
+ uint32_t l_898 = 0UL;
+ uint8_t **l_972[2][5][1];
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ {
+ for (j = 0; j < 5; j++)
+ {
+ for (k = 0; k < 1; k++)
+ l_972[i][j][k] = (void*)0;
+ }
+ }
+ for (g_193.f3 = 0; (g_193.f3 <= 2); g_193.f3 += 1)
+ { /* block id: 376 */
+ union U2 **l_836 = &l_835;
+ int32_t l_871 = (-4L);
+ int32_t l_884 = (-5L);
+ int32_t l_888 = 0x753BF6FFL;
+ int32_t l_895 = (-1L);
+ int32_t l_896[8] = {9L,9L,0x5C7D4CE2L,9L,9L,0x5C7D4CE2L,9L,9L};
+ int32_t l_901[4] = {2L,2L,2L,2L};
+ struct S1 l_930[6] = {{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL}};
+ int i;
+ (*l_836) = l_835;
+ if ((*p_41))
+ continue;
+ for (g_29 = 2; (g_29 >= 0); g_29 -= 1)
+ { /* block id: 381 */
+ int8_t l_872 = 0xD6L;
+ int32_t l_881 = 0xC2359472L;
+ int32_t l_882 = 7L;
+ int32_t l_883 = (-1L);
+ int32_t l_885 = 0x0CE63601L;
+ int32_t l_887[6][3] = {{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)},{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)},{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)}};
+ struct S0 *l_956 = (void*)0;
+ int i, j;
+ for (g_663.f1 = 0; (g_663.f1 <= 2); g_663.f1 += 1)
+ { /* block id: 384 */
+ uint32_t *l_846 = &g_27;
+ uint32_t **l_850 = &l_831;
+ int32_t *l_862 = &g_203.f1;
+ uint32_t l_865 = 0UL;
+ uint32_t *l_873 = &l_865;
+ union U2 l_875 = {-6L};
+ struct S1 *l_876[4][8] = {{(void*)0,(void*)0,&g_203,&g_429[3][2][4],(void*)0,&g_429[3][2][4],(void*)0,(void*)0},{&g_429[3][2][4],(void*)0,&g_203,&g_429[3][2][4],&g_429[0][4][4],&g_429[3][2][4],&g_203,(void*)0},{(void*)0,(void*)0,&g_429[3][2][4],&g_429[3][2][4],(void*)0,&g_203,&g_429[0][4][4],&g_429[3][2][4]},{&g_429[1][1][5],&g_429[0][4][4],&g_429[1][1][3],(void*)0,(void*)0,&g_429[1][1][3],&g_429[0][4][4],&g_429[1][1][5]}};
+ int32_t l_886 = 0xC62C1A3DL;
+ int32_t l_889 = 1L;
+ int32_t l_890 = (-4L);
+ int32_t l_891 = 0xBBD98B66L;
+ int32_t l_894[6] = {9L,9L,9L,9L,9L,9L};
+ int32_t l_897 = 0L;
+ int32_t *l_911 = &l_891;
+ int i, j;
+ if ((safe_mod_func_int32_t_s_s((safe_mul_func_int16_t_s_s((l_841 , 1L), ((((*l_873) = (((safe_lshift_func_int16_t_s_u(((l_844 ^= g_275[(g_663.f1 + 2)][g_29]) != ((*l_846)++)), (((l_849 = l_849) == ((*l_850) = &g_275[0][1])) , (safe_add_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_u(((*g_146)--), ((((*g_522) = (*g_522)) <= (safe_rshift_func_uint16_t_u_u(((safe_mod_func_uint8_t_u_u((((*l_862) = (l_861 ^= l_845)) , ((safe_mul_func_int32_t_s_s(l_865, ((((safe_rshift_func_uint8_t_u_s((((((safe_lshift_func_uint8_t_u_u((p_43.f1 ^ (*g_10)), l_865)) , g_663.f0) , g_870) == p_43.f1) | (**g_712)), 6)) < l_871) | (*p_42)) != (*p_42)))) , p_43.f3)), (*g_713))) , 0x8497L), 0))) , (*g_522)))), (-6L)))))) >= 0xF1L) >= l_872)) < l_871) < p_43.f1))), l_874[4][3][3])))
+ { /* block id: 394 */
+ return l_875;
+ }
+ else
+ { /* block id: 396 */
+ struct S1 **l_877 = &l_876[2][3];
+ int32_t *l_878 = (void*)0;
+ int32_t *l_879 = (void*)0;
+ int32_t *l_880[5][6] = {{&l_874[2][2][5],&l_816[1],&l_845,&l_845,&l_816[1],&l_874[2][2][5]},{&l_874[2][2][5],(void*)0,&l_844,&l_845,(void*)0,&l_845},{&l_874[2][2][5],&l_871,&l_874[2][2][5],&l_845,&l_871,&l_844},{&l_874[2][2][5],&l_816[1],&l_845,&l_845,&l_816[1],&l_874[2][2][5]},{&l_874[2][2][5],(void*)0,&l_844,&l_845,(void*)0,&l_845}};
+ int16_t l_893 = 0xC5C8L;
+ int i, j;
+ (*l_877) = l_876[2][5];
+ l_898++;
+ l_816[1] |= (l_841.f3 != (l_888 = (*p_41)));
+ }
+ if (l_901[2])
+ continue;
+ }
+ for (l_871 = 0; (l_871 <= 1); l_871 += 1)
+ { /* block id: 422 */
+ uint16_t l_941[1];
+ union U2 l_942[5][7] = {{{7L},{1L},{-3L},{7L},{0xD252D763L},{7L},{-3L}},{{-3L},{-3L},{-4L},{0x81C8047CL},{1L},{-7L},{-3L}},{{-3L},{-3L},{0x0CC969D1L},{1L},{-1L},{-1L},{1L}},{{7L},{0xD252D763L},{7L},{-3L},{1L},{7L},{0x1BEE06C4L}},{{1L},{0xD252D763L},{1L},{0x81C8047CL},{0xD252D763L},{-4L},{0xD252D763L}}};
+ int32_t **l_951 = &g_364;
+ int i, j;
+ for (i = 0; i < 1; i++)
+ l_941[i] = 0x94B7L;
+ for (g_203.f3.f3 = 0; (g_203.f3.f3 <= 1); g_203.f3.f3 += 1)
+ { /* block id: 425 */
+ int32_t **l_925 = (void*)0;
+ int8_t * const l_927 = &g_9;
+ int8_t *l_929 = &g_368[7][5][2];
+ int8_t **l_928 = &l_929;
+ uint32_t *l_940 = &g_491;
+ int i;
+ (*g_688) = (l_925 != l_926[0][2][5]);
+ g_131 = (g_28[4] = &p_44);
+ if (l_881)
+ break;
+ }
+ p_44 = ((safe_div_func_int16_t_s_s(((((!l_883) != p_43.f3) <= ((((((*p_41) < (((*g_10) = (safe_lshift_func_int8_t_s_u((((**g_712)++) ^ (l_951 != (void*)0)), (0x1EDDL & ((safe_mod_func_int16_t_s_s(((l_884 = (safe_sub_func_uint32_t_u_u(l_861, (*p_41)))) > 4294967291UL), 0xD5B9L)) <= g_709[8][1]))))) <= 0UL)) , (*p_42)) || (*p_42)) || p_43.f2) , (*p_42))) < (*p_41)), 65535UL)) == 0L);
+ }
+ (*g_802) = l_956;
+ for (l_898 = 0; (l_898 <= 2); l_898 += 1)
+ { /* block id: 444 */
+ for (g_663.f3 = 0; (g_663.f3 <= 3); g_663.f3 += 1)
+ { /* block id: 447 */
+ int i, j;
+ (*g_688) &= (safe_add_func_uint16_t_u_u((1L == (-1L)), (safe_lshift_func_uint8_t_u_s(g_709[(g_29 + 4)][l_898], 1))));
+ return g_23;
+ }
+ }
+ }
+ }
+ (*g_688) = ((g_275[3][1] = 18446744073709551612UL) , (safe_sub_func_uint16_t_u_u(p_43.f4, ((((**g_712) = (safe_mod_func_int32_t_s_s(((*g_522) && (((safe_lshift_func_int8_t_s_s(l_967, (*g_10))) & ((*l_835) , (safe_mul_func_int8_t_s_s(((void*)0 != &g_202[3][1]), (((safe_mul_func_int8_t_s_s(0xFDL, (*g_713))) , l_972[1][4][0]) == l_973))))) ^ (**g_712))), g_429[3][2][4].f3.f2))) || (*p_42)) , (*g_146)))));
+ }
+ else
+ { /* block id: 457 */
+ int8_t l_975 = (-4L);
+ int32_t l_976[2];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_976[i] = 0xB56CD2F2L;
+ l_977++;
+ }
+ return g_23;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_146 g_33 g_82 g_23.f2 g_10 g_9 g_23.f0 g_193 g_23 g_27 g_130 g_96 g_202 g_94 g_203.f1 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_203.f0 g_362 g_367 g_368 g_29 g_448
+ * writes: g_94 g_82 g_202 g_33 g_203.f1 g_92 g_275 g_9 g_23.f2 g_28 g_203.f0 g_96 g_141 g_29 g_448
+ */
+static int32_t * func_45(int8_t * const p_46, int32_t * p_47, int8_t * p_48)
+{ /* block id: 34 */
+ int16_t l_149 = 0x2C69L;
+ int32_t l_158 = 1L;
+ uint8_t *l_159[6][2][6] = {{{(void*)0,&g_96,(void*)0,&g_96,&g_94,(void*)0},{&g_141[5][6],&g_96,&g_141[5][5],&g_141[3][4],&g_96,&g_141[5][6]}},{{(void*)0,&g_141[3][1],&g_141[0][2],&g_141[5][6],&g_141[5][6],&g_94},{&g_96,&g_141[5][5],(void*)0,(void*)0,(void*)0,(void*)0}},{{&g_96,&g_96,&g_141[3][4],&g_141[3][1],(void*)0,&g_141[0][1]},{&g_141[1][1],&g_141[0][1],&g_96,(void*)0,&g_141[5][6],&g_141[3][4]}},{{&g_141[3][4],(void*)0,&g_96,&g_141[5][6],&g_96,(void*)0},{&g_96,&g_141[5][6],&g_96,&g_96,&g_141[3][3],(void*)0}},{{&g_96,&g_141[3][3],(void*)0,(void*)0,&g_141[3][1],(void*)0},{(void*)0,&g_96,(void*)0,&g_96,&g_141[3][4],&g_94}},{{&g_141[3][4],(void*)0,&g_141[1][1],&g_141[5][6],&g_94,&g_141[5][5]},{&g_141[3][3],&g_96,&g_96,&g_141[5][6],&g_94,&g_96}}};
+ int32_t l_162 = 0L;
+ int32_t l_163 = 0x368D4868L;
+ int32_t l_164 = (-1L);
+ int32_t l_165[5][8] = {{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L}};
+ uint16_t l_168 = 65531UL;
+ union U2 l_194 = {0x9F5D8235L};
+ int8_t l_195 = (-8L);
+ uint32_t l_245 = 0x0D5D64FBL;
+ struct S1 l_261[4][9] = {{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}}};
+ int32_t **l_298 = (void*)0;
+ int8_t l_302 = 3L;
+ uint32_t l_384 = 8UL;
+ int32_t **l_615 = &g_364;
+ uint16_t **l_616 = &g_146;
+ int32_t l_659 = 0x16F391CCL;
+ struct S0 *l_660 = &l_261[3][8].f3;
+ uint16_t l_779[5] = {0xCE19L,0xCE19L,0xCE19L,0xCE19L,0xCE19L};
+ uint8_t l_784 = 0xE9L;
+ int i, j, k;
+ if ((((safe_rshift_func_int8_t_s_s(((void*)0 != g_146), 4)) <= ((safe_add_func_uint32_t_u_u(l_149, 0xCFA7979AL)) , (l_149 && (g_94 = ((safe_rshift_func_uint16_t_u_u((safe_mod_func_int16_t_s_s(((*p_47) , ((g_23.f2 && 4294967286UL) & (safe_sub_func_int16_t_s_s((safe_rshift_func_uint16_t_u_u(((((((&l_149 == (void*)0) <= (*g_10)) > 0x5FL) & l_149) | (*p_48)) && l_158), 1)), (*g_146))))), l_149)), 13)) == l_158))))) >= g_23.f0))
+ { /* block id: 36 */
+ int32_t *l_160 = &g_82;
+ int32_t *l_161[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+ int32_t l_166 = (-1L);
+ int16_t l_167 = (-3L);
+ const struct S0 l_224 = {-1L,1UL,65535UL,1UL,0x64L};
+ union U2 l_228 = {-1L};
+ int32_t *l_340 = &l_164;
+ int32_t *l_349 = &g_140;
+ int32_t **l_348[5];
+ struct S1 *l_353[1][8][2] = {{{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]},{&l_261[2][5],&l_261[0][4]},{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]},{&l_261[2][5],&l_261[0][4]},{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]}}};
+ int i, j, k;
+ for (i = 0; i < 5; i++)
+ l_348[i] = &l_349;
+ --l_168;
+ if (l_163)
+ { /* block id: 38 */
+ int32_t l_175 = 0x58B35087L;
+ int8_t *l_186 = &g_9;
+ int16_t *l_189[8][1][3] = {{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}}};
+ int32_t l_190 = 4L;
+ uint8_t **l_198 = &l_159[5][1][1];
+ uint8_t *l_201 = &g_94;
+ union U2 *l_207 = &g_23;
+ uint32_t *l_219[5] = {&g_27,&g_27,&g_27,&g_27,&g_27};
+ uint32_t *l_263 = &g_27;
+ int i, j, k;
+ (*l_160) = (((safe_lshift_func_int16_t_s_u(l_165[1][2], (safe_lshift_func_int8_t_s_s(((l_175 == ((safe_lshift_func_uint16_t_u_s((safe_mod_func_int8_t_s_s((safe_lshift_func_int16_t_s_s(((((-2L) | (safe_sub_func_int16_t_s_s((safe_mod_func_uint16_t_u_u((l_186 == p_46), (l_190 = (4UL | ((safe_mul_func_int8_t_s_s((*l_160), 0xE7L)) != 4294967295UL))))), 1L))) < (*p_48)) | l_168), l_175)), 0x48L)), 10)) ^ (*g_10))) | (*p_48)), l_175)))) , (*g_146)) != 0x7572L);
+ if ((safe_mul_func_uint8_t_u_u(((((-9L) && ((((g_193 , (l_194 = g_23)) , (((l_195 ^ (safe_mod_func_int16_t_s_s(((((*l_198) = &g_96) == (l_194 , (void*)0)) & (((safe_mul_func_int8_t_s_s(((*p_48) | ((*l_201) = 1UL)), g_27)) ^ g_27) != g_130[0][5])), g_193.f3))) || 0xACL) , l_194)) , l_195) != l_175)) != g_96) < 4UL), (*p_48))))
+ { /* block id: 44 */
+ struct S1 **l_204 = &g_202[1][9];
+ union U2 *l_208[5][1][10] = {{{&g_23,&g_23,&l_194,&g_23,(void*)0,&l_194,&g_23,&g_23,&l_194,(void*)0}},{{&l_194,&g_23,&g_23,&l_194,&l_194,&l_194,&g_23,&g_23,(void*)0,&g_23}},{{&l_194,&l_194,&g_23,&l_194,&g_23,&l_194,&g_23,&l_194,&g_23,&l_194}},{{&g_23,(void*)0,&g_23,&g_23,(void*)0,&g_23,&g_23,&l_194,&l_194,&l_194}},{{&l_194,&g_23,&l_194,&g_23,&l_194,(void*)0,(void*)0,&l_194,&g_23,&l_194}}};
+ int32_t l_210 = 1L;
+ int32_t l_225 = 0x90807700L;
+ int i, j, k;
+ (*l_204) = g_202[4][9];
+ for (g_82 = (-22); (g_82 < 17); g_82++)
+ { /* block id: 48 */
+ uint32_t l_209 = 0x1A28751EL;
+ l_208[0][0][0] = l_207;
+ l_190 = (!(l_210 = l_209));
+ }
+ (*l_160) &= 0xBCAB29ADL;
+ (*p_47) = ((l_165[1][6] &= (safe_add_func_uint32_t_u_u(((((safe_sub_func_uint8_t_u_u(((safe_div_func_int8_t_s_s((safe_lshift_func_uint8_t_u_s((*l_160), (*p_48))), g_94)) | (l_219[2] == &g_27)), (l_225 |= (((*p_47) > (safe_div_func_int8_t_s_s(l_210, l_164))) ^ (safe_mod_func_uint16_t_u_u(((l_224 , (*p_47)) | (*l_160)), g_94)))))) & g_27) == l_210) > 9UL), 0x54DDF528L))) > l_194.f0);
+ }
+ else
+ { /* block id: 57 */
+ int16_t l_237 = 0x7730L;
+ uint8_t l_246 = 1UL;
+ int32_t l_247 = 1L;
+ uint16_t *l_252 = &g_203.f3.f1;
+ struct S1 l_264 = {-1L,0L,0UL,{0x4C04L,0UL,65535UL,0x3C41L,0x23L},1UL};
+ uint32_t *l_273 = (void*)0;
+ uint32_t *l_274 = &g_275[5][2];
+ for (g_203.f1 = 0; (g_203.f1 <= 0); g_203.f1 += 1)
+ { /* block id: 60 */
+ return p_47;
+ }
+ if ((safe_mod_func_int8_t_s_s((l_228 , (safe_sub_func_uint8_t_u_u(((safe_lshift_func_uint8_t_u_u((safe_mul_func_int16_t_s_s((g_92 = (safe_div_func_uint8_t_u_u((&g_133[0] != ((l_237 && (l_190 && (l_247 ^= (l_246 = (!(0x5600L <= (((safe_unary_minus_func_uint32_t_u((safe_mod_func_uint16_t_u_u(((safe_lshift_func_uint8_t_u_u((safe_lshift_func_uint8_t_u_s(g_140, (*p_48))), ((*l_201) = (~(((void*)0 == &p_48) == (*p_47)))))) && 0x43L), l_245)))) > (*p_47)) >= l_237))))))) , &p_47)), (*l_160)))), 0L)), g_132)) & g_140), 0x38L))), 4UL)))
+ { /* block id: 67 */
+ uint8_t l_262 = 0x79L;
+ (*p_47) = (l_262 &= (l_246 || ((safe_lshift_func_uint8_t_u_s((safe_mod_func_uint16_t_u_u(((void*)0 == l_252), (l_246 && (*g_146)))), (l_190 | (g_146 != ((safe_add_func_int8_t_s_s((safe_rshift_func_int16_t_s_s((safe_mod_func_int16_t_s_s((safe_mul_func_uint16_t_u_u((l_261[3][8] , l_149), 0x2EB2L)), (*l_160))), l_190)), l_246)) , (void*)0))))) >= g_132)));
+ }
+ else
+ { /* block id: 70 */
+ return p_47;
+ }
+ (*l_160) = ((((l_165[1][6] = l_237) , (l_263 != (((!0xDFC7L) && ((((*l_274) = (l_264 , ((safe_add_func_int8_t_s_s(0x54L, (safe_lshift_func_uint16_t_u_u((safe_mul_func_int8_t_s_s((safe_add_func_int32_t_s_s((l_189[4][0][0] != ((l_165[1][6] , l_264.f3) , &g_92)), (*p_47))), 0L)), (*g_146))))) , 0xF01E3291L))) , (void*)0) == (void*)0)) , (void*)0))) != l_237) == (*p_47));
+ }
+ }
+ else
+ { /* block id: 77 */
+ uint32_t l_276 = 18446744073709551615UL;
+ int32_t **l_281 = &g_28[2];
+ int8_t *l_292[9][7][4] = {{{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&g_203.f0,&l_261[3][8].f0,(void*)0,&g_203.f0},{&l_261[3][8].f0,&l_195,&g_203.f0,&l_195},{(void*)0,&l_261[3][8].f0,&l_195,&l_195},{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0}},{{&l_195,(void*)0,&g_203.f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&l_195,(void*)0},{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,&l_261[3][8].f0,(void*)0,&l_195},{&g_203.f0,&l_195,&g_203.f0,&l_261[3][8].f0},{(void*)0,(void*)0,&g_203.f0,&g_203.f0}},{{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_195,&l_195,&l_195},{&l_195,&l_261[3][8].f0,&l_195,&g_203.f0},{&g_203.f0,&g_203.f0,&g_203.f0,(void*)0},{&g_203.f0,&g_203.f0,&l_261[3][8].f0,&g_203.f0},{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{(void*)0,(void*)0,&l_261[3][8].f0,&g_203.f0}},{{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&g_203.f0,&l_261[3][8].f0,&g_203.f0,&l_195},{&g_203.f0,&l_195,&l_195,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_195,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0}},{{&g_203.f0,&l_261[3][8].f0,(void*)0,&g_203.f0},{&l_261[3][8].f0,&l_195,&g_203.f0,&l_195},{(void*)0,&l_261[3][8].f0,&l_195,&l_195},{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_195,(void*)0,&g_203.f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&l_195,(void*)0}},{{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,&l_261[3][8].f0,(void*)0,&l_195},{&g_203.f0,&l_195,&g_203.f0,&l_261[3][8].f0},{(void*)0,(void*)0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_195,&l_195,&l_195},{&l_195,(void*)0,&g_203.f0,&g_203.f0}},{{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&l_195,&g_203.f0,(void*)0,&l_261[3][8].f0},{&g_203.f0,(void*)0,&l_261[3][8].f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&g_203.f0,(void*)0,(void*)0,(void*)0},{&l_195,&l_195,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&g_203.f0,&l_261[3][8].f0}},{{&l_261[3][8].f0,&g_203.f0,(void*)0,(void*)0},{&l_195,&g_203.f0,&l_195,&l_261[3][8].f0},{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{&g_203.f0,&g_203.f0,&l_261[3][8].f0,(void*)0},{&g_203.f0,&g_203.f0,&l_195,&l_261[3][8].f0},{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_195,&l_195,&l_261[3][8].f0,(void*)0}},{{&l_195,(void*)0,&g_203.f0,&l_195},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_195,(void*)0,&g_203.f0,&l_261[3][8].f0},{&l_195,&g_203.f0,&l_261[3][8].f0,&l_195},{&l_195,&l_261[3][8].f0,&g_203.f0,&g_203.f0},{(void*)0,(void*)0,&l_195,&l_261[3][8].f0},{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0}}};
+ int32_t l_293 = 0xAF17BE23L;
+ struct S1 l_339 = {3L,0xC6CD4D1FL,0x97B2L,{-1L,65534UL,0xDC6FL,0x8F73L,3UL},0x1D13L};
+ int32_t ***l_350 = &l_348[0];
+ int i, j, k;
+ if ((((l_293 = ((((l_276 &= (*g_146)) || (safe_sub_func_uint16_t_u_u((~(((*g_146) = ((safe_lshift_func_uint8_t_u_s(((((*p_48) = (l_281 == &p_47)) | (l_165[0][4] |= (g_96 || (safe_div_func_uint8_t_u_u(g_193.f0, (safe_sub_func_uint16_t_u_u(((safe_sub_func_int32_t_s_s((((((safe_add_func_uint32_t_u_u(((void*)0 != &g_27), (safe_div_func_int16_t_s_s(1L, (((0xFA23E02CL == l_164) >= g_141[3][0]) ^ g_275[5][2]))))) , &l_194) != &l_194) , &l_245) != p_47), (-9L))) ^ l_261[3][8].f1), g_203.f3.f0))))))) || l_158), 7)) != g_23.f2)) , 0x8DBAL)), l_261[3][8].f3.f4))) , &l_261[2][7]) == (void*)0)) , g_203.f3.f4) < l_261[3][8].f3.f2))
+ { /* block id: 83 */
+ union U2 l_299[9][3][7] = {{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}},{{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}}},{{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}}},{{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}}},{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}},{{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}}},{{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}}},{{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}}},{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}}};
+ int16_t *l_303[10][2][5] = {{{&l_167,&g_92,&l_149,&l_149,&g_92},{(void*)0,(void*)0,&l_149,&l_167,&l_149}},{{(void*)0,(void*)0,&l_167,(void*)0,&l_167},{&g_92,&g_92,&l_149,&l_167,&g_92}},{{(void*)0,&l_167,(void*)0,&g_92,(void*)0},{(void*)0,(void*)0,&g_92,&g_92,&l_149}},{{&l_167,(void*)0,(void*)0,&l_167,(void*)0},{&g_92,&g_92,&l_149,(void*)0,&g_92}},{{(void*)0,(void*)0,&l_167,&l_167,&l_167},{(void*)0,(void*)0,(void*)0,&l_149,&l_167}},{{&g_92,&l_167,&l_149,&g_92,&g_92},{(void*)0,&g_92,&g_92,&g_92,(void*)0}},{{(void*)0,(void*)0,&l_149,&g_92,&l_149},{&g_92,(void*)0,(void*)0,&g_92,(void*)0}},{{&g_92,&g_92,&l_167,(void*)0,&g_92},{(void*)0,(void*)0,&l_149,&l_149,&l_167}},{{(void*)0,(void*)0,(void*)0,(void*)0,&l_149},{&g_92,&g_92,&g_92,&g_92,&g_92}},{{(void*)0,&g_92,(void*)0,&g_92,(void*)0},{(void*)0,(void*)0,&l_149,&g_92,&l_167}}};
+ int32_t l_304 = (-1L);
+ int i, j, k;
+ (*p_47) |= (l_162 < ((l_304 |= (((safe_mul_func_int8_t_s_s((*p_48), (safe_mod_func_int8_t_s_s((l_298 == &g_133[0]), ((l_228 , l_299[6][2][1]) , (safe_add_func_uint16_t_u_u(l_302, (((void*)0 != &p_47) && l_299[6][2][1].f2)))))))) != (*g_146)) , g_193.f2)) <= (*g_146)));
+ }
+ else
+ { /* block id: 86 */
+ int32_t *l_309 = &g_203.f1;
+ int32_t l_318 = (-1L);
+ int16_t *l_319 = &g_92;
+ if (((safe_lshift_func_int16_t_s_u((l_318 = ((safe_sub_func_uint16_t_u_u((*g_146), (((*l_309) = (g_23 , g_94)) , g_193.f3))) == ((*l_319) = (safe_sub_func_uint16_t_u_u((*g_146), ((safe_lshift_func_int8_t_s_u(5L, 4)) == (safe_rshift_func_int8_t_s_s((safe_lshift_func_int8_t_s_s(((0x4268F694L ^ l_318) <= g_96), (*p_48))), 5)))))))), 2)) != 0x143FL))
+ { /* block id: 90 */
+ int16_t l_335 = 1L;
+ int32_t l_338 = 0L;
+ (*l_281) = &g_29;
+ for (g_203.f0 = 0; (g_203.f0 >= 22); ++g_203.f0)
+ { /* block id: 94 */
+ uint8_t l_328[2];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_328[i] = 0x73L;
+ l_338 &= ((((*g_146)++) > (0xCFFAL > ((0xDCFD5DADL != (safe_mul_func_uint8_t_u_u((~(g_96 = g_132)), ((safe_lshift_func_uint16_t_u_s((g_275[5][1] < l_328[1]), 10)) | (~((safe_sub_func_int32_t_s_s((*p_47), ((safe_mod_func_int32_t_s_s(0x7B9BFE1BL, ((safe_rshift_func_uint16_t_u_s((l_335 <= ((safe_rshift_func_uint8_t_u_u((g_141[0][1] = g_203.f3.f4), g_27)) || g_140)), g_193.f4)) && (*p_47)))) ^ 0x9CL))) == 0x78C5L)))))) || (-8L)))) == g_203.f3.f4);
+ return &g_82;
+ }
+ }
+ else
+ { /* block id: 101 */
+ uint32_t l_344[4][4][4] = {{{4294967295UL,0x20A336BFL,0x508F9594L,0x20A336BFL},{1UL,0x4B5B738DL,1UL,0xFAAC7D03L},{0x20A336BFL,1UL,0xC65866FCL,0xFD1D0127L},{1UL,0x1FDA686FL,4294967286UL,4294967295UL}},{{1UL,0UL,0xC65866FCL,4294967286UL},{0x20A336BFL,4294967295UL,1UL,0x005F1C4FL},{0x005F1C4FL,4294967295UL,4294967295UL,4294967295UL},{1UL,1UL,0x005F1C4FL,1UL}},{{4294967295UL,4294967294UL,4294967286UL,0xC65866FCL},{0x508F9594L,0x005F1C4FL,4294967295UL,4294967286UL},{0UL,0x005F1C4FL,0xFD1D0127L,0xC65866FCL},{0x005F1C4FL,4294967294UL,0xFAAC7D03L,1UL}},{{0x05C4B03AL,1UL,0xBED9113FL,4294967295UL},{4294967286UL,4294967295UL,4294967286UL,0x005F1C4FL},{0x4687D50BL,4294967295UL,0UL,4294967286UL},{6UL,0UL,0UL,4294967295UL}}};
+ int i, j, k;
+ if (((l_339 , (&g_33 != l_340)) != ((*p_48) = (-5L))))
+ { /* block id: 103 */
+ uint16_t l_341 = 0xCD7FL;
+ ++l_341;
+ }
+ else
+ { /* block id: 105 */
+ int8_t **l_347[4];
+ int i;
+ for (i = 0; i < 4; i++)
+ l_347[i] = &l_292[7][5][0];
+ l_344[1][0][2]++;
+ (*p_47) &= (l_344[0][1][3] , ((g_23 , g_275[4][1]) > (&g_9 == (p_48 = (void*)0))));
+ (*l_281) = p_47;
+ }
+ return &g_33;
+ }
+ }
+ (*l_340) = (*p_47);
+ (*l_350) = l_348[0];
+ for (l_164 = (-28); (l_164 < (-6)); l_164 = safe_add_func_uint32_t_u_u(l_164, 6))
+ { /* block id: 118 */
+ struct S1 **l_354 = &g_202[4][9];
+ (*l_354) = l_353[0][4][1];
+ }
+ }
+ }
+ else
+ { /* block id: 122 */
+ uint32_t l_355[5][5] = {{1UL,0x1EFE6392L,0x1EFE6392L,1UL,0x1EFE6392L},{1UL,1UL,1UL,1UL,1UL},{0x1EFE6392L,1UL,0x1EFE6392L,0x1EFE6392L,1UL},{1UL,0x08136386L,0x08136386L,1UL,0x08136386L},{1UL,1UL,4294967294UL,1UL,1UL}};
+ int32_t l_369 = 0L;
+ struct S1 l_370 = {0x0FL,0x1D359E28L,0x2098L,{-1L,0UL,65535UL,0x21B8L,0x91L},0UL};
+ uint8_t l_371 = 5UL;
+ int32_t *l_372 = &l_164;
+ int32_t *l_373 = &l_369;
+ int16_t *l_385[4];
+ int32_t l_386 = 0x87316FB4L;
+ int32_t l_387[9] = {0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L};
+ int8_t **l_402 = &g_10;
+ int8_t l_408 = (-2L);
+ uint32_t *l_459[7] = {&l_384,&l_384,&l_384,&l_384,&l_384,&l_384,&l_384};
+ union U2 l_506 = {-1L};
+ uint32_t * const l_541 = (void*)0;
+ uint32_t * const *l_540 = &l_541;
+ int8_t l_551 = (-7L);
+ int32_t l_562 = 0x7B63C334L;
+ int16_t l_572[2];
+ uint32_t l_609[1][2][6] = {{{4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL},{4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL}}};
+ uint32_t l_610 = 0xA2210773L;
+ uint16_t **l_617[5][10][2] = {{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}}};
+ uint32_t l_622[8][10][3] = {{{4294967288UL,0xD980B936L,0UL},{0xCFF7DF80L,0xC6F50153L,4294967295UL},{4294967288UL,0x189C563AL,0xA0DDD608L},{0xB9019512L,5UL,1UL},{0UL,0xA209FE77L,0xF6C96FF1L},{0xF25DA586L,5UL,0xB9019512L},{0x55FB34F6L,9UL,0xA11D72F8L},{0x5C6871E7L,4294967290UL,0xB9019512L},{0UL,0xF6C96FF1L,0xF6C96FF1L},{0UL,0xE1B43826L,1UL}},{{4294967295UL,8UL,0xA0DDD608L},{0x35DA2F23L,1UL,4294967295UL},{0xA0DDD608L,0x55FB34F6L,0UL},{1UL,1UL,0x182BD3A5L},{0xD980B936L,8UL,0xD980B936L},{4294967287UL,0xE1B43826L,0xF25DA586L},{0xA209FE77L,0xF6C96FF1L,4294967288UL},{0x182BD3A5L,4294967290UL,4294967295UL},{0x29A9BD62L,9UL,0x15D08CC1L},{0x182BD3A5L,5UL,0x5C6871E7L}},{{0xA209FE77L,0xA209FE77L,8UL},{4294967287UL,5UL,1UL},{0xD980B936L,0x189C563AL,0xA209FE77L},{1UL,0xC6F50153L,0x48801177L},{0xA0DDD608L,0xD980B936L,0xA209FE77L},{0x35DA2F23L,0x2BCB943DL,1UL},{4294967295UL,0x29A9BD62L,8UL},{0UL,0xC6555B24L,0x5C6871E7L},{0UL,0UL,0x15D08CC1L},{0x5C6871E7L,7UL,4294967295UL}},{{0x55FB34F6L,0UL,4294967288UL},{0xF25DA586L,0xC6555B24L,0xF25DA586L},{0UL,0x29A9BD62L,0xD980B936L},{0xB9019512L,0x2BCB943DL,0x182BD3A5L},{4294967288UL,0xD980B936L,0UL},{0xCFF7DF80L,0xC6F50153L,4294967295UL},{4294967288UL,0x189C563AL,0xA0DDD608L},{0xB9019512L,5UL,1UL},{0UL,0xA209FE77L,0xF6C96FF1L},{0xF25DA586L,5UL,0xB9019512L}},{{0x55FB34F6L,9UL,0xA11D72F8L},{0x5C6871E7L,4294967290UL,0xB9019512L},{0UL,0xF6C96FF1L,0xF6C96FF1L},{0UL,0xE1B43826L,1UL},{4294967295UL,8UL,0xA0DDD608L},{0x35DA2F23L,1UL,4294967295UL},{0xA0DDD608L,0x55FB34F6L,0UL},{1UL,1UL,0x182BD3A5L},{0xD980B936L,8UL,0xD980B936L},{4294967287UL,0xE1B43826L,0xF25DA586L}},{{0xA209FE77L,0xF6C96FF1L,4294967288UL},{0x182BD3A5L,4294967290UL,4294967295UL},{0x29A9BD62L,9UL,0x15D08CC1L},{0x182BD3A5L,5UL,0x5C6871E7L},{0xA209FE77L,0xA209FE77L,8UL},{4294967287UL,5UL,1UL},{0xD980B936L,0x189C563AL,0xA0DDD608L},{0xDF803319L,7UL,0x182BD3A5L},{0x29A9BD62L,0x23F5EC66L,0xA0DDD608L},{0UL,6UL,4294967295UL}},{{0x15D08CC1L,0UL,9UL},{4294967295UL,0xC6F50153L,0xCFF7DF80L},{4294967295UL,0xF6C96FF1L,0UL},{0xCFF7DF80L,5UL,0x48801177L},{0x189C563AL,0xF6C96FF1L,0xD980B936L},{4294967290UL,0xC6F50153L,4294967290UL},{0xF6C96FF1L,0UL,0x23F5EC66L},{0x5C6871E7L,6UL,0xF25DA586L},{0xD980B936L,0x23F5EC66L,0xA11D72F8L},{0x35DA2F23L,7UL,4294967287UL}},{{0xD980B936L,0xA209FE77L,0x29A9BD62L},{0x5C6871E7L,4294967295UL,0x66955C2CL},{0xF6C96FF1L,0xA0DDD608L,0UL},{4294967290UL,5UL,0x5C6871E7L},{0x189C563AL,0x55FB34F6L,4294967288UL},{0xCFF7DF80L,0xC30C919DL,0x5C6871E7L},{4294967295UL,0UL,0UL},{4294967295UL,0xC0A101CBL,0x66955C2CL},{0x15D08CC1L,9UL,0x29A9BD62L},{0UL,0x2BCB943DL,4294967287UL}}};
+ uint8_t l_625 = 1UL;
+ struct S0 **l_789 = &l_660;
+ int i, j, k;
+ for (i = 0; i < 4; i++)
+ l_385[i] = &l_149;
+ for (i = 0; i < 2; i++)
+ l_572[i] = 0xCE21L;
+ l_369 = (l_355[1][4] >= (safe_mod_func_int8_t_s_s((g_140 >= (((3UL & g_275[4][2]) | (safe_mod_func_uint32_t_u_u((safe_rshift_func_int16_t_s_u(((void*)0 == g_362[1][2]), (l_261[3][8].f3.f2 ^ ((*g_10) , ((((((*p_47) = (safe_mul_func_uint8_t_u_u((((0xA0C97CF4L < (*p_47)) >= 0xA05A7788L) < g_367), 1L))) && g_203.f1) < g_368[5][5][0]) >= l_355[2][0]) == l_355[1][4]))))), g_130[0][5]))) == l_355[3][0])), (*p_48))));
+ (*l_373) &= ((l_370 , l_371) <= (((*p_47) = (*p_47)) <= ((*l_372) = (-3L))));
+ }
+ return &g_29;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_9 g_82 g_33 g_92 g_23.f2 g_94 g_96 g_23 g_27 g_28 g_141 g_448
+ * writes: g_82 g_92 g_96 g_9 g_27 g_131 g_133 g_141 g_448
+ */
+static int32_t * func_50(uint32_t p_51, int8_t p_52, int8_t p_53, int8_t * p_54, const int32_t p_55)
+{ /* block id: 13 */
+ int8_t *l_81[10] = {&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9};
+ int16_t *l_91 = &g_92;
+ int32_t l_93 = (-8L);
+ uint8_t *l_95 = &g_96;
+ union U2 l_107 = {0x2706CD28L};
+ int32_t l_113 = (-3L);
+ struct S1 l_114 = {8L,0x07506916L,0x6519L,{0xCEA1L,0UL,65531UL,0x6711L,251UL},1UL};
+ const uint16_t l_127 = 0UL;
+ int32_t *l_135 = &l_113;
+ int32_t *l_136 = (void*)0;
+ int32_t *l_137 = (void*)0;
+ int32_t *l_138 = &l_113;
+ int32_t *l_139[6] = {(void*)0,&g_82,(void*)0,(void*)0,&g_82,(void*)0};
+ int i;
+ l_93 = (safe_add_func_uint16_t_u_u(p_52, ((((safe_lshift_func_int16_t_s_u(((safe_div_func_int8_t_s_s((g_82 &= (*p_54)), (*p_54))) >= ((safe_mod_func_int8_t_s_s(((void*)0 != &p_53), (safe_add_func_int32_t_s_s((-3L), 0x3BD055D5L)))) <= 0x5DL)), 14)) ^ ((*l_95) |= (safe_mul_func_int8_t_s_s(((safe_rshift_func_int8_t_s_u(((((((*l_91) ^= g_33) | 0xA63FL) , l_93) >= l_93) > l_93), g_23.f2)) , g_94), 0xC7L)))) != l_93) , g_96)));
+ if (p_51)
+ { /* block id: 18 */
+ int8_t **l_108[6] = {&l_81[4],&l_81[9],&l_81[4],&l_81[4],&l_81[9],&l_81[4]};
+ struct S1 l_109 = {-3L,0xD4E8C809L,0x47BFL,{2L,0x3CBAL,0UL,65535UL,255UL},0xD01BL};
+ uint16_t *l_110 = &l_107.f2;
+ int32_t *l_111 = &l_93;
+ int32_t *l_112[8] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+ uint32_t *l_125 = &g_27;
+ uint8_t *l_126 = (void*)0;
+ const int32_t *l_129 = &g_130[0][5];
+ const int32_t **l_128[9][6][4] = {{{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,&l_129,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,&l_129},{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,&l_129}},{{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0}},{{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0}}};
+ int i, j, k;
+ l_113 = ((*l_111) = (safe_mul_func_uint8_t_u_u((safe_lshift_func_uint16_t_u_u(((p_51 , ((*l_110) = (safe_rshift_func_int8_t_s_u((((*p_54) = (safe_mul_func_uint16_t_u_u(g_92, 0L))) & (safe_mul_func_int16_t_s_s(((0xF9L < (g_23 , (l_107 , ((l_81[9] = (void*)0) == &p_53)))) != ((((l_109 , &p_55) == &g_29) < 250UL) != l_109.f3.f2)), 65533UL))), l_109.f3.f0)))) & l_109.f3.f2), 5)), l_93)));
+ g_133[0] = (g_131 = func_16(l_114, (((void*)0 == p_54) != (((safe_mul_func_uint8_t_u_u(((safe_rshift_func_uint8_t_u_u(((safe_mul_func_uint16_t_u_u((((safe_mul_func_uint16_t_u_u(p_52, ((*p_54) == (((l_113 |= (l_109.f3 , ((*l_95) = (g_23.f2 <= (safe_add_func_int32_t_s_s(l_107.f2, (((+(((*l_125) ^= (l_91 == (void*)0)) <= p_55)) & 0x47876926L) , p_52))))))) ^ (*p_54)) ^ 0L)))) != 4294967288UL) <= p_53), l_114.f0)) & 0xEB91146BL), 2)) < p_51), 255UL)) , p_51) ^ l_127)), &g_9, g_23));
+ }
+ else
+ { /* block id: 29 */
+ int32_t *l_134 = &g_33;
+ return l_134;
+ }
+ ++g_141[5][6];
+ return &g_82;
+}
+
+
+
+
+/* ---------------------------------------- */
+int main (int argc, char* argv[])
+{
+ int i, j, k;
+ int print_hash_value = 0;
+ if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1;
+ platform_main_begin();
+ crc32_gentab();
+ func_1();
+ transparent_crc(g_9, "g_9", print_hash_value);
+ transparent_crc(g_23.f2, "g_23.f2", print_hash_value);
+ transparent_crc(g_27, "g_27", print_hash_value);
+ transparent_crc(g_29, "g_29", print_hash_value);
+ transparent_crc(g_33, "g_33", print_hash_value);
+ transparent_crc(g_82, "g_82", print_hash_value);
+ transparent_crc(g_92, "g_92", print_hash_value);
+ transparent_crc(g_94, "g_94", print_hash_value);
+ transparent_crc(g_96, "g_96", print_hash_value);
+ for (i = 0; i < 8; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ transparent_crc(g_130[i][j], "g_130[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_132, "g_132", print_hash_value);
+ transparent_crc(g_140, "g_140", print_hash_value);
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 7; j++)
+ {
+ transparent_crc(g_141[i][j], "g_141[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_193.f0, "g_193.f0", print_hash_value);
+ transparent_crc(g_193.f1, "g_193.f1", print_hash_value);
+ transparent_crc(g_193.f2, "g_193.f2", print_hash_value);
+ transparent_crc(g_193.f3, "g_193.f3", print_hash_value);
+ transparent_crc(g_193.f4, "g_193.f4", print_hash_value);
+ transparent_crc(g_203.f0, "g_203.f0", print_hash_value);
+ transparent_crc(g_203.f1, "g_203.f1", print_hash_value);
+ transparent_crc(g_203.f2, "g_203.f2", print_hash_value);
+ transparent_crc(g_203.f3.f0, "g_203.f3.f0", print_hash_value);
+ transparent_crc(g_203.f3.f1, "g_203.f3.f1", print_hash_value);
+ transparent_crc(g_203.f3.f2, "g_203.f3.f2", print_hash_value);
+ transparent_crc(g_203.f3.f3, "g_203.f3.f3", print_hash_value);
+ transparent_crc(g_203.f3.f4, "g_203.f3.f4", print_hash_value);
+ transparent_crc(g_203.f4, "g_203.f4", print_hash_value);
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ transparent_crc(g_275[i][j], "g_275[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_367, "g_367", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ transparent_crc(g_368[i][j][k], "g_368[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ for (k = 0; k < 6; k++)
+ {
+ transparent_crc(g_429[i][j][k].f0, "g_429[i][j][k].f0", print_hash_value);
+ transparent_crc(g_429[i][j][k].f1, "g_429[i][j][k].f1", print_hash_value);
+ transparent_crc(g_429[i][j][k].f2, "g_429[i][j][k].f2", print_hash_value);
+ transparent_crc(g_429[i][j][k].f3.f0, "g_429[i][j][k].f3.f0", print_hash_value);
+ transparent_crc(g_429[i][j][k].f3.f1, "g_429[i][j][k].f3.f1", print_hash_value);
+ transparent_crc(g_429[i][j][k].f3.f2, "g_429[i][j][k].f3.f2", print_hash_value);
+ transparent_crc(g_429[i][j][k].f3.f3, "g_429[i][j][k].f3.f3", print_hash_value);
+ transparent_crc(g_429[i][j][k].f3.f4, "g_429[i][j][k].f3.f4", print_hash_value);
+ transparent_crc(g_429[i][j][k].f4, "g_429[i][j][k].f4", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_448, "g_448", print_hash_value);
+ transparent_crc(g_491, "g_491", print_hash_value);
+ transparent_crc(g_663.f0, "g_663.f0", print_hash_value);
+ transparent_crc(g_663.f1, "g_663.f1", print_hash_value);
+ transparent_crc(g_663.f2, "g_663.f2", print_hash_value);
+ transparent_crc(g_663.f3, "g_663.f3", print_hash_value);
+ transparent_crc(g_663.f4, "g_663.f4", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ transparent_crc(g_709[i][j], "g_709[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_870, "g_870", print_hash_value);
+ transparent_crc(g_902, "g_902", print_hash_value);
+ transparent_crc(g_1001, "g_1001", print_hash_value);
+ transparent_crc(g_1007.f0, "g_1007.f0", print_hash_value);
+ transparent_crc(g_1007.f2, "g_1007.f2", print_hash_value);
+ transparent_crc(g_1359, "g_1359", print_hash_value);
+ transparent_crc(g_1361, "g_1361", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ transparent_crc(g_1473[i], "g_1473[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_1474, "g_1474", print_hash_value);
+ transparent_crc(g_1492, "g_1492", print_hash_value);
+ transparent_crc(g_1725, "g_1725", print_hash_value);
+ transparent_crc(g_1798, "g_1798", print_hash_value);
+ transparent_crc(g_2122, "g_2122", print_hash_value);
+ transparent_crc(g_2341, "g_2341", print_hash_value);
+ transparent_crc(g_2575, "g_2575", print_hash_value);
+ transparent_crc(g_2686.f0, "g_2686.f0", print_hash_value);
+ transparent_crc(g_2686.f1, "g_2686.f1", print_hash_value);
+ transparent_crc(g_2686.f2, "g_2686.f2", print_hash_value);
+ transparent_crc(g_2686.f3, "g_2686.f3", print_hash_value);
+ transparent_crc(g_2686.f4, "g_2686.f4", print_hash_value);
+ transparent_crc(g_2898, "g_2898", print_hash_value);
+ platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
+ return 0;
+}
+
+/************************ statistics *************************
+XXX max struct depth: 2
+breakdown:
+ depth: 0, occurrence: 717
+ depth: 1, occurrence: 16
+ depth: 2, occurrence: 33
+XXX total union variables: 30
+
+XXX non-zero bitfields defined in structs: 1
+XXX zero bitfields defined in structs: 1
+XXX const bitfields defined in structs: 0
+XXX volatile bitfields defined in structs: 0
+XXX structs with bitfields in the program: 45
+breakdown:
+ indirect level: 0, occurrence: 33
+ indirect level: 1, occurrence: 8
+ indirect level: 2, occurrence: 4
+XXX full-bitfields structs in the program: 0
+breakdown:
+XXX times a bitfields struct's address is taken: 36
+XXX times a bitfields struct on LHS: 0
+XXX times a bitfields struct on RHS: 66
+XXX times a single bitfield on LHS: 0
+XXX times a single bitfield on RHS: 0
+
+XXX max expression depth: 42
+breakdown:
+ depth: 1, occurrence: 186
+ depth: 2, occurrence: 44
+ depth: 3, occurrence: 2
+ depth: 4, occurrence: 4
+ depth: 5, occurrence: 2
+ depth: 6, occurrence: 3
+ depth: 7, occurrence: 1
+ depth: 11, occurrence: 2
+ depth: 13, occurrence: 1
+ depth: 14, occurrence: 1
+ depth: 16, occurrence: 2
+ depth: 17, occurrence: 1
+ depth: 18, occurrence: 1
+ depth: 19, occurrence: 4
+ depth: 20, occurrence: 4
+ depth: 21, occurrence: 2
+ depth: 22, occurrence: 4
+ depth: 23, occurrence: 4
+ depth: 25, occurrence: 1
+ depth: 27, occurrence: 1
+ depth: 28, occurrence: 2
+ depth: 29, occurrence: 2
+ depth: 30, occurrence: 1
+ depth: 31, occurrence: 1
+ depth: 33, occurrence: 2
+ depth: 41, occurrence: 1
+ depth: 42, occurrence: 1
+
+XXX total number of pointers: 576
+
+XXX times a variable address is taken: 1577
+XXX times a pointer is dereferenced on RHS: 578
+breakdown:
+ depth: 1, occurrence: 540
+ depth: 2, occurrence: 36
+ depth: 3, occurrence: 2
+XXX times a pointer is dereferenced on LHS: 463
+breakdown:
+ depth: 1, occurrence: 432
+ depth: 2, occurrence: 30
+ depth: 3, occurrence: 1
+XXX times a pointer is compared with null: 72
+XXX times a pointer is compared with address of another variable: 17
+XXX times a pointer is compared with another pointer: 25
+XXX times a pointer is qualified to be dereferenced: 11097
+
+XXX max dereference level: 4
+breakdown:
+ level: 0, occurrence: 0
+ level: 1, occurrence: 2473
+ level: 2, occurrence: 250
+ level: 3, occurrence: 21
+ level: 4, occurrence: 4
+XXX number of pointers point to pointers: 214
+XXX number of pointers point to scalars: 326
+XXX number of pointers point to structs: 20
+XXX percent of pointers has null in alias set: 29
+XXX average alias set size: 1.59
+
+XXX times a non-volatile is read: 2782
+XXX times a non-volatile is write: 1303
+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: 8
+
+XXX stmts: 189
+XXX max block depth: 5
+breakdown:
+ depth: 0, occurrence: 32
+ depth: 1, occurrence: 30
+ depth: 2, occurrence: 20
+ depth: 3, occurrence: 30
+ depth: 4, occurrence: 37
+ depth: 5, occurrence: 40
+
+XXX percentage a fresh-made variable is used: 15.4
+XXX percentage an existing variable is used: 84.6
+FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
+********************* end of statistics **********************/
+
diff --git a/tests/fuzz/11.c.txt b/tests/fuzz/11.c.txt
new file mode 100644
index 00000000..d878ac9d
--- /dev/null
+++ b/tests/fuzz/11.c.txt
@@ -0,0 +1 @@
+checksum = F3170034
diff --git a/tests/fuzz/15.c b/tests/fuzz/15.c
new file mode 100644
index 00000000..d84af705
--- /dev/null
+++ b/tests/fuzz/15.c
@@ -0,0 +1,1581 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-packed-struct
+ * Seed: 797096764
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+union U0 {
+ const int16_t f0;
+ int8_t f1;
+ uint32_t f2;
+};
+
+union U1 {
+ uint32_t f0;
+ signed f1 : 23;
+};
+
+union U2 {
+ int32_t f0;
+ const int8_t f1;
+ uint32_t f2;
+ uint64_t f3;
+ const int16_t f4;
+};
+
+/* --- GLOBAL VARIABLES --- */
+static uint8_t g_2 = 0x99L;
+static union U2 g_10[10] = {{0x98764276L},{0xDA7EF5D8L},{0x1AFA9B64L},{0x1AFA9B64L},{0xDA7EF5D8L},{0x98764276L},{0xDA7EF5D8L},{0x1AFA9B64L},{0x1AFA9B64L},{0xDA7EF5D8L}};
+static union U2 *g_9 = &g_10[9];
+static int64_t g_49 = 0x47CDD5376E30F4AELL;
+static uint8_t g_53[6] = {0xA8L,0xA8L,255UL,0xA8L,0xA8L,255UL};
+static union U2 **g_54 = (void*)0;
+static int16_t g_75 = 0xDA77L;
+static int32_t g_89 = 0x94124F91L;
+static int32_t g_92 = (-10L);
+static uint32_t g_93 = 0UL;
+static uint8_t g_101 = 1UL;
+static int32_t g_111[9][9] = {{0xA052AF0DL,(-6L),0x1281BCF5L,(-7L),0xA052AF0DL,(-1L),(-6L),0x453539CAL,(-7L)},{0xD59F121BL,0xADC77BC6L,9L,0x74088AFDL,(-7L),0x0F6EBCB2L,(-7L),0x74088AFDL,9L},{0xA052AF0DL,0xA052AF0DL,(-6L),0x1281BCF5L,(-7L),0xA052AF0DL,(-1L),(-6L),0x453539CAL},{9L,0xADC77BC6L,9L,(-1L),9L,0x74088AFDL,0L,0x74088AFDL,9L},{0x453539CAL,0L,0L,0x453539CAL,0xA052AF0DL,0x1281BCF5L,0L,(-4L),0x453539CAL},{0xD59F121BL,(-1L),(-7L),(-1L),0xD59F121BL,0x0F6EBCB2L,0xC841BEEAL,0xADC77BC6L,0xC841BEEAL},{(-4L),0xA052AF0DL,0x90AFEB5AL,0x90AFEB5AL,0xA052AF0DL,(-4L),(-1L),0x90AFEB5AL,1L},{0x01AA1EC4L,0x0F6EBCB2L,9L,0xADC77BC6L,9L,0x0F6EBCB2L,0x01AA1EC4L,(-1L),0L},{0x453539CAL,(-1L),0x1281BCF5L,(-4L),(-4L),0x1281BCF5L,(-1L),0x453539CAL,(-4L)}};
+static int16_t *g_136[6][10] = {{&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,(void*)0,(void*)0,&g_75,&g_75},{&g_75,&g_75,&g_75,&g_75,(void*)0,&g_75,&g_75,&g_75,(void*)0,&g_75},{&g_75,&g_75,&g_75,(void*)0,&g_75,&g_75,&g_75,&g_75,(void*)0,&g_75},{(void*)0,(void*)0,&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,(void*)0},{&g_75,&g_75,&g_75,&g_75,(void*)0,(void*)0,&g_75,&g_75,&g_75,&g_75},{&g_75,(void*)0,&g_75,(void*)0,(void*)0,(void*)0,&g_75,(void*)0,&g_75,&g_75}};
+static int8_t g_147 = 0x73L;
+static int64_t g_149 = 0x9236ECDBE2488046LL;
+static union U2 g_223 = {0x3CAFA4DCL};
+static union U2 *g_222 = &g_223;
+static union U0 g_226 = {-1L};
+static union U0 *g_225 = &g_226;
+static union U0 g_229[3][1][5] = {{{{0xF0CDL},{1L},{0x1C62L},{0x7D68L},{0x7D68L}}},{{{1L},{0xF0CDL},{1L},{0x1C62L},{0x7D68L}}},{{{0x095AL},{0xCCBBL},{0x7D68L},{0xCCBBL},{0x095AL}}}};
+static union U0 g_231[6][9][4] = {{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}}};
+static uint16_t g_245 = 0xE292L;
+static const uint16_t *g_244 = &g_245;
+static const uint16_t **g_243[4][5][5] = {{{&g_244,&g_244,(void*)0,&g_244,&g_244},{(void*)0,(void*)0,(void*)0,&g_244,&g_244},{&g_244,(void*)0,&g_244,(void*)0,&g_244},{(void*)0,&g_244,(void*)0,(void*)0,(void*)0},{&g_244,&g_244,&g_244,&g_244,(void*)0}},{{&g_244,(void*)0,(void*)0,&g_244,(void*)0},{(void*)0,&g_244,(void*)0,(void*)0,&g_244},{(void*)0,(void*)0,&g_244,&g_244,(void*)0},{&g_244,(void*)0,&g_244,&g_244,&g_244},{&g_244,(void*)0,(void*)0,(void*)0,&g_244}},{{&g_244,&g_244,(void*)0,(void*)0,(void*)0},{&g_244,&g_244,(void*)0,&g_244,&g_244},{&g_244,&g_244,&g_244,&g_244,(void*)0},{(void*)0,&g_244,&g_244,&g_244,&g_244},{(void*)0,&g_244,&g_244,&g_244,&g_244}},{{(void*)0,&g_244,(void*)0,&g_244,(void*)0},{(void*)0,&g_244,&g_244,&g_244,(void*)0},{(void*)0,(void*)0,&g_244,&g_244,&g_244},{(void*)0,(void*)0,&g_244,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&g_244}}};
+static const uint16_t **g_250[3] = {&g_244,&g_244,&g_244};
+static int32_t **g_251[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+static const union U0 g_255 = {0x8343L};
+static const uint64_t g_319 = 1UL;
+static const uint64_t *g_318 = &g_319;
+static uint32_t g_375 = 0x72D6932EL;
+static union U1 g_428[8][1][4] = {{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}}};
+static uint16_t g_444 = 0x21E0L;
+static int8_t g_479 = 0x73L;
+static int16_t g_507 = 0x62B6L;
+static union U2 *** const g_604 = &g_54;
+static int32_t g_627 = 0x6061E963L;
+static int8_t g_706 = (-10L);
+static const union U2 g_814 = {0x1ABBD7A4L};
+static union U0 **g_815 = &g_225;
+static union U0 **g_819 = &g_225;
+static const union U1 *g_902 = &g_428[0][0][2];
+static uint32_t *g_912 = &g_93;
+static uint32_t **g_911 = &g_912;
+static uint8_t *g_931 = &g_2;
+static uint8_t **g_930 = &g_931;
+static int32_t g_1007 = 1L;
+static int32_t ***g_1075 = &g_251[3];
+static int32_t ****g_1074[10] = {&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075};
+static int8_t g_1178 = 1L;
+static uint32_t g_1198[10][6] = {{0x6E30EC80L,1UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,1UL},{0x10B3A749L,18446744073709551615UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,1UL,1UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x74CE00C5L,18446744073709551615UL,18446744073709551615UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,1UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,1UL},{0x10B3A749L,18446744073709551615UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,1UL,1UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x74CE00C5L,18446744073709551615UL,18446744073709551615UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,18446744073709551615UL,18446744073709551615UL}};
+static int32_t g_1232 = 0x71F484AAL;
+static int64_t g_1399[3][1][5] = {{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}},{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}},{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}}};
+static union U1 *g_1459 = &g_428[0][0][2];
+static uint32_t *g_1502 = &g_375;
+static union U1 g_1574[2] = {{4294967286UL},{4294967286UL}};
+static uint64_t g_1582 = 0xDE7693F682AE7AA6LL;
+static int8_t g_1693 = 0x0CL;
+static int64_t g_1695 = 0x84AF5CDD96B38B31LL;
+static uint16_t g_1743 = 0x3C40L;
+static int32_t g_1771 = 0x66C24BEBL;
+static const uint64_t g_1864[2][4][3] = {{{5UL,1UL,1UL},{18446744073709551615UL,0x14DC4E3CB165692BLL,18446744073709551615UL},{5UL,5UL,1UL},{0xE46C208F0BCDDE06LL,0x14DC4E3CB165692BLL,0xE46C208F0BCDDE06LL}},{{5UL,1UL,1UL},{18446744073709551615UL,0x14DC4E3CB165692BLL,18446744073709551615UL},{5UL,5UL,1UL},{0xE46C208F0BCDDE06LL,0x14DC4E3CB165692BLL,0xE46C208F0BCDDE06LL}}};
+static const int32_t *g_1948[8][5][2] = {{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}}};
+static uint16_t * const g_2081 = (void*)0;
+static uint16_t * const *g_2080 = &g_2081;
+static uint16_t * const **g_2079[6][9] = {{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,(void*)0,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080}};
+static uint16_t *g_2110 = &g_444;
+static uint16_t **g_2109 = &g_2110;
+static int32_t g_2120 = 0x6DA12724L;
+static uint16_t *g_2144 = (void*)0;
+static uint32_t * const *g_2212 = (void*)0;
+static union U1 **g_2317[4] = {&g_1459,&g_1459,&g_1459,&g_1459};
+static union U1 ***g_2316 = &g_2317[1];
+
+
+/* --- FORWARD DECLARATIONS --- */
+static uint32_t func_1(void);
+static union U2 * const func_3(union U1 p_4, int16_t p_5);
+static union U1 func_6(union U2 * p_7, const int64_t p_8);
+static const uint64_t func_16(uint64_t p_17, union U1 p_18);
+static union U2 func_20(union U2 * p_21);
+static int8_t func_26(const int64_t p_27, uint32_t p_28, uint64_t p_29, union U2 p_30);
+static uint8_t func_33(union U2 * p_34, uint32_t p_35, union U0 p_36, uint8_t p_37, union U2 * p_38);
+static uint32_t func_40(union U2 * p_41, union U2 ** p_42, union U2 * p_43);
+static int16_t func_66(uint8_t * const p_67, int64_t p_68, union U2 *** const p_69);
+static uint8_t * func_70(int64_t p_71, int32_t p_72, uint8_t * p_73);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_10.f1 g_53 g_54 g_231.f1 g_223.f4 g_318 g_319 g_10 g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_93 g_225 g_226 g_223.f0 g_428.f0 g_223.f3 g_930 g_931 g_627 g_912 g_911 g_1007 g_226.f2 g_244 g_245 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_222 g_223 g_75 g_814.f1 g_902 g_223.f1 g_1232 g_9 g_255.f0 g_1502 g_1574 g_479 g_1695 g_1459 g_229.f0 g_1582 g_507 g_1743 g_1574.f1 g_819 g_2110 g_2144 g_1864 g_223.f2 g_2212 g_2316
+ * writes: g_9 g_49 g_2 g_53 g_706 g_444 g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_226.f2 g_89 g_507 g_479 g_147 g_1198 g_54 g_1399 g_231.f1 g_1502 g_931 g_92 g_1232 g_375 g_10.f3 g_428 g_222 g_1743 g_1695 g_1007 g_10.f2 g_2079 g_2109 g_2120 g_1948 g_223.f2 g_2212
+ */
+static uint32_t func_1(void)
+{ /* block id: 0 */
+ int64_t l_1967[2];
+ uint8_t l_1977[4];
+ uint32_t l_1980 = 1UL;
+ int32_t l_1982 = 0xD67F4E36L;
+ int32_t l_1983 = 0xF965B165L;
+ uint16_t l_1999 = 0x9388L;
+ int32_t l_2011 = 0xE1C04DFFL;
+ int32_t l_2012 = 0xFCA65305L;
+ int32_t l_2013 = 0xADB23608L;
+ int32_t l_2014 = 0x0E5033ACL;
+ int32_t ****l_2054 = &g_1075;
+ uint32_t l_2062 = 0x1B47355CL;
+ const int8_t l_2064 = 0xCCL;
+ uint64_t l_2066[1][3][9] = {{{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL},{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL},{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL}}};
+ int64_t l_2071 = 0L;
+ int32_t l_2099[1][7][8] = {{{0x189E11A8L,5L,0xA01202B2L,5L,(-3L),5L,(-3L),0x33D3B688L},{0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L},{(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL},{(-3L),0x33D3B688L,0x189E11A8L,0x33D3B688L,(-3L),5L,(-3L),0x33D3B688L},{0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L},{(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL},{(-3L),0x33D3B688L,0x189E11A8L,0x33D3B688L,(-3L),5L,(-3L),0x33D3B688L}}};
+ int32_t l_2104 = 3L;
+ uint16_t **l_2111 = &g_2110;
+ int64_t *l_2115 = &g_1399[2][0][3];
+ const int16_t l_2123[10] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)};
+ const uint64_t **l_2168[4];
+ uint32_t ****l_2184 = (void*)0;
+ int64_t l_2198[1];
+ int8_t l_2208 = 5L;
+ uint32_t l_2232 = 18446744073709551612UL;
+ uint32_t l_2239 = 4294967289UL;
+ uint64_t l_2304 = 0UL;
+ int8_t l_2308[10] = {0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL};
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ l_1967[i] = 1L;
+ for (i = 0; i < 4; i++)
+ l_1977[i] = 0x3AL;
+ for (i = 0; i < 4; i++)
+ l_2168[i] = &g_318;
+ for (i = 0; i < 1; i++)
+ l_2198[i] = (-10L);
+ if (g_2)
+ { /* block id: 1 */
+ union U2 **l_1971 = &g_222;
+ int32_t *l_1972 = &g_111[1][3];
+ int64_t *l_1981[4];
+ int16_t *l_1996 = &g_507;
+ uint16_t l_1997 = 4UL;
+ uint16_t *l_1998 = &g_1743;
+ uint64_t l_2000 = 1UL;
+ int i;
+ for (i = 0; i < 4; i++)
+ l_1981[i] = &g_1399[1][0][0];
+ (*l_1971) = func_3(((*g_1459) = func_6((g_9 = (void*)0), g_10[9].f1)), l_1967[0]);
+ l_1972 = l_1972;
+ l_1983 = ((((*g_1459) , (!l_1967[1])) && ((safe_mod_func_uint8_t_u_u((l_1977[1] != (l_1982 = (g_149 = (0x8EL >= ((((safe_sub_func_int32_t_s_s((l_1977[1] < (*l_1972)), ((l_1980 , &g_1075) == &g_1075))) || (*l_1972)) , (*l_1972)) , (**g_930)))))), l_1980)) != l_1967[1])) >= g_111[1][3]);
+ l_2000 |= (((safe_mod_func_uint8_t_u_u((((*l_1998) = (~((((**g_911) = (safe_sub_func_int64_t_s_s((((safe_lshift_func_uint16_t_u_s(0xCB04L, ((*l_1996) |= (3L >= (safe_unary_minus_func_int8_t_s((0L == (((safe_unary_minus_func_uint64_t_u((g_229[0][0][3].f0 & 0x70L))) <= ((safe_mul_func_int8_t_s_s((l_1980 , g_1582), (((*l_1972) | ((*l_1972) <= g_223.f4)) || 4UL))) >= (*g_318))) , (*l_1972))))))))) , l_1967[0]) , g_428[0][0][2].f0), l_1997))) < (*l_1972)) , (*l_1972)))) && (*l_1972)), l_1977[1])) || (*l_1972)) , l_1999);
+ }
+ else
+ { /* block id: 890 */
+ int8_t l_2010 = 0L;
+ int32_t l_2018[9][4][7] = {{{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L}},{{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L}},{{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L}},{{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L}},{{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L}},{{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L}},{{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L}},{{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L}},{{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L}}};
+ uint8_t l_2026 = 0xC8L;
+ int8_t l_2029[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L};
+ const int16_t l_2061 = 0x8AA0L;
+ uint32_t *l_2063 = &g_10[9].f2;
+ uint64_t l_2065 = 7UL;
+ int64_t l_2067 = 1L;
+ uint32_t l_2070 = 18446744073709551615UL;
+ uint16_t *l_2076[4] = {(void*)0,(void*)0,(void*)0,(void*)0};
+ uint16_t **l_2075 = &l_2076[0];
+ uint16_t ***l_2074[9][8] = {{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075}};
+ union U0 l_2096[7] = {{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L}};
+ uint16_t l_2107 = 65534UL;
+ union U2 *l_2156 = &g_10[9];
+ uint64_t *l_2166 = (void*)0;
+ uint64_t **l_2165 = &l_2166;
+ const uint32_t l_2171 = 8UL;
+ union U1 l_2190 = {0xC236650BL};
+ union U1 **l_2204 = &g_1459;
+ union U1 **l_2205 = &g_1459;
+ uint64_t l_2215 = 0x96E9BBDEA25EDF34LL;
+ int16_t l_2227[5][9][5] = {{{0x0EB5L,0x1960L,0x1960L,0x0EB5L,0x6030L},{0xDD4AL,(-1L),7L,7L,0x1FD4L},{0x1960L,(-1L),0xCA87L,1L,0xCA87L},{0xE2CEL,0xE2CEL,0x1FD4L,7L,7L},{0x735EL,0x2B2BL,0x6030L,0x0EB5L,0x1960L},{(-9L),0x1FD4L,1L,0x1FD4L,(-9L)},{2L,0x2B2BL,1L,0x248EL,1L},{7L,0xE2CEL,1L,(-1L),(-1L)},{0x248EL,(-1L),0x248EL,0x2B2BL,1L}},{{1L,(-1L),0xE2CEL,0L,(-9L)},{1L,0x1960L,(-1L),(-1L),0x1960L},{1L,0x8BCEL,0xE2CEL,(-9L),7L},{(-1L),7L,0x248EL,0x6030L,0xCA87L},{(-5L),1L,1L,(-5L),0x1FD4L},{(-1L),(-1L),1L,2L,0x6030L},{1L,0xDD4AL,1L,0xE2CEL,1L},{1L,1L,0x6030L,2L,1L},{1L,0L,0x1FD4L,(-5L),1L}},{{0x248EL,0x6030L,0xCA87L,0x6030L,0x248EL},{7L,0L,7L,(-9L),0xE2CEL},{2L,1L,0x1960L,(-1L),(-1L)},{(-9L),0xDD4AL,(-9L),0L,0xE2CEL},{0x735EL,(-1L),1L,0x2B2BL,0x248EL},{0xE2CEL,1L,(-1L),(-1L),1L},{0x1960L,7L,1L,0x248EL,1L},{0xDD4AL,0x8BCEL,(-9L),0x1FD4L,1L},{0x0EB5L,0x1960L,0x1960L,0x0EB5L,0x6030L}},{{0xDD4AL,(-1L),7L,7L,0x1FD4L},{0x1960L,(-1L),0xCA87L,1L,0xCA87L},{0xE2CEL,0xE2CEL,0x1FD4L,7L,7L},{0x735EL,0x2B2BL,0x6030L,0x0EB5L,0x1960L},{(-9L),0xDD4AL,1L,0xDD4AL,(-1L)},{0x2B2BL,7L,0xCA87L,(-1L),0x6030L},{0L,0x1FD4L,(-5L),1L,1L},{(-1L),2L,(-1L),7L,0x6030L},{(-9L),1L,0x1FD4L,0x8BCEL,(-1L)}},{{0x6030L,0x0EB5L,0x1960L,0x1960L,0x0EB5L},{(-5L),7L,0x1FD4L,(-1L),1L},{2L,1L,(-1L),(-1L),0x735EL},{0xE2CEL,(-5L),(-5L),0xE2CEL,0xDD4AL},{2L,0x1960L,0xCA87L,0x2B2BL,(-1L)},{(-5L),7L,1L,0x1FD4L,1L},{0x6030L,0x6030L,(-1L),0x2B2BL,0xCA87L},{(-9L),0x8BCEL,0xDD4AL,0xE2CEL,(-5L)},{(-1L),(-1L),0x735EL,(-1L),(-1L)}}};
+ int16_t l_2229 = 0xCCBFL;
+ int16_t l_2238[10][5][5] = {{{0x26A1L,0x93F8L,0xCE93L,9L,0xB42DL},{0L,1L,0x34A3L,0L,0L},{9L,(-1L),9L,0x93F8L,0xB42DL},{(-1L),0L,1L,0x5701L,1L},{0xB42DL,0L,0xA442L,0xA442L,0L}},{{0x34A3L,(-1L),1L,1L,(-1L)},{(-1L),(-9L),9L,1L,(-9L)},{0x1869L,0x34A3L,0x34A3L,0x1869L,0x878EL},{(-1L),0xA442L,0xCE93L,0x26A1L,1L},{0x34A3L,0x0254L,0xEC99L,1L,0xEC99L}},{{0xB42DL,0xB42DL,1L,0x26A1L,0xCE93L},{(-1L),0x5701L,0x878EL,0x1869L,0x34A3L},{9L,1L,(-9L),1L,9L},{0L,0x5701L,(-1L),1L,1L},{0x26A1L,0xB42DL,0L,0xA442L,0xA442L}},{{1L,0x0254L,1L,0x5701L,1L},{0x1300L,0xA442L,0xB42DL,0x93F8L,9L},{1L,0x34A3L,0L,0L,0x34A3L},{0L,(-9L),0xB42DL,9L,0xCE93L},{0x0254L,(-1L),1L,0x878EL,0xEC99L}},{{7L,0L,0L,7L,1L},{0x0254L,0L,(-1L),0L,0x878EL},{0L,(-1L),(-9L),0xB42DL,(-9L)},{1L,1L,0x878EL,0L,(-1L)},{0x1300L,0x93F8L,(-1L),0xB42DL,7L}},{{0L,0x0254L,(-1L),0x0254L,0L},{0x93F8L,(-9L),(-9L),0xA442L,1L},{0x5701L,0x878EL,0x1869L,0x34A3L,0x34A3L},{0xA442L,0x26A1L,0xA442L,(-9L),1L},{1L,0x34A3L,0x878EL,(-1L),0L}},{{1L,7L,0L,0L,7L},{0x1869L,(-1L),0x878EL,0L,0xEC99L},{0x26A1L,0xCE93L,0xA442L,(-1L),0x1300L},{1L,0x1869L,0x1869L,1L,0x0254L},{0x26A1L,0L,(-9L),0x93F8L,(-1L)}},{{0x1869L,0L,(-1L),0x878EL,(-1L)},{1L,1L,(-1L),0x93F8L,(-9L)},{1L,(-1L),0x0254L,1L,0x1869L},{0xA442L,(-1L),0x1300L,(-1L),0xA442L},{0x5701L,(-1L),0xEC99L,0L,0x878EL}},{{0x93F8L,1L,7L,0L,0L},{0L,0L,0L,(-1L),0x878EL},{9L,0L,1L,(-9L),0xA442L},{0x878EL,0x1869L,0x34A3L,0x34A3L,0x1869L},{7L,0xCE93L,1L,0xA442L,(-9L)}},{{0L,(-1L),0L,0x0254L,(-1L)},{0xB42DL,7L,7L,0xB42DL,(-1L)},{0L,0x34A3L,0xEC99L,0x5701L,0x0254L},{7L,0x26A1L,0x1300L,1L,0x1300L},{0x878EL,0x878EL,0x0254L,0x5701L,0xEC99L}}};
+ uint32_t l_2271[9];
+ uint64_t l_2305[10] = {0x2AFF29B5EB439595LL,0x31A843976A988D39LL,0x739F945BCAB457C2LL,0x739F945BCAB457C2LL,0x31A843976A988D39LL,0x2AFF29B5EB439595LL,0x31A843976A988D39LL,0x739F945BCAB457C2LL,0x739F945BCAB457C2LL,0x31A843976A988D39LL};
+ int i, j, k;
+ for (i = 0; i < 9; i++)
+ l_2271[i] = 18446744073709551610UL;
+lbl_2214:
+ for (g_1695 = 0; (g_1695 > (-5)); g_1695 = safe_sub_func_int64_t_s_s(g_1695, 1))
+ { /* block id: 893 */
+ int32_t *l_2003 = &l_1982;
+ int32_t *l_2004 = &g_89;
+ int32_t l_2005 = 0x4B4F5FC8L;
+ int32_t *l_2006 = &l_1983;
+ int32_t *l_2007 = &g_89;
+ int32_t *l_2008 = &g_1232;
+ int32_t *l_2009[3];
+ uint64_t l_2015 = 8UL;
+ int32_t l_2019 = 8L;
+ int32_t l_2020 = 0x34E658EBL;
+ uint32_t l_2021 = 0UL;
+ uint16_t *l_2034 = &g_444;
+ uint16_t *l_2037 = &g_1743;
+ int32_t *l_2038 = &g_1007;
+ int32_t *l_2039 = &g_223.f0;
+ int i;
+ for (i = 0; i < 3; i++)
+ l_2009[i] = &g_1232;
+ l_2015++;
+ --l_2021;
+ (*l_2008) |= (safe_add_func_int64_t_s_s(((((l_2026 ^= 0x41L) & l_1977[2]) < ((*l_2003) && (l_2029[2] & (((safe_sub_func_int8_t_s_s((+(*l_2003)), ((safe_mul_func_uint16_t_u_u(((*l_2037) |= (++(*l_2034))), 0x45A3L)) < ((((*l_2039) = ((*l_2038) = g_92)) , (*l_2003)) ^ (l_1999 , g_1574[1].f1))))) , (void*)0) != (void*)0)))) <= 0x9A7C15D3L), l_1977[1]));
+ if (l_2018[3][2][5])
+ continue;
+ }
+ if (((safe_div_func_uint16_t_u_u((255UL > (safe_lshift_func_int16_t_s_s((l_2029[2] ^ (((((safe_rshift_func_uint16_t_u_s((0x41132324FECFB523LL > ((safe_lshift_func_uint16_t_u_s((0L && ((((**g_819) , ((safe_add_func_int64_t_s_s(g_1198[5][5], (safe_mul_func_int8_t_s_s((((*l_2063) = (safe_add_func_int32_t_s_s((&g_1075 == l_2054), (safe_rshift_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((!(safe_mod_func_int64_t_s_s((((*g_318) >= l_2018[3][2][5]) >= 4294967287UL), l_2061))), 0x8EL)), l_2062))))) , l_2064), 0x8CL)))) ^ l_2029[2])) >= l_1982) | l_2065)), l_1967[1])) , l_2066[0][1][6])), 8)) > l_2026) , l_1977[3]) >= (*g_1502)) , l_2067)), 15))), l_2010)) || l_2018[3][2][5]))
+ { /* block id: 905 */
+ int32_t l_2068 = 3L;
+ int32_t *l_2069[9][7] = {{&l_2018[3][2][5],&l_2013,&l_2012,&l_2012,&l_2013,&l_2018[3][2][5],&l_2013},{&g_111[1][3],&l_1982,&l_2012,&g_1232,(void*)0,&g_1232,&l_2012},{&l_2013,&l_2013,&l_2018[3][2][5],&l_2012,&l_2018[3][2][5],&l_2013,&l_2013},{&l_1982,&l_1982,&l_2013,&l_1982,&l_1982,&g_1232,&l_2012},{&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3],&l_2013},{&l_2012,(void*)0,&l_2013,&l_2014,(void*)0,&l_1982,(void*)0},{&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5]},{&l_1982,&g_1232,&l_2012,(void*)0,&g_111[1][3],&l_1982,&l_2012},{&l_2018[3][2][5],&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3]}};
+ int32_t l_2105 = 0L;
+ uint64_t l_2106 = 18446744073709551611UL;
+ uint16_t **l_2108 = &l_2076[0];
+ int16_t *l_2134 = &g_75;
+ int64_t l_2172 = (-1L);
+ int16_t l_2221 = 1L;
+ int32_t l_2230 = (-10L);
+ int8_t l_2237 = 0x72L;
+ int32_t l_2286 = 1L;
+ int i, j;
+ l_2070 = l_2068;
+ if (l_2071)
+ { /* block id: 907 */
+ uint16_t * const *l_2078[4][10][6] = {{{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],(void*)0,&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[1]},{&l_2076[0],(void*)0,&l_2076[0],&l_2076[0],(void*)0,&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[2],&l_2076[0],(void*)0,&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[1],(void*)0,&l_2076[3],&l_2076[0],(void*)0},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[3]},{&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[1],&l_2076[1],&l_2076[0],(void*)0,(void*)0}},{{&l_2076[1],&l_2076[1],(void*)0,&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[1],&l_2076[3]},{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{(void*)0,&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3]},{&l_2076[3],(void*)0,&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[0],(void*)0,&l_2076[0],&l_2076[2],(void*)0},{&l_2076[3],&l_2076[0],&l_2076[1],(void*)0,(void*)0,&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[3],&l_2076[3]},{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0]}},{{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[3],(void*)0},{&l_2076[3],&l_2076[0],(void*)0,&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[2],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],(void*)0,&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[2],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[1]},{&l_2076[2],(void*)0,&l_2076[2],&l_2076[0],&l_2076[0],&l_2076[0]}},{{&l_2076[3],&l_2076[0],&l_2076[3],(void*)0,(void*)0,&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[0],(void*)0,&l_2076[0],(void*)0},{&l_2076[3],&l_2076[0],&l_2076[0],(void*)0,&l_2076[3],&l_2076[0]},{&l_2076[3],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1]},{&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[1],&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[2],&l_2076[0],&l_2076[0],(void*)0},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[1],&l_2076[0]},{&l_2076[0],&l_2076[0],(void*)0,&l_2076[2],(void*)0,&l_2076[0]},{(void*)0,&l_2076[3],&l_2076[1],&l_2076[0],(void*)0,(void*)0}}};
+ uint16_t * const **l_2077[9];
+ union U1 l_2097 = {4294967287UL};
+ int64_t *l_2098[5][10] = {{&l_1967[0],&g_1399[2][0][3],(void*)0,&l_2071,(void*)0,&g_1399[2][0][3],&l_1967[0],&l_1967[0],&g_1399[2][0][3],(void*)0},{&g_1399[2][0][3],&l_1967[0],&l_1967[0],&g_1399[2][0][3],(void*)0,&l_2071,(void*)0,&g_1399[2][0][3],&l_1967[0],&l_1967[0]},{(void*)0,&l_1967[0],&l_1967[0],&l_2071,&l_2071,&l_1967[0],&l_1967[0],(void*)0,&l_1967[0],&l_1967[0]},{&l_2071,&g_1399[2][0][3],&l_2071,&g_1399[2][0][3],&l_2071,&l_1967[0],&l_1967[0],&l_2071,&g_1399[2][0][3],&l_2071},{(void*)0,(void*)0,&l_2071,&l_2071,&g_1399[2][0][3],&l_2071,&l_2071,(void*)0,(void*)0,&l_2071}};
+ int16_t *l_2100 = &g_75;
+ int16_t *l_2101 = (void*)0;
+ int16_t *l_2102 = (void*)0;
+ int16_t *l_2103[4][8] = {{(void*)0,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507},{&g_507,&g_507,&g_507,&g_507,(void*)0,(void*)0,&g_507,&g_507},{&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,(void*)0},{&g_507,&g_507,&g_507,(void*)0,(void*)0,(void*)0,(void*)0,&g_507}};
+ int64_t **l_2112 = &l_2098[4][0];
+ int64_t **l_2113 = (void*)0;
+ int64_t *l_2114 = &l_2071;
+ int16_t l_2133 = 0x534CL;
+ int i, j, k;
+ for (i = 0; i < 9; i++)
+ l_2077[i] = &l_2078[3][8][1];
+ l_2097.f1 = ((safe_sub_func_uint8_t_u_u((((*g_225) , (((void*)0 == &g_319) | ((l_2104 &= (((g_93 && 254UL) , ((l_2074[2][7] == (g_2079[3][8] = l_2077[8])) != (~l_2018[2][1][2]))) , ((*l_2100) = (((safe_mod_func_int32_t_s_s(((safe_mul_func_uint8_t_u_u((((safe_rshift_func_int8_t_s_u(((safe_mul_func_uint8_t_u_u(((l_2018[3][2][5] = ((safe_lshift_func_uint16_t_u_s((safe_sub_func_uint16_t_u_u((safe_sub_func_uint64_t_u_u(((l_2096[3] , l_2097) , l_2097.f0), 1L)), l_2097.f1)), 12)) <= 0x6B0AE9BDFA119AC2LL)) && 0xE2F6AABA98EB6A18LL), g_1198[8][5])) , l_2097.f0), 3)) > l_2097.f0) , 255UL), 0xAAL)) < l_2099[0][4][2]), l_2061)) == l_2026) ^ 0xABAFL)))) , (**g_930)))) > l_2097.f1), l_2105)) == l_2106);
+ l_2014 = (l_2018[3][2][5] = (l_2099[0][4][2] != (l_2107 , (((g_2109 = l_2108) != l_2111) < ((**g_930) = (4UL <= ((((*l_2112) = l_2098[1][5]) == (l_2115 = (l_2114 = &g_1399[0][0][0]))) != ((g_2120 = (safe_sub_func_int64_t_s_s(l_2065, (safe_div_func_uint16_t_u_u(l_2065, l_2067))))) == l_2097.f1))))))));
+ l_1982 ^= (safe_lshift_func_uint16_t_u_u(l_2123[6], 14));
+ if ((safe_lshift_func_uint16_t_u_u((--(*g_2110)), l_2070)))
+ { /* block id: 923 */
+ int8_t l_2130 = 0xA8L;
+ int16_t **l_2135 = &l_2100;
+ int32_t l_2138 = 0x0DE8473CL;
+ l_2138 ^= ((safe_sub_func_uint64_t_u_u(((l_2130 | (safe_lshift_func_int8_t_s_s(g_706, 1))) >= (l_2133 == (((*l_2135) = l_2134) == &g_75))), (safe_sub_func_int16_t_s_s(1L, 0x844EL)))) && l_2018[4][2][3]);
+ }
+ else
+ { /* block id: 926 */
+ for (l_2013 = 0; (l_2013 <= 9); l_2013 += 1)
+ { /* block id: 929 */
+ return g_223.f4;
+ }
+ for (l_2014 = 25; (l_2014 == (-20)); l_2014 = safe_sub_func_int32_t_s_s(l_2014, 4))
+ { /* block id: 934 */
+ uint32_t l_2143 = 4294967289UL;
+ l_2143 = ((safe_sub_func_uint32_t_u_u((*g_1502), (l_2070 | l_2097.f1))) < l_2010);
+ }
+ l_2097.f1 = 0L;
+ }
+ }
+ else
+ { /* block id: 939 */
+ int8_t *l_2149 = (void*)0;
+ int8_t *l_2150 = &g_479;
+ int8_t *l_2151 = (void*)0;
+ int8_t *l_2152[4][9] = {{&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1},{&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1},{&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1},{&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1}};
+ int32_t l_2153 = 0x98A48BC2L;
+ uint64_t ***l_2167 = &l_2165;
+ uint32_t ***l_2182 = &g_911;
+ uint32_t ****l_2181 = &l_2182;
+ uint8_t l_2199 = 0xADL;
+ int32_t l_2216 = 0xFB679376L;
+ int32_t l_2220 = 0xC71D761AL;
+ int32_t l_2223 = 0xB664C4E1L;
+ int32_t l_2228[10] = {7L,0L,5L,0L,7L,7L,0L,5L,0L,7L};
+ int8_t l_2231[6][6][4] = {{{0L,0x8DL,0x8DL,0x98L},{0x62L,0x06L,1L,0x83L},{0x97L,0x99L,0x31L,0xBBL},{0L,1L,0x17L,0xBBL},{0x9FL,0x99L,0L,0x83L},{(-9L),0x06L,0xD0L,0x98L}},{{0x47L,4L,0x97L,(-9L)},{0x99L,8L,1L,0x8AL},{0x06L,0x17L,0x74L,0xABL},{0xFDL,0x83L,0x83L,7L},{4L,0x31L,0L,(-9L)},{1L,0x83L,1L,(-1L)}},{{(-1L),0L,(-1L),0x9FL},{0x8AL,0L,0x83L,(-6L)},{0x1BL,(-9L),0L,0L},{(-6L),0L,0L,0xD0L},{0x1BL,1L,0x83L,4L},{0x8AL,(-10L),(-1L),(-9L)}},{{(-1L),(-9L),1L,0xFDL},{1L,0x98L,0L,0x17L},{4L,0L,0x83L,0x62L},{0xFDL,8L,0x74L,1L},{0x06L,0x1BL,1L,1L},{0x99L,(-9L),0x97L,0x97L}},{{0x47L,0x47L,0xD0L,0L},{(-9L),(-1L),0L,0x06L},{0x9FL,0x97L,0x17L,0L},{0L,0x97L,0x31L,0x06L},{0x97L,(-1L),1L,0L},{0x62L,0x47L,4L,0x97L}},{{0x98L,(-9L),0x62L,1L},{0x17L,0x1BL,(-9L),1L},{7L,8L,0x9FL,0x62L},{(-1L),0L,1L,0x17L},{8L,0x98L,7L,0xFDL},{(-10L),(-9L),(-6L),(-9L)}}};
+ int i, j, k;
+ l_2018[3][2][5] ^= (0x7276L <= ((void*)0 != g_2144));
+ l_1982 = (safe_rshift_func_int8_t_s_u((l_2153 = ((*l_2150) = ((safe_mod_func_uint64_t_u_u((*g_318), 18446744073709551613UL)) != g_231[2][3][1].f1))), 0));
+ if ((((g_9 = l_2156) == (void*)0) < ((((((g_319 , (((*g_2110) = (safe_div_func_int64_t_s_s(((g_444 , (((safe_rshift_func_uint8_t_u_u((*g_931), 3)) , ((safe_lshift_func_uint16_t_u_u(((((!g_319) >= ((((*l_2167) = l_2165) != l_2168[3]) < (safe_add_func_int32_t_s_s(0x4BE7EAE3L, 0xE2FB1C89L)))) | 18446744073709551615UL) , l_2153), l_2153)) == 0UL)) , l_2026)) > 0xD9F5L), g_1864[1][2][0]))) >= l_2171)) < g_319) , (-5L)) || l_2172) ^ 0x99E19607FCAEFB6CLL) != l_2065)))
+ { /* block id: 947 */
+ for (g_375 = 0; (g_375 <= 0); g_375 += 1)
+ { /* block id: 950 */
+ uint64_t l_2173 = 0x7E0A1EE474B83E5FLL;
+ --l_2173;
+ }
+ for (l_2070 = 0; (l_2070 <= 1); l_2070 += 1)
+ { /* block id: 955 */
+ union U2 *l_2178 = &g_223;
+ uint32_t *****l_2183 = &l_2181;
+ int16_t *l_2187 = &g_507;
+ uint16_t **l_2188 = &l_2076[2];
+ int32_t l_2189 = 0L;
+ union U2 **l_2191 = &g_9;
+ int i;
+ if (l_1967[l_2070])
+ break;
+ l_2018[3][2][5] = ((**g_930) | 1UL);
+ }
+ for (l_2068 = 0; l_2068 < 8; l_2068 += 1)
+ {
+ for (g_375 = 0; g_375 < 5; g_375 += 1)
+ {
+ for (l_2012 = 0; l_2012 < 2; l_2012 += 1)
+ {
+ g_1948[l_2068][g_375][l_2012] = &l_1982;
+ }
+ }
+ }
+ }
+ else
+ { /* block id: 968 */
+ int32_t *l_2200 = (void*)0;
+ int32_t l_2217 = 0x4FE96332L;
+ int32_t l_2218 = (-10L);
+ int32_t l_2219 = 0x079E3D68L;
+ int32_t l_2222[5];
+ uint32_t l_2224 = 0x695369B6L;
+ int i;
+ for (i = 0; i < 5; i++)
+ l_2222[i] = 0x0EC35639L;
+ if (((safe_mod_func_uint8_t_u_u(l_1999, (safe_mul_func_uint8_t_u_u((*g_931), (safe_lshift_func_int16_t_s_s((-3L), 5)))))) , l_2198[0]))
+ { /* block id: 969 */
+ return l_2199;
+ }
+ else
+ { /* block id: 971 */
+ int32_t **l_2201 = &l_2200;
+ (*l_2201) = l_2200;
+ l_2208 ^= (((safe_lshift_func_int16_t_s_s(((*l_2134) &= ((l_2204 = &g_1459) == l_2205)), 11)) <= (l_2070 <= (safe_rshift_func_int16_t_s_u(0xCB44L, 15)))) , (~0xF110CC3CL));
+ }
+ for (g_223.f2 = (-12); (g_223.f2 == 7); g_223.f2++)
+ { /* block id: 979 */
+ int16_t l_2211 = 1L;
+ uint32_t * const **l_2213 = &g_2212;
+ l_2153 = l_2211;
+ l_2153 = (0x968C6B2DL & (((*l_2213) = g_2212) != (void*)0));
+ if (g_627)
+ goto lbl_2214;
+ if (l_2215)
+ continue;
+ }
+ ++l_2224;
+ }
+ ++l_2232;
+ }
+ for (g_147 = 2; (g_147 != (-18)); g_147 = safe_sub_func_int16_t_s_s(g_147, 9))
+ { /* block id: 992 */
+ int32_t l_2249 = (-4L);
+ int32_t l_2267 = 0x9D46F976L;
+ int32_t l_2268[10] = {0x5F78B802L,0L,0L,0L,0L,0x5F78B802L,0L,0L,0L,0L};
+ int i;
+ --l_2239;
+ }
+ }
+ else
+ { /* block id: 1030 */
+ const int32_t l_2313[7][8][4] = {{{0L,0xC17774FEL,0x22684D08L,(-1L)},{(-5L),0xCB537E5CL,0xCF8749F9L,0x5B8E73CDL},{0x24574F0DL,0x0B1950AEL,0x37612EECL,0x5B8E73CDL},{0xD050476FL,0xCB537E5CL,0x549F2490L,(-1L)},{8L,0xC17774FEL,4L,0xCB537E5CL},{(-1L),(-4L),0L,0x24574F0DL},{0x22684D08L,0x72EECBFFL,0x549F2490L,7L},{0x6AEDCBCAL,(-5L),1L,(-5L)}},{{0x24574F0DL,0x549F2490L,0xD050476FL,0xC17774FEL},{0x549F2490L,0x72EECBFFL,0x22684D08L,0x9AA1FD11L},{(-4L),0x6DDE5AC8L,0x5B8E73CDL,(-4L)},{(-4L),4L,1L,(-1L)},{0xD168EDB2L,(-4L),1L,5L},{7L,(-1L),0xC17774FEL,0x549F2490L},{0x22684D08L,0x2E56501BL,0xD168EDB2L,(-1L)},{1L,0L,0x2E56501BL,0x2E56501BL}},{{0x6DDE5AC8L,0x6DDE5AC8L,(-1L),7L},{0x37612EECL,0xCF8749F9L,0xD168EDB2L,0L},{1L,0x0B1950AEL,0x9AA1FD11L,0xD168EDB2L},{7L,0x0B1950AEL,8L,0L},{0x0B1950AEL,0xCF8749F9L,1L,7L},{0x2E56501BL,0x6DDE5AC8L,(-1L),0x2E56501BL},{(-4L),0L,0x24574F0DL,(-1L)},{0x0B1950AEL,0x2E56501BL,1L,0x549F2490L}},{{0x9AA1FD11L,(-1L),0x9AA1FD11L,5L},{0x22684D08L,(-4L),0L,(-1L)},{0x37612EECL,4L,0x2E56501BL,(-4L)},{(-1L),0x6DDE5AC8L,0x2E56501BL,0x9AA1FD11L},{0x37612EECL,0xD050476FL,0L,0L},{0x22684D08L,0xD168EDB2L,0x9AA1FD11L,0x0B1950AEL},{0x9AA1FD11L,0x0B1950AEL,1L,4L},{0x0B1950AEL,0xD050476FL,0x24574F0DL,7L}},{{(-4L),(-1L),(-1L),(-4L)},{0x2E56501BL,0L,1L,(-8L)},{0x0B1950AEL,(-4L),8L,0x549F2490L},{7L,0x247ABAC3L,0x9AA1FD11L,0x549F2490L},{1L,(-4L),0xD168EDB2L,(-8L)},{0x37612EECL,0L,(-1L),(-4L)},{0x6DDE5AC8L,(-1L),0x2E56501BL,7L},{1L,0xD050476FL,0xD168EDB2L,4L}},{{0x22684D08L,0x0B1950AEL,0xC17774FEL,0x0B1950AEL},{7L,0xD168EDB2L,1L,0L},{0xD168EDB2L,0xD050476FL,1L,0x9AA1FD11L},{(-4L),0x6DDE5AC8L,0x5B8E73CDL,(-4L)},{(-4L),4L,1L,(-1L)},{0xD168EDB2L,(-4L),1L,5L},{7L,(-1L),0xC17774FEL,0x549F2490L},{0x22684D08L,0x2E56501BL,0xD168EDB2L,(-1L)}},{{1L,0L,0x2E56501BL,0x2E56501BL},{0x6DDE5AC8L,0x6DDE5AC8L,(-1L),7L},{0x37612EECL,0xCF8749F9L,0xD168EDB2L,0L},{1L,0x0B1950AEL,0x9AA1FD11L,0xD168EDB2L},{7L,0x0B1950AEL,8L,0L},{0x0B1950AEL,0xCF8749F9L,1L,7L},{0x2E56501BL,0x6DDE5AC8L,(-1L),0x2E56501BL},{(-4L),0L,0x24574F0DL,(-1L)}}};
+ union U1 ***l_2318 = &g_2317[2];
+ uint8_t *l_2319 = &l_2026;
+ uint32_t l_2320 = 18446744073709551615UL;
+ int i, j, k;
+ if (((safe_div_func_int8_t_s_s((&g_149 != (void*)0), ((((((safe_add_func_uint64_t_u_u((l_2313[5][1][3] , ((((l_2305[3] >= ((*g_318) ^ (safe_rshift_func_uint16_t_u_u((g_2316 != l_2318), 6)))) < l_2313[5][1][3]) , l_2319) == &l_1977[3])), 0x27D3C5AEB2740B3BLL)) & 0L) <= l_2313[5][1][3]) > l_2313[5][1][3]) & l_2320) | (*g_318)))) , l_2313[5][1][3]))
+ { /* block id: 1031 */
+ int32_t *l_2321 = &l_2012;
+ if (l_2010)
+ goto lbl_2214;
+ (*l_2321) |= 0x8BD5E6EBL;
+ (*l_2321) &= 0x7E3A8021L;
+ }
+ else
+ { /* block id: 1035 */
+ int32_t *l_2323[1][1][10] = {{{&l_2012,(void*)0,(void*)0,&l_2012,(void*)0,(void*)0,(void*)0,&g_111[6][3],&g_111[6][3],(void*)0}}};
+ int32_t **l_2322 = &l_2323[0][0][1];
+ int i, j, k;
+ (*l_2322) = &l_2018[5][0][0];
+ return g_101;
+ }
+ return g_93;
+ }
+ }
+ return g_1232;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static union U2 * const func_3(union U1 p_4, int16_t p_5)
+{ /* block id: 878 */
+ int32_t *l_1968[4][3][10] = {{{&g_89,&g_111[3][5],&g_111[7][8],&g_111[3][5],&g_89,&g_92,(void*)0,(void*)0,&g_111[1][5],&g_111[1][3]},{&g_111[3][5],&g_89,&g_92,(void*)0,&g_111[1][3],&g_89,&g_111[0][6],(void*)0,&g_92,&g_111[1][3]},{&g_111[1][3],(void*)0,&g_111[7][7],&g_92,&g_89,&g_111[7][8],&g_89,&g_89,&g_111[7][8],&g_89}},{{(void*)0,(void*)0,(void*)0,(void*)0,&g_92,&g_111[0][6],&g_1232,&g_89,(void*)0,&g_111[3][5]},{&g_111[1][3],&g_111[1][3],&g_111[3][5],&g_1232,&g_89,(void*)0,(void*)0,&g_1232,(void*)0,&g_111[1][3]},{(void*)0,&g_92,&g_111[1][3],(void*)0,&g_111[7][8],&g_92,(void*)0,&g_92,&g_111[7][8],(void*)0}},{{&g_111[1][5],&g_89,&g_111[1][5],&g_92,&g_111[0][6],(void*)0,&g_111[1][3],&g_1232,&g_92,&g_111[1][3]},{&g_1232,&g_89,&g_111[0][6],(void*)0,(void*)0,&g_111[1][3],&g_92,&g_1232,&g_111[1][5],(void*)0},{(void*)0,&g_111[0][6],&g_111[1][5],&g_111[3][5],&g_92,&g_1232,&g_1232,&g_92,&g_111[3][5],&g_111[1][5]}},{{&g_92,&g_92,&g_111[1][3],(void*)0,(void*)0,&g_111[3][5],&g_111[1][3],&g_1232,&g_89,&g_1232},{&g_89,&g_111[7][7],&g_111[3][5],&g_111[0][6],&g_111[1][3],&g_111[1][3],&g_111[1][3],&g_89,(void*)0,(void*)0},{&g_111[6][8],&g_92,(void*)0,&g_89,&g_1232,&g_1232,&g_1232,&g_89,(void*)0,&g_92}}};
+ int32_t **l_1969 = &l_1968[1][0][7];
+ union U2 * const l_1970 = &g_223;
+ int i, j, k;
+ (*l_1969) = l_1968[3][2][3];
+ return l_1970;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_53 g_54 g_231.f1 g_223.f4 g_318 g_319 g_10 g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_93 g_225 g_226 g_223.f0 g_428.f0 g_223.f3 g_930 g_931 g_627 g_912 g_911 g_1007 g_226.f2 g_244 g_245 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_222 g_223 g_75 g_814.f1 g_902 g_223.f1 g_1232 g_9 g_255.f0 g_1502 g_1574 g_479 g_1695
+ * writes: g_9 g_49 g_2 g_53 g_706 g_444 g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_226.f2 g_89 g_507 g_479 g_147 g_1198 g_54 g_1399 g_231.f1 g_1502 g_931 g_92 g_1232 g_375 g_10.f3
+ */
+static union U1 func_6(union U2 * p_7, const int64_t p_8)
+{ /* block id: 3 */
+ int16_t l_13[5][4][3] = {{{0xF903L,1L,0xF6B3L},{0x35D5L,0L,(-1L)},{(-1L),(-1L),0x6B5BL},{1L,(-1L),0xD9DCL}},{{0L,0L,(-1L)},{0xAF87L,1L,8L},{(-1L),0L,(-1L)},{0x713EL,0xD9DCL,0xD9DCL}},{{(-1L),0xF903L,0x6B5BL},{(-1L),0x6B5BL,(-1L)},{0x713EL,1L,0xF6B3L},{(-1L),0xAF87L,1L}},{{0xAF87L,1L,0x35D5L},{0L,0x6B5BL,0L},{1L,0xF903L,0L},{(-1L),0xD9DCL,0x35D5L}},{{0x35D5L,0L,1L},{0xF903L,1L,0xF6B3L},{0x35D5L,0L,(-1L)},{(-1L),(-1L),0x6B5BL}}};
+ union U2 *l_19 = &g_10[0];
+ union U2 **l_39 = &g_9;
+ union U1 l_44 = {0UL};
+ union U1 *l_45 = &l_44;
+ int64_t *l_48 = &g_49;
+ uint8_t *l_50 = &g_2;
+ uint8_t *l_51 = (void*)0;
+ uint8_t *l_52 = &g_53[1];
+ union U0 l_675[7][2] = {{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}}};
+ union U1 l_1377 = {1UL};
+ uint16_t ***l_1529 = (void*)0;
+ uint16_t **** const l_1528[1] = {&l_1529};
+ int32_t *l_1542 = (void*)0;
+ int32_t *l_1550 = &g_1232;
+ int8_t *l_1555[8];
+ uint64_t *l_1556 = &g_10[9].f3;
+ uint64_t *l_1557[3];
+ int16_t ** const l_1561 = &g_136[1][4];
+ int32_t l_1672 = 0xE1877820L;
+ int32_t l_1673 = 5L;
+ int16_t l_1674 = 0xF8F5L;
+ int32_t l_1675 = (-10L);
+ int32_t l_1676 = 0xEAAD7C91L;
+ int32_t l_1677[7][2] = {{0L,0L},{0L,0L},{0L,7L},{0L,0L},{0L,0L},{0L,0L},{7L,0L}};
+ int8_t l_1691[1];
+ int32_t l_1694 = 1L;
+ int32_t l_1697 = (-9L);
+ int16_t l_1698 = (-1L);
+ uint32_t l_1699 = 0xEC9D5EB3L;
+ uint8_t l_1731 = 6UL;
+ union U2 l_1738 = {1L};
+ uint32_t ***l_1778 = &g_911;
+ union U1 **l_1828 = &l_45;
+ union U1 ***l_1827 = &l_1828;
+ uint32_t l_1855 = 9UL;
+ const uint64_t *l_1863 = &g_1864[1][0][1];
+ union U2 ***l_1904 = &g_54;
+ union U2 ****l_1903 = &l_1904;
+ int32_t l_1911[2][6][2] = {{{0x3EBE484EL,0x9E187370L},{3L,0x9E187370L},{0x3EBE484EL,3L},{1L,1L},{1L,3L},{0x3EBE484EL,0x9E187370L}},{{3L,0x9E187370L},{0x3EBE484EL,3L},{1L,1L},{1L,3L},{0x3EBE484EL,0x9E187370L},{3L,0x9E187370L}}};
+ union U0 l_1940 = {0xFC0AL};
+ uint64_t l_1951 = 18446744073709551613UL;
+ int i, j, k;
+ for (i = 0; i < 8; i++)
+ l_1555[i] = &g_229[0][0][3].f1;
+ for (i = 0; i < 3; i++)
+ l_1557[i] = &g_223.f3;
+ for (i = 0; i < 1; i++)
+ l_1691[i] = (-2L);
+ if ((safe_mul_func_uint8_t_u_u(0x1AL, (l_13[1][0][1] & (safe_div_func_uint64_t_u_u(func_16((g_2 , (l_13[3][2][0] <= (l_19 == (func_20(((safe_mul_func_int16_t_s_s(((safe_mod_func_int8_t_s_s(func_26((func_33(((*l_39) = &g_10[9]), func_40((((*l_52) &= ((*l_50) = (!((((l_13[1][0][1] >= (((*l_45) = l_44) , ((safe_mod_func_int64_t_s_s(((*l_48) = (&g_10[1] == l_19)), p_8)) && l_13[1][0][2]))) , l_13[2][2][1]) ^ 0x68L) > l_13[3][0][2])))) , (void*)0), g_54, p_7), l_675[6][1], l_13[3][0][2], l_19) <= 0UL), g_223.f4, (*g_318), (*l_19)), p_8)) <= p_8), 0x6D7BL)) , p_7)) , (void*)0)))), l_1377), 0xC3FDE676F061A725LL))))))
+ { /* block id: 645 */
+ int16_t l_1486 = 0x7754L;
+ uint8_t **l_1493 = &g_931;
+ uint32_t *l_1500 = &l_1377.f0;
+ uint32_t **l_1501[7][5][6] = {{{&l_1500,&g_912,&l_1500,&l_1500,(void*)0,(void*)0},{(void*)0,&g_912,&g_912,&l_1500,&l_1500,&g_912},{&l_1500,&l_1500,&l_1500,&l_1500,&l_1500,(void*)0},{&l_1500,(void*)0,(void*)0,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,(void*)0,&g_912,&l_1500,(void*)0}},{{&l_1500,&g_912,&l_1500,(void*)0,&l_1500,&g_912},{(void*)0,&l_1500,&g_912,&l_1500,&g_912,(void*)0},{&g_912,&l_1500,&l_1500,&l_1500,&l_1500,&l_1500},{&l_1500,&g_912,&g_912,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,&g_912,&g_912,(void*)0,(void*)0}},{{&l_1500,&l_1500,&l_1500,&g_912,(void*)0,&g_912},{(void*)0,&g_912,&l_1500,&g_912,&l_1500,&l_1500},{(void*)0,&l_1500,&l_1500,&g_912,&g_912,&g_912},{&g_912,&l_1500,&g_912,&g_912,&l_1500,&g_912},{&g_912,&g_912,&g_912,&g_912,&l_1500,&l_1500}},{{(void*)0,&l_1500,&l_1500,&g_912,(void*)0,&g_912},{(void*)0,(void*)0,&g_912,&g_912,&l_1500,&l_1500},{&g_912,&l_1500,&l_1500,&g_912,&l_1500,&g_912},{&g_912,&g_912,(void*)0,&g_912,(void*)0,&g_912},{(void*)0,&g_912,&g_912,&g_912,(void*)0,&g_912}},{{(void*)0,&g_912,&l_1500,&g_912,&l_1500,(void*)0},{&l_1500,&g_912,(void*)0,&g_912,&l_1500,(void*)0},{&l_1500,&g_912,&l_1500,&g_912,&l_1500,&g_912},{&l_1500,(void*)0,&g_912,&l_1500,&g_912,&g_912},{&g_912,&l_1500,&l_1500,&g_912,&l_1500,&l_1500}},{{(void*)0,&l_1500,&l_1500,(void*)0,(void*)0,&g_912},{&g_912,&g_912,&g_912,&l_1500,&g_912,&g_912},{&l_1500,&l_1500,&g_912,(void*)0,&g_912,&l_1500},{&l_1500,&g_912,&g_912,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,(void*)0,(void*)0,&l_1500,&l_1500}},{{&l_1500,&l_1500,(void*)0,&g_912,&l_1500,&g_912},{&l_1500,(void*)0,&l_1500,&g_912,(void*)0,&g_912},{&l_1500,&g_912,&l_1500,&g_912,&l_1500,&l_1500},{&g_912,&g_912,(void*)0,&g_912,&g_912,&g_912},{&l_1500,&g_912,(void*)0,&g_912,&l_1500,&l_1500}}};
+ int i, j, k;
+ l_1486 &= ((void*)0 == &g_931);
+ l_1377.f1 ^= (l_44.f1 &= ((safe_lshift_func_int8_t_s_u((safe_lshift_func_uint16_t_u_u((safe_div_func_uint64_t_u_u(((void*)0 != l_1493), ((safe_add_func_int16_t_s_s((safe_rshift_func_uint8_t_u_u((safe_add_func_int32_t_s_s(0xFC0D237BL, (((*g_911) == (g_1502 = l_1500)) , (l_1486 == (((*g_902) , (((void*)0 != l_1500) < p_8)) , 0L))))), (**g_930))), l_1486)) , g_1007))), p_8)), (*g_931))) & p_8));
+ }
+ else
+ { /* block id: 650 */
+ int8_t l_1503 = (-1L);
+ int8_t *l_1530 = (void*)0;
+ int32_t *l_1531 = &g_92;
+ int32_t *l_1532 = &g_1232;
+ union U1 l_1537 = {0x0E8069F6L};
+ (*l_1532) |= ((1L ^ l_1503) & ((safe_div_func_uint64_t_u_u((safe_div_func_int64_t_s_s(((l_1503 >= (-1L)) || (((((*l_1531) = ((((*g_930) = func_70(((safe_mod_func_uint32_t_u_u(p_8, (safe_rshift_func_int16_t_s_u(((l_44.f1 = (safe_mul_func_uint8_t_u_u((((*l_48) = ((safe_div_func_uint16_t_u_u((+0xA86AL), (safe_rshift_func_int16_t_s_s((safe_add_func_uint64_t_u_u((safe_div_func_int16_t_s_s(((safe_add_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((void*)0 != l_1528[0]), l_44.f0)), 1L)), l_1503)) >= l_675[6][1].f0), l_1377.f1)), g_223.f1)), l_1503)))) && 0xBAL)) , l_44.f0), 0x20L))) >= p_8), 7)))) <= 65531UL), p_8, l_52)) == (void*)0) || l_1503)) && 0x71B749F4L) < 7L) <= p_8)), 0x09F26AADB4610C8FLL)), p_8)) >= 4294967292UL));
+ (*l_1531) = ((((safe_rshift_func_int16_t_s_u((((safe_mul_func_int8_t_s_s(((((((void*)0 == l_48) , ((l_1537 , (~1L)) != (safe_mul_func_uint16_t_u_u((p_8 <= ((safe_mod_func_int8_t_s_s(((void*)0 == l_1542), (((func_20((*l_39)) , (*g_318)) <= g_255.f0) | 0xDEL))) , 0x18L)), l_675[6][1].f0)))) >= p_8) < p_8) <= l_13[2][0][0]), l_675[6][1].f1)) >= 4L) < (*l_1531)), (*l_1531))) , (-1L)) & g_627) , 0x66A190CFL);
+ for (g_375 = 14; (g_375 == 5); g_375--)
+ { /* block id: 659 */
+ union U1 l_1545 = {0x21DB83E7L};
+ return l_1545;
+ }
+ }
+ (*l_1550) &= (safe_lshift_func_uint8_t_u_u((safe_rshift_func_uint8_t_u_u(((((((&g_1459 == (void*)0) && (*g_318)) , (*g_911)) == ((*l_45) , (*g_911))) <= 0xC39A113BL) == l_675[6][1].f1), 5)), 5));
+ if (((p_8 > ((l_1377.f1 ^= ((g_444 = ((safe_mul_func_int8_t_s_s(p_8, ((*l_1550) = (p_8 ^ ((*l_1550) || ((8UL == (*l_1550)) | (((*l_45) , &g_479) == l_52))))))) && g_814.f1)) && p_8)) < 0xA9CC9107554708AALL)) <= l_675[6][1].f0))
+ { /* block id: 667 */
+ int32_t *l_1558 = (void*)0;
+ l_1558 = l_1542;
+ return (*g_902);
+ }
+ else
+ { /* block id: 670 */
+ uint32_t *l_1566 = &g_375;
+ int32_t l_1569 = 0x08A23406L;
+ union U1 *l_1570 = &l_44;
+ uint32_t *l_1571 = (void*)0;
+ uint32_t *l_1572[8] = {&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2};
+ int32_t l_1573 = 0xA3C5E453L;
+ uint16_t *l_1600 = (void*)0;
+ uint16_t *l_1601 = &g_245;
+ uint32_t l_1608 = 0x9F9F4AECL;
+ int32_t l_1632[6] = {0xD2B77DEEL,0xD2B77DEEL,0x2136032EL,0xD2B77DEEL,0xD2B77DEEL,0x2136032EL};
+ int32_t ***l_1653 = (void*)0;
+ int32_t *l_1684 = &g_89;
+ int32_t l_1692 = (-1L);
+ int64_t l_1696 = 1L;
+ int16_t *l_1726 = &l_13[3][1][2];
+ int8_t *l_1770[1];
+ int8_t l_1819[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L};
+ union U0 l_1929 = {0L};
+ int32_t l_1950 = 0x0CB4EE2CL;
+ int i;
+ for (i = 0; i < 1; i++)
+ l_1770[i] = &l_1691[0];
+ if (((((*l_1556) = ((((((*g_1502) = (safe_mul_func_int8_t_s_s(((l_1561 == &g_136[5][3]) && 0x9A21L), ((((*l_1550) |= (+((l_1569 = (safe_lshift_func_uint16_t_u_s((((safe_mod_func_uint32_t_u_u((l_1566 == (void*)0), p_8)) == (safe_sub_func_int16_t_s_s(l_1569, (1UL >= ((g_1198[6][4] , l_1570) == l_1570))))) > 0L), l_1569))) , 65535UL))) && 0x1566L) >= l_1573)))) > l_1573) & l_1573) | p_8) == (*g_931))) , 0L) > l_1573))
+ { /* block id: 675 */
+ return g_1574[1];
+ }
+ else
+ { /* block id: 677 */
+ union U1 **l_1595 = &g_1459;
+ int32_t l_1596 = 0x29729CF3L;
+ int32_t *l_1612 = &l_1596;
+ int8_t l_1655 = 0L;
+ int32_t l_1669 = 0x1660C04CL;
+ int32_t l_1670[8][7][3] = {{{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL},{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L},{0xD135A330L,0x82C06C68L,0x42993B24L}},{{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL},{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL}},{{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L},{0xD135A330L,0x82C06C68L,0x42993B24L},{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL}},{{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL},{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L}},{{0xD135A330L,0x82C06C68L,0x42993B24L},{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL},{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{1L,0x5984A900L,0x7DC4BDB8L}},{{(-1L),0xC4140F93L,5L},{(-1L),(-1L),(-3L)},{1L,0x3633256DL,0xFDAF309DL},{8L,(-1L),0xF05BDE44L},{0x5984A900L,0xC4140F93L,0xF05BDE44L},{0x2E44F393L,0x5984A900L,0xFDAF309DL},{0x1E79692DL,0x1E79692DL,(-3L)}},{{0x2E44F393L,8L,5L},{0x5984A900L,8L,0x7DC4BDB8L},{8L,0x1E79692DL,0x14C84822L},{1L,0x5984A900L,0x7DC4BDB8L},{(-1L),0xC4140F93L,5L},{(-1L),(-1L),(-3L)},{1L,0x3633256DL,0xFDAF309DL}},{{8L,(-1L),0xF05BDE44L},{0x5984A900L,0xC4140F93L,0xF05BDE44L},{0x2E44F393L,0x5984A900L,0xFDAF309DL},{0x1E79692DL,0x1E79692DL,(-3L)},{0x2E44F393L,8L,5L},{0x5984A900L,8L,0x7DC4BDB8L},{8L,0x1E79692DL,0x14C84822L}}};
+ int8_t l_1671 = 1L;
+ const union U2 l_1683 = {-10L};
+ int32_t l_1685[3];
+ int32_t *l_1686 = &l_1676;
+ int32_t *l_1687 = &l_1669;
+ int32_t *l_1688 = &g_89;
+ int32_t *l_1689 = &l_1573;
+ int32_t *l_1690[5];
+ const int16_t *l_1714 = &l_675[6][1].f0;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ l_1685[i] = 9L;
+ for (i = 0; i < 5; i++)
+ l_1690[i] = &l_1632[2];
+ for (g_706 = 2; (g_706 >= 0); g_706 -= 1)
+ { /* block id: 680 */
+ uint16_t *l_1581 = &g_245;
+ uint16_t ** const l_1580 = &l_1581;
+ uint16_t ** const *l_1579 = &l_1580;
+ int32_t l_1597 = 9L;
+ union U1 *l_1599 = &l_44;
+ int32_t l_1611 = (-1L);
+ uint8_t * const *l_1646 = (void*)0;
+ uint32_t **l_1649 = &l_1566;
+ int32_t l_1667[8] = {2L,(-2L),2L,(-2L),2L,(-2L),2L,(-2L)};
+ int i;
+ for (g_479 = 2; (g_479 >= 0); g_479 -= 1)
+ { /* block id: 683 */
+ uint32_t l_1585 = 1UL;
+ union U1 ***l_1592 = (void*)0;
+ union U1 **l_1594[6][4][8] = {{{&g_1459,&g_1459,&g_1459,&g_1459,&g_1459,&g_1459,&l_1570,&l_45},{(void*)0,(void*)0,(void*)0,&l_45,&l_45,(void*)0,&g_1459,&l_45},{(void*)0,(void*)0,&l_45,&g_1459,&g_1459,&g_1459,&l_45,(void*)0},{&l_1570,&g_1459,&l_1570,&l_45,&l_1570,&l_45,&g_1459,&l_1570}},{{(void*)0,&l_1570,&g_1459,&l_1570,(void*)0,&l_1570,&g_1459,(void*)0},{&l_1570,&g_1459,&g_1459,&l_1570,&l_1570,&l_45,&l_1570,&l_1570},{(void*)0,&l_1570,(void*)0,&l_1570,&l_1570,&g_1459,(void*)0,&g_1459},{(void*)0,&l_1570,(void*)0,&l_45,(void*)0,(void*)0,(void*)0,&l_45}},{{&g_1459,&l_45,(void*)0,&l_1570,&l_45,(void*)0,&l_45,&g_1459},{(void*)0,&g_1459,&l_45,&l_45,&l_1570,&l_45,&l_45,&g_1459},{&g_1459,(void*)0,&g_1459,&l_45,&l_45,&l_45,(void*)0,&l_1570},{(void*)0,&l_45,&l_1570,(void*)0,&g_1459,(void*)0,(void*)0,&g_1459}},{{&l_1570,(void*)0,&g_1459,&l_45,(void*)0,&g_1459,&l_45,&l_1570},{(void*)0,&g_1459,&l_45,&l_1570,&g_1459,&g_1459,&l_45,&l_1570},{&l_45,&g_1459,(void*)0,(void*)0,&g_1459,&g_1459,&l_45,(void*)0},{&g_1459,&g_1459,&l_45,&g_1459,(void*)0,(void*)0,&l_1570,&l_1570}},{{&g_1459,&l_1570,&g_1459,&l_1570,&l_1570,&l_1570,(void*)0,&g_1459},{&g_1459,(void*)0,&l_45,&g_1459,&l_1570,(void*)0,(void*)0,&g_1459},{&l_45,&l_45,&l_45,&g_1459,&g_1459,&g_1459,&l_1570,&l_1570},{(void*)0,&l_1570,&l_45,&l_45,&l_1570,(void*)0,&g_1459,(void*)0}},{{&l_1570,(void*)0,&g_1459,(void*)0,&g_1459,(void*)0,&g_1459,&g_1459},{&l_45,&g_1459,&g_1459,(void*)0,&l_45,&g_1459,&l_45,(void*)0},{&l_1570,&l_45,(void*)0,&l_45,&l_45,(void*)0,&l_45,&l_1570},{&g_1459,&g_1459,(void*)0,&g_1459,&l_45,(void*)0,&g_1459,&g_1459}}};
+ union U1 ***l_1593 = &l_1594[0][3][0];
+ int32_t l_1598[6][6] = {{0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L,1L,0xF4E79753L,0x3EEF7D26L},{(-5L),0xCF041577L,1L,0xE57F6CC9L,0xF4E79753L,(-5L)},{1L,0xA3191B49L,0xE57F6CC9L,0xE57F6CC9L,0xA3191B49L,1L},{(-5L),0xF4E79753L,0xE57F6CC9L,1L,0xCF041577L,(-5L)},{0x3EEF7D26L,0xF4E79753L,1L,0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L},{0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L,1L,0xF4E79753L,0x3EEF7D26L}};
+ union U0 ***l_1604 = (void*)0;
+ union U0 ***l_1605 = &g_815;
+ int16_t *l_1609[8][9][2] = {{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}}};
+ int32_t l_1610 = 0L;
+ int i, j, k;
+ }
+ for (g_75 = 2; (g_75 >= 0); g_75 -= 1)
+ { /* block id: 732 */
+ int8_t l_1654 = 0L;
+ int32_t l_1668[5];
+ uint64_t l_1678[9];
+ int i;
+ for (i = 0; i < 5; i++)
+ l_1668[i] = 1L;
+ for (i = 0; i < 9; i++)
+ l_1678[i] = 18446744073709551615UL;
+ }
+ }
+ l_1550 = l_1684;
+ --l_1699;
+ (*l_1688) = (safe_div_func_int16_t_s_s((((g_444 = ((*l_1684) <= (*g_244))) >= (safe_mod_func_uint64_t_u_u((safe_mod_func_int32_t_s_s(((*l_1686) = (((g_1695 < ((safe_sub_func_uint8_t_u_u((safe_div_func_uint16_t_u_u(((safe_sub_func_uint16_t_u_u(((0x696A82E2L & ((((void*)0 != l_1714) , (safe_add_func_uint64_t_u_u((safe_unary_minus_func_uint8_t_u((safe_add_func_int16_t_s_s(0x5C2EL, (safe_add_func_uint32_t_u_u((safe_add_func_uint64_t_u_u(((void*)0 != &l_1608), p_8)), p_8)))))), g_319))) & (*l_1686))) <= 0x911E72491D7C01F5LL), 0x41B8L)) != p_8), 2UL)), g_75)) , (-6L))) , (*g_931)) != (*g_931))), 0xE8F5704DL)), p_8))) == 0xD20EL), (*g_244)));
+ }
+ l_1731 = ((0x5465FD2D39850ADCLL && ((p_8 | ((((safe_lshift_func_uint16_t_u_s(p_8, ((*l_1726) = (!((*l_1684) = p_8))))) , (p_8 == (l_1572[7] == ((safe_mul_func_int8_t_s_s(0x36L, (*l_1550))) , (((safe_sub_func_uint64_t_u_u(((g_10[9].f4 ^ (*g_318)) <= (*l_1550)), 18446744073709551615UL)) == p_8) , &g_1007))))) | p_8) > p_8)) != 0x0EL)) , (*l_1550));
+ for (l_1608 = 0; (l_1608 != 16); ++l_1608)
+ { /* block id: 763 */
+ int16_t l_1741 = 0x6876L;
+ uint16_t *l_1742 = &g_1743;
+ int32_t * const *l_1745[4] = {&l_1550,&l_1550,&l_1550,&l_1550};
+ int32_t * const **l_1744 = &l_1745[2];
+ uint32_t ***l_1752 = &g_911;
+ union U2 *l_1779 = &g_10[7];
+ uint64_t l_1802 = 18446744073709551615UL;
+ uint8_t * const *l_1809 = &l_50;
+ uint32_t l_1820 = 0xA20A1AFDL;
+ uint16_t * const *l_1853 = &l_1601;
+ uint16_t * const **l_1852 = &l_1853;
+ uint16_t * const ***l_1851 = &l_1852;
+ int32_t l_1854[10][7][3] = {{{0xB2A1302FL,5L,7L},{(-1L),1L,(-1L)},{6L,(-1L),0x2617E67EL},{0x055AC6CEL,0x2617E67EL,0x055AC6CEL},{0L,0x9966CFEAL,0x7F53882FL},{0L,0x3BA83663L,0x2E0E4AE9L},{0xC3E47ADDL,1L,0x8BBFA625L}},{{0x2617E67EL,0x7F53882FL,(-1L)},{0xC3E47ADDL,1L,0x199D5833L},{0L,0x85A3A27FL,1L},{0L,7L,8L},{0x055AC6CEL,(-1L),8L},{6L,3L,0x8139E0D0L},{(-1L),8L,(-1L)}},{{0xB2A1302FL,(-1L),1L},{(-1L),0xC3F8B041L,0L},{(-1L),0xA1D8305EL,0x228FD4CBL},{(-1L),0xB386BFE8L,0xDE9C09DDL},{0xA1D8305EL,0L,(-1L)},{(-1L),0L,0x6259268EL},{0x9D15D649L,0xB386BFE8L,1L}},{{0x2E0E4AE9L,0xA1D8305EL,0xE9DBB44FL},{1L,0xC3F8B041L,(-6L)},{0x1EDDD83FL,(-1L),0xB386BFE8L},{0x8BBFA625L,8L,0L},{1L,3L,0x94D57003L},{0x0E07BC25L,(-1L),0x3BA83663L},{7L,7L,0x0E07BC25L}},{{3L,0x85A3A27FL,0xC3E47ADDL},{1L,1L,0xC9E9E146L},{(-1L),0x7F53882FL,(-6L)},{0L,1L,0xC9E9E146L},{(-1L),0x3BA83663L,0xC3E47ADDL},{0x8139E0D0L,0x9966CFEAL,0x0E07BC25L},{1L,0x2617E67EL,0x3BA83663L}},{{8L,(-1L),0x94D57003L},{0x378498A2L,1L,0L},{(-6L),5L,0xB386BFE8L},{0x86784362L,0xC9E9E146L,(-6L)},{0xA48CE08BL,0x86784362L,0xE9DBB44FL},{0xDE9C09DDL,0L,6L},{1L,0L,0xB386BFE8L}},{{(-2L),0x9D15D649L,0xC9E9E146L},{(-2L),0L,0L},{1L,0x2E0E4AE9L,0xA1D8305EL},{0L,0x3A4500ACL,0L},{(-1L),0x2DFA94E1L,8L},{0x8139E0D0L,8L,0xC3E47ADDL},{0x6259268EL,(-6L),(-1L)}},{{(-9L),0xA1D8305EL,(-1L)},{(-1L),0x9966CFEAL,0x9966CFEAL},{0x2DFA94E1L,0x7F53882FL,0x73C793C8L},{(-1L),(-1L),0x2E0E4AE9L},{0xC3F8B041L,1L,0x75B2328CL},{0xE9DBB44FL,6L,0L},{5L,1L,0x100E7AA8L}},{{(-1L),(-1L),0L},{(-1L),0x7F53882FL,3L},{0L,0x9966CFEAL,(-1L)},{0x8BBFA625L,0xA1D8305EL,0xC3F8B041L},{8L,(-6L),0L},{0L,8L,0x7F53882FL},{8L,0x2DFA94E1L,1L}},{{0x73C793C8L,0x3A4500ACL,0x640675F7L},{0x100E7AA8L,0x2E0E4AE9L,0x055AC6CEL},{1L,0L,(-1L)},{0xC3E47ADDL,0x9D15D649L,(-1L)},{0xB2A1302FL,0L,0x055AC6CEL},{0x75B2328CL,0L,0x640675F7L},{0L,0x8139E0D0L,1L}}};
+ uint64_t l_1867 = 18446744073709551612UL;
+ union U1 l_1891 = {4294967291UL};
+ union U2 ***l_1901 = &l_39;
+ union U2 ****l_1900[10][2] = {{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901}};
+ union U2 *****l_1902 = (void*)0;
+ int8_t l_1936 = (-1L);
+ uint32_t l_1937 = 0x8A6D3A2FL;
+ int i, j, k;
+ }
+ }
+ return (*g_902);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_444 g_223.f0 g_75 g_244 g_245 g_814.f1 g_318 g_319 g_53 g_89 g_149 g_92
+ * writes: g_444 g_75 g_1399 g_231.f1 g_89 g_149 g_507
+ */
+static const uint64_t func_16(uint64_t p_17, union U1 p_18)
+{ /* block id: 592 */
+ int8_t l_1386 = 0xEBL;
+ uint16_t *l_1389 = &g_444;
+ uint64_t l_1393 = 18446744073709551615UL;
+ uint32_t ***l_1394 = &g_911;
+ int16_t *l_1395 = &g_75;
+ uint16_t *l_1398[4][6] = {{&g_245,&g_245,(void*)0,(void*)0,&g_245,&g_245},{&g_245,&g_245,(void*)0,(void*)0,&g_245,(void*)0},{&g_245,&g_245,&g_245,(void*)0,&g_245,(void*)0},{&g_245,&g_245,(void*)0,(void*)0,&g_245,&g_245}};
+ int32_t l_1400 = 0L;
+ int32_t l_1401 = 0xADEB96C4L;
+ uint16_t l_1405 = 0xFE0CL;
+ int32_t ***l_1409 = &g_251[3];
+ union U0 l_1422 = {0x3EC3L};
+ int64_t l_1423 = 0L;
+ int32_t l_1479[10] = {0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L};
+ int i, j;
+ if ((safe_rshift_func_int16_t_s_s(p_18.f0, (safe_div_func_int16_t_s_s((safe_add_func_int16_t_s_s((l_1400 = ((safe_add_func_int32_t_s_s(((l_1386 ^ (((*l_1395) = (safe_div_func_uint16_t_u_u(((*l_1389) = ((-8L) && 6UL)), (safe_unary_minus_func_uint8_t_u((safe_rshift_func_int16_t_s_s(l_1393, (l_1394 == l_1394)))))))) != 0xE77CL)) , ((((g_1399[2][0][3] = ((*l_1389) |= (safe_div_func_int8_t_s_s((0L >= 0xE9FB419A1EFB1097LL), (-1L))))) | 0x08C3L) || g_223.f0) != l_1393)), (-2L))) , l_1386)), l_1401)), l_1386)))))
+ { /* block id: 598 */
+ union U1 l_1402 = {4294967295UL};
+ int8_t *l_1406 = &g_231[2][3][1].f1;
+ int32_t ***l_1410 = &g_251[3];
+ int32_t *l_1411[3][10] = {{(void*)0,(void*)0,(void*)0,&g_111[7][6],&g_1232,(void*)0,&l_1400,(void*)0,&g_1232,&g_111[7][6]},{&g_111[7][6],&g_111[5][1],&g_111[7][6],(void*)0,(void*)0,&g_111[1][3],&l_1400,&l_1400,&g_111[1][3],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&g_111[7][6],&g_1232,(void*)0,&l_1400,(void*)0,&g_1232}};
+ int i, j;
+ l_1423 = ((l_1402 , ((l_1402.f1 = (((*l_1406) = l_1405) == (-1L))) | (((safe_mod_func_int8_t_s_s((0xB61EL && (((l_1400 && (p_18.f1 ^= (l_1409 != l_1410))) && (safe_lshift_func_uint16_t_u_s((safe_add_func_int8_t_s_s((p_18.f1 , (safe_rshift_func_int16_t_s_u(((safe_mod_func_uint32_t_u_u(((safe_sub_func_uint16_t_u_u((((*l_1395) &= (((l_1422 , p_17) , 0xF25EF439L) == p_17)) , 9UL), p_17)) & 0UL), 0xD5507FF8L)) == (*g_244)), 2))), p_17)), p_17))) | p_17)), g_814.f1)) <= (*g_318)) != g_53[1]))) > 0x2F5002ECB99A8F88LL);
+ for (g_89 = 0; (g_89 != 23); g_89 = safe_add_func_uint8_t_u_u(g_89, 1))
+ { /* block id: 606 */
+ uint32_t l_1426 = 0x9900E60AL;
+ int32_t *l_1436 = &g_1232;
+ uint32_t l_1445 = 4294967295UL;
+ int32_t l_1460 = 8L;
+ int32_t l_1478[2];
+ uint32_t l_1480 = 0x8DC4F29BL;
+ int i;
+ for (i = 0; i < 2; i++)
+ l_1478[i] = 2L;
+ ++l_1426;
+ for (g_149 = 0; (g_149 >= (-5)); g_149 = safe_sub_func_int16_t_s_s(g_149, 1))
+ { /* block id: 610 */
+ int32_t *l_1433 = (void*)0;
+ int32_t *l_1437 = &g_111[1][3];
+ union U1 *l_1456[4];
+ union U2 ***l_1473 = (void*)0;
+ union U2 **** const l_1472 = &l_1473;
+ int32_t l_1477 = (-9L);
+ int i;
+ for (i = 0; i < 4; i++)
+ l_1456[i] = &g_428[0][0][2];
+ }
+ --l_1480;
+ }
+ }
+ else
+ { /* block id: 639 */
+ int16_t *l_1483 = &g_507;
+ int32_t *l_1484 = (void*)0;
+ int32_t *l_1485 = &l_1400;
+ (*l_1485) &= ((((*l_1483) = ((*l_1395) ^= p_17)) != (p_17 > g_92)) || (*g_318));
+ }
+ return (*g_318);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_93 g_225 g_226 g_223.f0 g_149 g_231.f1 g_428.f0 g_92 g_223.f3 g_930 g_931 g_627 g_912 g_318 g_319 g_911 g_1007 g_89 g_226.f2 g_244 g_245 g_10.f4 g_444 g_428 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_53 g_706 g_222 g_223
+ * writes: g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_2 g_226.f2 g_89 g_444 g_507 g_479 g_147 g_1198 g_54 g_706 g_53
+ */
+static union U2 func_20(union U2 * p_21)
+{ /* block id: 334 */
+ int64_t l_751 = 0x5E75AE4C622A21C5LL;
+ union U2 * const l_752[8][4] = {{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]}};
+ int32_t l_759 = 0x817DE0C4L;
+ uint16_t l_792 = 0xE74AL;
+ union U0 **l_817 = &g_225;
+ uint16_t l_822[3][6];
+ uint32_t l_857[7][2][6] = {{{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L},{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL}},{{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL},{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL}},{{0x151888D0L,0x52F0D1DCL,4294967294UL,0x151888D0L,0x069C0D93L,0x151888D0L},{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L}},{{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL},{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL}},{{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL},{0x151888D0L,0x52F0D1DCL,4294967294UL,0x151888D0L,0x069C0D93L,0x151888D0L}},{{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L},{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL}},{{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL},{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL}}};
+ uint16_t *l_871 = &g_245;
+ uint16_t **l_870[10] = {&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871};
+ uint16_t ***l_869[4];
+ int8_t *l_880 = &g_147;
+ union U2 ***l_900 = &g_54;
+ union U2 ****l_899 = &l_900;
+ uint32_t *l_909 = &l_857[5][0][1];
+ uint32_t **l_908[9][3] = {{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909}};
+ uint32_t l_932 = 1UL;
+ int64_t l_943[1][7][4] = {{{0x31817ECD765582DFLL,0x3C4000B56088A104LL,0x3C4000B56088A104LL,0x31817ECD765582DFLL},{(-8L),5L,0L,2L},{0x0E65A79A37AC998BLL,(-1L),2L,8L},{2L,8L,(-4L),8L},{0x3C4000B56088A104LL,(-1L),0x3941FF1ADCFF6FFCLL,2L},{0x07095D56C55A0754LL,5L,8L,0x31817ECD765582DFLL},{0x3941FF1ADCFF6FFCLL,0x3C4000B56088A104LL,(-5L),(-5L)}}};
+ int32_t l_964 = 6L;
+ int32_t l_975 = 1L;
+ int32_t l_976 = 0xA8F33034L;
+ int32_t l_980 = 1L;
+ int32_t l_1042 = 4L;
+ uint32_t l_1090 = 18446744073709551609UL;
+ int16_t l_1101 = 0xE3F0L;
+ uint8_t l_1130 = 251UL;
+ int32_t l_1183 = 0x99FFB991L;
+ int32_t l_1189 = 0x193C6D4BL;
+ int32_t l_1191 = 0x799703FFL;
+ int32_t l_1192[6][5] = {{0x7D50E986L,0x1D2A5D45L,0x1D2A5D45L,0x7D50E986L,0x1D2A5D45L},{0xB0F500FBL,0xB0F500FBL,0x9F171E12L,0xB0F500FBL,0xB0F500FBL},{0x1D2A5D45L,0x7D50E986L,0x1D2A5D45L,0x1D2A5D45L,0x7D50E986L},{0xB0F500FBL,6L,6L,0xB0F500FBL,6L},{0x7D50E986L,0x7D50E986L,(-2L),0x7D50E986L,0x7D50E986L},{6L,0xB0F500FBL,6L,6L,6L}};
+ int16_t l_1212[10][3][8] = {{{0L,(-1L),4L,1L,0x39A8L,(-8L),(-9L),0x74A8L},{(-9L),2L,1L,0xE2F5L,0x43FCL,0x976FL,0xEC7EL,(-1L)},{0xE00DL,0x74A8L,0L,0xA987L,(-1L),0xAE8AL,1L,0L}},{{(-1L),(-3L),0x925EL,0xE00DL,0xEC7EL,0x74A8L,(-1L),(-1L)},{0L,0x4D21L,(-5L),0x74A8L,0x0AB7L,0x1B3AL,0L,0x1EE1L},{0xFD58L,0L,0L,(-9L),(-9L),0L,0L,0xFD58L}},{{0xE096L,0L,0x2447L,0x5CD9L,0x5027L,0L,(-4L),0x4433L},{0x0518L,(-1L),0L,1L,0x5CD9L,0L,0x0AB7L,0xEC7EL},{0xE2F5L,0L,0x450AL,0x1B3AL,(-5L),0L,0x1126L,1L}},{{0xEC7EL,0L,(-3L),0x3336L,(-6L),0x1B3AL,0x4D21L,4L},{(-1L),0x4D21L,1L,(-8L),7L,0x74A8L,(-3L),(-1L)},{(-3L),(-3L),0x8D33L,0x1EE1L,0x94DEL,0xAE8AL,(-6L),1L}},{{0x1FC3L,0x74A8L,(-5L),0x0950L,(-4L),0x976FL,0L,0x1B3AL},{1L,2L,(-1L),(-3L),0L,(-8L),1L,0xE00DL},{(-8L),(-1L),0xA987L,(-1L),0L,(-4L),4L,1L}},{{0x0950L,0x1E22L,0xAE8AL,(-1L),1L,0x5027L,0xFD58L,0x5CD9L},{0x39A8L,4L,(-8L),0L,0x1605L,0L,(-8L),4L},{2L,0L,0x74A8L,1L,4L,(-1L),0L,0xF390L}},{{0x2447L,0xFD58L,(-4L),(-8L),2L,0L,0L,0x450AL},{0x450AL,(-8L),0x74A8L,(-1L),(-3L),0x1EE1L,(-8L),0L},{(-3L),0x1EE1L,(-8L),0L,(-1L),(-1L),0xFD58L,0xEC64L}},{{(-5L),0x5CD9L,0xAE8AL,(-3L),0xB3BFL,0x0950L,4L,(-1L)},{0L,0x0AB7L,0xA987L,0x0518L,(-7L),0x4433L,1L,0L},{0xF390L,1L,(-1L),0x6038L,0x1B3AL,0xB3BFL,0xA987L,(-8L)}},{{7L,0xE2F5L,0x97EAL,0xFD58L,0x6038L,2L,0x0492L,0x5CD9L},{0x1E22L,(-1L),0xF390L,0xF2C9L,(-8L),0x0518L,0x8D48L,1L},{(-1L),1L,0x0518L,(-3L),1L,(-1L),(-3L),0L}},{{0xE2F5L,(-8L),(-1L),0L,(-1L),(-1L),0L,(-1L)},{(-4L),(-4L),0x1B3AL,(-8L),2L,0L,0xEC7EL,(-3L)},{0x0950L,0xF2C9L,0xA987L,7L,0L,(-1L),1L,(-3L)}}};
+ int32_t *l_1237 = &l_1192[5][0];
+ int32_t *l_1238[6][5][8] = {{{&l_980,(void*)0,&l_1192[0][0],(void*)0,&l_980,&l_964,(void*)0,&g_92},{&g_111[2][8],&l_1189,&g_111[1][3],&l_1191,&l_759,&g_111[3][4],&l_1192[5][0],&l_1189},{&g_92,&l_1192[5][0],&l_759,&g_111[1][3],&l_759,&g_1232,&l_964,&g_111[1][3]},{&l_1042,&l_964,&l_980,&l_1191,&l_980,&l_964,&l_1042,&l_1192[0][1]},{&g_111[3][8],&l_1189,&l_1192[0][0],&l_976,&l_1189,&l_1192[5][1],(void*)0,&l_980}},{{&l_980,&l_1042,&g_89,&l_1042,&l_1189,&l_1192[5][0],&l_1191,&l_1191},{&g_111[3][8],&l_976,(void*)0,&l_980,&l_980,&l_759,&g_111[5][8],&l_964},{&l_1042,&l_1192[4][0],&l_1192[5][1],&l_980,&l_759,&l_976,(void*)0,&l_976},{&g_92,&l_759,&g_1232,(void*)0,&l_759,&l_1191,&l_980,&l_980},{&g_111[2][8],&l_964,&l_1191,(void*)0,&l_980,&g_1232,&l_980,(void*)0}},{{&l_980,&g_111[3][8],&g_1232,&l_1189,(void*)0,(void*)0,&l_1192[5][0],(void*)0},{&l_759,&l_1192[5][0],&g_111[1][3],(void*)0,&g_89,&l_1189,&l_1191,(void*)0},{&l_976,&l_1192[3][1],&l_1042,&g_89,(void*)0,&l_976,&l_1042,&l_964},{&g_111[5][8],(void*)0,&g_89,&l_1189,&g_89,&g_1232,(void*)0,&l_1192[5][0]},{&l_1192[0][1],&g_111[8][4],(void*)0,&l_1042,&l_1042,&g_111[1][3],&l_1042,&l_1189}},{{&l_1192[5][0],&l_1191,&l_980,(void*)0,&l_1042,(void*)0,&g_111[3][8],&l_1192[0][1]},{&l_1042,&l_1189,&g_89,(void*)0,&l_1191,&l_759,&l_1191,&g_111[2][8]},{&g_1232,&l_1189,(void*)0,&g_111[1][3],&l_964,&g_111[1][3],&g_111[1][3],&l_964},{&l_1191,&l_964,&l_964,&l_1191,&l_1042,&l_1189,&g_111[3][5],&l_1042},{&l_980,&l_1042,&l_1042,&g_111[1][3],&l_1191,&l_1189,&g_1232,(void*)0}},{{(void*)0,&l_1042,&g_111[1][3],(void*)0,&l_980,&l_1189,&l_976,&l_1192[5][0]},{&l_980,&l_964,&l_1192[4][0],&l_1189,(void*)0,&g_111[1][3],(void*)0,&l_980},{&l_980,&g_89,&l_1189,&l_964,&g_1232,&l_976,&l_964,(void*)0},{(void*)0,&l_759,(void*)0,&g_1232,&l_980,&l_1192[4][0],&g_1232,&l_1192[0][1]},{&l_1192[5][0],&g_111[1][3],(void*)0,&g_111[1][3],&l_1192[4][0],(void*)0,&l_759,(void*)0}},{{(void*)0,&l_964,(void*)0,&l_964,&l_759,&l_1189,&l_1042,&l_980},{(void*)0,&l_964,&l_980,&l_1042,&l_964,&l_1192[0][0],&g_111[1][3],(void*)0},{&g_111[3][5],&g_1232,&l_759,&l_1191,(void*)0,(void*)0,&l_1191,(void*)0},{(void*)0,&l_759,&l_1189,&l_1192[5][0],&l_1192[0][0],&l_1042,&l_759,(void*)0},{(void*)0,&g_111[1][3],&g_89,&g_111[1][3],(void*)0,&g_111[1][3],&l_964,&l_980}}};
+ int32_t l_1239 = 0x5078E770L;
+ int32_t l_1240 = 0L;
+ uint32_t l_1241 = 0x263AC74CL;
+ int32_t l_1251[7][5][4] = {{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}},{{0x603D9C89L,0xAA29CFDBL,0xAA29CFDBL,0x603D9C89L},{1L,0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL},{0xAA29CFDBL,6L,0x721A6F8FL,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}},{{0x603D9C89L,0xAA29CFDBL,0xAA29CFDBL,0x603D9C89L},{1L,0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL},{0xAA29CFDBL,6L,0x721A6F8FL,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}}};
+ int16_t l_1252 = 0x8099L;
+ union U1 l_1296[6][10][4] = {{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}},{{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}},{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}},{{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}},{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}}};
+ uint32_t ****l_1337 = (void*)0;
+ uint32_t *****l_1336 = &l_1337;
+ int32_t l_1352 = 0L;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 6; j++)
+ l_822[i][j] = 4UL;
+ }
+ for (i = 0; i < 4; i++)
+ l_869[i] = &l_870[3];
+ if ((safe_rshift_func_uint16_t_u_s((safe_mul_func_int8_t_s_s(0x74L, (g_2 >= l_751))), 10)))
+ { /* block id: 335 */
+ uint32_t *l_757[4][4][10] = {{{(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0},{(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0}},{{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375},{&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93},{(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375}},{{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93}},{{&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,(void*)0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0}}};
+ int32_t l_758[1][4][8] = {{{0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL},{0x13BCAF3AL,0x13BCAF3AL,0x748F0485L,0x13BCAF3AL,0x13BCAF3AL,0x748F0485L,0x13BCAF3AL,0x13BCAF3AL},{0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL},{0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL}}};
+ union U1 l_762 = {0x3F18B329L};
+ int32_t l_769 = 0xC76289FEL;
+ uint16_t *l_774 = &g_245;
+ union U1 l_775 = {4294967288UL};
+ int32_t *l_776[10][6];
+ int64_t *l_777 = &g_149;
+ int32_t *l_778 = &g_111[1][3];
+ int32_t **l_779 = &l_778;
+ int i, j, k;
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 6; j++)
+ l_776[i][j] = &g_223.f0;
+ }
+ (*l_778) = (((void*)0 != l_752[1][2]) | ((*l_777) = (safe_div_func_int16_t_s_s((safe_div_func_uint32_t_u_u((++g_93), (l_762 , (safe_rshift_func_uint8_t_u_s((((safe_add_func_int16_t_s_s(((((safe_mul_func_int8_t_s_s(((0x8DD6L < l_769) | (((g_223.f0 ^= ((safe_mul_func_uint8_t_u_u((0x3C13D321L < (safe_mod_func_int8_t_s_s((((*l_774) = l_762.f0) | ((l_775 , (*g_225)) , l_758[0][2][3])), 1UL))), 0x55L)) > l_775.f0)) , 0L) | g_149)), g_231[2][3][1].f1)) && 0x9AL) , l_759) || l_759), l_759)) >= g_428[0][0][2].f0) < g_92), 6))))), l_751))));
+ (*l_779) = &l_758[0][2][0];
+ }
+ else
+ { /* block id: 342 */
+ int8_t l_789 = 0L;
+ int32_t l_791 = 0xA19943A3L;
+ uint32_t *l_849 = (void*)0;
+ uint8_t *l_875 = &g_2;
+ union U0 *l_883 = &g_229[0][0][4];
+ const union U1 *l_901 = &g_428[0][0][2];
+ int32_t *l_916[9][9][2] = {{{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0}},{{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0}},{{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0}},{{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0}},{{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0}},{{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0}},{{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0}},{{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627}},{{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0}}};
+ int64_t l_918[7] = {0x7A51C65C262453B0LL,0x7A51C65C262453B0LL,5L,0x7A51C65C262453B0LL,0x7A51C65C262453B0LL,5L,0x7A51C65C262453B0LL};
+ union U0 ***l_963[5][5][5] = {{{&l_817,&g_815,(void*)0,&l_817,(void*)0},{&g_815,(void*)0,&g_815,&g_815,&g_815},{&g_815,&l_817,&g_815,(void*)0,&l_817},{&g_815,&g_815,&l_817,(void*)0,&g_819},{&l_817,(void*)0,&g_815,&l_817,&g_819}},{{&g_819,&l_817,&l_817,&g_819,&l_817},{&l_817,(void*)0,&g_815,(void*)0,&l_817},{(void*)0,(void*)0,&g_815,(void*)0,(void*)0},{&g_819,&l_817,(void*)0,&l_817,&g_815},{&g_819,&g_815,&g_819,&g_819,&l_817}},{{(void*)0,&l_817,&g_819,&l_817,&g_815},{&g_819,&g_819,&g_815,&l_817,(void*)0},{&g_815,&g_815,&l_817,(void*)0,&l_817},{&g_815,&g_815,&g_815,&g_815,&l_817},{&g_815,&g_819,&l_817,&l_817,&g_819}},{{(void*)0,&g_819,&g_819,&g_815,&g_819},{&l_817,&g_819,&g_819,&l_817,&l_817},{&g_815,&g_815,&g_815,&g_819,&g_815},{&l_817,&g_815,&g_815,&l_817,(void*)0},{&l_817,&g_819,&g_815,&g_815,(void*)0}},{{&g_815,&l_817,&g_819,(void*)0,&l_817},{(void*)0,&g_815,&l_817,&g_815,&g_819},{(void*)0,&l_817,(void*)0,(void*)0,&l_817},{&g_819,&l_817,&g_815,&g_815,&l_817},{&l_817,&g_819,&g_815,(void*)0,&l_817}}};
+ const uint8_t **l_966 = (void*)0;
+ const uint8_t ** const *l_965 = &l_966;
+ int32_t l_974 = (-6L);
+ int32_t l_977 = 0L;
+ int32_t l_978 = 0x13F01D48L;
+ int32_t l_979 = 1L;
+ int32_t l_982 = 0L;
+ uint64_t l_983 = 18446744073709551615UL;
+ uint32_t l_1013 = 0xCE3163D8L;
+ uint8_t l_1067 = 0xD4L;
+ int32_t l_1180 = 0xF57081BFL;
+ int32_t l_1181 = 0xFB5777F6L;
+ int32_t l_1182 = 0x275AD62DL;
+ int32_t l_1184 = 6L;
+ int32_t l_1185 = (-1L);
+ int32_t l_1186 = 0x7A2C130CL;
+ int32_t l_1188 = (-7L);
+ int32_t l_1190 = 0x38A4EFDBL;
+ int32_t l_1193 = 0xBF70D8C0L;
+ int32_t l_1194 = 1L;
+ int32_t l_1195 = 0x0CE7F4DEL;
+ int32_t l_1196 = (-2L);
+ int32_t l_1197[9] = {0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L};
+ uint64_t l_1233 = 0x13588E024B8FA85ALL;
+ int32_t *l_1236[6][9][4] = {{{(void*)0,&l_1182,&l_1182,&l_1197[1]},{&l_1186,&l_1194,&l_1194,&l_1186},{&l_1196,&l_1185,&l_1192[5][0],&l_977},{(void*)0,&l_1184,&l_1197[7],(void*)0},{(void*)0,(void*)0,&l_1193,(void*)0},{&l_1194,&l_1184,&l_1185,&l_977},{&l_1186,&l_1185,&l_1191,&l_1186},{&l_1182,&l_1194,&l_1193,&l_1197[1]},{&l_1185,&l_1182,(void*)0,&l_1196}},{{&l_1186,&l_1197[1],&l_1197[1],&l_1185},{&l_1195,(void*)0,&l_1193,&l_1182},{&l_977,(void*)0,&l_977,(void*)0},{(void*)0,&l_1197[1],(void*)0,(void*)0},{(void*)0,&l_1185,&l_1194,&l_1197[1]},{&l_964,&l_1195,&l_1194,&l_964},{(void*)0,&l_1185,(void*)0,(void*)0},{(void*)0,&l_982,&l_977,(void*)0},{&l_977,(void*)0,&l_1193,(void*)0}},{{&l_1195,&l_1184,&l_1197[1],(void*)0},{&l_1186,(void*)0,(void*)0,&l_1186},{&l_1185,&l_1195,&l_1193,&l_1193},{&l_1182,&l_1182,&l_1191,(void*)0},{&l_1186,&l_1193,&l_1185,&l_1185},{&l_1194,(void*)0,&l_1193,&l_1185},{(void*)0,(void*)0,&l_1197[7],&l_1185},{(void*)0,&l_1193,&l_1192[5][0],(void*)0},{&l_1196,&l_1182,&l_1194,&l_1193}},{{&l_1186,&l_1195,&l_1182,&l_1186},{(void*)0,(void*)0,&l_1192[5][0],(void*)0},{(void*)0,&l_1184,&l_977,(void*)0},{(void*)0,(void*)0,&l_976,(void*)0},{&l_1195,&l_982,&l_1185,(void*)0},{(void*)0,&l_1185,(void*)0,&l_964},{&l_1182,&l_1195,&l_982,&l_1197[1]},{&l_1182,&l_1185,(void*)0,(void*)0},{(void*)0,&l_1197[1],&l_1185,(void*)0}},{{&l_1195,(void*)0,&l_976,&l_1182},{(void*)0,(void*)0,&l_977,&l_1185},{(void*)0,&l_1197[1],&l_1192[5][0],&l_1196},{(void*)0,&l_1182,&l_1182,&l_1197[1]},{&l_1186,&l_1194,&l_1194,&l_1186},{&l_1196,&l_1185,&l_1192[5][0],&l_977},{(void*)0,&l_1192[5][0],&l_1197[1],(void*)0},{&l_1193,&l_1042,&l_1196,(void*)0},{&l_1196,&l_1192[5][0],&l_1191,&l_982}},{{&l_977,&l_982,(void*)0,&l_1185},{(void*)0,&l_1196,&l_1182,&l_1194},{&l_1191,(void*)0,&l_1042,&l_980},{&l_977,&l_1194,(void*)0,&l_982},{&l_964,&l_1192[0][0],&l_1196,(void*)0},{&l_982,&l_1196,&l_982,&l_1196},{&l_1196,&l_1194,&l_1188,(void*)0},{(void*)0,&l_1191,&l_1196,&l_1194},{&l_1197[1],&l_964,&l_1196,&l_1197[1]}}};
+ int i, j, k;
+ for (g_223.f3 = 14; (g_223.f3 >= 16); g_223.f3 = safe_add_func_int32_t_s_s(g_223.f3, 9))
+ { /* block id: 345 */
+ int32_t l_788 = 0x9C835BFDL;
+ int32_t l_790 = 0L;
+ uint8_t *l_824 = (void*)0;
+ uint8_t **l_823 = &l_824;
+ union U1 l_856 = {4294967286UL};
+ uint16_t ***l_873 = &l_870[0];
+ int8_t *l_876 = &g_479;
+ const union U0 l_937 = {7L};
+ const int32_t *l_950[1];
+ const int32_t **l_949[4];
+ const int32_t ***l_948 = &l_949[3];
+ uint32_t l_967 = 0x77B72420L;
+ int32_t l_981 = 1L;
+ union U2 * const l_994 = (void*)0;
+ uint32_t l_1008 = 4294967295UL;
+ int32_t l_1038 = 0xCA27D7C2L;
+ int32_t l_1041 = 2L;
+ int32_t l_1043[10][5] = {{0L,0L,0x66C6F2F5L,1L,(-7L)},{0x77081B5EL,0xEF4C7256L,0x5589E398L,0x77081B5EL,0L},{0x90D8465BL,(-5L),0xAF1CDC4BL,5L,(-5L)},{0L,0xEF4C7256L,0xB86532B7L,0x944B88F4L,0x944B88F4L},{0x5589E398L,0L,0x5589E398L,0xAF1CDC4BL,0x944B88F4L},{1L,0x77081B5EL,0x48DB9371L,0x90D8465BL,(-5L)},{0xEF4C7256L,0x90D8465BL,0xDAE9F189L,1L,0L},{0x832C4FFEL,0L,0x48DB9371L,(-5L),(-7L)},{0x90D8465BL,0x5589E398L,0x5589E398L,0x90D8465BL,0x832C4FFEL},{0x90D8465BL,1L,0xB86532B7L,5L,1L}};
+ uint8_t l_1044[1][4][6] = {{{0xD3L,0xE8L,0xD3L,255UL,255UL,0xD3L},{0UL,0UL,255UL,250UL,255UL,0UL},{255UL,0xE8L,250UL,250UL,0xE8L,255UL},{0UL,255UL,250UL,255UL,0UL,0UL}}};
+ uint32_t ***l_1127 = (void*)0;
+ uint32_t ****l_1126 = &l_1127;
+ uint32_t *****l_1125 = &l_1126;
+ uint32_t ****l_1129 = &l_1127;
+ uint32_t *****l_1128 = &l_1129;
+ int16_t l_1187[2][3][7] = {{{0x8B62L,1L,0x8B62L,1L,1L,(-9L),(-9L)},{1L,3L,0x2A4CL,3L,1L,0x2A4CL,0xC3E2L},{0xC3E2L,(-9L),1L,0xC3E2L,1L,(-9L),0xC3E2L}},{{0x8B62L,0xC3E2L,(-9L),1L,0xC3E2L,1L,(-9L)},{0xC3E2L,0xC3E2L,0x2A4CL,1L,3L,0x2A4CL,3L},{1L,(-9L),(-9L),1L,1L,0x8B62L,1L}}};
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ l_950[i] = &l_791;
+ for (i = 0; i < 4; i++)
+ l_949[i] = &l_950[0];
+ for (g_75 = 0; (g_75 <= 5); g_75 += 1)
+ { /* block id: 348 */
+ int32_t *l_782 = &g_111[4][0];
+ int32_t *l_783 = &g_92;
+ int32_t *l_784 = (void*)0;
+ int32_t *l_785 = &g_111[1][3];
+ int32_t *l_786 = &g_92;
+ int32_t *l_787[8] = {&g_92,&g_89,&g_92,&g_89,&g_92,&g_89,&g_92,&g_89};
+ union U0 **l_803 = &g_225;
+ uint8_t *l_809 = &g_53[1];
+ uint8_t **l_808 = &l_809;
+ const union U2 *l_813 = &g_814;
+ const union U2 **l_812 = &l_813;
+ union U0 **l_816 = (void*)0;
+ union U0 ***l_818[1][8] = {{(void*)0,&l_803,&l_803,(void*)0,&l_803,&l_803,(void*)0,&l_803}};
+ int16_t *l_820 = (void*)0;
+ int16_t *l_821 = &g_507;
+ union U0 l_848 = {0L};
+ int32_t l_865 = 0xD0F7F5FBL;
+ uint16_t ***l_868 = (void*)0;
+ int64_t *l_940 = &g_49;
+ int i, j;
+ l_792++;
+ }
+ if (((~(0x961AFC41136F22A9LL | (safe_add_func_uint16_t_u_u(((safe_div_func_uint32_t_u_u((((((l_790 | ((void*)0 == l_948)) == ((safe_rshift_func_uint16_t_u_s(((safe_lshift_func_uint8_t_u_u(((*g_931) = (safe_lshift_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u(((((safe_rshift_func_int16_t_s_s((((l_918[2] || (0x5CL != ((((l_964 = (safe_sub_func_int8_t_s_s(((l_963[4][2][3] == l_963[4][2][3]) == (l_759 = 18446744073709551615UL)), 0x1DL))) > 0x1AL) , &l_856) == &g_428[6][0][2]))) , (**g_930)) < g_627), l_857[0][0][1])) , &g_930) != l_965) || 0x2A4742A4L), 0x19AAL)), 10))), l_918[3])) == (*g_912)), 5)) != (*g_912))) & (*g_318)) , l_950[0]) == (*g_911)), 0xDFE9E75CL)) > l_967), 1L)))) == l_932))
+ { /* block id: 423 */
+ int32_t *l_968 = &l_759;
+ int32_t *l_969 = &g_89;
+ int32_t *l_970 = &l_790;
+ int32_t *l_971 = &l_791;
+ int32_t *l_972 = (void*)0;
+ int32_t *l_973[5];
+ union U2 ***l_1006 = &g_54;
+ uint16_t *l_1024 = &l_792;
+ int8_t l_1035 = 0L;
+ int i;
+ for (i = 0; i < 5; i++)
+ l_973[i] = (void*)0;
+ l_983++;
+ if ((*l_971))
+ break;
+ (**l_948) = l_970;
+ for (g_226.f2 = 0; (g_226.f2 <= 2); g_226.f2 += 1)
+ { /* block id: 429 */
+ uint32_t l_986 = 4294967295UL;
+ int32_t l_987 = 1L;
+ int32_t l_988[5][9] = {{0L,0x09DD368BL,2L,0L,0L,2L,0x09DD368BL,0L,2L},{0L,0x09DD368BL,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L}};
+ int32_t *l_1016 = (void*)0;
+ uint16_t *l_1023 = &g_245;
+ int i, j;
+ if (l_986)
+ { /* block id: 430 */
+ uint16_t l_989[1][1][7];
+ uint32_t *l_1009[5][7][5] = {{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,(void*)0,(void*)0,(void*)0},{&g_223.f2,(void*)0,(void*)0,&g_226.f2,&l_967},{&g_223.f2,(void*)0,&l_932,(void*)0,&l_967},{&l_967,&g_226.f2,&g_226.f2,(void*)0,(void*)0}}};
+ int32_t l_1010 = 0xE506438AL;
+ int32_t l_1011 = (-3L);
+ int32_t l_1012 = 0x265CF71AL;
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 7; k++)
+ l_989[i][j][k] = 0xDF33L;
+ }
+ }
+ (**l_948) = &l_791;
+ l_989[0][0][3]++;
+ (*l_969) |= (safe_lshift_func_uint8_t_u_u((((void*)0 != l_994) , (safe_unary_minus_func_uint32_t_u(((l_988[1][6] = (safe_lshift_func_int8_t_s_u(((void*)0 == &g_627), ((safe_lshift_func_uint16_t_u_u((safe_mod_func_uint16_t_u_u((safe_lshift_func_uint16_t_u_s((l_975 , (safe_lshift_func_int16_t_s_s(((*l_899) == l_1006), 7))), (((*g_931) = g_1007) == g_223.f3))), 0xDB6DL)), l_1008)) , l_974)))) , 4294967291UL)))), 7));
+ l_1013++;
+ }
+ else
+ { /* block id: 437 */
+ uint16_t *l_1025 = (void*)0;
+ int32_t l_1034 = (-1L);
+ int32_t l_1036 = 0xB9E319BAL;
+ int32_t l_1037 = 5L;
+ int32_t l_1039 = (-1L);
+ int32_t l_1040 = 0x5EEBA298L;
+ l_1016 = l_972;
+ (*l_968) ^= (safe_rshift_func_int8_t_s_s((+((safe_mod_func_int16_t_s_s((safe_div_func_int8_t_s_s(l_791, 0x24L)), (((l_1024 = l_1023) != (l_1025 = l_1025)) , (((safe_lshift_func_int8_t_s_u(((safe_div_func_uint64_t_u_u((safe_rshift_func_uint16_t_u_u((*l_971), ((*g_931) || (0x69EAL < (((*g_912) = (safe_sub_func_uint16_t_u_u(((g_226.f2 ^ (l_982 ^ l_988[3][6])) == (*g_318)), (*g_244)))) >= l_789))))), (*g_318))) == (*l_971)), 7)) & l_1034) , (-7L))))) , g_149)), 6));
+ l_1044[0][3][5]++;
+ }
+ }
+ }
+ else
+ { /* block id: 446 */
+ uint32_t l_1053 = 18446744073709551612UL;
+ const uint16_t ****l_1061 = (void*)0;
+ int32_t l_1089 = 0x58936FB3L;
+ uint8_t l_1099 = 0x88L;
+ int32_t l_1108[7] = {4L,0xBE5E93A0L,0xBE5E93A0L,4L,0xBE5E93A0L,0xBE5E93A0L,4L};
+ int i;
+ for (l_792 = 0; (l_792 <= 3); l_792 += 1)
+ { /* block id: 449 */
+ int32_t *l_1047 = (void*)0;
+ int32_t *l_1048 = &l_759;
+ int32_t *l_1049 = (void*)0;
+ int32_t *l_1050 = (void*)0;
+ int32_t *l_1051 = &l_981;
+ int32_t *l_1052[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+ uint32_t ***l_1059 = (void*)0;
+ uint32_t ****l_1058[6][9] = {{&l_1059,(void*)0,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059},{&l_1059,(void*)0,&l_1059,(void*)0,&l_1059,&l_1059,(void*)0,&l_1059,&l_1059},{&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,(void*)0},{&l_1059,&l_1059,(void*)0,&l_1059,&l_1059,&l_1059,(void*)0,&l_1059,&l_1059},{&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059},{(void*)0,(void*)0,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059}};
+ uint32_t ***l_1060 = &l_908[8][1];
+ union U1 l_1064[9] = {{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L}};
+ union U0 **l_1076[7];
+ uint32_t l_1077[10] = {18446744073709551615UL,0x091F9E54L,0xCE927A92L,0x091F9E54L,18446744073709551615UL,18446744073709551615UL,0x091F9E54L,0xCE927A92L,0x091F9E54L,18446744073709551615UL};
+ union U2 l_1104[1] = {{1L}};
+ int i, j;
+ for (i = 0; i < 7; i++)
+ l_1076[i] = &l_883;
+ l_1053++;
+ l_1067 ^= (((g_10[9].f4 & (safe_add_func_uint64_t_u_u(((l_1060 = &g_911) != &l_908[5][0]), (l_974 , ((void*)0 != l_1061))))) , l_1053) <= ((safe_sub_func_uint16_t_u_u(((l_1064[0] , (safe_mul_func_uint8_t_u_u(255UL, l_975))) || 0x62FFL), l_979)) , (*g_912)));
+ if ((((l_1067 , (((((((g_444--) <= (((*l_901) , ((*g_244) , ((l_976 < (g_627 , ((g_245 = (safe_rshift_func_int16_t_s_u((((safe_mul_func_uint32_t_u_u((g_1074[2] != (void*)0), (l_1076[4] == (((g_147 < g_231[2][3][1].f1) > g_101) , (void*)0)))) , l_791) >= l_1053), l_918[3]))) , 9L))) | l_976))) >= 0x0FL)) && (*l_1051)) || l_932) , l_1077[0]) & l_1053) , l_1013)) && (*l_1051)) && (**g_930)))
+ { /* block id: 455 */
+ uint32_t *l_1086 = &l_1064[0].f0;
+ int16_t *l_1087 = &g_507;
+ int16_t *l_1088[8] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0};
+ int32_t l_1091 = 0x536FF2CFL;
+ int i;
+ l_974 |= ((*l_1051) = ((safe_mod_func_int8_t_s_s((*l_1048), 8UL)) <= (safe_sub_func_int16_t_s_s(((l_1089 &= ((*l_1087) = (safe_rshift_func_uint16_t_u_u(((void*)0 == &g_911), (safe_mul_func_uint16_t_u_u(((&l_1008 != (l_1086 = &l_1013)) >= 0xC6D2L), ((-7L) == l_822[0][4]))))))) && 0x72AFL), l_857[5][1][3]))));
+ if (l_1090)
+ continue;
+ if (l_1091)
+ continue;
+ }
+ else
+ { /* block id: 463 */
+ uint32_t l_1094 = 18446744073709551615UL;
+ int32_t l_1100 = (-7L);
+ l_1043[4][0] = (((((safe_sub_func_uint64_t_u_u((((0xC7L <= ((l_918[5] , (l_1094 = (*g_912))) > ((safe_add_func_uint64_t_u_u((safe_rshift_func_int8_t_s_u(l_1099, ((*l_875) = l_1100))), (~(l_1101 <= (safe_mul_func_uint16_t_u_u((l_1100 , ((((l_1104[0] , ((***l_948) > l_1099)) , l_1100) & l_983) <= (*g_912))), l_1100)))))) || l_857[1][1][0]))) == g_375) <= 0xECL), (*g_318))) , l_1089) ^ (**g_911)) != 0x48965DBB2790DDDDLL) | 1L);
+ }
+ for (l_1099 = 0; (l_1099 <= 4); l_1099 += 1)
+ { /* block id: 470 */
+ int8_t l_1105 = 0xADL;
+ int32_t l_1106 = 0x413B3C1FL;
+ int32_t l_1107[10][4] = {{1L,(-6L),0x7FC6FB02L,0x7FC6FB02L},{0xAD222DD9L,0xAD222DD9L,1L,0x7FC6FB02L},{0xEEC01B30L,(-6L),0xEEC01B30L,1L},{0xEEC01B30L,1L,1L,0xEEC01B30L},{0xAD222DD9L,1L,0x7FC6FB02L,1L},{1L,(-6L),0x7FC6FB02L,0x7FC6FB02L},{0xAD222DD9L,0xAD222DD9L,1L,0x7FC6FB02L},{0xEEC01B30L,(-6L),0xEEC01B30L,1L},{0xEEC01B30L,1L,1L,0xEEC01B30L},{0xAD222DD9L,1L,0x7FC6FB02L,1L}};
+ uint16_t l_1109 = 65534UL;
+ int i, j;
+ (*l_1051) |= l_1013;
+ l_1109++;
+ if (l_789)
+ break;
+ }
+ for (l_976 = 3; (l_976 >= 1); l_976 -= 1)
+ { /* block id: 477 */
+ union U2 l_1112 = {0x95AB76F0L};
+ (**l_948) = (void*)0;
+ return l_1112;
+ }
+ }
+ }
+ if (l_751)
+ break;
+ if ((((*l_876) = (safe_rshift_func_int16_t_s_s((safe_div_func_int32_t_s_s((safe_lshift_func_int8_t_s_s(((*g_318) , ((safe_mul_func_uint16_t_u_u((l_822[0][5] == ((l_983 <= l_759) > ((((safe_rshift_func_int16_t_s_s(0x99CFL, 1)) , (safe_rshift_func_uint8_t_u_u(l_1042, 5))) <= (((*l_1128) = ((*l_1125) = (void*)0)) == (void*)0)) < ((g_149 != l_1130) > l_943[0][6][1])))), 7L)) == 0x7FA5L)), l_857[3][1][2])), l_822[2][5])), 11))) | 0xFEL))
+ { /* block id: 487 */
+ int32_t *l_1131 = &l_982;
+ for (l_1038 = 0; l_1038 < 10; l_1038 += 1)
+ {
+ l_870[l_1038] = &l_871;
+ }
+ (*l_1131) |= (0xE835L >= 1L);
+ }
+ else
+ { /* block id: 490 */
+ int32_t l_1132 = 3L;
+ const uint32_t l_1157 = 0xC3A60DA1L;
+ int8_t l_1158 = 1L;
+ int32_t l_1168 = 1L;
+ int32_t l_1169 = 8L;
+ int32_t l_1170 = 0xAC0D721EL;
+ int32_t l_1173 = 0xFDFA3AE3L;
+ int32_t l_1174[6] = {0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L};
+ int32_t *l_1229 = &l_1182;
+ int32_t *l_1230 = &l_1185;
+ int32_t *l_1231[7];
+ int i;
+ for (i = 0; i < 7; i++)
+ l_1231[i] = &l_1190;
+ for (l_979 = 5; (l_979 >= 0); l_979 -= 1)
+ { /* block id: 493 */
+ uint8_t l_1135 = 8UL;
+ int32_t *l_1138 = &g_89;
+ int32_t l_1171 = (-3L);
+ int32_t l_1172 = 0x574353F2L;
+ int32_t l_1175 = 0x9B33C241L;
+ int32_t l_1176 = 0x272F75CEL;
+ int32_t l_1177 = 5L;
+ int32_t l_1179[3];
+ union U1 l_1207 = {4294967295UL};
+ int i;
+ for (i = 0; i < 3; i++)
+ l_1179[i] = 0L;
+ if (l_1132)
+ break;
+ (*l_1138) = ((0L > ((l_943[0][3][1] & (l_1132 ^ (l_1135 != ((safe_mul_func_uint16_t_u_u(l_1135, 65535UL)) ^ ((l_975 , 2UL) >= (0x64L & l_1135)))))) , l_1135)) && 0UL);
+ if (((**l_817) , (((safe_mul_func_int16_t_s_s((((+0L) & (safe_mod_func_int8_t_s_s((((*l_880) |= (safe_mul_func_int16_t_s_s(((((((((*l_1138) == (((*l_909)++) < (((*l_871) = l_1132) & (safe_div_func_uint64_t_u_u(((*l_1138) < (safe_lshift_func_int8_t_s_s((l_1132 | ((safe_add_func_int8_t_s_s(((((safe_mul_func_uint8_t_u_u((((l_1132 > l_974) ^ (safe_mod_func_uint64_t_u_u(((1UL > 0x8F25A903L) == (*g_931)), l_789))) , (*l_1138)), g_627)) == (*l_1138)) == (*l_1138)) , (*l_1138)), 1L)) & l_918[1])), 2))), (*g_318)))))) != (*g_318)) || l_1132) > (-1L)) || 8L) != l_1132) ^ l_1132), l_1157))) & (*g_931)), 0x0CL))) <= 0L), 0x96EEL)) != l_1158) , (*l_1138))))
+ { /* block id: 499 */
+ int32_t *l_1159 = &l_759;
+ int32_t *l_1160 = &l_980;
+ int32_t *l_1161 = &l_981;
+ int32_t *l_1162 = &g_92;
+ int32_t *l_1163 = &l_1041;
+ int32_t *l_1164 = (void*)0;
+ int32_t *l_1165 = &l_791;
+ int32_t *l_1166 = (void*)0;
+ int32_t *l_1167[4] = {&l_964,&l_964,&l_964,&l_964};
+ int i;
+ g_1198[6][3]--;
+ (**l_948) = &l_976;
+ if (l_1158)
+ continue;
+ }
+ else
+ { /* block id: 503 */
+ uint32_t l_1219 = 0x008FA38AL;
+ (*l_1138) = (((0xEFL < ((safe_div_func_uint64_t_u_u((safe_mul_func_int16_t_s_s(((*g_931) ^ ((~0x1F9CBF83EE15EE48LL) ^ ((((l_1207 , (*g_244)) < ((safe_add_func_uint64_t_u_u((safe_mul_func_uint8_t_u_u((l_1212[3][2][7] , l_1192[5][0]), (safe_add_func_uint32_t_u_u(((safe_sub_func_uint16_t_u_u((((safe_lshift_func_int16_t_s_s(((**l_817) , (((l_1219 == 65533UL) || 0xDF1FE933C61F5786LL) > 0x2F60BAB9L)), l_792)) < 7L) , l_1173), (-1L))) <= (-7L)), l_1174[5])))), (*l_1138))) > g_231[2][3][1].f1)) , 0UL) || 0x45C9L))), 0xB438L)), 0xD8DBB58FFCFC04ADLL)) & 1L)) >= (-7L)) | (*l_1138));
+ }
+ for (l_1173 = 0; (l_1173 >= 0); l_1173 -= 1)
+ { /* block id: 508 */
+ int32_t l_1226 = 0xE9D9050BL;
+ int16_t *l_1227 = &l_1101;
+ (*l_1138) = ((safe_sub_func_int16_t_s_s(((*l_1227) = ((((((*l_1138) > (((*g_604) = &p_21) == &p_21)) && g_814.f0) , 1L) != (((*g_912) = (safe_div_func_int64_t_s_s(l_1174[5], ((((void*)0 == &g_1075) , (*l_883)) , g_53[1])))) == l_1194)) > l_1226)), 0xCE39L)) ^ l_1226);
+ }
+ for (l_792 = 0; (l_792 <= 0); l_792 += 1)
+ { /* block id: 516 */
+ uint32_t l_1228 = 3UL;
+ (*l_1138) |= l_1228;
+ }
+ }
+ l_1233++;
+ (**l_948) = l_1236[2][7][2];
+ }
+ }
+ }
+ l_1241++;
+ for (g_706 = 2; (g_706 >= 0); g_706 -= 1)
+ { /* block id: 528 */
+ int32_t l_1244 = 4L;
+ int32_t l_1245 = 0x5B87C714L;
+ int32_t l_1246[8][9][3] = {{{(-5L),0xB5ED473FL,0L},{1L,1L,0xF457B790L},{(-1L),1L,1L},{1L,0xA309F180L,0xFFF59FB6L},{(-5L),1L,0xFFF59FB6L},{0x10A1A9AFL,0xFFF59FB6L,1L},{5L,0L,0xF457B790L},{0xFFF59FB6L,0xFFF59FB6L,0L},{1L,1L,0x14D48AFEL}},{{1L,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L}},{{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L}},{{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L}},{{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)}},{{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)}},{{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L}},{{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)}}};
+ uint32_t l_1247 = 0UL;
+ int16_t l_1250 = 0L;
+ uint32_t l_1253 = 5UL;
+ int32_t l_1257[9] = {(-7L),0x6AB92E35L,4L,4L,(-7L),4L,4L,(-7L),4L};
+ int16_t l_1263[8][8] = {{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL}};
+ union U0 *l_1291 = (void*)0;
+ int8_t l_1292 = 0xCBL;
+ union U2 ***l_1297 = &g_54;
+ uint32_t *****l_1338[6][9] = {{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337},{(void*)0,&l_1337,&l_1337,(void*)0,(void*)0,&l_1337,&l_1337,&l_1337,&l_1337},{(void*)0,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,(void*)0,&l_1337,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337,(void*)0,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337,&l_1337}};
+ int i, j, k;
+ l_1247--;
+ ++l_1253;
+ }
+ return (*g_222);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_53
+ * writes: g_706 g_444
+ */
+static int8_t func_26(const int64_t p_27, uint32_t p_28, uint64_t p_29, union U2 p_30)
+{ /* block id: 322 */
+ int64_t l_678[10] = {0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL};
+ int32_t *l_679 = &g_111[1][3];
+ int32_t *l_680 = &g_111[1][3];
+ int32_t *l_681 = &g_111[1][3];
+ int32_t *l_682 = &g_89;
+ int32_t *l_683 = (void*)0;
+ int32_t *l_684 = &g_111[6][3];
+ int32_t *l_685 = &g_111[1][3];
+ int32_t *l_686 = &g_111[4][8];
+ int32_t *l_687 = &g_89;
+ int32_t *l_688 = &g_92;
+ int32_t *l_689 = &g_89;
+ int32_t *l_690 = &g_111[7][0];
+ int32_t l_691 = (-1L);
+ int32_t *l_692 = &g_92;
+ int32_t *l_693 = &l_691;
+ int32_t *l_694 = &g_111[1][3];
+ int32_t *l_695 = (void*)0;
+ int32_t *l_696 = &g_111[1][3];
+ int32_t l_697 = 0x8F752B8FL;
+ int32_t *l_698 = &g_111[2][4];
+ int32_t *l_699[6][5][7] = {{{(void*)0,&l_691,&g_89,&g_111[1][1],(void*)0,&l_691,&g_89},{&l_691,(void*)0,&l_691,&g_89,&l_691,&g_89,&g_111[1][3]},{&g_111[1][5],&l_691,&g_89,&g_89,&g_111[0][3],&g_111[1][3],&l_697},{(void*)0,&l_691,&l_697,&l_697,&l_697,&l_691,&g_89},{&g_111[1][3],&g_89,&l_697,&g_111[1][3],&g_89,&l_691,&l_691}},{{&g_111[1][3],&g_92,&g_111[1][3],&g_111[1][3],&g_92,&g_111[1][3],&g_111[7][4]},{&g_111[1][1],&g_89,(void*)0,&g_92,(void*)0,&g_89,&g_111[7][8]},{&g_89,(void*)0,&l_691,&g_111[7][4],&g_111[1][1],&l_691,&g_89},{(void*)0,&g_111[1][3],(void*)0,&l_697,(void*)0,&l_691,&g_89},{&g_92,&l_691,(void*)0,&g_89,&g_111[1][3],&l_691,&g_89}},{{&l_697,&g_92,(void*)0,(void*)0,&g_111[1][3],&l_691,&l_691},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_92,&g_111[1][3],&g_111[7][4],&l_697,(void*)0,&g_89,&g_89},{&l_691,&l_691,&g_89,&g_111[0][8],&l_697,&l_697,&g_111[7][4]},{&g_92,&l_697,&g_92,&g_92,&l_691,(void*)0,&g_89}},{{(void*)0,&l_691,&g_89,&l_697,&g_111[1][2],(void*)0,(void*)0},{&l_697,&g_89,&l_691,&l_697,(void*)0,&l_691,(void*)0},{&g_92,(void*)0,(void*)0,&g_92,&g_89,&g_89,&l_691},{(void*)0,&g_92,&g_111[1][1],&g_111[0][8],(void*)0,&l_697,&g_111[7][8]},{(void*)0,&g_89,&l_691,&l_697,&l_691,&g_89,&l_691}},{{(void*)0,&l_697,&g_111[1][5],(void*)0,(void*)0,&g_89,(void*)0},{&l_697,&l_697,&g_92,(void*)0,&g_89,&g_111[7][8],(void*)0},{&g_111[7][8],(void*)0,&g_92,&g_89,&g_89,&g_89,&g_89},{&g_111[1][5],&g_111[1][1],&g_111[1][5],&l_697,&g_111[0][8],&g_111[1][2],&g_111[7][4]},{&g_89,&g_111[0][8],&l_691,(void*)0,(void*)0,&g_92,&g_89}},{{&g_111[1][3],&l_697,&g_111[1][1],&l_691,&g_111[0][3],&g_111[1][2],(void*)0},{&l_691,&l_691,(void*)0,&g_92,&g_111[1][1],&g_89,&l_691},{&g_111[1][2],(void*)0,&l_691,&l_697,&g_111[1][3],&g_111[7][8],&g_89},{&g_111[0][8],(void*)0,&g_89,&g_89,&g_92,&g_89,&g_89},{&l_691,&l_691,&g_92,&g_111[1][2],&l_691,&g_89,(void*)0}}};
+ int64_t l_700 = 1L;
+ int16_t l_701 = 8L;
+ int32_t l_702[1][6][7] = {{{0L,1L,0x18B116A3L,0L,0x18B116A3L,1L,0L},{8L,0xF5B73F85L,3L,0x8478EF1FL,0xF5B73F85L,0x8478EF1FL,3L},{0L,0L,0x04248741L,(-1L),(-5L),0x04248741L,(-5L)},{6L,3L,3L,6L,0x8478EF1FL,8L,6L},{(-1L),(-5L),0x18B116A3L,0x18B116A3L,(-5L),(-1L),1L},{0xFEB019D1L,3L,0xF5B73F85L,8L,8L,0xF5B73F85L,3L}}};
+ int8_t l_703 = 5L;
+ int16_t l_704 = 0x19F2L;
+ int8_t l_705 = (-1L);
+ int32_t l_707 = 0xCB0D6A35L;
+ int32_t l_708 = 0xC949726BL;
+ int8_t l_709[10] = {0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L};
+ int64_t l_710 = (-1L);
+ uint32_t l_711 = 1UL;
+ uint16_t l_714 = 0xFD9EL;
+ int i, j, k;
+ l_711--;
+ l_714--;
+ for (g_706 = (-3); (g_706 > (-9)); g_706--)
+ { /* block id: 327 */
+ union U0 *l_723 = &g_229[1][0][4];
+ uint16_t *l_734 = &g_444;
+ uint32_t l_735 = 8UL;
+ uint64_t *l_736 = &g_223.f3;
+ uint64_t *l_737 = &g_10[9].f3;
+ uint64_t *l_738 = &g_223.f3;
+ uint64_t *l_739 = (void*)0;
+ uint64_t *l_740 = &g_223.f3;
+ uint64_t *l_741 = &g_223.f3;
+ uint64_t *l_742 = &g_223.f3;
+ uint64_t *l_743 = &g_10[9].f3;
+ uint64_t *l_744 = &g_223.f3;
+ int32_t l_745 = 0x1A8AE3E5L;
+ int32_t l_746[6] = {0x10D458ECL,0x5D95F8E7L,0x10D458ECL,0x10D458ECL,0x5D95F8E7L,0x10D458ECL};
+ int i;
+ l_746[5] ^= (((safe_mul_func_int16_t_s_s((((safe_mul_func_int8_t_s_s(((p_30.f0 , l_723) != l_723), (0x10ED398AEA39893FLL < ((safe_mul_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s((g_428[0][0][2] , (((*l_692) & (0xD0L < (safe_mod_func_uint32_t_u_u((safe_div_func_uint64_t_u_u((l_745 ^= (((safe_lshift_func_uint8_t_u_u((((*l_734) &= 6UL) > p_28), 7)) , (*l_693)) > l_735)), 0x48414B2CEFF21B1FLL)), 4UL)))) , g_10[9].f4)), 1UL)) || 18446744073709551615UL), g_89)) & p_30.f0)))) == p_29) >= 0xEEE62B04L), (*l_684))) < 4UL) , p_30.f2);
+ return g_149;
+ }
+ return g_53[2];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static uint8_t func_33(union U2 * p_34, uint32_t p_35, union U0 p_36, uint8_t p_37, union U2 * p_38)
+{ /* block id: 319 */
+ int32_t *l_676 = (void*)0;
+ int32_t **l_677 = &l_676;
+ (*l_677) = l_676;
+ return p_37;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_231.f1
+ * writes:
+ */
+static uint32_t func_40(union U2 * p_41, union U2 ** p_42, union U2 * p_43)
+{ /* block id: 9 */
+ uint64_t l_55 = 0x80453D47EBDCF28DLL;
+ uint8_t *l_86 = &g_2;
+ int32_t l_113[10] = {0xF63A0E5FL,(-1L),0xBFF73A4BL,(-1L),0xF63A0E5FL,0xF63A0E5FL,(-1L),0xBFF73A4BL,(-1L),0xF63A0E5FL};
+ uint32_t l_152[1];
+ int64_t *l_176[6][9][4];
+ uint32_t l_196 = 0x2BEC0524L;
+ int32_t *l_204 = &l_113[4];
+ union U2 l_217 = {7L};
+ union U0 *l_228[10] = {&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0};
+ union U0 *l_230 = &g_231[2][3][1];
+ const union U0 *l_254[10][2][7] = {{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}}};
+ uint8_t l_273 = 0x57L;
+ int64_t l_401 = 0xD80C2B337075255ALL;
+ int32_t l_412 = 0xFC3C03E8L;
+ const uint16_t *l_449 = (void*)0;
+ int32_t * const *l_468[3];
+ int32_t * const **l_467 = &l_468[1];
+ uint16_t l_530 = 0x994DL;
+ uint64_t l_546 = 0UL;
+ int32_t ***l_550 = (void*)0;
+ union U1 l_561 = {0x4A4BD98AL};
+ uint64_t l_565 = 1UL;
+ int64_t l_630 = 0x4F210B20CA5980E1LL;
+ uint8_t l_639 = 251UL;
+ int16_t *l_640 = (void*)0;
+ int16_t *l_641 = (void*)0;
+ int16_t *l_642 = &g_507;
+ uint32_t l_643 = 0x1483458EL;
+ uint64_t l_644 = 0x4B3D7633749DC52FLL;
+ uint8_t l_645[10][1] = {{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L}};
+ uint64_t l_646[3][1];
+ int32_t l_647 = 0x551C0AE0L;
+ uint32_t l_666 = 0UL;
+ uint8_t l_667[3];
+ uint32_t *l_668 = (void*)0;
+ uint32_t *l_669 = &l_152[0];
+ uint32_t l_670 = 9UL;
+ int16_t *l_671 = &g_75;
+ int32_t l_672 = 0x0446CA0FL;
+ int8_t l_673[3][6];
+ int32_t l_674[9] = {(-1L),(-4L),(-1L),(-4L),(-1L),(-4L),(-1L),(-4L),(-1L)};
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ l_152[i] = 0x975F8E47L;
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 9; j++)
+ {
+ for (k = 0; k < 4; k++)
+ l_176[i][j][k] = &g_149;
+ }
+ }
+ for (i = 0; i < 3; i++)
+ l_468[i] = &l_204;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 1; j++)
+ l_646[i][j] = 5UL;
+ }
+ for (i = 0; i < 3; i++)
+ l_667[i] = 255UL;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 6; j++)
+ l_673[i][j] = 0x09L;
+ }
+ return g_231[2][3][1].f1;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static int16_t func_66(uint8_t * const p_67, int64_t p_68, union U2 *** const p_69)
+{ /* block id: 26 */
+ return p_68;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_93
+ * writes: g_93
+ */
+static uint8_t * func_70(int64_t p_71, int32_t p_72, uint8_t * p_73)
+{ /* block id: 23 */
+ int32_t *l_87 = (void*)0;
+ int32_t *l_88 = &g_89;
+ int32_t *l_90 = &g_89;
+ int32_t *l_91[7];
+ uint8_t *l_96 = &g_53[4];
+ int i;
+ for (i = 0; i < 7; i++)
+ l_91[i] = &g_89;
+ ++g_93;
+ return l_96;
+}
+
+
+
+
+/* ---------------------------------------- */
+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);
+ for (i = 0; i < 10; i++)
+ {
+ transparent_crc(g_10[i].f0, "g_10[i].f0", print_hash_value);
+ transparent_crc(g_10[i].f1, "g_10[i].f1", print_hash_value);
+ transparent_crc(g_10[i].f2, "g_10[i].f2", print_hash_value);
+ transparent_crc(g_10[i].f4, "g_10[i].f4", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_49, "g_49", print_hash_value);
+ for (i = 0; i < 6; i++)
+ {
+ transparent_crc(g_53[i], "g_53[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_75, "g_75", print_hash_value);
+ transparent_crc(g_89, "g_89", print_hash_value);
+ transparent_crc(g_92, "g_92", print_hash_value);
+ transparent_crc(g_93, "g_93", print_hash_value);
+ transparent_crc(g_101, "g_101", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 9; j++)
+ {
+ transparent_crc(g_111[i][j], "g_111[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_147, "g_147", print_hash_value);
+ transparent_crc(g_149, "g_149", print_hash_value);
+ transparent_crc(g_223.f0, "g_223.f0", print_hash_value);
+ transparent_crc(g_223.f1, "g_223.f1", print_hash_value);
+ transparent_crc(g_223.f2, "g_223.f2", print_hash_value);
+ transparent_crc(g_223.f4, "g_223.f4", print_hash_value);
+ transparent_crc(g_226.f0, "g_226.f0", print_hash_value);
+ transparent_crc(g_226.f1, "g_226.f1", print_hash_value);
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 5; k++)
+ {
+ transparent_crc(g_229[i][j][k].f0, "g_229[i][j][k].f0", print_hash_value);
+ transparent_crc(g_229[i][j][k].f1, "g_229[i][j][k].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 9; j++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ transparent_crc(g_231[i][j][k].f1, "g_231[i][j][k].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_245, "g_245", print_hash_value);
+ transparent_crc(g_255.f0, "g_255.f0", print_hash_value);
+ transparent_crc(g_255.f1, "g_255.f1", print_hash_value);
+ transparent_crc(g_319, "g_319", print_hash_value);
+ transparent_crc(g_375, "g_375", print_hash_value);
+ for (i = 0; i < 8; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ transparent_crc(g_428[i][j][k].f0, "g_428[i][j][k].f0", print_hash_value);
+ transparent_crc(g_428[i][j][k].f1, "g_428[i][j][k].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_444, "g_444", print_hash_value);
+ transparent_crc(g_479, "g_479", print_hash_value);
+ transparent_crc(g_507, "g_507", print_hash_value);
+ transparent_crc(g_627, "g_627", print_hash_value);
+ transparent_crc(g_706, "g_706", print_hash_value);
+ transparent_crc(g_814.f0, "g_814.f0", print_hash_value);
+ transparent_crc(g_814.f1, "g_814.f1", print_hash_value);
+ transparent_crc(g_814.f2, "g_814.f2", print_hash_value);
+ transparent_crc(g_814.f4, "g_814.f4", print_hash_value);
+ transparent_crc(g_1007, "g_1007", print_hash_value);
+ transparent_crc(g_1178, "g_1178", print_hash_value);
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ transparent_crc(g_1198[i][j], "g_1198[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_1232, "g_1232", print_hash_value);
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 5; k++)
+ {
+ transparent_crc(g_1399[i][j][k], "g_1399[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ for (i = 0; i < 2; i++)
+ {
+ transparent_crc(g_1574[i].f0, "g_1574[i].f0", print_hash_value);
+ transparent_crc(g_1574[i].f1, "g_1574[i].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_1582, "g_1582", print_hash_value);
+ transparent_crc(g_1693, "g_1693", print_hash_value);
+ transparent_crc(g_1695, "g_1695", print_hash_value);
+ transparent_crc(g_1743, "g_1743", print_hash_value);
+ transparent_crc(g_1771, "g_1771", print_hash_value);
+ for (i = 0; i < 2; i++)
+ {
+ for (j = 0; j < 4; j++)
+ {
+ for (k = 0; k < 3; k++)
+ {
+ transparent_crc(g_1864[i][j][k], "g_1864[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_2120, "g_2120", print_hash_value);
+ platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
+ return 0;
+}
+
+/************************ statistics *************************
+XXX max struct depth: 0
+breakdown:
+ depth: 0, occurrence: 713
+XXX total union variables: 42
+
+XXX non-zero bitfields defined in structs: 1
+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: 32
+breakdown:
+ indirect level: 0, occurrence: 20
+ indirect level: 1, occurrence: 6
+ indirect level: 2, occurrence: 3
+ indirect level: 3, occurrence: 3
+XXX full-bitfields structs in the program: 0
+breakdown:
+XXX times a bitfields struct's address is taken: 14
+XXX times a bitfields struct on LHS: 0
+XXX times a bitfields struct on RHS: 30
+XXX times a single bitfield on LHS: 14
+XXX times a single bitfield on RHS: 16
+
+XXX max expression depth: 42
+breakdown:
+ depth: 1, occurrence: 160
+ depth: 2, occurrence: 29
+ depth: 3, occurrence: 2
+ depth: 4, occurrence: 3
+ depth: 5, occurrence: 1
+ depth: 6, occurrence: 2
+ depth: 7, occurrence: 1
+ depth: 9, occurrence: 1
+ depth: 10, occurrence: 2
+ depth: 12, occurrence: 1
+ depth: 14, occurrence: 1
+ depth: 15, occurrence: 1
+ depth: 16, occurrence: 1
+ depth: 17, occurrence: 3
+ depth: 18, occurrence: 2
+ depth: 19, occurrence: 1
+ depth: 20, occurrence: 2
+ depth: 22, occurrence: 1
+ depth: 23, occurrence: 2
+ depth: 24, occurrence: 2
+ depth: 25, occurrence: 1
+ depth: 26, occurrence: 2
+ depth: 27, occurrence: 3
+ depth: 28, occurrence: 1
+ depth: 29, occurrence: 2
+ depth: 30, occurrence: 1
+ depth: 34, occurrence: 1
+ depth: 35, occurrence: 1
+ depth: 36, occurrence: 1
+ depth: 38, occurrence: 1
+ depth: 42, occurrence: 1
+
+XXX total number of pointers: 537
+
+XXX times a variable address is taken: 1354
+XXX times a pointer is dereferenced on RHS: 255
+breakdown:
+ depth: 1, occurrence: 229
+ depth: 2, occurrence: 25
+ depth: 3, occurrence: 1
+XXX times a pointer is dereferenced on LHS: 245
+breakdown:
+ depth: 1, occurrence: 228
+ depth: 2, occurrence: 17
+XXX times a pointer is compared with null: 50
+XXX times a pointer is compared with address of another variable: 8
+XXX times a pointer is compared with another pointer: 10
+XXX times a pointer is qualified to be dereferenced: 13484
+
+XXX max dereference level: 5
+breakdown:
+ level: 0, occurrence: 0
+ level: 1, occurrence: 1642
+ level: 2, occurrence: 237
+ level: 3, occurrence: 148
+ level: 4, occurrence: 45
+ level: 5, occurrence: 1
+XXX number of pointers point to pointers: 186
+XXX number of pointers point to scalars: 314
+XXX number of pointers point to structs: 0
+XXX percent of pointers has null in alias set: 31.3
+XXX average alias set size: 1.5
+
+XXX times a non-volatile is read: 1761
+XXX times a non-volatile is write: 847
+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: 0
+XXX backward jumps: 10
+
+XXX stmts: 154
+XXX max block depth: 5
+breakdown:
+ depth: 0, occurrence: 24
+ depth: 1, occurrence: 26
+ depth: 2, occurrence: 22
+ depth: 3, occurrence: 27
+ depth: 4, occurrence: 21
+ depth: 5, occurrence: 34
+
+XXX percentage a fresh-made variable is used: 14.7
+XXX percentage an existing variable is used: 85.3
+FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
+********************* end of statistics **********************/
+
diff --git a/tests/fuzz/15.c.txt b/tests/fuzz/15.c.txt
new file mode 100644
index 00000000..42eb1e0f
--- /dev/null
+++ b/tests/fuzz/15.c.txt
@@ -0,0 +1 @@
+checksum = B1ED5468
diff --git a/tests/fuzz/18.cpp b/tests/fuzz/18.cpp
new file mode 100644
index 00000000..b27aac1b
--- /dev/null
+++ b/tests/fuzz/18.cpp
@@ -0,0 +1,1125 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-packed-struct --lang-cpp
+ * Seed: 2604553870
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+struct S0 {
+ unsigned f0 : 21;
+ uint8_t f1;
+ const unsigned f2 : 30;
+ unsigned f3 : 8;
+ signed f4 : 13;
+ unsigned f5 : 5;
+ unsigned f6 : 18;
+ unsigned f7 : 3;
+};
+
+struct S1 {
+ const int32_t f0;
+ unsigned f1 : 9;
+ unsigned f2 : 16;
+};
+
+struct S2 {
+ int32_t f0;
+ int64_t f1;
+};
+
+/* --- GLOBAL VARIABLES --- */
+static int32_t g_2 = 9L;
+static int16_t g_27 = 0x03BEL;
+static int16_t g_38 = 6L;
+static int16_t *g_37[8][8] = {{&g_38,NULL,&g_38,&g_38,NULL,&g_38,&g_38,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,NULL,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38},{&g_38,NULL,&g_38,&g_38,NULL,&g_38,&g_38,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38},{&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38,&g_38}};
+static int32_t g_62 = 0x3DA513E6L;
+static int32_t *g_61 = &g_62;
+static uint16_t g_68 = 0xCE71L;
+static uint8_t g_78 = 0x1DL;
+static uint32_t g_114 = 0x200BAF9CL;
+static struct S2 g_121 = {0x5C255F5DL,-10L};
+static uint64_t g_159 = 0UL;
+static uint16_t g_161 = 0x490DL;
+static uint8_t g_184 = 8UL;
+static uint32_t g_187 = 0x30F3DA43L;
+static int32_t g_202 = 0x4816DB70L;
+static uint64_t g_203 = 18446744073709551615UL;
+static struct S1 g_208 = {0xB9C60537L,10,69};
+static uint32_t g_215 = 0x25330C45L;
+static int32_t g_239 = 9L;
+static int8_t g_240 = 3L;
+static int16_t g_241[4] = {0xD26EL,0xD26EL,0xD26EL,0xD26EL};
+static int64_t g_242 = 7L;
+static uint16_t g_244[3] = {65534UL,65534UL,65534UL};
+static struct S2 g_291[4][6] = {{{0L,0x2B7545660DAF5139LL},{-3L,0L},{0L,0x2B7545660DAF5139LL},{-3L,0L},{0L,0x2B7545660DAF5139LL},{-3L,0L}},{{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L},{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L},{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L}},{{0L,0x2B7545660DAF5139LL},{-3L,0L},{0L,0x2B7545660DAF5139LL},{-3L,0L},{0L,0x2B7545660DAF5139LL},{-3L,0L}},{{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L},{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L},{0x468E1691L,0x9955880D6DFFD78ALL},{-3L,0L}}};
+static uint64_t g_323 = 1UL;
+static int64_t *g_379 = &g_242;
+static int64_t **g_378[4] = {&g_379,&g_379,&g_379,&g_379};
+static const int32_t *g_385 = &g_291[0][1].f0;
+static int32_t g_386[4] = {0L,0L,0L,0L};
+static struct S0 g_408 = {1391,0xFDL,15322,15,20,0,166,1};
+static struct S0 * const g_414 = &g_408;
+static struct S0 * const *g_413[3][5] = {{NULL,NULL,&g_414,NULL,NULL},{&g_414,NULL,&g_414,&g_414,NULL},{NULL,&g_414,&g_414,NULL,&g_414}};
+static int32_t g_467 = 0x3F4F500CL;
+static uint32_t g_468 = 3UL;
+static int32_t g_476 = (-7L);
+static uint8_t *g_553 = &g_184;
+static uint8_t **g_552[9][3] = {{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553},{&g_553,&g_553,&g_553}};
+static int64_t * const **g_561 = NULL;
+static int64_t g_565 = 0L;
+static uint16_t *g_569 = &g_68;
+static uint16_t * const *g_568 = &g_569;
+static struct S2 *g_589 = &g_291[0][1];
+static struct S0 g_605 = {1424,0xCBL,22754,10,-53,2,290,0};
+static int8_t g_706 = 8L;
+static uint32_t *g_708 = &g_114;
+static uint32_t **g_707 = &g_708;
+static uint64_t g_721 = 0xC18F15E9DB4D38A5LL;
+static uint32_t g_732[5] = {4UL,4UL,4UL,4UL,4UL};
+
+
+/* --- FORWARD DECLARATIONS --- */
+static uint16_t func_1(void);
+static struct S1 func_11(uint64_t p_12, struct S0 p_13, int32_t p_14, int32_t p_15);
+static int8_t func_18(int16_t p_19, struct S0 p_20, const struct S0 p_21, uint8_t p_22);
+static struct S0 func_24(const int16_t p_25);
+static const struct S0 func_32(int16_t * p_33, int16_t * p_34, int16_t * p_35, uint32_t p_36);
+static int16_t * func_39(int16_t * p_40, struct S2 p_41, const int16_t p_42);
+static struct S2 func_43(uint64_t p_44, int8_t p_45, int64_t p_46, const int16_t * p_47, int32_t p_48);
+static uint64_t func_49(int16_t * p_50, int16_t * p_51, uint8_t p_52);
+static int16_t * func_53(uint8_t p_54);
+static const int32_t * func_63(uint16_t p_64, uint32_t p_65);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_37 g_38 g_68 g_62 g_78 g_61 g_114 g_121 g_159 g_187 g_203 g_215 g_161 g_244 g_202 g_241 g_242 g_208 g_323 g_378 g_291.f0 g_386 g_385 g_184 g_413 g_379 g_240 g_569 g_408.f1 g_565 g_706 g_707 g_568 g_467 g_721 g_732 g_408.f0 g_708 g_476 g_589 g_291
+ * writes: g_2 g_27 g_61 g_68 g_78 g_62 g_114 g_38 g_121.f1 g_121.f0 g_159 g_161 g_187 g_203 g_215 g_244 g_184 g_242 g_291 g_323 g_378 g_385 g_413 g_240 g_552 g_589 g_467 g_241 g_721 g_732 g_476 g_706
+ */
+static uint16_t func_1(void)
+{ /* block id: 0 */
+ int32_t l_23 = 0x5ECCE35AL;
+ int16_t *l_55 = &g_38;
+ const int32_t l_409 = (-1L);
+ int8_t l_740[6];
+ struct S0 l_770[6][4] = {{{194,0x1EL,26558,5,45,3,258,0},{560,246UL,5062,13,1,2,403,1},{194,0x1EL,26558,5,45,3,258,0},{194,0x1EL,26558,5,45,3,258,0}},{{560,246UL,5062,13,1,2,403,1},{560,246UL,5062,13,1,2,403,1},{426,7UL,3307,9,-84,3,210,1},{560,246UL,5062,13,1,2,403,1}},{{560,246UL,5062,13,1,2,403,1},{194,0x1EL,26558,5,45,3,258,0},{194,0x1EL,26558,5,45,3,258,0},{560,246UL,5062,13,1,2,403,1}},{{194,0x1EL,26558,5,45,3,258,0},{560,246UL,5062,13,1,2,403,1},{194,0x1EL,26558,5,45,3,258,0},{194,0x1EL,26558,5,45,3,258,0}},{{560,246UL,5062,13,1,2,403,1},{560,246UL,5062,13,1,2,403,1},{426,7UL,3307,9,-84,3,210,1},{560,246UL,5062,13,1,2,403,1}},{{560,246UL,5062,13,1,2,403,1},{194,0x1EL,26558,5,45,3,258,0},{194,0x1EL,26558,5,45,3,258,0},{560,246UL,5062,13,1,2,403,1}}};
+ int i, j;
+ for (i = 0; i < 6; i++)
+ l_740[i] = 0L;
+ for (g_2 = 0; (g_2 >= (-27)); g_2--)
+ { /* block id: 3 */
+ int16_t *l_26 = &g_27;
+ int32_t l_738[1][3];
+ int32_t *l_792[9][5];
+ int i, j;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 3; j++)
+ l_738[i][j] = 0x140016D3L;
+ }
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 5; j++)
+ l_792[i][j] = &g_291[0][1].f0;
+ }
+ l_23 = (safe_mod_func_int32_t_s_s((safe_rshift_func_int16_t_s_s((safe_div_func_int16_t_s_s((0xFDEB7727L != (func_11((safe_mul_func_int8_t_s_s(func_18(l_23, func_24(((*l_26) = 1L)), func_32(g_37[1][3], l_26, func_39(&g_38, func_43(func_49(func_53((NULL != l_55)), &g_38, g_38), g_386[0], l_23, &g_241[2], l_23), l_409), l_738[0][1]), l_740[4]), g_386[2])), l_770[4][1], l_770[4][1].f2, l_738[0][1]) , (*g_385))), l_738[0][1])), l_738[0][0])), l_770[4][1].f0));
+ }
+ return l_740[0];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_589 g_291 g_467 g_208
+ * writes: g_291 g_467
+ */
+static struct S1 func_11(uint64_t p_12, struct S0 p_13, int32_t p_14, int32_t p_15)
+{ /* block id: 356 */
+ int32_t *l_774 = NULL;
+ int32_t *l_775 = &g_386[3];
+ int32_t l_776 = (-4L);
+ int32_t *l_777 = &g_476;
+ int32_t *l_778 = &g_386[3];
+ int32_t *l_779 = &g_291[0][1].f0;
+ int32_t *l_780 = &g_467;
+ int32_t *l_781 = &g_121.f0;
+ int32_t *l_782 = NULL;
+ int32_t *l_783 = NULL;
+ int32_t *l_784 = &g_121.f0;
+ int32_t *l_785 = &l_776;
+ int32_t *l_786 = &g_386[3];
+ int32_t *l_787 = &g_476;
+ int32_t *l_788[5];
+ uint32_t l_789 = 4294967295UL;
+ int i;
+ for (i = 0; i < 5; i++)
+ l_788[i] = &g_467;
+ (*g_589) = (*g_589);
+ for (g_467 = (-24); (g_467 >= (-17)); g_467 = safe_add_func_int16_t_s_s(g_467, 2))
+ { /* block id: 360 */
+ struct S2 l_773 = {7L,0L};
+ (*g_589) = l_773;
+ }
+ l_789--;
+ return g_208;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_408.f0 g_708 g_114 g_467 g_476 g_408.f1 g_61 g_386
+ * writes: g_476 g_240 g_706 g_62 g_61
+ */
+static int8_t func_18(int16_t p_19, struct S0 p_20, const struct S0 p_21, uint8_t p_22)
+{ /* block id: 344 */
+ int16_t l_743[9] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)};
+ int32_t l_752 = (-4L);
+ int32_t *l_753 = &g_476;
+ struct S2 **l_758 = &g_589;
+ int8_t *l_759 = NULL;
+ int8_t *l_760 = &g_240;
+ int8_t *l_761 = NULL;
+ int8_t *l_762 = &g_706;
+ int32_t l_763[5][9] = {{0x84E88DC3L,0x30E877D1L,0x84E88DC3L,0x128A5967L,0x128A5967L,0x84E88DC3L,0x30E877D1L,0x84E88DC3L,0x128A5967L},{0x84E88DC3L,0x128A5967L,0x128A5967L,0x84E88DC3L,0x30E877D1L,0x84E88DC3L,0x128A5967L,0x128A5967L,0x84E88DC3L},{0x8A917A69L,0x128A5967L,0L,0x128A5967L,0x8A917A69L,0x8A917A69L,0x128A5967L,0L,0x128A5967L},{0x128A5967L,0x30E877D1L,0L,0L,0x30E877D1L,0x128A5967L,0x30E877D1L,0L,0L},{0x8A917A69L,0x8A917A69L,0x128A5967L,0L,0x128A5967L,0x8A917A69L,0x8A917A69L,0x128A5967L,0L}};
+ int32_t *l_764 = &g_62;
+ uint32_t *l_765[3];
+ uint16_t l_766 = 0xF503L;
+ int32_t **l_769 = &g_61;
+ int i, j;
+ for (i = 0; i < 3; i++)
+ l_765[i] = &g_187;
+ (*l_764) = (l_763[4][6] = (((safe_add_func_uint16_t_u_u(l_743[0], (!((l_743[6] > ((safe_div_func_uint64_t_u_u((safe_add_func_uint32_t_u_u(l_743[8], (((*l_762) = ((*l_760) = ((safe_lshift_func_int16_t_s_u(((p_21.f3 < (safe_mod_func_int64_t_s_s(((((*l_753) = (l_752 = p_20.f1)) <= (safe_div_func_int8_t_s_s((safe_mod_func_int16_t_s_s(0xB8ECL, (p_20.f2 | ((((g_408.f0 , ((((p_21.f2 , p_21.f0) != (*g_708)) != 0x4E7498EBL) , l_758)) == NULL) , 0L) , 0xBFE5L)))), 0x90L))) != 0xE0L), g_467))) , (*l_753)), 14)) && 65535UL))) & g_408.f1))), 1L)) < l_743[0])) ^ p_20.f2)))) ^ 0L) >= l_743[0]));
+ (*l_769) = &g_386[2];
+ return (**l_769);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static struct S0 func_24(const int16_t p_25)
+{ /* block id: 5 */
+ uint8_t l_28 = 1UL;
+ struct S0 l_31 = {1310,250UL,6302,7,41,3,97,1};
+ --l_28;
+ return l_31;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static const struct S0 func_32(int16_t * p_33, int16_t * p_34, int16_t * p_35, uint32_t p_36)
+{ /* block id: 342 */
+ const struct S0 l_739[6][2] = {{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}},{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}},{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}},{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}},{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}},{{320,0x7AL,32637,2,-27,2,378,0},{320,0x7AL,32637,2,-27,2,378,0}}};
+ int i, j;
+ return l_739[2][1];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_385 g_62 g_2 g_68 g_184 g_413 g_244 g_208.f0 g_121.f0 g_61 g_114 g_379 g_240 g_291.f0 g_569 g_242 g_121.f1 g_408.f1 g_38 g_241 g_565 g_706 g_707 g_568 g_467 g_721 g_732
+ * writes: g_68 g_61 g_184 g_413 g_78 g_121.f0 g_242 g_240 g_215 g_38 g_244 g_552 g_589 g_467 g_241 g_721 g_732
+ */
+static int16_t * func_39(int16_t * p_40, struct S2 p_41, const int16_t p_42)
+{ /* block id: 206 */
+ struct S0 *l_412 = &g_408;
+ struct S0 ** const l_411 = &l_412;
+ int32_t l_433 = 0x4FB4C694L;
+ struct S2 l_438 = {-10L,1L};
+ int32_t l_485 = 0x47EB926BL;
+ int32_t l_489 = (-5L);
+ int32_t l_491 = (-5L);
+ int32_t l_497[1][2][7] = {{{1L,0x49C8437AL,0x027D64C9L,0x027D64C9L,0x49C8437AL,1L,0x49C8437AL},{0L,1L,1L,0L,0x49C8437AL,0L,1L}}};
+ int16_t l_566 = (-6L);
+ int64_t **l_571 = &g_379;
+ uint8_t *l_616 = &g_78;
+ const struct S1 l_690 = {8L,21,198};
+ struct S2 *l_701[10][4];
+ uint64_t *l_704 = &g_159;
+ uint64_t **l_703 = &l_704;
+ uint32_t l_715 = 0x9F38D7D3L;
+ int32_t l_718 = 0x12E69001L;
+ int8_t l_719 = 0xD2L;
+ int32_t *l_724 = &g_121.f0;
+ int32_t *l_725 = &g_476;
+ int32_t *l_726[4][7] = {{&g_291[0][1].f0,&l_497[0][0][3],&l_497[0][0][3],&g_291[0][1].f0,&l_497[0][0][3],&l_497[0][0][3],&g_291[0][1].f0},{&g_476,&l_497[0][0][3],&g_476,&g_386[0],&l_491,&g_386[0],&g_476},{&g_291[0][1].f0,&g_291[0][1].f0,&l_485,&g_291[0][1].f0,&g_291[0][1].f0,&l_485,&g_291[0][1].f0},{&l_491,&g_386[0],&g_476,&l_497[0][0][3],&g_476,&g_386[0],&l_491}};
+ int8_t l_727 = 0x0FL;
+ int32_t l_728 = 0x918BB4DCL;
+ int8_t l_729 = (-1L);
+ int64_t l_730 = 0x057B8866389C3D9ALL;
+ int32_t l_731 = 0x218CCC61L;
+ uint32_t l_735[3][8] = {{4UL,0xC3126DF4L,4294967288UL,0x0F3DCF02L,4294967295UL,0x220CCB51L,4294967295UL,0x0F3DCF02L},{0x3C85B5A0L,0x3828014FL,0x3C85B5A0L,0xAB1F2D4FL,0x0F3DCF02L,0x220CCB51L,4294967288UL,4294967288UL},{4294967288UL,0xC3126DF4L,4UL,4UL,0xC3126DF4L,4294967288UL,0x0F3DCF02L,4294967295UL}};
+ int i, j, k;
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 4; j++)
+ l_701[i][j] = &g_121;
+ }
+ if ((*g_385))
+ { /* block id: 207 */
+ const int64_t l_425 = 0L;
+ int64_t l_445[1][7][8] = {{{6L,0x5503377F6E0C2E72LL,0xDB1D715F2161BBA0LL,8L,0xC2EEBBADC442C092LL,8L,0xDB1D715F2161BBA0LL,0x5503377F6E0C2E72LL},{0L,0xDB1D715F2161BBA0LL,(-1L),8L,0x9650F0EF7A1B8096LL,0xE43D72817AE39055LL,0xE43D72817AE39055LL,0x9650F0EF7A1B8096LL},{(-9L),0x9650F0EF7A1B8096LL,0x9650F0EF7A1B8096LL,(-9L),0L,0x5503377F6E0C2E72LL,0xE43D72817AE39055LL,6L},{0xDB1D715F2161BBA0LL,(-9L),(-1L),0xE43D72817AE39055LL,(-1L),(-9L),0xDB1D715F2161BBA0LL,0xC2EEBBADC442C092LL},{(-1L),(-9L),0xDB1D715F2161BBA0LL,0xC2EEBBADC442C092LL,0x5503377F6E0C2E72LL,0x5503377F6E0C2E72LL,0xC2EEBBADC442C092LL,0xDB1D715F2161BBA0LL},{0x9650F0EF7A1B8096LL,0x9650F0EF7A1B8096LL,(-9L),0L,0x5503377F6E0C2E72LL,0xE43D72817AE39055LL,6L,0xE43D72817AE39055LL},{(-1L),0xDB1D715F2161BBA0LL,0L,0xDB1D715F2161BBA0LL,(-1L),8L,0x9650F0EF7A1B8096LL,0xE43D72817AE39055LL}}};
+ int32_t l_456 = 0xF544D161L;
+ int32_t l_457 = (-3L);
+ int32_t l_472 = 0x70112BE4L;
+ int32_t l_473 = (-3L);
+ int32_t l_474 = (-8L);
+ int32_t l_482 = 3L;
+ int32_t l_487 = 0xF8FC29F0L;
+ int32_t l_488 = 1L;
+ int32_t l_495 = 0x89F792B4L;
+ int32_t l_499 = 7L;
+ int32_t l_501 = 8L;
+ int32_t l_503[8][4] = {{4L,(-1L),(-1L),4L},{0x45F54343L,0xC77ACF08L,0x5D3F1EBDL,(-1L)},{0xC77ACF08L,0x923204FEL,1L,(-1L)},{(-1L),0x45F54343L,(-1L),(-1L)},{9L,0x923204FEL,9L,(-1L)},{4L,0xC77ACF08L,9L,4L},{(-1L),(-1L),0x5D3F1EBDL,0xC77ACF08L},{(-1L),0x923204FEL,0x5D3F1EBDL,0x5D3F1EBDL}};
+ int8_t l_508 = (-1L);
+ const int64_t *l_537 = &l_438.f1;
+ const int64_t **l_536 = &l_537;
+ uint8_t *l_540[1][10] = {{&g_184,&g_184,NULL,&g_184,NULL,&g_184,&g_184,NULL,&g_184,NULL}};
+ struct S1 l_567[5] = {{0x8D6E23A6L,16,120},{0x8D6E23A6L,16,120},{0x8D6E23A6L,16,120},{0x8D6E23A6L,16,120},{0x8D6E23A6L,16,120}};
+ int64_t l_572[6][1][3];
+ struct S0 *l_603 = &g_408;
+ struct S0 *l_618 = &g_605;
+ int16_t l_624 = 0xB59DL;
+ int8_t *l_683 = &g_240;
+ struct S2 **l_700[2][3][2] = {{{&g_589,&g_589},{&g_589,&g_589},{&g_589,&g_589}},{{&g_589,&g_589},{&g_589,&g_589},{&g_589,&g_589}}};
+ int16_t *l_702[4][1];
+ int8_t *l_705 = &l_508;
+ int i, j, k;
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 3; k++)
+ l_572[i][j][k] = 0xD283F39FEC0527E5LL;
+ }
+ }
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 1; j++)
+ l_702[i][j] = &g_241[3];
+ }
+ for (g_68 = 0; (g_68 <= 3); g_68 += 1)
+ { /* block id: 210 */
+ int32_t **l_410 = &g_61;
+ struct S0 **l_421[3][5] = {{&l_412,&l_412,&l_412,&l_412,&l_412},{&l_412,&l_412,&l_412,&l_412,&l_412},{&l_412,&l_412,&l_412,&l_412,&l_412}};
+ struct S1 l_442 = {0x8A5D5689L,10,57};
+ uint64_t l_448 = 0x6347FF966CC3914CLL;
+ int32_t l_471 = 1L;
+ int32_t l_478 = 8L;
+ int32_t l_480 = 0xFA8E425CL;
+ int32_t l_483 = 0x315C4785L;
+ int32_t l_484 = 0x680B5AEDL;
+ int32_t l_490 = 0xE692470BL;
+ int32_t l_496 = 0L;
+ int32_t l_498 = (-1L);
+ int32_t l_500 = 0x95A5B8D0L;
+ int32_t l_502 = 0L;
+ int32_t l_504 = 0L;
+ int32_t l_505 = 0x05779FDBL;
+ int32_t l_506 = 0x918B72A4L;
+ int32_t l_507 = 0x2EA2263BL;
+ int32_t l_510 = 0xE311EADEL;
+ int32_t l_511 = 0x75ECBCB0L;
+ int32_t l_512 = 0x1C2CC190L;
+ int32_t l_513 = 0L;
+ int32_t l_514 = 6L;
+ int32_t l_515 = 0x0937537CL;
+ int32_t l_517 = 0x3441E561L;
+ int32_t l_518 = 0xC823A3FCL;
+ int32_t l_519 = 0x90011C2FL;
+ int32_t l_520 = 0x341C22D6L;
+ int32_t l_521 = 0x5CAAD854L;
+ int32_t l_522 = (-10L);
+ int32_t l_523 = 0x049BF5F2L;
+ int32_t l_524 = (-8L);
+ uint16_t l_525 = 65535UL;
+ int64_t ***l_590 = &g_378[0];
+ int64_t l_629 = 0x46CA53608441CAF0LL;
+ int16_t l_677 = 0L;
+ uint8_t **l_681 = &l_540[0][2];
+ int i, j;
+ (*l_410) = &g_2;
+ for (g_184 = 0; (g_184 <= 2); g_184 += 1)
+ { /* block id: 214 */
+ struct S0 * const **l_415 = NULL;
+ struct S0 * const **l_416[6];
+ uint8_t *l_424 = &g_78;
+ int32_t *l_426[2];
+ uint64_t *l_462 = &g_159;
+ uint64_t *l_463 = &g_159;
+ int16_t l_493 = 0x6E98L;
+ int8_t l_494 = 0xF3L;
+ int64_t l_509 = 0xC174661CDA2966DCLL;
+ int32_t l_516 = 0x5FDB9509L;
+ int64_t * const l_564 = &g_565;
+ int64_t * const *l_563 = &l_564;
+ int64_t * const **l_562[10] = {&l_563,&l_563,&l_563,&l_563,&l_563,&l_563,&l_563,&l_563,&l_563,&l_563};
+ int8_t *l_601 = &g_240;
+ struct S0 *l_604[2];
+ int32_t * const l_620 = &l_487;
+ int64_t l_634 = 1L;
+ struct S2 l_641 = {2L,0L};
+ int i;
+ for (i = 0; i < 6; i++)
+ l_416[i] = &g_413[0][2];
+ for (i = 0; i < 2; i++)
+ l_426[i] = NULL;
+ for (i = 0; i < 2; i++)
+ l_604[i] = &g_605;
+ g_121.f0 &= ((l_411 != (g_413[1][3] = g_413[0][2])) , (safe_add_func_int8_t_s_s((((safe_div_func_uint8_t_u_u((&l_412 == l_421[1][3]), ((NULL == (*l_411)) && g_244[g_184]))) < (((*l_424) = (((0x12C856C1CC60DBF6LL < (safe_mul_func_uint8_t_u_u((g_244[g_184] | g_208.f0), 0UL))) < 0x8AL) , 255UL)) == l_425)) >= 6UL), 3UL)));
+ for (g_242 = 0; (g_242 <= 3); g_242 += 1)
+ { /* block id: 220 */
+ int8_t *l_439 = &g_240;
+ uint16_t *l_440 = &g_244[g_184];
+ int32_t l_441 = (-1L);
+ struct S1 *l_452 = &g_208;
+ struct S1 **l_451 = &l_452;
+ int32_t l_475 = 8L;
+ int32_t l_477 = 0x536BCEFBL;
+ int32_t l_486[10] = {0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L,0x481F5BC6L};
+ int16_t l_492 = 0x66BEL;
+ uint8_t **l_541 = &l_540[0][0];
+ uint8_t ***l_554 = &l_541;
+ int32_t *l_570 = &l_516;
+ uint32_t * const l_588 = &g_114;
+ uint32_t * const *l_587[4][9][1] = {{{NULL},{NULL},{&l_588},{&l_588},{NULL},{&l_588},{&l_588},{NULL},{NULL}},{{NULL},{NULL},{NULL},{&l_588},{&l_588},{NULL},{&l_588},{&l_588},{NULL}},{{NULL},{NULL},{NULL},{NULL},{&l_588},{&l_588},{NULL},{&l_588},{&l_588}},{{NULL},{NULL},{NULL},{NULL},{NULL},{&l_588},{&l_588},{NULL},{&l_588}}};
+ int i, j, k;
+ }
+ if ((p_42 && (((safe_mod_func_int8_t_s_s(0L, (safe_add_func_int8_t_s_s((**l_410), ((g_114 >= (NULL == (*l_571))) > ((((safe_div_func_int64_t_s_s((((safe_lshift_func_int8_t_s_s((((*l_601) ^= (safe_sub_func_int16_t_s_s((-9L), ((0L <= (p_42 < 4UL)) > p_42)))) == p_41.f0), g_291[0][1].f0)) && (*g_569)) <= 0xD53C66FD4F73076ELL), p_42)) ^ p_41.f0) != 0UL) > 0xF8645B00L)))))) && (*g_379)) , l_489)))
+ { /* block id: 267 */
+ int32_t l_617 = (-7L);
+ l_495 &= ((safe_unary_minus_func_uint8_t_u((((*l_411) = l_603) != ((((l_604[1] = &g_408) != (((safe_mul_func_int16_t_s_s(((l_617 = ((*l_616) = (safe_mod_func_uint64_t_u_u(((safe_mod_func_uint64_t_u_u((g_121.f1 > (((safe_rshift_func_uint8_t_u_u((p_41.f1 , p_41.f1), ((safe_div_func_int8_t_s_s((!(l_616 == l_540[0][0])), (-1L))) && 4294967291UL))) < p_42) , 0UL)), (*g_379))) != 0xE395B63D813E0CE4LL), l_567[1].f0)))) | (-7L)), (**l_410))) , (**l_410)) , l_603)) & 0xE7L) , l_618)))) == p_41.f0);
+ }
+ else
+ { /* block id: 273 */
+ int8_t l_619 = 1L;
+ int32_t l_622 = 0x58D90218L;
+ int32_t l_627[3][2][3] = {{{0x6C7084D8L,1L,1L},{(-2L),0x656137AFL,(-2L)}},{{0x6C7084D8L,0x6C7084D8L,1L},{0xC42365C0L,0x656137AFL,0xC42365C0L}},{{0x6C7084D8L,1L,1L},{(-2L),0x656137AFL,(-2L)}}};
+ int16_t l_630 = 0x0383L;
+ uint64_t l_631 = 2UL;
+ int i, j, k;
+ if ((*g_61))
+ { /* block id: 274 */
+ return p_40;
+ }
+ else
+ { /* block id: 276 */
+ if (l_619)
+ break;
+ }
+ for (g_215 = 0; (g_215 <= 3); g_215 += 1)
+ { /* block id: 281 */
+ int32_t **l_621 = &g_61;
+ int32_t l_623 = 1L;
+ int32_t l_625 = 0x55945757L;
+ int32_t l_626 = (-10L);
+ int32_t l_628[7][6] = {{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}};
+ int i, j;
+ (*l_621) = l_620;
+ l_631--;
+ }
+ p_41.f0 &= (l_634 , (*g_385));
+ }
+ (*l_620) = (((g_408.f1 , (safe_div_func_int8_t_s_s((&g_385 == &g_61), (l_501 = 5L)))) >= (safe_mul_func_uint16_t_u_u((((**l_410) , (-9L)) || ((((((safe_mod_func_uint16_t_u_u(((l_641 , (**l_410)) != p_41.f0), p_42)) ^ (*p_40)) & 0x0CL) || 1UL) , (-3L)) >= 1L)), (*p_40)))) ^ 248UL);
+ }
+ for (l_472 = 3; (l_472 >= 0); l_472 -= 1)
+ { /* block id: 292 */
+ int i;
+ if (g_241[g_68])
+ break;
+ for (l_624 = 0; (l_624 >= 0); l_624 -= 1)
+ { /* block id: 296 */
+ int16_t *l_657[8][5][6] = {{{&g_38,&g_38,&g_38,NULL,&g_38,NULL},{&g_241[0],NULL,&g_241[3],NULL,&l_624,&g_241[g_68]},{&g_38,&g_38,&g_241[0],NULL,NULL,&g_241[3]},{NULL,&g_241[0],&g_241[3],NULL,NULL,NULL},{NULL,NULL,&l_624,&g_241[g_68],&g_241[0],&g_241[2]}},{{&g_241[2],NULL,&g_241[g_68],NULL,&g_38,NULL},{&g_38,&g_241[g_68],&g_241[3],NULL,&g_38,NULL},{&g_38,NULL,&g_38,&l_566,&g_241[3],&g_38},{NULL,NULL,&g_241[3],&g_241[3],NULL,NULL},{&g_38,&l_624,&g_241[3],&g_38,NULL,&g_241[3]}},{{NULL,NULL,&g_241[3],NULL,&g_241[3],&l_624},{&g_241[g_68],&l_624,NULL,NULL,&l_566,&l_624},{&l_624,NULL,&l_566,NULL,NULL,&g_38},{NULL,&l_566,&g_241[3],&g_241[0],NULL,&l_624},{&g_241[1],&g_241[3],NULL,&g_38,NULL,NULL}},{{NULL,&g_241[0],NULL,&g_38,&l_624,NULL},{NULL,&g_38,&l_566,&l_566,&g_241[0],NULL},{&g_241[2],&g_38,&g_241[3],&l_624,&g_38,&g_241[2]},{&g_241[0],&l_624,&g_241[2],&g_241[3],&g_241[2],&l_624},{NULL,&g_241[3],NULL,&g_241[2],&g_38,&g_241[3]}},{{&g_38,NULL,&g_241[2],&g_241[g_68],&g_38,NULL},{NULL,NULL,NULL,&l_566,&g_38,NULL},{&l_624,&g_241[3],&g_241[g_68],NULL,&g_241[2],NULL},{NULL,&l_624,NULL,NULL,&g_38,&g_241[3]},{&l_624,&g_38,&g_38,&l_566,&g_241[0],&g_38}},{{NULL,&g_38,&g_38,NULL,&l_624,&l_566},{&g_241[2],&g_241[0],&g_241[3],NULL,NULL,NULL},{&g_241[3],&g_241[3],NULL,NULL,NULL,&g_241[g_68]},{NULL,&l_566,&g_241[g_68],NULL,NULL,&g_241[g_68]},{NULL,NULL,&l_624,&g_38,&l_566,NULL}},{{&g_241[g_68],&l_624,NULL,&g_241[0],&g_241[0],&l_624},{&g_241[0],&g_241[g_68],NULL,NULL,NULL,NULL},{&l_566,NULL,&l_624,NULL,&l_624,&g_241[g_68]},{NULL,&l_624,&g_241[g_68],&l_624,&g_241[g_68],&g_241[g_68]},{NULL,&g_241[3],NULL,NULL,&g_241[3],NULL}},{{&g_241[3],&g_241[3],&g_241[3],NULL,&g_241[g_68],&l_566},{&l_566,NULL,&g_38,NULL,&g_38,&g_38},{&g_241[0],&g_241[0],&g_38,&g_241[g_68],NULL,&g_241[3]},{&g_241[g_68],NULL,NULL,NULL,&g_241[2],NULL},{&g_241[g_68],&l_624,&g_241[g_68],&g_241[3],NULL,NULL}}};
+ uint16_t *l_674 = NULL;
+ uint16_t *l_675 = &g_244[0];
+ int i, j, k;
+ if (l_497[l_624][(l_624 + 1)][(l_472 + 2)])
+ break;
+ if ((1UL ^ ((0UL >= (safe_add_func_int32_t_s_s((safe_mod_func_int8_t_s_s((l_457 = ((safe_mod_func_uint16_t_u_u(0xE961L, (safe_sub_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u((safe_lshift_func_uint16_t_u_u((l_497[l_624][(l_624 + 1)][(l_472 + 2)] != (((*p_40) = (0xA3B3L | (0x1353L ^ 4L))) && (g_408.f1 < ((*l_616) = p_41.f0)))), 6)), l_495)), g_241[g_68])))) , 0x84L)), p_41.f0)), 0x07DE3AA1L))) <= 0x6467FAD3L)))
+ { /* block id: 301 */
+ const uint16_t *l_655 = &g_244[2];
+ const uint16_t **l_654 = &l_655;
+ const uint16_t ***l_656 = &l_654;
+ (*l_656) = l_654;
+ return &g_241[3];
+ }
+ else
+ { /* block id: 304 */
+ int i, j, k;
+ l_497[l_624][l_624][(g_68 + 2)] = (&g_378[3] == &l_571);
+ if (l_438.f1)
+ continue;
+ (*l_410) = (*l_410);
+ }
+ if ((safe_rshift_func_uint16_t_u_u(((*l_675) = (((safe_div_func_uint8_t_u_u(252UL, l_474)) && (3UL ^ (((*p_40) & (safe_rshift_func_int8_t_s_s((+(l_497[l_624][(l_624 + 1)][(l_472 + 2)] || ((safe_rshift_func_uint8_t_u_s((safe_mul_func_int8_t_s_s((safe_add_func_int64_t_s_s((0UL == (safe_mul_func_uint8_t_u_u(((*g_569) , ((safe_sub_func_uint16_t_u_u((3L > l_497[0][0][2]), l_485)) & g_241[g_68])), p_41.f0))), l_438.f1)), p_41.f1)), p_41.f0)) , 255UL))), g_565))) < 0x23L))) || l_488)), l_474)))
+ { /* block id: 310 */
+ return p_40;
+ }
+ else
+ { /* block id: 312 */
+ int32_t *l_676 = &l_512;
+ (*l_676) |= 0xC60B90E3L;
+ if (l_677)
+ continue;
+ }
+ for (l_485 = 3; (l_485 >= 0); l_485 -= 1)
+ { /* block id: 318 */
+ uint8_t ***l_680 = &g_552[0][2];
+ int32_t *l_682[10] = {&l_499,&l_488,&l_499,&l_499,&l_488,&l_499,&l_499,&l_488,&l_499,&l_499};
+ int i;
+ l_490 = (safe_div_func_uint16_t_u_u((((*l_680) = &g_553) == l_681), (-5L)));
+ }
+ }
+ }
+ }
+ g_467 |= (((*l_683) = 0x75L) >= ((safe_mul_func_uint16_t_u_u(((safe_rshift_func_int16_t_s_u((safe_add_func_int32_t_s_s((l_690 , ((((((safe_add_func_int8_t_s_s(((*l_705) = (((safe_div_func_int32_t_s_s((safe_unary_minus_func_int64_t_s(((((safe_lshift_func_int16_t_s_s((l_499 |= ((*p_40) = (safe_sub_func_int32_t_s_s((*g_385), ((g_589 = (l_701[2][1] = &g_291[0][1])) != &g_291[1][3]))))), 5)) || l_438.f0) == ((-8L) < (((((p_41.f0 && p_42) & g_242) && 65533UL) >= p_41.f0) ^ 0x0575L))) || (*g_385)))), 0x74555EFDL)) , l_703) != NULL)), p_41.f1)) && g_706) >= 1UL) , (uint32_t**) NULL) == g_707) | p_41.f0)), p_41.f1)), (*g_569))) ^ (**g_568)), 0xD444L)) | 0x2E5CL));
+ return &g_241[3];
+ }
+ else
+ { /* block id: 333 */
+ int32_t *l_709 = &g_386[0];
+ int32_t *l_710 = &g_291[0][1].f0;
+ int32_t *l_711 = &g_386[0];
+ int32_t *l_712[10] = {&g_476,&g_476,&g_476,&g_476,&g_476,&g_476,&g_476,&g_476,&g_476,&g_476};
+ int8_t l_713[2][10] = {{8L,8L,8L,8L,8L,8L,8L,8L,8L,8L},{8L,8L,8L,8L,8L,8L,8L,8L,8L,8L}};
+ int8_t l_714 = (-4L);
+ int8_t l_720 = 0x74L;
+ int i, j;
+ for (g_242 = 0; g_242 < 4; g_242 += 1)
+ {
+ g_241[g_242] = 0xA2BAL;
+ }
+ ++l_715;
+ --g_721;
+ }
+ p_41.f0 |= p_42;
+ ++g_732[4];
+ --l_735[1][1];
+ return p_40;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_187 g_61 g_2 g_291.f0 g_121
+ * writes: g_242 g_68 g_291 g_203
+ */
+static struct S2 func_43(uint64_t p_44, int8_t p_45, int64_t p_46, const int16_t * p_47, int32_t p_48)
+{ /* block id: 199 */
+ struct S1 *l_389[8] = {&g_208,&g_208,&g_208,&g_208,&g_208,&g_208,&g_208,&g_208};
+ struct S2 *l_396 = &g_121;
+ uint16_t *l_399 = &g_161;
+ uint64_t *l_402 = &g_203;
+ int32_t l_403[3][3] = {{0x065366F1L,0x065366F1L,0x065366F1L},{(-1L),(-1L),(-1L)},{0x065366F1L,0x065366F1L,0x065366F1L}};
+ int64_t l_404 = 0x9AD62FCB4E69716BLL;
+ int32_t *l_405 = &g_291[0][1].f0;
+ struct S0 *l_407 = &g_408;
+ struct S0 **l_406 = &l_407;
+ int i, j;
+ for (g_242 = 0; g_242 < 4; g_242 += 1)
+ {
+ for (g_68 = 0; g_68 < 6; g_68 += 1)
+ {
+ struct S2 tmp = {0xF74DE0BBL,0xE77EDE5556FB1F53LL};
+ g_291[g_242][g_68] = tmp;
+ }
+ }
+ (*l_405) ^= (safe_mul_func_uint16_t_u_u(p_45, (!((&g_208 == l_389[7]) > ((l_403[0][0] = ((safe_rshift_func_int8_t_s_u((safe_mul_func_uint16_t_u_u((safe_mul_func_int16_t_s_s((l_396 != NULL), (safe_div_func_uint64_t_u_u(((NULL == l_399) , ((*l_402) = (l_389[7] == ((safe_add_func_int8_t_s_s(0x0DL, g_187)) , l_389[7])))), l_403[2][1])))), l_404)), l_403[2][1])) , (*g_61))) , 9UL)))));
+ (*l_406) = NULL;
+ return g_121;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_68 g_62 g_78 g_38 g_61 g_114 g_121 g_159 g_187 g_203 g_215 g_161 g_244 g_202 g_241 g_242 g_208 g_323 g_378 g_291.f0
+ * writes: g_61 g_68 g_78 g_62 g_114 g_38 g_121.f1 g_121.f0 g_159 g_161 g_187 g_203 g_215 g_244 g_184 g_242 g_291 g_323 g_378 g_385
+ */
+static uint64_t func_49(int16_t * p_50, int16_t * p_51, uint8_t p_52)
+{ /* block id: 10 */
+ int32_t *l_57 = &g_2;
+ int32_t **l_58 = NULL;
+ int32_t *l_60 = &g_2;
+ int32_t **l_59[1];
+ uint16_t *l_66 = NULL;
+ uint16_t *l_67 = &g_68;
+ const int32_t *l_384 = &g_291[0][1].f0;
+ const int32_t **l_383[7] = {&l_384,&l_384,&l_384,&l_384,&l_384,&l_384,&l_384};
+ int i;
+ for (i = 0; i < 1; i++)
+ l_59[i] = &l_60;
+ g_61 = (l_57 = l_57);
+ g_385 = func_63(((*l_67) ^= g_2), g_62);
+ g_291[0][1].f0 &= 0x21F51DF0L;
+ return g_208.f2;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads :
+ * writes:
+ */
+static int16_t * func_53(uint8_t p_54)
+{ /* block id: 8 */
+ int16_t *l_56 = NULL;
+ return l_56;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_78 g_68 g_62 g_2 g_38 g_61 g_114 g_121 g_159 g_187 g_203 g_215 g_161 g_244 g_202 g_241 g_242 g_208 g_323 g_378
+ * writes: g_78 g_62 g_114 g_38 g_121.f1 g_121.f0 g_159 g_68 g_161 g_187 g_203 g_215 g_244 g_184 g_242 g_291 g_323 g_378
+ */
+static const int32_t * func_63(uint16_t p_64, uint32_t p_65)
+{ /* block id: 14 */
+ int32_t *l_69 = NULL;
+ int32_t **l_70 = &l_69;
+ int32_t l_91 = 0xE8BE9C2CL;
+ uint16_t **l_98 = NULL;
+ uint8_t l_223 = 1UL;
+ uint8_t *l_237 = &g_184;
+ int32_t l_267 = 0x50EEFC11L;
+ uint32_t l_268 = 0x089C4C44L;
+ uint8_t l_305 = 255UL;
+ int32_t l_356 = (-1L);
+ int32_t l_358 = 0x1ABD8A15L;
+ uint32_t l_375 = 0xAF36EF52L;
+ int64_t ***l_380 = &g_378[3];
+ int64_t **l_382 = &g_379;
+ int64_t ***l_381 = &l_382;
+lbl_190:
+ (*l_70) = l_69;
+ if ((safe_rshift_func_int16_t_s_u(p_64, 10)))
+ { /* block id: 16 */
+ uint16_t *l_85[1];
+ int32_t l_89 = (-6L);
+ struct S2 l_122[6] = {{0L,0x1CD949914032C2DELL},{0L,0x1CD949914032C2DELL},{0L,0x1CD949914032C2DELL},{0L,0x1CD949914032C2DELL},{0L,0x1CD949914032C2DELL},{0L,0x1CD949914032C2DELL}};
+ struct S1 l_136 = {0L,20,34};
+ uint8_t *l_163 = &g_78;
+ struct S1 *l_207 = &g_208;
+ struct S1 *l_247 = &g_208;
+ int i;
+ for (i = 0; i < 1; i++)
+ l_85[i] = &g_68;
+ if (p_64)
+ { /* block id: 17 */
+ uint8_t *l_77 = &g_78;
+ uint16_t *l_83[2][1][1];
+ uint16_t **l_84 = &l_83[1][0][0];
+ int32_t l_88 = 1L;
+ int32_t *l_90 = NULL;
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 1; k++)
+ l_83[i][j][k] = NULL;
+ }
+ }
+ l_91 &= ((+(65535UL == ((~((safe_div_func_int16_t_s_s((((safe_div_func_int8_t_s_s(p_64, (+((((((*l_77)--) <= (safe_rshift_func_uint8_t_u_s((((*l_84) = l_83[1][0][0]) == l_85[0]), 4))) < p_64) & (g_68 <= g_62)) , ((safe_rshift_func_int16_t_s_u((g_2 ^ g_38), p_64)) & l_88))))) == (*g_61)) | p_64), l_89)) , g_62)) ^ p_65))) , p_65);
+ if (p_64)
+ { /* block id: 21 */
+ int32_t *l_92 = &g_62;
+ int32_t *l_93 = &l_89;
+ (*l_93) = ((*l_92) |= l_89);
+ }
+ else
+ { /* block id: 24 */
+ return &g_2;
+ }
+ }
+ else
+ { /* block id: 27 */
+ uint32_t *l_113 = &g_114;
+ int32_t l_115 = 1L;
+ struct S2 l_126 = {0x3EC0817FL,-8L};
+ uint8_t *l_151 = &g_78;
+ int16_t *l_182[3];
+ int32_t l_221 = 0xB19B034DL;
+ int32_t l_222 = 1L;
+ int32_t *l_236[6][4][8] = {{{&l_89,&l_126.f0,&l_221,&l_89,&g_62,NULL,&l_126.f0,&l_126.f0},{&l_122[5].f0,&g_62,NULL,NULL,&g_62,&l_122[5].f0,&l_115,&l_122[5].f0},{&l_89,&l_115,&l_91,&l_126.f0,&l_122[5].f0,&l_91,&g_62,&l_91},{&l_222,&l_126.f0,&l_126.f0,&l_126.f0,&l_222,&l_126.f0,&l_126.f0,&l_122[5].f0}},{{&l_89,&l_222,&l_122[5].f0,NULL,&l_126.f0,&l_89,&l_89,&l_126.f0},{&l_89,&l_122[5].f0,&l_122[5].f0,&l_89,&l_115,&l_91,&l_126.f0,&l_122[5].f0},{&l_126.f0,&g_62,&l_126.f0,&l_122[5].f0,&g_62,&l_221,&g_62,&l_122[5].f0},{&l_91,&g_62,&l_91,&l_122[5].f0,&l_126.f0,&l_91,&l_115,&l_89}},{{&l_222,&l_122[5].f0,NULL,&l_126.f0,&l_89,&l_89,&l_126.f0,NULL},{&l_222,&l_222,&l_221,&l_122[5].f0,&l_126.f0,&l_126.f0,&l_222,&l_126.f0},{&l_91,&l_126.f0,&l_122[5].f0,&l_91,&g_62,&l_91,&l_122[5].f0,&l_126.f0},{&l_126.f0,&l_115,NULL,&l_122[5].f0,&l_115,&l_122[5].f0,&g_62,NULL}},{{&l_89,&g_62,NULL,&l_126.f0,&l_126.f0,NULL,&g_62,&l_89},{&l_89,&l_126.f0,NULL,&l_122[5].f0,&l_222,&l_89,&l_122[5].f0,&l_122[5].f0},{&l_222,&l_89,&l_122[5].f0,&l_122[5].f0,&l_122[5].f0,&l_89,&l_222,&l_122[5].f0},{&l_89,&l_126.f0,&l_221,&l_89,&g_62,NULL,&l_126.f0,&l_126.f0}},{{&l_122[5].f0,&g_62,NULL,NULL,&g_62,&l_122[5].f0,&l_115,&l_122[5].f0},{&l_89,&l_115,&l_126.f0,&l_91,NULL,&l_126.f0,&l_89,&l_126.f0},{&l_122[5].f0,&l_91,&g_62,&l_91,&l_122[5].f0,&l_126.f0,&l_91,&l_115},{&l_221,&l_122[5].f0,NULL,&g_2,&l_91,&l_221,&l_221,&l_91}},{{NULL,NULL,NULL,NULL,&l_126.f0,&l_126.f0,&l_91,NULL},{&l_91,&l_89,&g_62,&l_115,&l_89,&l_89,&l_89,&l_115},{&l_126.f0,&l_89,&l_126.f0,NULL,&l_91,&l_126.f0,&l_126.f0,NULL},{&l_122[5].f0,NULL,&g_2,&l_91,&l_221,&l_221,&l_91,&g_2}}};
+ struct S1 **l_248 = &l_207;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ l_182[i] = &g_38;
+ if ((g_62 ^ (!((safe_sub_func_int64_t_s_s((~(l_115 = (g_62 , ((safe_lshift_func_int16_t_s_s((NULL == l_98), (safe_rshift_func_uint16_t_u_s(((((*l_113) ^= (safe_mul_func_int16_t_s_s((0x3A24L >= (-6L)), (safe_rshift_func_uint16_t_u_s((safe_lshift_func_int8_t_s_s(p_64, 1)), ((l_89 = (safe_mod_func_int16_t_s_s((safe_sub_func_int32_t_s_s(0L, (safe_lshift_func_uint16_t_u_s((0x2F0D9F09L & 1UL), 4)))), p_64))) ^ g_68)))))) != 0xC0EDEAE2L) == g_2), p_64)))) || g_2)))), p_65)) & p_65))))
+ { /* block id: 31 */
+ int32_t *l_116 = NULL;
+ int16_t l_160 = 1L;
+ int32_t l_166 = 4L;
+ struct S2 l_179 = {0x56559E35L,7L};
+ int32_t *l_185 = NULL;
+ int32_t *l_186[6][6][5] = {{{&g_121.f0,&g_121.f0,NULL,&l_166,NULL},{&l_89,&g_62,NULL,&l_89,&l_179.f0},{NULL,&l_122[5].f0,&l_89,NULL,NULL},{NULL,&g_62,&l_89,&g_62,NULL},{&l_89,&g_121.f0,&l_122[5].f0,NULL,&g_121.f0},{NULL,&l_115,&g_121.f0,&g_62,NULL}},{{NULL,&l_166,NULL,&g_121.f0,&g_121.f0},{&l_89,&g_62,&l_89,&l_89,NULL},{&g_121.f0,&l_122[5].f0,NULL,&g_121.f0,NULL},{&l_126.f0,&l_122[5].f0,&l_89,&g_62,&l_179.f0},{&l_89,NULL,NULL,NULL,NULL},{&l_179.f0,&l_115,&l_89,&g_62,NULL}},{{&l_166,NULL,NULL,NULL,&l_166},{&l_89,&l_122[5].f0,&g_121.f0,&l_89,&l_126.f0},{&l_166,&l_122[5].f0,&l_122[5].f0,&l_166,NULL},{&l_179.f0,&g_62,&l_89,&l_122[5].f0,&l_126.f0},{&l_89,&l_166,&l_89,NULL,&l_166},{&l_126.f0,&l_115,NULL,&l_122[5].f0,NULL}},{{&g_121.f0,&g_121.f0,NULL,&l_166,NULL},{&l_89,&g_62,NULL,&l_89,&l_179.f0},{NULL,&l_122[5].f0,&l_89,NULL,NULL},{NULL,&g_62,&l_89,&g_62,NULL},{&l_89,&g_121.f0,&l_122[5].f0,NULL,&g_121.f0},{NULL,&l_115,&g_121.f0,&g_62,NULL}},{{NULL,&l_166,NULL,&g_121.f0,&g_121.f0},{&l_89,&g_62,&l_89,&l_89,NULL},{&g_121.f0,&l_122[5].f0,NULL,&g_121.f0,NULL},{&l_126.f0,NULL,&l_126.f0,&l_115,NULL},{&l_115,NULL,&l_126.f0,&l_126.f0,NULL},{NULL,NULL,&l_89,&l_89,NULL}},{{&l_122[5].f0,NULL,&g_121.f0,NULL,&l_122[5].f0},{&l_89,NULL,&l_89,NULL,&l_89},{&l_122[5].f0,NULL,NULL,&l_122[5].f0,&l_126.f0},{NULL,&l_115,&l_126.f0,NULL,&l_89},{&l_115,&l_122[5].f0,&l_115,&l_126.f0,&l_122[5].f0},{&l_89,NULL,NULL,NULL,NULL}}};
+ int i, j, k;
+ g_62 &= (g_68 , p_65);
+ for (g_38 = (-4); (g_38 < 27); g_38++)
+ { /* block id: 35 */
+ for (g_114 = (-27); (g_114 != 17); ++g_114)
+ { /* block id: 38 */
+ uint32_t l_123 = 4294967286UL;
+ struct S2 *l_127 = &l_122[1];
+ l_122[5] = g_121;
+ ++l_123;
+ (*l_127) = (g_114 , l_126);
+ }
+ }
+ for (g_121.f1 = 0; (g_121.f1 >= 14); g_121.f1 = safe_add_func_int64_t_s_s(g_121.f1, 3))
+ { /* block id: 46 */
+ int8_t l_157 = 0L;
+ int8_t l_162 = 1L;
+ struct S1 l_170 = {0x613543D0L,20,166};
+ for (g_121.f0 = 0; (g_121.f0 <= 27); ++g_121.f0)
+ { /* block id: 49 */
+ uint8_t l_134[1];
+ int32_t *l_135 = &l_91;
+ int i;
+ for (i = 0; i < 1; i++)
+ l_134[i] = 0x73L;
+ (*l_135) = (g_62 = ((safe_rshift_func_int16_t_s_s(0x5A5DL, 8)) <= l_134[0]));
+ }
+ if ((l_136 , (*g_61)))
+ { /* block id: 53 */
+ (*l_70) = &g_2;
+ }
+ else
+ { /* block id: 55 */
+ uint32_t l_156 = 4294967286UL;
+ uint64_t *l_158 = &g_159;
+ int32_t *l_164 = NULL;
+ int32_t *l_165 = &l_91;
+ int8_t *l_169 = &l_162;
+ const int16_t *l_173[5][6][8] = {{{&l_160,&g_38,&l_160,&l_160,NULL,NULL,NULL,NULL},{&l_160,&l_160,&l_160,&l_160,&g_38,&l_160,&l_160,&l_160},{NULL,&g_38,&l_160,&l_160,&g_38,&g_38,&l_160,&g_38},{&g_38,&g_38,&g_38,&l_160,&g_38,&l_160,&g_38,&g_38},{&l_160,&l_160,NULL,&g_38,&g_38,NULL,&l_160,&l_160},{&l_160,&g_38,&g_38,NULL,&l_160,&l_160,&l_160,&g_38}},{{&g_38,&g_38,&l_160,&g_38,&g_38,&g_38,&l_160,&g_38},{&l_160,&g_38,&l_160,&g_38,&l_160,NULL,&g_38,&g_38},{&l_160,&l_160,&l_160,&g_38,&g_38,&g_38,&g_38,&l_160},{&l_160,&g_38,&l_160,&g_38,&l_160,&l_160,&g_38,&g_38},{&g_38,&l_160,NULL,&l_160,&g_38,&l_160,&g_38,&g_38},{&g_38,&l_160,NULL,NULL,&g_38,NULL,NULL,&l_160}},{{&g_38,&l_160,&g_38,&l_160,&g_38,&l_160,&l_160,NULL},{&g_38,&l_160,&g_38,&g_38,&g_38,&g_38,&l_160,&g_38},{&l_160,&g_38,&g_38,&l_160,NULL,&g_38,NULL,&g_38},{NULL,&g_38,NULL,&g_38,&l_160,&l_160,&g_38,&l_160},{NULL,&g_38,NULL,&g_38,&g_38,&g_38,&g_38,&g_38},{&g_38,&g_38,&l_160,&l_160,&l_160,&g_38,&g_38,NULL}},{{&l_160,&g_38,&l_160,&g_38,&g_38,&g_38,&l_160,&l_160},{&g_38,&l_160,&g_38,&g_38,NULL,&g_38,&l_160,&l_160},{NULL,&g_38,&g_38,&l_160,NULL,&l_160,&g_38,&l_160},{&g_38,&g_38,NULL,NULL,&l_160,&g_38,&l_160,&l_160},{&l_160,&g_38,&g_38,&g_38,&g_38,&l_160,&g_38,NULL},{&l_160,&l_160,&g_38,&l_160,&l_160,NULL,&g_38,&g_38}},{{NULL,&g_38,&g_38,&l_160,&l_160,&g_38,&g_38,NULL},{&l_160,&l_160,&g_38,&g_38,&g_38,&l_160,&g_38,&l_160},{&l_160,&g_38,&l_160,NULL,NULL,&g_38,&g_38,&l_160},{&l_160,&l_160,&g_38,&l_160,&g_38,&g_38,&g_38,&l_160},{&g_38,&g_38,&g_38,&g_38,&l_160,&l_160,&l_160,&l_160},{&l_160,&l_160,&l_160,&g_38,&l_160,&l_160,&g_38,&g_38}}};
+ uint8_t *l_183[3][2][3] = {{{&g_184,&g_184,&g_184},{&g_184,&g_184,&g_184}},{{&g_184,&g_184,&g_184},{&g_184,&g_184,&g_184}},{{&g_184,&g_184,&g_184},{&g_184,&g_184,&g_184}}};
+ int i, j, k;
+ l_166 |= (l_126 , ((*l_165) ^= (((safe_mod_func_uint8_t_u_u((+(&g_78 == ((safe_add_func_int32_t_s_s((safe_mul_func_uint8_t_u_u(((-1L) & (p_65 > (l_162 = (~(g_161 = (g_68 = (((safe_rshift_func_int8_t_s_s((+(safe_mod_func_uint16_t_u_u(l_126.f1, ((((*l_158) = ((((safe_rshift_func_uint16_t_u_u((((*l_113) = (l_151 != ((((func_24((((safe_mod_func_int16_t_s_s((l_156 = ((safe_rshift_func_uint8_t_u_s(p_64, (~0x5FL))) > 0L)), p_64)) || 0xCC89D979L) <= 0x3E2DD196261E54E0LL)) , l_126.f0) | 0x1E0ADED1L) | l_157) , (uint8_t*) NULL))) != 7UL), l_126.f0)) | l_126.f1) & (*g_61)) & p_64)) & 0x0FC352BBFD28FE82LL) | g_121.f0)))), p_64)) & 0xCEC0L) || l_160))))))), 0xACL)), l_136.f0)) , l_163))), l_157)) , &g_2) != &g_62)));
+ l_122[5].f0 |= ((*l_165) ^= (safe_add_func_int8_t_s_s(((*l_169) = g_159), (((~(l_170 , (0xDCF4L | (safe_div_func_uint8_t_u_u((((l_89 = ((*l_163) = (l_173[2][1][1] != ((safe_unary_minus_func_uint64_t_u(((safe_div_func_uint32_t_u_u((safe_div_func_uint32_t_u_u((l_179 , (p_64 & l_115)), (0xD642D507L | ((safe_mul_func_uint8_t_u_u((g_159 != 0xE52791890F00B84BLL), 255UL)) ^ p_65)))), l_89)) <= p_65))) , l_182[2])))) , p_65) , p_65), p_65))))) && 0xDB16BE7C8CA683B8LL) > g_68))));
+ }
+ }
+ g_187++;
+ }
+ else
+ { /* block id: 72 */
+ uint16_t l_191 = 1UL;
+ if (g_187)
+ goto lbl_190;
+ l_191 = 7L;
+ }
+ for (g_159 = 0; (g_159 <= 0); g_159 += 1)
+ { /* block id: 78 */
+ int32_t *l_192 = &l_91;
+ uint32_t l_218 = 0xF747F287L;
+ int32_t *l_219 = &l_126.f0;
+ int32_t *l_220[8][10][3] = {{{NULL,&g_2,&l_89},{&l_91,&l_91,&l_115},{&g_2,&l_89,NULL},{NULL,&l_91,&l_115},{&l_126.f0,&g_121.f0,&l_89},{&l_122[5].f0,&l_126.f0,&l_91},{&l_115,NULL,&l_115},{&l_89,NULL,&l_89},{&l_89,&g_2,&l_122[5].f0},{&g_2,NULL,&l_126.f0}},{{NULL,&l_115,&g_2},{&l_91,&l_89,NULL},{NULL,NULL,NULL},{&g_2,&l_91,&g_121.f0},{&l_89,&g_121.f0,&l_91},{&l_89,NULL,NULL},{&l_115,NULL,&g_62},{&l_122[5].f0,NULL,&l_89},{&l_126.f0,&l_89,&l_89},{NULL,NULL,&l_91}},{{&g_2,&l_89,&g_2},{&l_91,NULL,&g_121.f0},{NULL,NULL,NULL},{NULL,NULL,&l_122[5].f0},{&g_121.f0,&g_121.f0,&l_115},{&g_62,&l_91,&l_126.f0},{&l_115,NULL,&l_91},{&g_121.f0,NULL,NULL},{&l_89,&g_2,&l_91},{&l_91,&l_91,NULL}},{{&l_122[5].f0,NULL,&g_2},{&g_121.f0,NULL,NULL},{&l_89,&g_121.f0,&l_89},{&l_126.f0,&g_62,&l_89},{&l_91,&l_115,NULL},{&l_122[5].f0,&g_121.f0,&l_122[5].f0},{&g_2,NULL,NULL},{&l_122[5].f0,NULL,NULL},{&l_91,&g_62,NULL},{&l_126.f0,&l_91,&l_89}},{{&l_89,NULL,NULL},{&g_121.f0,&g_121.f0,&l_91},{&l_122[5].f0,&g_121.f0,&l_89},{&l_91,NULL,&l_122[5].f0},{&l_89,&l_115,&g_62},{&g_121.f0,NULL,&g_62},{&g_2,&g_121.f0,&l_89},{&g_121.f0,&g_121.f0,NULL},{&l_115,NULL,NULL},{&l_91,&l_91,&g_121.f0}},{{&l_122[5].f0,&g_62,NULL},{&g_121.f0,NULL,NULL},{&g_62,NULL,&l_89},{&l_126.f0,&g_121.f0,NULL},{&g_2,&l_115,NULL},{&l_115,&g_62,&g_121.f0},{&g_2,&g_121.f0,NULL},{NULL,NULL,NULL},{&g_2,NULL,&l_89},{NULL,&l_91,&g_62}},{{&l_115,&g_2,&g_62},{&g_121.f0,NULL,&l_122[5].f0},{&l_115,&l_126.f0,&l_89},{NULL,&l_122[5].f0,&l_91},{&g_2,&l_115,NULL},{NULL,&l_89,&l_89},{&g_2,&l_89,NULL},{&l_115,&g_2,NULL},{&g_2,NULL,NULL},{&l_126.f0,&l_91,&l_122[5].f0}},{{&g_62,NULL,NULL},{&g_121.f0,&g_2,&l_89},{&l_122[5].f0,&l_89,&l_89},{&l_91,&l_89,NULL},{&l_115,&l_115,&g_2},{&g_121.f0,&l_122[5].f0,NULL},{&g_2,&l_126.f0,&l_91},{&g_121.f0,NULL,NULL},{&l_89,&g_2,&l_91},{&l_91,&l_91,NULL}}};
+ int i, j, k;
+ g_121.f0 ^= l_89;
+ for (g_121.f1 = 0; (g_121.f1 <= 2); g_121.f1 += 1)
+ { /* block id: 82 */
+ int16_t l_193 = 7L;
+ int32_t *l_194 = &g_62;
+ int32_t *l_195 = &l_115;
+ int32_t *l_196 = &l_115;
+ int32_t *l_197 = &l_89;
+ int32_t l_198 = 1L;
+ int32_t *l_199 = &l_89;
+ int32_t l_200 = 0xEA293CA1L;
+ int32_t *l_201[5][8] = {{&l_198,NULL,&l_89,&l_115,&l_115,&l_89,NULL,&l_198},{NULL,&l_126.f0,&l_198,&g_2,&l_198,&l_126.f0,NULL,NULL},{&l_126.f0,&g_2,&l_89,&l_89,&g_2,&l_126.f0,&l_115,&l_126.f0},{&g_2,&l_126.f0,&l_115,&l_126.f0,&g_2,&l_89,&l_115,&l_89},{NULL,&g_2,&g_2,NULL,&l_91,&l_89,&l_91,NULL}};
+ int i, j;
+ (*l_70) = l_192;
+ g_203--;
+ if (l_126.f1)
+ break;
+ }
+ for (l_126.f1 = 0; (l_126.f1 >= 0); l_126.f1 -= 1)
+ { /* block id: 89 */
+ int64_t l_209 = (-1L);
+ for (l_126.f0 = 0; (l_126.f0 <= 0); l_126.f0 += 1)
+ { /* block id: 92 */
+ (*l_192) ^= 0xDC3F510EL;
+ (*l_70) = NULL;
+ }
+ for (g_161 = 0; (g_161 <= 5); g_161 += 1)
+ { /* block id: 98 */
+ int32_t *l_206 = &l_126.f0;
+ int i;
+ (*l_70) = l_206;
+ l_122[(l_126.f1 + 1)] = l_122[(l_126.f1 + 4)];
+ l_207 = NULL;
+ if (p_65)
+ continue;
+ }
+ for (g_121.f1 = 0; (g_121.f1 <= 2); g_121.f1 += 1)
+ { /* block id: 106 */
+ int32_t *l_210 = &l_122[5].f0;
+ int32_t *l_211 = &l_115;
+ int32_t *l_212 = &l_115;
+ int32_t *l_213 = NULL;
+ int32_t *l_214[2];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_214[i] = &l_89;
+ g_215++;
+ if (l_218)
+ break;
+ (*l_211) = p_65;
+ }
+ }
+ --l_223;
+ }
+ if (((safe_div_func_int16_t_s_s((((+p_65) > ((-6L) || (safe_div_func_uint64_t_u_u(p_64, (safe_rshift_func_int8_t_s_s(((l_122[5].f0 = ((safe_mul_func_int16_t_s_s((safe_rshift_func_uint8_t_u_u(((l_91 = l_122[5].f0) , (&g_184 != (l_237 = l_163))), ((l_89 = ((safe_unary_minus_func_int8_t_s(g_38)) && (&g_208 != NULL))) < 0xE523L))), 0x8B00L)) >= p_64)) || p_64), p_65)))))) <= 0L), 9UL)) >= g_161))
+ { /* block id: 118 */
+ l_91 = (p_64 & (-1L));
+ }
+ else
+ { /* block id: 120 */
+ int8_t l_243 = (-1L);
+ --g_244[2];
+ }
+ (*l_248) = l_247;
+ }
+ }
+ else
+ { /* block id: 125 */
+ int16_t l_254 = 0xC2D8L;
+ int32_t l_258 = 3L;
+ struct S1 *l_298[4][3] = {{&g_208,&g_208,&g_208},{&g_208,&g_208,&g_208},{&g_208,&g_208,&g_208},{&g_208,&g_208,&g_208}};
+ uint16_t l_306 = 0UL;
+ uint32_t *l_307 = NULL;
+ int32_t l_308 = (-7L);
+ uint16_t l_359 = 0x98FFL;
+ int i, j;
+ for (g_121.f0 = 0; (g_121.f0 <= 3); g_121.f0 += 1)
+ { /* block id: 128 */
+ uint32_t *l_253 = &g_114;
+ int32_t *l_255 = &l_91;
+ int32_t *l_256 = NULL;
+ int32_t *l_257 = &l_91;
+ int32_t *l_259 = &l_258;
+ int32_t *l_260 = &l_91;
+ int32_t *l_261 = &g_62;
+ int32_t *l_262 = &g_62;
+ int32_t l_263[4][10][6] = {{{3L,2L,0x44646C51L,2L,3L,0x240811FDL},{2L,3L,0x240811FDL,0x240811FDL,3L,2L},{(-1L),2L,0x1456EAE4L,3L,0x1456EAE4L,2L},{0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL},{0x1456EAE4L,0x1456EAE4L,0x44646C51L,3L,0x2A09282DL,3L},{(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L},{2L,(-1L),(-1L),2L,0x1456EAE4L,3L},{3L,2L,0x44646C51L,2L,3L,0x240811FDL},{2L,3L,0x240811FDL,0x240811FDL,3L,2L},{(-1L),2L,0x1456EAE4L,3L,0x1456EAE4L,2L}},{{0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL},{0x1456EAE4L,0x1456EAE4L,0x44646C51L,3L,0x2A09282DL,3L},{(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L},{2L,(-1L),(-1L),2L,0x1456EAE4L,3L},{3L,2L,0x44646C51L,2L,3L,0x240811FDL},{2L,3L,0x240811FDL,0x240811FDL,3L,2L},{(-1L),2L,0x1456EAE4L,3L,0x1456EAE4L,2L},{0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL},{0x1456EAE4L,0x1456EAE4L,0x44646C51L,3L,0x2A09282DL,3L},{(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L}},{{2L,(-1L),(-1L),2L,0x1456EAE4L,3L},{3L,2L,0x44646C51L,2L,3L,0x240811FDL},{2L,3L,0x240811FDL,0x240811FDL,3L,2L},{(-1L),2L,0x1456EAE4L,3L,0x1456EAE4L,2L},{0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL},{0x1456EAE4L,0x1456EAE4L,0x44646C51L,3L,0x2A09282DL,3L},{(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L,0x44646C51L},{2L,(-1L),(-1L),2L,0x1456EAE4L,3L},{3L,(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L},{(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL,(-1L)}},{{3L,(-1L),0x2A09282DL,0x240811FDL,0x2A09282DL,(-1L)},{0x2A09282DL,3L,0x44646C51L,0x1456EAE4L,0x1456EAE4L,0x44646C51L},{0x2A09282DL,0x2A09282DL,0x1456EAE4L,0x240811FDL,2L,0x240811FDL},{3L,0x2A09282DL,3L,0x44646C51L,0x1456EAE4L,0x1456EAE4L},{(-1L),3L,3L,(-1L),0x2A09282DL,0x240811FDL},{0x240811FDL,(-1L),0x1456EAE4L,(-1L),0x240811FDL,0x44646C51L},{(-1L),0x240811FDL,0x44646C51L,0x44646C51L,0x240811FDL,(-1L)},{3L,(-1L),0x2A09282DL,0x240811FDL,0x2A09282DL,(-1L)},{0x2A09282DL,3L,0x44646C51L,0x1456EAE4L,0x1456EAE4L,0x44646C51L},{0x2A09282DL,0x2A09282DL,0x1456EAE4L,0x240811FDL,2L,0x240811FDL}}};
+ int32_t *l_264 = &l_91;
+ int32_t *l_265 = &l_91;
+ int32_t *l_266[3];
+ int64_t *l_280[8][3] = {{&g_121.f1,&g_121.f1,&g_121.f1},{NULL,&g_242,&g_242},{&g_121.f1,&g_242,NULL},{NULL,NULL,NULL},{&g_121.f1,&g_121.f1,NULL},{&g_121.f1,&g_121.f1,&g_242},{NULL,&g_121.f1,&g_121.f1},{&g_242,NULL,NULL}};
+ uint16_t *l_283[9][10] = {{&g_244[0],NULL,&g_68,&g_68,&g_68,&g_68,NULL,&g_244[0],&g_68,&g_68},{&g_244[0],&g_244[2],&g_68,&g_68,&g_68,&g_244[0],NULL,&g_68,&g_68,&g_68},{&g_244[0],NULL,&g_68,&g_68,&g_68,&g_68,NULL,&g_244[0],&g_68,&g_68},{&g_244[0],&g_244[2],&g_68,&g_68,&g_68,&g_244[0],NULL,&g_68,&g_68,&g_68},{&g_244[0],NULL,&g_68,&g_68,&g_68,&g_68,NULL,&g_244[0],&g_68,&g_68},{&g_244[0],&g_244[2],&g_68,&g_68,&g_68,&g_244[0],NULL,&g_68,&g_68,&g_68},{&g_244[0],NULL,&g_68,&g_68,&g_68,&g_68,NULL,&g_244[0],&g_68,&g_68},{&g_244[0],&g_244[2],&g_68,&g_68,&g_68,&g_244[0],NULL,&g_68,&g_68,&g_68},{&g_244[0],NULL,&g_68,&g_68,&g_68,&g_68,NULL,&g_244[0],&g_68,&g_68}};
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ l_266[i] = &l_91;
+ l_254 = ((safe_rshift_func_uint8_t_u_u((g_184 = (((*l_253) &= (safe_rshift_func_int8_t_s_s(g_202, 2))) > 0x48EA2435L)), p_65)) <= 1L);
+ l_268--;
+ (*l_259) = (!p_64);
+ (*l_265) = ((((1UL || ((((safe_sub_func_uint64_t_u_u(0x55E803D2FD9BEF9FLL, (safe_add_func_int32_t_s_s((0x1127L != (safe_mod_func_uint64_t_u_u((((((0xF7L > (safe_unary_minus_func_int8_t_s(p_65))) && ((safe_div_func_uint64_t_u_u(18446744073709551615UL, (g_242 = (-1L)))) , (safe_lshift_func_uint16_t_u_s((l_258 = 0x8659L), (safe_mul_func_uint16_t_u_u(((g_121 , (int16_t*) NULL) != NULL), p_64)))))) && 3UL) > g_2) & (*l_265)), 1L))), 0x307B5E04L)))) , (*l_260)) , p_65) <= l_254)) , p_65) <= p_64) <= p_65);
+ for (g_187 = 0; (g_187 <= 3); g_187 += 1)
+ { /* block id: 139 */
+ uint8_t l_286[9][1][3] = {{{255UL,2UL,255UL}},{{0x71L,246UL,0x12L}},{{246UL,246UL,255UL}},{{0x12L,255UL,255UL}},{{255UL,0x71L,2UL}},{{0x12L,0x71L,0x12L}},{{246UL,255UL,2UL}},{{246UL,246UL,255UL}},{{0x12L,255UL,255UL}}};
+ int i, j, k;
+ for (g_215 = 0; (g_215 <= 3); g_215 += 1)
+ { /* block id: 142 */
+ int i;
+ for (g_68 = 0; (g_68 <= 3); g_68 += 1)
+ { /* block id: 145 */
+ l_286[7][0][1]--;
+ }
+ for (p_65 = 2; (p_65 <= 8); p_65 += 1)
+ { /* block id: 150 */
+ struct S2 *l_289 = NULL;
+ struct S2 *l_290 = &g_291[0][1];
+ (*l_290) = g_121;
+ if (p_64)
+ goto lbl_190;
+ }
+ for (g_161 = 0; (g_161 <= 3); g_161 += 1)
+ { /* block id: 156 */
+ return &g_2;
+ }
+ if (g_241[g_187])
+ continue;
+ }
+ }
+ }
+ l_258 = p_64;
+ if (((safe_mul_func_uint8_t_u_u((((!((safe_mul_func_uint8_t_u_u((p_65 | ((!(safe_rshift_func_uint8_t_u_u(((-3L) | (p_64 || (&g_208 == l_298[3][2]))), 5))) && g_242)), (((safe_mod_func_uint16_t_u_u((l_308 = (safe_mul_func_uint16_t_u_u(((l_258 |= (safe_mod_func_int8_t_s_s((-1L), ((p_65 != ((p_65 | l_305) , 0x0DA34F26F14F79CFLL)) || l_306)))) , g_159), 0L))), (-1L))) , g_208) , p_65))) <= p_64)) & 1L) > 0x66L), 5L)) && 0UL))
+ { /* block id: 166 */
+ uint32_t **l_315 = &l_307;
+ struct S2 l_320 = {0x97D02AEDL,0xD98A267DB47F5A99LL};
+ uint64_t *l_321 = NULL;
+ uint64_t *l_322 = &g_159;
+ uint16_t *l_324 = &g_161;
+ l_258 = (safe_mod_func_int32_t_s_s(((!(safe_add_func_uint16_t_u_u(g_203, ((p_65 == (safe_mul_func_int8_t_s_s(((((((((((p_65 != (((*l_315) = &g_114) == NULL)) , ((*l_324) = (((*l_237) = (safe_mul_func_int16_t_s_s((g_68 != ((safe_mod_func_int32_t_s_s((g_208.f2 && ((*l_322) = ((l_320 , (l_320.f1 > 1L)) || g_2))), g_121.f0)) >= (*g_61))), g_323))) & 0xD4L))) <= g_2) || (-2L)) , 0xF4L) & 255UL) , 1L) & p_65) , 0xFE222A196B499643LL) && p_65), p_64))) , p_64)))) , 0x7C957AF7L), (-1L)));
+ }
+ else
+ { /* block id: 172 */
+ uint32_t *l_329[8] = {NULL,&l_268,&l_268,NULL,&l_268,&l_268,NULL,&l_268};
+ int32_t l_349 = 2L;
+ int32_t l_357 = 0x3309E014L;
+ struct S2 l_362 = {0L,-4L};
+ int i;
+ for (g_215 = 0; (g_215 != 12); ++g_215)
+ { /* block id: 175 */
+ int32_t l_332 = 0x995CAD86L;
+ uint32_t *l_333 = &g_215;
+ struct S2 l_334[8][3] = {{{0x249C85D9L,0L},{0x249C85D9L,0L},{0x249C85D9L,0L}},{{-1L,0L},{-1L,0L},{-1L,0L}},{{0x249C85D9L,0L},{0x249C85D9L,0L},{0x249C85D9L,0L}},{{-1L,0L},{-1L,0L},{-1L,0L}},{{0x249C85D9L,0L},{0x249C85D9L,0L},{0x249C85D9L,0L}},{{-1L,0L},{-1L,0L},{-1L,0L}},{{0x249C85D9L,0L},{0x249C85D9L,0L},{0x249C85D9L,0L}},{{-1L,0L},{-1L,0L},{-1L,0L}}};
+ struct S2 *l_335 = &g_291[0][5];
+ int32_t *l_336 = &l_258;
+ int32_t *l_337 = &l_332;
+ int32_t *l_338 = &l_258;
+ int32_t *l_339 = &l_267;
+ int32_t *l_340 = &l_308;
+ int32_t *l_341 = &g_62;
+ int32_t *l_342 = NULL;
+ int32_t *l_343 = &l_267;
+ int32_t *l_344 = &l_267;
+ int32_t *l_345 = &l_308;
+ int32_t *l_346 = &l_332;
+ int32_t *l_347 = &g_291[0][1].f0;
+ int32_t *l_348 = NULL;
+ int32_t *l_350 = &l_332;
+ int32_t *l_351 = &l_258;
+ int32_t *l_352 = &g_291[0][1].f0;
+ int32_t *l_353 = &g_291[0][1].f0;
+ int32_t *l_354 = &g_62;
+ int32_t *l_355[7];
+ int i, j;
+ for (i = 0; i < 7; i++)
+ l_355[i] = &l_334[1][0].f0;
+ (*l_335) = (g_208 , (((((safe_add_func_int64_t_s_s(g_242, (1L || p_65))) | (l_329[7] == ((((safe_sub_func_int8_t_s_s((~g_208.f0), (+l_258))) > ((p_65 ^ l_332) , 3UL)) , g_121.f0) , l_333))) || g_215) <= l_332) , l_334[1][0]));
+ ++l_359;
+ (*l_335) = l_362;
+ }
+ for (l_306 = 0; (l_306 >= 25); ++l_306)
+ { /* block id: 182 */
+ return &g_62;
+ }
+ return &g_2;
+ }
+ for (g_323 = 0; (g_323 < 1); g_323 = safe_add_func_uint8_t_u_u(g_323, 5))
+ { /* block id: 189 */
+ int32_t *l_367 = &g_62;
+ int32_t *l_368 = NULL;
+ int32_t l_369 = 0x32767108L;
+ int32_t *l_370 = &l_258;
+ int32_t *l_371 = &l_356;
+ int32_t *l_372 = &l_258;
+ int32_t *l_373 = &g_291[0][1].f0;
+ int32_t *l_374[4];
+ int i;
+ for (i = 0; i < 4; i++)
+ l_374[i] = &l_308;
+ --l_375;
+ }
+ }
+ (*l_381) = ((*l_380) = g_378[3]);
+ return &g_2;
+}
+
+
+
+
+/* ---------------------------------------- */
+int main (int argc, char* argv[])
+{
+ int i, j;
+ 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_27, "g_27", print_hash_value);
+ transparent_crc(g_38, "g_38", print_hash_value);
+ transparent_crc(g_62, "g_62", print_hash_value);
+ transparent_crc(g_68, "g_68", print_hash_value);
+ transparent_crc(g_78, "g_78", print_hash_value);
+ transparent_crc(g_114, "g_114", print_hash_value);
+ transparent_crc(g_121.f0, "g_121.f0", print_hash_value);
+ transparent_crc(g_121.f1, "g_121.f1", print_hash_value);
+ transparent_crc(g_159, "g_159", print_hash_value);
+ transparent_crc(g_161, "g_161", print_hash_value);
+ transparent_crc(g_184, "g_184", print_hash_value);
+ transparent_crc(g_187, "g_187", print_hash_value);
+ transparent_crc(g_202, "g_202", print_hash_value);
+ transparent_crc(g_203, "g_203", print_hash_value);
+ transparent_crc(g_208.f0, "g_208.f0", print_hash_value);
+ transparent_crc(g_208.f1, "g_208.f1", print_hash_value);
+ transparent_crc(g_208.f2, "g_208.f2", print_hash_value);
+ transparent_crc(g_215, "g_215", print_hash_value);
+ transparent_crc(g_239, "g_239", print_hash_value);
+ transparent_crc(g_240, "g_240", print_hash_value);
+ for (i = 0; i < 4; i++)
+ {
+ transparent_crc(g_241[i], "g_241[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_242, "g_242", print_hash_value);
+ for (i = 0; i < 3; i++)
+ {
+ transparent_crc(g_244[i], "g_244[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ transparent_crc(g_291[i][j].f0, "g_291[i][j].f0", print_hash_value);
+ transparent_crc(g_291[i][j].f1, "g_291[i][j].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_323, "g_323", print_hash_value);
+ for (i = 0; i < 4; i++)
+ {
+ transparent_crc(g_386[i], "g_386[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_408.f0, "g_408.f0", print_hash_value);
+ transparent_crc(g_408.f1, "g_408.f1", print_hash_value);
+ transparent_crc(g_408.f2, "g_408.f2", print_hash_value);
+ transparent_crc(g_408.f3, "g_408.f3", print_hash_value);
+ transparent_crc(g_408.f4, "g_408.f4", print_hash_value);
+ transparent_crc(g_408.f5, "g_408.f5", print_hash_value);
+ transparent_crc(g_408.f6, "g_408.f6", print_hash_value);
+ transparent_crc(g_408.f7, "g_408.f7", print_hash_value);
+ transparent_crc(g_467, "g_467", print_hash_value);
+ transparent_crc(g_468, "g_468", print_hash_value);
+ transparent_crc(g_476, "g_476", print_hash_value);
+ transparent_crc(g_565, "g_565", print_hash_value);
+ transparent_crc(g_605.f0, "g_605.f0", print_hash_value);
+ transparent_crc(g_605.f1, "g_605.f1", print_hash_value);
+ transparent_crc(g_605.f2, "g_605.f2", print_hash_value);
+ transparent_crc(g_605.f3, "g_605.f3", print_hash_value);
+ transparent_crc(g_605.f4, "g_605.f4", print_hash_value);
+ transparent_crc(g_605.f5, "g_605.f5", print_hash_value);
+ transparent_crc(g_605.f6, "g_605.f6", print_hash_value);
+ transparent_crc(g_605.f7, "g_605.f7", print_hash_value);
+ transparent_crc(g_706, "g_706", print_hash_value);
+ transparent_crc(g_721, "g_721", print_hash_value);
+ for (i = 0; i < 5; i++)
+ {
+ transparent_crc(g_732[i], "g_732[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: 1
+breakdown:
+ depth: 0, occurrence: 213
+ depth: 1, occurrence: 18
+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: 19
+breakdown:
+ indirect level: 0, occurrence: 8
+ indirect level: 1, occurrence: 7
+ indirect level: 2, occurrence: 4
+XXX full-bitfields structs in the program: 0
+breakdown:
+XXX times a bitfields struct's address is taken: 18
+XXX times a bitfields struct on LHS: 0
+XXX times a bitfields struct on RHS: 15
+XXX times a single bitfield on LHS: 0
+XXX times a single bitfield on RHS: 14
+
+XXX max expression depth: 40
+breakdown:
+ depth: 1, occurrence: 150
+ depth: 2, occurrence: 38
+ depth: 4, occurrence: 3
+ depth: 7, occurrence: 1
+ depth: 15, occurrence: 1
+ depth: 18, occurrence: 3
+ depth: 19, occurrence: 1
+ depth: 21, occurrence: 3
+ depth: 22, occurrence: 1
+ depth: 23, occurrence: 1
+ depth: 24, occurrence: 1
+ depth: 25, occurrence: 3
+ depth: 31, occurrence: 1
+ depth: 33, occurrence: 1
+ depth: 34, occurrence: 1
+ depth: 35, occurrence: 1
+ depth: 40, occurrence: 1
+
+XXX total number of pointers: 223
+
+XXX times a variable address is taken: 543
+XXX times a pointer is dereferenced on RHS: 51
+breakdown:
+ depth: 1, occurrence: 34
+ depth: 2, occurrence: 17
+XXX times a pointer is dereferenced on LHS: 78
+breakdown:
+ depth: 1, occurrence: 78
+XXX times a pointer is compared with null: 11
+XXX times a pointer is compared with address of another variable: 4
+XXX times a pointer is compared with another pointer: 3
+XXX times a pointer is qualified to be dereferenced: 3931
+
+XXX max dereference level: 2
+breakdown:
+ level: 0, occurrence: 0
+ level: 1, occurrence: 316
+ level: 2, occurrence: 69
+XXX number of pointers point to pointers: 42
+XXX number of pointers point to scalars: 163
+XXX number of pointers point to structs: 18
+XXX percent of pointers has null in alias set: 23.3
+XXX average alias set size: 1.38
+
+XXX times a non-volatile is read: 508
+XXX times a non-volatile is write: 276
+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: 0
+XXX backward jumps: 2
+
+XXX stmts: 141
+XXX max block depth: 5
+breakdown:
+ depth: 0, occurrence: 30
+ depth: 1, occurrence: 13
+ depth: 2, occurrence: 19
+ depth: 3, occurrence: 25
+ depth: 4, occurrence: 21
+ depth: 5, occurrence: 33
+
+XXX percentage a fresh-made variable is used: 17.8
+XXX percentage an existing variable is used: 82.2
+FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
+********************* end of statistics **********************/
+
diff --git a/tests/fuzz/18.cpp.txt b/tests/fuzz/18.cpp.txt
new file mode 100644
index 00000000..33a07e9f
--- /dev/null
+++ b/tests/fuzz/18.cpp.txt
@@ -0,0 +1 @@
+checksum = C536CE7C
diff --git a/tests/fuzz/6.c b/tests/fuzz/6.c
new file mode 100644
index 00000000..f7d003f0
--- /dev/null
+++ b/tests/fuzz/6.c
@@ -0,0 +1,1313 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-packed-struct --no-math64
+ * Seed: 2616503890
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+struct S0 {
+ int32_t f0;
+ signed f1 : 20;
+ signed f2 : 24;
+ unsigned f3 : 26;
+ int8_t f4;
+ unsigned f5 : 24;
+ unsigned f6 : 29;
+ signed : 0;
+};
+
+struct S1 {
+ const uint32_t f0;
+ const uint32_t f1;
+ uint8_t f2;
+ int16_t f3;
+};
+
+struct S2 {
+ signed f0 : 15;
+ unsigned : 0;
+};
+
+struct S3 {
+ uint32_t f0;
+ uint32_t f1;
+};
+
+union U4 {
+ const int32_t f0;
+};
+
+/* --- GLOBAL VARIABLES --- */
+static int32_t g_5 = (-1L);
+static struct S3 g_25 = {0x4D91F06EL,0x5FCB4448L};
+static struct S3 g_49[9] = {{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L},{4294967288UL,0xD28BC130L}};
+static int32_t g_52 = 0x7DC46221L;
+static int8_t g_82 = 0xC8L;
+static int32_t g_90 = 0x34F93D1DL;
+static int8_t g_92 = 0x9FL;
+static uint8_t g_96 = 0xE9L;
+static struct S1 g_99 = {0xCD962F93L,0UL,0UL,4L};
+static uint16_t g_103 = 0x5C9BL;
+static struct S0 g_108 = {-1L,-898,-748,7155,0xCCL,1045,17733};
+static const union U4 g_109 = {0x2D6F4160L};
+static struct S2 g_110 = {123};
+static uint16_t *g_165 = &g_103;
+static union U4 g_183 = {0L};
+static const struct S2 *g_192[6][10] = {{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110},{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110},{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110},{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110},{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110},{&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110,&g_110}};
+static const struct S2 **g_191 = &g_192[3][4];
+static const struct S2 g_218 = {169};
+static int8_t g_258 = 0xF5L;
+static int32_t *g_304 = &g_52;
+static uint16_t g_332 = 1UL;
+static union U4 g_345[10][1] = {{{-9L}},{{-8L}},{{-8L}},{{-9L}},{{-8L}},{{-8L}},{{-9L}},{{-8L}},{{-8L}},{{-9L}}};
+static int8_t g_393[6] = {0L,0L,0L,0L,0L,0L};
+static uint16_t g_395 = 0xE48FL;
+static uint8_t g_398 = 0x12L;
+static const struct S1 g_404[9][3][7] = {{{{4294967292UL,1UL,1UL,0x9004L},{4294967289UL,0x2D40B248L,9UL,-4L},{1UL,0x14CE5E2CL,255UL,0L},{4294967293UL,9UL,0xC3L,-1L},{9UL,0UL,0xF5L,0x8933L},{0x6EEFBF3DL,0x0697DDFDL,0x28L,-9L},{4294967289UL,0x2D40B248L,9UL,-4L}},{{0xF16E1005L,0x69DEE0BEL,254UL,1L},{0x5BF993C5L,0xAF30037DL,6UL,0x86D2L},{0x3D1AF904L,6UL,9UL,0x2382L},{0xF16E1005L,0x69DEE0BEL,254UL,1L},{0UL,8UL,0x3FL,0xC4F6L},{0xF1D13282L,0xDC13E8D4L,0x09L,0xA438L},{0UL,1UL,0xBEL,-1L}},{{0xB4FDA9A7L,0UL,253UL,0xB6B4L},{4294967292UL,0x6F35DE22L,1UL,-5L},{0xABD76823L,0x5C4094FAL,0xA7L,0x73B2L},{0xDAC922BDL,4294967294UL,0x6DL,0xD7DCL},{0x875F6C4FL,0xCA33B9B0L,255UL,1L},{0xFD8E57F7L,0x5D91100AL,250UL,0x47E3L},{0xFD8E57F7L,0x5D91100AL,250UL,0x47E3L}}},{{{4294967292UL,0xE89D2B46L,255UL,0x36E0L},{0UL,1UL,0xBEL,-1L},{0xC95419F9L,0xF1DC8401L,254UL,0L},{0UL,1UL,0xBEL,-1L},{4294967292UL,0xE89D2B46L,255UL,0x36E0L},{0UL,0xEFDC9B0EL,0xF6L,-6L},{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L}},{{1UL,0x107BAB83L,0x8AL,-1L},{0x7ACE9691L,0UL,0UL,-4L},{4294967295UL,0x0399C950L,0x97L,0L},{0x92CBD4F1L,0xF902C1C3L,255UL,-1L},{4294967289UL,0x4AFC16F4L,0x01L,-1L},{0x9998859DL,0UL,0UL,0xDCE0L},{9UL,0UL,0xF5L,0x8933L}},{{0x3D1AF904L,6UL,9UL,0x2382L},{0x8B37F662L,1UL,0UL,0xDC69L},{4294967295UL,0x2E972767L,0x39L,0x5645L},{0x8441D93CL,0xB82A1ADDL,0x37L,0xF064L},{0x8B37F662L,1UL,0UL,0xDC69L},{1UL,0x4B1F371AL,0x74L,0x3354L},{4294967295UL,0xF04724DEL,0UL,1L}}},{{{1UL,0x107BAB83L,0x8AL,-1L},{0x92CBD4F1L,0xF902C1C3L,255UL,-1L},{0x6EEFBF3DL,0x0697DDFDL,0x28L,-9L},{0xFFF82B4BL,0xAB1E80A6L,0xC5L,5L},{0x46979E7AL,4294967295UL,0x4CL,1L},{0x95A17D55L,0xD9337297L,7UL,0xCBA7L},{4294967292UL,1UL,1UL,0x9004L}},{{4294967292UL,0xE89D2B46L,255UL,0x36E0L},{0UL,1UL,0xE9L,1L},{0x5BF993C5L,0xAF30037DL,6UL,0x86D2L},{4294967295UL,0xEA9EC9E5L,0UL,1L},{1UL,0x4B1F371AL,0x74L,0x3354L},{4294967286UL,0x5DAECA4EL,8UL,-9L},{4294967292UL,0xE89D2B46L,255UL,0x36E0L}},{{0xB4FDA9A7L,0UL,253UL,0xB6B4L},{4294967292UL,1UL,1UL,0x9004L},{0xDAC922BDL,4294967294UL,0x6DL,0xD7DCL},{4294967289UL,0x4AFC16F4L,0x01L,-1L},{0x69C1217CL,0x67F03E08L,0xF4L,0L},{0xB4FDA9A7L,0UL,253UL,0xB6B4L},{0xDA074F93L,0xC781FFB4L,0x04L,0xE568L}}},{{{0xF16E1005L,0x69DEE0BEL,254UL,1L},{0xF013A00DL,0x9E73816BL,7UL,0x34A3L},{0x784D76C3L,0xFBEB689CL,255UL,0xCB7DL},{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L},{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L},{0x784D76C3L,0xFBEB689CL,255UL,0xCB7DL},{0xF013A00DL,0x9E73816BL,7UL,0x34A3L}},{{4294967292UL,1UL,1UL,0x9004L},{0x7ACE9691L,0UL,0UL,-4L},{4294967295UL,6UL,0x39L,1L},{0xAF10A225L,8UL,0x5BL,0L},{0x5BB4543EL,0xA355F2F5L,0UL,-1L},{4294967289UL,0x4AFC16F4L,0x01L,-1L},{0x46979E7AL,4294967295UL,0x4CL,1L}},{{0x1E34A7E3L,2UL,0x35L,-3L},{0x7ED76638L,0UL,0x81L,0xCBD2L},{0x3D1AF904L,6UL,9UL,0x2382L},{0xF1D13282L,0xDC13E8D4L,0x09L,0xA438L},{0xF013A00DL,0x9E73816BL,7UL,0x34A3L},{0x4FC46E8AL,0xD6B44EB8L,251UL,0xE72EL},{0x5BF993C5L,0xAF30037DL,6UL,0x86D2L}}},{{{4294967292UL,0x6F35DE22L,1UL,-5L},{0x69C1217CL,0x67F03E08L,0xF4L,0L},{0x6EEFBF3DL,0x0697DDFDL,0x28L,-9L},{0xAF10A225L,8UL,0x5BL,0L},{0x875F6C4FL,0xCA33B9B0L,255UL,1L},{0xF899DD77L,0xA3A3B24CL,1UL,-3L},{4294967286UL,0x789C42E1L,6UL,-1L}},{{4294967295UL,0x7F701539L,0xD0L,-1L},{0x5BF993C5L,0xAF30037DL,6UL,0x86D2L},{0x8441D93CL,0xB82A1ADDL,0x37L,0xF064L},{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L},{0UL,4294967295UL,0x0BL,0x685FL},{0UL,1UL,0xE9L,1L},{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L}},{{0x2D3EC666L,0x823C73E7L,0x94L,0x14BDL},{9UL,0UL,0xF5L,0x8933L},{0x9998859DL,0UL,0UL,0xDCE0L},{4294967289UL,0x4AFC16F4L,0x01L,-1L},{0x92CBD4F1L,0xF902C1C3L,255UL,-1L},{4294967295UL,0x0399C950L,0x97L,0L},{0x7ACE9691L,0UL,0UL,-4L}}},{{{0x31191B3CL,0xD2860BEAL,249UL,0xCA00L},{0x8B37F662L,1UL,0UL,0xDC69L},{0xC95419F9L,0xF1DC8401L,254UL,0L},{4294967295UL,0xEA9EC9E5L,0UL,1L},{0x90D64501L,0x4A5C382BL,9UL,-1L},{0xCE0E03FCL,4294967286UL,252UL,-6L},{0x90D64501L,0x4A5C382BL,9UL,-1L}},{{0xFFF82B4BL,0xAB1E80A6L,0xC5L,5L},{0xDA074F93L,0xC781FFB4L,0x04L,0xE568L},{0xDA074F93L,0xC781FFB4L,0x04L,0xE568L},{0xFFF82B4BL,0xAB1E80A6L,0xC5L,5L},{0x5BB4543EL,0xA355F2F5L,0UL,-1L},{0x2D3EC666L,0x823C73E7L,0x94L,0x14BDL},{0x875F6C4FL,0xCA33B9B0L,255UL,1L}},{{4294967286UL,0x5DAECA4EL,8UL,-9L},{0x8D5C7EE6L,1UL,0xCEL,0x8DF8L},{1UL,0x4B1F371AL,0x74L,0x3354L},{0x8441D93CL,0xB82A1ADDL,0x37L,0xF064L},{0UL,1UL,0xBEL,-1L},{4294967286UL,0x5DAECA4EL,8UL,-9L},{0UL,1UL,0xE9L,1L}}},{{{0x69C1217CL,0x67F03E08L,0xF4L,0L},{0x875F6C4FL,0xCA33B9B0L,255UL,1L},{1UL,0x14CE5E2CL,255UL,0L},{0x92CBD4F1L,0xF902C1C3L,255UL,-1L},{4294967286UL,0x789C42E1L,6UL,-1L},{0xF899DD77L,0xA3A3B24CL,1UL,-3L},{0x875F6C4FL,0xCA33B9B0L,255UL,1L}},{{0xF16E1005L,0x69DEE0BEL,254UL,1L},{4294967295UL,0xF04724DEL,0UL,1L},{0x1E34A7E3L,2UL,0x35L,-3L},{0UL,1UL,0xBEL,-1L},{1UL,0x4B1F371AL,0x74L,0x3354L},{0xF1D13282L,0xDC13E8D4L,0x09L,0xA438L},{0x90D64501L,0x4A5C382BL,9UL,-1L}},{{0xABD76823L,0x5C4094FAL,0xA7L,0x73B2L},{4294967289UL,0x2D40B248L,9UL,-4L},{4294967295UL,6UL,0x39L,1L},{0xDAC922BDL,4294967294UL,0x6DL,0xD7DCL},{4294967289UL,0x2D40B248L,9UL,-4L},{0xDA074F93L,0xC781FFB4L,0x04L,0xE568L},{0x7ACE9691L,0UL,0UL,-4L}}},{{{0x39B853AAL,4294967292UL,0x81L,0xC7A0L},{0UL,1UL,0xBEL,-1L},{0xCE0E03FCL,4294967286UL,252UL,-6L},{0xF16E1005L,0x69DEE0BEL,254UL,1L},{0xF013A00DL,0x9E73816BL,7UL,0x34A3L},{1UL,4294967291UL,246UL,0x32EEL},{0x1E34A7E3L,2UL,0x35L,-3L}},{{0xABD76823L,0x5C4094FAL,0xA7L,0x73B2L},{0x6EEFBF3DL,0x0697DDFDL,0x28L,-9L},{4294967295UL,4294967290UL,252UL,2L},{0xC2ECAACAL,4294967295UL,0x82L,0xD801L},{4294967295UL,4294967290UL,252UL,2L},{0x6EEFBF3DL,0x0697DDFDL,0x28L,-9L},{0xABD76823L,0x5C4094FAL,0xA7L,0x73B2L}},{{0xB7131E29L,0xA1E58848L,0xEAL,1L},{0x1E34A7E3L,2UL,0x35L,-3L},{0UL,5UL,250UL,0x4C0BL},{1UL,0xC1D7F27EL,0x9FL,0xB17DL},{0x3D1AF904L,6UL,9UL,0x2382L},{0x5AE9864FL,0xA033A2BEL,1UL,0xFE78L},{0x784D76C3L,0xFBEB689CL,255UL,0xCB7DL}}},{{{4294967295UL,6UL,0x39L,1L},{0xB4FDA9A7L,0UL,253UL,0xB6B4L},{4294967293UL,9UL,0xC3L,-1L},{0x9998859DL,0UL,0UL,0xDCE0L},{4294967295UL,0x0399C950L,0x97L,0L},{4294967293UL,9UL,0xC3L,-1L},{0UL,0xCC5E76F7L,0xBFL,0x5E44L}},{{0x4FC46E8AL,0xD6B44EB8L,251UL,0xE72EL},{0UL,0xEFDC9B0EL,0xF6L,-6L},{0UL,5UL,250UL,0x4C0BL},{4294967295UL,0xF04724DEL,0UL,1L},{2UL,0xF7CF134CL,1UL,0x2E10L},{0x2A40AB47L,0x27F0A379L,0xCBL,0x2F41L},{0UL,1UL,0xE9L,1L}},{{0x512C9CC6L,4294967295UL,0x73L,7L},{4294967295UL,0x0399C950L,0x97L,0L},{4294967295UL,4294967290UL,252UL,2L},{0xC4D78A4AL,8UL,0x5AL,0xCE6CL},{0UL,0xCC5E76F7L,0xBFL,0x5E44L},{0x512C9CC6L,4294967295UL,0x73L,7L},{0x95A17D55L,0xD9337297L,7UL,0xCBA7L}}}};
+static int8_t g_452 = 7L;
+static int32_t g_454 = 0xB2827763L;
+static uint16_t g_455[1] = {0xADE9L};
+static int32_t g_465 = 0x5BA367D9L;
+static int8_t g_466 = 0x08L;
+static uint8_t g_467 = 255UL;
+static uint16_t g_518 = 0UL;
+static struct S1 g_525 = {0xC8451B01L,6UL,0x90L,1L};
+static const struct S1 *g_524[2][8][6] = {{{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]}},{{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]},{(void*)0,&g_404[3][1][6],&g_404[4][2][5],&g_99,&g_404[4][2][5],&g_404[3][1][6]}}};
+static int8_t g_531 = 0x57L;
+static int32_t g_532 = (-4L);
+static int16_t g_534 = 0xCE5BL;
+static uint16_t g_535[3][6][4] = {{{1UL,65531UL,1UL,0UL},{65531UL,1UL,0xB853L,0x0C15L},{6UL,1UL,65531UL,0x9E89L},{7UL,65527UL,65535UL,0UL},{0UL,0xF306L,0UL,0x443AL},{0x6BA1L,0UL,0x0F29L,0UL}},{{0xF306L,0xA53EL,0x9E89L,0x0F29L},{1UL,6UL,65531UL,1UL},{65535UL,1UL,0UL,0x1B02L},{65535UL,0xF306L,65531UL,65535UL},{1UL,0x1B02L,0x9E89L,0UL},{0xF306L,0x89BEL,0x0F29L,0x0C15L}},{{0x6BA1L,1UL,0UL,1UL},{0UL,0xA53EL,65535UL,0UL},{1UL,0x443AL,0x443AL,1UL},{0x1B02L,65535UL,65526UL,65535UL},{0x443AL,0UL,65527UL,0x2B24L},{65531UL,0UL,1UL,0x2B24L}}};
+static uint16_t g_538 = 9UL;
+static int16_t g_557 = 0x3DB5L;
+static uint8_t g_575 = 0xFBL;
+static union U4 g_591[10][8] = {{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}},{{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L},{1L},{0x03B75086L}}};
+static struct S0 g_623 = {0xFA23ED7BL,277,-1899,349,1L,2438,20296};
+static int32_t *g_680[3][9] = {{&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90,&g_90}};
+static struct S0 *g_689 = (void*)0;
+static struct S0 **g_688 = &g_689;
+static int32_t *g_692 = &g_465;
+static int8_t g_815[4][3] = {{(-10L),(-10L),(-10L)},{(-10L),(-10L),(-10L)},{(-10L),(-10L),(-10L)},{(-10L),(-10L),(-10L)}};
+static struct S2 g_901 = {9};
+static struct S3 * const g_966 = (void*)0;
+static struct S3 * const *g_965 = &g_966;
+static int8_t g_1054 = 0xF3L;
+static int32_t g_1055 = 0x97667764L;
+static uint32_t g_1057[4][5] = {{1UL,0x21F81601L,0x21F81601L,1UL,1UL},{1UL,0x43F88B83L,0x43F88B83L,1UL,2UL},{1UL,0x21F81601L,0x21F81601L,1UL,1UL},{1UL,0x43F88B83L,0x43F88B83L,1UL,2UL}};
+static struct S3 *g_1170 = (void*)0;
+static int32_t ** const *g_1175 = (void*)0;
+static int32_t **g_1183 = &g_680[2][7];
+static int32_t ***g_1182 = &g_1183;
+static int32_t ***g_1184 = &g_1183;
+
+
+/* --- FORWARD DECLARATIONS --- */
+static struct S3 func_1(void);
+static int32_t func_2(uint8_t p_3, uint16_t p_4);
+static struct S0 func_10(uint8_t p_11, uint32_t p_12);
+static int32_t * func_15(const int32_t * p_16, uint32_t p_17, uint16_t p_18);
+static int32_t * func_19(int32_t * p_20, struct S3 p_21, const int32_t * p_22, int32_t * p_23);
+static struct S3 func_26(int32_t p_27, int32_t * p_28);
+static uint8_t func_31(int32_t * p_32);
+static int32_t * func_34(int32_t * p_35, union U4 p_36, int32_t * p_37);
+static int32_t * func_38(struct S3 p_39, uint32_t p_40, int32_t * p_41, const struct S1 p_42);
+static int32_t * func_45(int32_t * p_46, struct S3 p_47);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_5 g_25 g_52 g_96 g_99 g_103 g_108 g_109 g_110 g_109.f0 g_165 g_82 g_92 g_183.f0 g_191 g_218 g_90 g_183 g_49.f1 g_49.f0 g_258 g_49 g_332 g_345.f0 g_395 g_398 g_455 g_467 g_345 g_393 g_465 g_535 g_538 g_452 g_525.f1 g_575 g_532 g_623.f4 g_692 g_466 g_1057 g_404.f1 g_623.f0 g_454 g_815 g_623.f3 g_1175 g_404.f3 g_557 g_1055 g_525.f0 g_591
+ * writes: g_5 g_49 g_52 g_96 g_103 g_110 g_99.f3 g_108.f4 g_99.f2 g_165 g_108.f0 g_191 g_92 g_108.f2 g_108.f1 g_108.f6 g_108 g_304 g_332 g_395 g_398 g_258 g_455 g_467 g_465 g_518 g_524 g_535 g_538 g_557 g_575 g_532 g_452 g_1057 g_25.f0 g_623.f0 g_466 g_1170 g_192 g_1182 g_1184 g_534 g_1055
+ */
+static struct S3 func_1(void)
+{ /* block id: 0 */
+ uint32_t l_6 = 0x41A9C213L;
+ struct S3 l_1252 = {4294967295UL,0x7AFC605BL};
+ (*g_692) = func_2(g_5, l_6);
+ return l_1252;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_25 g_5 g_52 g_96 g_99 g_103 g_108 g_109 g_110 g_109.f0 g_165 g_82 g_92 g_183.f0 g_191 g_218 g_90 g_183 g_49.f1 g_49.f0 g_258 g_49 g_332 g_345.f0 g_395 g_398 g_455 g_467 g_345 g_393 g_465 g_535 g_538 g_452 g_525.f1 g_575 g_532 g_623.f4 g_692 g_466 g_1057 g_404.f1 g_623.f0 g_454 g_815 g_623.f3 g_1175 g_404.f3 g_557 g_1055 g_525.f0 g_591
+ * writes: g_5 g_49 g_52 g_96 g_103 g_110 g_99.f3 g_108.f4 g_99.f2 g_165 g_108.f0 g_191 g_92 g_108.f2 g_108.f1 g_108.f6 g_108 g_304 g_332 g_395 g_398 g_258 g_455 g_467 g_465 g_518 g_524 g_535 g_538 g_557 g_575 g_532 g_452 g_1057 g_25.f0 g_623.f0 g_466 g_1170 g_192 g_1182 g_1184 g_534 g_1055
+ */
+static int32_t func_2(uint8_t p_3, uint16_t p_4)
+{ /* block id: 1 */
+ uint32_t l_13 = 4294967293UL;
+ struct S1 l_1192 = {4294967295UL,9UL,255UL,1L};
+ uint32_t l_1195 = 0xCB50686CL;
+ union U4 *l_1201 = &g_345[6][0];
+ union U4 **l_1200 = &l_1201;
+ const struct S2 l_1216[6] = {{55},{55},{55},{55},{55},{55}};
+ int32_t *l_1217 = &g_1055;
+ int32_t **l_1218 = &l_1217;
+ int32_t *l_1219 = &g_532;
+ const int32_t *l_1225 = &g_90;
+ const int32_t * const *l_1224 = &l_1225;
+ const int32_t * const **l_1223 = &l_1224;
+ const int32_t * const ***l_1222 = &l_1223;
+ struct S0 l_1232 = {0L,896,3465,3852,0x4AL,3152,4727};
+ uint32_t l_1235[3][7] = {{0x1A37F656L,1UL,0UL,2UL,1UL,2UL,0UL},{1UL,1UL,0UL,0x65068BF2L,18446744073709551613UL,0UL,18446744073709551613UL},{0x65068BF2L,0UL,0UL,0x65068BF2L,2UL,0x1A37F656L,0x65068BF2L}};
+ const struct S2 **l_1242 = &g_192[3][4];
+ const int32_t l_1244 = 0xB5670868L;
+ struct S3 l_1247[10] = {{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL},{4294967295UL,4294967295UL}};
+ int32_t *l_1248 = &g_623.f0;
+ int i, j;
+ (*g_692) = (safe_mod_func_int32_t_s_s(((safe_unary_minus_func_int32_t_s((func_10(l_13, p_3) , (((+(safe_sub_func_uint16_t_u_u(p_3, (((l_1192 , (safe_mul_func_uint8_t_u_u(l_1195, (l_1192.f2 ^ (!(p_3 >= 1UL)))))) >= 0xB3L) , 0xD7AAL)))) ^ p_4) , p_3)))) && g_466), p_3));
+ l_1219 = ((*l_1218) = ((safe_add_func_int32_t_s_s(((0x2BL & (l_1195 | (safe_mod_func_int16_t_s_s(p_3, ((l_1200 == &l_1201) , g_108.f2))))) < (0xD1L <= 0L)), (safe_lshift_func_int8_t_s_s((((safe_rshift_func_uint16_t_u_s((safe_mod_func_uint32_t_u_u((safe_sub_func_int32_t_s_s((safe_sub_func_int32_t_s_s(((safe_mul_func_uint8_t_u_u(((l_1216[1] , l_1192) , p_3), g_404[2][0][0].f3)) | 1L), g_96)), 4294967287UL)), l_1192.f0)), 11)) && l_1192.f1) <= 0x9DAECEF8L), l_1192.f3)))) , l_1217));
+ if ((func_26(((*g_165) & ((safe_rshift_func_int8_t_s_s((((g_557 > (5UL == (g_557 , g_96))) <= (l_1222 == &g_1182)) == (safe_sub_func_uint16_t_u_u((safe_mod_func_int32_t_s_s((safe_sub_func_int32_t_s_s(((((((l_1232 , ((*l_1217) ^= (safe_mul_func_int8_t_s_s(((+((void*)0 == &l_13)) >= 0xEEL), 1UL)))) < p_4) != (*g_165)) || g_455[0]) , p_3) ^ l_1235[1][2]), 0x9CB65C83L)), g_99.f3)), g_1057[2][2]))), g_525.f1)) , 0x48F4L)), (*l_1218)) , (**l_1218)))
+ { /* block id: 590 */
+ struct S2 **l_1243 = (void*)0;
+ union U4 *l_1245 = &g_591[3][4];
+ int32_t l_1246 = (-1L);
+ (*g_692) &= (safe_lshift_func_int8_t_s_s(((safe_mod_func_int8_t_s_s(((safe_div_func_uint16_t_u_u((((!(((l_1242 != l_1243) ^ (0x2DA6L || l_1244)) && ((*l_1219) = (l_1245 == l_1245)))) < (l_1246 , g_452)) == (((*g_165) = p_4) < 0x34C9L)), l_1246)) == g_108.f5), g_525.f0)) , p_4), 5));
+ (*l_1218) = func_34(&g_465, (*l_1245), func_34(func_45((*l_1218), l_1247[3]), g_345[5][0], l_1248));
+ (*l_1219) ^= (*l_1248);
+ }
+ else
+ { /* block id: 596 */
+ struct S3 l_1249 = {4294967295UL,1UL};
+ struct S3 *l_1250 = (void*)0;
+ struct S3 *l_1251[7][8][1] = {{{&g_25},{(void*)0},{&l_1249},{&g_25},{(void*)0},{(void*)0},{(void*)0},{&g_49[3]}},{{(void*)0},{(void*)0},{(void*)0},{&g_25},{&l_1249},{(void*)0},{&g_25},{(void*)0}},{{(void*)0},{&g_25},{(void*)0},{&l_1249},{&g_25},{(void*)0},{(void*)0},{(void*)0}},{{&g_49[3]},{(void*)0},{(void*)0},{(void*)0},{&g_25},{&l_1249},{(void*)0},{&g_25}},{{(void*)0},{(void*)0},{&g_25},{(void*)0},{&l_1249},{&g_25},{(void*)0},{(void*)0}},{{(void*)0},{&g_49[3]},{(void*)0},{(void*)0},{(void*)0},{&g_25},{&l_1249},{(void*)0}},{{&g_25},{(void*)0},{(void*)0},{&g_25},{(void*)0},{&l_1249},{&g_25},{(void*)0}}};
+ int i, j, k;
+ g_49[4] = l_1249;
+ }
+ return (*g_692);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_25 g_5 g_52 g_96 g_99 g_103 g_108 g_109 g_110 g_109.f0 g_165 g_82 g_92 g_183.f0 g_191 g_218 g_90 g_183 g_49.f1 g_49.f0 g_258 g_49 g_332 g_345.f0 g_395 g_398 g_455 g_467 g_345 g_393 g_465 g_535 g_538 g_452 g_525.f1 g_575 g_532 g_623.f4 g_692 g_466 g_1057 g_404.f1 g_623.f0 g_454 g_815 g_623.f3 g_1175
+ * writes: g_5 g_49 g_52 g_96 g_103 g_110 g_99.f3 g_108.f4 g_99.f2 g_165 g_108.f0 g_191 g_92 g_108.f2 g_108.f1 g_108.f6 g_108 g_304 g_332 g_395 g_398 g_258 g_455 g_467 g_465 g_518 g_524 g_535 g_538 g_557 g_575 g_532 g_452 g_1057 g_25.f0 g_623.f0 g_466 g_1170 g_192 g_1182 g_1184 g_534
+ */
+static struct S0 func_10(uint8_t p_11, uint32_t p_12)
+{ /* block id: 2 */
+ uint8_t l_14[2];
+ struct S3 *l_1025 = &g_49[3];
+ struct S3 **l_1024 = &l_1025;
+ union U4 l_1026 = {-10L};
+ int32_t *l_1037 = &g_108.f0;
+ int32_t l_1049 = 0x9C024423L;
+ int32_t l_1051 = 1L;
+ int32_t l_1052 = 6L;
+ int32_t l_1053 = 6L;
+ int32_t l_1056 = (-10L);
+ int32_t l_1080 = 5L;
+ int16_t l_1149 = 0x2237L;
+ int32_t ** const l_1152 = (void*)0;
+ int32_t **l_1179 = (void*)0;
+ int32_t ***l_1178 = &l_1179;
+ int32_t ***l_1181 = &l_1179;
+ int32_t ****l_1180[9] = {&l_1181,&l_1181,&l_1181,&l_1181,&l_1181,&l_1181,&l_1181,&l_1181,&l_1181};
+ int8_t l_1187 = (-8L);
+ int16_t *l_1188 = (void*)0;
+ struct S0 l_1189 = {0xED4943ABL,-763,-734,4256,0xC4L,3227,1761};
+ int i;
+ for (i = 0; i < 2; i++)
+ l_14[i] = 0UL;
+ for (p_12 = 0; (p_12 <= 1); p_12 += 1)
+ { /* block id: 5 */
+ int32_t *l_24 = (void*)0;
+ uint8_t *l_470 = &g_96;
+ int32_t **l_1021 = &l_24;
+ int i;
+ for (g_5 = 0; g_5 < 2; g_5 += 1)
+ {
+ l_14[g_5] = 0UL;
+ }
+ l_24 = func_15(func_19(l_24, g_25, (func_26(l_14[p_12], (((((safe_sub_func_uint8_t_u_u(((*l_470) = func_31(l_24)), l_14[p_12])) && 0UL) ^ (safe_mul_func_int16_t_s_s(0x458AL, ((l_14[p_12] != l_14[1]) ^ 255UL)))) || p_11) , &g_465)) , &g_52), &g_532), g_623.f4, p_11);
+ (*l_1021) = l_24;
+ if (l_14[0])
+ continue;
+ }
+ (*g_692) = (g_623.f4 < 0UL);
+ if ((+(safe_mod_func_uint16_t_u_u((*g_165), (((l_1024 == &g_966) , (5UL <= l_14[0])) , (((l_1026 , p_11) ^ ((safe_mod_func_int16_t_s_s(((p_11 ^ (safe_add_func_int8_t_s_s((((**l_1024) = (**l_1024)) , g_466), 0xC0L))) , 0x5932L), p_11)) || l_1026.f0)) , (*g_165)))))))
+ { /* block id: 537 */
+ for (g_452 = 4; (g_452 <= (-10)); --g_452)
+ { /* block id: 540 */
+ struct S0 l_1033 = {1L,698,901,1235,0xECL,371,16979};
+ return l_1033;
+ }
+ }
+ else
+ { /* block id: 543 */
+ int32_t *l_1036 = &g_108.f0;
+ int32_t l_1045 = 0xA4C54D33L;
+ int32_t l_1046 = 0x85FF5E2CL;
+ int32_t l_1047 = 0x9B98B598L;
+ int32_t l_1048 = 0L;
+ int32_t l_1050[4] = {0x17E2FF5BL,0x17E2FF5BL,0x17E2FF5BL,0x17E2FF5BL};
+ struct S2 l_1075 = {83};
+ int16_t l_1081 = 0x9246L;
+ struct S1 l_1143 = {0x454ACDE8L,0UL,0xC1L,-1L};
+ const int32_t **l_1150 = (void*)0;
+ int i;
+ for (g_108.f4 = (-8); (g_108.f4 == 1); g_108.f4 = safe_add_func_int16_t_s_s(g_108.f4, 4))
+ { /* block id: 546 */
+ l_1037 = func_34(l_1036, l_1026, l_1036);
+ }
+ if ((*l_1036))
+ { /* block id: 549 */
+ int32_t *l_1038 = &g_465;
+ int32_t *l_1039 = &g_108.f0;
+ int32_t *l_1040 = &g_623.f0;
+ int32_t *l_1041 = &g_465;
+ int32_t *l_1042 = &g_465;
+ int32_t l_1043 = 0L;
+ int32_t *l_1044[5] = {&g_465,&g_465,&g_465,&g_465,&g_465};
+ int8_t *l_1074 = &g_258;
+ uint32_t *l_1078 = &g_25.f0;
+ uint32_t *l_1079 = &g_1057[2][1];
+ int i;
+ g_1057[2][2]++;
+ (*l_1042) = ((*l_1040) &= (safe_add_func_int16_t_s_s(((((safe_rshift_func_int8_t_s_u((safe_sub_func_int8_t_s_s(((safe_rshift_func_int16_t_s_s(g_404[2][0][0].f1, (((safe_mod_func_int32_t_s_s((0xCCABL ^ (*g_165)), (safe_sub_func_int32_t_s_s(p_12, ((((((*g_692) , (((-1L) & ((*l_1079) &= ((*l_1078) = (safe_mul_func_int8_t_s_s((!((*l_1074) &= (*l_1041))), (l_1075 , (safe_mul_func_uint16_t_u_u(p_12, (*l_1036))))))))) > (*l_1036))) != p_11) , p_11) | 0x2FL) >= l_1080))))) < 0xDF08L) & 0x88C67591L))) < p_12), p_12)), 7)) >= 0x5AD2FD77L) >= l_1081) && 0x28L), p_12)));
+ }
+ else
+ { /* block id: 556 */
+ int8_t l_1082 = 0x86L;
+ int32_t l_1084 = 0x272816E1L;
+ int32_t l_1093 = (-1L);
+ int32_t l_1096 = (-1L);
+ int32_t l_1097 = 1L;
+ struct S1 *l_1171 = &l_1143;
+ if ((!l_1082))
+ { /* block id: 557 */
+ int32_t **l_1083 = &l_1036;
+ int32_t l_1085 = 1L;
+ int32_t *l_1086 = (void*)0;
+ int32_t *l_1087 = &l_1047;
+ int32_t *l_1088 = (void*)0;
+ int32_t *l_1089 = &l_1050[1];
+ int32_t *l_1090 = &g_465;
+ int32_t *l_1091 = (void*)0;
+ int32_t *l_1092 = &l_1050[1];
+ int32_t *l_1094 = &g_465;
+ int32_t *l_1095[4][6];
+ uint32_t l_1098 = 4294967295UL;
+ uint32_t *l_1134[9][1][3];
+ int8_t *l_1135 = &g_466;
+ int8_t *l_1136 = &g_258;
+ struct S3 * const l_1148 = &g_49[5];
+ int i, j, k;
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 6; j++)
+ l_1095[i][j] = (void*)0;
+ }
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 3; k++)
+ l_1134[i][j][k] = (void*)0;
+ }
+ }
+ (*l_1083) = &l_1047;
+ ++l_1098;
+ (*g_692) = ((safe_div_func_int16_t_s_s(((safe_mod_func_int8_t_s_s(((safe_lshift_func_int16_t_s_s((-6L), (safe_lshift_func_uint16_t_u_u(((*l_1087) ^= (*l_1092)), (!(*l_1037)))))) <= ((*g_165) = (safe_mod_func_int8_t_s_s((safe_add_func_uint32_t_u_u((*l_1037), p_11)), (safe_unary_minus_func_uint32_t_u((((*l_1136) = ((*l_1135) = (safe_mod_func_int16_t_s_s((((safe_add_func_uint16_t_u_u((((g_455[0] , (safe_div_func_uint32_t_u_u((g_49[3].f0 |= ((safe_mul_func_int8_t_s_s((((*l_1037) > ((safe_lshift_func_int8_t_s_s((((safe_rshift_func_int16_t_s_s((l_1093 ^= (safe_mod_func_uint8_t_u_u((((safe_sub_func_uint8_t_u_u(((~((safe_mul_func_int16_t_s_s((safe_add_func_uint16_t_u_u((((p_11 , ((p_11 || 0x67L) & (*g_165))) > 4L) >= 0x8DB0432BL), p_11)), g_465)) && 0xA1L)) | 65535UL), 0L)) & l_1084) != p_12), p_11))), (*l_1037))) < 0x75L) == g_218.f0), g_108.f4)) <= (*g_692))) | g_454), g_1057[2][2])) >= 0xABL)), (*l_1037)))) | 3UL) && p_11), p_11)) ^ p_11) , g_404[2][0][0].f1), l_1096)))) > 0x6CL))))))), p_12)) ^ p_12), 0xF789L)) | 0xB5CD281EL);
+ (*l_1094) = (!(safe_rshift_func_int8_t_s_u((safe_div_func_uint32_t_u_u(((((*g_165) = (p_11 || (safe_mod_func_int32_t_s_s(1L, 1UL)))) || (((((*l_1025) , ((((void*)0 == &l_1075) & (l_1143 , (safe_mul_func_int16_t_s_s((safe_div_func_uint32_t_u_u(0x48E9A67DL, ((l_1148 == (void*)0) && l_1084))), g_532)))) & p_12)) <= l_1149) & (*l_1037)) ^ (*g_692))) != l_1096), l_1096)), l_1097)));
+ }
+ else
+ { /* block id: 569 */
+ const int32_t ***l_1151[2][6] = {{(void*)0,&l_1150,(void*)0,&l_1150,(void*)0,&l_1150},{(void*)0,&l_1150,(void*)0,&l_1150,(void*)0,&l_1150}};
+ int32_t *l_1165 = (void*)0;
+ int32_t *l_1166 = (void*)0;
+ int32_t *l_1167 = (void*)0;
+ int32_t *l_1168[2];
+ uint16_t l_1169[1][2];
+ struct S1 **l_1172[3];
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_1168[i] = &l_1047;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 2; j++)
+ l_1169[i][j] = 5UL;
+ }
+ for (i = 0; i < 3; i++)
+ l_1172[i] = &l_1171;
+ l_1169[0][0] |= (((l_1150 = l_1150) != l_1152) ^ (safe_rshift_func_uint8_t_u_s((((*l_1037) , (safe_mod_func_int32_t_s_s((safe_rshift_func_uint8_t_u_s(((safe_mul_func_int16_t_s_s((3UL < (p_12 ^ ((safe_mod_func_int16_t_s_s(((safe_sub_func_uint32_t_u_u((func_26((l_1082 & ((-6L) >= p_11)), &g_465) , p_11), g_404[2][0][0].f1)) > (-1L)), g_815[0][0])) >= p_11))), g_92)) & g_1057[1][4]), 1)), (-1L)))) , 1UL), g_623.f3)));
+ g_1170 = (void*)0;
+ g_524[1][2][3] = l_1171;
+ }
+ (*g_191) = (void*)0;
+ }
+ }
+ (*g_692) |= ((safe_add_func_int16_t_s_s((&l_1152 == g_1175), ((*l_1037) , (g_534 = (0xEFL <= ((*l_1037) |= (safe_mul_func_uint8_t_u_u((((g_1182 = (l_1178 = l_1178)) == (g_1184 = (void*)0)) , (l_1026 , (g_96 = (safe_sub_func_int16_t_s_s(0xCE65L, l_1187))))), p_11)))))))) >= p_11);
+ return l_1189;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_52 g_532 g_108.f3 g_575 g_165 g_110.f0 g_393 g_692 g_465
+ * writes: g_52 g_532 g_103
+ */
+static int32_t * func_15(const int32_t * p_16, uint32_t p_17, uint16_t p_18)
+{ /* block id: 387 */
+ uint16_t l_766 = 1UL;
+ struct S3 *l_771 = &g_49[3];
+ int32_t l_774 = 0L;
+ union U4 l_789[6] = {{0x9E74BDE0L},{0x3925C28AL},{0x9E74BDE0L},{0x9E74BDE0L},{0x3925C28AL},{0x9E74BDE0L}};
+ const int16_t *l_794 = &g_404[2][0][0].f3;
+ int32_t *l_795 = &g_532;
+ int16_t l_803 = 0xBBA5L;
+ int32_t l_812 = 0xEEA32322L;
+ int32_t l_813 = 0xA6554D27L;
+ int32_t l_814[8][1][4] = {{{(-6L),6L,0x6CA574B2L,1L}},{{(-6L),0x6CA574B2L,(-6L),0L}},{{6L,1L,0L,0L}},{{0x6CA574B2L,0x6CA574B2L,0x2134D653L,1L}},{{1L,6L,0x2134D653L,6L}},{{0x6CA574B2L,(-6L),0L,0x2134D653L}},{{6L,(-6L),(-6L),6L}},{{(-6L),6L,0x6CA574B2L,1L}}};
+ uint16_t l_816 = 0UL;
+ uint16_t ** const l_830[6] = {&g_165,&g_165,&g_165,&g_165,&g_165,&g_165};
+ union U4 *l_920 = (void*)0;
+ union U4 **l_919[4][5][5] = {{{&l_920,&l_920,&l_920,&l_920,(void*)0},{&l_920,(void*)0,(void*)0,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920}},{{&l_920,(void*)0,(void*)0,&l_920,(void*)0},{&l_920,&l_920,&l_920,(void*)0,(void*)0},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,(void*)0,&l_920}},{{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,(void*)0,(void*)0},{&l_920,&l_920,&l_920,&l_920,(void*)0},{&l_920,&l_920,&l_920,(void*)0,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920}},{{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,(void*)0,(void*)0,(void*)0},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920},{&l_920,&l_920,&l_920,&l_920,&l_920}}};
+ union U4 ** const *l_918 = &l_919[2][4][3];
+ struct S1 l_963 = {8UL,0UL,248UL,1L};
+ uint32_t l_1004 = 4294967295UL;
+ struct S1 *l_1015 = &g_99;
+ struct S1 **l_1014 = &l_1015;
+ struct S1 ***l_1013[1][10][10] = {{{&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,(void*)0,&l_1014},{&l_1014,&l_1014,&l_1014,(void*)0,&l_1014,&l_1014,&l_1014,&l_1014,(void*)0,&l_1014},{&l_1014,(void*)0,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014},{(void*)0,(void*)0,&l_1014,(void*)0,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014},{&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014},{&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,(void*)0,&l_1014,(void*)0,&l_1014,&l_1014},{(void*)0,&l_1014,&l_1014,&l_1014,&l_1014,(void*)0,&l_1014,&l_1014,&l_1014,&l_1014},{&l_1014,(void*)0,&l_1014,&l_1014,(void*)0,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014},{&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014},{&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,&l_1014,(void*)0,&l_1014,&l_1014,&l_1014}}};
+ uint32_t l_1020[5];
+ int i, j, k;
+ for (i = 0; i < 5; i++)
+ l_1020[i] = 4294967292UL;
+ for (g_52 = 0; (g_52 == (-15)); g_52 = safe_sub_func_int8_t_s_s(g_52, 5))
+ { /* block id: 390 */
+ int32_t *l_760 = &g_532;
+ int32_t *l_761 = &g_532;
+ int32_t *l_762 = &g_623.f0;
+ int32_t *l_763 = (void*)0;
+ int32_t *l_764 = (void*)0;
+ int32_t *l_765[7] = {&g_465,&g_465,&g_532,&g_465,&g_465,&g_532,&g_465};
+ struct S3 *l_772 = &g_49[3];
+ uint8_t *l_773[10][2][1] = {{{(void*)0},{(void*)0}},{{(void*)0},{(void*)0}},{{&g_96},{(void*)0}},{{(void*)0},{(void*)0}},{{(void*)0},{&g_96}},{{(void*)0},{(void*)0}},{{(void*)0},{(void*)0}},{{&g_96},{(void*)0}},{{(void*)0},{(void*)0}},{{(void*)0},{&g_96}}};
+ int16_t *l_793 = &g_534;
+ struct S2 l_826 = {-115};
+ uint16_t l_865 = 65534UL;
+ struct S0 l_915 = {0x8466C6A7L,-203,3616,8093,0xFEL,2572,14412};
+ int32_t l_927 = (-1L);
+ struct S2 *l_941 = (void*)0;
+ union U4 l_949 = {0xA27D6C43L};
+ int i, j, k;
+ --l_766;
+ }
+ (*l_795) &= l_1004;
+ l_1020[1] = ((safe_rshift_func_uint16_t_u_s(((((g_108.f3 > ((safe_mul_func_int8_t_s_s((safe_lshift_func_uint8_t_u_u(p_17, (((safe_mul_func_int16_t_s_s(g_575, ((void*)0 == l_1013[0][9][3]))) | (safe_rshift_func_uint16_t_u_s((p_18 = (~((*g_165) = 65531UL))), 15))) | 0x251EB381L))), g_110.f0)) == ((safe_div_func_uint16_t_u_u((((6L > 7UL) , 0x3EF1C5FCL) & 0x28F2BA2DL), p_17)) != p_17))) <= p_17) | g_393[5]) && (*l_795)), p_17)) < (*g_692));
+ return &g_532;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_52 g_165 g_103 g_110 g_108.f2 g_532
+ * writes: g_532 g_52
+ */
+static int32_t * func_19(int32_t * p_20, struct S3 p_21, const int32_t * p_22, int32_t * p_23)
+{ /* block id: 301 */
+ struct S1 *l_578 = (void*)0;
+ struct S1 **l_579 = &l_578;
+ union U4 *l_580 = &g_345[6][0];
+ union U4 **l_581 = &l_580;
+ int32_t *l_582 = &g_52;
+ struct S0 l_603[2] = {{1L,-255,2999,2573,0L,1710,19812},{1L,-255,2999,2573,0L,1710,19812}};
+ int32_t l_701 = (-1L);
+ int32_t l_703 = 0x526C16DAL;
+ int32_t l_705 = 0xE1B0524CL;
+ int32_t l_706 = 0x31E2FC84L;
+ int32_t l_707 = 0xDCA00973L;
+ int i;
+ (*l_579) = l_578;
+ (*l_581) = l_580;
+ (*l_582) ^= ((*p_23) = 1L);
+ for (p_21.f0 = 2; (p_21.f0 <= 8); p_21.f0 += 1)
+ { /* block id: 308 */
+ union U4 * const **l_587 = (void*)0;
+ union U4 * const l_590 = &g_591[6][0];
+ union U4 * const *l_589 = &l_590;
+ union U4 * const **l_588 = &l_589;
+ struct S2 *l_595 = &g_110;
+ struct S2 **l_594 = &l_595;
+ uint16_t *l_598[4] = {&g_395,&g_395,&g_395,&g_395};
+ int32_t l_605 = 1L;
+ int32_t l_617[7][3] = {{1L,1L,(-1L)},{3L,2L,(-1L)},{2L,3L,(-1L)},{1L,1L,(-1L)},{3L,2L,(-1L)},{2L,3L,(-1L)},{1L,1L,1L}};
+ struct S0 l_622 = {0x8FD8D455L,470,911,1284,1L,1845,10842};
+ uint32_t l_651 = 18446744073709551612UL;
+ uint32_t l_708 = 4294967286UL;
+ int32_t *l_714[10];
+ int8_t *l_721 = &g_108.f4;
+ int i, j;
+ for (i = 0; i < 10; i++)
+ l_714[i] = &l_622.f0;
+ (*p_23) &= ((0xB43ABAF6L < ((safe_lshift_func_int8_t_s_u(((((*l_588) = &l_580) != (void*)0) ^ 0L), (((*g_165) >= ((safe_lshift_func_int8_t_s_u((((&g_192[3][4] != l_594) , (**l_594)) , 0xC4L), p_21.f1)) ^ (*l_582))) <= 0L))) && (*l_582))) >= g_108.f2);
+ }
+ return &g_465;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_395 g_258 g_165 g_103 g_49.f1 g_25.f1 g_92 g_455 g_52 g_5 g_25.f0 g_96 g_99 g_108 g_109 g_110 g_109.f0 g_345 g_332 g_393 g_398 g_465 g_49 g_535 g_538 g_452 g_467 g_525.f1 g_575 g_1055
+ * writes: g_395 g_465 g_49.f1 g_258 g_455 g_52 g_96 g_103 g_110 g_99.f3 g_49 g_108.f4 g_99.f2 g_165 g_304 g_332 g_518 g_524 g_535 g_538 g_108.f0 g_557 g_575 g_1055
+ */
+static struct S3 func_26(int32_t p_27, int32_t * p_28)
+{ /* block id: 237 */
+ uint8_t l_483 = 0xF7L;
+ uint16_t *l_484 = &g_332;
+ int32_t l_485 = 0x98DB7E6CL;
+ union U4 l_486 = {0x92E9D8B5L};
+ struct S1 l_488 = {0x97A67194L,0UL,246UL,0xC600L};
+ struct S3 l_489 = {0xEF71F2B9L,0x3456D091L};
+ int32_t l_504[8][3][4] = {{{0xA5103F6CL,(-1L),0x0FD3DB73L,(-1L)},{0xEC5AAA0EL,3L,0L,0xA5103F6CL},{0x194E9225L,0L,(-1L),0x75938D71L}},{{0L,0xEC5AAA0EL,4L,4L},{0L,0L,(-1L),0L},{0x194E9225L,4L,0L,0L}},{{0xEC5AAA0EL,0L,0x0FD3DB73L,0L},{0xA5103F6CL,0L,0xA5103F6CL,0L},{0L,4L,0x89CB0F28L,0L}},{{0L,0L,0xEC5AAA0EL,4L},{0x75938D71L,0xEC5AAA0EL,0xEC5AAA0EL,0x75938D71L},{0L,0L,0x89CB0F28L,0xA5103F6CL}},{{0L,3L,0xA5103F6CL,(-1L)},{0xA5103F6CL,(-1L),0x0FD3DB73L,(-1L)},{0xEC5AAA0EL,3L,0L,0xA5103F6CL}},{{0x194E9225L,0L,(-1L),0x75938D71L},{0L,0xEC5AAA0EL,4L,4L},{0L,0L,(-1L),0L}},{{0x194E9225L,4L,0L,0L},{0xEC5AAA0EL,0L,0x0FD3DB73L,0L},{0xA5103F6CL,0L,0xA5103F6CL,0L}},{{0L,4L,0x89CB0F28L,0L},{0L,0L,0xEC5AAA0EL,4L},{0x75938D71L,0xEC5AAA0EL,0xEC5AAA0EL,0x75938D71L}}};
+ uint32_t l_507 = 0x647DD300L;
+ struct S2 l_550 = {102};
+ int32_t *l_558 = &g_52;
+ int32_t *l_559 = &l_485;
+ int32_t *l_560 = (void*)0;
+ int32_t *l_561 = &g_532;
+ int32_t *l_562 = &g_532;
+ int32_t *l_563 = &g_465;
+ int32_t *l_564 = &g_52;
+ int32_t *l_565 = &g_52;
+ int32_t *l_566 = &g_108.f0;
+ int32_t *l_567 = &l_504[4][1][2];
+ int32_t *l_568 = &g_52;
+ int32_t *l_569 = &l_504[3][0][3];
+ int32_t *l_570 = &g_532;
+ int32_t *l_571 = &g_52;
+ int32_t *l_572 = &l_485;
+ int32_t *l_573 = &g_52;
+ int32_t *l_574[2];
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ l_574[i] = &l_504[4][1][2];
+ for (g_395 = 0; (g_395 <= 8); g_395 += 1)
+ { /* block id: 240 */
+ uint16_t *l_477 = (void*)0;
+ struct S2 l_478 = {134};
+ int32_t *l_490 = &g_108.f0;
+ int32_t l_529[9];
+ struct S0 l_546[3][5][9] = {{{{9L,-558,2164,8024,-2L,1272,4805},{9L,-558,2164,8024,-2L,1272,4805},{0x98E31EE4L,524,3745,6533,0L,809,13078},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{-7L,-918,3174,3816,0x5CL,341,15849},{0x98E31EE4L,524,3745,6533,0L,809,13078},{-7L,-918,3174,3816,0x5CL,341,15849},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{0x98E31EE4L,524,3745,6533,0L,809,13078}},{{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{-1L,-324,671,6036,0x18L,743,22659},{6L,-198,-158,3699,0x19L,3763,2066},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{6L,-198,-158,3699,0x19L,3763,2066},{-1L,-324,671,6036,0x18L,743,22659},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619}},{{9L,-558,2164,8024,-2L,1272,4805},{9L,-558,2164,8024,-2L,1272,4805},{0x98E31EE4L,524,3745,6533,0L,809,13078},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{-7L,-918,3174,3816,0x5CL,341,15849},{0x98E31EE4L,524,3745,6533,0L,809,13078},{-7L,-918,3174,3816,0x5CL,341,15849},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{0x98E31EE4L,524,3745,6533,0L,809,13078}},{{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{-1L,-324,671,6036,0x18L,743,22659},{6L,-198,-158,3699,0x19L,3763,2066},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{6L,-198,-158,3699,0x19L,3763,2066},{-1L,-324,671,6036,0x18L,743,22659},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619}},{{9L,-558,2164,8024,-2L,1272,4805},{9L,-558,2164,8024,-2L,1272,4805},{0x98E31EE4L,524,3745,6533,0L,809,13078},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{-7L,-918,3174,3816,0x5CL,341,15849},{0x98E31EE4L,524,3745,6533,0L,809,13078},{-7L,-918,3174,3816,0x5CL,341,15849},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{0x98E31EE4L,524,3745,6533,0L,809,13078}}},{{{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{-1L,-324,671,6036,0x18L,743,22659},{6L,-198,-158,3699,0x19L,3763,2066},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{6L,-198,-158,3699,0x19L,3763,2066},{-1L,-324,671,6036,0x18L,743,22659},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619}},{{9L,-558,2164,8024,-2L,1272,4805},{9L,-558,2164,8024,-2L,1272,4805},{0x98E31EE4L,524,3745,6533,0L,809,13078},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{-7L,-918,3174,3816,0x5CL,341,15849},{0x98E31EE4L,524,3745,6533,0L,809,13078},{-7L,-918,3174,3816,0x5CL,341,15849},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{0x98E31EE4L,524,3745,6533,0L,809,13078}},{{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{-1L,-324,671,6036,0x18L,743,22659},{6L,-198,-158,3699,0x19L,3763,2066},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{6L,-198,-158,3699,0x19L,3763,2066},{-1L,-324,671,6036,0x18L,743,22659},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619}},{{9L,-558,2164,8024,-2L,1272,4805},{9L,-558,2164,8024,-2L,1272,4805},{0x98E31EE4L,524,3745,6533,0L,809,13078},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{-7L,-918,3174,3816,0x5CL,341,15849},{0x98E31EE4L,524,3745,6533,0L,809,13078},{-7L,-918,3174,3816,0x5CL,341,15849},{0x6D6BAD42L,108,-3812,5229,0x1EL,1650,3238},{0x98E31EE4L,524,3745,6533,0L,809,13078}},{{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{-1L,-324,671,6036,0x18L,743,22659},{6L,-198,-158,3699,0x19L,3763,2066},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619},{6L,-198,-158,3699,0x19L,3763,2066},{-1L,-324,671,6036,0x18L,743,22659},{0xB51E6FFAL,-615,2203,924,0x1CL,953,19619}}},{{{9L,-558,2164,8024,-2L,1272,4805},{0L,-867,-638,5318,0x30L,27,9582},{9L,-558,2164,8024,-2L,1272,4805},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{9L,-558,2164,8024,-2L,1272,4805},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{9L,-558,2164,8024,-2L,1272,4805}},{{1L,-463,3552,4737,9L,3388,5555},{1L,-463,3552,4737,9L,3388,5555},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB99A8D2DL,623,254,6652,0L,2740,6051},{0x6B0D55B9L,786,3393,3754,0x9BL,2318,16303},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x6B0D55B9L,786,3393,3754,0x9BL,2318,16303},{0xB99A8D2DL,623,254,6652,0L,2740,6051},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070}},{{0L,-867,-638,5318,0x30L,27,9582},{0L,-867,-638,5318,0x30L,27,9582},{9L,-558,2164,8024,-2L,1272,4805},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{9L,-558,2164,8024,-2L,1272,4805},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{9L,-558,2164,8024,-2L,1272,4805}},{{1L,-463,3552,4737,9L,3388,5555},{1L,-463,3552,4737,9L,3388,5555},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0xB99A8D2DL,623,254,6652,0L,2740,6051},{0x6B0D55B9L,786,3393,3754,0x9BL,2318,16303},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070},{0x6B0D55B9L,786,3393,3754,0x9BL,2318,16303},{0xB99A8D2DL,623,254,6652,0L,2740,6051},{0x04F751E2L,-810,2427,5511,0x87L,1463,7070}},{{0L,-867,-638,5318,0x30L,27,9582},{0L,-867,-638,5318,0x30L,27,9582},{9L,-558,2164,8024,-2L,1272,4805},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{9L,-558,2164,8024,-2L,1272,4805},{0xFA3EC8E2L,-191,-287,7473,0xE1L,3268,19310},{0x3C8FBEA6L,-370,-2091,2733,0x6EL,3848,7328},{9L,-558,2164,8024,-2L,1272,4805}}}};
+ int i, j, k;
+ for (i = 0; i < 9; i++)
+ l_529[i] = (-6L);
+ if (((safe_sub_func_int32_t_s_s((l_485 = (safe_rshift_func_int16_t_s_s((((((l_477 != l_477) == (l_478 , (safe_sub_func_int32_t_s_s(((safe_sub_func_uint32_t_u_u((((((*p_28) = l_483) ^ ((l_484 != (void*)0) ^ 1L)) >= ((((g_258 == (*g_165)) <= p_27) , p_27) >= 0x86E9F35BL)) & 0xC2L), l_483)) || l_478.f0), p_27)))) != p_27) | p_27) , l_483), l_478.f0))), l_478.f0)) == l_483))
+ { /* block id: 243 */
+ uint32_t l_487 = 0xCA921D1AL;
+ int32_t **l_491[4][3] = {{&g_304,&g_304,&l_490},{&g_304,&g_304,&l_490},{&g_304,&g_304,&l_490},{&g_304,&g_304,&l_490}};
+ int i, j;
+ g_304 = func_34(func_45(func_34(&g_465, l_486, &g_465), ((l_487 , l_488) , l_489)), g_345[7][0], l_490);
+ }
+ else
+ { /* block id: 245 */
+ int8_t l_492 = (-10L);
+ int32_t l_493 = 0x8EFF5816L;
+ int32_t l_502 = 0xC3A4854FL;
+ int32_t l_503 = 0L;
+ int32_t l_505 = (-2L);
+ int32_t l_506 = 0x9317DCD3L;
+ int32_t l_530 = 0x3BEC1AE2L;
+ int32_t l_533 = 0xC6DC5D19L;
+ struct S2 l_545 = {59};
+ struct S1 l_555 = {0UL,0x16F39D5EL,1UL,6L};
+ struct S2 l_556 = {-140};
+ for (g_103 = 0; (g_103 <= 8); g_103 += 1)
+ { /* block id: 248 */
+ int32_t *l_494 = &l_485;
+ int32_t *l_495 = &l_485;
+ int32_t l_496 = (-9L);
+ int32_t *l_497 = &g_52;
+ int32_t *l_498 = &l_493;
+ int32_t *l_499 = &g_108.f0;
+ int32_t l_500 = 0x705D0817L;
+ int32_t *l_501[9][7] = {{&l_500,&l_500,&l_496,(void*)0,(void*)0,(void*)0,(void*)0},{&g_465,&l_500,&g_465,(void*)0,&g_465,&l_500,&g_465},{&l_500,(void*)0,(void*)0,&l_500,(void*)0,&l_496,&l_496},{&l_493,&l_500,&g_465,&l_500,&l_493,&l_500,&g_465},{(void*)0,&l_500,(void*)0,(void*)0,&l_500,(void*)0,&l_496},{&g_465,(void*)0,&g_465,&l_500,&g_465,(void*)0,&g_465},{(void*)0,(void*)0,&l_496,&l_500,&l_500,&l_496,(void*)0},{&l_493,(void*)0,&g_465,(void*)0,&l_493,(void*)0,&g_465},{&l_500,&l_500,&l_496,(void*)0,(void*)0,(void*)0,(void*)0}};
+ const struct S1 **l_523 = (void*)0;
+ int i, j;
+ --l_507;
+ for (l_485 = 1; (l_485 <= 5); l_485 += 1)
+ { /* block id: 252 */
+ uint32_t *l_514 = &g_49[3].f0;
+ uint16_t *l_517 = &g_518;
+ int16_t l_519[3][8][7] = {{{1L,0x7436L,0x0B36L,(-1L),0x1325L,(-1L),0x186EL},{0L,(-1L),0x53B9L,0x97DDL,0xD97BL,(-6L),0L},{0xBB5AL,(-5L),0x0B36L,0x9816L,(-4L),(-1L),0x0D60L},{0xEF7CL,0xB31EL,(-1L),0xD0F5L,0xA256L,0x186EL,0L},{0xD10FL,0L,0x97DDL,0xD338L,0x53B9L,9L,0xB38CL},{0L,9L,1L,0L,0L,(-1L),1L},{0x0B36L,0x6756L,0xB31EL,9L,0L,1L,0xD97BL},{0x383CL,6L,0L,0xF1EEL,4L,1L,0xBB51L}},{{(-6L),0x7197L,0x1325L,1L,0xB707L,(-1L),0x66F8L},{(-4L),(-1L),0L,1L,(-5L),9L,(-1L)},{1L,0L,0x087EL,(-1L),(-4L),0xB471L,9L},{0L,(-5L),0xA8BCL,0xA8BCL,(-5L),0L,0x1608L},{0x97DDL,0xDEE0L,9L,0xD97BL,0x087EL,(-5L),0L},{(-1L),(-1L),(-6L),1L,0x0D60L,0x2F34L,(-1L)},{6L,0xDEE0L,0xBB51L,(-3L),(-7L),9L,(-5L)},{0xF1EEL,(-5L),0L,0x186EL,(-1L),4L,0xBB5AL}},{{(-1L),0xA8BCL,(-7L),0x383CL,(-1L),0xF1EEL,1L},{0x843AL,0x2F34L,0xEF7CL,1L,0xB27FL,0xDEE0L,0L},{0L,(-1L),1L,(-3L),0xBB95L,1L,0x8043L},{(-1L),6L,(-3L),0x8043L,0xBB95L,0L,0L},{1L,(-1L),0x66F8L,0xA256L,0xB27FL,0x087EL,(-1L)},{0L,0xF1EEL,1L,(-7L),(-1L),1L,0L},{0L,0L,1L,0xB27FL,(-1L),0xD338L,0xD338L},{(-7L),0x8AC8L,0x0D60L,0x8AC8L,(-7L),0xED5EL,0x66F8L}}};
+ struct S1 l_522 = {0x646DAE79L,4294967288UL,1UL,0x99F1L};
+ int i, j, k;
+ (*p_28) &= (safe_rshift_func_int8_t_s_u(((safe_add_func_uint8_t_u_u((((((+9L) || ((*l_498) , (((*l_514) = 1UL) <= (safe_add_func_uint16_t_u_u(((*l_517) = (g_455[0] = ((*l_484) &= (0xB114L <= p_27)))), (l_505 > (((~l_519[1][0][5]) || (((0xA658L & (safe_mod_func_int8_t_s_s((l_522 , g_393[3]), p_27))) != l_522.f3) >= l_505)) <= l_519[0][7][1]))))))) <= (*g_165)) , p_27) > l_504[4][1][2]), 0xEAL)) || g_398), p_27));
+ return g_49[g_395];
+ }
+ g_524[1][2][3] = &g_404[2][0][0];
+ }
+ for (g_99.f2 = 0; (g_99.f2 <= 8); g_99.f2 += 1)
+ { /* block id: 264 */
+ int32_t *l_526 = (void*)0;
+ int32_t *l_527 = &l_505;
+ int32_t *l_528[6][3];
+ struct S1 *l_554 = &l_488;
+ struct S1 **l_553 = &l_554;
+ int i, j;
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 3; j++)
+ l_528[i][j] = &g_52;
+ }
+ ++g_535[1][4][2];
+ g_538++;
+ for (l_506 = 6; (l_506 >= 0); l_506 -= 1)
+ { /* block id: 269 */
+ uint16_t l_548[5] = {0xF940L,0xF940L,0xF940L,0xF940L,0xF940L};
+ struct S2 *l_549 = (void*)0;
+ int i;
+ if ((safe_sub_func_int32_t_s_s((*p_28), (!((*p_28) || (*l_490))))))
+ { /* block id: 270 */
+ (*l_527) ^= (*p_28);
+ if ((*p_28))
+ continue;
+ }
+ else
+ { /* block id: 273 */
+ struct S2 l_543 = {91};
+ struct S2 *l_544[1];
+ int16_t *l_547 = &g_99.f3;
+ int i;
+ for (i = 0; i < 1; i++)
+ l_544[i] = &g_110;
+ l_545 = l_543;
+ (*l_527) = ((l_546[2][3][0] = g_108) , (((*l_547) = g_452) == ((*l_484) = l_548[4])));
+ if (g_467)
+ continue;
+ }
+ (*l_490) = (((l_550 = l_478) , (g_108 , &l_486)) == &l_486);
+ for (l_492 = 7; (l_492 >= 1); l_492 -= 1)
+ { /* block id: 285 */
+ (*l_490) |= l_486.f0;
+ return g_49[0];
+ }
+ }
+ g_557 = (safe_mul_func_int16_t_s_s(((g_525.f1 & (&g_524[1][5][1] != l_553)) ^ (p_27 && ((l_555 , (l_556 , (-1L))) > g_25.f0))), 0x7A39L));
+ }
+ }
+ for (g_96 = 1; (g_96 <= 8); g_96 += 1)
+ { /* block id: 295 */
+ int i;
+ return g_49[g_96];
+ }
+ }
+ g_575--;
+ return l_489;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_5 g_25 g_52 g_96 g_99 g_103 g_108 g_109 g_110 g_109.f0 g_165 g_82 g_92 g_183.f0 g_191 g_218 g_90 g_183 g_49.f1 g_49.f0 g_258 g_49 g_332 g_345.f0 g_395 g_398 g_455 g_467
+ * writes: g_5 g_49 g_52 g_96 g_103 g_110 g_99.f3 g_108.f4 g_99.f2 g_165 g_108.f0 g_191 g_92 g_108.f2 g_108.f1 g_108.f6 g_108 g_304 g_332 g_395 g_398 g_258 g_455 g_467
+ */
+static uint8_t func_31(int32_t * p_32)
+{ /* block id: 7 */
+ uint32_t l_33[2];
+ struct S3 l_43 = {0x4F6F4846L,1UL};
+ struct S3 l_50 = {4UL,4294967289UL};
+ union U4 l_406[7] = {{-3L},{0xB7779B28L},{-3L},{-3L},{0xB7779B28L},{-3L},{-3L}};
+ int32_t l_462 = (-1L);
+ int32_t *l_463 = &l_462;
+ int32_t *l_464[3];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_33[i] = 4294967286UL;
+ for (i = 0; i < 3; i++)
+ l_464[i] = &l_462;
+ for (g_5 = 1; (g_5 >= 0); g_5 -= 1)
+ { /* block id: 10 */
+ struct S3 *l_44 = &l_43;
+ struct S3 *l_48 = &g_49[3];
+ const struct S1 l_167 = {0x3CA78DFFL,0x8E3CAE63L,1UL,0L};
+ int32_t **l_458 = &g_304;
+ struct S0 *l_461 = &g_108;
+ int i;
+ (*l_458) = func_34(func_38(((*l_44) = l_43), l_33[g_5], func_45(p_32, (l_50 = ((*l_48) = g_25))), l_167), l_406[3], p_32);
+ for (g_99.f2 = 0; (g_99.f2 <= 1); g_99.f2 += 1)
+ { /* block id: 230 */
+ struct S0 *l_459 = &g_108;
+ struct S0 **l_460[6] = {&l_459,&l_459,(void*)0,&l_459,&l_459,(void*)0};
+ int i;
+ l_461 = l_459;
+ }
+ }
+ g_467++;
+ return g_467;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_49.f1 g_165 g_103 g_25.f1 g_258 g_92 g_455
+ * writes: g_49.f1 g_258 g_455
+ */
+static int32_t * func_34(int32_t * p_35, union U4 p_36, int32_t * p_37)
+{ /* block id: 221 */
+ struct S2 l_409 = {-163};
+ uint32_t *l_416 = (void*)0;
+ uint32_t *l_417[2];
+ int32_t l_418 = 0L;
+ int32_t l_419 = 0x825E3BEFL;
+ int32_t l_420 = 0x051A042DL;
+ int32_t l_443 = (-1L);
+ int32_t *l_444 = &l_418;
+ int32_t *l_445 = (void*)0;
+ int32_t *l_446 = (void*)0;
+ int32_t *l_447 = (void*)0;
+ int32_t *l_448 = &l_420;
+ int32_t *l_449 = &g_108.f0;
+ int32_t *l_450 = &l_418;
+ int32_t *l_451[2][10] = {{&g_52,&g_52,&l_419,&g_52,&g_52,&l_419,&g_52,&g_52,&l_419,&g_52},{&g_52,&l_420,&l_420,&g_52,&l_420,&l_420,&g_52,&l_420,&l_420,&g_52}};
+ int8_t l_453 = (-6L);
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_417[i] = &g_49[3].f0;
+ l_443 &= ((safe_rshift_func_int8_t_s_u((l_409 , (((p_36.f0 && ((safe_rshift_func_int16_t_s_u(((safe_mod_func_uint8_t_u_u(((safe_sub_func_uint32_t_u_u(0UL, (g_49[3].f1--))) & (safe_mul_func_int8_t_s_s((g_258 ^= (safe_lshift_func_uint8_t_u_u((safe_mul_func_int16_t_s_s(0xC9E3L, (((safe_add_func_int16_t_s_s((l_409.f0 == p_36.f0), (safe_mod_func_uint16_t_u_u(l_419, (+((safe_div_func_int8_t_s_s((safe_div_func_int32_t_s_s((((safe_lshift_func_uint16_t_u_u((*g_165), 9)) , ((safe_add_func_uint16_t_u_u(((safe_sub_func_int8_t_s_s((-3L), 0x98L)) , p_36.f0), (*g_165))) & 0x6D1BCE73L)) < l_409.f0), p_36.f0)), g_25.f1)) , p_36.f0)))))) , l_418) != 0xE3B4E678L))), l_418))), l_409.f0))), l_420)) < l_420), p_36.f0)) >= l_409.f0)) < g_92) , 0x95L)), l_418)) > (*g_165));
+ ++g_455[0];
+ return p_37;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_108 g_52 g_165 g_103 g_82 g_25.f1 g_5 g_92 g_183.f0 g_191 g_109.f0 g_25.f0 g_218 g_90 g_109 g_183 g_49.f1 g_49.f0 g_258 g_49 g_110.f0 g_99.f2 g_332 g_25 g_96 g_99.f3 g_345.f0 g_395 g_398
+ * writes: g_108.f0 g_99.f2 g_52 g_103 g_191 g_92 g_108.f2 g_108.f1 g_108.f6 g_99.f3 g_108 g_49.f0 g_304 g_332 g_395 g_398 g_49
+ */
+static int32_t * func_38(struct S3 p_39, uint32_t p_40, int32_t * p_41, const struct S1 p_42)
+{ /* block id: 71 */
+ int8_t l_172 = (-1L);
+ int32_t *l_175 = (void*)0;
+ int32_t **l_174[3];
+ int32_t ***l_173 = &l_174[0];
+ struct S2 l_176 = {-169};
+ uint8_t *l_177 = &g_99.f2;
+ union U4 *l_182 = &g_183;
+ struct S2 *l_195 = (void*)0;
+ struct S2 **l_194 = &l_195;
+ int32_t l_254 = 0x048F6AE0L;
+ int8_t l_255 = 0L;
+ struct S0 l_262 = {0xC1C6760BL,-54,2234,3520,0L,2794,348};
+ struct S3 l_293 = {0xF50D0A37L,4294967291UL};
+ uint16_t l_350 = 0xC4BAL;
+ int32_t l_365 = 0x2489EBF2L;
+ uint32_t l_378[4] = {0x9D96597DL,0x9D96597DL,0x9D96597DL,0x9D96597DL};
+ const struct S1 *l_403 = &g_404[2][0][0];
+ int i;
+ for (i = 0; i < 3; i++)
+ l_174[i] = &l_175;
+ l_172 |= (g_108.f0 = (((p_39 , g_108) , (safe_rshift_func_int8_t_s_u((safe_add_func_uint16_t_u_u(p_39.f0, (g_52 <= g_108.f2))), 5))) || (*g_165)));
+ if ((((*l_173) = &p_41) != (((g_103 <= (((((l_176 , ((&g_52 != (p_42 , p_41)) , g_82)) <= (((*l_177) = p_42.f0) | (((((l_176 , g_25.f1) && g_5) & g_92) ^ g_108.f3) && 0x9DDE6059L))) , p_42.f1) , (void*)0) == (void*)0)) != 0x06L) , &l_175)))
+ { /* block id: 76 */
+ uint32_t l_178 = 0x40F41BBAL;
+ int32_t l_179 = 8L;
+ uint32_t *l_186 = &g_49[3].f0;
+ struct S0 l_217 = {0x9CC95D81L,-985,-1516,7140,0xA9L,2285,11191};
+ uint32_t l_259[5][5][8] = {{{0x404513ECL,1UL,0x0D50F805L,18446744073709551613UL,0x0D50F805L,1UL,0x404513ECL,0x657FA000L},{18446744073709551615UL,18446744073709551608UL,1UL,0xBD5D16FAL,0xEBC21351L,0x0D50F805L,0xDC2B5266L,0xFA0CCB0CL},{1UL,0UL,0x9FFD4D6FL,18446744073709551614UL,0xEBC21351L,0x404513ECL,0x66F2389CL,18446744073709551613UL},{18446744073709551615UL,7UL,0UL,0xFA0CCB0CL,0x0D50F805L,0x1AC60CB9L,1UL,1UL},{0x404513ECL,1UL,18446744073709551608UL,0xEBC21351L,4UL,1UL,0x96F26880L,0x1AC60CB9L}},{{0x233A39EEL,0xA609B5DDL,0xFA0CCB0CL,0xD9F72379L,0xAF2F1A97L,6UL,7UL,18446744073709551615UL},{18446744073709551608UL,18446744073709551608UL,1UL,0UL,18446744073709551615UL,18446744073709551612UL,18446744073709551612UL,18446744073709551614UL},{18446744073709551612UL,18446744073709551608UL,18446744073709551608UL,18446744073709551612UL,0x1AC60CB9L,0xBD5D16FAL,0x96F26880L,0x6981C5EEL},{1UL,0x9FFD4D6FL,18446744073709551615UL,0xFA0CCB0CL,18446744073709551615UL,0x984A7A52L,0x20E4E1FBL,1UL},{18446744073709551615UL,0x9FFD4D6FL,1UL,0xA609B5DDL,18446744073709551608UL,0xBD5D16FAL,1UL,0xF087EB8CL}},{{18446744073709551613UL,18446744073709551608UL,6UL,18446744073709551615UL,18446744073709551615UL,18446744073709551612UL,0xAF2F1A97L,0UL},{0xDC2B5266L,0x47E5CDF2L,4UL,1UL,1UL,0x4B447F4BL,18446744073709551608UL,0x0D50F805L},{0xDF4C687CL,18446744073709551612UL,0x9FFD4D6FL,18446744073709551613UL,0x47E5CDF2L,0UL,18446744073709551615UL,0xFA0CCB0CL},{18446744073709551608UL,0xD9F72379L,0x233A39EEL,0xB0982D63L,0UL,0xB0982D63L,0x233A39EEL,0xD9F72379L},{0x657FA000L,0xC65D9BC6L,0x782E8E32L,0x4B447F4BL,18446744073709551615UL,18446744073709551615UL,0x6981C5EEL,18446744073709551608UL}},{{0x2A31B2FEL,0x66F2389CL,18446744073709551615UL,0x0D50F805L,0x657FA000L,0UL,0x6981C5EEL,0x782E8E32L},{0UL,0x0D50F805L,0x782E8E32L,18446744073709551615UL,0x9FFD4D6FL,1UL,0x233A39EEL,0xDF4C687CL},{0x9FFD4D6FL,1UL,0x233A39EEL,0xDF4C687CL,0xC65D9BC6L,18446744073709551615UL,18446744073709551615UL,0x657FA000L},{0x6DAE4665L,0xFA0CCB0CL,0x9FFD4D6FL,1UL,0xBD5D16FAL,18446744073709551608UL,18446744073709551608UL,1UL},{0xA609B5DDL,0UL,4UL,0xD9F72379L,0x404513ECL,1UL,0xAF2F1A97L,0xAF2F1A97L}},{{0x6981C5EEL,1UL,6UL,6UL,1UL,0x6981C5EEL,1UL,8UL},{0xC65D9BC6L,0x2A31B2FEL,1UL,1UL,0xA609B5DDL,1UL,0x20E4E1FBL,0xBD5D16FAL},{6UL,1UL,18446744073709551615UL,1UL,18446744073709551613UL,0x782E8E32L,0x96F26880L,8UL},{0UL,18446744073709551613UL,18446744073709551608UL,6UL,18446744073709551615UL,18446744073709551615UL,18446744073709551612UL,0xAF2F1A97L},{0xF087EB8CL,0UL,1UL,0xD9F72379L,0x6DAE4665L,18446744073709551615UL,0xC65D9BC6L,1UL}}};
+ int i, j, k;
+lbl_185:
+ l_178 ^= p_42.f0;
+lbl_221:
+ l_179 ^= (g_108.f3 , (-1L));
+ for (g_52 = 0; (g_52 <= (-8)); --g_52)
+ { /* block id: 81 */
+ struct S2 **l_193 = (void*)0;
+ int32_t l_220 = (-2L);
+ uint8_t *l_247 = &g_99.f2;
+ struct S3 *l_294 = &l_293;
+ int32_t l_295[1];
+ int i;
+ for (i = 0; i < 1; i++)
+ l_295[i] = 1L;
+ for (g_103 = 1; (g_103 <= 8); g_103 += 1)
+ { /* block id: 84 */
+ union U4 **l_184 = &l_182;
+ (**l_173) = &g_52;
+ (*l_184) = l_182;
+ if (g_108.f6)
+ goto lbl_185;
+ }
+ if (((l_186 != l_186) >= ((((safe_mul_func_int8_t_s_s((p_42.f0 ^ ((safe_mod_func_int32_t_s_s(g_183.f0, (((g_191 = g_191) == (l_178 , (l_194 = l_193))) & p_42.f0))) , (safe_div_func_uint16_t_u_u(((safe_div_func_int8_t_s_s((safe_mod_func_int16_t_s_s(g_108.f1, g_109.f0)), g_108.f1)) , p_40), l_178)))), l_179)) , (void*)0) != (void*)0) < 0UL)))
+ { /* block id: 91 */
+ uint8_t l_210 = 1UL;
+ int8_t *l_219 = &g_92;
+ l_179 ^= (safe_add_func_int8_t_s_s(((safe_mod_func_uint32_t_u_u(g_109.f0, ((p_42.f2 == (safe_add_func_uint16_t_u_u((safe_add_func_int8_t_s_s(l_210, ((0x20L | (safe_rshift_func_int8_t_s_s((safe_sub_func_int32_t_s_s((g_108.f2 = (((*l_219) ^= ((g_25.f0 | (safe_mod_func_uint16_t_u_u((0x9049C42DL == g_108.f6), p_39.f0))) & ((l_217 , g_218) , 0xFFL))) > (-1L))), 1UL)), g_108.f4))) < l_220))), p_42.f2))) | l_210))) , g_108.f5), p_39.f0));
+ g_108.f1 = (g_108.f0 = l_210);
+ }
+ else
+ { /* block id: 97 */
+ int16_t *l_234 = &g_99.f3;
+ struct S2 l_235 = {-27};
+ const int32_t l_242 = 0L;
+ int32_t l_256 = 0xA933B74FL;
+ uint32_t l_289 = 0x25A83FB6L;
+ if (g_108.f5)
+ goto lbl_221;
+ if ((((safe_sub_func_uint32_t_u_u(0UL, g_90)) > ((safe_rshift_func_int16_t_s_s(((safe_mul_func_int16_t_s_s(((*l_234) = (safe_mod_func_int32_t_s_s(4L, (safe_lshift_func_int8_t_s_s((g_92 >= (g_108.f6 &= 0x5E2D9ED2L)), 2))))), g_92)) >= (l_235 , g_5)), l_220)) >= g_103)) | p_40))
+ { /* block id: 101 */
+ int16_t l_248 = 1L;
+ int32_t l_249 = 0xF2B5DE02L;
+ uint16_t l_250 = 65535UL;
+ if ((l_217.f5 , (g_109 , (+((safe_lshift_func_int16_t_s_s((safe_mod_func_int16_t_s_s((p_42.f3 <= ((((*l_182) , (((safe_add_func_int8_t_s_s(8L, l_242)) >= (((((!((safe_mod_func_int32_t_s_s((0L > (((safe_div_func_uint8_t_u_u((g_49[3].f1 >= ((((l_177 != l_247) ^ 0xA5L) & 0x5FE0L) == l_220)), l_217.f3)) >= p_42.f2) == l_179)), l_242)) && p_42.f2)) ^ l_235.f0) , l_242) & g_218.f0) >= 0xBCL)) >= p_42.f2)) <= 1L) | l_220)), l_248)), 12)) , 0x01166651L)))))
+ { /* block id: 102 */
+ union U4 **l_253 = &l_182;
+ l_250++;
+ (*l_253) = &g_183;
+ if (l_217.f3)
+ break;
+ }
+ else
+ { /* block id: 106 */
+ int32_t l_257 = (-1L);
+ l_259[3][4][1]--;
+ if (g_183.f0)
+ goto lbl_185;
+ }
+ for (l_217.f4 = 5; (l_217.f4 >= 0); l_217.f4 -= 1)
+ { /* block id: 112 */
+ if (g_25.f0)
+ break;
+ (**l_173) = &g_52;
+ }
+ }
+ else
+ { /* block id: 116 */
+ struct S0 *l_263 = (void*)0;
+ struct S0 **l_276 = &l_263;
+ g_108 = l_262;
+ l_256 = (0L > (safe_div_func_uint32_t_u_u(((*l_186) &= ((*g_165) | (0x9EL <= l_178))), (safe_div_func_uint8_t_u_u(((safe_div_func_int8_t_s_s(((safe_sub_func_int16_t_s_s((l_179 ^= 2L), p_39.f1)) == (~(safe_sub_func_uint16_t_u_u((g_108.f2 & p_40), ((safe_lshift_func_int16_t_s_s((!(-1L)), g_108.f6)) , 7UL))))), l_217.f6)) || (*g_165)), g_82)))));
+ (*l_276) = &g_108;
+ }
+ l_220 = (((((((255UL ^ l_220) <= (l_259[0][4][0] == ((safe_rshift_func_int16_t_s_s(((*l_234) = ((safe_rshift_func_uint8_t_u_s(((safe_add_func_uint32_t_u_u((0L ^ 0x06EA03D3L), 0x130C64E2L)) || 7L), 0)) || ((safe_lshift_func_uint8_t_u_u((safe_rshift_func_int16_t_s_u(((safe_lshift_func_uint8_t_u_s((l_242 , (p_42.f3 , l_220)), 4)) <= (*g_165)), p_42.f1)), 4)) ^ p_39.f1))), l_289)) > l_242))) > 0UL) != l_220) ^ g_108.f6) > g_258) , l_242);
+ }
+ for (l_220 = 0; (l_220 == (-6)); l_220--)
+ { /* block id: 128 */
+ struct S3 *l_292[2][4] = {{&g_49[3],&g_49[3],&g_49[3],&g_49[3]},{&g_49[3],&g_49[3],&g_49[3],&g_49[3]}};
+ int32_t *l_297 = (void*)0;
+ int i, j;
+ l_293 = g_49[3];
+ for (p_39.f1 = 0; (p_39.f1 <= 1); p_39.f1 += 1)
+ { /* block id: 132 */
+ int32_t *l_296 = &l_179;
+ for (l_255 = 0; (l_255 <= 5); l_255 += 1)
+ { /* block id: 135 */
+ int i, j;
+ l_294 = l_292[p_39.f1][(p_39.f1 + 1)];
+ l_295[0] = 0x1705E1A6L;
+ }
+ return l_297;
+ }
+ }
+ }
+ if (g_183.f0)
+ goto lbl_185;
+ }
+ else
+ { /* block id: 144 */
+ int16_t l_311 = (-9L);
+ int32_t l_330[5];
+ union U4 *l_344 = &g_345[6][0];
+ int8_t *l_348 = &g_108.f4;
+ int32_t **l_349[3][6] = {{&g_304,&g_304,&g_304,&g_304,&g_304,&g_304},{&g_304,&g_304,&g_304,&g_304,&g_304,&g_304},{&g_304,&g_304,&g_304,&g_304,&g_304,&g_304}};
+ struct S0 *l_385 = (void*)0;
+ int i, j;
+ for (i = 0; i < 5; i++)
+ l_330[i] = 1L;
+lbl_312:
+ for (p_39.f0 = (-9); (p_39.f0 > 18); ++p_39.f0)
+ { /* block id: 147 */
+ uint32_t l_300 = 4294967294UL;
+ int32_t l_301 = 0xD9208B22L;
+ if (l_300)
+ break;
+ l_301 = 0xA4C65C70L;
+ for (l_262.f4 = (-17); (l_262.f4 <= 4); l_262.f4 = safe_add_func_int16_t_s_s(l_262.f4, 8))
+ { /* block id: 152 */
+ for (l_301 = 3; (l_301 <= 8); l_301 += 1)
+ { /* block id: 155 */
+ struct S0 *l_305 = &g_108;
+ for (l_300 = 0; (l_300 <= 8); l_300 += 1)
+ { /* block id: 158 */
+ return p_41;
+ }
+ for (g_99.f3 = 2; (g_99.f3 <= 8); g_99.f3 += 1)
+ { /* block id: 163 */
+ g_304 = p_41;
+ }
+ l_305 = (void*)0;
+ }
+ if (p_42.f1)
+ continue;
+ }
+ }
+ for (p_39.f0 = (-15); (p_39.f0 != 21); p_39.f0 = safe_add_func_uint32_t_u_u(p_39.f0, 9))
+ { /* block id: 173 */
+ for (g_52 = (-16); (g_52 != 2); g_52++)
+ { /* block id: 176 */
+ uint8_t l_310 = 0x9BL;
+ g_108.f2 &= (l_311 = (l_310 ^= g_110.f0));
+ for (p_39.f1 = 0; (p_39.f1 <= 5); p_39.f1 += 1)
+ { /* block id: 182 */
+ if (p_42.f2)
+ goto lbl_312;
+ }
+ if (g_5)
+ break;
+ }
+ }
+ if ((safe_add_func_uint16_t_u_u((l_293 , 0x3EC2L), g_99.f2)))
+ { /* block id: 188 */
+ int32_t l_321[6][7] = {{(-5L),(-5L),0xD6B91F25L,4L,(-1L),4L,0xD6B91F25L},{0xACB8014FL,0xACB8014FL,0x3ED75555L,0xBE7ED0B2L,1L,0xBE7ED0B2L,0x3ED75555L},{(-5L),(-5L),0xD6B91F25L,0xEA670ACDL,(-3L),0xEA670ACDL,(-5L)},{1L,1L,0xACB8014FL,0L,0x94A37624L,0L,0xACB8014FL},{(-1L),(-1L),(-5L),0xEA670ACDL,(-3L),0xEA670ACDL,(-5L)},{1L,1L,0xACB8014FL,0L,0x94A37624L,0L,0xACB8014FL}};
+ uint16_t *l_331 = &g_332;
+ union U4 *l_341 = &g_183;
+ union U4 **l_342 = &l_182;
+ union U4 **l_343 = (void*)0;
+ union U4 *l_347 = &g_345[6][0];
+ union U4 **l_346 = &l_347;
+ uint32_t l_351 = 3UL;
+ struct S2 * const *l_356 = &l_195;
+ int32_t l_387 = 0L;
+ int32_t l_392[1][2][8] = {{{0x972F012CL,0L,0L,0x972F012CL,0L,0L,0x972F012CL,0L},{0x972F012CL,0x972F012CL,(-8L),0x972F012CL,0x972F012CL,(-8L),0x972F012CL,0x972F012CL}}};
+ int i, j, k;
+ if ((((safe_mul_func_int16_t_s_s((safe_rshift_func_int8_t_s_u(((*l_348) &= ((safe_add_func_int8_t_s_s((0x8DL > l_321[0][1]), (((safe_div_func_uint8_t_u_u((safe_add_func_int32_t_s_s((l_351 &= (safe_div_func_int16_t_s_s(g_99.f2, ((safe_lshift_func_uint16_t_u_u((*g_165), ((*l_331)++))) | (((g_25 , (safe_rshift_func_int16_t_s_s((safe_div_func_int16_t_s_s((safe_rshift_func_int8_t_s_u(((l_344 = ((*l_342) = l_341)) != ((*l_346) = &g_345[4][0])), 7)), ((((*l_173) = ((((&g_92 != l_348) && 1UL) && 0L) , l_349[0][5])) == (void*)0) | 0L))), 10))) <= l_350) | 0x5D11L))))), g_258)), 0xB7L)) && g_82) <= p_42.f1))) | p_40)), p_42.f1)), l_321[4][2])) < g_96) <= 0x9CL))
+ { /* block id: 196 */
+ g_108.f1 = (+(((void*)0 == &g_108) & (3UL <= (p_42 , ((((0x76BACE53L ^ g_99.f3) & ((p_42.f1 | (safe_mul_func_uint8_t_u_u((&g_192[3][4] != (((*l_348) ^= (safe_div_func_int16_t_s_s((-1L), 0x3769L))) , l_356)), g_108.f3))) && g_108.f5)) >= g_49[3].f0) >= 5UL)))));
+ }
+ else
+ { /* block id: 199 */
+ const int32_t l_374 = 0x1727C7D6L;
+ int32_t l_375 = 0xA28F6C8BL;
+ int16_t *l_376 = (void*)0;
+ int16_t *l_377[3];
+ int32_t l_379 = 0L;
+ int i;
+ for (i = 0; i < 3; i++)
+ l_377[i] = &l_311;
+ l_379 = (safe_add_func_uint8_t_u_u((safe_mul_func_uint16_t_u_u(((safe_div_func_int8_t_s_s((-2L), p_42.f1)) > 0UL), (((safe_add_func_int32_t_s_s(l_365, g_258)) && (((g_99.f3 = (safe_mod_func_int8_t_s_s(g_108.f0, ((*l_348) = (l_375 = ((g_345[6][0].f0 > ((safe_sub_func_uint32_t_u_u((g_108.f3 &= ((safe_rshift_func_uint16_t_u_u((*g_165), ((safe_mod_func_uint32_t_u_u(l_351, l_374)) <= p_42.f3))) , 4294967295UL)), l_374)) != l_374)) && l_374)))))) && l_378[1]) , p_40)) < (-5L)))), p_42.f3));
+ }
+ for (l_311 = 4; (l_311 >= 25); l_311++)
+ { /* block id: 208 */
+ struct S0 *l_382 = &l_262;
+ struct S0 **l_383[9][10][1] = {{{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382}},{{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382},{(void*)0},{&l_382},{(void*)0}},{{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382},{(void*)0},{&l_382}},{{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382},{&l_382}},{{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382}},{{(void*)0},{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{(void*)0}},{{&l_382},{(void*)0},{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382}},{{(void*)0},{&l_382},{&l_382},{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382},{&l_382}},{{&l_382},{(void*)0},{&l_382},{(void*)0},{&l_382},{(void*)0},{&l_382},{&l_382},{&l_382},{&l_382}}};
+ struct S0 *l_384 = &g_108;
+ int32_t l_386 = (-1L);
+ int32_t l_388 = 1L;
+ int32_t l_389 = 0xE1A9D191L;
+ int32_t l_390 = 0xC7A0417FL;
+ int32_t l_391 = 1L;
+ int32_t l_394 = (-8L);
+ int i, j, k;
+ l_385 = (l_384 = l_382);
+ g_395++;
+ }
+ --g_398;
+ }
+ else
+ { /* block id: 214 */
+ const struct S1 *l_402 = (void*)0;
+ const struct S1 **l_401[7][3][9] = {{{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402}},{{&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402}},{{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402}},{{&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402}},{{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402}},{{&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402}},{{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402},{&l_402,(void*)0,(void*)0,&l_402,&l_402,(void*)0,(void*)0,&l_402,&l_402},{&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402,(void*)0,&l_402}}};
+ int32_t *l_405 = &g_52;
+ int i, j, k;
+ l_403 = &p_42;
+ g_49[3] = g_49[6];
+ l_405 = (void*)0;
+ }
+ }
+ return &g_52;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_52 g_5 g_25.f0 g_96 g_99 g_103 g_108 g_109 g_110 g_25.f1 g_109.f0
+ * writes: g_52 g_96 g_103 g_110 g_99.f3 g_49 g_108.f4 g_99.f2 g_165
+ */
+static int32_t * func_45(int32_t * p_46, struct S3 p_47)
+{ /* block id: 14 */
+ int32_t *l_51 = &g_52;
+ int32_t *l_53 = &g_52;
+ int32_t *l_54 = &g_52;
+ int32_t *l_55 = &g_52;
+ int32_t *l_56 = &g_52;
+ int32_t *l_57 = &g_52;
+ int32_t *l_58 = &g_52;
+ int32_t *l_59 = &g_52;
+ int32_t l_60 = 0x722525A5L;
+ int32_t *l_61 = (void*)0;
+ int32_t *l_62 = &g_52;
+ int32_t *l_63 = (void*)0;
+ int32_t *l_64 = &l_60;
+ int32_t *l_65 = &g_52;
+ uint8_t l_66 = 0x5DL;
+ struct S3 l_76 = {0x937BBCECL,0x3F78CAFAL};
+ int32_t l_93 = 0L;
+ int32_t l_95 = 0xCC66F1EAL;
+ uint16_t *l_123 = &g_103;
+ struct S2 l_152[7] = {{137},{137},{137},{137},{137},{137},{137}};
+ struct S0 l_154 = {0x4F983824L,-543,3055,3523,8L,612,3345};
+ int i;
+ ++l_66;
+lbl_113:
+ if (((*l_64) |= (+(safe_unary_minus_func_int32_t_s((*l_55))))))
+ { /* block id: 17 */
+ uint8_t l_75 = 3UL;
+ int32_t l_81[8][5] = {{(-7L),0xABB25A59L,0xDA4CDC86L,(-10L),(-10L)},{(-10L),0x9E1B0F05L,(-10L),(-8L),0x4CABBE7FL},{0xDA4CDC86L,0xABB25A59L,(-7L),0L,0x4CABBE7FL},{0xA845DB39L,4L,4L,0xA845DB39L,(-10L)},{0x58DE384CL,0xA845DB39L,(-7L),0x4CABBE7FL,0xABB25A59L},{0x58DE384CL,(-7L),(-10L),(-7L),0x58DE384CL},{0xA845DB39L,0L,0xDA4CDC86L,0x4CABBE7FL,4L},{0xDA4CDC86L,0L,0xA845DB39L,0xA845DB39L,0L}};
+ int32_t l_94 = (-1L);
+ int i, j;
+ for (l_66 = 0; (l_66 >= 10); ++l_66)
+ { /* block id: 20 */
+ int8_t l_74[9] = {0x4BL,0xC8L,0xC8L,0x4BL,0xC8L,0xC8L,0x4BL,0xC8L,0xC8L};
+ int32_t l_83 = 1L;
+ int32_t *l_84 = &l_81[1][3];
+ int32_t *l_85 = (void*)0;
+ int32_t *l_86 = &l_60;
+ int32_t *l_87 = (void*)0;
+ int32_t *l_88 = &g_52;
+ int32_t *l_89 = (void*)0;
+ int32_t *l_91[10] = {&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3],&l_81[0][3]};
+ int i;
+ (*l_53) = (((safe_add_func_uint8_t_u_u(l_74[0], ((&g_49[3] == &p_47) , l_75))) == (l_76 , g_5)) , ((((255UL | g_25.f0) , (safe_add_func_int16_t_s_s(((safe_mul_func_int8_t_s_s(0x15L, g_5)) ^ 4294967294UL), (*l_58)))) , l_74[7]) && 0x05855809L));
+ --g_96;
+ }
+ }
+ else
+ { /* block id: 24 */
+ uint16_t *l_102 = &g_103;
+ struct S2 *l_111 = (void*)0;
+ struct S2 *l_112 = &g_110;
+ (*l_58) ^= (g_99 , (safe_lshift_func_uint16_t_u_s((((*l_102)++) < ((safe_rshift_func_uint16_t_u_u(p_47.f1, p_47.f1)) < ((0UL & (g_108 , ((void*)0 != p_46))) >= (0L | (+((((*l_112) = ((g_109 , p_47.f0) , g_110)) , (-1L)) , g_108.f2)))))), 4)));
+ if (l_76.f0)
+ goto lbl_113;
+ }
+ for (g_99.f3 = (-30); (g_99.f3 != 13); g_99.f3++)
+ { /* block id: 32 */
+ int32_t **l_116 = &l_56;
+ struct S0 l_126 = {-10L,818,-153,1691,1L,3770,19024};
+ (*l_116) = &l_60;
+ (*l_64) |= 0xA61E07D3L;
+ for (l_76.f0 = 19; (l_76.f0 < 18); l_76.f0--)
+ { /* block id: 37 */
+ uint32_t l_129 = 0x97477C28L;
+ uint32_t l_143 = 18446744073709551615UL;
+ if ((((safe_lshift_func_uint8_t_u_s((+g_99.f2), (safe_rshift_func_int8_t_s_s((1L & (l_123 != &g_103)), (safe_mod_func_int16_t_s_s(1L, (l_126 , 65535UL))))))) < (65530UL | (safe_div_func_int32_t_s_s(5L, l_129)))) & (-2L)))
+ { /* block id: 38 */
+ struct S3 l_130 = {0UL,4294967295UL};
+ struct S3 *l_131 = &g_49[3];
+ struct S3 *l_132 = &l_130;
+ struct S2 *l_134 = &g_110;
+ struct S2 **l_133 = &l_134;
+ (*l_132) = ((*l_131) = l_130);
+ (*l_133) = &g_110;
+ (*l_53) = (safe_mul_func_int8_t_s_s(0xEFL, 252UL));
+ }
+ else
+ { /* block id: 43 */
+ uint32_t l_137 = 1UL;
+ int32_t l_138[2];
+ struct S0 l_149 = {0x4E9E4B14L,423,871,982,0x3CL,988,6284};
+ int i;
+ for (i = 0; i < 2; i++)
+ l_138[i] = (-5L);
+ (*l_62) ^= 7L;
+ l_138[0] = (0xB4L < l_137);
+ if (l_129)
+ { /* block id: 46 */
+ struct S3 *l_140 = &l_76;
+ struct S3 **l_139 = &l_140;
+ (*l_139) = &g_49[3];
+ for (g_108.f4 = 0; (g_108.f4 == (-18)); g_108.f4 = safe_sub_func_int32_t_s_s(g_108.f4, 2))
+ { /* block id: 50 */
+ return &g_52;
+ }
+ l_143 &= g_103;
+ }
+ else
+ { /* block id: 54 */
+ uint8_t *l_148 = &l_66;
+ uint8_t *l_153 = &g_99.f2;
+ if ((((safe_add_func_uint8_t_u_u((((*l_148) &= (safe_sub_func_int8_t_s_s(p_47.f1, (0xF9L < (-9L))))) == g_99.f1), (l_149 , ((*l_153) = (safe_mod_func_uint32_t_u_u((l_152[0] , p_47.f1), g_108.f6)))))) && (((l_154 , p_47.f1) , (-1L)) < g_25.f1)) | g_108.f6))
+ { /* block id: 57 */
+ return &g_52;
+ }
+ else
+ { /* block id: 59 */
+ uint32_t *l_166 = &g_49[3].f0;
+ (*l_57) ^= g_108.f6;
+ (*l_51) ^= (((*l_166) = (safe_add_func_int16_t_s_s(g_108.f1, ((*l_123) = (p_47.f0 < (safe_div_func_int8_t_s_s(0xA3L, (safe_rshift_func_uint16_t_u_s((safe_rshift_func_uint16_t_u_u(65535UL, 5)), (safe_sub_func_uint32_t_u_u(l_143, ((((p_47.f0 ^ ((&g_96 != (void*)0) == (+(+((g_165 = &g_103) == &g_103))))) | l_129) , 0x08092664L) ^ g_109.f0)))))))))))) || l_149.f1);
+ }
+ }
+ }
+ }
+ }
+ return p_46;
+}
+
+
+
+
+/* ---------------------------------------- */
+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_5, "g_5", print_hash_value);
+ transparent_crc(g_25.f0, "g_25.f0", print_hash_value);
+ transparent_crc(g_25.f1, "g_25.f1", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ transparent_crc(g_49[i].f0, "g_49[i].f0", print_hash_value);
+ transparent_crc(g_49[i].f1, "g_49[i].f1", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_52, "g_52", print_hash_value);
+ transparent_crc(g_82, "g_82", print_hash_value);
+ transparent_crc(g_90, "g_90", print_hash_value);
+ transparent_crc(g_92, "g_92", print_hash_value);
+ transparent_crc(g_96, "g_96", print_hash_value);
+ transparent_crc(g_99.f0, "g_99.f0", print_hash_value);
+ transparent_crc(g_99.f1, "g_99.f1", print_hash_value);
+ transparent_crc(g_99.f2, "g_99.f2", print_hash_value);
+ transparent_crc(g_99.f3, "g_99.f3", print_hash_value);
+ transparent_crc(g_103, "g_103", print_hash_value);
+ transparent_crc(g_108.f0, "g_108.f0", print_hash_value);
+ transparent_crc(g_108.f1, "g_108.f1", print_hash_value);
+ transparent_crc(g_108.f2, "g_108.f2", print_hash_value);
+ transparent_crc(g_108.f3, "g_108.f3", print_hash_value);
+ transparent_crc(g_108.f4, "g_108.f4", print_hash_value);
+ transparent_crc(g_108.f5, "g_108.f5", print_hash_value);
+ transparent_crc(g_108.f6, "g_108.f6", print_hash_value);
+ transparent_crc(g_109.f0, "g_109.f0", print_hash_value);
+ transparent_crc(g_110.f0, "g_110.f0", print_hash_value);
+ transparent_crc(g_183.f0, "g_183.f0", print_hash_value);
+ transparent_crc(g_218.f0, "g_218.f0", print_hash_value);
+ transparent_crc(g_258, "g_258", print_hash_value);
+ transparent_crc(g_332, "g_332", print_hash_value);
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ transparent_crc(g_345[i][j].f0, "g_345[i][j].f0", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ for (i = 0; i < 6; i++)
+ {
+ transparent_crc(g_393[i], "g_393[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_395, "g_395", print_hash_value);
+ transparent_crc(g_398, "g_398", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ for (k = 0; k < 7; k++)
+ {
+ transparent_crc(g_404[i][j][k].f0, "g_404[i][j][k].f0", print_hash_value);
+ transparent_crc(g_404[i][j][k].f1, "g_404[i][j][k].f1", print_hash_value);
+ transparent_crc(g_404[i][j][k].f2, "g_404[i][j][k].f2", print_hash_value);
+ transparent_crc(g_404[i][j][k].f3, "g_404[i][j][k].f3", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_452, "g_452", print_hash_value);
+ transparent_crc(g_454, "g_454", print_hash_value);
+ for (i = 0; i < 1; i++)
+ {
+ transparent_crc(g_455[i], "g_455[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_465, "g_465", print_hash_value);
+ transparent_crc(g_466, "g_466", print_hash_value);
+ transparent_crc(g_467, "g_467", print_hash_value);
+ transparent_crc(g_518, "g_518", print_hash_value);
+ transparent_crc(g_525.f0, "g_525.f0", print_hash_value);
+ transparent_crc(g_525.f1, "g_525.f1", print_hash_value);
+ transparent_crc(g_525.f2, "g_525.f2", print_hash_value);
+ transparent_crc(g_525.f3, "g_525.f3", print_hash_value);
+ transparent_crc(g_531, "g_531", print_hash_value);
+ transparent_crc(g_532, "g_532", print_hash_value);
+ transparent_crc(g_534, "g_534", print_hash_value);
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ transparent_crc(g_535[i][j][k], "g_535[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_538, "g_538", print_hash_value);
+ transparent_crc(g_557, "g_557", print_hash_value);
+ transparent_crc(g_575, "g_575", print_hash_value);
+ for (i = 0; i < 10; i++)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ transparent_crc(g_591[i][j].f0, "g_591[i][j].f0", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_623.f0, "g_623.f0", print_hash_value);
+ transparent_crc(g_623.f1, "g_623.f1", print_hash_value);
+ transparent_crc(g_623.f2, "g_623.f2", print_hash_value);
+ transparent_crc(g_623.f3, "g_623.f3", print_hash_value);
+ transparent_crc(g_623.f4, "g_623.f4", print_hash_value);
+ transparent_crc(g_623.f5, "g_623.f5", print_hash_value);
+ transparent_crc(g_623.f6, "g_623.f6", print_hash_value);
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 3; j++)
+ {
+ transparent_crc(g_815[i][j], "g_815[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_901.f0, "g_901.f0", print_hash_value);
+ transparent_crc(g_1054, "g_1054", print_hash_value);
+ transparent_crc(g_1055, "g_1055", print_hash_value);
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 5; j++)
+ {
+ transparent_crc(g_1057[i][j], "g_1057[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
+ return 0;
+}
+
+/************************ statistics *************************
+XXX max struct depth: 1
+breakdown:
+ depth: 0, occurrence: 269
+ depth: 1, occurrence: 55
+XXX total union variables: 9
+
+XXX non-zero bitfields defined in structs: 8
+XXX zero bitfields defined in structs: 2
+XXX const bitfields defined in structs: 0
+XXX volatile bitfields defined in structs: 0
+XXX structs with bitfields in the program: 52
+breakdown:
+ indirect level: 0, occurrence: 35
+ indirect level: 1, occurrence: 7
+ indirect level: 2, occurrence: 10
+XXX full-bitfields structs in the program: 17
+breakdown:
+ indirect level: 0, occurrence: 17
+XXX times a bitfields struct's address is taken: 36
+XXX times a bitfields struct on LHS: 8
+XXX times a bitfields struct on RHS: 43
+XXX times a single bitfield on LHS: 10
+XXX times a single bitfield on RHS: 51
+
+XXX max expression depth: 47
+breakdown:
+ depth: 1, occurrence: 181
+ depth: 2, occurrence: 42
+ depth: 3, occurrence: 4
+ depth: 4, occurrence: 1
+ depth: 5, occurrence: 1
+ depth: 6, occurrence: 1
+ depth: 8, occurrence: 1
+ depth: 9, occurrence: 2
+ depth: 11, occurrence: 2
+ depth: 13, occurrence: 1
+ depth: 14, occurrence: 2
+ depth: 15, occurrence: 3
+ depth: 16, occurrence: 3
+ depth: 17, occurrence: 3
+ depth: 18, occurrence: 1
+ depth: 19, occurrence: 1
+ depth: 20, occurrence: 1
+ depth: 21, occurrence: 3
+ depth: 22, occurrence: 3
+ depth: 23, occurrence: 1
+ depth: 24, occurrence: 3
+ depth: 26, occurrence: 1
+ depth: 28, occurrence: 2
+ depth: 33, occurrence: 1
+ depth: 35, occurrence: 1
+ depth: 47, occurrence: 1
+
+XXX total number of pointers: 302
+
+XXX times a variable address is taken: 479
+XXX times a pointer is dereferenced on RHS: 115
+breakdown:
+ depth: 1, occurrence: 111
+ depth: 2, occurrence: 4
+XXX times a pointer is dereferenced on LHS: 145
+breakdown:
+ depth: 1, occurrence: 142
+ depth: 2, occurrence: 3
+XXX times a pointer is compared with null: 16
+XXX times a pointer is compared with address of another variable: 8
+XXX times a pointer is compared with another pointer: 7
+XXX times a pointer is qualified to be dereferenced: 2276
+
+XXX max dereference level: 3
+breakdown:
+ level: 0, occurrence: 0
+ level: 1, occurrence: 957
+ level: 2, occurrence: 39
+ level: 3, occurrence: 11
+XXX number of pointers point to pointers: 74
+XXX number of pointers point to scalars: 173
+XXX number of pointers point to structs: 46
+XXX percent of pointers has null in alias set: 32.1
+XXX average alias set size: 1.41
+
+XXX times a non-volatile is read: 962
+XXX times a non-volatile is write: 470
+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: 5
+
+XXX stmts: 174
+XXX max block depth: 5
+breakdown:
+ depth: 0, occurrence: 36
+ depth: 1, occurrence: 30
+ depth: 2, occurrence: 27
+ depth: 3, occurrence: 39
+ depth: 4, occurrence: 20
+ depth: 5, occurrence: 22
+
+XXX percentage a fresh-made variable is used: 22
+XXX percentage an existing variable is used: 78
+FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
+********************* end of statistics **********************/
+
diff --git a/tests/fuzz/6.c.txt b/tests/fuzz/6.c.txt
new file mode 100644
index 00000000..00e8a313
--- /dev/null
+++ b/tests/fuzz/6.c.txt
@@ -0,0 +1 @@
+checksum = F4711189
diff --git a/tests/fuzz/9.c b/tests/fuzz/9.c
new file mode 100644
index 00000000..3e69535e
--- /dev/null
+++ b/tests/fuzz/9.c
@@ -0,0 +1,1296 @@
+/*
+ * This is a RANDOMLY GENERATED PROGRAM.
+ *
+ * Generator: csmith 2.2.0
+ * Git version: bf42ffd
+ * Options: --no-volatiles --no-packed-struct --no-math64
+ * Seed: 3993158628
+ */
+
+#include "csmith.h"
+
+
+static long __undefined;
+
+/* --- Struct/Union Declarations --- */
+struct S0 {
+ signed f0 : 2;
+ signed f1 : 30;
+ const unsigned f2 : 2;
+ signed f3 : 15;
+ unsigned f4 : 13;
+ unsigned f5 : 2;
+ signed f6 : 6;
+ signed f7 : 19;
+ signed f8 : 5;
+};
+
+union U1 {
+ const int8_t f0;
+};
+
+/* --- GLOBAL VARIABLES --- */
+static int32_t g_2 = 0xDBC37078L;
+static uint32_t g_24 = 1UL;
+static int16_t g_36 = 1L;
+static int32_t g_52 = 0L;
+static int32_t g_53 = 0xB92BB776L;
+static int32_t g_55 = 0xD870105CL;
+static uint16_t g_72 = 0xB820L;
+static int32_t *g_86 = &g_52;
+static struct S0 g_109 = {1,-3768,1,145,49,0,-1,-585,0};
+static uint8_t g_113 = 0xB8L;
+static uint8_t g_114 = 0xE1L;
+static int16_t g_126[4][6] = {{0x5BB1L,0x13A7L,0x5786L,0x89D4L,0x5786L,0x13A7L},{0xD5BCL,0x5BB1L,0x5786L,2L,0x8967L,0x89D4L},{0x4E36L,2L,0x13A7L,0x13A7L,2L,0x4E36L},{0x13A7L,2L,0x4E36L,0xF1A0L,0x8967L,0x5786L}};
+static uint32_t g_141[2] = {1UL,1UL};
+static int8_t g_143 = 1L;
+static uint8_t g_144 = 0x18L;
+static uint16_t *g_194[1] = {&g_72};
+static int32_t g_215 = 3L;
+static int32_t *g_214 = &g_215;
+static int16_t g_217 = 0x0B9EL;
+static int16_t *g_216 = &g_217;
+static uint32_t g_234[6][6][7] = {{{4294967295UL,1UL,0xE50A6E4DL,0x7CBB9599L,0x4038AB73L,1UL,0x30275B19L},{0xEF103696L,4294967288UL,0xF9FCF56DL,4294967288UL,0xEF103696L,0UL,4UL},{0x4038AB73L,0x7CBB9599L,0xE50A6E4DL,1UL,4294967295UL,7UL,0xE50A6E4DL},{0UL,0xEF4BBCF4L,0UL,9UL,0UL,0xF9FCF56DL,0xF9FCF56DL},{0x30275B19L,0UL,0x7A5E963CL,0UL,0x30275B19L,0UL,0xE50A6E4DL},{0UL,9UL,0UL,0xEF4BBCF4L,0UL,0xF9FCF56DL,0xF01C7FA8L}},{{0xEEABF480L,0UL,0xB0A03C78L,0x3D45A5B2L,0x30275B19L,7UL,0xD95DDA20L},{0UL,0xEF4BBCF4L,1UL,0xEF4BBCF4L,0UL,0x9CA25930L,0xF01C7FA8L},{0x30275B19L,0x3D45A5B2L,0xB0A03C78L,0UL,0xEEABF480L,7UL,0xE50A6E4DL},{0UL,0xEF4BBCF4L,0UL,9UL,0UL,0xF9FCF56DL,0xF9FCF56DL},{0x30275B19L,0UL,0x7A5E963CL,0UL,0x30275B19L,0UL,0xE50A6E4DL},{0UL,9UL,0UL,0xEF4BBCF4L,0UL,0xF9FCF56DL,0xF01C7FA8L}},{{0xEEABF480L,0UL,0xB0A03C78L,0x3D45A5B2L,0x30275B19L,7UL,0xD95DDA20L},{0UL,0xEF4BBCF4L,1UL,0xEF4BBCF4L,0UL,0x9CA25930L,0xF01C7FA8L},{0x30275B19L,0x3D45A5B2L,0xB0A03C78L,0UL,0xEEABF480L,7UL,0xE50A6E4DL},{0UL,0xEF4BBCF4L,0UL,9UL,0UL,0xF9FCF56DL,0xF9FCF56DL},{0x30275B19L,0UL,0x7A5E963CL,0UL,0x30275B19L,0UL,0xE50A6E4DL},{0UL,9UL,0UL,0xEF4BBCF4L,0UL,0xF9FCF56DL,0xF01C7FA8L}},{{0xEEABF480L,0UL,0xB0A03C78L,0x3D45A5B2L,0x30275B19L,7UL,0xD95DDA20L},{0UL,0xEF4BBCF4L,1UL,0xEF4BBCF4L,0UL,0x9CA25930L,0xF01C7FA8L},{0x30275B19L,0x3D45A5B2L,0xB0A03C78L,0UL,0xEEABF480L,7UL,0xE50A6E4DL},{0UL,0xEF4BBCF4L,0UL,9UL,0UL,0xF9FCF56DL,0xF9FCF56DL},{0x30275B19L,0UL,0x7A5E963CL,0UL,0x30275B19L,0UL,0xE50A6E4DL},{0UL,9UL,0UL,0xEF4BBCF4L,0UL,0xF9FCF56DL,0xF01C7FA8L}},{{0xEEABF480L,0UL,0xB0A03C78L,0x3D45A5B2L,0x30275B19L,7UL,0xD95DDA20L},{0UL,0xEF4BBCF4L,1UL,0xEF4BBCF4L,0UL,0x9CA25930L,0xF01C7FA8L},{0x30275B19L,0x3D45A5B2L,0xB0A03C78L,0UL,0xEEABF480L,7UL,0xE50A6E4DL},{0UL,0xEF4BBCF4L,0UL,9UL,0UL,0xF9FCF56DL,0xF9FCF56DL},{0x30275B19L,0UL,0x7A5E963CL,0UL,0x30275B19L,0UL,0xE50A6E4DL},{0UL,9UL,0UL,0xEF4BBCF4L,0UL,0xF9FCF56DL,0xF01C7FA8L}},{{0x28C0AEB2L,0UL,0xFD89EE91L,0x495489C1L,0xD95DDA20L,0x177A3353L,0x7A5E963CL},{0xF9FCF56DL,4294967294UL,0x3E2A85B4L,4294967294UL,0xF9FCF56DL,4UL,0UL},{0xD95DDA20L,0x495489C1L,0xFD89EE91L,0UL,0x28C0AEB2L,0x177A3353L,0xB0A03C78L},{0x9CA25930L,4294967294UL,1UL,0xEF103696L,0xF9FCF56DL,1UL,1UL},{0xD95DDA20L,0UL,1UL,0UL,0xD95DDA20L,4294967295UL,0xB0A03C78L},{0xF9FCF56DL,0xEF103696L,1UL,4294967294UL,0x9CA25930L,1UL,0UL}}};
+static uint32_t *g_252[2][6] = {{&g_141[1],(void*)0,&g_141[1],(void*)0,&g_141[1],(void*)0},{&g_141[1],(void*)0,&g_141[1],(void*)0,&g_141[1],(void*)0}};
+static uint32_t g_312[2] = {0x15E444CFL,0x15E444CFL};
+static const union U1 g_331 = {-8L};
+static struct S0 g_350[9][8] = {{{-1,20557,0,-138,48,0,7,-279,4},{-0,-27047,1,59,12,0,3,510,2},{0,24814,0,172,41,1,5,583,-3},{1,12364,1,154,28,0,-0,-107,1},{0,24814,0,172,41,1,5,583,-3},{-0,-27047,1,59,12,0,3,510,2},{-1,20557,0,-138,48,0,7,-279,4},{-0,19189,1,60,64,1,1,97,2}},{{1,-6931,1,81,81,1,-2,483,0},{-1,-26584,0,-110,24,0,0,-318,3},{1,-10097,1,114,10,1,-4,152,3},{1,12364,1,154,28,0,-0,-107,1},{-1,20557,0,-138,48,0,7,-279,4},{-0,-28474,1,81,7,1,-7,16,2},{-1,32727,1,-65,83,1,4,-198,-0},{1,-10897,1,12,62,1,3,-592,2}},{{0,4827,1,-65,66,1,-3,-196,-3},{1,12364,1,154,28,0,-0,-107,1},{1,23006,1,51,25,1,-4,439,-4},{1,17086,1,-44,2,0,0,411,-4},{-1,20557,0,-138,48,0,7,-279,4},{1,17086,1,-44,2,0,0,411,-4},{1,23006,1,51,25,1,-4,439,-4},{1,12364,1,154,28,0,-0,-107,1}},{{1,-6931,1,81,81,1,-2,483,0},{-0,-27047,1,59,12,0,3,510,2},{0,4827,1,-65,66,1,-3,-196,-3},{1,-10897,1,12,62,1,3,-592,2},{0,24814,0,172,41,1,5,583,-3},{1,17086,1,-44,2,0,0,411,-4},{1,-6931,1,81,81,1,-2,483,0},{-0,19189,1,60,64,1,1,97,2}},{{-1,20557,0,-138,48,0,7,-279,4},{1,12364,1,154,28,0,-0,-107,1},{1,-10097,1,114,10,1,-4,152,3},{-1,-26584,0,-110,24,0,0,-318,3},{1,-6931,1,81,81,1,-2,483,0},{-0,-28474,1,81,7,1,-7,16,2},{1,-6931,1,81,81,1,-2,483,0},{-1,-26584,0,-110,24,0,0,-318,3}},{{0,4827,1,-65,66,1,-3,-196,-3},{-1,-26584,0,-110,24,0,0,-318,3},{0,4827,1,-65,66,1,-3,-196,-3},{1,17086,1,-44,2,0,0,411,-4},{-1,32727,1,-65,83,1,4,-198,-0},{-0,-27047,1,59,12,0,3,510,2},{1,23006,1,51,25,1,-4,439,-4},{-1,-26584,0,-110,24,0,0,-318,3}},{{-1,32727,1,-65,83,1,4,-198,-0},{-0,-27047,1,59,12,0,3,510,2},{1,23006,1,51,25,1,-4,439,-4},{-1,-26584,0,-110,24,0,0,-318,3},{0,24814,0,172,41,1,5,583,-3},{-0,19189,1,60,64,1,1,97,2},{-1,32727,1,-65,83,1,4,-198,-0},{-0,19189,1,60,64,1,1,97,2}},{{-1,32727,1,-65,83,1,4,-198,-0},{1,-10897,1,12,62,1,3,-592,2},{1,-10097,1,114,10,1,-4,152,3},{1,-10897,1,12,62,1,3,-592,2},{-1,32727,1,-65,83,1,4,-198,-0},{-0,-28474,1,81,7,1,-7,16,2},{-1,20557,0,-138,48,0,7,-279,4},{1,12364,1,154,28,0,-0,-107,1}},{{0,4827,1,-65,66,1,-3,-196,-3},{1,-10897,1,12,62,1,3,-592,2},{0,24814,0,172,41,1,5,583,-3},{1,17086,1,-44,2,0,0,411,-4},{1,-6931,1,81,81,1,-2,483,0},{-0,19189,1,60,64,1,1,97,2},{1,23006,1,51,25,1,-4,439,-4},{1,-10897,1,12,62,1,3,-592,2}}};
+static uint16_t *g_351 = (void*)0;
+static int16_t g_408 = 0x7620L;
+static union U1 g_477 = {1L};
+static int8_t *g_487 = &g_143;
+static int8_t **g_486 = &g_487;
+static const int32_t g_493 = 1L;
+static int8_t g_543 = (-9L);
+static uint8_t *g_555 = &g_144;
+static uint8_t **g_554 = &g_555;
+static uint16_t g_626 = 65526UL;
+static const uint32_t g_664 = 1UL;
+static const uint32_t g_666[1][9][4] = {{{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL},{4294967295UL,4294967293UL,4294967295UL,4294967293UL}}};
+static uint8_t g_733 = 0UL;
+static uint32_t g_776 = 4294967291UL;
+static int32_t ** const g_786 = &g_214;
+static int32_t ** const *g_785 = &g_786;
+static int32_t ** const **g_784[2] = {&g_785,&g_785};
+static uint16_t g_807 = 65535UL;
+static int32_t *g_808 = (void*)0;
+static int32_t g_812 = 0xAE392FB2L;
+static union U1 g_824 = {0xC0L};
+static int32_t g_825 = (-1L);
+static int16_t g_891 = (-1L);
+static uint32_t *g_967[10][9] = {{&g_234[2][0][1],&g_234[2][0][1],&g_141[0],&g_141[1],&g_141[0],&g_141[0],&g_141[1],&g_141[0],&g_234[2][0][1]},{&g_141[0],&g_234[4][3][3],&g_141[1],&g_234[3][1][4],&g_24,&g_141[0],&g_141[1],&g_234[2][0][1],&g_141[0]},{&g_24,&g_234[2][0][1],&g_234[2][0][1],&g_234[2][0][1],(void*)0,&g_234[2][0][1],&g_141[0],(void*)0,&g_234[4][3][3]},{&g_776,&g_234[3][1][4],&g_141[0],&g_141[1],&g_24,&g_234[2][0][1],&g_234[2][0][1],&g_234[2][0][1],(void*)0},{&g_234[3][1][4],&g_234[2][0][1],&g_24,&g_234[3][1][1],&g_234[3][1][1],&g_24,&g_234[2][0][1],&g_234[3][1][4],&g_141[0]},{&g_776,&g_24,&g_234[2][0][1],&g_24,&g_234[3][1][1],&g_141[0],&g_141[1],&g_141[1],&g_141[1]},{&g_234[4][3][3],&g_141[0],&g_24,&g_234[3][1][4],&g_24,&g_141[0],&g_234[4][3][3],&g_141[0],&g_141[0]},{&g_141[0],&g_234[2][0][1],&g_234[4][3][3],&g_234[3][1][4],&g_141[1],&g_234[3][1][1],(void*)0,&g_24,(void*)0},{(void*)0,&g_776,&g_24,&g_24,&g_776,(void*)0,&g_141[0],&g_141[0],&g_234[4][3][3]},{&g_24,&g_234[2][0][1],&g_24,&g_234[3][1][1],&g_141[0],&g_141[1],&g_141[1],&g_141[1],&g_141[1]}};
+static int32_t * const *g_1021 = &g_214;
+static int32_t * const **g_1020 = &g_1021;
+static union U1 **g_1028 = (void*)0;
+static int8_t g_1058 = 0x12L;
+static int32_t ***g_1078 = (void*)0;
+static int8_t ** const g_1095 = (void*)0;
+static int8_t ** const *g_1094 = &g_1095;
+static const union U1 g_1177 = {-3L};
+static const int8_t *g_1218 = &g_1177.f0;
+static const int8_t **g_1217 = &g_1218;
+
+
+/* --- FORWARD DECLARATIONS --- */
+static int16_t func_1(void);
+static int32_t func_11(int32_t * p_12, uint32_t p_13, const int32_t p_14, int32_t p_15, int32_t * p_16);
+static uint32_t func_20(uint32_t p_21);
+static const uint8_t func_31(uint8_t p_32);
+static int32_t * func_40(uint32_t p_41, int32_t * p_42, int16_t * p_43, int32_t p_44, uint32_t * p_45);
+static union U1 func_46(int8_t p_47);
+static int32_t func_48(int32_t * p_49);
+static uint16_t func_97(uint32_t p_98);
+static int32_t * func_99(uint32_t * const p_100, uint8_t p_101, uint8_t p_102, const int8_t p_103);
+static uint8_t func_104(const struct S0 p_105, int16_t p_106, int32_t p_107);
+
+
+/* --- FUNCTIONS --- */
+/* ------------------------------------------ */
+/*
+ * reads : g_2 g_24 g_36 g_53 g_86 g_52 g_109 g_114 g_72 g_144 g_55 g_126 g_141 g_214 g_216 g_215 g_217 g_234 g_312 g_331 g_350 g_351 g_143 g_408 g_486 g_493 g_487 g_543 g_113 g_554 g_555 g_477 g_626 g_784 g_666 g_824 g_825 g_785 g_786 g_891 g_733 g_967 g_1020 g_1028 g_807 g_1058 g_1078 g_1021
+ * writes: g_2 g_24 g_36 g_52 g_53 g_55 g_86 g_113 g_126 g_109.f3 g_114 g_141 g_143 g_144 g_72 g_194 g_215 g_252 g_217 g_312 g_234 g_486 g_350.f8 g_214 g_351 g_626 g_776 g_808 g_408 g_733 g_1020 g_807 g_825 g_1078 g_1094 g_1058 g_967 g_543
+ */
+static int16_t func_1(void)
+{ /* block id: 0 */
+ int32_t l_8 = (-1L);
+ int32_t *l_19 = (void*)0;
+ uint32_t l_39 = 18446744073709551615UL;
+ if (g_2)
+ { /* block id: 1 */
+ uint8_t l_3 = 0UL;
+ int32_t l_22 = 0xB0420410L;
+ uint32_t *l_23 = &g_24;
+ int16_t *l_35 = &g_36;
+ int32_t *l_1232 = &g_52;
+ l_3--;
+ for (l_3 = 2; (l_3 <= 56); l_3 = safe_add_func_int8_t_s_s(l_3, 1))
+ { /* block id: 5 */
+ int16_t l_9[2][5][10] = {{{0x4E76L,0xFA83L,0x1F6FL,0xCA36L,0xCA36L,0x1F6FL,0xFA83L,0x4E76L,(-1L),0xC1D1L},{0x2278L,0xF72BL,0L,0xDB82L,8L,0x1F6FL,0xEE5AL,0x2278L,0xDB82L,0xCA36L},{0x4E76L,0x80DBL,0L,8L,0x391CL,0x2278L,2L,0x4E76L,1L,0xCA36L},{0L,0xD2B5L,0x1F6FL,0xC1D1L,8L,0L,2L,0L,8L,0xC1D1L},{0x9F7CL,0x80DBL,0x9F7CL,0xC1D1L,0xCA36L,0L,0xEE5AL,0x9F7CL,1L,(-1L)}},{{0x9F7CL,0xF72BL,0x4E76L,8L,1L,0L,0xFA83L,0x9F7CL,0xDB82L,1L},{0L,0xFA83L,0x9F7CL,0xDB82L,1L,0x2278L,0x80DBL,0L,(-1L),(-1L)},{0x4E76L,0xFA83L,0x1F6FL,0xCA36L,0xCA36L,0x1F6FL,0xFA83L,0x4E76L,(-1L),0xC1D1L},{0x2278L,0xF72BL,0L,0xDB82L,8L,0x1F6FL,0xEE5AL,0x2278L,0xDB82L,0xCA36L},{0x4E76L,0x80DBL,0L,8L,0x391CL,0x2278L,2L,0x4E76L,1L,0xCA36L}}};
+ int32_t *l_10 = &g_2;
+ int i, j, k;
+ (*l_10) |= (l_9[0][1][8] = l_8);
+ }
+ (*l_1232) = func_11(&l_8, (safe_rshift_func_uint16_t_u_s((((void*)0 == l_19) , (func_20((++(*l_23))) , (safe_rshift_func_uint8_t_u_s(func_31(((safe_rshift_func_uint16_t_u_s((0xFA3CL & g_2), (((!((*l_35) ^= g_24)) <= g_24) || (safe_sub_func_int32_t_s_s((l_22 <= l_39), 0xE948ECA1L))))) , 1UL)), g_109.f2)))), g_666[0][0][3])), l_22, l_22, &l_22);
+ }
+ else
+ { /* block id: 556 */
+ int16_t l_1233 = 0x9A09L;
+ int8_t *l_1240 = &g_1058;
+ const uint8_t l_1241 = 1UL;
+ union U1 l_1242 = {9L};
+ (*g_214) = ((g_477 , l_1233) ^ (((safe_add_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((((((!((safe_mul_func_int8_t_s_s(((*l_1240) = ((*g_487) = 4L)), ((-1L) & (-7L)))) & ((((l_1241 < (l_1241 | l_1241)) , (((l_1242 , l_1233) < l_1241) & l_39)) > l_1242.f0) | 6UL))) , l_1233) != (*g_86)) == 0x7FL) != (*g_555)), (*g_555))), (-1L))) , l_39) <= (**g_1021)));
+ (**g_786) &= 0x557529FFL;
+ }
+ return (*g_216);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_216 g_52 g_824 g_555 g_144 g_141 g_825 g_487 g_217 g_785 g_786 g_214 g_331 g_554 g_143 g_234 g_626 g_891 g_733 g_114 g_486 g_312 g_967 g_55 g_477 g_1020 g_1028 g_807 g_1058 g_408 g_1078 g_215 g_350.f6 g_72 g_113
+ * writes: g_72 g_52 g_114 g_217 g_808 g_126 g_143 g_214 g_408 g_234 g_144 g_626 g_733 g_351 g_141 g_252 g_113 g_1020 g_807 g_776 g_55 g_24 g_825 g_1078 g_1094 g_1058 g_215 g_2 g_967 g_543
+ */
+static int32_t func_11(int32_t * p_12, uint32_t p_13, const int32_t p_14, int32_t p_15, int32_t * p_16)
+{ /* block id: 328 */
+ int32_t *l_794 = &g_55;
+ uint32_t l_821 = 0UL;
+ const uint32_t *l_910 = (void*)0;
+ const int8_t *l_915 = &g_477.f0;
+ uint32_t **l_968 = &g_252[0][5];
+ int16_t l_969 = 0L;
+ struct S0 l_988[8] = {{-1,2956,0,-52,85,0,1,513,4},{-1,747,0,116,79,1,2,-456,1},{-1,2956,0,-52,85,0,1,513,4},{-1,747,0,116,79,1,2,-456,1},{-1,2956,0,-52,85,0,1,513,4},{-1,747,0,116,79,1,2,-456,1},{-1,2956,0,-52,85,0,1,513,4},{-1,747,0,116,79,1,2,-456,1}};
+ uint8_t **l_992[6] = {&g_555,&g_555,&g_555,&g_555,&g_555,&g_555};
+ uint32_t l_1018 = 1UL;
+ int32_t l_1033[10] = {(-5L),0x05CEC50EL,(-5L),0x05CEC50EL,(-5L),0x05CEC50EL,(-5L),0x05CEC50EL,(-5L),0x05CEC50EL};
+ int32_t l_1163[10];
+ int32_t l_1220 = 9L;
+ int32_t l_1229 = 0x0A906A68L;
+ uint32_t l_1230[8][4] = {{0x1199E2CDL,0xCCF4C89AL,5UL,0UL},{0x1199E2CDL,0xE2EEF004L,0UL,0UL},{0xCCF4C89AL,0xCCF4C89AL,0x4DCCF4F6L,0xE2EEF004L},{0xE2EEF004L,0x1199E2CDL,0x4DCCF4F6L,0x1199E2CDL},{0xCCF4C89AL,5UL,0UL,0x4DCCF4F6L},{0x1199E2CDL,5UL,5UL,0x1199E2CDL},{5UL,0x1199E2CDL,0xCCF4C89AL,0xE2EEF004L},{5UL,0xCCF4C89AL,5UL,0UL}};
+ uint16_t **l_1231[2];
+ int i, j;
+ for (i = 0; i < 10; i++)
+ l_1163[i] = 0x1BA9B6D4L;
+ for (i = 0; i < 2; i++)
+ l_1231[i] = &g_194[0];
+lbl_1113:
+ for (g_72 = (-30); (g_72 < 11); g_72 = safe_add_func_uint16_t_u_u(g_72, 8))
+ { /* block id: 331 */
+ int32_t *l_793 = &g_52;
+ int32_t *l_815 = &g_812;
+ uint32_t l_889 = 18446744073709551615UL;
+ uint16_t *l_928 = &g_626;
+ int32_t l_956 = 0x322A5631L;
+ uint32_t l_957 = 0x0E4C1742L;
+ for (g_52 = 0; (g_52 == (-15)); --g_52)
+ { /* block id: 334 */
+ int32_t l_792 = 0x51FDD8C4L;
+ (*p_12) &= l_792;
+ }
+ l_794 = l_793;
+ for (g_114 = 0; (g_114 == 36); ++g_114)
+ { /* block id: 340 */
+ uint16_t * const l_806 = &g_807;
+ uint16_t * const *l_805 = &l_806;
+ int32_t l_816 = 1L;
+ uint32_t **l_831 = &g_252[1][0];
+ for (g_52 = (-18); (g_52 == (-27)); g_52 = safe_sub_func_int16_t_s_s(g_52, 7))
+ { /* block id: 343 */
+ uint16_t **l_803 = &g_351;
+ uint16_t * const **l_804 = (void*)0;
+ int32_t **l_809 = (void*)0;
+ int32_t *l_811 = &g_812;
+ int32_t **l_810 = &l_811;
+ int32_t *l_814 = &g_812;
+ int32_t **l_813[9][9][3] = {{{&l_814,(void*)0,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0}},{{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{(void*)0,&l_814,&l_814},{(void*)0,&l_814,&l_814},{&l_814,&l_814,&l_814},{(void*)0,(void*)0,&l_814},{(void*)0,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814}},{{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0},{&l_814,(void*)0,&l_814},{&l_814,&l_814,&l_814},{&l_814,(void*)0,&l_814},{&l_814,&l_814,(void*)0},{(void*)0,&l_814,&l_814},{(void*)0,&l_814,&l_814}},{{&l_814,&l_814,&l_814},{(void*)0,&l_814,&l_814},{(void*)0,(void*)0,(void*)0},{&l_814,&l_814,&l_814},{&l_814,(void*)0,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0}},{{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,(void*)0,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0}},{{&l_814,&l_814,&l_814},{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{(void*)0,&l_814,&l_814},{(void*)0,&l_814,&l_814},{&l_814,&l_814,&l_814},{(void*)0,(void*)0,&l_814},{(void*)0,(void*)0,&l_814}},{{&l_814,&l_814,&l_814},{(void*)0,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{(void*)0,(void*)0,(void*)0},{&l_814,&l_814,(void*)0}},{{&l_814,(void*)0,&l_814},{&l_814,&l_814,(void*)0},{&l_814,(void*)0,(void*)0},{&l_814,&l_814,&l_814},{(void*)0,(void*)0,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,&l_814,&l_814}},{{&l_814,&l_814,&l_814},{(void*)0,&l_814,&l_814},{&l_814,&l_814,&l_814},{&l_814,(void*)0,(void*)0},{&l_814,&l_814,(void*)0},{&l_814,(void*)0,&l_814},{&l_814,&l_814,(void*)0},{&l_814,&l_814,(void*)0},{&l_814,&l_814,&l_814}}};
+ int16_t *l_822 = (void*)0;
+ int16_t *l_823[3][4] = {{(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0}};
+ int32_t l_826[6][10][1] = {{{7L},{0x94DFE73AL},{1L},{(-1L)},{2L},{0x0C09348AL},{2L},{(-1L)},{1L},{0x94DFE73AL}},{{7L},{0xCD063AC6L},{0x9A614DC4L},{0xCD063AC6L},{7L},{0x94DFE73AL},{1L},{(-1L)},{2L},{0x0C09348AL}},{{2L},{(-1L)},{1L},{0x94DFE73AL},{7L},{0xCD063AC6L},{0x9A614DC4L},{0xCD063AC6L},{7L},{0x94DFE73AL}},{{1L},{(-1L)},{2L},{0x0C09348AL},{2L},{(-1L)},{1L},{0x94DFE73AL},{7L},{0xCD063AC6L}},{{0x9A614DC4L},{0xCD063AC6L},{7L},{0x94DFE73AL},{1L},{(-1L)},{2L},{0x0C09348AL},{2L},{(-1L)}},{{1L},{0x94DFE73AL},{7L},{0xCD063AC6L},{0x9A614DC4L},{0xCD063AC6L},{7L},{0x94DFE73AL},{1L},{(-1L)}}};
+ int i, j, k;
+ (*p_16) &= (((*g_487) = (safe_sub_func_int8_t_s_s((p_15 , (((((safe_add_func_int16_t_s_s(((*g_216) = (l_803 != (l_805 = (void*)0))), ((((g_126[2][2] = ((((!(((l_815 = ((*l_810) = (g_808 = (void*)0))) != (void*)0) == (~1L))) != l_816) | (safe_add_func_int8_t_s_s(((safe_sub_func_int32_t_s_s((((p_15 == 1L) == (*l_793)) >= (*l_793)), l_821)) >= l_816), p_14))) | p_14)) , g_824) , (*g_555)) != (*l_793)))) , 0x04B39DE0L) ^ p_15) ^ g_141[1]) || g_825)), (*l_794)))) > l_826[1][1][0]);
+ }
+ (*l_793) = (safe_rshift_func_int16_t_s_u((*g_216), (safe_mod_func_uint8_t_u_u(((void*)0 != l_831), ((*l_794) & p_13)))));
+ if ((*p_16))
+ { /* block id: 354 */
+ int32_t **l_832 = (void*)0;
+ int32_t **l_833[1][10][2] = {{{&g_86,&g_86},{&l_794,&g_86},{&g_86,&l_794},{&l_793,&l_793},{&l_794,&l_793},{&l_793,&l_794},{&l_793,&l_793},{&l_794,&l_793},{&l_793,&l_794},{&g_86,&g_86}}};
+ int i, j, k;
+ (*g_786) = (**g_785);
+ p_12 = ((**g_785) = &p_15);
+ }
+ else
+ { /* block id: 358 */
+ uint32_t l_834 = 0x597229EDL;
+ ++l_834;
+ (**g_785) = l_793;
+ if ((*l_794))
+ continue;
+ }
+ }
+ for (g_143 = 20; (g_143 >= 19); g_143 = safe_sub_func_int8_t_s_s(g_143, 3))
+ { /* block id: 366 */
+ int8_t *l_858[7] = {&g_543,&g_543,&g_543,&g_543,&g_543,&g_543,&g_543};
+ const int32_t l_859 = 0x8F3A324DL;
+ int8_t l_860 = 3L;
+ union U1 *l_863 = (void*)0;
+ int32_t l_868 = 0x4157F9B0L;
+ int16_t *l_919[10];
+ uint32_t *l_962 = &g_141[1];
+ int i;
+ for (i = 0; i < 10; i++)
+ l_919[i] = &g_126[1][4];
+ (**g_785) = (void*)0;
+ if (((safe_div_func_int8_t_s_s((safe_mod_func_uint32_t_u_u((((((*g_216) <= (safe_mul_func_uint8_t_u_u(((g_331 , (**g_554)) , (safe_sub_func_int8_t_s_s((safe_unary_minus_func_int8_t_s(((safe_sub_func_uint32_t_u_u((safe_mod_func_uint32_t_u_u((+p_15), ((0L > (safe_sub_func_int8_t_s_s(((*l_793) = (safe_sub_func_uint8_t_u_u((safe_add_func_int16_t_s_s((g_408 = (*g_216)), (&g_808 != &g_808))), p_14))), p_14))) ^ (-1L)))), l_859)) == p_15))), (*g_487)))), p_15))) , 2L) == l_859) >= l_860), p_13)), 0x22L)) & (*g_216)))
+ { /* block id: 370 */
+ union U1 *l_862 = &g_477;
+ union U1 **l_861 = &l_862;
+ uint32_t *l_869 = &g_234[2][0][1];
+ int32_t l_876 = (-1L);
+ uint32_t *l_888[4][6] = {{&g_141[1],&g_141[1],(void*)0,&g_141[1],&g_141[1],(void*)0},{&g_141[1],&g_141[1],(void*)0,&g_141[1],&g_141[1],&g_141[1]},{&g_141[1],&g_141[1],&g_141[1],&g_141[1],&g_141[1],&g_141[1]},{&g_141[1],&g_141[1],&g_141[1],&g_141[1],&g_141[1],&g_141[1]}};
+ uint16_t *l_890 = &g_626;
+ uint32_t l_896 = 0x1B4D8A09L;
+ uint8_t *l_899 = &g_733;
+ uint8_t *l_904 = (void*)0;
+ uint8_t *l_905 = &g_114;
+ const uint32_t *l_909 = &g_666[0][5][1];
+ const uint32_t **l_908[2];
+ const int8_t **l_916 = &l_915;
+ const int8_t *l_918 = &g_477.f0;
+ const int8_t **l_917 = &l_918;
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_908[i] = &l_909;
+ (*l_794) = ((((l_863 = ((*l_861) = (void*)0)) == ((((safe_rshift_func_uint8_t_u_u((((*l_794) || (safe_unary_minus_func_uint8_t_u(((safe_unary_minus_func_int32_t_s((-1L))) <= 0xC8L)))) != (((*l_890) |= ((((++(*l_869)) >= ((safe_div_func_int32_t_s_s((safe_lshift_func_int8_t_s_u((l_876 || (((safe_add_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((**g_554) = (*g_555)), (*g_487))), ((safe_mul_func_uint8_t_u_u(((safe_unary_minus_func_uint32_t_u((safe_add_func_uint32_t_u_u((safe_mod_func_uint8_t_u_u(l_876, (((((l_889 = (0xEDF1L != 0xC34DL)) , (void*)0) != (void*)0) >= (*p_16)) , p_14))), p_15)))) , (*l_794)), 0xE3L)) < 0x71L))) ^ l_876) != (*l_793))), (*l_794))), (*p_12))) > 0x7A44L)) > (*g_216)) != 3UL)) , p_13)), 6)) > g_891) , 0x39L) , (void*)0)) , p_15) ^ 65534UL);
+ (*p_12) |= (((*l_861) != (((l_868 ^= ((safe_sub_func_uint8_t_u_u(((*g_555) = (l_896 == 0L)), (safe_mul_func_int16_t_s_s((0xC16CF829L != (((*l_899)--) < (safe_div_func_uint16_t_u_u((((((*l_869) = p_14) > (*p_16)) == ((((*g_487) > ((*l_905)--)) , &l_896) != (l_910 = p_16))) && (-1L)), (*g_216))))), (*g_216))))) , p_14)) && p_13) , &g_331)) || 0xAD58L);
+ if ((*l_793))
+ break;
+ (*p_16) &= ((p_13 >= (safe_mod_func_int32_t_s_s((0xCBE4L >= ((*g_555) , (*g_216))), 1UL))) >= (safe_sub_func_int32_t_s_s((*p_12), ((((((*l_917) = ((*l_916) = l_915)) != (void*)0) , l_919[1]) != l_890) == p_14))));
+ }
+ else
+ { /* block id: 389 */
+ uint16_t **l_929 = &g_351;
+ int32_t l_930 = 0x94F847F7L;
+ struct S0 l_954 = {0,-17641,1,-5,1,1,-0,-701,-1};
+ int32_t l_955[6][2] = {{2L,2L},{0xABC97F79L,2L},{2L,0xABC97F79L},{2L,2L},{0xABC97F79L,2L},{2L,0xABC97F79L}};
+ int i, j;
+ l_868 ^= ((safe_div_func_uint16_t_u_u((((*l_793) = (((-1L) || (safe_rshift_func_uint8_t_u_u((safe_sub_func_int16_t_s_s((safe_div_func_int16_t_s_s((((*l_929) = l_928) == ((((l_930 == ((safe_rshift_func_int16_t_s_s((safe_unary_minus_func_uint16_t_u((safe_mod_func_int8_t_s_s((((*g_216) = ((void*)0 == &g_626)) & ((!((((l_930 >= (safe_add_func_uint16_t_u_u(((safe_sub_func_uint32_t_u_u((safe_mul_func_int8_t_s_s((safe_sub_func_uint8_t_u_u((((*l_794) < ((safe_div_func_uint16_t_u_u(((safe_div_func_uint32_t_u_u((safe_lshift_func_int8_t_s_s((((l_957 |= ((*p_12) |= ((l_954.f6 = (l_956 |= (l_955[5][0] ^= (safe_add_func_int32_t_s_s((safe_mod_func_int32_t_s_s(((l_954 , 65527UL) < 0x3CB0L), l_954.f7)), 0x40492926L))))) | 0x30L))) >= 0x67C755EDL) < (*l_794)), 5)), (*p_16))) , p_13), 0xE718L)) , l_859)) && (*g_555)), 0x15L)), (**g_486))), 0xF838E5DEL)) && 0x0FL), 0xA8E8L))) != 0x32L) == 1UL) & p_14)) == p_14)), (*g_487))))), 6)) ^ (*g_487))) | p_13) < 1L) , &g_72)), 0x370CL)), (-1L))), l_954.f1))) <= l_859)) , p_14), g_312[1])) && 0x4B9B8319L);
+ if ((*p_12))
+ continue;
+ }
+ (*p_12) ^= ((**g_486) || (((safe_mod_func_int32_t_s_s((*p_16), (--(*l_962)))) == ((**g_554) ^ 0xB0L)) == p_14));
+ if ((*l_794))
+ continue;
+ }
+ }
+ if ((((safe_add_func_int16_t_s_s((((*l_968) = g_967[4][1]) == p_16), (0x5FL >= ((((+(l_969 && (+((**g_486) &= ((*l_794) & (safe_rshift_func_int8_t_s_s((p_13 < (safe_rshift_func_int16_t_s_s(0x58D4L, 9))), 2))))))) > ((-6L) && ((*l_794) , 0x3108L))) < (*l_794)) && 0x9B63F63FL)))) , g_477) , 0xF4F5C698L))
+ { /* block id: 408 */
+ int32_t l_993[7][4][7] = {{{(-1L),0x669ADB8DL,(-1L),0x768A8FF2L,(-9L),0x5618A3D9L,(-1L)},{(-1L),1L,1L,(-1L),0L,0x0CE0602CL,(-8L)},{0xBDF91091L,(-9L),0L,0L,(-9L),0xBDF91091L,(-1L)},{(-3L),0x65E176B1L,0xD0E18EF1L,(-1L),7L,0xD0E18EF1L,(-1L)}},{{(-9L),(-1L),0x63B56E82L,(-9L),0L,0xA0C6014DL,(-9L)},{0x0CE0602CL,0x65E176B1L,0x8B067229L,0L,(-8L),1L,1L},{5L,(-9L),0x5618A3D9L,(-9L),5L,(-1L),(-1L)},{0x3CB930F8L,1L,0L,7L,(-3L),1L,0x3CB930F8L}},{{0L,0x669ADB8DL,(-1L),0L,(-1L),0xDDF01AC2L,0x6F8CD22DL},{0x3CB930F8L,7L,(-1L),(-8L),0x32492198L,0xD0E18EF1L,0x32492198L},{5L,0x6F8CD22DL,0x6F8CD22DL,5L,0xDDF01AC2L,0L,0x768A8FF2L},{0x0CE0602CL,0x45BD0F4FL,0xBCF91C2CL,(-3L),0x45BD0F4FL,(-8L),1L}},{{(-9L),0xF839E9FAL,0x5618A3D9L,(-1L),0L,0x5618A3D9L,0x768A8FF2L},{(-3L),1L,0x0CE0602CL,0x32492198L,(-3L),(-3L),0x32492198L},{0xBDF91091L,5L,0xBDF91091L,0xDDF01AC2L,0xF839E9FAL,6L,0x6F8CD22DL},{(-1L),(-3L),0xD0E18EF1L,0x45BD0F4FL,0x65E176B1L,(-1L),0x3CB930F8L}},{{(-1L),0x6F8CD22DL,0xA0C6014DL,0L,0L,6L,(-1L)},{0x8B067229L,(-1L),1L,(-3L),0x3CB930F8L,(-3L),1L},{0L,0L,(-1L),0xF839E9FAL,(-1L),0x5618A3D9L,(-9L)},{0x65E176B1L,1L,1L,0x65E176B1L,0L,(-8L),(-1L)}},{{0xBDF91091L,(-1L),0xDDF01AC2L,0L,(-1L),0L,(-1L)},{0x45BD0F4FL,(-8L),0xD0E18EF1L,0x3CB930F8L,0x3CB930F8L,0xD0E18EF1L,(-8L)},{(-9L),(-1L),0L,(-1L),0L,0xDDF01AC2L,(-1L)},{0x0CE0602CL,(-1L),0L,1L,1L,0xD0E18EF1L,1L}},{{(-1L),0L,(-1L),0xDDF01AC2L,0x6F8CD22DL,0x669ADB8DL,0x63B56E82L},{(-8L),1L,0x9EE64B86L,0x8B067229L,0x9EE64B86L,1L,(-8L)},{0L,0xBDF91091L,(-1L),0L,0x63B56E82L,6L,0x2F367A28L},{0x0CE0602CL,0x8B067229L,0x3CB930F8L,1L,(-3L),7L,0L}}};
+ int8_t l_1011 = (-1L);
+ int32_t l_1019 = 0L;
+ int32_t ***l_1023 = (void*)0;
+ union U1 *l_1027 = &g_824;
+ union U1 ** const l_1026 = &l_1027;
+ int i, j, k;
+ for (g_113 = 0; (g_113 >= 15); g_113++)
+ { /* block id: 411 */
+ uint8_t **l_983 = &g_555;
+ int32_t l_987 = (-9L);
+ }
+ (*p_16) = (((safe_rshift_func_uint16_t_u_u(((safe_div_func_int32_t_s_s((*l_794), (((*g_555) = (safe_sub_func_int32_t_s_s(0x9FC66077L, 1UL))) , ((*p_12) = l_1011)))) == ((safe_mul_func_int16_t_s_s((*g_216), (((*l_794) ^ 4294967295UL) & ((**g_486) = (((0xFFF2L == ((l_993[0][1][0] = (safe_mul_func_uint8_t_u_u((safe_lshift_func_int8_t_s_s(l_993[0][1][0], 1)), l_1018))) && (-9L))) > 0UL) , p_14))))) <= p_14)), 13)) < (-8L)) , (*l_794));
+ for (l_1011 = 0; (l_1011 <= 1); l_1011 += 1)
+ { /* block id: 437 */
+ int32_t * const ***l_1022 = &g_1020;
+ int i;
+ if (l_1019)
+ break;
+ (*p_16) |= (((*l_794) , l_993[6][1][0]) && (1L || (((*g_555) = ((((*l_1022) = g_1020) == l_1023) ^ (safe_lshift_func_uint16_t_u_u(((((*l_794) , l_1026) != g_1028) ^ p_14), 0)))) < p_15)));
+ l_1033[5] = (safe_mod_func_int8_t_s_s((-6L), (++(*g_555))));
+ for (g_114 = 0; (g_114 <= 1); g_114 += 1)
+ { /* block id: 446 */
+ for (l_821 = 0; (l_821 <= 1); l_821 += 1)
+ { /* block id: 449 */
+ uint16_t *l_1036 = (void*)0;
+ uint16_t *l_1037 = &g_807;
+ int32_t l_1040[3][4];
+ int i, j;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 4; j++)
+ l_1040[i][j] = 0x5DAFB0C6L;
+ }
+ (*p_16) = ((safe_mul_func_int16_t_s_s(0xA4FBL, (*g_216))) , (((++(*l_1037)) | l_1040[0][1]) , (*p_12)));
+ if ((*p_16))
+ continue;
+ }
+ }
+ }
+ }
+ else
+ { /* block id: 456 */
+ int16_t l_1043 = 0x49EFL;
+ uint32_t *l_1048 = &g_776;
+ uint32_t *l_1057 = &g_24;
+ int32_t l_1059 = 0x6FF24338L;
+ int32_t l_1068 = 0x5AC0A6A1L;
+ int8_t l_1069[9];
+ int32_t l_1070[8][1][4] = {{{0x7F392DC0L,0x199421BFL,0xC16261B1L,1L}},{{0xC16261B1L,1L,0xC16261B1L,0x199421BFL}},{{0x7F392DC0L,1L,0xD4EC7BF7L,1L}},{{0x7F392DC0L,0x199421BFL,0xC16261B1L,1L}},{{0xC16261B1L,1L,0xC16261B1L,0x199421BFL}},{{0x7F392DC0L,1L,0xD4EC7BF7L,1L}},{{0x7F392DC0L,0x199421BFL,0xC16261B1L,1L}},{{0xC16261B1L,1L,0xC16261B1L,0x199421BFL}}};
+ uint32_t l_1071 = 1UL;
+ const union U1 *l_1176 = &g_1177;
+ union U1 *l_1179[8][7] = {{&g_824,&g_477,(void*)0,&g_477,&g_824,&g_477,(void*)0},{&g_477,&g_477,(void*)0,&g_824,(void*)0,(void*)0,&g_824},{(void*)0,&g_824,(void*)0,&g_477,(void*)0,&g_824,(void*)0},{&g_477,&g_824,&g_824,&g_477,(void*)0,(void*)0,(void*)0},{&g_824,&g_824,(void*)0,&g_824,&g_824,&g_824,(void*)0},{(void*)0,&g_477,&g_824,&g_824,&g_477,(void*)0,(void*)0},{(void*)0,&g_477,(void*)0,&g_824,(void*)0,&g_477,(void*)0},{(void*)0,&g_824,(void*)0,&g_477,&g_477,(void*)0,&g_824}};
+ uint16_t **l_1182 = &g_351;
+ uint16_t ***l_1181 = &l_1182;
+ struct S0 l_1185 = {-0,1627,0,19,60,1,5,363,-1};
+ int i, j, k;
+ for (i = 0; i < 9; i++)
+ l_1069[i] = (-8L);
+ l_1059 |= (((safe_lshift_func_int8_t_s_s((((p_15 ^ ((*g_487) = (l_1043 ^ ((*l_794) = ((p_13 | (*l_794)) || ((*l_1048) = (((*g_555)--) , ((safe_rshift_func_int16_t_s_s((*l_794), 4)) > (*l_794))))))))) ^ (safe_add_func_int32_t_s_s(((*p_16) = l_1033[5]), ((*l_1057) = (!(safe_mul_func_int16_t_s_s(((((safe_sub_func_int16_t_s_s(l_1043, (safe_add_func_int8_t_s_s(p_13, p_14)))) && p_15) > p_14) , (*g_216)), p_14))))))) == l_1043), g_1058)) >= l_1043) & (*g_216));
+ for (g_825 = 22; (g_825 > (-1)); g_825 = safe_sub_func_uint8_t_u_u(g_825, 7))
+ { /* block id: 466 */
+ int32_t *l_1062 = &g_2;
+ int32_t *l_1063 = &g_215;
+ int32_t l_1064 = 0x85D314CCL;
+ int32_t *l_1065 = &g_2;
+ int32_t *l_1066 = &l_1059;
+ int32_t *l_1067[1][1][1];
+ int32_t **l_1087 = &g_214;
+ int32_t *** const l_1086 = &l_1087;
+ uint32_t l_1170 = 0x1133297AL;
+ const union U1 *l_1175 = &g_331;
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 1; j++)
+ {
+ for (k = 0; k < 1; k++)
+ l_1067[i][j][k] = &g_2;
+ }
+ }
+ --l_1071;
+ for (g_408 = 1; (g_408 >= 0); g_408 -= 1)
+ { /* block id: 470 */
+ const int32_t l_1099 = 0x5235A3F0L;
+ int32_t l_1134 = 8L;
+ int16_t **l_1153 = &g_216;
+ int32_t l_1162[6];
+ int32_t l_1164 = 8L;
+ int i;
+ for (i = 0; i < 6; i++)
+ l_1162[i] = 0x6B185421L;
+ if ((safe_mod_func_uint32_t_u_u(1UL, g_141[g_408])))
+ { /* block id: 471 */
+ uint16_t l_1096 = 65535UL;
+ for (g_733 = 0; (g_733 <= 1); g_733 += 1)
+ { /* block id: 474 */
+ int32_t ****l_1079 = &g_1078;
+ int8_t ** const *l_1093 = &g_486;
+ int i, j;
+ (*l_1066) = (safe_sub_func_uint8_t_u_u((((*l_1079) = g_1078) != (((safe_mod_func_uint32_t_u_u(4294967292UL, (safe_lshift_func_uint16_t_u_s(p_14, (*l_794))))) > (safe_mod_func_int16_t_s_s((*g_216), 1L))) , l_1086)), ((((safe_rshift_func_int8_t_s_u((safe_unary_minus_func_uint32_t_u(((0x73L <= (safe_rshift_func_uint8_t_u_s(((g_1094 = l_1093) == (void*)0), g_141[g_408]))) , (*l_794)))), p_15)) , (void*)0) == &g_486) , (*g_555))));
+ l_1096 = (*l_794);
+ if ((*l_794))
+ break;
+ }
+ for (p_13 = 0; (p_13 <= 8); p_13 += 1)
+ { /* block id: 483 */
+ uint32_t l_1100 = 0xD370DA3EL;
+ const uint8_t *l_1112 = &g_733;
+ const uint8_t **l_1111 = &l_1112;
+ (*l_1062) = (((*l_1063) ^= (((p_14 | (*g_216)) > ((safe_add_func_uint16_t_u_u(l_1099, l_1100)) ^ p_15)) >= ((**g_486) && (g_733 &= (safe_lshift_func_int8_t_s_s((safe_mod_func_int16_t_s_s((safe_rshift_func_uint16_t_u_s(((safe_lshift_func_int8_t_s_s((safe_mod_func_int8_t_s_s((!(g_1058 &= ((*g_487) = (((g_141[g_408] ^ ((((65535UL ^ (l_1111 != l_992[1])) , 0x1CL) , (*g_216)) == l_1096)) | l_1100) | 0xDDF6L)))), (*g_555))), (*l_794))) | p_14), p_13)), l_1100)), p_15)))))) < 0x24L);
+ if (l_1100)
+ goto lbl_1113;
+ (*l_794) ^= (*l_1066);
+ }
+ }
+ else
+ { /* block id: 492 */
+ int32_t l_1126 = 0xCFC1EBE5L;
+ uint16_t l_1137 = 0x946EL;
+ const int32_t *l_1158 = &g_55;
+ int32_t l_1159 = 3L;
+ int32_t l_1160 = (-1L);
+ int32_t l_1161[2];
+ uint32_t l_1165[10][1] = {{0xE54AEF6EL},{0x293B7BE6L},{0xE54AEF6EL},{0x293B7BE6L},{0xE54AEF6EL},{0x293B7BE6L},{0xE54AEF6EL},{0x293B7BE6L},{0xE54AEF6EL},{0x293B7BE6L}};
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_1161[i] = 1L;
+ for (g_215 = 2; (g_215 <= 8); g_215 += 1)
+ { /* block id: 495 */
+ uint32_t *l_1129 = &g_234[2][5][1];
+ uint16_t ***l_1144 = (void*)0;
+ uint16_t ****l_1145 = &l_1144;
+ int8_t *l_1148[7][6][4] = {{{(void*)0,&l_1069[3],&l_1069[4],(void*)0},{&l_1069[3],&g_1058,&l_1069[4],&l_1069[5]},{(void*)0,&g_1058,&g_1058,&l_1069[3]},{&l_1069[5],&g_543,&l_1069[3],(void*)0},{&l_1069[3],(void*)0,&l_1069[1],&g_1058},{&g_543,&l_1069[5],&l_1069[5],&g_543}},{{(void*)0,&l_1069[3],&l_1069[5],&g_1058},{&g_543,&l_1069[1],&g_543,&g_543},{&l_1069[3],&g_543,(void*)0,&g_543},{&l_1069[3],&l_1069[1],&l_1069[3],&g_1058},{&l_1069[5],&l_1069[3],&l_1069[3],&g_543},{(void*)0,&l_1069[5],&g_1058,&g_1058}},{{&g_1058,(void*)0,(void*)0,(void*)0},{(void*)0,&g_543,&g_543,&l_1069[3]},{&l_1069[3],&g_1058,&l_1069[3],&l_1069[5]},{&g_1058,&l_1069[5],&l_1069[3],&g_543},{&g_1058,(void*)0,&g_543,&l_1069[5]},{&l_1069[5],&g_543,(void*)0,&g_1058}},{{&g_543,&g_1058,&l_1069[3],&l_1069[4]},{&l_1069[5],&l_1069[3],(void*)0,(void*)0},{&g_1058,&g_1058,&g_1058,&l_1069[3]},{&g_1058,(void*)0,&g_543,&l_1069[3]},{&g_1058,&l_1069[3],&l_1069[3],&g_543},{(void*)0,&l_1069[3],&l_1069[1],&l_1069[3]}},{{&l_1069[3],(void*)0,&l_1069[4],&l_1069[3]},{&l_1069[3],&g_1058,&g_1058,(void*)0},{&l_1069[1],&l_1069[3],&g_543,&l_1069[4]},{(void*)0,&g_1058,(void*)0,&g_1058},{&l_1069[4],&g_543,&l_1069[5],&l_1069[5]},{&l_1069[3],(void*)0,&l_1069[3],&g_543}},{{(void*)0,&l_1069[5],&l_1069[3],&g_1058},{&l_1069[3],&l_1069[3],&l_1069[5],&g_543},{&l_1069[4],&l_1069[3],(void*)0,&l_1069[3]},{(void*)0,&l_1069[3],&g_543,&g_1058},{&l_1069[1],&g_1058,&g_1058,&l_1069[1]},{&l_1069[3],&l_1069[3],&l_1069[4],&l_1069[3]}},{{&l_1069[3],&g_543,&l_1069[1],&l_1069[3]},{(void*)0,(void*)0,&l_1069[3],&l_1069[3]},{&g_1058,&g_543,&g_543,&l_1069[3]},{&g_1058,&l_1069[3],&g_1058,&l_1069[1]},{&g_1058,&g_1058,(void*)0,&g_1058},{&l_1069[5],&l_1069[3],&l_1069[3],&l_1069[3]}}};
+ int8_t *l_1154[2];
+ int8_t *l_1155 = &g_543;
+ const int32_t *l_1157 = &g_493;
+ const int32_t **l_1156[6];
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ l_1154[i] = &l_1069[3];
+ for (i = 0; i < 6; i++)
+ l_1156[i] = &l_1157;
+ l_1134 &= (safe_mul_func_int16_t_s_s((p_14 & (g_141[g_408] |= (((safe_lshift_func_uint8_t_u_s((safe_mul_func_int8_t_s_s((safe_rshift_func_int8_t_s_u((safe_rshift_func_uint16_t_u_s(p_15, 4)), 3)), ((safe_mul_func_uint16_t_u_u(l_1126, (((*g_555) = (safe_add_func_uint8_t_u_u(((g_967[g_215][g_215] = l_1129) == ((*l_968) = (void*)0)), (*g_555)))) >= (safe_rshift_func_uint16_t_u_s(((0x17L && (g_350[4][2].f6 || (&g_216 == (void*)0))) , 0xABBCL), (*g_216)))))) >= l_1126))), 6)) <= l_1126) ^ l_1069[3]))), (*l_794)));
+ l_1070[0][0][0] = ((((*p_16) = (g_141[g_408] || (((safe_add_func_int32_t_s_s((((**g_486) = l_1137) | p_14), ((safe_lshift_func_uint16_t_u_u((safe_div_func_int16_t_s_s((((((0xB1L < 0xF5L) | ((safe_add_func_uint32_t_u_u((((*l_1145) = l_1144) != (((l_1059 = (safe_mod_func_uint8_t_u_u(1UL, 1L))) || ((safe_add_func_uint8_t_u_u(((((safe_mul_func_int8_t_s_s((g_543 = (-1L)), p_15)) < l_1134) ^ 254UL) , (**g_554)), p_13)) >= p_15)) , (void*)0)), (*p_12))) , p_14)) || l_1137) >= g_141[g_408]) && 0xE81EF0E4L), l_1137)), 14)) == (*l_794)))) && (*p_12)) , p_15))) , 0xF2D2L) | g_141[g_408]);
+ if (l_1137)
+ continue;
+ l_1158 = l_910;
+ }
+ l_1165[3][0]++;
+ }
+ }
+ (**l_1086) = (**g_785);
+ for (g_144 = 0; (g_144 == 50); g_144 = safe_add_func_uint8_t_u_u(g_144, 8))
+ { /* block id: 518 */
+ uint16_t **l_1174[9][1][8] = {{{&g_194[0],&g_351,&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0],&g_194[0]}},{{&g_351,&g_194[0],&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0],&g_351}},{{&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0]}},{{&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0]}},{{&g_194[0],&g_194[0],&g_194[0],&g_351,&g_351,&g_351,&g_194[0],&g_194[0]}},{{&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0],&g_194[0]}},{{&g_194[0],&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0],&g_194[0],&g_194[0]}},{{&g_194[0],&g_351,&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0],&g_194[0]}},{{&g_351,&g_194[0],&g_194[0],&g_194[0],&g_351,&g_194[0],&g_194[0],&g_351}}};
+ uint16_t ***l_1173[7];
+ const union U1 **l_1178[1];
+ union U1 **l_1180 = &l_1179[0][0];
+ int32_t l_1202 = 6L;
+ int i, j, k;
+ for (i = 0; i < 7; i++)
+ l_1173[i] = &l_1174[7][0][7];
+ for (i = 0; i < 1; i++)
+ l_1178[i] = (void*)0;
+ --l_1170;
+ if ((l_1173[5] != (((l_1175 = (l_1176 = l_1175)) == ((*l_1180) = l_1179[6][2])) , l_1181)))
+ { /* block id: 523 */
+ struct S0 *l_1183 = &l_988[7];
+ struct S0 **l_1184 = &l_1183;
+ (*l_1184) = l_1183;
+ }
+ else
+ { /* block id: 525 */
+ (*p_12) = ((&g_109 != &g_350[7][3]) || 0xC1D9L);
+ }
+ (*p_16) = (l_1185 , (safe_lshift_func_int8_t_s_s((((safe_unary_minus_func_uint16_t_u((safe_mod_func_uint16_t_u_u((safe_add_func_uint32_t_u_u((0x13L > (safe_add_func_int16_t_s_s((((*p_12) = (safe_sub_func_int32_t_s_s((*l_794), ((safe_unary_minus_func_int32_t_s((*p_16))) && (safe_add_func_int32_t_s_s(((((*g_216) = (safe_add_func_int8_t_s_s((0x3D58L != l_1202), p_13))) ^ ((safe_div_func_int32_t_s_s((((((*l_1065) = (-1L)) ^ 0xEDBC3F46L) < (*p_12)) < l_1202), 0x6FEA2B67L)) ^ (*p_12))) & l_1185.f5), 1UL)))))) >= l_1185.f4), (*l_794)))), p_13)), (*l_794))))) & (*l_1063)) == p_13), p_13)));
+ for (l_969 = 29; (l_969 == (-2)); l_969 = safe_sub_func_uint32_t_u_u(l_969, 1))
+ { /* block id: 534 */
+ }
+ }
+ }
+ }
+ (*p_12) = ((((safe_unary_minus_func_uint8_t_u((l_1220 ^ (((safe_sub_func_uint32_t_u_u(((safe_div_func_uint8_t_u_u((safe_mod_func_int8_t_s_s((safe_div_func_uint16_t_u_u(((l_1229 = ((l_988[7] , (((((((-1L) & ((*g_487) |= (*l_794))) >= (*l_794)) , (*l_794)) & p_15) || (-3L)) > (((0x3940D9DAL <= 4294967289UL) == (*l_794)) | (*l_794)))) <= (*l_794))) ^ l_1230[3][0]), 0xDA9EL)), p_13)), (*l_794))) , 0x099334B0L), (*l_794))) > (*l_794)) > 0x30ABL)))) , &g_194[0]) == l_1231[0]) , (*p_12));
+ return (*l_794);
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_2
+ * writes: g_2
+ */
+static uint32_t func_20(uint32_t p_21)
+{ /* block id: 10 */
+ const int32_t l_27[8][7][4] = {{{0x213633E7L,1L,(-7L),1L},{0xBFCF419CL,(-3L),(-7L),1L},{0x213633E7L,0xB19D88C8L,0xBFCF419CL,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)}},{{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL}},{{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL}},{{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)}},{{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L}},{{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)}},{{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL},{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,0xE89405DBL,9L,0xE89405DBL},{1L,0xB19D88C8L,9L,(-3L)},{0xBFCF419CL,1L,1L,(-3L)},{(-7L),0xB19D88C8L,(-7L),0xE89405DBL}},{{(-7L),0xE89405DBL,1L,1L},{0xBFCF419CL,1L,0x213633E7L,1L},{(-7L),1L,0x213633E7L,0xB19D88C8L},{1L,0xE89405DBL,(-7L),0xB19D88C8L},{9L,1L,9L,1L},{9L,1L,(-7L),(-3L)},{1L,1L,0x213633E7L,1L}}};
+ int32_t *l_28 = &g_2;
+ int i, j, k;
+ (*l_28) &= l_27[0][2][2];
+ return p_21;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_24 g_53 g_2 g_36 g_86 g_52 g_109 g_114 g_72 g_144 g_55 g_126 g_141 g_214 g_216 g_215 g_217 g_234 g_312 g_331 g_350 g_351 g_143 g_408 g_486 g_493 g_487 g_543 g_113 g_554 g_555 g_477 g_626 g_784
+ * writes: g_24 g_2 g_36 g_52 g_53 g_55 g_86 g_113 g_126 g_109.f3 g_114 g_141 g_143 g_144 g_72 g_194 g_215 g_252 g_217 g_312 g_234 g_486 g_350.f8 g_214 g_351 g_626 g_776
+ */
+static const uint8_t func_31(uint8_t p_32)
+{ /* block id: 14 */
+ uint16_t l_213[5][7][7] = {{{0xE217L,65535UL,0x056FL,0xE217L,65532UL,0x5C96L,8UL},{65526UL,0x85C2L,0UL,65532UL,65532UL,0UL,0x85C2L},{65532UL,0x9171L,0x0C94L,1UL,0x056FL,8UL,65533UL},{0x0C94L,65526UL,0x4E03L,0x9171L,0x3561L,65535UL,0x056FL},{0x72F8L,0x85C2L,1UL,1UL,0xA3E3L,0x9D98L,65526UL},{65535UL,0x056FL,0xE217L,65532UL,0x5C96L,8UL,0x72F8L},{0x941BL,1UL,0xE217L,0xE217L,1UL,0x941BL,0UL}},{{0x3561L,1UL,1UL,0xA3E3L,0x85C2L,0x208BL,0xA3E3L},{65532UL,0x7E30L,0x4E03L,65533UL,0UL,0x0C94L,0x72F8L},{0x9171L,1UL,0x0C94L,8UL,0x3561L,0xE217L,0x9171L},{1UL,1UL,0UL,0xA3E3L,65535UL,2UL,65535UL},{1UL,0x056FL,0x056FL,1UL,0x4E03L,0x5C96L,65533UL},{0x9171L,0x85C2L,0x941BL,0x4E03L,65532UL,0x941BL,0x5C96L},{65532UL,65526UL,2UL,1UL,65535UL,1UL,65533UL}},{{0x3561L,0x9171L,0x4E03L,65526UL,0x0C94L,65535UL,65535UL},{0x941BL,0x85C2L,0x9171L,65535UL,0xA3E3L,65535UL,0x9171L},{65535UL,65535UL,65526UL,65532UL,0x85C2L,1UL,0x72F8L},{0x72F8L,65535UL,0xE217L,1UL,65535UL,0x941BL,0xA3E3L},{0x0C94L,1UL,0x9171L,0UL,0x85C2L,0x5C96L,0UL},{65532UL,0x60CBL,0x6E77L,65533UL,0xA3E3L,2UL,0x72F8L},{65526UL,0xE217L,0x0C94L,65533UL,0x0C94L,0xE217L,65526UL}},{{0xE217L,1UL,0x941BL,0UL,65535UL,0x0C94L,0x056FL},{1UL,65535UL,6UL,1UL,65532UL,0x208BL,65533UL},{65526UL,0x5C96L,0x941BL,65532UL,0x4E03L,0x941BL,0x85C2L},{0x9D98L,0x7E30L,0UL,65526UL,8UL,1UL,1UL},{0x941BL,0x7E30L,1UL,0x7E30L,0x941BL,1UL,8UL},{0x4E03L,2UL,65535UL,0xE217L,0x208BL,65526UL,0x7E30L},{1UL,8UL,6UL,0x9D98L,0x0C94L,1UL,0x6E77L}},{{0x4E03L,0xE217L,65535UL,0x056FL,0xE217L,65532UL,0x5C96L},{0x941BL,6UL,65535UL,0x5C96L,2UL,2UL,0x5C96L},{0x9D98L,0UL,0x9D98L,1UL,0x5C96L,0UL,0x6E77L},{0x7E30L,0x056FL,0x72F8L,0x9171L,0x941BL,65535UL,0x7E30L},{0x056FL,65526UL,0x6E77L,0x5C96L,1UL,0UL,8UL},{6UL,8UL,1UL,6UL,65535UL,2UL,1UL},{0x7E30L,0x0C94L,65532UL,65535UL,65535UL,65532UL,0x0C94L}}};
+ int32_t l_222[3][10] = {{(-1L),(-1L),(-1L),(-1L),0x2D656744L,5L,0x2D656744L,(-1L),(-1L),(-1L)},{0x2D656744L,(-1L),0x83BE1114L,1L,1L,0x83BE1114L,(-1L),0x2D656744L,(-1L),0x83BE1114L},{5L,(-1L),1L,(-1L),5L,0x83BE1114L,0x83BE1114L,5L,(-1L),1L}};
+ uint32_t *l_233[3][2];
+ int32_t **l_236 = &g_86;
+ int8_t *l_250 = &g_143;
+ int16_t l_251 = 0x6775L;
+ int32_t *l_253 = (void*)0;
+ uint8_t *l_256 = &g_114;
+ union U1 l_263 = {0xD8L};
+ const int16_t l_288 = 0L;
+ int32_t l_289 = 0L;
+ uint16_t l_299 = 0xB300L;
+ int32_t l_311 = 1L;
+ int32_t l_326 = 1L;
+ uint32_t l_359 = 0x854B9D9CL;
+ struct S0 l_375 = {-0,-610,1,170,32,1,-2,576,1};
+ int32_t l_440 = (-1L);
+ int32_t l_443 = 0xC3336E55L;
+ union U1 *l_476[1];
+ int8_t l_522 = 0x0AL;
+ uint8_t l_530 = 0xC0L;
+ int8_t **l_696 = &g_487;
+ int16_t l_724 = 0x0842L;
+ uint32_t * const l_775 = &g_776;
+ uint32_t * const *l_774 = &l_775;
+ int i, j, k;
+ for (i = 0; i < 3; i++)
+ {
+ for (j = 0; j < 2; j++)
+ l_233[i][j] = &g_234[2][0][1];
+ }
+ for (i = 0; i < 1; i++)
+ l_476[i] = &g_477;
+ (*l_236) = func_40((func_46(p_32) , l_213[2][6][1]), g_214, g_216, (+(safe_sub_func_int32_t_s_s(((safe_lshift_func_uint8_t_u_u(g_109.f7, 7)) == l_222[0][6]), (safe_mul_func_int16_t_s_s((((safe_lshift_func_uint8_t_u_s(((((l_222[0][7] == (safe_lshift_func_int8_t_s_u((safe_rshift_func_uint8_t_u_s((safe_sub_func_uint32_t_u_u(g_109.f8, (*g_214))), 0)), g_109.f4))) < 0x97C0L) <= p_32) , g_109.f0), p_32)) ^ l_213[3][0][1]) & 0x3BD0L), p_32))))), l_233[2][1]);
+lbl_787:
+ g_2 |= (((safe_mod_func_int8_t_s_s(((g_252[1][3] = func_99(l_233[1][0], (((((*g_216) , (safe_unary_minus_func_uint16_t_u((safe_lshift_func_int16_t_s_u(6L, (**l_236)))))) < ((*g_214) |= (safe_add_func_int16_t_s_s(((g_109 , ((**l_236) >= (((safe_lshift_func_uint8_t_u_s(((safe_rshift_func_int8_t_s_s((((*l_250) = (g_234[2][0][1] != (p_32 == (((safe_div_func_int16_t_s_s((*g_216), (*g_216))) ^ 1UL) & (**l_236))))) & (**l_236)), 3)) | p_32), 5)) | p_32) ^ g_141[1]))) ^ 0xC824L), 1UL)))) && l_251) & (*g_86)), (**l_236), p_32)) == &g_24), p_32)) != 0x33L) == (*g_86));
+ (*g_214) = ((safe_sub_func_int8_t_s_s(0x67L, ((**l_236) , ((*l_256) = (**l_236))))) == ((((**l_236) & (safe_div_func_uint8_t_u_u(((safe_add_func_uint8_t_u_u(((safe_sub_func_uint16_t_u_u(((((*g_216) |= p_32) , ((l_263 , (void*)0) == &l_251)) & ((safe_div_func_int16_t_s_s(p_32, 65527UL)) & 6UL)), 0x9836L)) , g_109.f4), p_32)) < p_32), (**l_236)))) & (**l_236)) == 253UL));
+ if (((p_32 ^ ((p_32 ^ (~((((*g_214) |= (safe_sub_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((**l_236), (safe_div_func_uint32_t_u_u((l_289 = (((*g_216) = (0xB485L > ((safe_lshift_func_uint8_t_u_u((safe_sub_func_int16_t_s_s((safe_div_func_int16_t_s_s((safe_mod_func_int32_t_s_s(((((safe_sub_func_uint32_t_u_u((g_109.f8 , ((g_141[0] || ((0x2F8BL || (safe_sub_func_int16_t_s_s((safe_sub_func_int8_t_s_s((p_32 | (p_32 > 0xF1L)), 0xF4L)), p_32))) != 0xDE6FF466L)) || p_32)), (**l_236))) > (-1L)) && g_72) || (**l_236)), p_32)), (**l_236))), 65528UL)), 7)) < l_288))) > (**l_236))), (*g_86))))), p_32))) , p_32) < 0x883BL))) >= 0xB94D1ED4L)) != 0x6E74L))
+ { /* block id: 111 */
+ struct S0 l_292 = {1,868,0,-167,63,0,6,185,-4};
+ int16_t *l_293 = &l_251;
+ int16_t **l_294 = &l_293;
+ int8_t *l_426 = (void*)0;
+ int16_t l_436 = 0L;
+ int32_t l_439 = 0x78F69DFEL;
+ int32_t l_441 = 6L;
+ int32_t l_442 = 0x2B99C833L;
+ uint32_t l_454 = 18446744073709551615UL;
+ uint32_t l_466 = 1UL;
+ union U1 l_471 = {0x2BL};
+ int8_t l_490[6];
+ int32_t *l_495 = &g_2;
+ int16_t l_527 = 0x2489L;
+ uint16_t l_542 = 0UL;
+ const uint32_t *l_663[9] = {&g_664,&g_664,&g_664,&g_664,&g_664,&g_664,&g_664,&g_664,&g_664};
+ const uint32_t **l_662[6] = {&l_663[8],&l_663[4],&l_663[4],&l_663[8],&l_663[4],&l_663[4]};
+ const uint32_t *l_665 = &g_666[0][5][1];
+ int i;
+ for (i = 0; i < 6; i++)
+ l_490[i] = 0x8DL;
+ if ((safe_lshift_func_int8_t_s_u(g_109.f5, ((l_292 , &l_251) != ((*l_294) = l_293)))))
+ { /* block id: 113 */
+lbl_399:
+ (*l_236) = &g_55;
+ }
+ else
+ { /* block id: 115 */
+ int32_t l_300[7][3] = {{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L},{0xDEA12953L,0xA39915C5L,0xA39915C5L}};
+ int16_t *l_301 = &l_251;
+ int32_t l_388 = 0x600FA4EEL;
+ uint8_t **l_422 = &l_256;
+ int8_t *l_423[2];
+ int8_t **l_424 = (void*)0;
+ int8_t **l_425 = &l_423[1];
+ uint8_t l_427 = 3UL;
+ union U1 *l_475 = &l_471;
+ uint32_t l_489 = 0UL;
+ int32_t **l_496 = &g_214;
+ int32_t l_513 = 0xF8A528CBL;
+ int32_t l_517 = (-1L);
+ uint16_t l_541 = 5UL;
+ uint8_t *l_544 = (void*)0;
+ uint8_t *l_545 = &g_114;
+ uint8_t *l_546 = &g_113;
+ int16_t l_589 = (-2L);
+ int32_t l_595[3];
+ int32_t l_605 = (-10L);
+ struct S0 l_606 = {0,19573,1,121,89,0,5,169,-3};
+ int16_t l_621 = 1L;
+ uint8_t l_623 = 255UL;
+ uint8_t l_632 = 248UL;
+ int8_t l_633 = (-1L);
+ uint8_t l_634 = 1UL;
+ uint32_t l_635 = 0x54A42BA3L;
+ int32_t l_639 = 0L;
+ uint16_t l_645 = 0xDE68L;
+ int16_t l_648 = (-1L);
+ int8_t l_655 = 0x79L;
+ int16_t l_656 = (-1L);
+ int32_t *l_657 = &g_215;
+ int i, j;
+ for (i = 0; i < 2; i++)
+ l_423[i] = &g_143;
+ for (i = 0; i < 3; i++)
+ l_595[i] = (-7L);
+ if ((safe_add_func_uint32_t_u_u((safe_mul_func_uint16_t_u_u(((l_292 , ((l_299 >= l_300[4][1]) , l_301)) == ((((safe_rshift_func_int16_t_s_u(l_292.f3, ((g_144 < (l_292.f8 < (((65527UL <= (((((void*)0 != l_301) & (*g_214)) ^ p_32) , l_292.f4)) < g_109.f5) > g_53))) || 0x91L))) ^ l_292.f7) >= l_300[3][2]) , &l_251)), p_32)), (*g_86))))
+ { /* block id: 116 */
+ int32_t *l_304 = &l_300[5][1];
+ int32_t *l_305 = (void*)0;
+ int32_t l_306 = (-1L);
+ int32_t *l_307 = &l_300[4][1];
+ int32_t *l_308 = &g_53;
+ int32_t *l_309[2];
+ int32_t l_310 = 0x9A6A31B5L;
+ int8_t *l_321 = &g_143;
+ int i;
+ for (i = 0; i < 2; i++)
+ l_309[i] = (void*)0;
+ ++g_312[0];
+ if (((safe_mul_func_int8_t_s_s((p_32 == ((safe_mul_func_uint8_t_u_u(((**l_236) = 0xC4L), (safe_div_func_int32_t_s_s((((p_32 ^ 0xE6BD7F7FL) , l_321) != &g_143), (safe_rshift_func_uint8_t_u_s(3UL, 5)))))) > ((safe_lshift_func_int16_t_s_u(((((p_32 <= (l_292.f1 = p_32)) , l_326) > p_32) == p_32), p_32)) , 0x79L))), g_109.f2)) == (-1L)))
+ { /* block id: 120 */
+ (*l_307) = (safe_lshift_func_int16_t_s_s(4L, 8));
+ (*l_308) |= (*g_214);
+ (*g_86) = (safe_lshift_func_uint16_t_u_u((*l_307), (((g_331 , p_32) , (-5L)) && 0xA58AL)));
+ (*g_86) ^= (safe_div_func_int32_t_s_s((-1L), 0xEDDE48FAL));
+ }
+ else
+ { /* block id: 125 */
+ uint32_t l_353 = 4294967291UL;
+ int32_t l_354 = 0x8D8C0522L;
+ for (g_114 = 0; (g_114 == 45); g_114 = safe_add_func_int32_t_s_s(g_114, 4))
+ { /* block id: 128 */
+ int32_t *l_336 = &g_215;
+ uint16_t *l_345 = &g_72;
+ int32_t l_352 = 0x8A444AF9L;
+ (*l_236) = l_336;
+ (*l_236) = &g_215;
+ l_354 = (safe_rshift_func_uint16_t_u_s((safe_sub_func_uint8_t_u_u(g_109.f6, ((+(safe_div_func_int32_t_s_s(p_32, (safe_add_func_uint8_t_u_u(((((void*)0 == l_345) , (safe_mod_func_uint16_t_u_u((((*l_336) ^= p_32) ^ (l_300[5][0] , (safe_add_func_int32_t_s_s(((((((((g_126[2][2] || (l_263 , ((*l_321) |= (((g_350[4][2] , (-1L)) , &g_72) == g_351)))) & 6L) == p_32) , p_32) > l_352) > g_114) > l_353) , p_32), p_32)))), (*l_307)))) , p_32), 0x31L))))) < (*l_308)))), 14));
+ }
+ if (g_109.f7)
+ goto lbl_494;
+ }
+ for (g_2 = 25; (g_2 < (-5)); g_2 = safe_sub_func_uint8_t_u_u(g_2, 5))
+ { /* block id: 138 */
+ for (g_113 = 0; (g_113 < 55); g_113 = safe_add_func_uint16_t_u_u(g_113, 8))
+ { /* block id: 141 */
+ (*l_236) = (void*)0;
+ }
+ for (l_251 = 2; (l_251 >= 0); l_251 -= 1)
+ { /* block id: 146 */
+ int i, j;
+ return l_300[l_251][l_251];
+ }
+ }
+ l_359--;
+ }
+ else
+ { /* block id: 151 */
+ int16_t l_392 = (-1L);
+ int32_t l_393 = 0x4FE45244L;
+ int32_t *l_421 = &g_2;
+ for (g_217 = (-10); (g_217 == 12); g_217 = safe_add_func_uint32_t_u_u(g_217, 1))
+ { /* block id: 154 */
+ int16_t l_370 = (-1L);
+ int16_t l_398 = 0x1CFDL;
+ if (((safe_add_func_uint32_t_u_u(((l_300[4][2] == (safe_lshift_func_int8_t_s_u((g_331 , (safe_div_func_uint8_t_u_u(0xCFL, (-1L)))), l_292.f2))) ^ (g_109 , l_300[4][1])), l_370)) , ((safe_rshift_func_int16_t_s_u((safe_div_func_uint8_t_u_u((&p_32 == &g_113), p_32)), p_32)) <= g_350[4][2].f7)))
+ { /* block id: 155 */
+ int16_t l_381 = (-1L);
+ const int32_t l_391 = 0L;
+ l_381 ^= (l_375 , ((g_215 , (**l_236)) > ((((safe_sub_func_uint16_t_u_u(((((!(**l_236)) & (1L >= p_32)) , ((((safe_unary_minus_func_int8_t_s((**l_236))) < 0x3DA1L) >= (((p_32 ^ (**l_236)) | l_300[4][1]) && (*g_86))) <= p_32)) == l_300[4][1]), l_300[0][2])) | l_292.f4) , (void*)0) == l_250)));
+ l_393 &= (((safe_div_func_int8_t_s_s((safe_lshift_func_int8_t_s_u((((*g_216) & (0x61DE9766L != 0xD43EE1FDL)) , (p_32 < ((!(((((((safe_add_func_uint16_t_u_u(((l_388 == (248UL ^ ((*l_250) |= (safe_div_func_uint8_t_u_u(0x83L, (l_292.f1 && (*g_216))))))) , l_391), l_392)) , l_292.f1) && p_32) , 65532UL) | l_292.f4) , p_32) == p_32)) || 6UL))), g_350[4][2].f3)), g_24)) != p_32) , 0x6C8538B0L);
+ }
+ else
+ { /* block id: 159 */
+ return p_32;
+ }
+ (*g_86) = (safe_lshift_func_int8_t_s_u((0x40C17C14L >= (g_350[4][2].f4 , (safe_lshift_func_uint8_t_u_u(l_398, 0)))), 3));
+ }
+ if (l_251)
+ goto lbl_399;
+ (*g_86) = ((*g_214) & (((l_393 < 5UL) >= (-1L)) || ((**l_236) && (0x29C54269L != 0x3CAA9559L))));
+ l_393 = (safe_mul_func_uint16_t_u_u((safe_sub_func_uint16_t_u_u((safe_sub_func_uint32_t_u_u((((safe_rshift_func_uint8_t_u_s(((g_408 && (*g_86)) >= p_32), 1)) , 4294967288UL) & (*g_214)), ((*l_421) = (safe_div_func_int32_t_s_s(0xEC54B450L, ((safe_add_func_uint8_t_u_u((safe_mod_func_int8_t_s_s((safe_sub_func_int32_t_s_s((-7L), (safe_mod_func_uint8_t_u_u(p_32, (safe_mod_func_int32_t_s_s((&g_214 == &l_253), l_392)))))), 0x60L)), g_109.f8)) , l_388)))))), p_32)), l_292.f3));
+ }
+ if (((g_109.f2 | (((*l_422) = (void*)0) != ((((*l_425) = (l_292 , l_423[1])) != l_426) , (((0x82AE79FEL || (l_427 = p_32)) & ((safe_mul_func_int16_t_s_s((p_32 > (safe_mul_func_int8_t_s_s((safe_div_func_uint32_t_u_u(((l_292.f2 > (-9L)) ^ l_300[5][1]), 0xCB376623L)), 1UL))), 0L)) & p_32)) , &g_113)))) , p_32))
+ { /* block id: 172 */
+ int32_t *l_434[8][4][6] = {{{&l_311,&g_215,&g_215,&g_215,&l_289,(void*)0},{&g_215,&g_215,&l_388,&l_388,&g_215,&g_215},{&l_388,&g_215,&g_215,(void*)0,&l_289,&g_215},{&g_215,&g_215,&l_311,&g_215,&g_215,&g_215}},{{&g_215,&l_388,&g_215,(void*)0,&l_300[0][1],&l_300[0][1]},{&l_388,&l_289,&l_289,&l_388,&l_311,&l_300[0][1]},{&g_215,&l_300[0][1],&g_215,&g_215,(void*)0,&g_215},{&l_311,&l_388,&l_311,(void*)0,(void*)0,&g_215}},{{&l_388,&g_215,&l_311,&g_215,&g_215,&l_311},{(void*)0,(void*)0,&l_289,&g_215,&g_215,&g_215},{&l_388,&l_289,&g_215,&g_215,&g_215,&l_289},{&g_215,&l_388,&g_215,&l_388,(void*)0,&g_215}},{{&l_311,&l_388,&l_289,&l_289,&l_388,&l_311},{&l_289,&l_388,&l_311,&l_300[0][1],(void*)0,&g_215},{&g_215,&l_388,&g_215,&l_388,&g_215,&l_388},{&g_215,&l_289,&l_388,&l_300[0][1],&g_215,&g_215}},{{&l_289,(void*)0,(void*)0,&l_289,&g_215,&g_215},{&l_311,&g_215,&l_388,&l_388,&l_300[0][1],&l_388},{&g_215,(void*)0,&g_215,&g_215,&l_300[0][1],&g_215},{&l_388,&g_215,&l_311,&g_215,&g_215,&l_311}},{{(void*)0,(void*)0,&l_289,&g_215,&g_215,&g_215},{&l_388,&l_289,&g_215,&g_215,&g_215,&l_289},{&g_215,&l_388,&g_215,&l_388,(void*)0,&g_215},{&l_311,&l_388,&l_289,&l_289,&l_388,&l_311}},{{&l_289,&l_388,&l_311,&l_300[0][1],(void*)0,&g_215},{&g_215,&l_388,&g_215,&l_388,&g_215,&l_388},{&g_215,&l_289,&l_388,&l_300[0][1],&g_215,&g_215},{&l_289,(void*)0,(void*)0,&l_289,&g_215,&g_215}},{{&l_311,&g_215,&l_388,&l_388,&l_300[0][1],&l_388},{&g_215,(void*)0,&g_215,&g_215,&l_300[0][1],&g_215},{&l_388,&g_215,&l_311,&g_215,&g_215,&l_311},{(void*)0,(void*)0,&l_289,&g_215,&g_215,&g_215}}};
+ int32_t l_435 = 3L;
+ int32_t l_437 = 5L;
+ int32_t l_438[2];
+ uint32_t l_444 = 0xDB1A413FL;
+ uint8_t *l_453 = &g_113;
+ struct S0 l_455 = {1,6823,0,-72,14,1,-4,-531,-1};
+ const int8_t *l_457 = &l_263.f0;
+ const int8_t **l_456 = &l_457;
+ int i, j, k;
+ for (i = 0; i < 2; i++)
+ l_438[i] = 0L;
+ l_444++;
+ (*g_214) &= (safe_mod_func_uint32_t_u_u((l_454 = (((safe_lshift_func_int8_t_s_s(((safe_mod_func_int16_t_s_s((l_250 == l_426), p_32)) ^ (((*l_250) = 0xDAL) | (g_331 , p_32))), (((g_2 & ((g_126[1][2] & (l_453 != &g_144)) , g_350[4][2].f3)) , l_292.f3) | p_32))) & 7L) != 6L)), l_439));
+ for (l_299 = 0; l_299 < 2; l_299 += 1)
+ {
+ for (l_289 = 0; l_289 < 6; l_289 += 1)
+ {
+ g_252[l_299][l_289] = &g_141[0];
+ }
+ }
+ if (((*g_214) |= (&g_143 == (l_455 , ((*l_456) = l_453)))))
+ { /* block id: 180 */
+ int16_t l_462 = 0xFFE7L;
+ int32_t l_464 = 1L;
+ int32_t l_465 = (-8L);
+ uint8_t l_472[4][10][6] = {{{0x44L,0x78L,7UL,1UL,0UL,7UL},{0x09L,0x2AL,0UL,255UL,0UL,0x2AL},{1UL,0x78L,0xF6L,255UL,0x78L,0UL},{0x09L,0UL,0xF6L,1UL,0x2AL,0x2AL},{0x44L,0UL,0UL,0x44L,0x78L,7UL},{0x44L,0x78L,7UL,1UL,0UL,7UL},{0x09L,0x2AL,0UL,255UL,0UL,0x2AL},{1UL,0x78L,0xF6L,255UL,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L}},{{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L},{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L}},{{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L},{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L}},{{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0xF6L,0x7FL,0x13L},{0xF6L,0x7FL,0x13L,7UL,0xE7L,0x13L},{0UL,0xBEL,0xE7L,0x78L,0xE7L,0xBEL},{7UL,0x7FL,0UL,0x78L,0x7FL,0xE7L},{0UL,0xE7L,0UL,7UL,0xBEL,0xBEL},{0xF6L,0xE7L,0xE7L,0UL,1UL,0xD6L}}};
+ int8_t ***l_488 = &g_486;
+ int i, j, k;
+ for (l_436 = 0; (l_436 == (-20)); l_436--)
+ { /* block id: 183 */
+ int16_t l_460 = 0x8D84L;
+ int32_t l_461 = 0L;
+ int32_t l_463[3][1][7] = {{{5L,0x4FEAE600L,5L,0x2AF12338L,0x70CB83D5L,0x70CB83D5L,0x2AF12338L}},{{5L,0x4FEAE600L,5L,0x2AF12338L,0x70CB83D5L,0x70CB83D5L,0x2AF12338L}},{{5L,0x4FEAE600L,5L,0x2AF12338L,0x70CB83D5L,0x70CB83D5L,0x2AF12338L}}};
+ int i, j, k;
+ l_466--;
+ (*g_214) = (safe_rshift_func_uint8_t_u_u(l_436, 0));
+ (*g_214) = (0UL >= (((p_32 | l_436) , &l_465) != (l_471 , &g_52)));
+ l_472[2][3][2]++;
+ }
+ l_476[0] = l_475;
+ (*g_214) = (safe_mul_func_int16_t_s_s((-1L), (safe_add_func_int16_t_s_s((((*g_214) & ((((safe_div_func_int32_t_s_s((65534UL >= ((!((l_465 &= (((*l_488) = g_486) == &l_457)) != (g_350[4][2].f8 = (*g_214)))) >= l_489)), p_32)) < (0x270A4E95L != 1L)) > l_490[5]) | 1L)) & l_300[3][0]), 0xE47FL))));
+ l_292.f0 |= (&g_216 != (void*)0);
+ }
+ else
+ { /* block id: 195 */
+ for (l_311 = 0; (l_311 > 18); l_311 = safe_add_func_int32_t_s_s(l_311, 1))
+ { /* block id: 198 */
+ return g_493;
+ }
+ }
+ }
+ else
+ { /* block id: 202 */
+lbl_494:
+ (*g_214) ^= 9L;
+ for (l_439 = 2; (l_439 >= 0); l_439 -= 1)
+ { /* block id: 207 */
+ int32_t ***l_497 = &l_236;
+ uint16_t *l_506 = &l_213[2][2][2];
+ uint32_t l_514 = 0UL;
+ int32_t *l_515 = &l_222[0][4];
+ int32_t *l_516[2];
+ int i;
+ for (i = 0; i < 2; i++)
+ l_516[i] = (void*)0;
+ g_86 = l_495;
+ (*l_497) = l_496;
+ }
+ if ((l_375 , (((**l_294) = (((safe_add_func_uint32_t_u_u((l_530 |= 4294967295UL), 0xE1E4D1B6L)) & (*g_487)) <= (((*l_546) = (g_143 , ((*l_545) |= ((safe_sub_func_uint8_t_u_u((safe_mod_func_int16_t_s_s(p_32, (safe_sub_func_uint32_t_u_u((safe_div_func_uint32_t_u_u((safe_sub_func_int32_t_s_s((((((*l_495) & ((l_541 &= 0x15239216L) ^ (&g_216 == &g_216))) , 0xD1FAFE0AL) > (**l_496)) , p_32), 0x11CB596BL)), l_542)), g_543)))), (*l_495))) != (*l_495))))) > p_32))) <= (*g_216))))
+ { /* block id: 233 */
+ int32_t l_562 = 0L;
+ uint16_t *l_573 = &g_72;
+ uint16_t *l_578 = &l_213[2][6][1];
+ uint16_t *l_579 = &l_542;
+ int32_t l_580[8][1][3] = {{{0L,0L,0L}},{{0xED1E47A8L,0xED1E47A8L,0xED1E47A8L}},{{0L,0L,0L}},{{0xED1E47A8L,0xED1E47A8L,0xED1E47A8L}},{{0L,0L,0L}},{{0xED1E47A8L,0xED1E47A8L,0xED1E47A8L}},{{0L,0L,0L}},{{0xED1E47A8L,0xED1E47A8L,0xED1E47A8L}}};
+ uint8_t l_596 = 246UL;
+ union U1 **l_597 = &l_476[0];
+ union U1 ***l_598 = &l_597;
+ int i, j, k;
+ (*l_495) = ((p_32 ^ (((*l_546) &= p_32) & (safe_sub_func_uint8_t_u_u(((safe_unary_minus_func_uint8_t_u((safe_mul_func_int16_t_s_s((+(((((p_32 != p_32) , (void*)0) == (void*)0) & ((void*)0 == g_554)) > 1L)), 0xE42FL)))) , (*g_555)), (*g_555))))) >= (**l_496));
+ l_517 |= (p_32 ^ ((**l_496) || ((safe_lshift_func_int16_t_s_u((safe_lshift_func_uint8_t_u_s((p_32 > (safe_sub_func_uint16_t_u_u((l_562 & (l_580[2][0][0] |= (safe_sub_func_int32_t_s_s(((*g_214) = (((safe_mul_func_uint16_t_u_u(((*l_579) = (+((safe_add_func_uint32_t_u_u((safe_add_func_int8_t_s_s((-9L), (((((safe_sub_func_int32_t_s_s((*l_495), (((((*l_578) = ((++(*l_573)) , (((safe_div_func_uint8_t_u_u((&l_496 == &l_496), (*g_487))) ^ (*l_495)) != 0UL))) ^ p_32) && 0x6B6A2B71L) != (**g_486)))) , (void*)0) != &g_331) ^ 0x78B73E53L) | 0xD9BBL))), p_32)) , p_32))), (*g_216))) , (*l_495)) , p_32)), 0L)))), p_32))), p_32)), 0)) & p_32)));
+ l_596 |= ((+(p_32 , ((+2UL) != (safe_div_func_uint32_t_u_u(((safe_lshift_func_uint8_t_u_u((l_471 , (safe_mul_func_uint16_t_u_u((safe_sub_func_int16_t_s_s((*l_495), l_589)), (((**l_496) &= (safe_unary_minus_func_int8_t_s((-3L)))) | (safe_mod_func_int16_t_s_s((((*l_495) <= ((safe_div_func_uint32_t_u_u(p_32, 1L)) | 0L)) <= g_408), p_32)))))), 4)) > (*g_487)), 0x8438359BL))))) <= l_595[1]);
+ (*l_598) = l_597;
+ }
+ else
+ { /* block id: 245 */
+ int32_t l_622 = 0xFB315905L;
+ uint16_t *l_627 = (void*)0;
+ uint16_t *l_628 = &l_542;
+ uint8_t l_629[8][8][2] = {{{248UL,248UL},{7UL,255UL},{254UL,0UL},{4UL,0UL},{247UL,4UL},{255UL,0x46L},{255UL,4UL},{247UL,0UL}},{{4UL,0UL},{254UL,255UL},{7UL,248UL},{248UL,6UL},{1UL,0x4EL},{0x5DL,0UL},{6UL,6UL},{0xAAL,254UL}},{{0x8AL,247UL},{6UL,0x5DL},{0x22L,249UL},{0xFBL,2UL},{6UL,0xFEL},{0x4EL,0xFEL},{6UL,2UL},{0xFBL,249UL}},{{0x22L,0x5DL},{6UL,247UL},{0x8AL,254UL},{0xAAL,6UL},{6UL,0UL},{0x5DL,0x4EL},{1UL,6UL},{248UL,248UL}},{{7UL,255UL},{254UL,0UL},{4UL,0UL},{247UL,4UL},{255UL,0x46L},{255UL,4UL},{247UL,0UL},{4UL,0UL}},{{254UL,255UL},{7UL,248UL},{248UL,6UL},{1UL,0x4EL},{0x5DL,0UL},{6UL,6UL},{0xAAL,254UL},{0x8AL,247UL}},{{6UL,0x5DL},{0x22L,249UL},{0xFBL,2UL},{6UL,0xFEL},{0x4EL,0xFEL},{6UL,2UL},{0xFBL,249UL},{0x22L,0x5DL}},{{6UL,247UL},{0x8AL,254UL},{0xAAL,6UL},{6UL,0UL},{0x5DL,0x4EL},{1UL,6UL},{248UL,248UL},{7UL,255UL}}};
+ const int32_t ** const *l_631 = (void*)0;
+ const int32_t ** const **l_630 = &l_631;
+ int32_t l_640 = 7L;
+ int32_t l_641 = (-1L);
+ int8_t l_642 = (-1L);
+ int32_t l_643 = (-1L);
+ int32_t l_644 = 0x8BDF11AEL;
+ int i, j, k;
+ if ((safe_rshift_func_int8_t_s_s(((safe_rshift_func_uint16_t_u_u((((l_605 | p_32) ^ (((l_606 , ((l_375 , ((safe_mul_func_int8_t_s_s((((safe_mul_func_uint16_t_u_u((g_477 , l_632), p_32)) && p_32) ^ p_32), p_32)) & p_32)) < l_633)) || (**g_486)) <= p_32)) < l_634), 9)) , l_635), 2)))
+ { /* block id: 249 */
+ int32_t *l_636 = &l_595[1];
+ int32_t *l_637 = &l_326;
+ int32_t *l_638[10][10] = {{&l_440,&l_300[2][2],&l_440,&l_441,&g_215,&l_595[1],&l_443,&g_53,&g_215,&g_215},{&l_300[2][2],&g_215,(void*)0,&l_595[2],&l_443,&g_53,&g_215,&g_55,&g_55,&g_215},{&l_440,(void*)0,&g_215,&g_215,(void*)0,&l_440,&g_55,&l_388,&l_443,(void*)0},{&l_595[1],&l_622,&g_55,&l_311,&l_388,(void*)0,&g_53,&g_52,&l_326,&l_441},{&l_595[1],&g_215,&l_441,&l_440,&l_300[2][2],&l_440,&l_441,&g_215,&l_595[1],&l_443},{&l_440,&l_441,&g_215,&l_595[1],&l_443,&g_53,&g_215,&g_215,&l_517,&g_52},{&l_311,&g_55,&l_622,&l_595[1],&l_517,&l_595[2],&l_595[2],&l_517,&l_595[1],&l_622},{&g_215,&g_215,(void*)0,&l_440,&g_55,&l_388,&l_443,(void*)0,&l_326,&l_289},{&l_441,(void*)0,&g_215,&l_311,&l_595[2],&l_326,&l_443,&l_440,&l_443,&l_326},{&l_289,&g_215,&l_311,&g_215,&l_289,&g_215,&l_595[2],&l_300[4][1],&g_55,(void*)0}};
+ int i, j;
+ ++l_645;
+ }
+ else
+ { /* block id: 251 */
+ uint16_t **l_649 = &g_351;
+ struct S0 l_652 = {1,-1595,1,-114,32,1,3,-572,3};
+ l_648 &= (*g_214);
+ (*l_496) = (*l_236);
+ l_656 = (p_32 , (((+(*l_495)) <= (((*l_649) = &g_72) != &g_72)) , ((((((--(**l_649)) , (((l_652 , (safe_sub_func_uint32_t_u_u((((*g_351) = (*g_351)) >= p_32), ((*l_495) = p_32)))) != (((*l_475) , (**g_486)) >= (**g_486))) | p_32)) > l_655) >= p_32) >= 3UL) & (*g_216))));
+ }
+ }
+ (*l_657) |= (*l_495);
+ }
+ return (**g_554);
+ }
+ (*g_86) = (safe_add_func_uint32_t_u_u(p_32, (safe_div_func_uint16_t_u_u(0UL, (l_471 , (((**l_236) | ((&g_24 != (l_665 = l_253)) ^ (**l_236))) && (*l_495)))))));
+ }
+ else
+ { /* block id: 267 */
+ int32_t *l_667 = &l_311;
+ const int8_t **l_779 = (void*)0;
+ int32_t ***l_783 = &l_236;
+ int32_t ****l_782 = &l_783;
+ for (g_52 = 0; (g_52 <= 1); g_52 += 1)
+ { /* block id: 270 */
+ int32_t *l_674 = &g_2;
+ int i;
+ if (g_312[g_52])
+ break;
+ (**l_236) = g_141[g_52];
+ l_667 = l_667;
+ (*l_674) ^= (!((~((safe_add_func_uint8_t_u_u(((safe_mul_func_uint16_t_u_u(((((*g_214) = ((**l_236) = (safe_sub_func_uint16_t_u_u(((~p_32) >= (*l_667)), (0xFCA0L || (*g_216)))))) < (p_32 || ((!9L) != (0xEAD7L || p_32)))) | 2UL), (*l_667))) | 0xD8E940E8L), 0UL)) < p_32)) | 3UL));
+ }
+ (*g_86) = (safe_mul_func_int8_t_s_s((((*g_487) = (0xEDL && 2UL)) >= ((void*)0 == &g_486)), p_32));
+ for (g_53 = 0; (g_53 <= 0); g_53 += 1)
+ { /* block id: 282 */
+ union U1 **l_690 = &l_476[0];
+ union U1 ***l_689 = &l_690;
+ int32_t l_697 = 5L;
+ int32_t l_698 = 0x4E770919L;
+ uint32_t **l_713[2];
+ int16_t l_728 = 0x06BDL;
+ struct S0 l_738[4] = {{-1,-28471,1,52,85,1,-3,153,2},{-1,-28471,1,52,85,1,-3,153,2},{-1,-28471,1,52,85,1,-3,153,2},{-1,-28471,1,52,85,1,-3,153,2}};
+ int16_t **l_739 = &g_216;
+ const int8_t *l_781 = (void*)0;
+ const int8_t **l_780 = &l_781;
+ int i;
+ for (i = 0; i < 2; i++)
+ l_713[i] = &l_233[2][1];
+ for (g_626 = 0; (g_626 <= 1); g_626 += 1)
+ { /* block id: 285 */
+ int32_t ***l_686 = &l_236;
+ int32_t **** const l_685[1][6][8] = {{{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686},{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686},{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686},{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686},{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686},{&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686,&l_686}}};
+ int8_t ***l_693 = (void*)0;
+ int8_t ***l_694 = (void*)0;
+ int8_t ***l_695[1];
+ uint32_t **l_715 = &g_252[0][3];
+ union U1 *l_722 = &g_477;
+ uint32_t * const *l_773 = (void*)0;
+ uint32_t * const **l_772[4];
+ int i, j, k;
+ for (i = 0; i < 1; i++)
+ l_695[i] = (void*)0;
+ for (i = 0; i < 4; i++)
+ l_772[i] = &l_773;
+ }
+ (**l_236) ^= ((safe_sub_func_uint32_t_u_u(((*l_775) = p_32), ((l_738[3] , l_779) == l_780))) , (0xC66D43EFL & ((1L && ((g_350[4][2].f4 , l_782) == g_784[1])) | 65535UL)));
+ if (g_55)
+ goto lbl_787;
+ }
+ }
+ return p_32;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_141 g_53 g_2 g_36 g_86 g_52 g_109 g_114 g_72 g_144 g_24 g_55 g_126 g_214 g_215
+ * writes: g_24 g_2 g_36 g_52 g_53 g_55 g_86 g_113 g_126 g_109.f3 g_114 g_141 g_143 g_144 g_72 g_194 g_215
+ */
+static int32_t * func_40(uint32_t p_41, int32_t * p_42, int16_t * p_43, int32_t p_44, uint32_t * p_45)
+{ /* block id: 97 */
+ uint32_t l_235 = 1UL;
+ (*g_214) |= ((func_46(g_141[1]) , l_235) , 0xCE81F14CL);
+ return p_45;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_24 g_53 g_2 g_36 g_86 g_52 g_109 g_114 g_72 g_144 g_55 g_126 g_141
+ * writes: g_24 g_2 g_36 g_52 g_53 g_55 g_86 g_113 g_126 g_109.f3 g_114 g_141 g_143 g_144 g_72 g_194
+ */
+static union U1 func_46(int8_t p_47)
+{ /* block id: 15 */
+ int32_t *l_50 = &g_2;
+ int32_t l_211[7][2][7] = {{{6L,(-5L),6L,(-5L),6L,(-5L),6L},{0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L}},{{0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L},{0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L}},{{6L,(-5L),6L,(-5L),6L,(-5L),6L},{0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L}},{{0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L},{0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L}},{{6L,(-5L),6L,(-5L),6L,(-5L),6L},{0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L}},{{0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L,(-5L),0x225E0FD6L},{0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L}},{{6L,(-5L),6L,(-5L),6L,(-5L),6L},{0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L,0xD1FBBA7CL,0xD1FBBA7CL,0xBCAAB667L,0xBCAAB667L}}};
+ union U1 l_212 = {0L};
+ int i, j, k;
+ l_211[2][1][3] &= func_48(l_50);
+ return l_212;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_24 g_53 g_2 g_36 g_86 g_52 g_109 g_114 g_72 g_144 g_55 g_126 g_141
+ * writes: g_24 g_2 g_36 g_52 g_53 g_55 g_86 g_113 g_126 g_109.f3 g_114 g_141 g_143 g_144 g_72 g_194
+ */
+static int32_t func_48(int32_t * p_49)
+{ /* block id: 16 */
+ uint32_t l_51[1];
+ uint16_t *l_193 = &g_72;
+ int8_t *l_195 = &g_143;
+ int16_t *l_207 = (void*)0;
+ int16_t *l_208 = &g_36;
+ int32_t l_209[7][1];
+ int32_t l_210 = 0xA774E767L;
+ int i, j;
+ for (i = 0; i < 1; i++)
+ l_51[i] = 2UL;
+ for (i = 0; i < 7; i++)
+ {
+ for (j = 0; j < 1; j++)
+ l_209[i][j] = 9L;
+ }
+ for (g_24 = 0; (g_24 <= 0); g_24 += 1)
+ { /* block id: 19 */
+ uint32_t l_57 = 4294967293UL;
+ int32_t l_85 = 0L;
+ for (g_2 = 0; (g_2 >= 0); g_2 -= 1)
+ { /* block id: 22 */
+ int32_t l_88[7];
+ const uint32_t l_173[9] = {0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L,0xBCAD55B1L};
+ int32_t l_183 = 0x181DA4DAL;
+ int i;
+ for (i = 0; i < 7; i++)
+ l_88[i] = 0xFA934127L;
+ for (g_36 = 0; (g_36 <= 0); g_36 += 1)
+ { /* block id: 25 */
+ uint32_t l_67 = 1UL;
+ int32_t l_73 = 0xAC9C4BD7L;
+ for (g_52 = 0; (g_52 >= 0); g_52 -= 1)
+ { /* block id: 28 */
+ uint8_t l_68 = 251UL;
+ for (g_53 = 0; g_53 < 1; g_53 += 1)
+ {
+ l_51[g_53] = 4294967287UL;
+ }
+ for (g_53 = 0; (g_53 >= 0); g_53 -= 1)
+ { /* block id: 32 */
+ int32_t *l_54 = &g_55;
+ int32_t *l_56 = &g_55;
+ int32_t **l_60[5][2][1] = {{{&l_54},{(void*)0}},{{&l_54},{(void*)0}},{{&l_54},{(void*)0}},{{&l_54},{(void*)0}},{{&l_54},{(void*)0}}};
+ uint16_t *l_71[4][9] = {{(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0},{(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0},{(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0},{(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0}};
+ int i, j, k;
+ l_57++;
+ if (l_51[g_53])
+ break;
+ p_49 = (void*)0;
+ (*l_54) = (safe_add_func_uint16_t_u_u(((safe_mod_func_uint16_t_u_u(0x021BL, (safe_lshift_func_int8_t_s_s((l_57 <= ((l_67 ^ (l_68 > (safe_lshift_func_uint16_t_u_s((l_73 = g_2), 10)))) == 0UL)), (safe_unary_minus_func_uint8_t_u((!l_67))))))) | l_68), (safe_add_func_uint32_t_u_u((safe_lshift_func_int16_t_s_u(g_36, 7)), 0L))));
+ }
+ l_85 &= (safe_mul_func_uint8_t_u_u((safe_sub_func_uint8_t_u_u((safe_lshift_func_uint8_t_u_u(l_68, 2)), l_67)), g_2));
+ for (g_53 = 0; (g_53 <= 0); g_53 += 1)
+ { /* block id: 42 */
+ return l_51[0];
+ }
+ }
+ for (l_67 = 0; (l_67 <= 0); l_67 += 1)
+ { /* block id: 48 */
+ const int16_t *l_87 = (void*)0;
+ int16_t l_172 = (-1L);
+ int32_t *l_174 = &l_85;
+ uint16_t *l_184[7] = {(void*)0,&g_72,(void*)0,(void*)0,&g_72,(void*)0,(void*)0};
+ int32_t *l_190 = &g_53;
+ int i;
+ g_86 = &g_2;
+ if ((~((&g_36 != l_87) <= (l_88[5] <= (safe_mod_func_int32_t_s_s((*g_86), ((*l_174) &= (((safe_mod_func_int32_t_s_s((safe_div_func_int32_t_s_s((((safe_sub_func_uint16_t_u_u(func_97(g_52), (((safe_mod_func_int16_t_s_s(l_88[3], (safe_mod_func_int16_t_s_s((safe_rshift_func_uint16_t_u_s(g_109.f6, (0L == g_109.f0))), l_51[0])))) , l_88[5]) | l_88[3]))) == l_88[5]) < l_172), (*g_86))), l_173[0])) <= (-1L)) , 1L))))))))
+ { /* block id: 75 */
+ (*l_174) = 0xA3D40197L;
+ return (*g_86);
+ }
+ else
+ { /* block id: 78 */
+ if (l_51[0])
+ break;
+ }
+ (*l_190) &= ((l_51[g_24] = (l_51[0] || ((~(l_51[0] || l_67)) > (safe_mod_func_uint16_t_u_u(0x7F8CL, (safe_div_func_int16_t_s_s((safe_lshift_func_uint16_t_u_u(((((((l_173[0] ^ (safe_mod_func_int16_t_s_s(g_55, (g_72 = l_183)))) || ((+(safe_mul_func_uint16_t_u_u((safe_lshift_func_uint16_t_u_s(l_73, 1)), (((safe_unary_minus_func_uint32_t_u(l_183)) != (-1L)) != l_51[0])))) ^ g_109.f4)) , g_109.f3) , g_126[2][2]) < 0x684FL) , l_51[0]), g_109.f2)), l_51[0]))))))) && (*l_174));
+ }
+ if (l_51[0])
+ continue;
+ return l_173[2];
+ }
+ }
+ }
+ l_210 &= (safe_add_func_uint32_t_u_u(((~(((((*l_195) = ((g_194[0] = l_193) == l_193)) >= (safe_sub_func_uint32_t_u_u(((((safe_unary_minus_func_uint16_t_u(((((safe_add_func_uint16_t_u_u((l_195 != ((*g_86) , l_195)), (safe_sub_func_int8_t_s_s((safe_rshift_func_int16_t_s_u((((8L < (l_51[0] > (~(((((safe_mul_func_int16_t_s_s(((*l_208) &= (-1L)), 0xAB67L)) > l_51[0]) != g_126[0][1]) , 0xBED7L) <= l_51[0])))) && (-5L)) & g_141[0]), g_109.f1)), g_126[2][0])))) > g_72) & 0UL) && 0L))) == 0x986FCF50L) > l_209[2][0]) < l_209[5][0]), l_51[0]))) , l_195) == l_195)) > 0x199EL), 0xF422AACBL));
+ return l_51[0];
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_109 g_114 g_72 g_53 g_52 g_86 g_2 g_144 g_24 g_36
+ * writes: g_113 g_126 g_109.f3 g_52 g_114 g_53 g_141 g_143 g_144 g_55
+ */
+static uint16_t func_97(uint32_t p_98)
+{ /* block id: 50 */
+ const struct S0 l_108[9][4] = {{{0,-21199,1,135,86,0,1,-402,3},{-1,23252,1,149,26,1,-4,-424,-2},{0,-21199,1,135,86,0,1,-402,3},{-0,-7293,0,111,28,1,7,-518,-3}},{{0,-21199,1,135,86,0,1,-402,3},{-0,-7293,0,111,28,1,7,-518,-3},{-0,-7293,0,111,28,1,7,-518,-3},{0,-21199,1,135,86,0,1,-402,3}},{{1,3929,0,-39,34,0,-6,-396,2},{-0,-7293,0,111,28,1,7,-518,-3},{-0,-26147,1,-163,61,0,7,427,2},{-0,-7293,0,111,28,1,7,-518,-3}},{{-0,-7293,0,111,28,1,7,-518,-3},{-1,23252,1,149,26,1,-4,-424,-2},{-0,-26147,1,-163,61,0,7,427,2},{-0,-26147,1,-163,61,0,7,427,2}},{{1,3929,0,-39,34,0,-6,-396,2},{1,3929,0,-39,34,0,-6,-396,2},{-0,-7293,0,111,28,1,7,-518,-3},{-0,-26147,1,-163,61,0,7,427,2}},{{0,-21199,1,135,86,0,1,-402,3},{-1,23252,1,149,26,1,-4,-424,-2},{0,-21199,1,135,86,0,1,-402,3},{-0,-7293,0,111,28,1,7,-518,-3}},{{0,-21199,1,135,86,0,1,-402,3},{-0,-7293,0,111,28,1,7,-518,-3},{-0,-7293,0,111,28,1,7,-518,-3},{0,-21199,1,135,86,0,1,-402,3}},{{1,3929,0,-39,34,0,-6,-396,2},{-0,-7293,0,111,28,1,7,-518,-3},{-0,-26147,1,-163,61,0,7,427,2},{-0,-7293,0,111,28,1,7,-518,-3}},{{-0,-7293,0,111,28,1,7,-518,-3},{-1,23252,1,149,26,1,-4,-424,-2},{-0,-26147,1,-163,61,0,7,427,2},{-0,-26147,1,-163,61,0,7,427,2}}};
+ const union U1 l_110[3][7][3] = {{{{0L},{0L},{0L}},{{0xE3L},{-1L},{-1L}},{{0L},{0L},{0x97L}},{{0xE3L},{7L},{0xE3L}},{{0L},{0L},{0x97L}},{{-9L},{-9L},{-1L}},{{0xB4L},{0L},{0L}}},{{{-1L},{7L},{0x16L}},{{0xB4L},{0L},{0xB4L}},{{-9L},{-1L},{0x16L}},{{0L},{0L},{0L}},{{0xE3L},{-1L},{-1L}},{{0L},{0L},{0x97L}},{{0xE3L},{7L},{0xE3L}}},{{{0L},{0L},{0x97L}},{{-9L},{-9L},{-1L}},{{0x97L},{0xB4L},{0xB4L}},{{0xE3L},{-9L},{7L}},{{0x97L},{0L},{0x97L}},{{-1L},{0xE3L},{7L}},{{0L},{0L},{0xB4L}}}};
+ int32_t *l_111 = (void*)0;
+ uint8_t *l_112 = &g_113;
+ int32_t **l_164 = &l_111;
+ uint32_t l_165 = 0xE251D069L;
+ int i, j, k;
+ (*l_164) = func_99(&g_24, func_104(l_108[1][0], ((l_108[1][0].f4 , g_109) , ((l_110[0][2][1] , (((void*)0 != l_111) <= ((l_110[0][2][1] , ((*l_112) = (p_98 > p_98))) ^ g_109.f5))) | 0x4A07L)), g_114), g_109.f6, g_109.f7);
+ return l_165;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_52 g_109.f1 g_109.f0 g_86 g_2 g_144 g_24 g_36 g_234
+ * writes: g_52 g_114 g_53 g_141 g_143 g_144 g_55
+ */
+static int32_t * func_99(uint32_t * const p_100, uint8_t p_101, uint8_t p_102, const int8_t p_103)
+{ /* block id: 57 */
+ uint8_t l_151[6][9][4] = {{{255UL,0x6EL,0x5DL,0xA6L},{1UL,0UL,0UL,1UL},{1UL,0xC0L,0x5DL,0xD0L},{255UL,1UL,0xFCL,0x27L},{0xA6L,6UL,0xA6L,0x27L},{0xFCL,1UL,255UL,0xD0L},{0x5DL,0xC0L,1UL,1UL},{0UL,0UL,1UL,0xA6L},{0x5DL,0x6EL,255UL,0xC0L}},{{0xFCL,255UL,0xA6L,255UL},{0xA6L,255UL,0xFCL,0xC0L},{255UL,0x6EL,0x5DL,0xA6L},{1UL,0UL,0UL,1UL},{1UL,0xC0L,0x5DL,0xD0L},{255UL,1UL,0xFCL,0x27L},{0xA6L,6UL,0xA6L,0x27L},{0xFCL,1UL,255UL,0xD0L},{0x5DL,0xC0L,1UL,1UL}},{{0UL,0UL,1UL,0xA6L},{0x5DL,0x6EL,255UL,0xC0L},{0xFCL,255UL,0xA6L,255UL},{0xA6L,255UL,0xFCL,0xC0L},{255UL,0x6EL,0x5DL,0xA6L},{1UL,0UL,0UL,1UL},{1UL,0xC0L,0x5DL,0xD0L},{255UL,1UL,0xFCL,0x27L},{0xA6L,6UL,0xA6L,0x27L}},{{0xFCL,1UL,255UL,0xD0L},{0x5DL,0xC0L,1UL,1UL},{0UL,0UL,1UL,0xA6L},{0x5DL,0x6EL,255UL,0xC0L},{0xFCL,255UL,0xA6L,255UL},{0xA6L,255UL,0xFCL,0xC0L},{255UL,0x6EL,0x5DL,0xA6L},{1UL,0UL,0UL,1UL},{1UL,0xC0L,0x5DL,0xD0L}},{{255UL,1UL,0xFCL,0x27L},{0xA6L,6UL,0xA6L,0x27L},{0xFCL,1UL,255UL,0xD0L},{0x5DL,0xC0L,1UL,1UL},{0UL,0UL,1UL,0xA6L},{0x5DL,0x6EL,255UL,0xC0L},{0xFCL,255UL,0xA6L,255UL},{0xA6L,255UL,0xFCL,0xC0L},{6UL,0xFCL,0xA6L,0xC0L}},{{0UL,0x27L,0x27L,0UL},{0UL,1UL,0xA6L,0x6EL},{6UL,0UL,0x5DL,255UL},{0xC0L,0xD0L,0xC0L,255UL},{0x5DL,0UL,6UL,0x6EL},{0xA6L,1UL,0UL,0UL},{0x27L,0x27L,0UL,0xC0L},{0xA6L,0xFCL,6UL,1UL},{0x5DL,6UL,0xC0L,6UL}}};
+ int32_t *l_155 = &g_55;
+ int32_t l_156 = 0x20075B0AL;
+ int32_t *l_157 = (void*)0;
+ int32_t *l_158 = &g_52;
+ int32_t *l_159 = (void*)0;
+ uint16_t l_160 = 0xAE7EL;
+ int32_t *l_163 = (void*)0;
+ int i, j, k;
+ for (g_52 = 0; (g_52 < 13); g_52 = safe_add_func_int8_t_s_s(g_52, 1))
+ { /* block id: 60 */
+ int16_t l_132[8] = {0x8A8DL,0x8A8DL,1L,0x8A8DL,0x8A8DL,1L,0x8A8DL,0x8A8DL};
+ uint8_t *l_135[2][9] = {{&g_114,(void*)0,&g_113,&g_113,&g_113,(void*)0,&g_114,&g_114,(void*)0},{&g_113,(void*)0,&g_114,(void*)0,&g_113,(void*)0,(void*)0,&g_113,(void*)0}};
+ int32_t *l_136 = &g_53;
+ int32_t **l_137 = &l_136;
+ uint32_t *l_138 = (void*)0;
+ uint32_t *l_139 = (void*)0;
+ uint32_t *l_140 = &g_141[1];
+ int8_t *l_142 = &g_143;
+ int32_t *l_152 = &g_55;
+ int32_t **l_153 = (void*)0;
+ int32_t **l_154[5][5] = {{&l_152,&l_136,&l_152,&g_86,&g_86},{&l_152,&l_152,&g_86,&l_152,&l_152},{&l_152,&l_152,&l_136,&l_152,&l_136},{&l_136,&l_136,&g_86,&l_152,&l_152},{&l_152,&l_152,&l_152,&l_152,&l_136}};
+ int i, j;
+ (*l_136) = (l_132[7] | (g_114 = (safe_div_func_int8_t_s_s(l_132[7], g_109.f1))));
+ (*l_137) = p_100;
+ (*l_152) = (0x47L != ((g_109.f0 >= ((*l_142) = (((*l_140) = ((void*)0 != &g_114)) >= (*g_86)))) > ((0xACL >= (g_144 |= 7L)) | (((safe_rshift_func_int16_t_s_s((((safe_rshift_func_int16_t_s_u(0x722AL, ((safe_add_func_uint8_t_u_u(((*g_86) != (*p_100)), l_151[4][2][3])) || l_151[5][1][2]))) & (*g_86)) == p_102), 6)) , g_36) ^ l_151[4][2][3]))));
+ l_155 = p_100;
+ }
+ l_160++;
+ return l_163;
+}
+
+
+/* ------------------------------------------ */
+/*
+ * reads : g_72 g_53 g_109.f6 g_52 g_109.f3
+ * writes: g_126 g_109.f3
+ */
+static uint8_t func_104(const struct S0 p_105, int16_t p_106, int32_t p_107)
+{ /* block id: 52 */
+ uint8_t l_121 = 0xD5L;
+ uint32_t l_124[7];
+ int16_t *l_125 = &g_126[2][2];
+ int32_t *l_127[9][9] = {{&g_53,&g_52,(void*)0,&g_52,&g_53,&g_55,&g_52,(void*)0,(void*)0},{&g_2,&g_2,(void*)0,&g_2,(void*)0,&g_2,&g_2,&g_53,&g_2},{&g_2,&g_53,&g_52,&g_55,&g_52,&g_55,&g_52,&g_53,&g_2},{&g_2,&g_52,(void*)0,&g_53,&g_55,(void*)0,&g_55,&g_53,(void*)0},{&g_52,&g_52,&g_55,(void*)0,&g_53,(void*)0,&g_2,(void*)0,&g_53},{&g_2,&g_55,&g_55,&g_2,&g_2,&g_2,&g_2,(void*)0,&g_2},{&g_2,&g_55,&g_55,&g_55,&g_55,&g_2,&g_52,&g_52,&g_53},{&g_2,&g_2,(void*)0,&g_2,&g_2,(void*)0,&g_2,&g_2,&g_52},{&g_53,&g_55,&g_52,&g_52,&g_53,&g_53,&g_52,&g_52,&g_55}};
+ int32_t *l_128[3];
+ int16_t l_129 = (-1L);
+ int i, j;
+ for (i = 0; i < 7; i++)
+ l_124[i] = 18446744073709551615UL;
+ for (i = 0; i < 3; i++)
+ l_128[i] = &g_52;
+ g_109.f3 |= (safe_add_func_uint16_t_u_u((((((safe_div_func_uint16_t_u_u((safe_mod_func_int8_t_s_s((((((p_105.f0 <= (l_121 ^ p_106)) > (~(((*l_125) = (p_105.f5 <= (safe_rshift_func_int8_t_s_u(l_124[0], 0)))) > (((l_124[0] && l_124[2]) != ((l_128[2] = l_127[6][6]) == (void*)0)) & p_105.f5)))) >= 0xF23EL) < g_72) | 0L), p_107)), (-8L))) | g_53) , g_109.f6) | p_105.f8) , 0xEFFEL), g_52));
+ return l_129;
+}
+
+
+
+
+/* ---------------------------------------- */
+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_24, "g_24", print_hash_value);
+ transparent_crc(g_36, "g_36", print_hash_value);
+ transparent_crc(g_52, "g_52", print_hash_value);
+ transparent_crc(g_53, "g_53", print_hash_value);
+ transparent_crc(g_55, "g_55", print_hash_value);
+ transparent_crc(g_72, "g_72", print_hash_value);
+ transparent_crc(g_109.f0, "g_109.f0", print_hash_value);
+ transparent_crc(g_109.f1, "g_109.f1", print_hash_value);
+ transparent_crc(g_109.f2, "g_109.f2", print_hash_value);
+ transparent_crc(g_109.f3, "g_109.f3", print_hash_value);
+ transparent_crc(g_109.f4, "g_109.f4", print_hash_value);
+ transparent_crc(g_109.f5, "g_109.f5", print_hash_value);
+ transparent_crc(g_109.f6, "g_109.f6", print_hash_value);
+ transparent_crc(g_109.f7, "g_109.f7", print_hash_value);
+ transparent_crc(g_109.f8, "g_109.f8", print_hash_value);
+ transparent_crc(g_113, "g_113", print_hash_value);
+ transparent_crc(g_114, "g_114", print_hash_value);
+ for (i = 0; i < 4; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ transparent_crc(g_126[i][j], "g_126[i][j]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ for (i = 0; i < 2; i++)
+ {
+ transparent_crc(g_141[i], "g_141[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_143, "g_143", print_hash_value);
+ transparent_crc(g_144, "g_144", print_hash_value);
+ transparent_crc(g_215, "g_215", print_hash_value);
+ transparent_crc(g_217, "g_217", print_hash_value);
+ for (i = 0; i < 6; i++)
+ {
+ for (j = 0; j < 6; j++)
+ {
+ for (k = 0; k < 7; k++)
+ {
+ transparent_crc(g_234[i][j][k], "g_234[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ for (i = 0; i < 2; i++)
+ {
+ transparent_crc(g_312[i], "g_312[i]", print_hash_value);
+ if (print_hash_value) printf("index = [%d]\n", i);
+
+ }
+ transparent_crc(g_331.f0, "g_331.f0", print_hash_value);
+ for (i = 0; i < 9; i++)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ transparent_crc(g_350[i][j].f0, "g_350[i][j].f0", print_hash_value);
+ transparent_crc(g_350[i][j].f1, "g_350[i][j].f1", print_hash_value);
+ transparent_crc(g_350[i][j].f2, "g_350[i][j].f2", print_hash_value);
+ transparent_crc(g_350[i][j].f3, "g_350[i][j].f3", print_hash_value);
+ transparent_crc(g_350[i][j].f4, "g_350[i][j].f4", print_hash_value);
+ transparent_crc(g_350[i][j].f5, "g_350[i][j].f5", print_hash_value);
+ transparent_crc(g_350[i][j].f6, "g_350[i][j].f6", print_hash_value);
+ transparent_crc(g_350[i][j].f7, "g_350[i][j].f7", print_hash_value);
+ transparent_crc(g_350[i][j].f8, "g_350[i][j].f8", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d]\n", i, j);
+
+ }
+ }
+ transparent_crc(g_408, "g_408", print_hash_value);
+ transparent_crc(g_477.f0, "g_477.f0", print_hash_value);
+ transparent_crc(g_493, "g_493", print_hash_value);
+ transparent_crc(g_543, "g_543", print_hash_value);
+ transparent_crc(g_626, "g_626", print_hash_value);
+ transparent_crc(g_664, "g_664", print_hash_value);
+ for (i = 0; i < 1; i++)
+ {
+ for (j = 0; j < 9; j++)
+ {
+ for (k = 0; k < 4; k++)
+ {
+ transparent_crc(g_666[i][j][k], "g_666[i][j][k]", print_hash_value);
+ if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k);
+
+ }
+ }
+ }
+ transparent_crc(g_733, "g_733", print_hash_value);
+ transparent_crc(g_776, "g_776", print_hash_value);
+ transparent_crc(g_807, "g_807", print_hash_value);
+ transparent_crc(g_812, "g_812", print_hash_value);
+ transparent_crc(g_824.f0, "g_824.f0", print_hash_value);
+ transparent_crc(g_825, "g_825", print_hash_value);
+ transparent_crc(g_891, "g_891", print_hash_value);
+ transparent_crc(g_1058, "g_1058", print_hash_value);
+ transparent_crc(g_1177.f0, "g_1177.f0", print_hash_value);
+ platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value);
+ return 0;
+}
+
+/************************ statistics *************************
+XXX max struct depth: 1
+breakdown:
+ depth: 0, occurrence: 261
+ depth: 1, occurrence: 12
+XXX total union variables: 7
+
+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: 13
+breakdown:
+ indirect level: 0, occurrence: 12
+ indirect level: 1, occurrence: 1
+XXX full-bitfields structs in the program: 12
+breakdown:
+ indirect level: 0, occurrence: 12
+XXX times a bitfields struct's address is taken: 3
+XXX times a bitfields struct on LHS: 0
+XXX times a bitfields struct on RHS: 25
+XXX times a single bitfield on LHS: 5
+XXX times a single bitfield on RHS: 59
+
+XXX max expression depth: 51
+breakdown:
+ depth: 1, occurrence: 185
+ depth: 2, occurrence: 44
+ depth: 3, occurrence: 2
+ depth: 4, occurrence: 3
+ depth: 5, occurrence: 5
+ depth: 6, occurrence: 3
+ depth: 7, occurrence: 3
+ depth: 9, occurrence: 1
+ depth: 11, occurrence: 1
+ depth: 13, occurrence: 4
+ depth: 14, occurrence: 1
+ depth: 16, occurrence: 1
+ depth: 17, occurrence: 2
+ depth: 18, occurrence: 7
+ depth: 19, occurrence: 1
+ depth: 20, occurrence: 4
+ depth: 21, occurrence: 2
+ depth: 22, occurrence: 4
+ depth: 23, occurrence: 4
+ depth: 24, occurrence: 2
+ depth: 25, occurrence: 2
+ depth: 26, occurrence: 3
+ depth: 27, occurrence: 1
+ depth: 31, occurrence: 2
+ depth: 32, occurrence: 1
+ depth: 33, occurrence: 2
+ depth: 34, occurrence: 1
+ depth: 39, occurrence: 1
+ depth: 51, occurrence: 1
+
+XXX total number of pointers: 243
+
+XXX times a variable address is taken: 502
+XXX times a pointer is dereferenced on RHS: 249
+breakdown:
+ depth: 1, occurrence: 194
+ depth: 2, occurrence: 53
+ depth: 3, occurrence: 2
+XXX times a pointer is dereferenced on LHS: 190
+breakdown:
+ depth: 1, occurrence: 170
+ depth: 2, occurrence: 19
+ depth: 3, occurrence: 1
+XXX times a pointer is compared with null: 15
+XXX times a pointer is compared with address of another variable: 3
+XXX times a pointer is compared with another pointer: 9
+XXX times a pointer is qualified to be dereferenced: 3325
+
+XXX max dereference level: 4
+breakdown:
+ level: 0, occurrence: 0
+ level: 1, occurrence: 943
+ level: 2, occurrence: 212
+ level: 3, occurrence: 39
+ level: 4, occurrence: 2
+XXX number of pointers point to pointers: 94
+XXX number of pointers point to scalars: 139
+XXX number of pointers point to structs: 1
+XXX percent of pointers has null in alias set: 29.6
+XXX average alias set size: 1.43
+
+XXX times a non-volatile is read: 1247
+XXX times a non-volatile is write: 551
+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: 3
+
+XXX stmts: 190
+XXX max block depth: 5
+breakdown:
+ depth: 0, occurrence: 27
+ depth: 1, occurrence: 24
+ depth: 2, occurrence: 29
+ depth: 3, occurrence: 38
+ depth: 4, occurrence: 37
+ depth: 5, occurrence: 35
+
+XXX percentage a fresh-made variable is used: 15.1
+XXX percentage an existing variable is used: 84.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/9.c.txt b/tests/fuzz/9.c.txt
new file mode 100644
index 00000000..b551cc19
--- /dev/null
+++ b/tests/fuzz/9.c.txt
@@ -0,0 +1 @@
+checksum = F61662D3
diff --git a/tests/fuzz/creduce_tester.py b/tests/fuzz/creduce_tester.py
index d5618c2e..6bf9473f 100755
--- a/tests/fuzz/creduce_tester.py
+++ b/tests/fuzz/creduce_tester.py
@@ -34,7 +34,7 @@ except Exception, e:
print '4) Compile JS-ly and compare'
def try_js(args):
- shared.check_execute([shared.EMCC] + EMCC_ARGS + CSMITH_CFLAGS + args +
+ shared.check_execute([shared.PYTHON, shared.EMCC] + EMCC_ARGS + CSMITH_CFLAGS + args +
[filename, '-o', js_filename])
js = shared.run_js(js_filename, stderr=PIPE, engine=ENGINE)
assert correct == js
diff --git a/tests/fuzz/csmith_driver.py b/tests/fuzz/csmith_driver.py
index 90c7df2e..a4f506b8 100755
--- a/tests/fuzz/csmith_driver.py
+++ b/tests/fuzz/csmith_driver.py
@@ -14,7 +14,7 @@ sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.pat
import shared
engine1 = eval('shared.' + sys.argv[1]) if len(sys.argv) > 1 else shared.JS_ENGINES[0]
-engine2 = eval('shared.' + sys.argv[2]) if len(sys.argv) > 2 else None
+engine2 = shared.SPIDERMONKEY_ENGINE if os.path.exists(shared.SPIDERMONKEY_ENGINE[0]) else None
print 'testing js engines', engine1, engine2
@@ -35,26 +35,47 @@ notes = { 'invalid': 0, 'unaligned': 0, 'embug': 0 }
fails = 0
while 1:
- opts = '-O' + str(random.randint(0, 2))
+ if random.random() < 0.666:
+ opts = '-O' + str(random.randint(0, 3))
+ else:
+ if random.random() < 0.5:
+ opts = '-Os'
+ else:
+ opts = '-Oz'
print 'opt level:', opts
print 'Tried %d, notes: %s' % (tried, notes)
- print '1) Generate C'
- check_call([CSMITH, '--no-volatiles', '--no-packed-struct'],# '--no-math64'
+ print '1) Generate source'
+ extra_args = []
+ if random.random() < 0.5: extra_args += ['--no-math64']
+ suffix = '.c'
+ COMP = shared.CLANG_CC
+ if random.random() < 0.5:
+ extra_args += ['--lang-cpp']
+ suffix += 'pp'
+ COMP = shared.CLANG
+ print COMP, extra_args
+ fullname = filename + suffix
+ check_call([CSMITH, '--no-volatiles', '--no-packed-struct'] + extra_args,
#['--max-block-depth', '2', '--max-block-size', '2', '--max-expr-complexity', '2', '--max-funcs', '2'],
- stdout=open(filename + '.c', 'w'))
- #shutil.copyfile(filename + '.c', 'testcase%d.c' % tried)
- print '1) Generate C... %.2f K of C source' % (len(open(filename + '.c').read())/1024.)
+ stdout=open(fullname, 'w'))
+ print '1) Generate source... %.2f K' % (len(open(fullname).read())/1024.)
tried += 1
print '2) Compile natively'
shared.try_delete(filename)
- shared.check_execute([shared.CLANG_CC, opts, filename + '.c', '-o', filename + '1'] + CSMITH_CFLAGS) # + shared.EMSDK_OPTS
- shared.check_execute([shared.CLANG_CC, opts, '-emit-llvm', '-c', '-Xclang', '-triple=i386-pc-linux-gnu', filename + '.c', '-o', filename + '.bc'] + CSMITH_CFLAGS + shared.EMSDK_OPTS)
+ try:
+ shared.check_execute([COMP, opts, fullname, '-o', filename + '1'] + CSMITH_CFLAGS + ['-w']) # + shared.EMSDK_OPTS
+ except Exception, e:
+ print 'Failed to compile natively using clang'
+ notes['invalid'] += 1
+ continue
+
+ shared.check_execute([COMP, opts, '-emit-llvm', '-c', '-Xclang', '-triple=i386-pc-linux-gnu', fullname, '-o', filename + '.bc'] + CSMITH_CFLAGS + shared.EMSDK_OPTS)
shared.check_execute([shared.path_from_root('tools', 'nativize_llvm.py'), filename + '.bc'])
shutil.move(filename + '.bc.run', filename + '2')
- shared.check_execute([shared.CLANG_CC, filename + '.c', '-o', filename + '3'] + CSMITH_CFLAGS)
+ shared.check_execute([COMP, fullname, '-o', filename + '3'] + CSMITH_CFLAGS)
print '3) Run natively'
try:
correct1 = shared.jsrun.timeout_run(Popen([filename + '1'], stdout=PIPE, stderr=PIPE), 3)
@@ -74,7 +95,7 @@ while 1:
def try_js(args):
shared.try_delete(filename + '.js')
print '(compile)'
- shared.check_execute([shared.EMCC, opts, filename + '.c', '-o', filename + '.js'] + CSMITH_CFLAGS + args)
+ shared.check_execute([shared.PYTHON, shared.EMCC, opts, fullname, '-o', filename + '.js'] + CSMITH_CFLAGS + args)
assert os.path.exists(filename + '.js')
print '(run)'
js = shared.run_js(filename + '.js', stderr=PIPE, engine=engine1, check_timeout=True)
@@ -100,7 +121,7 @@ while 1:
print "EMSCRIPTEN BUG"
notes['embug'] += 1
fails += 1
- shutil.copyfile(filename + '.c', 'newfail%d.c' % fails)
+ shutil.copyfile(fullname, 'newfail%d%s' % (fails, suffix))
continue
#if not ok:
# try: # finally, try with safe heap. if that is triggered, this is nonportable code almost certainly
@@ -115,7 +136,7 @@ while 1:
# break
# This is ok. Try in secondary JS engine too
- if engine2 and normal:
+ if opts != '-O0' and engine2 and normal:
try:
js2 = shared.run_js(filename + '.js', stderr=PIPE, engine=engine2, full_output=True, check_timeout=True)
except:
@@ -127,11 +148,7 @@ while 1:
print "ODIN VALIDATION BUG"
notes['embug'] += 1
fails += 1
- shutil.copyfile(filename + '.c', 'newfail%d.c' % fails)
+ shutil.copyfile(fullname, 'newfail%d.c' % fails)
continue
-
- js2 = js2.replace('\nwarning: Successfully compiled asm.js code\n', '')
-
- 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'
+ print '[asm.js validation ok]'
diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh
index 166d4bab..9099f5e9 100755
--- a/tests/fuzz/test.sh
+++ b/tests/fuzz/test.sh
@@ -3,13 +3,15 @@
# to find failures, then check those out with this script
echo "builds"
+rm *.out *.bc *.js
gcc $@ -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null
/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null
/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o
-~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null
-#~/Dev/emscripten/emcc $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null
-#~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null
-EMCC_FAST_COMPILER=1 ~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null
+EMCC_FAST_COMPILER=0 ~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null
+EMCC_FAST_COMPILER=0~/Dev/emscripten/emcc $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null
+EMCC_FAST_COMPILER=0~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null
+~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null
+~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null
echo "run n1"
./n1.out &> n1
echo "run n2"
@@ -19,11 +21,13 @@ echo "run bc"
echo "run js"
mozjs js.out.js &> js
echo "run ua"
-#mozjs ua.out.js &> ua
+mozjs ua.out.js &> ua
echo "run sh"
-#mozjs sh.out.js &> sh
+mozjs sh.out.js &> sh
echo "run fc"
mozjs fc.out.js &> fc
+echo "run fc-sh"
+mozjs fc-sh.out.js &> fc-sh
echo "n/n"
diff n1 n2
echo "n/bc"
@@ -31,9 +35,17 @@ diff n1 bc
echo "n/js"
diff n1 js | grep -v warning
echo "n/js-ua"
-#diff n1 ua | grep -v warning
+diff n1 ua | grep -v warning
echo "n/js-sh"
-#diff n1 sh | grep -v warning
-echo "js/js"
-diff js fc | grep -v warning
+diff n1 sh | grep -v warning
+echo "js/fc"
+diff fc js | grep -v warning
+echo "js/fc-sh"
+diff fc-sh js | grep -v warning
+echo "native/fc"
+grep -v warning fc > fclean
+diff n1 fclean | grep -v warning
+echo "native2/fc"
+grep -v warning fc > fclean
+diff n2 fclean | grep -v warning
diff --git a/tests/fuzz/testpp.sh b/tests/fuzz/testpp.sh
new file mode 100755
index 00000000..3f060693
--- /dev/null
+++ b/tests/fuzz/testpp.sh
@@ -0,0 +1,51 @@
+# e.g.
+# ~/Dev/emscripten/tests/fuzz$ CSMITH=~/Dev/csmith/src/csmith CSMITH_PATH=~/Dev/csmith python ./csmith_driver.py
+# to find failures, then check those out with this script
+
+echo "builds"
+rm *.out *.bc *.js
+g++ $@ -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null
+/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null
+/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o
+EMCC_FAST_COMPILER=0~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null
+EMCC_FAST_COMPILER=0~/Dev/emscripten/em++ $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null
+EMCC_FAST_COMPILER=0~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null
+~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null
+~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null
+echo "run n1"
+./n1.out &> n1
+echo "run n2"
+./n2.out &> n2
+echo "run bc"
+/home/alon/Dev/fastcomp/build/Release/bin/lli bc.bc &> bc
+echo "run js"
+mozjs js.out.js &> js
+echo "run ua"
+mozjs ua.out.js &> ua
+echo "run sh"
+mozjs sh.out.js &> sh
+echo "run fc"
+mozjs fc.out.js &> fc
+echo "run fc-sh"
+mozjs fc-sh.out.js &> fc-sh
+echo "n/n"
+diff n1 n2
+echo "n/bc"
+diff n1 bc
+echo "n/js"
+diff n1 js | grep -v warning
+echo "n/js-ua"
+diff n1 ua | grep -v warning
+echo "n/js-sh"
+diff n1 sh | grep -v warning
+echo "js/fc"
+diff fc js | grep -v warning
+echo "js/fc-sh"
+diff fc-sh js | grep -v warning
+echo "native/fc"
+grep -v warning fc > fclean
+diff n1 fclean | grep -v warning
+echo "native2/fc"
+grep -v warning fc > fclean
+diff n2 fclean | grep -v warning
+
diff --git a/tests/gl_matrix_identity.c b/tests/gl_matrix_identity.c
index 9f990a77..8ca7d0cb 100644
--- a/tests/gl_matrix_identity.c
+++ b/tests/gl_matrix_identity.c
@@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -38,7 +38,7 @@ void verify() {
for (int x = 0; x < width*height*4; x++) {
if (x % 4 != 3) sum += x * data[x];
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
int result = sum;
REPORT_RESULT();
#endif
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
verify();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(1500);
#endif
diff --git a/tests/gl_ps.c b/tests/gl_ps.c
index 4fa79922..d9f3b079 100644
--- a/tests/gl_ps.c
+++ b/tests/gl_ps.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -219,7 +219,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_ps_packed.c b/tests/gl_ps_packed.c
index 9ab99cb8..be139cd9 100644
--- a/tests/gl_ps_packed.c
+++ b/tests/gl_ps_packed.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_ps_strides.c b/tests/gl_ps_strides.c
index d88f5d0b..1ff28c94 100644
--- a/tests/gl_ps_strides.c
+++ b/tests/gl_ps_strides.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_renderers.c b/tests/gl_renderers.c
index 0a8e6e78..ca6e828e 100644
--- a/tests/gl_renderers.c
+++ b/tests/gl_renderers.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 0
#endif
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -180,7 +180,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_stride.c b/tests/gl_stride.c
index c254ad5a..d6cf1fd2 100644
--- a/tests/gl_stride.c
+++ b/tests/gl_stride.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 0
#endif
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_vertex_buffer.c b/tests/gl_vertex_buffer.c
index 6b695462..73c30d48 100644
--- a/tests/gl_vertex_buffer.c
+++ b/tests/gl_vertex_buffer.c
@@ -22,7 +22,7 @@
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 0
#endif
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/gl_vertex_buffer_pre.c b/tests/gl_vertex_buffer_pre.c
index 84b76569..fb967d11 100644
--- a/tests/gl_vertex_buffer_pre.c
+++ b/tests/gl_vertex_buffer_pre.c
@@ -22,7 +22,7 @@
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 0
#endif
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -166,7 +166,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/glbegin_points.c b/tests/glbegin_points.c
index 9128a4f5..ae061bb2 100644
--- a/tests/glbegin_points.c
+++ b/tests/glbegin_points.c
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#if !defined(__EMSCRIPTEN__)
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/glgettexenv.c b/tests/glgettexenv.c
new file mode 100644
index 00000000..54bf2af8
--- /dev/null
+++ b/tests/glgettexenv.c
@@ -0,0 +1,71 @@
+/*
+THIS WORK, INCLUDING THE SOURCE CODE, DOCUMENTATION
+AND RELATED MEDIA AND DATA, IS PLACED INTO THE PUBLIC DOMAIN.
+
+THE ORIGINAL AUTHOR IS KYLE FOLEY.
+
+THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY
+OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF
+MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE,
+ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE
+RESULTING FROM THE USE, MODIFICATION, OR
+REDISTRIBUTION OF THIS SOFTWARE.
+*/
+
+#ifndef __EMSCRIPTEN__
+#define USE_GLEW 1
+#endif
+
+#if USE_GLEW
+#include "GL/glew.h"
+#endif
+
+#include "SDL/SDL.h"
+#if !USE_GLEW
+#include "SDL/SDL_opengl.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+int main(int argc, char *argv[])
+{
+ SDL_Surface *screen;
+ if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
+ printf("Unable to initialize SDL: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+ screen = SDL_SetVideoMode( 640, 480, 24, SDL_OPENGL );
+ if ( !screen ) {
+ printf("Unable to set video mode: %s\n", SDL_GetError());
+ return 1;
+ }
+
+ GLint value = 0;
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
+ glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &value);
+ assert(value == GL_BLEND);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, &value);
+ assert(value == GL_MODULATE);
+
+ GLfloat colora[4] = { 0.2f, 0.3f, 0.4f, 0.5f };
+ GLfloat colorb[4] = {};
+ glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, colora);
+ glGetTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, colorb);
+ printf("%f %f %f %f\n", colorb[0], colorb[1], colorb[2], colorb[3]);
+ assert(colora[0] == colorb[0]);
+ assert(colora[1] == colorb[1]);
+ assert(colora[2] == colorb[2]);
+ assert(colora[3] == colorb[3]);
+ SDL_Quit();
+
+#ifdef REPORT_RESULT
+ int result = 1;
+ REPORT_RESULT();
+#endif
+ return 0;
+}
diff --git a/tests/hello_world.ll b/tests/hello_world.ll
index adeac7eb..343805a0 100644
--- a/tests/hello_world.ll
+++ b/tests/hello_world.ll
@@ -1,6 +1,6 @@
; 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"
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
+target triple = "asmjs-unknown-emscripten"
@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
diff --git a/tests/hello_world_gles_deriv.c b/tests/hello_world_gles_deriv.c
index c5354d4e..592078ed 100644
--- a/tests/hello_world_gles_deriv.c
+++ b/tests/hello_world_gles_deriv.c
@@ -645,6 +645,7 @@ static const char vertex_shader[] =
static const char fragment_shader[] =
"#ifdef GL_ES\n"
+"#extension GL_OES_standard_derivatives : enable\n"
"precision mediump float;\n"
"#endif\n"
"varying vec4 Color;\n"
diff --git a/tests/module/test_stdin.c b/tests/module/test_stdin.c
index 4838d466..2772fcf0 100644
--- a/tests/module/test_stdin.c
+++ b/tests/module/test_stdin.c
@@ -3,13 +3,13 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
int line = 0;
-void main_loop(void *arg)
+void main_loop()
{
char str[10] = {0};
int ret;
@@ -46,12 +46,12 @@ int main(int argc, char const *argv[])
// SM shell doesn't implement an event loop and therefor doesn't support
// emscripten_set_main_loop. However, its stdin reads are sync so it
// should exit out after calling main_loop once.
- main_loop(NULL);
+ main_loop();
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL); sleep(1);
+ while (1) main_loop(); sleep(1);
#endif
return 0;
-} \ No newline at end of file
+}
diff --git a/tests/nbody-java/native_java_lang_String.c b/tests/nbody-java/native_java_lang_String.c
index 5ccf21df..c55e5412 100644
--- a/tests/nbody-java/native_java_lang_String.c
+++ b/tests/nbody-java/native_java_lang_String.c
@@ -10,7 +10,7 @@
JAVA_INT java_lang_String_toLowerCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1)
{
//XMLVM_BEGIN_NATIVE[java_lang_String_toLowerCaseImpl___int]
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
return tolower(n1);
#else
return towlower(n1);
@@ -21,7 +21,7 @@ JAVA_INT java_lang_String_toLowerCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1)
JAVA_INT java_lang_String_toUpperCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1)
{
//XMLVM_BEGIN_NATIVE[java_lang_String_toUpperCaseImpl___int]
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
return toupper(n1);
#else
return towupper(n1);
diff --git a/tests/nbody-java/native_java_lang_System.c b/tests/nbody-java/native_java_lang_System.c
index 861781ca..201f8beb 100644
--- a/tests/nbody-java/native_java_lang_System.c
+++ b/tests/nbody-java/native_java_lang_System.c
@@ -97,7 +97,7 @@ JAVA_OBJECT java_lang_System_getEncoding___int(JAVA_INT n1)
{
//XMLVM_BEGIN_NATIVE[java_lang_System_getEncoding___int]
//Get charset from the OS
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
return xmlvm_create_java_string("UTF-8");
#else
char charset[CHARSETBUFF];
diff --git a/tests/nbody-java/xmlvm.c b/tests/nbody-java/xmlvm.c
index 35e04d16..dedf1bc6 100644
--- a/tests/nbody-java/xmlvm.c
+++ b/tests/nbody-java/xmlvm.c
@@ -102,7 +102,7 @@ void xmlvm_init()
xmlvm_clear_constant_pool_cache();
#ifndef XMLVM_NO_GC
-#ifndef EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
GC_finalize_on_demand = 1;
GC_java_finalization = 1;
java_lang_Thread* finalizerThread = (java_lang_Thread*) org_xmlvm_runtime_FinalizerNotifier_startFinalizerThread__();
@@ -115,7 +115,7 @@ void xmlvm_init()
void xmlvm_destroy(java_lang_Thread* mainThread)
{
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
return; // Let the JS engine handle clean up
#endif
diff --git a/tests/nbody-java/xmlvm.h b/tests/nbody-java/xmlvm.h
index 0d931565..04f645db 100644
--- a/tests/nbody-java/xmlvm.h
+++ b/tests/nbody-java/xmlvm.h
@@ -22,7 +22,7 @@
#ifndef __XMLVM_H__
#define __XMLVM_H__
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
// Workaround definitions for Emscripten
// TODO: Determine if different solution is needed
diff --git a/tests/netinet/in.cpp b/tests/netinet/in.cpp
new file mode 100644
index 00000000..eaadfba2
--- /dev/null
+++ b/tests/netinet/in.cpp
@@ -0,0 +1,14 @@
+#include <netinet/in.h>
+extern "C" int puts(const char *);
+int main() {
+ struct in6_addr in6any = IN6ADDR_ANY_INIT;
+ struct in6_addr in6loopback = IN6ADDR_LOOPBACK_INIT;
+ int i;
+ for (i = 0; i < 16; ++i)
+ if (in6any.s6_addr[i] != in6addr_any.s6_addr[i])
+ return puts("in6addr_any != IN6ADDR_ANY_INIT\n");
+ for (i = 0; i < 16; ++i)
+ if (in6loopback.s6_addr[i] != in6addr_loopback.s6_addr[i])
+ return puts("in6addr_loopback != IN6ADDR_LOOPBACK_INIT\n");
+ return puts("pass");
+}
diff --git a/tests/netinet/in.out b/tests/netinet/in.out
new file mode 100644
index 00000000..2ae28399
--- /dev/null
+++ b/tests/netinet/in.out
@@ -0,0 +1 @@
+pass
diff --git a/tests/openal_buffers.c b/tests/openal_buffers.c
index 31104a33..df6d8e3f 100644
--- a/tests/openal_buffers.c
+++ b/tests/openal_buffers.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <AL/al.h>
#include <AL/alc.h>
@@ -68,7 +68,7 @@ void iter() {
// Exit once we've processed the entire clip.
if (offset >= size) {
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
int result = 0;
REPORT_RESULT();
#endif
@@ -87,7 +87,7 @@ int main(int argc, char* argv[]) {
//
// Read in the audio sample.
//
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
FILE* fp = fopen("the_entertainer.wav", "rb");
#else
FILE* fp = fopen("sounds/the_entertainer.wav", "rb");
@@ -176,7 +176,7 @@ int main(int argc, char* argv[]) {
//
// Cycle and refill the buffers until we're done.
//
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 0, 0);
#else
while (1) {
diff --git a/tests/openal_playback.cpp b/tests/openal_playback.cpp
index 13d619e6..880b6906 100644
--- a/tests/openal_playback.cpp
+++ b/tests/openal_playback.cpp
@@ -3,11 +3,15 @@
#include <AL/al.h>
#include <AL/alc.h>
#include <assert.h>
+#include <stdint.h>
+#include <unistd.h>
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
+#endif
void playSource(void* arg)
{
- ALuint source = reinterpret_cast<ALuint>(arg);
+ ALuint source = static_cast<ALuint>(reinterpret_cast<intptr_t>(arg));
ALint state;
alGetSourcei(source, AL_SOURCE_STATE, &state);
assert(state == AL_PLAYING);
@@ -21,15 +25,32 @@ void playSource(void* arg)
alGetSourcei(source, AL_SOURCE_STATE, &state);
assert(state == AL_STOPPED);
+#ifdef __EMSCRIPTEN__
int result = 1;
REPORT_RESULT();
+#endif
}
int main() {
+ int major, minor;
+ alcGetIntegerv(NULL, ALC_MAJOR_VERSION, 1, &major);
+ alcGetIntegerv(NULL, ALC_MAJOR_VERSION, 1, &minor);
+
+ assert(major == 1);
+
+ printf("ALC version: %i.%i\n", major, minor);
+ printf("Default device: %s\n", alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER));
+
ALCdevice* device = alcOpenDevice(NULL);
ALCcontext* context = alcCreateContext(device, NULL);
alcMakeContextCurrent(context);
+ assert(alGetString(AL_VERSION));
+
+ printf("OpenAL version: %s\n", alGetString(AL_VERSION));
+ printf("OpenAL vendor: %s\n", alGetString(AL_VENDOR));
+ printf("OpenAL renderer: %s\n", alGetString(AL_RENDERER));
+
ALfloat listenerPos[] = {0.0, 0.0, 0.0};
ALfloat listenerVel[] = {0.0, 0.0, 0.0};
ALfloat listenerOri[] = {0.0, 0.0, -1.0, 0.0, 1.0, 0.0};
@@ -42,7 +63,11 @@ int main() {
alGenBuffers(1, buffers);
+#ifdef __EMSCRIPTEN__
FILE* source = fopen("audio.wav", "rb");
+#else
+ FILE* source = fopen("sounds/audio.wav", "rb");
+#endif
fseek(source, 0, SEEK_END);
int size = ftell(source);
fseek(source, 0, SEEK_SET);
@@ -95,9 +120,21 @@ int main() {
alBufferData(buffers[0], format, &buffer[offset], size - offset, frequency);
+ ALint val;
+ alGetBufferi(buffers[0], AL_FREQUENCY, &val);
+ assert(val == frequency);
+ alGetBufferi(buffers[0], AL_SIZE, &val);
+ assert(val == size - offset);
+ alGetBufferi(buffers[0], AL_BITS, &val);
+ assert(val == bits);
+ alGetBufferi(buffers[0], AL_CHANNELS, &val);
+ assert(val == channels);
+
ALuint sources[1];
alGenSources(1, sources);
+ assert(alIsSource(sources[0]));
+
alSourcei(sources[0], AL_BUFFER, buffers[0]);
ALint state;
@@ -109,7 +146,12 @@ int main() {
alGetSourcei(sources[0], AL_SOURCE_STATE, &state);
assert(state == AL_PLAYING);
+#ifdef __EMSCRIPTEN__
emscripten_async_call(playSource, reinterpret_cast<void*>(sources[0]), 700);
+#else
+ usleep(700000);
+ playSource(reinterpret_cast<void*>(sources[0]));
+#endif
return 0;
}
diff --git a/tests/perspective.c b/tests/perspective.c
index 72f4c50f..77998557 100644
--- a/tests/perspective.c
+++ b/tests/perspective.c
@@ -8,7 +8,7 @@
#include <SDL/SDL.h>
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <GL/gl.h>
#include <GL/glu.h>
#include "emscripten.h"
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#define emColor4ubv(x)
#else
#define emColor4ubv(x) glColor4ubv(x)
@@ -392,7 +392,7 @@ int main( int argc, char* argv[] )
*/
one_iter(); // just one for testing purposes
-#ifndef EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(2000);
#endif
diff --git a/tests/poppler/utils/pdftoppm.cc b/tests/poppler/utils/pdftoppm.cc
index f600e5ba..a6865cc6 100644
--- a/tests/poppler/utils/pdftoppm.cc
+++ b/tests/poppler/utils/pdftoppm.cc
@@ -183,6 +183,10 @@ static void savePageSlice(PDFDoc *doc,
bitmap->writePNMFile(ppmFile);
}
} else {
+#ifdef __EMSCRIPTEN__ // XXX EMSCRIPTEN: avoid writing to stdout, better for benchmarking
+ printf("avoiding writing to stdout\n");
+#else
+
#ifdef _WIN32
setmode(fileno(stdout), O_BINARY);
#endif
@@ -194,6 +198,7 @@ static void savePageSlice(PDFDoc *doc,
} else {
bitmap->writePNMFile(stdout);
}
+#endif
}
}
diff --git a/tests/printf/output.txt b/tests/printf/output.txt
index a3baed28..14e053f6 100644
--- a/tests/printf/output.txt
+++ b/tests/printf/output.txt
@@ -8281,4 +8281,5 @@ ffffff8000000000
1
1.234568E+04
+1.234568E+04
no_new_line
diff --git a/tests/printf/test.c b/tests/printf/test.c
index adeb69db..c83d92b0 100644
--- a/tests/printf/test.c
+++ b/tests/printf/test.c
@@ -8286,6 +8286,7 @@ int main() {
printf("%x\n", -0xFFFFFFFF);
printf("\n");
printf("%*.*E\n", 10, -1, 12345.6789123);
+ printf("%*.*E\n", 10, -313, 12345.6789123);
printf("no_new_line");
return 0;
}
diff --git a/tests/python/python.le32.bc b/tests/python/python.asmjs-unknown-emscripten.bc
index 2a6bc77c..6c25401e 100644
--- a/tests/python/python.le32.bc
+++ b/tests/python/python.asmjs-unknown-emscripten.bc
Binary files differ
diff --git a/tests/runner.py b/tests/runner.py
index 7f0cbaed..c13a16eb 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -27,6 +27,19 @@ sys.path += [path_from_root(''), path_from_root('third_party/websockify')]
import tools.shared
from tools.shared import *
+# Utils
+
+def nonfastcomp(test):
+ try:
+ old_fastcomp = os.environ.get('EMCC_FAST_COMPILER')
+ os.environ['EMCC_FAST_COMPILER'] = '0'
+ test()
+ finally:
+ if old_fastcomp is None:
+ del os.environ['EMCC_FAST_COMPILER']
+ else:
+ os.environ['EMCC_FAST_COMPILER'] = old_fastcomp
+
# Sanity check for config
try:
@@ -36,7 +49,7 @@ except:
# Core test runner class, shared between normal tests and benchmarks
checked_sanity = False
-test_modes = ['default', 'o1', 'o2', 'asm1', 'asm2', 'asm2f', 'asm2g', 'asm2x86', 's_0_0', 's_0_1']
+test_modes = ['default', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g', 'slow2', 'slow2asm', 's_0_0', 's_0_1']
test_index = 0
class RunnerCore(unittest.TestCase):
@@ -138,7 +151,11 @@ class RunnerCore(unittest.TestCase):
post1 = post_build
post2 = None
- if self.emcc_args is None:
+ emcc_args = self.emcc_args
+ if emcc_args is None:
+ emcc_args = []
+
+ if emcc_args is None: # legacy testing mode, no longer used
Building.emscripten(filename, append_ext=True, extra_args=extra_emscripten_args)
if post1:
exec post1 in locals()
@@ -160,7 +177,7 @@ process(sys.argv[1])
''')
transform.close()
transform_args = ['--js-transform', "%s %s" % (PYTHON, transform_filename)]
- Building.emcc(filename + '.o.ll', Settings.serialize() + self.emcc_args + transform_args + Building.COMPILER_TEST_OPTS, filename + '.o.js')
+ Building.emcc(filename + '.o.ll', Settings.serialize() + emcc_args + transform_args + Building.COMPILER_TEST_OPTS, filename + '.o.js')
if post2: post2(filename + '.o.js')
# Build JavaScript code from source code
@@ -237,7 +254,7 @@ process(sys.argv[1])
if 'uccessfully compiled asm.js code' in err and 'asm.js link error' not in err:
print >> sys.stderr, "[was asm.js'ified]"
elif 'asm.js' in err: # if no asm.js error, then not an odin build
- raise Exception("did NOT asm.js'ify")
+ raise Exception("did NOT asm.js'ify: " + err)
err = '\n'.join(filter(lambda line: 'uccessfully compiled asm.js code' not in line, err.split('\n')))
return err
@@ -566,7 +583,7 @@ class BrowserCore(RunnerCore):
def with_report_result(self, code):
return r'''
- #if EMSCRIPTEN
+ #ifdef __EMSCRIPTEN__
#include <emscripten.h>
#define REPORT_RESULT_INTERNAL(sync) \
char output[1000]; \
@@ -649,7 +666,6 @@ class BrowserCore(RunnerCore):
def btest(self, filename, expected=None, reference=None, force_c=False, reference_slack=0, manual_reference=False, post_build=None,
args=[], outfile='test.html', message='.'): # TODO: use in all other tests
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and 'LEGACY_GL_EMULATION=1' in args: return self.skip('no legacy gl emulation in fastcomp')
# if we are provided the source and not a path, use that
filename_is_src = '\n' in filename
src = filename if filename_is_src else ''
@@ -792,6 +808,16 @@ an individual test with
python tests/runner.py ALL.test_hello_world
+Debugging: You can run
+
+ EM_SAVE_DIR=1 python tests/runner.py ALL.test_hello_world
+
+in order to save the test runner directory, in /tmp/emscripten_temp. All files
+created by the test will be present there. You can also use EMCC_DEBUG to
+further debug the compiler itself, which works outside of the test suite as
+well: EMCC_DEBUG=1 will emit emcc-* files in that temp dir for each stage
+of the compiler, while EMCC_DEBUG=2 will emit even more files, one for each
+js optimizer phase.
==============================================================================
'''
diff --git a/tests/s3tc.c b/tests/s3tc.c
index 5f7bee83..ca575ffc 100644
--- a/tests/s3tc.c
+++ b/tests/s3tc.c
@@ -143,7 +143,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(1500);
#endif
diff --git a/tests/s3tc_crunch.c b/tests/s3tc_crunch.c
index c2606c8f..ae5e1228 100644
--- a/tests/s3tc_crunch.c
+++ b/tests/s3tc_crunch.c
@@ -195,7 +195,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(1500);
#endif
diff --git a/tests/sdl_alloctext.c b/tests/sdl_alloctext.c
index 173be348..b7e9e6cf 100644
--- a/tests/sdl_alloctext.c
+++ b/tests/sdl_alloctext.c
@@ -25,7 +25,7 @@ int main()
SDL_FreeSurface(text);
}
-#if __EMSCRIPTEN__
+#ifdef __EMSCRIPTEN__
result = 1;
REPORT_RESULT();
#endif
diff --git a/tests/sdl_audio_beep.cpp b/tests/sdl_audio_beep.cpp
index 95a5a7e8..82001e8a 100644
--- a/tests/sdl_audio_beep.cpp
+++ b/tests/sdl_audio_beep.cpp
@@ -9,7 +9,7 @@
#define M_PI 3.14159265358979323846f
#endif
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include "emscripten/emscripten.h"
#endif
@@ -170,7 +170,7 @@ void nextTest(void *unused = 0) {
++s;
if (s >= NUM_ELEMS(sdlAudioFormats)) {
printf("All tests done. Quit.\n");
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop();
#ifdef REPORT_RESULT
int result = 1;
@@ -204,7 +204,7 @@ void update() {
if (size == 0 && beep) {
delete beep;
beep = 0;
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_async_call(nextTest, 0, 1500);
#else
SDL_Delay(1500);
@@ -233,7 +233,7 @@ int main(int argc, char** argv) {
nextTest();
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(update, 60, 0);
#else
while(beep) {
diff --git a/tests/sdl_audio_mix_channels.c b/tests/sdl_audio_mix_channels.c
index dd91d594..73d21963 100644
--- a/tests/sdl_audio_mix_channels.c
+++ b/tests/sdl_audio_mix_channels.c
@@ -42,7 +42,7 @@ int main(int argc, char **argv) {
int lastChannel = loadAndPlay();
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
int result = (lastChannel == -1);
REPORT_RESULT();
#endif
diff --git a/tests/sdl_canvas.c b/tests/sdl_canvas.c
index cab48985..4420d73e 100644
--- a/tests/sdl_canvas.c
+++ b/tests/sdl_canvas.c
@@ -6,7 +6,7 @@
int main(int argc, char **argv) {
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
// include GL stuff, to check that we can compile hybrid 2d/GL apps
extern void glBegin(int mode);
extern void glBindBuffer(int target, int buffer);
diff --git a/tests/sdl_canvas_size.c b/tests/sdl_canvas_size.c
index 923a9014..0d184823 100644
--- a/tests/sdl_canvas_size.c
+++ b/tests/sdl_canvas_size.c
@@ -30,7 +30,7 @@ REDISTRIBUTION OF THIS SOFTWARE.
#include <string.h>
#include <assert.h>
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); // *new*
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
// Test 1: Check that initializing video mode with size (0,0) will use the size from the <canvas> element.
screen = SDL_SetVideoMode( 0, 0, 16, SDL_OPENGL ); // *changed*
@@ -177,7 +177,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/sdl_canvas_twice.c b/tests/sdl_canvas_twice.c
index 28a7a01c..ba62846b 100644
--- a/tests/sdl_canvas_twice.c
+++ b/tests/sdl_canvas_twice.c
@@ -1,6 +1,6 @@
#include <SDL/SDL.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
diff --git a/tests/sdl_fog_density.c b/tests/sdl_fog_density.c
index cab6a4d2..46d4a8a1 100644
--- a/tests/sdl_fog_density.c
+++ b/tests/sdl_fog_density.c
@@ -165,7 +165,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(30000);
#endif
diff --git a/tests/sdl_fog_exp2.c b/tests/sdl_fog_exp2.c
index dba0c708..f813cede 100644
--- a/tests/sdl_fog_exp2.c
+++ b/tests/sdl_fog_exp2.c
@@ -166,7 +166,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#if !defined(__EMSCRIPTEN__)
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(30000);
#endif
diff --git a/tests/sdl_fog_linear.c b/tests/sdl_fog_linear.c
index f0805650..d7107914 100644
--- a/tests/sdl_fog_linear.c
+++ b/tests/sdl_fog_linear.c
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(30000);
#endif
diff --git a/tests/sdl_fog_negative.c b/tests/sdl_fog_negative.c
index 1ede63a7..f99467bb 100644
--- a/tests/sdl_fog_negative.c
+++ b/tests/sdl_fog_negative.c
@@ -164,7 +164,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(30000);
#endif
diff --git a/tests/sdl_fog_simple.c b/tests/sdl_fog_simple.c
index 6c052bf5..269b7432 100644
--- a/tests/sdl_fog_simple.c
+++ b/tests/sdl_fog_simple.c
@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(30000);
#endif
diff --git a/tests/sdl_gfx_primitives.c b/tests/sdl_gfx_primitives.c
index db0c6181..dbf9849c 100644
--- a/tests/sdl_gfx_primitives.c
+++ b/tests/sdl_gfx_primitives.c
@@ -1,7 +1,7 @@
#include "SDL/SDL.h"
#include "SDL/SDL_gfxPrimitives.h"
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include "emscripten.h"
#endif
@@ -31,7 +31,7 @@ int main(int argc, char **argv) {
SDL_UpdateRect(screen, 0, 0, 0, 0);
-#ifndef EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Event evt;
SDL_SaveBMP(screen, "native_output.bmp");
while (1) {
diff --git a/tests/sdl_headless.c b/tests/sdl_headless.c
index 349c5e26..6157a46d 100644
--- a/tests/sdl_headless.c
+++ b/tests/sdl_headless.c
@@ -6,7 +6,7 @@
int main(int argc, char **argv) {
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
// include GL stuff, to check that we can compile hybrid 2d/GL apps
extern void glBegin(int mode);
extern void glBindBuffer(int target, int buffer);
diff --git a/tests/sdl_ogl.c b/tests/sdl_ogl.c
index e7071dcd..78efd7e0 100644
--- a/tests/sdl_ogl.c
+++ b/tests/sdl_ogl.c
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/sdl_ogl_defaultMatrixMode.c b/tests/sdl_ogl_defaultMatrixMode.c
index eec2a831..6044f1ab 100644
--- a/tests/sdl_ogl_defaultMatrixMode.c
+++ b/tests/sdl_ogl_defaultMatrixMode.c
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/sdl_ogl_p.c b/tests/sdl_ogl_p.c
index 1889d926..2607f35c 100644
--- a/tests/sdl_ogl_p.c
+++ b/tests/sdl_ogl_p.c
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/sdl_ogl_proc_alias.c b/tests/sdl_ogl_proc_alias.c
index c96da81b..4c251f83 100644
--- a/tests/sdl_ogl_proc_alias.c
+++ b/tests/sdl_ogl_proc_alias.c
@@ -166,7 +166,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/sdl_rotozoom.c b/tests/sdl_rotozoom.c
index 2c0d35df..cc0ee224 100644
--- a/tests/sdl_rotozoom.c
+++ b/tests/sdl_rotozoom.c
@@ -2,7 +2,7 @@
#include "SDL/SDL_image.h"
#include "SDL/SDL_rotozoom.h"
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include "emscripten.h"
#endif
@@ -45,7 +45,7 @@ int main(int argc, char **argv) {
mainloop();
-#ifndef EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Event evt;
SDL_SaveBMP(screen, "native_output.bmp");
while (1) {
diff --git a/tests/sdl_swsurface.c b/tests/sdl_swsurface.c
new file mode 100644
index 00000000..c859dbc7
--- /dev/null
+++ b/tests/sdl_swsurface.c
@@ -0,0 +1,22 @@
+#include <assert.h>
+#include <stdio.h>
+#include <SDL/SDL.h>
+
+int main(int argc, char** argv) {
+ SDL_Init(SDL_INIT_VIDEO);
+ SDL_Surface *screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE);
+
+ // pixels should always be initialized for software surfaces,
+ // without having to call SDL_LockSurface / SDL_UnlockSurface
+ assert(screen->pixels != NULL);
+
+ SDL_Quit();
+
+#ifdef __EMSCRIPTEN__
+ int result = 1;
+ REPORT_RESULT();
+#endif
+
+ return 0;
+}
+
diff --git a/tests/sdlglshader.c b/tests/sdlglshader.c
index a096ef20..d629ca94 100644
--- a/tests/sdlglshader.c
+++ b/tests/sdlglshader.c
@@ -89,6 +89,11 @@ void setShaders() {
glCompileShader_(v);
glGetObjectParameteriv_(v, GL_OBJECT_COMPILE_STATUS_ARB, &ok);
+ if (!ok) {
+ char msg[512];
+ glGetShaderInfoLog(v, sizeof msg, NULL, msg);
+ printf("shader compilation issue: %s\n", msg);
+ }
assert(ok);
glCompileShader_(f);
@@ -143,7 +148,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
SDL_Delay(3000);
#endif
diff --git a/tests/sockets/test_enet_client.c b/tests/sockets/test_enet_client.c
index afcdcae8..b422e70c 100644
--- a/tests/sockets/test_enet_client.c
+++ b/tests/sockets/test_enet_client.c
@@ -1,14 +1,14 @@
#include <stdio.h>
#include <string.h>
#include <enet/enet.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
ENetHost * host;
void main_loop() {
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
static int counter = 0;
counter++;
if (counter == 100) {
@@ -34,7 +34,7 @@ void main_loop() {
event.channelID);
int result = strcmp("packetfoo", event.packet->data);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
REPORT_RESULT();
#else
exit(EXIT_SUCCESS);
@@ -92,7 +92,7 @@ int main (int argc, char ** argv)
exit (EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#if USE_IFRAME
emscripten_run_script("console.log('adding iframe');"
"var iframe = document.createElement('iframe');"
@@ -104,7 +104,7 @@ int main (int argc, char ** argv)
#endif
#endif
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 3, 1);
#else
while (1) main_loop();
diff --git a/tests/sockets/test_enet_server.c b/tests/sockets/test_enet_server.c
index 9a4518ac..30d86a99 100644
--- a/tests/sockets/test_enet_server.c
+++ b/tests/sockets/test_enet_server.c
@@ -4,7 +4,7 @@
#include <string.h>
#include <enet/enet.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -29,12 +29,12 @@ void send_msg(ENetPeer *peer) {
void main_loop() {
static int counter = 0;
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
counter++;
#endif
if (counter == 100) {
printf("stop!\n");
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_cancel_main_loop();
#endif
return;
@@ -101,7 +101,7 @@ int main (int argc, char ** argv)
exit (EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 3, 1);
#else
while (1) main_loop();
diff --git a/tests/sockets/test_getaddrinfo.c b/tests/sockets/test_getaddrinfo.c
index 1f912c69..85610473 100644
--- a/tests/sockets/test_getaddrinfo.c
+++ b/tests/sockets/test_getaddrinfo.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
diff --git a/tests/sockets/test_gethostbyname.c b/tests/sockets/test_gethostbyname.c
index 459c6b98..c0e11efb 100644
--- a/tests/sockets/test_gethostbyname.c
+++ b/tests/sockets/test_gethostbyname.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
diff --git a/tests/sockets/test_getnameinfo.c b/tests/sockets/test_getnameinfo.c
index c3fec6b4..dd4a0419 100644
--- a/tests/sockets/test_getnameinfo.c
+++ b/tests/sockets/test_getnameinfo.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -98,4 +98,4 @@ int main() {
puts("success");
return EXIT_SUCCESS;
-} \ No newline at end of file
+}
diff --git a/tests/sockets/test_sockets_echo_client.c b/tests/sockets/test_sockets_echo_client.c
index f6ea85cf..58d005c4 100644
--- a/tests/sockets/test_sockets_echo_client.c
+++ b/tests/sockets/test_sockets_echo_client.c
@@ -10,7 +10,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -42,13 +42,13 @@ void finish(int result) {
close(server.fd);
server.fd = 0;
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
REPORT_RESULT();
#endif
exit(result);
}
-void main_loop(void *arg) {
+void main_loop() {
static char out[1024*2];
static int pos = 0;
fd_set fdr;
@@ -71,21 +71,25 @@ void main_loop(void *arg) {
return;
}
+#if !TEST_DGRAM
// as a test, confirm with ioctl that we have data available
// after selecting
int available;
res = ioctl(server.fd, FIONREAD, &available);
assert(res != -1);
assert(available);
+#endif
res = do_msg_read(server.fd, &server.msg, echo_read, 0, NULL, NULL);
- if (res == 0) {
+ if (res == -1) {
+ return;
+ } else if (res == 0) {
perror("server closed");
finish(EXIT_FAILURE);
- } else if (res != -1) {
- echo_read += res;
}
+ echo_read += res;
+
// once we've read the entire message, validate it
if (echo_read >= server.msg.length) {
assert(!strcmp(server.msg.buffer, MESSAGE));
@@ -97,13 +101,15 @@ void main_loop(void *arg) {
}
res = do_msg_write(server.fd, &echo_msg, echo_wrote, 0, NULL, 0);
- if (res == 0) {
+ if (res == -1) {
+ return;
+ } else if (res == 0) {
perror("server closed");
finish(EXIT_FAILURE);
- } else if (res != -1) {
- echo_wrote += res;
}
+ echo_wrote += res;
+
// once we're done writing the message, read it back
if (echo_wrote >= echo_msg.length) {
server.state = MSG_READ;
@@ -124,8 +130,11 @@ int main() {
echo_msg.buffer = malloc(echo_msg.length);
strncpy(echo_msg.buffer, MESSAGE, echo_msg.length);
+ echo_read = 0;
+ echo_wrote = 0;
+
// create the socket and set to non-blocking
-#if !USE_UDP
+#if !TEST_DGRAM
server.fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
#else
server.fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -151,11 +160,11 @@ int main() {
finish(EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 0, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
-} \ No newline at end of file
+}
diff --git a/tests/sockets/test_sockets_echo_server.c b/tests/sockets/test_sockets_echo_server.c
index 55ace660..55898add 100644
--- a/tests/sockets/test_sockets_echo_server.c
+++ b/tests/sockets/test_sockets_echo_server.c
@@ -11,7 +11,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -49,7 +49,7 @@ void cleanup() {
}
}
-void main_loop(void *arg) {
+void main_loop() {
int res;
fd_set fdr;
fd_set fdw;
@@ -59,7 +59,7 @@ void main_loop(void *arg) {
FD_ZERO(&fdw);
FD_SET(server.fd, &fdr);
FD_SET(server.fd, &fdw);
-#if !USE_UDP
+#if !TEST_DGRAM
if (client.fd) FD_SET(client.fd, &fdr);
if (client.fd) FD_SET(client.fd, &fdw);
#endif
@@ -69,7 +69,7 @@ void main_loop(void *arg) {
exit(EXIT_SUCCESS);
}
-#if !USE_UDP
+#if !TEST_DGRAM
// for TCP sockets, we may need to accept a connection
if (FD_ISSET(server.fd, &fdr)) {
#if TEST_ACCEPT_ADDR
@@ -86,7 +86,7 @@ void main_loop(void *arg) {
}
#endif
-#if !USE_UDP
+#if !TEST_DGRAM
int fd = client.fd;
#else
int fd = server.fd;
@@ -99,14 +99,16 @@ void main_loop(void *arg) {
}
res = do_msg_read(fd, &client.msg, client.read, 0, (struct sockaddr *)&client.addr, &addrlen);
- if (res == 0) {
+ if (res == -1) {
+ return;
+ } else if (res == 0) {
// client disconnected
memset(&client, 0, sizeof(client_t));
return;
- } else if (res != -1) {
- client.read += res;
}
+ client.read += res;
+
// once we've read the entire message, echo it back
if (client.read >= client.msg.length) {
client.read = 0;
@@ -118,14 +120,16 @@ void main_loop(void *arg) {
}
res = do_msg_write(fd, &client.msg, client.wrote, 0, (struct sockaddr *)&client.addr, sizeof(client.addr));
- if (res == 0) {
+ if (res == -1) {
+ return;
+ } else if (res == 0) {
// client disconnected
memset(&client, 0, sizeof(client_t));
return;
- } else if (res != -1) {
- client.wrote += res;
}
+ client.wrote += res;
+
if (client.wrote >= client.msg.length) {
client.wrote = 0;
client.state = MSG_READ;
@@ -149,7 +153,7 @@ int main() {
memset(&client, 0, sizeof(client_t));
// create the socket and set to non-blocking
-#if !USE_UDP
+#if !TEST_DGRAM
server.fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
#else
server.fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
@@ -174,7 +178,7 @@ int main() {
exit(EXIT_FAILURE);
}
-#if !USE_UDP
+#if !TEST_DGRAM
res = listen(server.fd, 50);
if (res == -1) {
perror("listen failed");
@@ -182,10 +186,10 @@ int main() {
}
#endif
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_partial_client.c b/tests/sockets/test_sockets_partial_client.c
index dcf90f19..2d930516 100644
--- a/tests/sockets/test_sockets_partial_client.c
+++ b/tests/sockets/test_sockets_partial_client.c
@@ -10,7 +10,7 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -19,13 +19,13 @@ int sum = 0;
void finish(int result) {
close(sockfd);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
REPORT_RESULT();
#endif
exit(result);
}
-void iter(void *arg) {
+void iter() {
char buffer[1024];
char packetLength;
fd_set fdr;
@@ -108,10 +108,10 @@ int main() {
finish(EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 0, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_partial_server.c b/tests/sockets/test_sockets_partial_server.c
index 19f7f2af..5c3621a0 100644
--- a/tests/sockets/test_sockets_partial_server.c
+++ b/tests/sockets/test_sockets_partial_server.c
@@ -11,7 +11,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -61,7 +61,7 @@ void do_send(int sockfd) {
exit(EXIT_SUCCESS);
}
-void iter(void *arg) {
+void iter() {
int res;
fd_set fdr;
fd_set fdw;
@@ -124,10 +124,10 @@ int main() {
exit(EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 60, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
index 25dcdd05..28a81cd9 100644
--- a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
+++ b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
@@ -10,7 +10,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -24,13 +24,13 @@ msg_t writemsg;
void finish(int result) {
close(sockfd);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
REPORT_RESULT();
#endif
exit(result);
}
-void main_loop(void *arg) {
+void main_loop() {
static int state = 0;
static int readPos = 0;
static int writePos = 0;
@@ -216,10 +216,10 @@ int main() {
finish(EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 0, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_select_server_down_client.c b/tests/sockets/test_sockets_select_server_down_client.c
index 27e200e0..5b050870 100644
--- a/tests/sockets/test_sockets_select_server_down_client.c
+++ b/tests/sockets/test_sockets_select_server_down_client.c
@@ -10,7 +10,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -20,13 +20,13 @@ int sockfd = -1;
void finish(int result) {
close(sockfd);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
REPORT_RESULT();
#endif
exit(result);
}
-void iter(void *arg) {
+void iter() {
static int retries = 0;
fd_set sett;
@@ -87,10 +87,10 @@ int main() {
finish(EXIT_FAILURE);
}
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 0, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_FAILURE;
diff --git a/tests/sockets/test_sockets_select_server_down_server.c b/tests/sockets/test_sockets_select_server_down_server.c
index c2e70f33..07c5c847 100644
--- a/tests/sockets/test_sockets_select_server_down_server.c
+++ b/tests/sockets/test_sockets_select_server_down_server.c
@@ -10,11 +10,11 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
-void main_loop(void *arg) {
+void main_loop() {
}
int main() {
@@ -47,10 +47,10 @@ int main() {
close(serverfd);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL); sleep(1);
+ while (1) main_loop(); sleep(1);
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/webrtc_host.c b/tests/sockets/webrtc_host.c
index 770e59e0..e482d4ae 100644
--- a/tests/sockets/webrtc_host.c
+++ b/tests/sockets/webrtc_host.c
@@ -9,7 +9,7 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -26,7 +26,7 @@ struct iovec iov[1];
struct msghdr hdr;
int done = 0;
-void iter(void* arg) {
+void iter() {
int n;
n = recvmsg(sock, &hdr, 0);
@@ -37,7 +37,7 @@ void iter(void* arg) {
shutdown(sock, SHUT_RDWR);
close(sock);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
int result = 1;
REPORT_RESULT();
exit(EXIT_SUCCESS);
@@ -79,11 +79,11 @@ int main(void)
hdr.msg_iov = iov;
hdr.msg_iovlen = 1;
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 0, 0);
#else
- while (!done) iter(NULL);
+ while (!done) iter();
#endif
return EXIT_SUCCESS;
-} \ No newline at end of file
+}
diff --git a/tests/sockets/webrtc_peer.c b/tests/sockets/webrtc_peer.c
index d24979e7..327782d6 100644
--- a/tests/sockets/webrtc_peer.c
+++ b/tests/sockets/webrtc_peer.c
@@ -9,7 +9,7 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <assert.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -25,7 +25,7 @@ struct iovec iov[1];
struct msghdr hdr;
int done = 0;
-void iter(void* arg) {
+void iter() {
int n;
n = sendmsg(sock, &hdr, 0);
@@ -71,11 +71,11 @@ int main(void)
hdr.msg_iov = iov;
hdr.msg_iovlen = 1;
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
emscripten_set_main_loop(iter, 0, 0);
#else
- while (!done) iter(NULL);
+ while (!done) iter();
#endif
return EXIT_SUCCESS;
-} \ No newline at end of file
+}
diff --git a/tests/sqlite/benchmark.c b/tests/sqlite/benchmark.c
index 802abab1..de800742 100644
--- a/tests/sqlite/benchmark.c
+++ b/tests/sqlite/benchmark.c
@@ -2,8 +2,13 @@
#include <stdio.h>
#include <sqlite3.h>
+#include <emscripten.h>
+
+int print = 1;
+
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
+ if (!print) return 0;
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
@@ -44,11 +49,15 @@ int test(){
return 0;
}
-int main(){
+int main(int argc, char **argv){
sqlite3 *db;
char *zErrMsg = 0;
int rc, i;
clock_t t;
+ int n, m;
+
+ n = argc > 1 ? atoi(argv[1]) : 5000;
+ m = argc > 2 ? atoi(argv[2]) : 1;
rc = sqlite3_open(":memory:", &db);
if( rc ){
@@ -69,20 +78,21 @@ int main(){
#define TIME(msg) \
{ \
- printf(msg " : took %d ms\n", (1000*(clock()-t))/CLOCKS_PER_SEC); \
- t = clock(); \
+ int now = emscripten_get_now(); \
+ printf(msg " : took %d ms\n", (int)(now - t)); \
+ t = now; \
}
t = clock();
- TIME("'startup'");
+ TIME("'startup' - IGNORE THIS VALUE, it is an artifact");
RUN("CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));");
TIME("create table");
RUN("BEGIN;");
- // 25000 INSERTs in a transaction
- for (i = 0; i < 5000; i++) {
+ // n*5 INSERTs in a transaction
+ for (i = 0; i < n; i++) {
RUN("INSERT INTO t1 VALUES(1,12345,'one 1 one 1 one 1');");
RUN("INSERT INTO t1 VALUES(2,23422,'two two two two');");
RUN("INSERT INTO t1 VALUES(3,31233,'three three 33333333333 three');");
@@ -95,10 +105,13 @@ int main(){
TIME("commit");
// Counts
- RUN("SELECT count(*) FROM t1;");
- RUN("SELECT count(*) FROM t1 WHERE a == 4");
- RUN("SELECT count(*) FROM t1 WHERE b > 20000 AND b < 50000;");
- RUN("SELECT count(*) FROM t1 WHERE c like '%three%';");
+ for (i = 0; i < m; i++) {
+ print = i == 0;
+ RUN("SELECT count(*) FROM t1;");
+ RUN("SELECT count(*) FROM t1 WHERE a == 4");
+ RUN("SELECT count(*) FROM t1 WHERE b > 20000 AND b < 50000;");
+ RUN("SELECT count(*) FROM t1 WHERE c like '%three%';");
+ }
TIME("selects");
// Index
@@ -106,8 +119,11 @@ int main(){
RUN("CREATE INDEX iibb ON t1(b);");
TIME("create indexes");
- RUN("SELECT count(*) FROM t1 WHERE a == 4");
- RUN("SELECT count(*) FROM t1 WHERE b > 20000 AND b < 50000;");
+ for (i = 0; i < m; i++) {
+ print = i == 0;
+ RUN("SELECT count(*) FROM t1 WHERE a == 4");
+ RUN("SELECT count(*) FROM t1 WHERE b > 20000 AND b < 50000;");
+ }
TIME("selects with indexes");
sqlite3_close(db);
diff --git a/tests/sqlite/sqlite3.c b/tests/sqlite/sqlite3.c
index bcbb7cdd..2d7c7725 100644
--- a/tests/sqlite/sqlite3.c
+++ b/tests/sqlite/sqlite3.c
@@ -38132,9 +38132,6 @@ static int writeJournalHdr(Pager *pPager){
u32 nHeader = (u32)pPager->pageSize;/* Size of buffer pointed to by zHeader */
u32 nWrite; /* Bytes of header sector written */
int ii; /* Loop counter */
-#ifdef EMSCRIPTEN
- u8 temp[4];
-#endif
assert( isOpen(pPager->jfd) ); /* Journal file must be open. */
@@ -38185,12 +38182,7 @@ static int writeJournalHdr(Pager *pPager){
}
/* The random check-hash initialiser */
-#ifdef EMSCRIPTEN
- sqlite3_randomness(sizeof(pPager->cksumInit), temp);
- pPager->cksumInit = temp[0] + (((u32)temp[1]) << 8) + (((u32)temp[2]) << 16) + (((u32)temp[3]) << 24);
-#else
sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit);
-#endif
put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit);
/* The initial database size */
put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbOrigSize);
@@ -52942,12 +52934,7 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
endPtr = &data[pPage->cellOffset + 2*pPage->nCell - 2];
assert( (SQLITE_PTR_TO_INT(ptr)&1)==0 ); /* ptr is always 2-byte aligned */
while( ptr<endPtr ){
-#ifdef EMSCRIPTEN
- ptr[0] = ptr[2];
- ptr[1] = ptr[3];
-#else
*(u16*)ptr = *(u16*)&ptr[2];
-#endif
ptr += 2;
}
pPage->nCell--;
@@ -53043,12 +53030,7 @@ static void insertCell(
endPtr = &data[ins];
assert( (SQLITE_PTR_TO_INT(ptr)&1)==0 ); /* ptr is always 2-byte aligned */
while( ptr>endPtr ){
-#ifdef EMSCRIPTEN
- ptr[0] = ptr[-2];
- ptr[1] = ptr[-1];
-#else
*(u16*)ptr = *(u16*)&ptr[-2];
-#endif
ptr -= 2;
}
put2byte(&data[ins], idx);
diff --git a/tests/stat/test_mknod.c b/tests/stat/test_mknod.c
index 361b2315..262c8a5f 100644
--- a/tests/stat/test_mknod.c
+++ b/tests/stat/test_mknod.c
@@ -32,7 +32,7 @@ void test() {
// than a FIFO. so, the tests are disabled when running
// natively as they'd be utterly inconsistent.
//
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
// mknod a folder
err = mknod("mknod-folder", S_IFDIR | 0777, 0);
diff --git a/tests/stat/test_stat.c b/tests/stat/test_stat.c
index f59fb3c3..e14ebdc5 100644
--- a/tests/stat/test_stat.c
+++ b/tests/stat/test_stat.c
@@ -55,7 +55,7 @@ void test() {
assert(s.st_atime == 1200000000);
assert(s.st_mtime == 1200000000);
assert(s.st_ctime);
-#ifdef EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 1);
#endif
@@ -73,7 +73,7 @@ void test() {
assert(s.st_atime == 1200000000);
assert(s.st_mtime == 1200000000);
assert(s.st_ctime);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 1);
#endif
@@ -91,7 +91,7 @@ void test() {
assert(s.st_atime == 1200000000);
assert(s.st_mtime == 1200000000);
assert(s.st_ctime);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 1);
#endif
@@ -112,7 +112,7 @@ void test() {
assert(s.st_atime);
assert(s.st_mtime);
assert(s.st_ctime);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 0);
#endif
@@ -130,7 +130,7 @@ void test() {
assert(s.st_atime == 1200000000);
assert(s.st_mtime == 1200000000);
assert(s.st_ctime);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 1);
#endif
@@ -148,7 +148,7 @@ void test() {
assert(s.st_atime != 1200000000); // should NOT match the utime call we did for dir/file
assert(s.st_mtime != 1200000000);
assert(s.st_ctime);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
assert(s.st_blksize == 4096);
assert(s.st_blocks == 1);
#endif
diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py
index 21a47178..2bc34c60 100644
--- a/tests/test_benchmark.py
+++ b/tests/test_benchmark.py
@@ -51,20 +51,21 @@ class Benchmarker:
print
class NativeBenchmarker(Benchmarker):
- def __init__(self, name, cc, cxx):
+ def __init__(self, name, cc, cxx, args=['-O2']):
self.name = name
self.cc = cc
self.cxx = cxx
+ self.args = args
def build(self, parent, filename, args, shared_args, emcc_args, native_args, native_exec, lib_builder):
self.parent = parent
if lib_builder: native_args = native_args + lib_builder(self.name, native=True, env_init={ 'CC': self.cc, 'CXX': self.cxx })
if not native_exec:
compiler = self.cxx if filename.endswith('cpp') else self.cc
- process = Popen([compiler, '-O2', '-fno-math-errno', filename, '-o', filename+'.native'] + shared_args + native_args, stdout=PIPE, stderr=parent.stderr_redirect)
+ process = Popen([compiler, '-fno-math-errno', filename, '-o', filename+'.native'] + self.args + shared_args + native_args, stdout=PIPE, stderr=parent.stderr_redirect)
output = process.communicate()
if process.returncode is not 0:
- print >> sys.stderr, "Building native executable with command '%s' failed with a return code %d!" % (' '.join([compiler, '-O2', filename, '-o', filename+'.native']), process.returncode)
+ print >> sys.stderr, "Building native executable with command failed"
print "Output: " + output[0]
else:
shutil.copyfile(native_exec, filename + '.native')
@@ -106,7 +107,7 @@ process(sys.argv[1])
final = os.path.dirname(filename) + os.path.sep + self.name+'_' + os.path.basename(filename) + '.js'
try_delete(final)
output = Popen([PYTHON, EMCC, filename, #'-O3',
- '-O2', '-s', 'DOUBLE_MODE=0', '-s', 'PRECISE_I64_MATH=0',
+ '-O3', '-s', 'DOUBLE_MODE=0', '-s', 'PRECISE_I64_MATH=0',
'--memory-init-file', '0', '--js-transform', 'python hardcode.py',
'-s', 'TOTAL_MEMORY=128*1024*1024',
#'--closure', '1',
@@ -124,6 +125,7 @@ try:
benchmarkers = [
#NativeBenchmarker('clang', CLANG_CC, CLANG),
NativeBenchmarker('clang-3.2', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++')),
+ #NativeBenchmarker('clang-3.2-O3', os.path.join(LLVM_3_2, 'clang'), os.path.join(LLVM_3_2, 'clang++'), ['-O3']),
#NativeBenchmarker('clang-3.3', os.path.join(LLVM_3_3, 'clang'), os.path.join(LLVM_3_3, 'clang++')),
#NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
#NativeBenchmarker('gcc', 'gcc', 'g++'),
@@ -132,7 +134,6 @@ try:
#JSBenchmarker('sm-f32-3.2', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_2 }),
#JSBenchmarker('sm-f32-3.3', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_3 }),
#JSBenchmarker('sm-f32-3.4', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_4 }),
- #JSBenchmarker('sm-fc', SPIDERMONKEY_ENGINE, env={ 'EMCC_FAST_COMPILER': '1' }),
#JSBenchmarker('sm-noasm', SPIDERMONKEY_ENGINE + ['--no-asmjs']),
#JSBenchmarker('sm-noasm-f32', SPIDERMONKEY_ENGINE + ['--no-asmjs'], ['-s', 'PRECISE_F32=2']),
#JSBenchmarker('v8', V8_ENGINE)
@@ -174,7 +175,7 @@ class benchmark(RunnerCore):
pass
Building.COMPILER = CLANG
- Building.COMPILER_TEST_OPTS = []
+ Building.COMPILER_TEST_OPTS = ['-O2']
def do_benchmark(self, name, src, expected_output='FAIL', args=[], emcc_args=[], native_args=[], shared_args=[], force_c=False, reps=TEST_REPS, native_exec=None, output_parser=None, args_processor=None, lib_builder=None):
if len(benchmarkers) == 0: raise Exception('error, no benchmarkers: ' + benchmarkers_error)
@@ -472,7 +473,7 @@ class benchmark(RunnerCore):
def lua(self, benchmark, expected, output_parser=None, args_processor=None):
shutil.copyfile(path_from_root('tests', 'lua', benchmark + '.lua'), benchmark + '.lua')
def lib_builder(name, native, env_init):
- ret = self.get_library('lua', [os.path.join('src', 'lua'), os.path.join('src', 'liblua.a')], make=['make', 'generic'], configure=None, native=native, cache_name_extra=name, env_init=env_init)
+ ret = self.get_library('lua_native' if native else 'lua', [os.path.join('src', 'lua'), os.path.join('src', 'liblua.a')], make=['make', 'generic'], configure=None, native=native, cache_name_extra=name, env_init=env_init)
if native: return ret
shutil.copyfile(ret[0], ret[0] + '.bc')
ret[0] += '.bc'
diff --git a/tests/test_browser.py b/tests/test_browser.py
index 3b9d6ebb..3bceeda8 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1,5 +1,5 @@
import BaseHTTPServer, multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex
-from runner import BrowserCore, path_from_root
+from runner import BrowserCore, path_from_root, nonfastcomp
from tools.shared import *
# User can specify an environment variable EMSCRIPTEN_BROWSER to force the browser test suite to
@@ -120,8 +120,6 @@ If manually bisecting:
'''
def test_emscripten_log(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('fastcomp uses asm, where call stacks are sometimes less clear')
-
src = os.path.join(self.get_dir(), 'src.cpp')
open(src, 'w').write(self.with_report_result(open(path_from_root('tests', 'emscripten_log', 'emscripten_log.cpp')).read()))
@@ -143,187 +141,193 @@ If manually bisecting:
os.chdir(cwd)
def test_split(self):
- # test HTML generation.
- self.reftest(path_from_root('tests', 'htmltest.png'))
- output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '--split', '100', '--pre-js', 'reftest.js']).communicate()
- assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file'
- assert os.path.exists(os.path.join(self.get_dir(), 'something_functions.js')), 'must be functions js file'
- assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file'
-
- open(os.path.join(self.get_dir(), 'something.html'), 'w').write('''
-
- <!doctype html>
- <html lang="en-us">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Emscripten-Generated Code</title>
- <style>
- .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
- canvas.emscripten { border: 1px solid black; }
- textarea.emscripten { font-family: monospace; width: 80%; }
- div.emscripten { text-align: center; }
- </style>
- </head>
- <body>
- <hr/>
- <div class="emscripten" id="status">Downloading...</div>
- <div class="emscripten">
- <progress value="0" max="100" id="progress" hidden=1></progress>
- </div>
- <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
- <hr/>
- <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div>
- <hr/>
- <textarea class="emscripten" id="output" rows="8"></textarea>
- <hr>
- <script type='text/javascript'>
- // connect to canvas
- var Module = {
- preRun: [],
- postRun: [],
- print: (function() {
- var element = document.getElementById('output');
- element.value = ''; // clear browser cache
- return function(text) {
- // These replacements are necessary if you render to raw HTML
- //text = text.replace(/&/g, "&amp;");
- //text = text.replace(/</g, "&lt;");
- //text = text.replace(/>/g, "&gt;");
- //text = text.replace('\\n', '<br>', 'g');
- element.value += text + "\\n";
- element.scrollTop = element.scrollHeight; // focus on bottom
- };
- })(),
- printErr: function(text) {
- if (0) { // XXX disabled for safety typeof dump == 'function') {
- dump(text + '\\n'); // fast, straight to the real console
- } else {
- console.log(text);
- }
- },
- canvas: document.getElementById('canvas'),
- setStatus: function(text) {
- if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
- var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
- var statusElement = document.getElementById('status');
- var progressElement = document.getElementById('progress');
- if (m) {
- text = m[1];
- progressElement.value = parseInt(m[2])*100;
- progressElement.max = parseInt(m[4])*100;
- progressElement.hidden = false;
- } else {
- progressElement.value = null;
- progressElement.max = null;
- progressElement.hidden = true;
+ def nfc():
+ # test HTML generation.
+ self.reftest(path_from_root('tests', 'htmltest.png'))
+ output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '--split', '100', '--pre-js', 'reftest.js']).communicate()
+ assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file'
+ assert os.path.exists(os.path.join(self.get_dir(), 'something_functions.js')), 'must be functions js file'
+ assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file'
+
+ open(os.path.join(self.get_dir(), 'something.html'), 'w').write('''
+
+ <!doctype html>
+ <html lang="en-us">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Emscripten-Generated Code</title>
+ <style>
+ .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
+ canvas.emscripten { border: 1px solid black; }
+ textarea.emscripten { font-family: monospace; width: 80%; }
+ div.emscripten { text-align: center; }
+ </style>
+ </head>
+ <body>
+ <hr/>
+ <div class="emscripten" id="status">Downloading...</div>
+ <div class="emscripten">
+ <progress value="0" max="100" id="progress" hidden=1></progress>
+ </div>
+ <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+ <hr/>
+ <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div>
+ <hr/>
+ <textarea class="emscripten" id="output" rows="8"></textarea>
+ <hr>
+ <script type='text/javascript'>
+ // connect to canvas
+ var Module = {
+ preRun: [],
+ postRun: [],
+ print: (function() {
+ var element = document.getElementById('output');
+ element.value = ''; // clear browser cache
+ return function(text) {
+ // These replacements are necessary if you render to raw HTML
+ //text = text.replace(/&/g, "&amp;");
+ //text = text.replace(/</g, "&lt;");
+ //text = text.replace(/>/g, "&gt;");
+ //text = text.replace('\\n', '<br>', 'g');
+ element.value += text + "\\n";
+ element.scrollTop = element.scrollHeight; // focus on bottom
+ };
+ })(),
+ printErr: function(text) {
+ if (0) { // XXX disabled for safety typeof dump == 'function') {
+ dump(text + '\\n'); // fast, straight to the real console
+ } else {
+ console.log(text);
+ }
+ },
+ canvas: document.getElementById('canvas'),
+ setStatus: function(text) {
+ if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
+ var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+ var statusElement = document.getElementById('status');
+ var progressElement = document.getElementById('progress');
+ if (m) {
+ text = m[1];
+ progressElement.value = parseInt(m[2])*100;
+ progressElement.max = parseInt(m[4])*100;
+ progressElement.hidden = false;
+ } else {
+ progressElement.value = null;
+ progressElement.max = null;
+ progressElement.hidden = true;
+ }
+ statusElement.innerHTML = text;
+ },
+ totalDependencies: 0,
+ monitorRunDependencies: function(left) {
+ this.totalDependencies = Math.max(this.totalDependencies, left);
+ Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
- statusElement.innerHTML = text;
- },
- totalDependencies: 0,
- monitorRunDependencies: function(left) {
- this.totalDependencies = Math.max(this.totalDependencies, left);
- Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
- }
- };
- Module.setStatus('Downloading...');
- </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + '''
- </body>
- </html>
- ''')
+ };
+ Module.setStatus('Downloading...');
+ </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + '''
+ </body>
+ </html>
+ ''')
+
+ self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0')
- self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0')
+ nonfastcomp(nfc)
def test_split_in_source_filenames(self):
- self.reftest(path_from_root('tests', 'htmltest.png'))
- output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '-g', '--split', '100', '--pre-js', 'reftest.js']).communicate()
- assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file'
- assert os.path.exists(os.path.join(self.get_dir(), 'something', 'hello_world_sdl.cpp.js')), 'must be functions js file'
- assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file'
-
- open(os.path.join(self.get_dir(), 'something.html'), 'w').write('''
-
- <!doctype html>
- <html lang="en-us">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Emscripten-Generated Code</title>
- <style>
- .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
- canvas.emscripten { border: 1px solid black; }
- textarea.emscripten { font-family: monospace; width: 80%; }
- div.emscripten { text-align: center; }
- </style>
- </head>
- <body>
- <hr/>
- <div class="emscripten" id="status">Downloading...</div>
- <div class="emscripten">
- <progress value="0" max="100" id="progress" hidden=1></progress>
- </div>
- <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
- <hr/>
- <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div>
- <hr/>
- <textarea class="emscripten" id="output" rows="8"></textarea>
- <hr>
- <script type='text/javascript'>
- // connect to canvas
- var Module = {
- preRun: [],
- postRun: [],
- print: (function() {
- var element = document.getElementById('output');
- element.value = ''; // clear browser cache
- return function(text) {
- // These replacements are necessary if you render to raw HTML
- //text = text.replace(/&/g, "&amp;");
- //text = text.replace(/</g, "&lt;");
- //text = text.replace(/>/g, "&gt;");
- //text = text.replace('\\n', '<br>', 'g');
- element.value += text + "\\n";
- element.scrollTop = element.scrollHeight; // focus on bottom
- };
- })(),
- printErr: function(text) {
- if (0) { // XXX disabled for safety typeof dump == 'function') {
- dump(text + '\\n'); // fast, straight to the real console
- } else {
- console.log(text);
- }
- },
- canvas: document.getElementById('canvas'),
- setStatus: function(text) {
- if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
- var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
- var statusElement = document.getElementById('status');
- var progressElement = document.getElementById('progress');
- if (m) {
- text = m[1];
- progressElement.value = parseInt(m[2])*100;
- progressElement.max = parseInt(m[4])*100;
- progressElement.hidden = false;
- } else {
- progressElement.value = null;
- progressElement.max = null;
- progressElement.hidden = true;
+ def nfc():
+ self.reftest(path_from_root('tests', 'htmltest.png'))
+ output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '-g', '--split', '100', '--pre-js', 'reftest.js']).communicate()
+ assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file'
+ assert os.path.exists(os.path.join(self.get_dir(), 'something', 'hello_world_sdl.cpp.js')), 'must be functions js file'
+ assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file'
+
+ open(os.path.join(self.get_dir(), 'something.html'), 'w').write('''
+
+ <!doctype html>
+ <html lang="en-us">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Emscripten-Generated Code</title>
+ <style>
+ .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
+ canvas.emscripten { border: 1px solid black; }
+ textarea.emscripten { font-family: monospace; width: 80%; }
+ div.emscripten { text-align: center; }
+ </style>
+ </head>
+ <body>
+ <hr/>
+ <div class="emscripten" id="status">Downloading...</div>
+ <div class="emscripten">
+ <progress value="0" max="100" id="progress" hidden=1></progress>
+ </div>
+ <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+ <hr/>
+ <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div>
+ <hr/>
+ <textarea class="emscripten" id="output" rows="8"></textarea>
+ <hr>
+ <script type='text/javascript'>
+ // connect to canvas
+ var Module = {
+ preRun: [],
+ postRun: [],
+ print: (function() {
+ var element = document.getElementById('output');
+ element.value = ''; // clear browser cache
+ return function(text) {
+ // These replacements are necessary if you render to raw HTML
+ //text = text.replace(/&/g, "&amp;");
+ //text = text.replace(/</g, "&lt;");
+ //text = text.replace(/>/g, "&gt;");
+ //text = text.replace('\\n', '<br>', 'g');
+ element.value += text + "\\n";
+ element.scrollTop = element.scrollHeight; // focus on bottom
+ };
+ })(),
+ printErr: function(text) {
+ if (0) { // XXX disabled for safety typeof dump == 'function') {
+ dump(text + '\\n'); // fast, straight to the real console
+ } else {
+ console.log(text);
+ }
+ },
+ canvas: document.getElementById('canvas'),
+ setStatus: function(text) {
+ if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
+ var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+ var statusElement = document.getElementById('status');
+ var progressElement = document.getElementById('progress');
+ if (m) {
+ text = m[1];
+ progressElement.value = parseInt(m[2])*100;
+ progressElement.max = parseInt(m[4])*100;
+ progressElement.hidden = false;
+ } else {
+ progressElement.value = null;
+ progressElement.max = null;
+ progressElement.hidden = true;
+ }
+ statusElement.innerHTML = text;
+ },
+ totalDependencies: 0,
+ monitorRunDependencies: function(left) {
+ this.totalDependencies = Math.max(this.totalDependencies, left);
+ Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
- statusElement.innerHTML = text;
- },
- totalDependencies: 0,
- monitorRunDependencies: function(left) {
- this.totalDependencies = Math.max(this.totalDependencies, left);
- Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
- }
- };
- Module.setStatus('Downloading...');
- </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + '''
- </body>
- </html>
- ''')
+ };
+ Module.setStatus('Downloading...');
+ </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + '''
+ </body>
+ </html>
+ ''')
- self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0')
+ self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0')
+
+ nonfastcomp(nfc)
def test_compression(self):
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(self.with_report_result(r'''
@@ -580,6 +584,45 @@ If manually bisecting:
shutil.rmtree(os.path.join(self.get_dir(), 'subdirr'))
self.run_browser('page.html', 'You should see two cool numbers', '/report_result?1')
+ def test_custom_file_package_url(self):
+ # a few files inside a directory
+ self.clear()
+ os.makedirs(os.path.join(self.get_dir(), 'subdirr'));
+ os.makedirs(os.path.join(self.get_dir(), 'cdn'));
+ open(os.path.join(self.get_dir(), 'subdirr', 'data1.txt'), 'w').write('''1214141516171819''')
+ # change the file package base dir to look in a "cdn". note that normally you would add this in your own custom html file etc., and not by
+ # modifying the existing shell in this manner
+ open(self.in_dir('shell.html'), 'w').write(open(path_from_root('src', 'shell.html')).read().replace('var Module = {', 'var Module = { filePackagePrefixURL: "cdn/", '))
+ open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(self.with_report_result(r'''
+ #include <stdio.h>
+ #include <string.h>
+ #include <emscripten.h>
+ int main() {
+ char buf[17];
+
+ FILE *f = fopen("subdirr/data1.txt", "r");
+ fread(buf, 1, 16, f);
+ buf[16] = 0;
+ fclose(f);
+ printf("|%s|\n", buf);
+ int result = !strcmp("1214141516171819", buf);
+
+ REPORT_RESULT();
+ return 0;
+ }
+ '''))
+
+ def test():
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--shell-file', 'shell.html', '--preload-file', 'subdirr/data1.txt', '-o', 'test.html']).communicate()
+ shutil.move('test.data', os.path.join('cdn', 'test.data'))
+ self.run_browser('test.html', '', '/report_result?1')
+
+ test()
+
+ # TODO: CORS, test using a full url for filePackagePrefixURL
+ #open(self.in_dir('shell.html'), 'w').write(open(path_from_root('src', 'shell.html')).read().replace('var Module = {', 'var Module = { filePackagePrefixURL: "http:/localhost:8888/cdn/", '))
+ #test()
+
def test_compressed_file(self):
open(os.path.join(self.get_dir(), 'datafile.txt'), 'w').write('compress this please' + (2000*'.'))
open(os.path.join(self.get_dir(), 'datafile2.txt'), 'w').write('moar' + (100*'!'))
@@ -617,6 +660,9 @@ If manually bisecting:
shutil.move(os.path.join(self.get_dir(), 'datafile.txt'), 'datafile.txt.renamedsoitcannotbefound');
self.run_browser('page.html', '', '/report_result?1')
+ def test_sdl_swsurface(self):
+ self.btest('sdl_swsurface.c', expected='1')
+
def test_sdl_image(self):
# load an image file, get pixel data. Also O2 coverage for --preload-file, and memory-init
shutil.copyfile(path_from_root('tests', 'screenshot.jpg'), os.path.join(self.get_dir(), 'screenshot.jpg'))
@@ -682,7 +728,13 @@ If manually bisecting:
self.btest('sdl_stb_image_data.c', reference='screenshot.jpg', args=['-s', 'STB_IMAGE=1', '--preload-file', 'screenshot.not'])
def test_sdl_canvas(self):
+ self.clear()
self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1'])
+ # some extra coverage
+ self.clear()
+ self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-s', '-O0', '-s', 'SAFE_HEAP=1'])
+ self.clear()
+ self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-s', '-O2', '-s', 'SAFE_HEAP=1'])
def test_sdl_canvas_proxy(self):
def post():
@@ -695,8 +747,11 @@ function assert(x, y) { if (!x) throw 'assertion failed ' + y }
var windowClose = window.close;
window.close = function() {
- doReftest();
- setTimeout(windowClose, 1000);
+ // wait for rafs to arrive and the screen to update before reftesting
+ setTimeout(function() {
+ doReftest();
+ setTimeout(windowClose, 1000);
+ }, 1000);
};
</script>
</body>''' % open('reftest.js').read())
@@ -707,7 +762,7 @@ window.close = function() {
self.btest('sdl_canvas_proxy.c', reference='sdl_canvas_proxy.png', args=['--proxy-to-worker', '--preload-file', 'data.txt'], manual_reference=True, post_build=post)
def test_sdl_canvas_alpha(self):
- self.btest('sdl_canvas_alpha.c', reference='sdl_canvas_alpha.png', reference_slack=1)
+ self.btest('sdl_canvas_alpha.c', reference='sdl_canvas_alpha.png', reference_slack=9)
def test_sdl_key(self):
open(os.path.join(self.get_dir(), 'pre.js'), 'w').write('''
@@ -737,7 +792,7 @@ window.close = function() {
''')
open(os.path.join(self.get_dir(), 'sdl_key.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_key.c')).read()))
- 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()
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'sdl_key.c'), '-o', 'page.html', '--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']''', '-s', 'NO_EXIT_RUNTIME=1']).communicate()
self.run_browser('page.html', '', '/report_result?223092870')
def test_sdl_key_proxy(self):
@@ -784,7 +839,7 @@ keydown(100);keyup(100); // trigger the end
</body>''')
open('test.html', 'w').write(html)
- self.btest('sdl_key_proxy.c', '223092870', args=['--proxy-to-worker', '--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']'''], manual_reference=True, post_build=post)
+ self.btest('sdl_key_proxy.c', '223092870', args=['--proxy-to-worker', '--pre-js', 'pre.js', '-s', '''EXPORTED_FUNCTIONS=['_main', '_one']''', '-s', 'NO_EXIT_RUNTIME=1'], manual_reference=True, post_build=post)
def test_sdl_text(self):
open(os.path.join(self.get_dir(), 'pre.js'), 'w').write('''
@@ -1110,8 +1165,6 @@ keydown(100);keyup(100); // trigger the end
self.run_browser('page.html', '', '/report_result?1')
def test_sdl_audio_beeps(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo c++ exceptions in fastcomp')
-
open(os.path.join(self.get_dir(), 'sdl_audio_beep.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_beep.cpp')).read()))
# use closure to check for a possible bug with closure minifying away newer Audio() attributes
@@ -1410,14 +1463,23 @@ keydown(100);keyup(100); // trigger the end
self.btest('emscripten_api_browser.cpp', '1', args=['-s', '''EXPORTED_FUNCTIONS=['_main', '_third']'''])
def test_emscripten_api2(self):
- open('script1.js', 'w').write('''
- Module._set(456);
- ''')
+ def setup():
+ open('script1.js', 'w').write('''
+ Module._set(456);
+ ''')
+ open('file1.txt', 'w').write('first');
+ open('file2.txt', 'w').write('second');
- open('file1.txt', 'w').write('first');
- open('file2.txt', 'w').write('second');
+ setup()
Popen([PYTHON, FILE_PACKAGER, 'test.data', '--preload', 'file1.txt', 'file2.txt'], stdout=open('script2.js', 'w')).communicate()
+ self.btest('emscripten_api_browser2.cpp', '1', args=['-s', '''EXPORTED_FUNCTIONS=['_main', '_set']'''])
+ # check using file packager to another dir
+ self.clear()
+ setup()
+ os.mkdir('sub')
+ Popen([PYTHON, FILE_PACKAGER, 'sub/test.data', '--preload', 'file1.txt', 'file2.txt'], stdout=open('script2.js', 'w')).communicate()
+ shutil.copyfile(os.path.join('sub', 'test.data'), 'test.data')
self.btest('emscripten_api_browser2.cpp', '1', args=['-s', '''EXPORTED_FUNCTIONS=['_main', '_set']'''])
def test_emscripten_api_infloop(self):
@@ -1433,11 +1495,6 @@ keydown(100);keyup(100); // trigger the end
def test_sdl_resize(self):
self.btest('sdl_resize.c', '1')
- def test_gc(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('flaky in fastcomp and also non-fastcomp -O1, timing issues')
-
- self.btest('browser_gc.cpp', '1')
-
def test_glshaderinfo(self):
self.btest('glshaderinfo.cpp', '1')
@@ -1481,7 +1538,7 @@ keydown(100);keyup(100); // trigger the end
self.btest('gles2_conformance.cpp', args=['-s', 'GL_ASSERTIONS=1'], expected=['1'])
def test_matrix_identity(self):
- self.btest('gl_matrix_identity.c', expected=['-1882984448', '460451840'], args=['-s', 'LEGACY_GL_EMULATION=1'])
+ self.btest('gl_matrix_identity.c', expected=['-1882984448', '460451840', '1588195328'], args=['-s', 'LEGACY_GL_EMULATION=1'])
def test_cubegeom_pre(self):
self.btest('cubegeom_pre.c', reference='cubegeom_pre.png', args=['-s', 'LEGACY_GL_EMULATION=1'])
@@ -1495,6 +1552,21 @@ keydown(100);keyup(100); // trigger the end
def test_cubegeom(self):
self.btest('cubegeom.c', reference='cubegeom.png', args=['-O2', '-g', '-s', 'LEGACY_GL_EMULATION=1'])
+ def test_cubegeom_proc(self):
+ open('side.c', 'w').write(r'''
+
+extern void* SDL_GL_GetProcAddress(const char *);
+
+void *glBindBuffer = 0; // same name as the gl function, to check that the collision does not break us
+
+void *getBindBuffer() {
+ if (!glBindBuffer) glBindBuffer = SDL_GL_GetProcAddress("glBindBuffer");
+ return glBindBuffer;
+}
+''')
+ for opts in [0, 1]:
+ self.btest('cubegeom_proc.c', reference='cubegeom.png', args=['-O' + str(opts), 'side.c', '-s', 'LEGACY_GL_EMULATION=1'])
+
def test_cubegeom_glew(self):
self.btest('cubegeom_glew.c', reference='cubegeom.png', args=['-O2', '--closure', '1', '-s', 'LEGACY_GL_EMULATION=1'])
@@ -1543,6 +1615,9 @@ keydown(100);keyup(100); // trigger the end
def test_cube_explosion(self):
self.btest('cube_explosion.c', reference='cube_explosion.png', args=['-s', 'LEGACY_GL_EMULATION=1'])
+ def test_glgettexenv(self):
+ self.btest('glgettexenv.c', args=['-s', 'LEGACY_GL_EMULATION=1'], expected=['1'])
+
def test_sdl_canvas_blank(self):
self.btest('sdl_canvas_blank.c', reference='sdl_canvas_blank.png')
@@ -1599,6 +1674,10 @@ keydown(100);keyup(100); // trigger the end
shutil.copyfile(path_from_root('tests', 'screenshot.dds'), os.path.join(self.get_dir(), 'screenshot.dds'))
self.btest('s3tc.c', reference='s3tc.png', args=['--preload-file', 'screenshot.dds', '-s', 'LEGACY_GL_EMULATION=1'])
+ def test_s3tc_ffp_only(self):
+ shutil.copyfile(path_from_root('tests', 'screenshot.dds'), os.path.join(self.get_dir(), 'screenshot.dds'))
+ self.btest('s3tc.c', reference='s3tc.png', args=['--preload-file', 'screenshot.dds', '-s', 'LEGACY_GL_EMULATION=1', '-s', 'GL_FFP_ONLY=1'])
+
def test_s3tc_crunch(self):
shutil.copyfile(path_from_root('tests', 'ship.dds'), 'ship.dds')
shutil.copyfile(path_from_root('tests', 'bloom.dds'), 'bloom.dds')
@@ -1622,7 +1701,7 @@ keydown(100);keyup(100); // trigger the end
self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', reference_slack=11, args=['--pre-js', 'asset_a.js', '--pre-js', 'asset_b.js', '-s', 'LEGACY_GL_EMULATION=1'])
def test_aniso(self):
- if SPIDERMONKEY_ENGINE in JS_ENGINES and os.environ.get('EMCC_FAST_COMPILER') != '1':
+ if SPIDERMONKEY_ENGINE in JS_ENGINES:
# asm.js-ification check
Popen([PYTHON, EMCC, path_from_root('tests', 'aniso.c'), '-O2', '-g2', '-s', 'LEGACY_GL_EMULATION=1']).communicate()
Settings.ASM_JS = 1
@@ -1686,10 +1765,10 @@ keydown(100);keyup(100); // trigger the end
self.btest('http.cpp', expected='0', args=['-I' + path_from_root('tests')])
def test_module(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- Popen([PYTHON, EMCC, path_from_root('tests', 'browser_module.cpp'), '-o', 'module.js', '-O2', '-s', 'SIDE_MODULE=1', '-s', 'DLOPEN_SUPPORT=1', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two"]']).communicate()
- self.btest('browser_main.cpp', args=['-O2', '-s', 'MAIN_MODULE=1', '-s', 'DLOPEN_SUPPORT=1'], expected='8')
+ def nfc():
+ Popen([PYTHON, EMCC, path_from_root('tests', 'browser_module.cpp'), '-o', 'module.js', '-O2', '-s', 'SIDE_MODULE=1', '-s', 'DLOPEN_SUPPORT=1', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two"]']).communicate()
+ self.btest('browser_main.cpp', args=['-O2', '-s', 'MAIN_MODULE=1', '-s', 'DLOPEN_SUPPORT=1'], expected='8')
+ nonfastcomp(nfc)
def test_mmap_file(self):
open(self.in_dir('data.dat'), 'w').write('data from the file ' + ('.' * 9000))
@@ -1768,3 +1847,41 @@ Module["preRun"].push(function () {
self.btest('doublestart.c', args=['--pre-js', 'pre.js', '-o', 'test.html'], expected='1')
+ def test_html5(self):
+ self.btest(path_from_root('tests', 'test_html5.c'), expected='0')
+
+ def test_html5_fullscreen(self):
+ self.btest(path_from_root('tests', 'test_html5_fullscreen.c'), expected='0')
+
+ def test_codemods(self):
+ for opt_level in [0, 2]:
+ print 'opt level', opt_level
+ opts = '-O' + str(opt_level)
+ # sanity checks, building with and without precise float semantics generates different results
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='2', args=[opts])
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='1', args=[opts, '-s', 'PRECISE_F32=1'])
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='1', args=[opts, '-s', 'PRECISE_F32=2']) # empty polyfill, but browser has support, so semantics are like float
+
+ # now use a shell to remove the browser's fround support
+ open(self.in_dir('shell.html'), 'w').write(open(path_from_root('src', 'shell.html')).read().replace('var Module = {', '''
+ Math.fround = null;
+ var Module = {
+ '''))
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='2', args=[opts, '--shell-file', 'shell.html'])
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='1', args=[opts, '--shell-file', 'shell.html', '-s', 'PRECISE_F32=1'])
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='2', args=[opts, '--shell-file', 'shell.html', '-s', 'PRECISE_F32=2']) # empty polyfill, no browser support, so semantics are like double
+
+ # finally, remove fround, patch up fround as the code executes (after polyfilling etc.), to verify that we got rid of it entirely on the client side
+ fixer = 'python fix.py'
+ open('fix.py', 'w').write(r'''
+import sys
+filename = sys.argv[1]
+js = open(filename).read()
+replaced = js.replace("var Math_fround = Math.fround;", "var Math_fround = Math.fround = function(x) { return 0; }")
+assert js != replaced
+open(filename, 'w').write(replaced)
+ ''')
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='2', args=[opts, '--shell-file', 'shell.html', '--js-transform', fixer]) # no fround anyhow
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='121378', args=[opts, '--shell-file', 'shell.html', '--js-transform', fixer, '-s', 'PRECISE_F32=1']) # proper polyfill was enstated, then it was replaced by the fix so 0 is returned all the time, hence a different result here
+ self.btest(path_from_root('tests', 'codemods.cpp'), expected='2', args=[opts, '--shell-file', 'shell.html', '--js-transform', fixer, '-s', 'PRECISE_F32=2']) # we should remove the calls to the polyfill ENTIRELY here, on the clientside, so we should NOT see any calls to fround here, and result should be like double
+
diff --git a/tests/test_core.py b/tests/test_core.py
index 458e04fb..6ea0614a 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -6,7 +6,7 @@ from tools.shared import *
from runner import RunnerCore, path_from_root, checked_sanity, test_modes, get_bullet_library
class T(RunnerCore): # Short name, to make it more fun to use manually on the commandline
- def is_le32(self):
+ def is_emscripten_abi(self):
return not ('i386-pc-linux-gnu' in COMPILER_OPTS or self.env.get('EMCC_LLVM_TARGET') == 'i386-pc-linux-gnu')
def test_hello_world(self):
@@ -352,8 +352,6 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
'''
self.do_run(src, '*4903566027370624, 153236438355333*')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
code = open(os.path.join(self.get_dir(), 'src.cpp.o.js')).read()
assert 'goog.math.Long' not in code, 'i64 precise math should not have been included if not actually used'
@@ -462,8 +460,6 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_float32_precise(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
Settings.PRECISE_F32 = 1
test_path = path_from_root('tests', 'core', 'test_float32_precise')
@@ -508,41 +504,62 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run(open(path_from_root('tests', 'sha1.c')).read(), 'SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6')
+ def test_asmjs_unknown_emscripten(self):
+ if self.emcc_args == None: return self.skip('needs emcc')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for asmjs-unknown-emscripten target test')
+ if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('fastcomp needed for asmjs-unknonw-emscripten target')
+ self.do_run(open(path_from_root('tests', 'asmjs-unknown-emscripten.c')).read(), '')
+
def test_cube2md5(self):
if self.emcc_args == None: return self.skip('needs emcc')
- if not self.is_le32(): return self.skip('le32 needed for accurate math')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math')
self.emcc_args += ['--embed-file', 'cube2md5.txt']
shutil.copyfile(path_from_root('tests', 'cube2md5.txt'), os.path.join(self.get_dir(), 'cube2md5.txt'))
self.do_run(open(path_from_root('tests', 'cube2md5.cpp')).read(), open(path_from_root('tests', 'cube2md5.ok')).read())
def test_cube2hash(self):
- try:
- old_chunk_size = os.environ.get('EMSCRIPT_MAX_CHUNK_SIZE') or ''
- os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = '1' # test splitting out each function to a chunk in emscripten.py (21 functions here)
-
- # A good test of i64 math
- if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2 C-style memory aliasing')
- self.do_run('', 'Usage: hashstring <seed>',
- libraries=self.get_library('cube2hash', ['cube2hash.bc'], configure=None),
- includes=[path_from_root('tests', 'cube2hash')])
-
- for text, output in [('fleefl', '892BDB6FD3F62E863D63DA55851700FDE3ACF30204798CE9'),
- ('fleefl2', 'AA2CC5F96FC9D540CA24FDAF1F71E2942753DB83E8A81B61'),
- ('64bitisslow', '64D8470573635EC354FEE7B7F87C566FCAF1EFB491041670')]:
- self.do_run('', 'hash value: ' + output, [text], no_build=True)
- finally:
- os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = old_chunk_size
-
- assert 'asm1' in test_modes
- if self.run_name == 'asm1' and not os.environ.get('EMCC_FAST_COMPILER'):
- assert Settings.RELOOP
- generated = open('src.cpp.o.js').read()
- main = generated[generated.find('function _main'):]
- main = main[:main.find('\n}')]
- num_vars = 0
- for v in re.findall('var [^;]+;', main):
- num_vars += v.count(',') + 1
- assert num_vars == 10, 'no variable elimination should have been run, but seeing %d' % num_vars
+ # extra testing for various codegen modes
+ for x86 in [0, 1] if self.run_name == 'asm2' else [0]:
+ print 'x86', x86
+ try:
+ old_x86 = os.environ.get('EMCC_LLVM_TARGET') or ''
+ if x86:
+ os.environ['EMCC_LLVM_TARGET'] = "i386-pc-linux-gnu"
+ try:
+ old_fastcomp = os.environ.get('EMCC_FAST_COMPILER') or ''
+ if x86:
+ os.environ['EMCC_FAST_COMPILER'] = "0"
+ try:
+ old_chunk_size = os.environ.get('EMSCRIPT_MAX_CHUNK_SIZE') or ''
+
+ for chunk_size in ['1', old_chunk_size]: # test splitting out each function to a chunk in emscripten.py (21 functions here)
+ print ' chunks', chunk_size
+ os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = chunk_size
+
+ # A good test of i64 math
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2 C-style memory aliasing')
+ self.do_run('', 'Usage: hashstring <seed>',
+ libraries=self.get_library('cube2hash', ['cube2hash.bc'], configure=None, cache_name_extra=str(x86)),
+ includes=[path_from_root('tests', 'cube2hash')])
+
+ for text, output in [('fleefl', '892BDB6FD3F62E863D63DA55851700FDE3ACF30204798CE9'),
+ ('fleefl2', 'AA2CC5F96FC9D540CA24FDAF1F71E2942753DB83E8A81B61'),
+ ('64bitisslow', '64D8470573635EC354FEE7B7F87C566FCAF1EFB491041670')]:
+ self.do_run('', 'hash value: ' + output, [text], no_build=True)
+ finally:
+ os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = old_chunk_size
+ finally:
+ if x86:
+ if old_fastcomp:
+ os.environ['EMCC_FAST_COMPILER'] = old_fastcomp
+ else:
+ del os.environ['EMCC_FAST_COMPILER']
+ finally:
+ if x86:
+ if old_x86:
+ os.environ['EMCC_LLVM_TARGET'] = old_x86
+ else:
+ del os.environ['EMCC_LLVM_TARGET']
def test_unaligned(self):
if Settings.QUANTUM_SIZE == 1: return self.skip('No meaning to unaligned addresses in q1')
@@ -578,7 +595,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
# TODO: A version of this with int64s as well
- if self.is_le32():
+ if self.is_emscripten_abi():
return self.skip('LLVM marks the reads of s as fully aligned, making this test invalid')
else:
self.do_run(src, '*12 : 1 : 12\n328157500735811.0,23,416012775903557.0,99\n')
@@ -658,7 +675,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
}
'''
- if self.is_le32():
+ if self.is_emscripten_abi():
self.do_run(src, '''16,32
0,8,8,8
16,24,24,24
@@ -840,7 +857,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_math_lgamma(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if not self.is_le32(): return self.skip('le32 needed for accurate math')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math')
test_path = path_from_root('tests', 'math', 'lgamma')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -955,7 +972,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
for named in (0, 1):
print named
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and named: continue # no named globals in fastcomp
+ if os.environ.get('EMCC_FAST_COMPILER') != '0' and named: continue # no named globals in fastcomp
Settings.NAMED_GLOBALS = named
self.do_run_from_file(src, output, ['wowie', 'too', '74'])
@@ -1117,74 +1134,56 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_longjmp(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- test_path = path_from_root('tests', 'core', 'test_longjmp')
- src, output = (test_path + s for s in ('.in', '.out'))
-
- self.do_run_from_file(src, output)
+ test_path = path_from_root('tests', 'core', 'test_longjmp')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
def test_longjmp2(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp2')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_longjmp3(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp3')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_longjmp4(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp4')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_longjmp_funcptr(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp_funcptr')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_longjmp_repeat(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- Settings.MAX_SETJMPS = 1
-
- test_path = path_from_root('tests', 'core', 'test_longjmp_repeat')
- src, output = (test_path + s for s in ('.in', '.out'))
-
- self.do_run_from_file(src, output)
+ if os.environ.get('EMCC_FAST_COMPILER') == '0': Settings.MAX_SETJMPS = 1 # todo: do this more strict thing in fastcomp too
+ test_path = path_from_root('tests', 'core', 'test_longjmp_repeat')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
def test_longjmp_stacked(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp_stacked')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
-
def test_longjmp_exc(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
test_path = path_from_root('tests', 'core', 'test_longjmp_exc')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
+ def test_longjmp_throw(self):
+ for disable_throw in [0, 1]:
+ print disable_throw
+ Settings.DISABLE_EXCEPTION_CATCHING = disable_throw
+ test_path = path_from_root('tests', 'core', 'test_longjmp_throw')
+ src, output = (test_path + s for s in ('.cpp', '.out'))
+ self.do_run_from_file(src, output)
+
def test_setjmp_many(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp: make MAX_SETJMPS take effect')
src = r'''
#include <stdio.h>
@@ -1269,7 +1268,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
}
catch (MyException & e)
{
- std::cout << "Catched...";
+ std::cout << "Caught...";
}
try
@@ -1278,7 +1277,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
}
catch (MyException e)
{
- std::cout << "Catched...";
+ std::cout << "Caught...";
}
return 0;
@@ -1288,34 +1287,40 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
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...')
+ self.do_run(src, 'Throw...Construct...Caught...Destruct...Throw...Construct...Copy...Caught...Destruct...Destruct...')
- def test_exception_2(self):
+ def test_exceptions_2(self):
if self.emcc_args is None: return self.skip('need emcc to add in libcxx properly')
- Settings.DISABLE_EXCEPTION_CATCHING = 0
-
- test_path = path_from_root('tests', 'core', 'test_exception_2')
- src, output = (test_path + s for s in ('.in', '.out'))
-
- self.do_run_from_file(src, output)
+ if self.run_name == 'asm2x86': return self.skip('TODO')
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
- def test_white_list_exception(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ for safe in [0,1]:
+ print safe
+ Settings.SAFE_HEAP = safe
+ test_path = path_from_root('tests', 'core', 'test_exceptions_2')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
+ def test_exceptions_white_list(self):
Settings.DISABLE_EXCEPTION_CATCHING = 2
Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"]
Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified
- test_path = path_from_root('tests', 'core', 'test_white_list_exception')
+ test_path = path_from_root('tests', 'core', 'test_exceptions_white_list')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
- Settings.DISABLE_EXCEPTION_CATCHING = 0
- Settings.EXCEPTION_CATCHING_WHITELIST = []
+ def test_exceptions_white_list_2(self):
+ Settings.DISABLE_EXCEPTION_CATCHING = 2
+ Settings.EXCEPTION_CATCHING_WHITELIST = ["_main"]
+ Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified
+
+ test_path = path_from_root('tests', 'core', 'test_exceptions_white_list_2')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
- def test_uncaught_exception(self):
+ def test_exceptions_uncaught(self):
if self.emcc_args is None: return self.skip('no libcxx inclusion without emcc')
Settings.DISABLE_EXCEPTION_CATCHING = 0
@@ -1354,33 +1359,37 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
'''
self.do_run(src, 'success')
- def test_typed_exceptions(self):
- Settings.DISABLE_EXCEPTION_CATCHING = 0
- Settings.SAFE_HEAP = 0 # Throwing null will cause an ignorable null pointer access.
- src = open(path_from_root('tests', 'exceptions', 'typed.cpp'), 'r').read()
- expected = open(path_from_root('tests', 'exceptions', 'output.txt'), 'r').read()
- self.do_run(src, expected)
-
- def test_multiexception(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
+ def test_exceptions_typed(self):
Settings.DISABLE_EXCEPTION_CATCHING = 0
+ Settings.SAFE_HEAP = 0 # Throwing null will cause an ignorable null pointer access.
- test_path = path_from_root('tests', 'core', 'test_multiexception')
+ test_path = path_from_root('tests', 'core', 'test_exceptions_typed')
src, output = (test_path + s for s in ('.in', '.out'))
self.do_run_from_file(src, output)
- def test_std_exception(self):
+ def test_exceptions_multi(self):
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
+ test_path = path_from_root('tests', 'core', 'test_exceptions_multi')
+ src, output = (test_path + s for s in ('.in', '.out'))
+ self.do_run_from_file(src, output)
+
+ def test_exceptions_std(self):
if self.emcc_args is None: return self.skip('requires emcc')
Settings.DISABLE_EXCEPTION_CATCHING = 0
self.emcc_args += ['-s', 'SAFE_HEAP=0']
- test_path = path_from_root('tests', 'core', 'test_std_exception')
+ test_path = path_from_root('tests', 'core', 'test_exceptions_std')
src, output = (test_path + s for s in ('.in', '.out'))
self.do_run_from_file(src, output)
+ def test_exceptions_alias(self):
+ Settings.DISABLE_EXCEPTION_CATCHING = 0
+ test_path = path_from_root('tests', 'core', 'test_exceptions_alias')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
+
def test_async_exit(self):
open('main.c', 'w').write(r'''
#include <stdio.h>
@@ -1486,7 +1495,6 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
def test_segfault(self):
if self.emcc_args is None: return self.skip('SAFE_HEAP without ta2 means we check types too, which hide segfaults')
- if Settings.ASM_JS: return self.skip('asm does not support safe heap')
Settings.SAFE_HEAP = 1
@@ -1547,7 +1555,9 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
return 0;
}
'''.replace('COND', '==' if cond else '!=').replace('BODY', r'{ printf("all good\n"); }' if body else '')
- self.do_run(src, 'dyncall error: vi' if not work else 'all good')
+ # typically we get the dyncall error message from SAFE_DYNCALLS, however llvm opts can devirtualize the
+ # call in -O2, leading to the much nicer error message specifically about the missing function
+ self.do_run(src, ('dyncall error: vi', 'missing function: _ZN2D14doItEv') if not work else 'all good')
def test_dynamic_cast(self):
if self.emcc_args is None: return self.skip('need libcxxabi')
@@ -1606,6 +1616,8 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_alloca(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('non-ta2 may have unaligned allocas')
+
test_path = path_from_root('tests', 'core', 'test_alloca')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -1869,7 +1881,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
# Compressed memory. Note that sizeof() does give the fat sizes, however!
self.do_run(src, '*0,0,0,1,2,3,4,5*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*12,20,5*')
else:
- if self.is_le32():
+ if self.is_emscripten_abi():
self.do_run(src, '*0,0,0,4,8,16,20,24*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*16,24,24*')
else:
self.do_run(src, '*0,0,0,4,8,12,16,20*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*12,20,20*')
@@ -1897,8 +1909,6 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output, [], lambda x, err: x.replace('\n', '*'))
def test_llvm_used(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('pnacl kills llvm_used')
-
Building.LLVM_OPTS = 3
test_path = path_from_root('tests', 'core', 'test_llvm_used')
@@ -1932,9 +1942,16 @@ def process(filename):
self.emcc_args += ['--closure', '1'] # Use closure here for some additional coverage
self.do_run(open(path_from_root('tests', 'emscripten_get_now.cpp')).read(), 'Timer resolution is good.')
+ def test_emscripten_get_compiler_setting(self):
+ test_path = path_from_root('tests', 'core', 'emscripten_get_compiler_setting')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run(open(src).read(), 'You must build with -s RETAIN_COMPILER_SETTINGS=1')
+ Settings.RETAIN_COMPILER_SETTINGS = 1
+ self.do_run(open(src).read(), open(output).read().replace('waka', EMSCRIPTEN_VERSION))
+
def test_inlinejs(self):
- if not self.is_le32(): return self.skip('le32 needed for inline js')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp only supports EM_ASM')
test_path = path_from_root('tests', 'core', 'test_inlinejs')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -1946,8 +1963,8 @@ def process(filename):
for i in range(1, 5): assert ('comment%d' % i) in out
def test_inlinejs2(self):
- if not self.is_le32(): return self.skip('le32 needed for inline js')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp only supports EM_ASM')
test_path = path_from_root('tests', 'core', 'test_inlinejs2')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -1961,8 +1978,7 @@ def process(filename):
self.do_run_from_file(src, output)
def test_memorygrowth(self):
- if Settings.USE_TYPED_ARRAYS == 0: return self.skip('memory growth is only supported with typed arrays')
- if Settings.ASM_JS: return self.skip('asm does not support memory growth yet')
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('memory growth is only supported with typed arrays mode 2')
# With typed arrays in particular, it is dangerous to use more memory than TOTAL_MEMORY,
# since we then need to enlarge the heap(s).
@@ -2078,8 +2094,6 @@ def process(filename):
def test_bigswitch(self):
if self.run_name != 'default': return self.skip('TODO: issue #781')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
src = open(path_from_root('tests', 'bigswitch.cpp')).read()
self.do_run(src, '''34962: GL_ARRAY_BUFFER (0x8892)
26214: what?
@@ -2087,8 +2101,6 @@ def process(filename):
''', args=['34962', '26214', '35040'])
def test_indirectbr(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
Building.COMPILER_TEST_OPTS = filter(lambda x: x != '-g', Building.COMPILER_TEST_OPTS)
test_path = path_from_root('tests', 'core', 'test_indirectbr')
@@ -2097,8 +2109,6 @@ def process(filename):
self.do_run_from_file(src, output)
def test_indirectbr_many(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('blockaddr > 255 requires ta2')
test_path = path_from_root('tests', 'core', 'test_indirectbr_many')
@@ -2142,7 +2152,7 @@ def process(filename):
def test_varargs(self):
if Settings.QUANTUM_SIZE == 1: return self.skip('FIXME: Add support for this')
- if not self.is_le32(): return self.skip('we do not support all varargs stuff without le32')
+ if not self.is_emscripten_abi(): return self.skip('we do not support all varargs stuff without asmjs-unknown-emscripten')
test_path = path_from_root('tests', 'core', 'test_varargs')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -2151,7 +2161,7 @@ def process(filename):
def test_varargs_byval(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('FIXME: Add support for this')
- if self.is_le32(): return self.skip('clang cannot compile this code with that target yet')
+ if self.is_emscripten_abi(): return self.skip('clang cannot compile this code with that target yet')
src = r'''
#include <stdio.h>
@@ -2346,6 +2356,7 @@ The current type of b is: 9
src = '''
#include <stdio.h>
#include <stdlib.h>
+ #include <ctype.h>
#include <sys/time.h>
void clean()
@@ -2390,11 +2401,13 @@ The current type of b is: 9
printf("*malloc(0)!=0:%d*\\n", malloc(0) != 0); // We should not fail horribly
+ printf("tolower_l: %c\\n", tolower_l('A', 0));
+
return 0;
}
'''
- self.do_run(src, '*1,2,3,5,5,6*\n*stdin==0:0*\n*%*\n*5*\n*66.0*\n*10*\n*0*\n*-10*\n*18*\n*10*\n*0*\n*4294967286*\n*malloc(0)!=0:1*\n*cleaned*')
+ self.do_run(src, '*1,2,3,5,5,6*\n*stdin==0:0*\n*%*\n*5*\n*66.0*\n*10*\n*0*\n*-10*\n*18*\n*10*\n*0*\n*4294967286*\n*malloc(0)!=0:1*\ntolower_l: a\n*cleaned*')
src = r'''
#include <stdio.h>
@@ -2544,8 +2557,6 @@ The current type of b is: 9
self.do_run_from_file(src, output)
def test_intentional_fault(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and self.run_name == 'default': return self.skip('todo in fastcomp in default')
-
# Some programs intentionally segfault themselves, we should compile that into a throw
src = r'''
int main () {
@@ -2599,6 +2610,18 @@ The current type of b is: 9
self.do_run_from_file(src, output)
+ def test_memcpy3(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('need ta2')
+ test_path = path_from_root('tests', 'core', 'test_memcpy3')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
+
+ def test_memset(self):
+ if Settings.USE_TYPED_ARRAYS != 2: return self.skip('need ta2')
+ test_path = path_from_root('tests', 'core', 'test_memset')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
+
def test_getopt(self):
if self.emcc_args is None: return self.skip('needs emcc for libc')
@@ -2747,7 +2770,7 @@ The current type of b is: 9
self.do_run(main, 'supp: 54,2\nmain: 56\nsupp see: 543\nmain see: 76\nok.')
def can_dlfcn(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1':
+ if os.environ.get('EMCC_FAST_COMPILER') != '0':
self.skip('todo in fastcomp')
return False
@@ -2762,8 +2785,8 @@ The current type of b is: 9
else:
Settings.NAMED_GLOBALS = 1
- if not self.is_le32():
- self.skip('need le32 for dlfcn support')
+ if not self.is_emscripten_abi():
+ self.skip('need asmjs-unknown-emscripten for dlfcn support')
return False
else:
return True
@@ -2836,6 +2859,46 @@ def process(filename):
self.do_run(src, 'Constructing main object.\nConstructing lib object.\n',
post_build=self.dlfcn_post_build)
+ def test_dlfcn_i64(self):
+ if not self.can_dlfcn(): return
+ if not Settings.ASM_JS: return self.skip('TODO')
+
+ self.prep_dlfcn_lib()
+ Settings.EXPORTED_FUNCTIONS = ['_foo']
+ lib_src = '''
+ int foo(int x) {
+ return (long long)x / (long long)1234;
+ }
+ '''
+ dirname = self.get_dir()
+ filename = os.path.join(dirname, 'liblib.c')
+ self.build(lib_src, dirname, filename)
+ shutil.move(filename + '.o.js', os.path.join(dirname, 'liblib.so'))
+
+ self.prep_dlfcn_main()
+ Settings.EXPORTED_FUNCTIONS = ['_main']
+ src = r'''
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <dlfcn.h>
+
+ typedef int (*intfunc)(int);
+
+ void *p;
+
+ int main() {
+ p = malloc(1024);
+ void *lib_handle = dlopen("liblib.so", 0);
+ printf("load %p\n", lib_handle);
+ intfunc x = (intfunc)dlsym(lib_handle, "foo");
+ printf("foo func %p\n", x);
+ if (p == 0) return 1;
+ printf("|%d|\n", x(81234567));
+ return 0;
+ }
+ '''
+ self.do_run(src, '|65830|', post_build=self.dlfcn_post_build)
+
def test_dlfcn_qsort(self):
if not self.can_dlfcn(): return
@@ -3129,7 +3192,7 @@ def process(filename):
def test_dlfcn_self(self):
if Settings.USE_TYPED_ARRAYS == 1: return self.skip('Does not work with USE_TYPED_ARRAYS=1')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
Settings.DLOPEN_SUPPORT = 1
def post(filename):
@@ -3223,6 +3286,7 @@ def process(filename):
#include <assert.h>
#include <stdio.h>
#include <dlfcn.h>
+ #include <string.h>
typedef int (*FUNCTYPE)(const char *);
@@ -3233,6 +3297,10 @@ def process(filename):
snprintf(str, sizeof(str), "foobar");
+ // HACK: Use strcmp in the main executable so that it doesn't get optimized out and the dynamic library
+ // is able to use it.
+ assert(!strcmp(str, "foobar"));
+
lib_handle = dlopen("liblib.so", RTLD_NOW);
assert(lib_handle != NULL);
@@ -3245,7 +3313,7 @@ def process(filename):
return 0;
}
'''
- Settings.EXPORTED_FUNCTIONS = ['_main', '_malloc']
+ Settings.EXPORTED_FUNCTIONS = ['_main', '_malloc', '_strcmp']
self.do_run(src, 'success', force_c=True, post_build=self.dlfcn_post_build)
def test_dlfcn_funcs(self):
@@ -3510,52 +3578,52 @@ ok
''', post_build=self.dlfcn_post_build)
def test_rand(self):
- return self.skip('rand() is now random') # FIXME
-
- src = r'''
- #include <stdio.h>
- #include <stdlib.h>
-
- int main() {
- printf("%d\n", rand());
- printf("%d\n", rand());
+ src = r'''#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+int main()
+{
+ // we need RAND_MAX to be a bitmask (power of 2 minus 1). this assertions guarantees
+ // if RAND_MAX changes the test failure will focus attention on that issue here.
+ assert(RAND_MAX == 0x7fffffff);
- srand(123);
- printf("%d\n", rand());
- printf("%d\n", rand());
- srand(123);
- printf("%d\n", rand());
+ srand(0xdeadbeef);
+ for(int i = 0; i < 10; ++i)
printf("%d\n", rand());
- unsigned state = 0;
- int r;
- r = rand_r(&state);
- printf("%d, %u\n", r, state);
- r = rand_r(&state);
- printf("%d, %u\n", r, state);
- state = 0;
- r = rand_r(&state);
- printf("%d, %u\n", r, state);
+ unsigned int seed = 0xdeadbeef;
+ for(int i = 0; i < 10; ++i)
+ printf("%d\n", rand_r(&seed));
- return 0;
- }
- '''
- expected = '''
- 1250496027
- 1116302336
- 440917656
- 1476150784
- 440917656
- 1476150784
- 12345, 12345
- 1406932606, 3554416254
- 12345, 12345
- '''
- self.do_run(src, re.sub(r'(^|\n)\s+', r'\1', expected))
+ return 0;
+}
+'''
+ expected = '''2073540312
+730128159
+1365227432
+1337224527
+792390264
+1952655743
+983994184
+1982845871
+1210574360
+1479617503
+2073540312
+730128159
+1365227432
+1337224527
+792390264
+1952655743
+983994184
+1982845871
+1210574360
+1479617503
+'''
+ self.do_run(src, expected)
def test_strtod(self):
if self.emcc_args is None: return self.skip('needs emcc for libc')
- if not self.is_le32(): return self.skip('le32 needed for accurate math')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math')
src = r'''
#include <stdio.h>
@@ -3703,9 +3771,15 @@ ok
self.do_run_from_file(src, output)
+ def test_fnmatch(self):
+ if self.emcc_args is None: return self.skip('requires linking in libc++')
+ test_path = path_from_root('tests', 'core', 'fnmatch')
+ src, output = (test_path + s for s in ('.c', '.out'))
+ self.do_run_from_file(src, output)
+
def test_sscanf(self):
if self.emcc_args is None: return self.skip('needs emcc for libc')
- if not self.is_le32(): return self.skip('le32 needed for accurate math')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math')
test_path = path_from_root('tests', 'core', 'test_sscanf')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -3812,7 +3886,6 @@ Pass: 0.000012 0.000012''')
def test_sscanf_6(self):
test_path = path_from_root('tests', 'core', 'test_sscanf_6')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_sscanf_skip(self):
@@ -3894,9 +3967,9 @@ def process(filename):
post = '''
def process(filename):
src = \'\'\'
- var data = [10, 20, 40, 30];
var Module = {
- stdin: function() { return data.pop() || null },
+ data: [10, 20, 40, 30],
+ stdin: function() { return Module.data.pop() || null },
stdout: function(x) { Module.print('got: ' + x) }
};
\'\'\' + open(filename, 'r').read()
@@ -3917,6 +3990,10 @@ def process(filename):
'''
self.do_run(src, ('got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1\n', 'isatty? 0,0,1\ngot: 35\ngot: 45\ngot: 25\ngot: 15\n'), post_build=post)
+ def test_mount(self):
+ src = open(path_from_root('tests', 'fs', 'test_mount.c'), 'r').read()
+ self.do_run(src, 'success', force_c=True)
+
def test_fwrite_0(self):
test_path = path_from_root('tests', 'core', 'test_fwrite_0')
src, output = (test_path + s for s in ('.in', '.out'))
@@ -3990,6 +4067,28 @@ def process(filename):
self.emcc_args += ['--embed-file', 'three_numbers.txt']
self.do_run(src, 'match = 3\nx = -1.0, y = 0.1, z = -0.1\n')
+ def test_fileno(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+ open(os.path.join(self.get_dir(), 'empty.txt'), 'w').write('')
+ src = r'''
+ #include <stdio.h>
+ #include <unistd.h>
+ int main()
+ {
+ FILE* fp = fopen("empty.txt", "r");
+ if (fp) {
+ printf("%d\n", fp);
+ printf("%d\n", fileno(fp));
+ printf("%d\n", fileno((FILE*)42)); // nonexistent stream
+ } else {
+ printf("failed to open empty.txt\n");
+ }
+ return 0;
+ }
+ '''
+ self.emcc_args += ['--embed-file', 'empty.txt']
+ self.do_run(src, '4\n3\n-1\n')
+
def test_readdir(self):
src = open(path_from_root('tests', 'dirent', 'test_readdir.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
@@ -4084,8 +4183,7 @@ def process(filename):
def test_utf32(self):
if self.emcc_args is None: return self.skip('need libc for wcslen()')
- if not self.is_le32(): return self.skip('this test uses inline js, which requires le32')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if not self.is_emscripten_abi(): return self.skip('this test uses inline js, which requires asmjs-unknown-emscripten')
self.do_run(open(path_from_root('tests', 'utf32.cpp')).read(), 'OK.')
self.do_run(open(path_from_root('tests', 'utf32.cpp')).read(), 'OK.', args=['-fshort-wchar'])
@@ -4142,13 +4240,13 @@ def process(filename):
def test_fs_nodefs_rw(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
src = open(path_from_root('tests', 'fs', 'test_nodefs_rw.c'), 'r').read()
self.do_run(src, 'success', force_c=True, js_engines=[NODE_JS])
def test_unistd_access(self):
self.clear()
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
src = open(path_from_root('tests', 'unistd', 'access.c'), 'r').read()
expected = open(path_from_root('tests', 'unistd', 'access.out'), 'r').read()
@@ -4156,7 +4254,7 @@ def process(filename):
self.do_run(src, expected, js_engines=[NODE_JS])
def test_unistd_curdir(self):
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
src = open(path_from_root('tests', 'unistd', 'curdir.c'), 'r').read()
expected = open(path_from_root('tests', 'unistd', 'curdir.out'), 'r').read()
self.do_run(src, expected)
@@ -4187,7 +4285,7 @@ def process(filename):
def test_unistd_truncate(self):
self.clear()
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
src = open(path_from_root('tests', 'unistd', 'truncate.c'), 'r').read()
expected = open(path_from_root('tests', 'unistd', 'truncate.out'), 'r').read()
@@ -4216,7 +4314,7 @@ def process(filename):
def test_unistd_unlink(self):
self.clear()
if self.emcc_args is None: return self.skip('requires emcc')
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
src = open(path_from_root('tests', 'unistd', 'unlink.c'), 'r').read()
Building.COMPILER_TEST_OPTS += ['-D' + fs]
@@ -4224,7 +4322,7 @@ def process(filename):
def test_unistd_links(self):
self.clear()
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
if WINDOWS and fs == 'NODEFS':
print >> sys.stderr, 'Skipping NODEFS part of this test for test_unistd_links on Windows, since it would require administrative privileges.'
@@ -4244,7 +4342,7 @@ def process(filename):
def test_unistd_io(self):
self.clear()
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
if self.run_name == 'o2': return self.skip('non-asm optimized builds can fail with inline js')
if self.emcc_args is None: return self.skip('requires emcc')
for fs in ['MEMFS', 'NODEFS']:
@@ -4255,7 +4353,7 @@ def process(filename):
def test_unistd_misc(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if not self.is_le32(): return self.skip('le32 needed for inline js')
+ if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js')
for fs in ['MEMFS', 'NODEFS']:
src = open(path_from_root('tests', 'unistd', 'misc.c'), 'r').read()
expected = open(path_from_root('tests', 'unistd', 'misc.out'), 'r').read()
@@ -4284,6 +4382,12 @@ def process(filename):
self.do_run_from_file(src, output)
+ def test_nl_types(self):
+ test_path = path_from_root('tests', 'core', 'test_nl_types')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
+
def test_799(self):
src = open(path_from_root('tests', '799.cpp'), 'r').read()
self.do_run(src, '''Set PORT family: 0, port: 3979
@@ -4316,6 +4420,11 @@ PORT: 3979
self.do_run_from_file(src, output)
+ def test_netinet_in(self):
+ src = open(path_from_root('tests', 'netinet', 'in.cpp'), 'r').read()
+ expected = open(path_from_root('tests', 'netinet', 'in.out'), 'r').read()
+ self.do_run(src, expected)
+
# libc++ tests
def test_iostream(self):
@@ -4431,13 +4540,58 @@ PORT: 3979
'''
self.do_run(src, 'value\narray_item1\narray_item2\narray_item3\n3\n3.00\n2.20\nJansson: Node with ID `0` not found. Context has `10` nodes.\n0\nJansson: No JSON context.\njansson!')
+ def test_constglobalunion(self):
+ if self.emcc_args is None: return self.skip('needs emcc')
+ self.emcc_args += ['-s', 'EXPORT_ALL=1']
+
+ self.do_run(r'''
+#include <stdio.h>
+
+struct one_const {
+ long a;
+};
+
+struct two_consts {
+ long a;
+ long b;
+};
+
+union some_consts {
+ struct one_const one;
+ struct two_consts two;
+};
+
+union some_consts my_consts = {{
+ 1
+}};
+
+struct one_const addr_of_my_consts = {
+ (long)(&my_consts)
+};
+
+int main(void) {
+ printf("%li\n", !!addr_of_my_consts.a);
+ return 0;
+}
+ ''', '1')
+
### 'Medium' tests
def test_fannkuch(self):
+ try:
+ if self.run_name == 'slow2' or self.run_name == 'slow2asm':
+ old_target = os.environ.get('EMCC_LLVM_TARGET') or ''
+ os.environ['EMCC_LLVM_TARGET'] = "asmjs-unknown-emscripten" # testing for asm-emscripten target on non-fastcomp
results = [ (1,0), (2,1), (3,2), (4,4), (5,7), (6,10), (7, 16), (8,22) ]
for i, j in results:
src = open(path_from_root('tests', 'fannkuch.cpp'), 'r').read()
self.do_run(src, 'Pfannkuchen(%d) = %d.' % (i,j), [str(i)], no_build=i>1)
+ finally:
+ if self.run_name == 'slow2' or self.run_name == 'slow2asm':
+ if old_target:
+ os.environ['EMCC_LLVM_TARGET'] = old_target
+ else:
+ del os.environ['EMCC_LLVM_TARGET']
def test_raytrace(self):
if self.emcc_args is None: return self.skip('requires emcc')
@@ -4598,31 +4752,14 @@ return malloc(size);
self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('skipping extra parts in fastcomp')
-
- assert 'asm2g' in test_modes
- if self.run_name == 'asm2g':
- results = {}
- original = open('src.cpp.o.js').read()
- results[Settings.ALIASING_FUNCTION_POINTERS] = len(original)
- Settings.ALIASING_FUNCTION_POINTERS = 1 - Settings.ALIASING_FUNCTION_POINTERS
- self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp')
- final = open('src.cpp.o.js').read()
- results[Settings.ALIASING_FUNCTION_POINTERS] = len(final)
- open('original.js', 'w').write(original)
- print results
- assert results[1] < 0.99*results[0]
- assert ' & 3]()' in original, 'small function table exists'
- assert ' & 3]()' not in final, 'small function table does not exist'
- assert ' & 255]()' not in original, 'big function table does not exist'
- assert ' & 255]()' in final, 'big function table exists'
-
assert 'asm1' in test_modes
if self.run_name == 'asm1':
+ print 'verifing postsets'
generated = open('src.cpp.o.js').read()
+ generated = re.sub(r'\n+[ \n]*\n+', '\n', generated)
main = generated[generated.find('function runPostSets'):]
main = main[:main.find('\n}')]
- assert main.count('\n') == 7, 'must not emit too many postSets: %d' % main.count('\n')
+ assert main.count('\n') <= 7, ('must not emit too many postSets: %d' % main.count('\n')) + ' : ' + main
def test_simd(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('needs ta2')
@@ -4653,9 +4790,9 @@ return malloc(size);
self.do_run_from_file(src, output)
def test_gcc_unmangler(self):
- if os.environ.get('EMCC_FAST_COMPILER') != '1': Settings.NAMED_GLOBALS = 1 # test coverage for this
+ if os.environ.get('EMCC_FAST_COMPILER') == '0': Settings.NAMED_GLOBALS = 1 # test coverage for this; fastcomp never names globals
- Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('third_party')]
+ Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('third_party'), '-Wno-warn-absolute-paths']
self.do_run(open(path_from_root('third_party', 'gcc_demangler.c')).read(), '*d_demangle(char const*, int, unsigned int*)*', args=['_ZL10d_demanglePKciPj'])
@@ -4672,7 +4809,6 @@ return malloc(size);
def test_lua(self):
if self.emcc_args is None: return self.skip('requires emcc')
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: make this work')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
for aggro in ([0, 1] if Settings.ASM_JS and '-O2' in self.emcc_args else [0]):
print aggro
@@ -4693,7 +4829,6 @@ return malloc(size);
def test_freetype(self):
if self.emcc_args is None: return self.skip('requires emcc')
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: Figure out and try to fix')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
assert 'asm2g' in test_modes
if self.run_name == 'asm2g':
@@ -4754,7 +4889,7 @@ def process(filename):
def test_sqlite(self):
# 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 not self.is_le32(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3')
+ if not self.is_emscripten_abi(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3')
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO FIXME')
self.banned_js_engines = [NODE_JS] # OOM in older node
@@ -4810,12 +4945,16 @@ def process(filename):
Settings.SAFE_HEAP_LINES = ['btVoronoiSimplexSolver.h:40', 'btVoronoiSimplexSolver.h:41',
'btVoronoiSimplexSolver.h:42', 'btVoronoiSimplexSolver.h:43']
+ asserts = Settings.ASSERTIONS
+
for use_cmake in [False, True]: # If false, use a configure script to configure Bullet build.
print 'cmake', use_cmake
# Windows cannot run configure sh scripts.
if WINDOWS and not use_cmake:
continue
+ Settings.ASSERTIONS = 2 if use_cmake else asserts # extra testing for ASSERTIONS == 2
+
def test():
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
@@ -4826,7 +4965,7 @@ def process(filename):
test()
assert 'asm2g' in test_modes
- if self.run_name == 'asm2g' and not use_cmake and os.environ.get('EMCC_FAST_COMPILER') != '1':
+ if self.run_name == 'asm2g' and not use_cmake and os.environ.get('EMCC_FAST_COMPILER') == '0':
# Test forced alignment
print >> sys.stderr, 'testing FORCE_ALIGNED_MEMORY'
old = open('src.cpp.o.js').read()
@@ -4839,7 +4978,6 @@ def process(filename):
def test_poppler(self):
if self.emcc_args is None: return self.skip('very slow, we only do this in emcc runs')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
Settings.CORRECT_OVERFLOWS = 1
Settings.CORRECT_SIGNS = 1
@@ -4847,6 +4985,7 @@ def process(filename):
Building.COMPILER_TEST_OPTS += [
'-I' + path_from_root('tests', 'freetype', 'include'),
'-I' + path_from_root('tests', 'poppler', 'include'),
+ '-Wno-warn-absolute-paths'
]
Settings.INVOKE_RUN = 0 # We append code that does run() ourselves
@@ -5001,7 +5140,9 @@ def process(filename):
def clean(text):
text = text.replace('\n\n', '\n').replace('\n\n', '\n').replace('\n\n', '\n').replace('\n\n', '\n').replace('\n\n', '\n').replace('{\n}', '{}')
return '\n'.join(sorted(text.split('\n')))
- self.assertIdentical(clean(open('release.js').read()), clean(open('debug%d.js' % debug).read())) # EMCC_DEBUG=1 mode must not generate different code!
+ sizes = len(open('release.js').read()), len(open('debug%d.js' % debug).read())
+ print >> sys.stderr, debug, 'sizes', sizes
+ assert abs(sizes[0] - sizes[1]) < 0.001*sizes[0], sizes # we can't check on identical output, compilation is not 100% deterministic (order of switch elements, etc.), but size should be ~identical
print >> sys.stderr, 'debug check %d passed too' % debug
try:
@@ -5019,18 +5160,21 @@ def process(filename):
def test_python(self):
if self.emcc_args is None: return self.skip('requires emcc')
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: make this work')
- if not self.is_le32(): return self.skip('fails on non-le32') # FIXME
+ if not self.is_emscripten_abi(): return self.skip('fails on not asmjs-unknown-emscripten') # FIXME
#Settings.EXPORTED_FUNCTIONS += ['_PyRun_SimpleStringFlags'] # for the demo
- if self.is_le32():
- bitcode = path_from_root('tests', 'python', 'python.le32.bc')
+ if self.is_emscripten_abi():
+ bitcode = path_from_root('tests', 'python', 'python.asmjs-unknown-emscripten.bc')
else:
bitcode = path_from_root('tests', 'python', 'python.small.bc')
- self.do_ll_run(bitcode,
- 'hello python world!\n[0, 2, 4, 6]\n5\n22\n5.470000',
- args=['-S', '-c' '''print "hello python world!"; print [x*2 for x in range(4)]; t=2; print 10-3-t; print (lambda x: x*2)(11); print '%f' % 5.47'''])
+ for lto in [0, 1]:
+ if lto == 1: self.emcc_args += ['--llvm-lto', '1']
+ print self.emcc_args
+ self.do_ll_run(bitcode,
+ 'hello python world!\n[0, 2, 4, 6]\n5\n22\n5.470000',
+ args=['-S', '-c' '''print "hello python world!"; print [x*2 for x in range(4)]; t=2; print 10-3-t; print (lambda x: x*2)(11); print '%f' % 5.47'''])
def test_lifetime(self):
if self.emcc_args is None: return self.skip('test relies on emcc opts')
@@ -5054,13 +5198,12 @@ def process(filename):
for name in glob.glob(path_from_root('tests', 'cases', '*.ll')):
shortname = name.replace('.ll', '')
if '' not in shortname: continue
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and os.path.basename(shortname) in [
- 'structparam', 'uadd_overflow_ta2', 'extendedprecision', 'issue_39', 'emptystruct', 'phinonexist', 'quotedlabel', 'oob_ta2', 'phientryimplicit', 'phiself', 'invokebitcast', # invalid ir
+ if os.environ.get('EMCC_FAST_COMPILER') != '0' and os.path.basename(shortname) in [
+ 'structparam', 'extendedprecision', 'issue_39', 'phinonexist', 'oob_ta2', 'phiself', 'invokebitcast', # invalid ir
'structphiparam', 'callwithstructural_ta2', 'callwithstructural64_ta2', 'structinparam', # pnacl limitations in ExpandStructRegs
'2xi40', # pnacl limitations in ExpandGetElementPtr
- 'legalizer_ta2', '514_ta2', # pnacl limitation in not legalizing i104, i96, etc.
- 'longjmp_tiny', 'longjmp_tiny_invoke', 'longjmp_tiny_phi', 'longjmp_tiny_phi2', 'longjmp_tiny_invoke_phi', 'indirectbrphi', 'ptrtoint_blockaddr', 'quoted', # current fastcomp limitations FIXME
- 'sillyfuncast2', 'sillybitcast', 'atomicrmw_unaligned' # TODO XXX
+ 'quoted', # current fastcomp limitations FIXME
+ 'atomicrmw_unaligned' # TODO XXX
]: continue
if '_ta2' in shortname and not Settings.USE_TYPED_ARRAYS == 2:
print self.skip('case "%s" only relevant for ta2' % shortname)
@@ -5068,8 +5211,11 @@ def process(filename):
if '_noasm' in shortname and Settings.ASM_JS:
print self.skip('case "%s" not relevant for asm.js' % shortname)
continue
- if '_le32' in shortname and not self.is_le32():
- print self.skip('case "%s" not relevant for non-le32 target' % shortname)
+ if '_eua' in shortname and not self.is_emscripten_abi():
+ print self.skip('case "%s" not relevant for not asmjs-unknown-emscripten target' % shortname)
+ continue
+ if '_fastcomp' in shortname and not os.environ.get('EMCC_FAST_COMPILER') != '0':
+ print self.skip('case "%s" not relevant for non-fastcomp' % shortname)
continue
self.emcc_args = emcc_args
if os.path.exists(shortname + '.emcc'):
@@ -5100,17 +5246,21 @@ def process(filename):
def test_fuzz(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip('needs ta2')
- Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('tests', 'fuzz')]
+ Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('tests', 'fuzz'), '-Wno-warn-absolute-paths']
def run_all(x):
print x
- for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')):
+ for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')) + glob.glob(path_from_root('tests', 'fuzz', '*.cpp')):
#if os.path.basename(name) != '4.c': continue
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and os.path.basename(name) in ['17.c']: continue # pnacl limitation in not legalizing i104, i96, etc.
+ if 'newfail' in name: continue
+ if os.environ.get('EMCC_FAST_COMPILER') == '0' and os.path.basename(name) in [
+ '18.cpp', '15.c'
+ ]:
+ continue # works only in fastcomp
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)
+ open(path_from_root('tests', 'fuzz', name + '.txt')).read(), force_c=name.endswith('.c'))
run_all('normal')
@@ -5346,7 +5496,7 @@ def process(filename):
def test_asm_pgo(self):
if not Settings.ASM_JS: return self.skip('this is a test for PGO for asm (NB: not *in* asm)')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
src = open(path_from_root('tests', 'hello_libcxx.cpp')).read()
output = 'hello, world!'
@@ -5419,7 +5569,6 @@ def process(filename):
def test_add_function(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
Settings.INVOKE_RUN = 0
Settings.RESERVED_FUNCTION_POINTERS = 1
@@ -5467,7 +5616,7 @@ def process(filename):
def test_embind(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
Building.COMPILER_TEST_OPTS += ['--bind']
src = r'''
@@ -5490,7 +5639,7 @@ def process(filename):
def test_embind_2(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
Building.COMPILER_TEST_OPTS += ['--bind', '--post-js', 'post.js']
open('post.js', 'w').write('''
Module.print('lerp ' + Module.lerp(1, 2, 0.66) + '.');
@@ -5511,7 +5660,6 @@ def process(filename):
def test_scriptaclass(self):
if self.emcc_args is None: return self.skip('requires emcc')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
Settings.EXPORT_BINDINGS = 1
@@ -5565,8 +5713,6 @@ def process(filename):
# Way 2: use CppHeaderParser
- Settings.RUNTIME_TYPE_INFO = 1
-
header = '''
#include <stdio.h>
@@ -5807,6 +5953,8 @@ def process(filename):
self.do_run(src, '|hello|43|world|41|', post_build=post)
def test_typeinfo(self):
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp does not support RUNTIME_TYPE_INFO')
+
if self.emcc_args is not None and self.emcc_args != []: return self.skip('full LLVM opts optimize out all the code that uses the type')
Settings.RUNTIME_TYPE_INFO = 1
@@ -5970,7 +6118,7 @@ def process(filename):
def test_debug(self):
if '-g' not in Building.COMPILER_TEST_OPTS: Building.COMPILER_TEST_OPTS.append('-g')
if self.emcc_args is not None:
- if '-O1' in self.emcc_args or '-O2' in self.emcc_args: return self.skip('optimizations remove LLVM debug info')
+ if '-O1' in self.emcc_args or '-O2' in self.emcc_args or '-O3' in self.emcc_args: return self.skip('optimizations remove LLVM debug info')
src = '''
#include <stdio.h>
@@ -6001,7 +6149,6 @@ def process(filename):
def test_source_map(self):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip("doesn't pass without typed arrays")
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
if NODE_JS not in JS_ENGINES: return self.skip('sourcemapper requires Node to run')
if '-g' not in Building.COMPILER_TEST_OPTS: Building.COMPILER_TEST_OPTS.append('-g')
@@ -6033,7 +6180,7 @@ def process(filename):
# can do an apples-to-apples comparison by compiling with the same file name
shutil.move(out_filename, no_maps_filename)
with open(no_maps_filename) as f: no_maps_file = f.read()
- no_maps_file = re.sub(' *//@.*$', '', no_maps_file, flags=re.MULTILINE)
+ no_maps_file = re.sub(' *//[@#].*$', '', no_maps_file, flags=re.MULTILINE)
Building.COMPILER_TEST_OPTS.append('-g4')
def build_and_check():
@@ -6046,8 +6193,9 @@ def process(filename):
# this is worth checking because the parser AST swaps strings for token
# objects when generating source maps, so we want to make sure the
# optimizer can deal with both types.
- out_file = re.sub(' *//@.*$', '', out_file, flags=re.MULTILINE)
+ out_file = re.sub(' *//[@#].*$', '', out_file, flags=re.MULTILINE)
def clean(code):
+ code = re.sub(r'\n+[ \n]*\n+', '\n', code)
code = code.replace('{\n}', '{}')
return '\n'.join(sorted(code.split('\n')))
self.assertIdentical(clean(no_maps_file), clean(out_file))
@@ -6085,7 +6233,6 @@ def process(filename):
if Settings.USE_TYPED_ARRAYS != 2: return self.skip("doesn't pass without typed arrays")
if '-g4' not in Building.COMPILER_TEST_OPTS: Building.COMPILER_TEST_OPTS.append('-g4')
if NODE_JS not in JS_ENGINES: return self.skip('sourcemapper requires Node to run')
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
src = '''
#include <stdio.h>
@@ -6110,7 +6257,7 @@ def process(filename):
tools.shared.NODE_JS, [map_filename]))
with open(filename) as f: lines = f.readlines()
for m in mappings:
- if m['originalLine'] == 5 and '__cxa_throw' in lines[m['generatedLine']]:
+ if m['originalLine'] == 5 and '__cxa_throw' in lines[m['generatedLine']-1]: # -1 to fix 0-start vs 1-start
return
assert False, 'Must label throw statements with line numbers'
@@ -6118,7 +6265,9 @@ def process(filename):
self.build(src, dirname, os.path.join(dirname, 'src.cpp'), post_build=(None, post))
def test_emscripten_log(self):
- self.banned_js_engines = [SPIDERMONKEY_ENGINE] # XXX, emscripten_log is broken in spidermonkey currently, issue #1970
+ if Settings.ASM_JS:
+ # XXX Does not work in SpiderMonkey since callstacks cannot be captured when running in asm.js, see https://bugzilla.mozilla.org/show_bug.cgi?id=947996
+ self.banned_js_engines = [SPIDERMONKEY_ENGINE]
if self.emcc_args is None: return self.skip('This test needs libc.')
if '-g' not in Building.COMPILER_TEST_OPTS: Building.COMPILER_TEST_OPTS.append('-g')
self.do_run('#define RUN_FROM_JS_SHELL\n' + open(path_from_root('tests', 'emscripten_log', 'emscripten_log.cpp')).read(), "Success!")
@@ -6284,6 +6433,9 @@ def process(filename):
self.do_run(src.replace('TYPE', 'unsigned int'), '*2147483645**2**-5**5*')
Settings.CORRECT_SIGNS = 0
+ def test_float_literals(self):
+ self.do_run_from_file(path_from_root('tests', 'test_float_literals.cpp'), path_from_root('tests', 'test_float_literals.out'))
+
def test_exit_status(self):
if self.emcc_args is None: return self.skip('need emcc')
src = r'''
@@ -6319,6 +6471,15 @@ def process(filename):
self.do_run_from_file(src, output)
+ def test_minmax(self):
+ if self.emcc_args == None: return self.skip('needs emcc')
+ if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('this test will not pass in the old compiler')
+ self.do_run(open(path_from_root('tests', 'test_minmax.c')).read(), 'NAN != NAN\nSuccess!')
+
+ def test_locale(self):
+ if self.emcc_args is None: return self.skip('needs emcc')
+ self.do_run_from_file(path_from_root('tests', 'test_locale.c'), path_from_root('tests', 'test_locale.out'))
+
# Generate tests for everything
def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0,
typed_arrays=0, emcc_args=None, env=None):
@@ -6360,7 +6521,7 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0,
if self.emcc_args is not None:
Settings.load(self.emcc_args)
Building.LLVM_OPTS = 0
- if '-O2' in self.emcc_args:
+ if '-O2' in self.emcc_args or '-O3' in self.emcc_args:
Building.COMPILER_TEST_OPTS = [] # remove -g in -O2 tests, for more coverage
#Building.COMPILER_TEST_OPTS += self.emcc_args
for arg in self.emcc_args:
@@ -6375,6 +6536,7 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0,
return
# TODO: Move much of these to a init() function in shared.py, and reuse that
+ Settings.ASM_JS = 0
Settings.USE_TYPED_ARRAYS = typed_arrays
Settings.INVOKE_RUN = 1
Settings.RELOOP = 0 # we only do them in the "o2" pass
@@ -6402,23 +6564,19 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0,
return TT
-# Make one run with the defaults
-default = make_run("default", compiler=CLANG, emcc_args=[] if os.environ.get('EMCC_FAST_COMPILER') != '1' else ['-s', 'ASM_JS=1'])
-
-# Make one run with -O1, with safe heap
-o1 = make_run("o1", compiler=CLANG, emcc_args=["-O1", "-s", "ASM_JS=0", "-s", "SAFE_HEAP=1"])
-
-# Make one run with -O2, but without closure (we enable closure in specific tests, otherwise on everything it is too slow)
-o2 = make_run("o2", compiler=CLANG, emcc_args=["-O2", "-s", "ASM_JS=0", "-s", "JS_CHUNK_SIZE=1024"])
-
-# asm.js
+# Main test modes
+default = make_run("default", compiler=CLANG, emcc_args=[])
asm1 = make_run("asm1", compiler=CLANG, emcc_args=["-O1"])
asm2 = make_run("asm2", compiler=CLANG, emcc_args=["-O2"])
+asm3 = make_run("asm3", compiler=CLANG, emcc_args=["-O3"])
asm2f = make_run("asm2f", compiler=CLANG, emcc_args=["-O2", "-s", "PRECISE_F32=1"])
-asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1", "-s", "CHECK_HEAP_ALIGN=1"])
-asm2x86 = make_run("asm2x86", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "CHECK_HEAP_ALIGN=1"], env={"EMCC_LLVM_TARGET": "i386-pc-linux-gnu"})
+asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1", "-s", "SAFE_HEAP=1"])
+
+# Legacy test modes -
+slow2 = make_run("slow2", compiler=CLANG, emcc_args=["-O2", "-s", "ASM_JS=0"], env={"EMCC_FAST_COMPILER": "0"})
+slow2asm = make_run("slow2asm", compiler=CLANG, emcc_args=["-O2"], env={"EMCC_FAST_COMPILER": "0"})
-# Make custom runs with various options
+# Legacy test modes - very old
for compiler, quantum, embetter, typed_arrays in [
(CLANG, 4, 0, 0),
(CLANG, 4, 1, 1),
@@ -6426,6 +6584,6 @@ for compiler, quantum, embetter, typed_arrays in [
fullname = 's_0_%d%s%s' % (
embetter, '' if quantum == 4 else '_q' + str(quantum), '' if typed_arrays in [0, 1] else '_t' + str(typed_arrays)
)
- locals()[fullname] = make_run(fullname, fullname, compiler, embetter, quantum, typed_arrays)
+ locals()[fullname] = make_run(fullname, fullname, compiler, embetter, quantum, typed_arrays, env={"EMCC_FAST_COMPILER": "0"})
del T # T is just a shape for the specific subclasses, we don't test it itself
diff --git a/tests/test_egl.c b/tests/test_egl.c
index d66949d0..6eef4aa5 100644
--- a/tests/test_egl.c
+++ b/tests/test_egl.c
@@ -75,7 +75,10 @@ int main(int argc, char *argv[])
ret = eglTerminate(display);
assert(eglGetError() == EGL_SUCCESS);
assert(ret == EGL_TRUE);
-
+
+ assert(eglGetProcAddress("glClear") != 0);
+ assert(eglGetProcAddress("glWakaWaka") == 0);
+
#ifdef REPORT_RESULT
REPORT_RESULT();
#endif
diff --git a/tests/test_float_literals.cpp b/tests/test_float_literals.cpp
new file mode 100644
index 00000000..2920fbd1
--- /dev/null
+++ b/tests/test_float_literals.cpp
@@ -0,0 +1,92 @@
+#include <limits>
+#include <math.h>
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if defined(_MSC_VER) || defined(__EMSCRIPTEN__)
+#define FLOAT_NAN ((float)std::numeric_limits<float>::quiet_NaN())
+#define FLOAT_INF ((float)std::numeric_limits<float>::infinity())
+#else
+#define FLOAT_NAN ((float)NAN)
+#define FLOAT_INF ((float)INFINITY)
+#endif
+
+#if defined(_MSC_VER) || defined(__EMSCRIPTEN__)
+#define DOUBLE_NAN ((double)std::numeric_limits<double>::quiet_NaN())
+#define DOUBLE_INF ((double)std::numeric_limits<double>::infinity())
+#else
+#define DOUBLE_NAN ((double)NAN)
+#define DOUBLE_INF ((double)INFINITY)
+#endif
+
+#ifdef _MSC_VER
+#define NOINLINE
+#else
+#define NOINLINE __attribute__((noinline))
+#endif
+
+float NOINLINE ret_e() { return (float)2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274; }
+float NOINLINE ret_minuspi() { return (float)-3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679; }
+float NOINLINE val() { return 10.f; }
+float NOINLINE val2() { return -10.f; }
+float NOINLINE zero() { return 0.f; }
+float NOINLINE zero2() { return -0.f; }
+
+double NOINLINE dret_e() { return (double)2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274; }
+double NOINLINE dret_minuspi() { return (double)-3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679; }
+double NOINLINE dval() { return 10.0; }
+double NOINLINE dval2() { return -10.0; }
+double NOINLINE dzero() { return 0.0; }
+double NOINLINE dzero2() { return -0.0; }
+
+const float e = ret_e();
+const float negpi = ret_minuspi();
+const float inf = FLOAT_INF;
+const float negInf = -FLOAT_INF;
+const float floatNan = FLOAT_NAN;
+const float floatMax = FLT_MAX;
+const float floatMin = -FLT_MAX;
+const float posValue = val();
+const float negValue = val2();
+const float posZero = zero();
+const float negZero = zero2();
+
+const double de = dret_e();
+const double dnegpi = dret_minuspi();
+const double dinf = DOUBLE_INF;
+const double dnegInf = -DOUBLE_INF;
+const double doubleNan = DOUBLE_NAN;
+const double doubleMax = DBL_MAX;
+const double doubleMin = -DBL_MAX;
+const double dposValue = dval();
+const double dnegValue = dval2();
+const double dposZero = dzero();
+const double dnegZero = dzero2();
+
+int main()
+{
+ printf("e: %f\n", e);
+ printf("negpi: %f\n", negpi);
+ printf("inf: %f\n", inf);
+ printf("negInf: %f\n", negInf);
+ printf("floatNan: %f\n", floatNan);
+ printf("floatMax: %f\n", floatMax);
+ printf("floatMin: %f\n", floatMin);
+ printf("posValue: %f\n", posValue);
+ printf("negValue: %f\n", negValue);
+ printf("posZero: %f\n", posZero);
+ printf("negZero: %f\n", negZero);
+
+ printf("e: %f\n", de);
+ printf("negpi: %f\n", dnegpi);
+ printf("inf: %f\n", dinf);
+ printf("negInf: %f\n", dnegInf);
+ printf("doubleNan: %f\n", doubleNan);
+ printf("doubleMax: %f\n", doubleMax);
+ printf("doubleMin: %f\n", doubleMin);
+ printf("posValue: %f\n", dposValue);
+ printf("negValue: %f\n", dnegValue);
+ printf("posZero: %f\n", dposZero);
+ printf("negZero: %f\n", dnegZero);
+}
diff --git a/tests/test_float_literals.out b/tests/test_float_literals.out
new file mode 100644
index 00000000..ab52d6c4
--- /dev/null
+++ b/tests/test_float_literals.out
@@ -0,0 +1,22 @@
+e: 2.718282
+negpi: -3.141593
+inf: inf
+negInf: -inf
+floatNan: nan
+floatMax: 3.4028234663852886e+38
+floatMin: -3.4028234663852886e+38
+posValue: 10.000000
+negValue: -10.000000
+posZero: 0.000000
+negZero: -0.000000
+e: 2.718282
+negpi: -3.141593
+inf: inf
+negInf: -inf
+doubleNan: nan
+doubleMax: 1.7976931348623157e+308
+doubleMin: -1.7976931348623157e+308
+posValue: 10.000000
+negValue: -10.000000
+posZero: 0.000000
+negZero: -0.000000
diff --git a/tests/test_html5.c b/tests/test_html5.c
new file mode 100644
index 00000000..fec46035
--- /dev/null
+++ b/tests/test_html5.c
@@ -0,0 +1,474 @@
+#include <stdio.h>
+#include <emscripten.h>
+#include <string.h>
+#include <emscripten/html5.h>
+
+static inline const char *emscripten_event_type_to_string(int eventType) {
+ const char *events[] = { "(invalid)", "(none)", "keypress", "keydown", "keyup", "click", "mousedown", "mouseup", "dblclick", "mousemove", "wheel", "resize",
+ "scroll", "blur", "focus", "focusin", "focusout", "deviceorientation", "devicemotion", "orientationchange", "fullscreenchange", "pointerlockchange",
+ "visibilitychange", "touchstart", "touchend", "touchmove", "touchcancel", "gamepadconnected", "gamepaddisconnected", "beforeunload",
+ "batterychargingchange", "batterylevelchange", "webglcontextlost", "webglcontextrestored", "(invalid)" };
+ ++eventType;
+ if (eventType < 0) eventType = 0;
+ if (eventType >= sizeof(events)/sizeof(events[0])) eventType = sizeof(events)/sizeof(events[0])-1;
+ return events[eventType];
+}
+
+const char *emscripten_result_to_string(EMSCRIPTEN_RESULT result) {
+ if (result == EMSCRIPTEN_RESULT_SUCCESS) return "EMSCRIPTEN_RESULT_SUCCESS";
+ if (result == EMSCRIPTEN_RESULT_DEFERRED) return "EMSCRIPTEN_RESULT_DEFERRED";
+ if (result == EMSCRIPTEN_RESULT_NOT_SUPPORTED) return "EMSCRIPTEN_RESULT_NOT_SUPPORTED";
+ if (result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED) return "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED";
+ if (result == EMSCRIPTEN_RESULT_INVALID_TARGET) return "EMSCRIPTEN_RESULT_INVALID_TARGET";
+ if (result == EMSCRIPTEN_RESULT_UNKNOWN_TARGET) return "EMSCRIPTEN_RESULT_UNKNOWN_TARGET";
+ if (result == EMSCRIPTEN_RESULT_INVALID_PARAM) return "EMSCRIPTEN_RESULT_INVALID_PARAM";
+ if (result == EMSCRIPTEN_RESULT_FAILED) return "EMSCRIPTEN_RESULT_FAILED";
+ if (result == EMSCRIPTEN_RESULT_NO_DATA) return "EMSCRIPTEN_RESULT_NO_DATA";
+ return "Unknown EMSCRIPTEN_RESULT!";
+}
+
+#define TEST_RESULT(x) if (ret != EMSCRIPTEN_RESULT_SUCCESS) printf("%s returned %s.\n", #x, emscripten_result_to_string(ret));
+
+// The event handler functions can return 1 to suppress the event and disable the default action. That calls event.preventDefault();
+// Returning 0 signals that the event was not consumed by the code, and will allow the event to pass on and bubble up normally.
+EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *userData)
+{
+ printf("%s, key: \"%s\", code: \"%s\", location: %lu,%s%s%s%s repeat: %d, locale: \"%s\", char: \"%s\", charCode: %lu, keyCode: %lu, which: %lu\n",
+ emscripten_event_type_to_string(eventType), e->key, e->code, e->location,
+ e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "",
+ e->repeat, e->locale, e->charValue, e->charCode, e->keyCode, e->which);
+
+ if (eventType == EMSCRIPTEN_EVENT_KEYPRESS && (!strcmp(e->key, "f") || e->which == 102)) {
+ EmscriptenFullscreenChangeEvent fsce;
+ EMSCRIPTEN_RESULT ret = emscripten_get_fullscreen_status(&fsce);
+ TEST_RESULT(emscripten_get_fullscreen_status);
+ if (!fsce.isFullscreen) {
+ printf("Requesting fullscreen..\n");
+ ret = emscripten_request_fullscreen(0, 1);
+ TEST_RESULT(emscripten_request_fullscreen);
+ } else {
+ printf("Exiting fullscreen..\n");
+ ret = emscripten_exit_fullscreen();
+ TEST_RESULT(emscripten_exit_fullscreen);
+ ret = emscripten_get_fullscreen_status(&fsce);
+ TEST_RESULT(emscripten_get_fullscreen_status);
+ if (fsce.isFullscreen) {
+ fprintf(stderr, "Fullscreen exit did not work!\n");
+ }
+ }
+ }
+
+ if (eventType == EMSCRIPTEN_EVENT_KEYPRESS && (!strcmp(e->key, "p") || e->which == 112)) {
+ EmscriptenPointerlockChangeEvent plce;
+ EMSCRIPTEN_RESULT ret = emscripten_get_pointerlock_status(&plce);
+ TEST_RESULT(emscripten_get_pointerlock_status);
+ if (!plce.isActive) {
+ printf("Requesting pointer lock..\n");
+ ret = emscripten_request_pointerlock(0, 1);
+ TEST_RESULT(emscripten_request_pointerlock);
+ } else {
+ printf("Exiting pointer lock..\n");
+ ret = emscripten_exit_pointerlock();
+ TEST_RESULT(emscripten_exit_pointerlock);
+ ret = emscripten_get_pointerlock_status(&plce);
+ TEST_RESULT(emscripten_get_pointerlock_status);
+ if (plce.isActive) {
+ fprintf(stderr, "Pointer lock exit did not work!\n");
+ }
+ }
+ }
+
+ return 0;
+}
+
+EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent *e, void *userData)
+{
+ printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, movement: (%ld,%ld), canvas: (%ld,%ld)\n",
+ emscripten_event_type_to_string(eventType), e->screenX, e->screenY, e->clientX, e->clientY,
+ e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "",
+ e->button, e->buttons, e->movementX, e->movementY, e->canvasX, e->canvasY);
+
+ return 0;
+}
+
+EM_BOOL wheel_callback(int eventType, const EmscriptenWheelEvent *e, void *userData)
+{
+ printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, canvas: (%ld,%ld), delta:(%g,%g,%g), deltaMode:%lu\n",
+ emscripten_event_type_to_string(eventType), e->mouse.screenX, e->mouse.screenY, e->mouse.clientX, e->mouse.clientY,
+ e->mouse.ctrlKey ? " CTRL" : "", e->mouse.shiftKey ? " SHIFT" : "", e->mouse.altKey ? " ALT" : "", e->mouse.metaKey ? " META" : "",
+ e->mouse.button, e->mouse.buttons, e->mouse.canvasX, e->mouse.canvasY,
+ (float)e->deltaX, (float)e->deltaY, (float)e->deltaZ, e->deltaMode);
+
+ return 0;
+}
+
+EM_BOOL uievent_callback(int eventType, const EmscriptenUiEvent *e, void *userData)
+{
+ printf("%s, detail: %ld, document.body.client size: (%d,%d), window.inner size: (%d,%d), scrollPos: (%d, %d)\n",
+ emscripten_event_type_to_string(eventType), e->detail, e->documentBodyClientWidth, e->documentBodyClientHeight,
+ e->windowInnerWidth, e->windowInnerHeight, e->scrollTop, e->scrollLeft);
+
+ return 0;
+}
+
+EM_BOOL focusevent_callback(int eventType, const EmscriptenFocusEvent *e, void *userData)
+{
+ printf("%s, nodeName: \"%s\", id: \"%s\"\n", emscripten_event_type_to_string(eventType), e->nodeName, e->id[0] == '\0' ? "(empty string)" : e->id);
+
+ return 0;
+}
+
+EM_BOOL deviceorientation_callback(int eventType, const EmscriptenDeviceOrientationEvent *e, void *userData)
+{
+ printf("%s, (%g, %g, %g)\n", emscripten_event_type_to_string(eventType), e->alpha, e->beta, e->gamma);
+
+ return 0;
+}
+
+EM_BOOL devicemotion_callback(int eventType, const EmscriptenDeviceMotionEvent *e, void *userData)
+{
+ printf("%s, accel: (%g, %g, %g), accelInclGravity: (%g, %g, %g), rotationRate: (%g, %g, %g)\n",
+ emscripten_event_type_to_string(eventType),
+ e->accelerationX, e->accelerationY, e->accelerationZ,
+ e->accelerationIncludingGravityX, e->accelerationIncludingGravityY, e->accelerationIncludingGravityZ,
+ e->rotationRateAlpha, e->rotationRateBeta, e->rotationRateGamma);
+
+ return 0;
+}
+
+EM_BOOL orientationchange_callback(int eventType, const EmscriptenOrientationChangeEvent *e, void *userData)
+{
+ printf("%s, orientationAngle: %d, orientationIndex: %d\n", emscripten_event_type_to_string(eventType), e->orientationAngle, e->orientationIndex);
+
+ return 0;
+}
+
+EM_BOOL fullscreenchange_callback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData)
+{
+ printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\". New size: %dx%d pixels. Screen size: %dx%d pixels.\n",
+ emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id, e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight);
+
+ return 0;
+}
+
+EM_BOOL pointerlockchange_callback(int eventType, const EmscriptenPointerlockChangeEvent *e, void *userData)
+{
+ printf("%s, isActive: %d, pointerlock element nodeName: \"%s\", id: \"%s\"\n",
+ emscripten_event_type_to_string(eventType), e->isActive, e->nodeName, e->id);
+
+ return 0;
+}
+
+EM_BOOL visibilitychange_callback(int eventType, const EmscriptenVisibilityChangeEvent *e, void *userData)
+{
+ printf("%s, hidden: %d, visibilityState: %d\n", emscripten_event_type_to_string(eventType), e->hidden, e->visibilityState);
+
+ return 0;
+}
+
+EM_BOOL touch_callback(int eventType, const EmscriptenTouchEvent *e, void *userData)
+{
+ printf("%s, numTouches: %d %s%s%s%s\n",
+ emscripten_event_type_to_string(eventType), e->numTouches,
+ e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "");
+ for(int i = 0; i < e->numTouches; ++i)
+ {
+ const EmscriptenTouchPoint *t = &e->touches[i];
+ printf(" %ld: screen: (%ld,%ld), client: (%ld,%ld), page: (%ld,%ld), isChanged: %d, onTarget: %d, canvas: (%ld, %ld)\n",
+ t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY);
+ }
+
+ return 0;
+}
+
+EM_BOOL gamepad_callback(int eventType, const EmscriptenGamepadEvent *e, void *userData)
+{
+ printf("%s: timeStamp: %g, connected: %d, index: %ld, numAxes: %d, numButtons: %d, id: \"%s\", mapping: \"%s\"\n",
+ eventType != 0 ? emscripten_event_type_to_string(eventType) : "Gamepad state", e->timestamp, e->connected, e->index,
+ e->numAxes, e->numButtons, e->id, e->mapping);
+
+ if (e->connected)
+ {
+ for(int i = 0; i < e->numAxes; ++i)
+ printf("Axis %d: %g\n", i, e->axis[i]);
+
+ for(int i = 0; i < e->numButtons; ++i)
+ printf("Button %d: Digital: %d, Analog: %g\n", i, e->digitalButton[i], e->analogButton[i]);
+ }
+
+ return 0;
+}
+
+const char *beforeunload_callback(int eventType, const void *reserved, void *userData)
+{
+#ifdef REPORT_RESULT
+ return ""; // For test harness, don't show a confirmation dialog to not block and keep the test runner automated.
+#else
+ return "Do you really want to leave the page?";
+#endif
+}
+
+void formatTime(char *str, int seconds)
+{
+ int h = seconds / (60*60);
+ seconds -= h*60*60;
+ int m = seconds / 60;
+ seconds -= m*60;
+ if (h > 0)
+ {
+ sprintf(str, "%dh:%02dm:%02ds", h, m, seconds);
+ }
+ else
+ {
+ sprintf(str, "%02dm:%02ds", m, seconds);
+ }
+}
+
+EM_BOOL battery_callback(int eventType, const EmscriptenBatteryEvent *e, void *userData)
+{
+ char t1[64];
+ formatTime(t1, (int)e->chargingTime);
+ char t2[64];
+ formatTime(t2, (int)e->dischargingTime);
+ printf("%s: chargingTime: %s, dischargingTime: %s, level: %g%%, charging: %d\n",
+ emscripten_event_type_to_string(eventType), t1, t2, e->level*100, e->charging);
+
+ return 0;
+}
+
+EM_BOOL webglcontext_callback(int eventType, const void *reserved, void *userData)
+{
+ printf("%s.\n", emscripten_event_type_to_string(eventType));
+
+ return 0;
+}
+
+EmscriptenGamepadEvent prevState[32];
+int prevNumGamepads = 0;
+
+void mainloop()
+{
+ int numGamepads = emscripten_get_num_gamepads();
+ if (numGamepads != prevNumGamepads)
+ {
+ if (numGamepads == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
+ printf("emscripten_get_num_gamepads returned EMSCRIPTEN_RESULT_NOT_SUPPORTED.\n");
+ emscripten_cancel_main_loop();
+ return;
+ } else {
+ printf("Number of connected gamepads: %d\n", numGamepads);
+ }
+ prevNumGamepads = numGamepads;
+ }
+
+ for(int i = 0; i < numGamepads && i < 32; ++i)
+ {
+ EmscriptenGamepadEvent ge;
+ int failed = emscripten_get_gamepad_status(i, &ge);
+ if (!failed)
+ {
+ int g = ge.index;
+ for(int j = 0; j < ge.numAxes; ++j)
+ {
+ if (ge.axis[j] != prevState[g].axis[j])
+ printf("Gamepad %d, axis %d: %g\n", g, j, ge.axis[j]);
+ }
+
+ for(int j = 0; j < ge.numButtons; ++j)
+ {
+ if (ge.analogButton[j] != prevState[g].analogButton[j] || ge.digitalButton[j] != prevState[g].digitalButton[j])
+ printf("Gamepad %d, button %d: Digital: %d, Analog: %g\n", g, j, ge.digitalButton[j], ge.analogButton[j]);
+ }
+ prevState[g] = ge;
+ }
+ }
+
+}
+
+#ifdef REPORT_RESULT
+void report_result(void *arg)
+{
+ int result = 0;
+ REPORT_RESULT();
+}
+#endif
+
+int main()
+{
+
+ EMSCRIPTEN_RESULT ret = emscripten_set_keypress_callback(0, 0, 1, key_callback);
+ TEST_RESULT(emscripten_set_keypress_callback);
+ ret = emscripten_set_keydown_callback(0, 0, 1, key_callback);
+ TEST_RESULT(emscripten_set_keydown_callback);
+ ret = emscripten_set_keyup_callback(0, 0, 1, key_callback);
+ TEST_RESULT(emscripten_set_keyup_callback);
+
+ ret = emscripten_set_click_callback(0, 0, 1, mouse_callback);
+ TEST_RESULT(emscripten_set_click_callback);
+ ret = emscripten_set_mousedown_callback(0, 0, 1, mouse_callback);
+ TEST_RESULT(emscripten_set_mousedown_callback);
+ ret = emscripten_set_mouseup_callback(0, 0, 1, mouse_callback);
+ TEST_RESULT(emscripten_set_mouseup_callback);
+ ret = emscripten_set_dblclick_callback(0, 0, 1, mouse_callback);
+ TEST_RESULT(emscripten_set_dblclick_callback);
+ ret = emscripten_set_mousemove_callback(0, 0, 1, mouse_callback);
+ TEST_RESULT(emscripten_set_mousemove_callback);
+
+ ret = emscripten_set_wheel_callback(0, 0, 1, wheel_callback);
+ TEST_RESULT(emscripten_set_wheel_callback);
+
+ ret = emscripten_set_resize_callback(0, 0, 1, uievent_callback);
+ TEST_RESULT(emscripten_set_resize_callback);
+ ret = emscripten_set_scroll_callback(0, 0, 1, uievent_callback);
+ TEST_RESULT(emscripten_set_scroll_callback);
+
+ ret = emscripten_set_blur_callback(0, 0, 1, focusevent_callback);
+ TEST_RESULT(emscripten_set_blur_callback);
+ ret = emscripten_set_focus_callback(0, 0, 1, focusevent_callback);
+ TEST_RESULT(emscripten_set_focus_callback);
+ ret = emscripten_set_focusin_callback(0, 0, 1, focusevent_callback);
+ TEST_RESULT(emscripten_set_focusin_callback);
+ ret = emscripten_set_focusout_callback(0, 0, 1, focusevent_callback);
+ TEST_RESULT(emscripten_set_focusout_callback);
+
+ ret = emscripten_set_deviceorientation_callback(0, 1, deviceorientation_callback);
+ TEST_RESULT(emscripten_set_deviceorientation_callback);
+ ret = emscripten_set_devicemotion_callback(0, 1, devicemotion_callback);
+ TEST_RESULT(emscripten_set_devicemotion_callback);
+
+ ret = emscripten_set_orientationchange_callback(0, 1, orientationchange_callback);
+ TEST_RESULT(emscripten_set_orientationchange_callback);
+
+ // Test the polling of orientation.
+ EmscriptenOrientationChangeEvent oce;
+ ret = emscripten_get_orientation_status(&oce);
+ TEST_RESULT(emscripten_get_orientation_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("The current orientation is:\n");
+ orientationchange_callback(EMSCRIPTEN_EVENT_ORIENTATIONCHANGE, &oce, 0);
+ }
+
+ int newOrientation = (oce.orientationIndex == EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY
+ || oce.orientationIndex == EMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY) ? EMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY : EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY;
+ // Test locking of orientation.
+ ret = emscripten_lock_orientation(newOrientation);
+ TEST_RESULT(emscripten_lock_orientation);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("Locked orientation to state %d.\n", newOrientation);
+ }
+
+ ret = emscripten_get_orientation_status(&oce);
+ TEST_RESULT(emscripten_get_orientation_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("The current orientation is after locking:\n");
+ orientationchange_callback(18, &oce, 0);
+ }
+
+ ret = emscripten_unlock_orientation();
+ TEST_RESULT(emscripten_unlock_orientation);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("Unlocked orientation.\n");
+ }
+
+ EmscriptenFullscreenChangeEvent fsce;
+ ret = emscripten_get_fullscreen_status(&fsce);
+ TEST_RESULT(emscripten_get_fullscreen_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("The current fullscreen status is:\n");
+ fullscreenchange_callback(EMSCRIPTEN_EVENT_FULLSCREENCHANGE, &fsce, 0);
+ }
+
+ ret = emscripten_set_fullscreenchange_callback(0, 0, 1, fullscreenchange_callback);
+ TEST_RESULT(emscripten_set_fullscreenchange_callback);
+
+ // These won't do anything, since fullscreen must be requested in an event handler,
+ // but call these anyways to confirm that they don't crash in an exception in the test suite.
+ ret = emscripten_request_fullscreen(0, 1);
+ TEST_RESULT(emscripten_request_fullscreen);
+ ret = emscripten_exit_fullscreen();
+ TEST_RESULT(emscripten_exit_fullscreen);
+
+ EmscriptenPointerlockChangeEvent plce;
+ ret = emscripten_get_pointerlock_status(&plce);
+ TEST_RESULT(emscripten_get_pointerlock_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("The current pointerlock status is:\n");
+ pointerlockchange_callback(EMSCRIPTEN_EVENT_POINTERLOCKCHANGE, &plce, 0);
+ }
+
+ ret = emscripten_set_pointerlockchange_callback(0, 0, 1, pointerlockchange_callback);
+ TEST_RESULT(emscripten_set_pointerlockchange_callback);
+
+ // These won't do anything, since pointer lock must be requested in an event handler,
+ // but call these anyways to confirm that they don't crash in an exception in the test suite.
+ ret = emscripten_request_pointerlock(0, 1);
+ TEST_RESULT(emscripten_request_pointerlock);
+ ret = emscripten_exit_pointerlock();
+ TEST_RESULT(emscripten_exit_pointerlock);
+
+ int vibratePattern[] = {
+ 150, 500,
+ 300, 500,
+ 450
+ };
+ ret = emscripten_vibrate_pattern(vibratePattern, sizeof(vibratePattern)/sizeof(vibratePattern[0]));
+ TEST_RESULT(emscripten_vibrate_pattern);
+
+ EmscriptenVisibilityChangeEvent vce;
+ ret = emscripten_get_visibility_status(&vce);
+ TEST_RESULT(emscripten_get_visibility_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("Current visibility status:\n");
+ visibilitychange_callback(EMSCRIPTEN_EVENT_VISIBILITYCHANGE, &vce, 0);
+ }
+
+ ret = emscripten_set_visibilitychange_callback(0, 1, visibilitychange_callback);
+ TEST_RESULT(emscripten_set_visibilitychange_callback);
+
+ ret = emscripten_set_touchstart_callback(0, 0, 1, touch_callback);
+ TEST_RESULT(emscripten_set_touchstart_callback);
+ ret = emscripten_set_touchend_callback(0, 0, 1, touch_callback);
+ TEST_RESULT(emscripten_set_touchend_callback);
+ ret = emscripten_set_touchmove_callback(0, 0, 1, touch_callback);
+ TEST_RESULT(emscripten_set_touchmove_callback);
+ ret = emscripten_set_touchcancel_callback(0, 0, 1, touch_callback);
+ TEST_RESULT(emscripten_set_touchcancel_callback);
+
+ ret = emscripten_set_gamepadconnected_callback(0, 1, gamepad_callback);
+ TEST_RESULT(emscripten_set_gamepadconnected_callback);
+ ret = emscripten_set_gamepaddisconnected_callback(0, 1, gamepad_callback);
+ TEST_RESULT(emscripten_set_gamepaddisconnected_callback);
+
+ emscripten_set_main_loop(mainloop, 10, 0);
+
+ ret = emscripten_set_beforeunload_callback(0, beforeunload_callback);
+ TEST_RESULT(emscripten_set_beforeunload_callback);
+
+ ret = emscripten_set_batterychargingchange_callback(0, battery_callback);
+ TEST_RESULT(emscripten_set_batterychargingchange_callback);
+ ret = emscripten_set_batterylevelchange_callback(0, battery_callback);
+ TEST_RESULT(emscripten_set_batterylevelchange_callback);
+
+ EmscriptenBatteryEvent bs;
+ ret = emscripten_get_battery_status(&bs);
+ TEST_RESULT(emscripten_get_battery_status);
+ if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
+ printf("Current battery status:\n");
+ battery_callback(EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE, &bs, 0);
+ }
+
+ ret = emscripten_set_webglcontextlost_callback(0, 0, 1, webglcontext_callback);
+ TEST_RESULT(emscripten_set_webglcontextlost_callback);
+ ret = emscripten_set_webglcontextrestored_callback(0, 0, 1, webglcontext_callback);
+ TEST_RESULT(emscripten_set_webglcontextrestored_callback);
+
+ /* For the events to function, one must either call emscripten_set_main_loop or enable Module.noExitRuntime by some other means.
+ Otherwise the application will exit after leaving main(), and the atexit handlers will clean up all event hooks (by design). */
+ EM_ASM(Module['noExitRuntime'] = true);
+
+#ifdef REPORT_RESULT
+ // Keep the page running for a moment.
+ emscripten_async_call(report_result, 0, 5000);
+#endif
+ return 0;
+}
diff --git a/tests/test_html5_fullscreen.c b/tests/test_html5_fullscreen.c
new file mode 100644
index 00000000..9a284b09
--- /dev/null
+++ b/tests/test_html5_fullscreen.c
@@ -0,0 +1,107 @@
+#include <stdio.h>
+#include <emscripten.h>
+#include <string.h>
+#include <emscripten/html5.h>
+
+#ifdef REPORT_RESULT
+void report_result(int result)
+{
+ if (result == 0) {
+ printf("Test successful!\n");
+ } else {
+ printf("Test failed!\n");
+ }
+ REPORT_RESULT();
+}
+#endif
+
+static inline const char *emscripten_event_type_to_string(int eventType) {
+ const char *events[] = { "(invalid)", "(none)", "keypress", "keydown", "keyup", "click", "mousedown", "mouseup", "dblclick", "mousemove", "wheel", "resize",
+ "scroll", "blur", "focus", "focusin", "focusout", "deviceorientation", "devicemotion", "orientationchange", "fullscreenchange", "pointerlockchange",
+ "visibilitychange", "touchstart", "touchend", "touchmove", "touchcancel", "gamepadconnected", "gamepaddisconnected", "beforeunload",
+ "batterychargingchange", "batterylevelchange", "webglcontextlost", "webglcontextrestored", "(invalid)" };
+ ++eventType;
+ if (eventType < 0) eventType = 0;
+ if (eventType >= sizeof(events)/sizeof(events[0])) eventType = sizeof(events)/sizeof(events[0])-1;
+ return events[eventType];
+}
+
+const char *emscripten_result_to_string(EMSCRIPTEN_RESULT result) {
+ if (result == EMSCRIPTEN_RESULT_SUCCESS) return "EMSCRIPTEN_RESULT_SUCCESS";
+ if (result == EMSCRIPTEN_RESULT_DEFERRED) return "EMSCRIPTEN_RESULT_DEFERRED";
+ if (result == EMSCRIPTEN_RESULT_NOT_SUPPORTED) return "EMSCRIPTEN_RESULT_NOT_SUPPORTED";
+ if (result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED) return "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED";
+ if (result == EMSCRIPTEN_RESULT_INVALID_TARGET) return "EMSCRIPTEN_RESULT_INVALID_TARGET";
+ if (result == EMSCRIPTEN_RESULT_UNKNOWN_TARGET) return "EMSCRIPTEN_RESULT_UNKNOWN_TARGET";
+ if (result == EMSCRIPTEN_RESULT_INVALID_PARAM) return "EMSCRIPTEN_RESULT_INVALID_PARAM";
+ if (result == EMSCRIPTEN_RESULT_FAILED) return "EMSCRIPTEN_RESULT_FAILED";
+ if (result == EMSCRIPTEN_RESULT_NO_DATA) return "EMSCRIPTEN_RESULT_NO_DATA";
+ return "Unknown EMSCRIPTEN_RESULT!";
+}
+
+#define TEST_RESULT(x) if (ret != EMSCRIPTEN_RESULT_SUCCESS) printf("%s returned %s.\n", #x, emscripten_result_to_string(ret));
+
+// The event handler functions can return 1 to suppress the event and disable the default action. That calls event.preventDefault();
+// Returning 0 signals that the event was not consumed by the code, and will allow the event to pass on and bubble up normally.
+EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *userData)
+{
+ if (eventType == EMSCRIPTEN_EVENT_KEYPRESS && (!strcmp(e->key, "f") || e->which == 102)) {
+ EmscriptenFullscreenChangeEvent fsce;
+ EMSCRIPTEN_RESULT ret = emscripten_get_fullscreen_status(&fsce);
+ TEST_RESULT(emscripten_get_fullscreen_status);
+ if (!fsce.isFullscreen) {
+ printf("Requesting fullscreen..\n");
+ ret = emscripten_request_fullscreen(0, 1);
+ TEST_RESULT(emscripten_request_fullscreen);
+ } else {
+ printf("Exiting fullscreen..\n");
+ ret = emscripten_exit_fullscreen();
+ TEST_RESULT(emscripten_exit_fullscreen);
+ ret = emscripten_get_fullscreen_status(&fsce);
+ TEST_RESULT(emscripten_get_fullscreen_status);
+ if (fsce.isFullscreen) {
+ fprintf(stderr, "Fullscreen exit did not work!\n");
+ }
+ }
+ }
+
+ return 0;
+}
+
+int callCount = 0;
+
+EM_BOOL fullscreenchange_callback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData)
+{
+ printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\". New size: %dx%d pixels. Screen size: %dx%d pixels.\n",
+ emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id, e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight);
+
+ ++callCount;
+ if (callCount == 1) { // Transitioned to fullscreen.
+ if (!e->isFullscreen) {
+ report_result(1);
+ }
+ } else if (callCount == 2) { // Transitioned to windowed, we must be back to the default pixel size 300x150.
+ if (e->isFullscreen || e->elementWidth != 300 || e->elementHeight != 150) {
+ report_result(1);
+ } else {
+ report_result(0);
+ }
+ }
+ return 0;
+}
+
+int main()
+{
+ EMSCRIPTEN_RESULT ret = emscripten_set_keypress_callback(0, 0, 1, key_callback);
+ TEST_RESULT(emscripten_set_keypress_callback);
+
+ ret = emscripten_set_fullscreenchange_callback(0, 0, 1, fullscreenchange_callback);
+ TEST_RESULT(emscripten_set_fullscreenchange_callback);
+
+ printf("To finish this test, press f to enter fullscreen mode, and then exit it.\n");
+
+ /* For the events to function, one must either call emscripten_set_main_loop or enable Module.noExitRuntime by some other means.
+ Otherwise the application will exit after leaving main(), and the atexit handlers will clean up all event hooks (by design). */
+ EM_ASM(Module['noExitRuntime'] = true);
+ return 0;
+}
diff --git a/tests/test_locale.c b/tests/test_locale.c
new file mode 100644
index 00000000..4aba30db
--- /dev/null
+++ b/tests/test_locale.c
@@ -0,0 +1,24 @@
+#include <locale.h>
+#include <stdio.h>
+
+int main()
+{
+ // Test basic functions from classic locale.
+ struct lconv* locale = localeconv();
+
+ printf("Testing locale information.\n");
+ printf("Decimal point: %s\n", locale->decimal_point);
+ printf("Thousands separator: %s\n", locale->thousands_sep);
+ printf("Grouping: %s\n", locale->grouping);
+ printf("International currency symbol: %s\n", locale->int_curr_symbol);
+ printf("Currency symbol: %s\n", locale->currency_symbol);
+ printf("Money decimal point: %s\n", locale->mon_decimal_point);
+ printf("Money thousands separator: %s\n", locale->mon_thousands_sep);
+ printf("Money Grouping: %s\n", locale->mon_grouping);
+ printf("Positive sign: %s\n", locale->positive_sign);
+ printf("Negative sign: %s\n", locale->negative_sign);
+
+ // If no runtime errors, assume the test passed.
+ printf("Locale tests passed.\n");
+ return 0;
+}
diff --git a/tests/test_locale.out b/tests/test_locale.out
new file mode 100644
index 00000000..7e8740fb
--- /dev/null
+++ b/tests/test_locale.out
@@ -0,0 +1,12 @@
+Testing locale information.
+Decimal point: .
+Thousands separator:
+Grouping:
+International currency symbol:
+Currency symbol:
+Money decimal point:
+Money thousands separator:
+Money Grouping:
+Positive sign:
+Negative sign:
+Locale tests passed.
diff --git a/tests/test_minmax.c b/tests/test_minmax.c
new file mode 100644
index 00000000..998c60d4
--- /dev/null
+++ b/tests/test_minmax.c
@@ -0,0 +1,89 @@
+#include <math.h>
+#include <assert.h>
+#include <float.h>
+#include <stdio.h>
+
+union fi
+{
+ float f;
+ unsigned int i;
+};
+
+unsigned int Float2Int(float f)
+{
+ union fi a;
+ a.f = f;
+ return a.i;
+}
+
+float Fminf(float x, float y)
+{
+ if (x < y || !(y == y))
+ return x;
+ else if (y < x || !(x == x))
+ return y;
+ else if (x != 0.f)
+ return x;
+ else
+ return Float2Int(x) == 0 ? y : x;
+}
+
+float Fmaxf(float x, float y)
+{
+ if (x > y || !(y == y))
+ return x;
+ else if (y > x || !(x == x))
+ return y;
+ else if (x != 0.f)
+ return x;
+ else
+ return Float2Int(x) == 0 ? x : y;
+}
+
+void TestMin(float a, float b, float ret)
+{
+ float x = Fminf(a, b);
+ if (x != ret)
+ printf("min(%f, %f) returned %f, should return ret: %f\n", a, b, x, ret);
+ assert(Float2Int(x) == Float2Int(ret));
+ float y = Fminf(b, a);
+ if (y != ret)
+ printf("min(%f, %f) returned %f, should return ret: %f\n", b, a, y, ret);
+ assert(Float2Int(y) == Float2Int(ret));
+}
+
+void TestMax(float a, float b, float ret)
+{
+ float x = Fmaxf(a, b);
+ if (x != ret)
+ printf("max(%f, %f) returned %f, should return ret: %f\n", a, b, x, ret);
+ assert(Float2Int(x) == Float2Int(ret));
+ float y = Fmaxf(b, a);
+ if (y != ret)
+ printf("max(%f, %f) returned %f, should return ret: %f\n", b, a, x, ret);
+ assert(Float2Int(y) == Float2Int(ret));
+}
+
+int main()
+{
+ TestMin(-INFINITY, INFINITY, -INFINITY);
+ TestMax(-INFINITY, INFINITY, INFINITY);
+
+ TestMin(-INFINITY, 1.f, -INFINITY);
+ TestMax(-INFINITY, 1.f, 1.f);
+
+ TestMin(INFINITY, 1.f, 1.f);
+ TestMax(INFINITY, 1.f, INFINITY);
+
+ TestMin(-INFINITY, NAN, -INFINITY);
+ TestMax(-INFINITY, NAN, -INFINITY);
+ assert(Float2Int(0.0f) != Float2Int(-0.0f));
+
+ if (NAN == NAN)
+ printf("NAN == NAN\n");
+ if (NAN != NAN)
+ printf("NAN != NAN\n");
+ TestMin(-0.0f, 0.0f, -0.0f);
+ TestMax(-0.0f, 0.0f, 0.0f);
+ printf("Success!\n");
+}
diff --git a/tests/test_other.py b/tests/test_other.py
index 00c42418..e381e1b3 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -1,7 +1,7 @@
import multiprocessing, os, re, shutil, subprocess, sys
import tools.shared
from tools.shared import *
-from runner import RunnerCore, path_from_root, get_bullet_library
+from runner import RunnerCore, path_from_root, get_bullet_library, nonfastcomp
class other(RunnerCore):
def get_zlib_library(self):
@@ -19,7 +19,7 @@ class other(RunnerCore):
output = Popen([PYTHON, compiler, '--version'], stdout=PIPE, stderr=PIPE).communicate()
output = output[0].replace('\r', '')
self.assertContained('''emcc (Emscripten GCC-like replacement)''', output)
- self.assertContained('''Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt)
+ self.assertContained('''Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
''', output)
@@ -134,13 +134,13 @@ Options that are modified or new in %s include:
(['-o', 'something.js', '-O2'], 2, None, 0, 1),
(['-o', 'something.js', '-O2', '-g'], 2, None, 0, 0),
(['-o', 'something.js', '-Os'], 2, None, 0, 1),
- (['-o', 'something.js', '-O3', '-s', 'ASM_JS=0'], 3, None, 1, 1),
+ (['-o', 'something.js', '-O3', '-s', 'ASM_JS=0'], 3, None, 0, 1),
# and, test compiling to bitcode first
(['-o', 'something.bc'], 0, [], 0, 0),
(['-o', 'something.bc', '-O0'], 0, [], 0, 0),
(['-o', 'something.bc', '-O1'], 1, ['-O1'], 0, 0),
(['-o', 'something.bc', '-O2'], 2, ['-O2'], 0, 0),
- (['-o', 'something.bc', '-O3'], 3, ['-O3', '-s', 'ASM_JS=0'], 1, 0),
+ (['-o', 'something.bc', '-O3'], 3, ['-O3', '-s', 'ASM_JS=0'], 0, 0),
(['-O1', '-o', 'something.bc'], 1, [], 0, 0),
]:
print params, opt_level, bc_params, closure, has_malloc
@@ -157,7 +157,6 @@ Options that are modified or new in %s include:
print '....', bc_args
output = Popen(bc_args, stdout=PIPE, stderr=PIPE).communicate()
assert os.path.exists('something.js'), output[1]
- assert ('Applying some potentially unsafe optimizations!' in output[1]) == (opt_level >= 3), 'unsafe warning should appear in opt >= 3'
self.assertContained('hello, world!', run_js('something.js'))
# Verify optimization level etc. in the generated code
@@ -196,8 +195,6 @@ Options that are modified or new in %s include:
(['-O2', '-g3'], lambda generated: 'var b=0' not in generated and 'var b = 0' not in generated and 'function _main' in generated, 'registerize is cancelled by -g3'),
#(['-O2', '-g4'], lambda generated: 'var b=0' not in generated and 'var b = 0' not in generated and 'function _main' in generated, 'same as -g3 for now'),
(['-s', 'INLINING_LIMIT=0'], lambda generated: 'function _dump' in generated, 'no inlining without opts'),
- (['-O3', '-s', 'INLINING_LIMIT=0', '--closure', '0'], lambda generated: 'function _dump' not in generated, 'lto/inlining'),
- (['-Os', '--llvm-lto', '1', '-s', 'ASM_JS=0', '-g2'], lambda generated: 'function _dump' in generated, '-Os disables 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'),
@@ -209,7 +206,7 @@ Options that are modified or new in %s include:
]:
print params, text
self.clear()
- if os.environ.get('EMCC_FAST_COMPILER') == '1' and ['disable typed arrays', 'typed arrays 1 selected']: continue
+ if os.environ.get('EMCC_FAST_COMPILER') != '0' and ['disable typed arrays', 'typed arrays 1 selected']: continue
output = Popen([PYTHON, compiler, path_from_root('tests', 'hello_world_loop.cpp'), '-o', 'a.out.js'] + params, stdout=PIPE, stderr=PIPE).communicate()
assert len(output[0]) == 0, output[0]
assert os.path.exists('a.out.js'), '\n'.join(output)
@@ -279,14 +276,41 @@ f.close()
# TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link!
# TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py.
+ def test_emcc_nonfastcomp(self):
+ nonfastcomp(self.test_emcc)
+
def test_cmake(self):
# Test all supported generators.
if WINDOWS:
generators = ['MinGW Makefiles', 'NMake Makefiles']
else:
- generators = ['Unix Makefiles']
-
- make_commands = { 'MinGW Makefiles': ['mingw32-make'], 'NMake Makefiles': ['nmake', '/NOLOGO'], 'Unix Makefiles': ['make'] }
+ generators = ['Unix Makefiles', 'Ninja', 'Eclipse CDT4 - Ninja']
+
+ def nmake_detect_error(configuration):
+ if Building.which(configuration['build'][0]):
+ return None
+ else:
+ return 'Skipping NMake test for CMake support, since nmake was not found in PATH. Run this test in Visual Studio command prompt to easily access nmake.'
+
+ def check_makefile(configuration, dirname):
+ assert os.path.exists(dirname + '/Makefile'), 'CMake call did not produce a Makefile!'
+
+ configurations = { 'MinGW Makefiles' : { 'prebuild': check_makefile,
+ 'build' : ['mingw32-make'],
+
+ },
+ 'NMake Makefiles' : { 'detect' : nmake_detect_error,
+ 'prebuild': check_makefile,
+ 'build' : ['nmake', '/NOLOGO'],
+ },
+ 'Unix Makefiles' : { 'prebuild': check_makefile,
+ 'build' : ['make'],
+ },
+ 'Ninja' : { 'build' : ['ninja'],
+ },
+ 'Eclipse CDT4 - Ninja': { 'build' : ['ninja'],
+ }
+ }
if os.name == 'nt':
emconfigure = path_from_root('emconfigure.bat')
@@ -294,11 +318,37 @@ f.close()
emconfigure = path_from_root('emconfigure')
for generator in generators:
- if generator == 'NMake Makefiles' and not Building.which('nmake'):
- print >> sys.stderr, 'Skipping NMake test for CMake support, since nmake was not found in PATH. Run this test in Visual Studio command prompt to easily access nmake.'
+ conf = configurations[generator]
+
+ make = conf['build']
+
+ try:
+ detector = conf['detect']
+ except KeyError:
+ detector = None
+
+ if detector:
+ error = detector(conf)
+ elif len(make) == 1 and not Building.which(make[0]):
+ # Use simple test if applicable
+ error = 'Skipping %s test for CMake support, since it could not be detected.' % generator
+ else:
+ error = None
+
+ if error:
+ logging.warning(error)
continue
- make = make_commands[generator]
+ try:
+ prebuild = conf['prebuild']
+ except KeyError:
+ prebuild = None
+
+ try:
+ postbuild = conf['postbuild']
+ except KeyError:
+ postbuild = None
+
cmake_cases = ['target_js', 'target_html']
cmake_outputs = ['test_cmake.js', 'hello_world_gles.html']
for i in range(0, 2):
@@ -331,7 +381,9 @@ f.close()
logging.error('Failed command: ' + ' '.join(cmd))
logging.error('Result:\n' + ret[1])
raise Exception('cmake call failed!')
- assert os.path.exists(tempdirname + '/Makefile'), 'CMake call did not produce a Makefile!'
+
+ if prebuild:
+ prebuild(configuration, tempdirname)
# Build
cmd = make + (['VERBOSE=1'] if verbose_level >= 3 else [])
@@ -344,6 +396,9 @@ f.close()
raise Exception('make failed!')
assert os.path.exists(tempdirname + '/' + cmake_outputs[i]), 'Building a cmake-generated Makefile failed to produce an output file %s!' % tempdirname + '/' + cmake_outputs[i]
+ if postbuild:
+ postbuild(configuration, tempdirname)
+
# Run through node, if CMake produced a .js file.
if cmake_outputs[i].endswith('.js'):
ret = Popen(listify(NODE_JS) + [tempdirname + '/' + cmake_outputs[i]], stdout=PIPE).communicate()[0]
@@ -398,48 +453,48 @@ f.close()
self.assertContained('hello, world!', run_js(os.path.join(self.get_dir(), 'a.out.js')))
def test_unaligned_memory(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
- #include <stdio.h>
- #include <stdarg.h>
+ def test():
+ open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
+ #include <stdio.h>
+ #include <stdarg.h>
- typedef unsigned char Bit8u;
- typedef unsigned short Bit16u;
- typedef unsigned int Bit32u;
+ typedef unsigned char Bit8u;
+ typedef unsigned short Bit16u;
+ typedef unsigned int Bit32u;
- int main()
- {
- va_list argp;
- va_arg(argp, char *); // check for compilation error, #1705
+ int main()
+ {
+ va_list argp;
+ va_arg(argp, char *); // check for compilation error, #1705
- Bit8u data[4] = {0x01,0x23,0x45,0x67};
+ Bit8u data[4] = {0x01,0x23,0x45,0x67};
- printf("data: %x\n", *(Bit32u*)data);
- printf("data[0,1] 16bit: %x\n", *(Bit16u*)data);
- printf("data[1,2] 16bit: %x\n", *(Bit16u*)(data+1));
- }
- ''')
- Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate()
- self.assertContained('data: 67452301\ndata[0,1] 16bit: 2301\ndata[1,2] 16bit: 4523', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ printf("data: %x\n", *(Bit32u*)data);
+ printf("data[0,1] 16bit: %x\n", *(Bit16u*)data);
+ printf("data[1,2] 16bit: %x\n", *(Bit16u*)(data+1));
+ }
+ ''')
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate()
+ self.assertContained('data: 67452301\ndata[0,1] 16bit: 2301\ndata[1,2] 16bit: 4523', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ nonfastcomp(test)
def test_unaligned_memory_2(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
- #include <string>
- #include <stdio.h>
+ def test():
+ open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r'''
+ #include <string>
+ #include <stdio.h>
- int main( int argc, char ** argv )
- {
- std::string testString( "Hello, World!" );
+ int main( int argc, char ** argv )
+ {
+ std::string testString( "Hello, World!" );
- printf( "testString = %s\n", testString.c_str() );
- return 0;
- }
- ''')
- Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate()
- self.assertContained('testString = Hello, World!', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ printf( "testString = %s\n", testString.c_str() );
+ return 0;
+ }
+ ''')
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate()
+ self.assertContained('testString = Hello, World!', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ nonfastcomp(test)
def test_asm_minify(self):
def test(args):
@@ -468,7 +523,6 @@ f.close()
assert 'function _malloc' in src
def test_dangerous_func_cast(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
src = r'''
#include <stdio.h>
typedef void (*voidfunc)();
@@ -485,18 +539,29 @@ f.close()
'''
open('src.c', 'w').write(src)
def test(args, expected, err_expected=None):
+ print args, expected, err_expected
out, err = Popen([PYTHON, EMCC, 'src.c'] + args, stderr=PIPE).communicate()
if err_expected: self.assertContained(err_expected, err)
self.assertContained(expected, run_js(self.in_dir('a.out.js'), stderr=PIPE, full_output=True))
return open(self.in_dir('a.out.js')).read()
- test([], 'my func') # no asm, so casting func works
- test(['-O2'], 'abort', ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
- 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
- test(['-O2', '-s', 'ASSERTIONS=1'],
- 'Invalid function pointer called. Perhaps a miscast function pointer (check compilation warnings) or bad vtable lookup (maybe due to derefing a bad pointer, like NULL)?',
- ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
- 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
+ if os.environ.get('EMCC_FAST_COMPILER') == '0':
+ test([], 'my func') # no asm, so casting func works
+ test(['-O2'], 'abort', ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
+ 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
+ test(['-O2', '-s', 'ASSERTIONS=1'],
+ 'Invalid function pointer called. Perhaps a miscast function pointer (check compilation warnings) or bad vtable lookup (maybe due to derefing a bad pointer, like NULL)?',
+ ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func',
+ 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure
+ else:
+ # fastcomp. all asm, so it can't just work with wrong sigs. but, ASSERTIONS=2 gives much better info to debug
+ test(['-O1'], 'If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.') # no useful info, but does mention ASSERTIONS
+ test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
+Build with ASSERTIONS=2 for more info.
+''') # some useful text
+ test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '0' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
+This pointer might make sense in another type signature: i: 0
+''') # actually useful identity of the bad pointer, with comparisons to what it would be in other types/tables
def test_l_link(self):
# Linking with -lLIBNAME and -L/DIRNAME should work
@@ -528,283 +593,285 @@ f.close()
assert not os.path.exists('a.out') and not os.path.exists('a.exe'), 'Must not leave unneeded linker stubs'
def test_static_link(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
- def test(name, header, main, side, expected, args=[], suffix='cpp', first=True):
- print name
- #t = main ; main = side ; side = t
- original_main = main
- original_side = side
- if header: open(os.path.join(self.get_dir(), 'header.h'), 'w').write(header)
- if type(main) == str:
- open(os.path.join(self.get_dir(), 'main.' + suffix), 'w').write(main)
- main = ['main.' + suffix]
- if type(side) == str:
- open(os.path.join(self.get_dir(), 'side.' + suffix), 'w').write(side)
- side = ['side.' + suffix]
- Popen([PYTHON, EMCC] + side + ['-o', 'side.js', '-s', 'SIDE_MODULE=1', '-O2'] + args).communicate()
- # TODO: test with and without DISABLE_GL_EMULATION, check that file sizes change
- Popen([PYTHON, EMCC] + main + ['-o', 'main.js', '-s', 'MAIN_MODULE=1', '-O2', '-s', 'DISABLE_GL_EMULATION=1'] + args).communicate()
- Popen([PYTHON, EMLINK, 'main.js', 'side.js', 'together.js'], stdout=PIPE).communicate()
- assert os.path.exists('together.js')
- for engine in JS_ENGINES:
- out = run_js('together.js', engine=engine, stderr=PIPE, full_output=True)
- self.assertContained(expected, out)
- if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out)
- if first:
- shutil.copyfile('together.js', 'first.js')
- test(name + ' (reverse)', header, original_side, original_main, expected, args, suffix, False) # test reverse order
-
- # test a simple call from one module to another. only one has a string (and constant memory initialization for it)
- test('basics', '', '''
- #include <stdio.h>
- extern int sidey();
- int main() {
- printf("other says %d.", sidey());
- return 0;
- }
- ''', '''
- int sidey() { return 11; }
- ''', 'other says 11.')
-
- # finalization of float variables should pass asm.js validation
- test('floats', '', '''
- #include <stdio.h>
- extern float sidey();
- int main() {
- printf("other says %.2f.", sidey()+1);
- return 0;
- }
- ''', '''
- float sidey() { return 11.5; }
- ''', 'other says 12.50')
+ def nonfc():
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
+
+ def test(name, header, main, side, expected, args=[], suffix='cpp', first=True):
+ print name
+ #t = main ; main = side ; side = t
+ original_main = main
+ original_side = side
+ if header: open(os.path.join(self.get_dir(), 'header.h'), 'w').write(header)
+ if type(main) == str:
+ open(os.path.join(self.get_dir(), 'main.' + suffix), 'w').write(main)
+ main = ['main.' + suffix]
+ if type(side) == str:
+ open(os.path.join(self.get_dir(), 'side.' + suffix), 'w').write(side)
+ side = ['side.' + suffix]
+ Popen([PYTHON, EMCC] + side + ['-o', 'side.js', '-s', 'SIDE_MODULE=1', '-O2'] + args).communicate()
+ # TODO: test with and without DISABLE_GL_EMULATION, check that file sizes change
+ Popen([PYTHON, EMCC] + main + ['-o', 'main.js', '-s', 'MAIN_MODULE=1', '-O2', '-s', 'DISABLE_GL_EMULATION=1'] + args).communicate()
+ Popen([PYTHON, EMLINK, 'main.js', 'side.js', 'together.js'], stdout=PIPE).communicate()
+ assert os.path.exists('together.js')
+ for engine in JS_ENGINES:
+ out = run_js('together.js', engine=engine, stderr=PIPE, full_output=True)
+ self.assertContained(expected, out)
+ if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out)
+ if first:
+ shutil.copyfile('together.js', 'first.js')
+ test(name + ' (reverse)', header, original_side, original_main, expected, args, suffix, False) # test reverse order
+
+ # test a simple call from one module to another. only one has a string (and constant memory initialization for it)
+ test('basics', '', '''
+ #include <stdio.h>
+ extern int sidey();
+ int main() {
+ printf("other says %d.", sidey());
+ return 0;
+ }
+ ''', '''
+ int sidey() { return 11; }
+ ''', 'other says 11.')
- # memory initialization in both
- test('multiple memory inits', '', r'''
- #include <stdio.h>
- extern void sidey();
- int main() {
- printf("hello from main\n");
- sidey();
- return 0;
- }
- ''', r'''
- #include <stdio.h>
- void sidey() { printf("hello from side\n"); }
- ''', 'hello from main\nhello from side\n')
+ # finalization of float variables should pass asm.js validation
+ test('floats', '', '''
+ #include <stdio.h>
+ extern float sidey();
+ int main() {
+ printf("other says %.2f.", sidey()+1);
+ return 0;
+ }
+ ''', '''
+ float sidey() { return 11.5; }
+ ''', 'other says 12.50')
- # function pointers
- test('fp1', 'typedef void (*voidfunc)();', r'''
- #include <stdio.h>
- #include "header.h"
- voidfunc sidey(voidfunc f);
- void a() { printf("hello from funcptr\n"); }
- int main() {
- sidey(a)();
- return 0;
- }
- ''', '''
- #include "header.h"
- voidfunc sidey(voidfunc f) { return f; }
- ''', 'hello from funcptr\n')
+ # memory initialization in both
+ test('multiple memory inits', '', r'''
+ #include <stdio.h>
+ extern void sidey();
+ int main() {
+ printf("hello from main\n");
+ sidey();
+ return 0;
+ }
+ ''', r'''
+ #include <stdio.h>
+ void sidey() { printf("hello from side\n"); }
+ ''', 'hello from main\nhello from side\n')
- # function pointers with 'return' in the name
- test('fp2', 'typedef void (*voidfunc)();', r'''
- #include <stdio.h>
- #include "header.h"
- int sidey(voidfunc f);
- void areturn0() { printf("hello 0\n"); }
- void areturn1() { printf("hello 1\n"); }
- void areturn2() { printf("hello 2\n"); }
- int main(int argc, char **argv) {
- voidfunc table[3] = { areturn0, areturn1, areturn2 };
- table[sidey(NULL)]();
- return 0;
- }
- ''', '''
- #include "header.h"
- int sidey(voidfunc f) { if (f) f(); return 1; }
- ''', 'hello 1\n')
+ # function pointers
+ test('fp1', 'typedef void (*voidfunc)();', r'''
+ #include <stdio.h>
+ #include "header.h"
+ voidfunc sidey(voidfunc f);
+ void a() { printf("hello from funcptr\n"); }
+ int main() {
+ sidey(a)();
+ return 0;
+ }
+ ''', '''
+ #include "header.h"
+ voidfunc sidey(voidfunc f) { return f; }
+ ''', 'hello from funcptr\n')
- # Global initializer
- test('global init', '', r'''
- #include <stdio.h>
- struct Class {
- Class() { printf("a new Class\n"); }
- };
- static Class c;
- int main() {
- return 0;
- }
- ''', r'''
- void nothing() {}
- ''', 'a new Class\n')
+ # function pointers with 'return' in the name
+ test('fp2', 'typedef void (*voidfunc)();', r'''
+ #include <stdio.h>
+ #include "header.h"
+ int sidey(voidfunc f);
+ void areturn0() { printf("hello 0\n"); }
+ void areturn1() { printf("hello 1\n"); }
+ void areturn2() { printf("hello 2\n"); }
+ int main(int argc, char **argv) {
+ voidfunc table[3] = { areturn0, areturn1, areturn2 };
+ table[sidey(NULL)]();
+ return 0;
+ }
+ ''', '''
+ #include "header.h"
+ int sidey(voidfunc f) { if (f) f(); return 1; }
+ ''', 'hello 1\n')
- # Multiple global initializers (LLVM generates overlapping names for them)
- test('global inits', r'''
- #include <stdio.h>
- struct Class {
- Class(const char *name) { printf("new %s\n", name); }
- };
- ''', r'''
- #include "header.h"
- static Class c("main");
- int main() {
- return 0;
- }
- ''', r'''
- #include "header.h"
- static Class c("side");
- ''', ['new main\nnew side\n', 'new side\nnew main\n'])
+ # Global initializer
+ test('global init', '', r'''
+ #include <stdio.h>
+ struct Class {
+ Class() { printf("a new Class\n"); }
+ };
+ static Class c;
+ int main() {
+ return 0;
+ }
+ ''', r'''
+ void nothing() {}
+ ''', 'a new Class\n')
- # Class code used across modules
- test('codecall', r'''
- #include <stdio.h>
- struct Class {
- Class(const char *name);
- };
- ''', r'''
- #include "header.h"
- int main() {
- Class c("main");
- return 0;
- }
- ''', r'''
- #include "header.h"
- Class::Class(const char *name) { printf("new %s\n", name); }
- ''', ['new main\n'])
-
- # malloc usage in both modules
- test('malloc', r'''
- #include <stdlib.h>
- #include <string.h>
- char *side(const char *data);
- ''', r'''
- #include <stdio.h>
- #include "header.h"
- int main() {
- char *temp = side("hello through side\n");
- char *ret = (char*)malloc(strlen(temp)+1);
- strcpy(ret, temp);
- temp[1] = 'x';
- puts(ret);
- return 0;
- }
- ''', r'''
- #include "header.h"
- char *side(const char *data) {
- char *ret = (char*)malloc(strlen(data)+1);
- strcpy(ret, data);
- return ret;
- }
- ''', ['hello through side\n'])
+ # Multiple global initializers (LLVM generates overlapping names for them)
+ test('global inits', r'''
+ #include <stdio.h>
+ struct Class {
+ Class(const char *name) { printf("new %s\n", name); }
+ };
+ ''', r'''
+ #include "header.h"
+ static Class c("main");
+ int main() {
+ return 0;
+ }
+ ''', r'''
+ #include "header.h"
+ static Class c("side");
+ ''', ['new main\nnew side\n', 'new side\nnew main\n'])
- # js library call
- open('lib.js', 'w').write(r'''
- mergeInto(LibraryManager.library, {
- test_lib_func: function(x) {
- return x + 17.2;
+ # Class code used across modules
+ test('codecall', r'''
+ #include <stdio.h>
+ struct Class {
+ Class(const char *name);
+ };
+ ''', r'''
+ #include "header.h"
+ int main() {
+ Class c("main");
+ return 0;
}
- });
- ''')
- test('js-lib', 'extern "C" { extern double test_lib_func(int input); }', r'''
- #include <stdio.h>
- #include "header.h"
- extern double sidey();
- int main2() { return 11; }
- int main() {
- int input = sidey();
- double temp = test_lib_func(input);
- printf("other says %.2f\n", temp);
- printf("more: %.5f, %d\n", temp, input);
- return 0;
- }
- ''', r'''
- #include <stdio.h>
- #include "header.h"
- extern int main2();
- double sidey() {
- int temp = main2();
- printf("main2 sed: %d\n", temp);
- printf("main2 sed: %u, %c\n", temp, temp/2);
- return test_lib_func(temp);
- }
- ''', 'other says 45.2', ['--js-library', 'lib.js'])
+ ''', r'''
+ #include "header.h"
+ Class::Class(const char *name) { printf("new %s\n", name); }
+ ''', ['new main\n'])
- # libc usage in one modules. must force libc inclusion in the main module if that isn't the one using mallinfo()
- try:
- os.environ['EMCC_FORCE_STDLIBS'] = 'libc'
- test('malloc-1', r'''
+ # malloc usage in both modules
+ test('malloc', r'''
+ #include <stdlib.h>
#include <string.h>
- int side();
+ char *side(const char *data);
''', r'''
#include <stdio.h>
#include "header.h"
int main() {
- printf("|%d|\n", side());
+ char *temp = side("hello through side\n");
+ char *ret = (char*)malloc(strlen(temp)+1);
+ strcpy(ret, temp);
+ temp[1] = 'x';
+ puts(ret);
return 0;
}
''', r'''
- #include <stdlib.h>
- #include <malloc.h>
#include "header.h"
- int side() {
- struct mallinfo m = mallinfo();
- return m.arena > 1;
+ char *side(const char *data) {
+ char *ret = (char*)malloc(strlen(data)+1);
+ strcpy(ret, data);
+ return ret;
}
- ''', ['|1|\n'])
- finally:
- del os.environ['EMCC_FORCE_STDLIBS']
-
- # iostream usage in one and std::string in both
- test('iostream', r'''
- #include <iostream>
- #include <string>
- std::string side();
- ''', r'''
- #include "header.h"
- int main() {
- std::cout << "hello from main " << side() << std::endl;
- return 0;
- }
- ''', r'''
- #include "header.h"
- std::string side() { return "and hello from side"; }
- ''', ['hello from main and hello from side\n'])
-
- # followup to iostream test: a second linking
- print 'second linking of a linking output'
- open('moar.cpp', 'w').write(r'''
- #include <iostream>
- struct Moar {
- Moar() { std::cout << "moar!" << std::endl; }
- };
- Moar m;
- ''')
- Popen([PYTHON, EMCC, 'moar.cpp', '-o', 'moar.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate()
- Popen([PYTHON, EMLINK, 'together.js', 'moar.js', 'triple.js'], stdout=PIPE).communicate()
- assert os.path.exists('triple.js')
- for engine in JS_ENGINES:
- out = run_js('triple.js', engine=engine, stderr=PIPE, full_output=True)
- self.assertContained('moar!\nhello from main and hello from side\n', out)
- if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out)
-
- # zlib compression library. tests function pointers in initializers and many other things
- test('zlib', '', open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(),
- self.get_zlib_library(),
- open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(),
- args=['-I' + path_from_root('tests', 'zlib')], suffix='c')
-
- use_cmake = WINDOWS
- bullet_library = get_bullet_library(self, use_cmake)
-
- # bullet physics engine. tests all the things
- test('bullet', '', open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(),
- bullet_library,
- [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', 'output3.txt'), 'r').read()],
- args=['-I' + path_from_root('tests', 'bullet', 'src')])
+ ''', ['hello through side\n'])
+
+ # js library call
+ open('lib.js', 'w').write(r'''
+ mergeInto(LibraryManager.library, {
+ test_lib_func: function(x) {
+ return x + 17.2;
+ }
+ });
+ ''')
+ test('js-lib', 'extern "C" { extern double test_lib_func(int input); }', r'''
+ #include <stdio.h>
+ #include "header.h"
+ extern double sidey();
+ int main2() { return 11; }
+ int main() {
+ int input = sidey();
+ double temp = test_lib_func(input);
+ printf("other says %.2f\n", temp);
+ printf("more: %.5f, %d\n", temp, input);
+ return 0;
+ }
+ ''', r'''
+ #include <stdio.h>
+ #include "header.h"
+ extern int main2();
+ double sidey() {
+ int temp = main2();
+ printf("main2 sed: %d\n", temp);
+ printf("main2 sed: %u, %c\n", temp, temp/2);
+ return test_lib_func(temp);
+ }
+ ''', 'other says 45.2', ['--js-library', 'lib.js'])
+
+ # libc usage in one modules. must force libc inclusion in the main module if that isn't the one using mallinfo()
+ try:
+ os.environ['EMCC_FORCE_STDLIBS'] = 'libc'
+ test('malloc-1', r'''
+ #include <string.h>
+ int side();
+ ''', r'''
+ #include <stdio.h>
+ #include "header.h"
+ int main() {
+ printf("|%d|\n", side());
+ return 0;
+ }
+ ''', r'''
+ #include <stdlib.h>
+ #include <malloc.h>
+ #include "header.h"
+ int side() {
+ struct mallinfo m = mallinfo();
+ return m.arena > 1;
+ }
+ ''', ['|1|\n'])
+ finally:
+ del os.environ['EMCC_FORCE_STDLIBS']
+
+ # iostream usage in one and std::string in both
+ test('iostream', r'''
+ #include <iostream>
+ #include <string>
+ std::string side();
+ ''', r'''
+ #include "header.h"
+ int main() {
+ std::cout << "hello from main " << side() << std::endl;
+ return 0;
+ }
+ ''', r'''
+ #include "header.h"
+ std::string side() { return "and hello from side"; }
+ ''', ['hello from main and hello from side\n'])
+
+ # followup to iostream test: a second linking
+ print 'second linking of a linking output'
+ open('moar.cpp', 'w').write(r'''
+ #include <iostream>
+ struct Moar {
+ Moar() { std::cout << "moar!" << std::endl; }
+ };
+ Moar m;
+ ''')
+ Popen([PYTHON, EMCC, 'moar.cpp', '-o', 'moar.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate()
+ Popen([PYTHON, EMLINK, 'together.js', 'moar.js', 'triple.js'], stdout=PIPE).communicate()
+ assert os.path.exists('triple.js')
+ for engine in JS_ENGINES:
+ out = run_js('triple.js', engine=engine, stderr=PIPE, full_output=True)
+ self.assertContained('moar!\nhello from main and hello from side\n', out)
+ if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out)
+
+ # zlib compression library. tests function pointers in initializers and many other things
+ test('zlib', '', open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(),
+ self.get_zlib_library(),
+ open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(),
+ args=['-I' + path_from_root('tests', 'zlib')], suffix='c')
+
+ use_cmake = WINDOWS
+ bullet_library = get_bullet_library(self, use_cmake)
+
+ # bullet physics engine. tests all the things
+ test('bullet', '', open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(),
+ bullet_library,
+ [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', 'output3.txt'), 'r').read()],
+ args=['-I' + path_from_root('tests', 'bullet', 'src')])
+ nonfastcomp(nonfc)
def test_outline(self):
def test(name, src, libs, expected, expected_ranges, args=[], suffix='cpp'):
@@ -852,11 +919,11 @@ f.close()
for test_opts, expected_ranges in [
([], {
100: (190, 500),
- 250: (200, 500),
- 500: (250, 500),
+ 250: (200, 600),
+ 500: (250, 700),
1000: (230, 1000),
2000: (380, 2000),
- 5000: (800, 5000),
+ 5000: (500, 5000),
0: (1500, 5000)
}),
(['-O2'], {
@@ -1720,10 +1787,14 @@ f.close()
['asm', 'eliminate']),
(path_from_root('tools', 'test-js-optimizer-asm-regs.js'), open(path_from_root('tools', 'test-js-optimizer-asm-regs-output.js')).read(),
['asm', 'registerize']),
+ (path_from_root('tools', 'test-js-optimizer-asm-regs-harder.js'), open(path_from_root('tools', 'test-js-optimizer-asm-regs-harder-output.js')).read(),
+ ['asm', 'registerizeHarder']),
(path_from_root('tools', 'test-js-optimizer-asm-regs-min.js'), open(path_from_root('tools', 'test-js-optimizer-asm-regs-min-output.js')).read(),
- ['asm', 'registerize']),
+ ['asm', 'registerize', 'minifyLocals']),
(path_from_root('tools', 'test-js-optimizer-asm-pre.js'), open(path_from_root('tools', 'test-js-optimizer-asm-pre-output.js')).read(),
['asm', 'simplifyExpressions']),
+ (path_from_root('tools', 'test-js-optimizer-asm-pre-f32.js'), open(path_from_root('tools', 'test-js-optimizer-asm-pre-output-f32.js')).read(),
+ ['asm', 'asmPreciseF32', 'simplifyExpressions', 'optimizeFrounds']),
(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']),
(path_from_root('tools', 'test-js-optimizer-asm-relocate.js'), open(path_from_root('tools', 'test-js-optimizer-asm-relocate-output.js')).read(),
@@ -1751,25 +1822,28 @@ f.close()
assert 'error' not in err, 'Unexpected stderr: ' + err
def test_chunking(self):
- if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode')
- if os.environ.get('EMCC_CORES'): return self.skip('cannot run if cores are altered')
- if multiprocessing.cpu_count() < 2: return self.skip('need multiple cores')
- try:
- os.environ['EMCC_DEBUG'] = '1'
- os.environ['EMCC_CORES'] = '2' # standardize over machines
- for asm, linkable, chunks in [
- (0, 0, 2), (0, 1, 2),
- (1, 0, 2), (1, 1, 2)
- ]:
- print asm, linkable, chunks
- output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate()
- ok = False
- for c in range(chunks, chunks+2):
- ok = ok or ('phase 2 working on %d chunks' % c in err)
- assert ok, err
- finally:
- del os.environ['EMCC_DEBUG']
- del os.environ['EMCC_CORES']
+ def nonfc():
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('not relevant for fastcomp, only checks js compiler chunking')
+ if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode')
+ if os.environ.get('EMCC_CORES'): return self.skip('cannot run if cores are altered')
+ if multiprocessing.cpu_count() < 2: return self.skip('need multiple cores')
+ try:
+ os.environ['EMCC_DEBUG'] = '1'
+ os.environ['EMCC_CORES'] = '2' # standardize over machines
+ for asm, linkable, chunks in [
+ (0, 0, 2), (0, 1, 2),
+ (1, 0, 2), (1, 1, 2)
+ ]:
+ print asm, linkable, chunks
+ output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate()
+ ok = False
+ for c in range(chunks, chunks+2):
+ ok = ok or ('phase 2 working on %d chunks' % c in err)
+ assert ok, err
+ finally:
+ del os.environ['EMCC_DEBUG']
+ del os.environ['EMCC_CORES']
+ nonfastcomp(nonfc)
def test_debuginfo(self):
if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode')
@@ -1801,23 +1875,25 @@ f.close()
assert 'If you see this - the world is all right!' in output
def test_embind(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
- for args, fail in [
- ([], True), # without --bind, we fail
- (['--bind'], False),
- (['--bind', '-O1'], False),
- (['--bind', '-O2'], False),
- (['--bind', '-O1', '-s', 'ASM_JS=0'], False),
- (['--bind', '-O2', '-s', 'ASM_JS=0'], False)
- ]:
- print args, fail
- self.clear()
- try_delete(self.in_dir('a.out.js'))
- Popen([PYTHON, EMCC, path_from_root('tests', 'embind', 'embind_test.cpp'), '--post-js', path_from_root('tests', 'embind', 'underscore-1.4.2.js'), '--post-js', path_from_root('tests', 'embind', 'imvu_test_adapter.js'), '--post-js', path_from_root('tests', 'embind', 'embind.test.js')] + args, stderr=PIPE if fail else None).communicate()
- assert os.path.exists(self.in_dir('a.out.js')) == (not fail)
- if not fail:
- output = run_js(self.in_dir('a.out.js'), stdout=PIPE, stderr=PIPE, full_output=True)
- assert "FAIL" not in output, output
+ def nonfc():
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp')
+ for args, fail in [
+ ([], True), # without --bind, we fail
+ (['--bind'], False),
+ (['--bind', '-O1'], False),
+ (['--bind', '-O2'], False),
+ (['--bind', '-O1', '-s', 'ASM_JS=0'], False),
+ (['--bind', '-O2', '-s', 'ASM_JS=0'], False)
+ ]:
+ print args, fail
+ self.clear()
+ try_delete(self.in_dir('a.out.js'))
+ Popen([PYTHON, EMCC, path_from_root('tests', 'embind', 'embind_test.cpp'), '--post-js', path_from_root('tests', 'embind', 'underscore-1.4.2.js'), '--post-js', path_from_root('tests', 'embind', 'imvu_test_adapter.js'), '--post-js', path_from_root('tests', 'embind', 'embind.test.js')] + args, stderr=PIPE if fail else None).communicate()
+ assert os.path.exists(self.in_dir('a.out.js')) == (not fail)
+ if not fail:
+ output = run_js(self.in_dir('a.out.js'), stdout=PIPE, stderr=PIPE, full_output=True)
+ assert "FAIL" not in output, output
+ nonfastcomp(nonfc)
def test_llvm_nativizer(self):
try:
@@ -1867,8 +1943,6 @@ seeked= file.
assert output == invalid
def test_link_s(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo safe heap in fastcomp')
-
# -s OPT=VALUE can conflict with -s as a linker option. We warn and ignore
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
extern "C" {
@@ -2221,7 +2295,6 @@ mergeInto(LibraryManager.library, {
process.communicate()
assert(os.path.isfile(outdir + 'hello_world.obj'))
-
def test_doublestart_bug(self):
open('code.cpp', 'w').write(r'''
#include <stdio.h>
@@ -2253,3 +2326,211 @@ Module["preRun"].push(function () {
assert output.count('This should only appear once.') == 1, '\n'+output
+ def test_module_print(self):
+ open('code.cpp', 'w').write(r'''
+#include <stdio.h>
+int main(void) {
+ printf("123456789\n");
+ return 0;
+}
+''')
+
+ open('pre.js', 'w').write(r'''
+var Module = { print: function(x) { throw '<{(' + x + ')}>' } };
+''')
+
+ Popen([PYTHON, EMCC, 'code.cpp', '--pre-js', 'pre.js']).communicate()
+ output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS)
+ assert r'<{(123456789)}>' in output, output
+
+ def test_precompiled_headers(self):
+ self.clear()
+
+ open('header.h', 'w').write('#define X 5\n')
+ Popen([PYTHON, EMCC, '-xc++-header', 'header.h', '-c']).communicate()
+ assert os.path.exists('header.h.gch')
+
+ open('src.cpp', 'w').write(r'''
+#include <stdio.h>
+int main() {
+ printf("|%d|\n", X);
+ return 0;
+}
+''')
+ Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h']).communicate()
+
+ output = run_js(self.in_dir('a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS)
+ assert '|5|' in output, output
+
+ # also verify that the gch is actually used
+ err = Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h', '-Xclang', '-print-stats'], stderr=PIPE).communicate()
+ assert '*** PCH/Modules Loaded:\nModule: header.h.gch' in err[1], err[1]
+ # and sanity check it is not mentioned when not
+ try_delete('header.h.gch')
+ err = Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h', '-Xclang', '-print-stats'], stderr=PIPE).communicate()
+ assert '*** PCH/Modules Loaded:\nModule: header.h.gch' not in err[1], err[1]
+
+ def test_warn_unaligned(self):
+ if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('need fastcomp')
+ open('src.cpp', 'w').write(r'''
+#include <stdio.h>
+static const double grid[4][2] = {{-3 / 3., -1 / 3.},
+ {+1 / 3., -3 / 3.},
+ {-1 / 3., +3 / 3.},
+ {+3 / 3., +1 / 3.}};
+int main() {
+ for (int i = 0; i < 4; i++)
+ printf("%d:%.2f,%.2f ", i, grid[i][0], grid[i][1]);
+ printf("\n");
+ return 0;
+}
+''')
+ output = Popen([PYTHON, EMCC, 'src.cpp', '-O1', '-s', 'WARN_UNALIGNED=1'], stderr=PIPE).communicate()
+ assert 'emcc: warning: unaligned store' in output[1]
+ output = Popen([PYTHON, EMCC, 'src.cpp', '-s', 'WARN_UNALIGNED=1', '-g'], stderr=PIPE).communicate()
+ assert 'emcc: warning: unaligned store' in output[1]
+ assert '@line 9 "src.cpp"' in output[1]
+
+ def test_no_exit_runtime(self):
+ open('code.cpp', 'w').write(r'''
+#include <stdio.h>
+
+template<int x>
+struct Waste {
+ Waste() {
+ printf("coming around %d\n", x);
+ }
+ ~Waste() {
+ printf("going away %d\n", x);
+ }
+};
+
+Waste<1> w1;
+Waste<2> w2;
+Waste<3> w3;
+Waste<4> w4;
+Waste<5> w5;
+
+int main(int argc, char **argv) {
+ return 0;
+}
+''')
+
+ for no_exit in [0, 1]:
+ for opts in [[], ['-O1'], ['-O2', '-g2'], ['-O2', '-g2', '--llvm-lto', '1']]:
+ print no_exit, opts
+ Popen([PYTHON, EMCC] + opts + ['code.cpp', '-s', 'NO_EXIT_RUNTIME=' + str(no_exit)]).communicate()
+ output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS)
+ src = open('a.out.js').read()
+ exit = 1-no_exit
+ assert 'coming around' in output
+ assert ('going away' in output) == exit, 'destructors should not run if no exit'
+ assert ('_ZN5WasteILi2EED1Ev' in src) == exit, 'destructors should not appear if no exit'
+ assert ('atexit(' in src) == exit, 'atexit should not appear or be called'
+
+ def test_os_oz(self):
+ if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode')
+ try:
+ os.environ['EMCC_DEBUG'] = '1'
+ for args, expect in [
+ (['-O1'], 'LLVM opts: -O1'),
+ (['-O2'], 'LLVM opts: -O3'),
+ (['-Os'], 'LLVM opts: -Os'),
+ (['-Oz'], 'LLVM opts: -Oz'),
+ (['-O3'], 'LLVM opts: -O3'),
+ ]:
+ print args, expect
+ output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + args, stdout=PIPE, stderr=PIPE).communicate()
+ self.assertContained(expect, err)
+ self.assertContained('hello, world!', run_js('a.out.js'))
+ finally:
+ del os.environ['EMCC_DEBUG']
+
+ def test_global_inits(self):
+ open('inc.h', 'w').write(r'''
+#include <stdio.h>
+
+template<int x>
+struct Waste {
+ int state;
+ Waste() : state(10) {}
+ void test(int a) {
+ printf("%d\n", a + state);
+ }
+ ~Waste() {
+ printf("going away %d\n", x);
+ }
+};
+
+Waste<3> *getMore();
+
+''')
+ open('main.cpp', 'w').write(r'''
+#include "inc.h"
+
+Waste<1> mw1;
+Waste<2> mw2;
+
+int main(int argc, char **argv) {
+ printf("argc: %d\n", argc);
+ mw1.state += argc;
+ mw2.state += argc;
+ mw1.test(5);
+ mw2.test(6);
+ getMore()->test(0);
+ return 0;
+}
+''')
+
+ open('side.cpp', 'w').write(r'''
+#include "inc.h"
+
+Waste<3> sw3;
+
+Waste<3> *getMore() {
+ return &sw3;
+}
+''')
+
+ for opts, has_global in [
+ (['-O2', '-g'], True),
+ (['-O2', '-g', '-s', 'NO_EXIT_RUNTIME=1'], False), # no-exit-runtime removes the atexits, and then globalgce can work it's magic to remove the global initializer entirely
+ (['-Os', '-g'], True),
+ (['-Os', '-g', '-s', 'NO_EXIT_RUNTIME=1'], False),
+ (['-O2', '-g', '--llvm-lto', '1'], True),
+ (['-O2', '-g', '-s', 'NO_EXIT_RUNTIME=1', '--llvm-lto', '1'], False),
+ ]:
+ print opts, has_global
+ Popen([PYTHON, EMCC, 'main.cpp', '-c'] + opts).communicate()
+ Popen([PYTHON, EMCC, 'side.cpp', '-c'] + opts).communicate()
+ Popen([PYTHON, EMCC, 'main.o', 'side.o'] + opts).communicate()
+ output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS)
+ src = open('a.out.js').read()
+ self.assertContained('argc: 1\n16\n17\n10\n', run_js('a.out.js'))
+ assert ('_GLOBAL_' in src) == has_global
+
+ def test_implicit_func(self):
+ open('src.c', 'w').write(r'''
+#include <stdio.h>
+int main()
+{
+ printf("hello %d\n", strnlen("waka", 2)); // Implicit declaration, no header, for strnlen
+ int (*my_strnlen)(char*, ...) = strnlen;
+ printf("hello %d\n", my_strnlen("shaka", 2));
+ return 0;
+}
+''')
+
+ for opts, expected, compile_expected in [
+ ([], ['abort()', 'it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this'], []),
+ (['-s', 'ASSERTIONS=2'], ['abort()', 'This pointer might make sense in another type signature'], []),
+ (['-O1'], ['hello 2\nhello 5\n'], []), # invalid output - second arg is sent as varargs, but needs to be int. llvm optimizer avoided the crash silently, caused undefined behavior... at least people can debug this by running an -O0 build.
+ ]:
+ print opts, expected
+ stdout, stderr = Popen([PYTHON, EMCC, 'src.c'] + opts, stderr=PIPE).communicate()
+ output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True)
+ for e in expected:
+ self.assertContained(e, output)
+ for ce in compile_expected + ['''warning: implicit declaration of function 'strnlen' is invalid in C99''', '''warning: incompatible pointer types''']:
+ self.assertContained(ce, stderr)
+
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index e8b1f885..3d3da523 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -3,7 +3,7 @@ from runner import RunnerCore, path_from_root
from tools.shared import *
SANITY_FILE = CONFIG_FILE + '_sanity'
-commands = [[EMCC], [PYTHON, path_from_root('tests', 'runner.py'), 'blahblah']]
+commands = [[PYTHON, EMCC], [PYTHON, path_from_root('tests', 'runner.py'), 'blahblah']]
def restore():
shutil.copyfile(CONFIG_FILE + '_backup', CONFIG_FILE)
@@ -15,6 +15,8 @@ def wipe():
def mtime(filename):
return os.stat(filename).st_mtime
+SANITY_MESSAGE = 'Emscripten: Running sanity checks'
+
class sanity(RunnerCore):
@classmethod
def setUpClass(self):
@@ -51,7 +53,7 @@ class sanity(RunnerCore):
if type(command) is not list:
command = [command]
if expected is None:
- if command[0] == EMCC:
+ if command[0] == EMCC or (len(command) >= 2 and command[1] == EMCC):
expected = 'no input files'
else:
expected = "No tests found for ['blahblah']"
@@ -196,9 +198,10 @@ class sanity(RunnerCore):
del os.environ['EM_IGNORE_SANITY']
def test_llvm_fastcomp(self):
- if os.environ.get('EMCC_FAST_COMPILER') != '1': return self.skip('not using fastcomp')
+ assert os.environ.get('EMCC_FAST_COMPILER') != '0', 'must be using fastcomp to test fastcomp'
WARNING = 'fastcomp in use, but LLVM has not been built with the JavaScript backend as a target'
+ WARNING2 = 'you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend'
restore()
@@ -206,22 +209,64 @@ class sanity(RunnerCore):
assert check_fastcomp()
output = self.check_working(EMCC)
assert WARNING not in output, output
+ assert WARNING2 not in output, output
# Fake incorrect llc output, no mention of js backend
restore()
f = open(CONFIG_FILE, 'a')
- f.write('LLVM_ROOT = "' + path_from_root('tests', 'fake') + '"')
+ f.write('LLVM_ROOT = "' + path_from_root('tests', 'fake', 'bin') + '"')
f.close()
+ #print '1', open(CONFIG_FILE).read()
- if not os.path.exists(path_from_root('tests', 'fake')):
- os.makedirs(path_from_root('tests', 'fake'))
+ try_delete(path_from_root('tests', 'fake'))
+ os.makedirs(path_from_root('tests', 'fake', 'bin'))
- f = open(path_from_root('tests', 'fake', 'llc'), 'w')
+ f = open(path_from_root('tests', 'fake', 'bin', 'llc'), 'w')
f.write('#!/bin/sh\n')
f.write('echo "llc fake output\nRegistered Targets:\nno j-s backend for you!"')
f.close()
- os.chmod(path_from_root('tests', 'fake', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
+ os.chmod(path_from_root('tests', 'fake', 'bin', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
output = self.check_working(EMCC, WARNING)
+ output = self.check_working(EMCC, WARNING2)
+
+ # fake some more
+ for fake in ['llvm-link', 'clang', 'clang++', 'llvm-ar', 'opt', 'llvm-as', 'llvm-dis', 'llvm-nm', 'lli']:
+ open(path_from_root('tests', 'fake', 'bin', fake), 'w').write('.')
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC, WARNING)
+ # make sure sanity checks notice there is no source dir with version #
+ open(path_from_root('tests', 'fake', 'bin', 'llc'), 'w').write('#!/bin/sh\necho "Registered Targets: there IZ a js backend: JavaScript (asm.js, emscripten) backend"')
+ open(path_from_root('tests', 'fake', 'bin', 'clang++'), 'w').write('#!/bin/sh\necho "clang version %s (blah blah)" >&2\necho "..." >&2\n' % '.'.join(map(str, EXPECTED_LLVM_VERSION)))
+ os.chmod(path_from_root('tests', 'fake', 'bin', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
+ os.chmod(path_from_root('tests', 'fake', 'bin', 'clang++'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC, 'did not see a source tree above LLVM_DIR, could not verify version numbers match')
+
+ VERSION_WARNING = 'Emscripten, llvm and clang versions do not match, this is dangerous'
+
+ # add version number
+ open(path_from_root('tests', 'fake', 'emscripten-version.txt'), 'w').write('waka')
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC, VERSION_WARNING)
+
+ os.makedirs(path_from_root('tests', 'fake', 'tools', 'clang'))
+
+ open(path_from_root('tests', 'fake', 'tools', 'clang', 'emscripten-version.txt'), 'w').write(EMSCRIPTEN_VERSION)
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC, VERSION_WARNING)
+
+ open(path_from_root('tests', 'fake', 'emscripten-version.txt'), 'w').write(EMSCRIPTEN_VERSION)
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC)
+ assert VERSION_WARNING not in output
+
+ open(path_from_root('tests', 'fake', 'tools', 'clang', 'emscripten-version.txt'), 'w').write('waka')
+ try_delete(SANITY_FILE)
+ output = self.check_working(EMCC, VERSION_WARNING)
+
+ restore()
+
+ self.check_working([EMCC, 'tests/hello_world.cpp', '-s', 'INIT_HEAP=1'], '''Compiler settings are incompatible with fastcomp. You can fall back to the older compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend''')
def test_node(self):
NODE_WARNING = 'node version appears too old'
@@ -272,7 +317,6 @@ fi
del os.environ['EM_IGNORE_SANITY']
def test_emcc(self):
- SANITY_MESSAGE = 'Emscripten: Running sanity checks'
SANITY_FAIL_MESSAGE = 'sanity check failed to run'
# emcc should check sanity if no ${EM_CONFIG}_sanity
@@ -311,6 +355,10 @@ fi
output = self.check_working(EMCC)
self.assertNotContained(SANITY_MESSAGE, output)
+ # also with -v, with or without inputs
+ output = self.check_working([EMCC, '-v'], SANITY_MESSAGE)
+ output = self.check_working([EMCC, '-v', path_from_root('tests', 'hello_world.c')], SANITY_MESSAGE)
+
# Make sure the test runner didn't do anything to the setup
output = self.check_working(EMCC)
self.assertNotContained(SANITY_MESSAGE, output)
@@ -414,21 +462,22 @@ fi
except:
pass
assert ll
- assert ll.count('\n!') < 10 # a few lines are left even in -O1 and -O2
+ assert ll.count('\n!') < 25 # a few lines are left even in -O1 and -O2
finally:
del os.environ['EMCC_DEBUG']
restore()
def ensure_cache():
- self.do([EMCC, '-O2', path_from_root('tests', 'hello_world.c')])
+ self.do([PYTHON, EMCC, '-O2', path_from_root('tests', 'hello_world.c')])
# Manual cache clearing
ensure_cache()
assert os.path.exists(EMCC_CACHE)
- output = self.do([EMCC, '--clear-cache'])
+ output = self.do([PYTHON, EMCC, '--clear-cache'])
assert ERASING_MESSAGE in output
assert not os.path.exists(EMCC_CACHE)
+ assert SANITY_MESSAGE in output
# Changing LLVM_ROOT, even without altering .emscripten, clears the cache
ensure_cache()
@@ -436,7 +485,7 @@ fi
try:
os.environ['LLVM'] = 'waka'
assert os.path.exists(EMCC_CACHE)
- output = self.do([EMCC])
+ output = self.do([PYTHON, EMCC])
assert ERASING_MESSAGE in output
assert not os.path.exists(EMCC_CACHE)
finally:
@@ -446,111 +495,34 @@ fi
try_delete(CANONICAL_TEMP_DIR)
def test_relooper(self):
- RELOOPER = Cache.get_path('relooper.js')
-
- restore()
- for phase in range(2): # 0: we wipe the relooper dir. 1: we have it, so should just update
- if phase == 0: Cache.erase()
- try_delete(RELOOPER)
-
- for i in range(4):
- print >> sys.stderr, phase, i
- opt = min(i, 2)
- try_delete('a.out.js')
- output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_loop.cpp'), '-O' + str(opt), '-g'],
- stdout=PIPE, stderr=PIPE).communicate()
- self.assertContained('hello, world!', run_js('a.out.js'))
- output = '\n'.join(output)
- assert ('bootstrapping relooper succeeded' in output) == (i == 1), 'only bootstrap on first O2: ' + output
- assert os.path.exists(RELOOPER) == (i >= 1), 'have relooper on O2: ' + output
- src = open('a.out.js').read()
- main = src.split('function _main()')[1].split('\n}\n')[0]
- assert ('while (1) {' in main or 'while(1){' in main or 'while(1) {' in main or '} while ($' in main or '}while($' in main) == (i >= 1), 'reloop code on O2: ' + main
- assert ('switch' not in main) == (i >= 1), 'reloop code on O2: ' + main
-
- def test_jcache(self):
- PRE_LOAD_MSG = 'loading pre from jcache'
- PRE_SAVE_MSG = 'saving pre to jcache'
- FUNC_CHUNKS_LOAD_MSG = ' funcchunks from jcache'
- FUNC_CHUNKS_SAVE_MSG = ' funcchunks to jcache'
- JSFUNC_CHUNKS_LOAD_MSG = 'jsfuncchunks from jcache'
- JSFUNC_CHUNKS_SAVE_MSG = 'jsfuncchunks to jcache'
-
- restore()
- Cache.erase()
+ assert os.environ.get('EMCC_FAST_COMPILER') is None
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)
-
- assert not os.path.exists(JCache.get_cachename('emscript_files'))
-
- srcs = {}
- used_jcache = False
-
- for args, input_file, expect_pre_save, expect_pre_load, expect_funcs_save, expect_funcs_load, expect_jsfuncs_save, expect_jsfuncs_load, expected in [
- ([], 'hello_world_loop.cpp', False, False, False, False, False, False, []),
- (['--jcache'], 'hello_world_loop.cpp', True, False, True, False, True, False, []),
- (['--jcache'], 'hello_world_loop.cpp', False, True, False, True, False, True, []),
- ([], 'hello_world_loop.cpp', False, False, False, False, False, False, []),
- # new
- ([], 'hello_world.cpp', False, False, False, False, False, False, []),
- (['--jcache'], 'hello_world.cpp', True, False, True, False, True, False, []),
- (['--jcache'], 'hello_world.cpp', False, True, False, True, False, True, []),
- ([], 'hello_world.cpp', False, False, False, False, False, False, []),
- # go back to old file, experience caching
- (['--jcache'], 'hello_world_loop.cpp', False, True, False, True, False, True, []),
- # new, large file
- ([], 'hello_malloc.cpp', False, False, False, False, False, False, []),
- (['--jcache'], 'hello_malloc.cpp', True, False, True, False, True, False, []),
- (['--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, ('4 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, []),
- # finally, build a file close to the previous, to see that some chunks are found in the cache and some not
- (['--jcache'], 'hello_libcxx_mod1.cpp', False, True, True, True, True, True, []), # win on pre, mix on funcs, mix on jsfuncs
- (['--jcache'], 'hello_libcxx_mod1.cpp', False, True, False, True, False, True, []),
- (None, None, None, None, None, None, None, None, None), # clear
- (['--jcache'], 'hello_libcxx_mod2.cpp', True, False, True, False, True, False, []), # load into cache
- (['--jcache'], 'hello_libcxx_mod2a.cpp', False, True, True, True, True, True, []) # add a printf, do not lose everything
- ]:
- self.clear()
- if args is None:
- Cache.erase()
- continue
-
- print >> sys.stderr, args, input_file, expect_pre_save, expect_pre_load, expect_funcs_save, expect_funcs_load, expect_jsfuncs_save, expect_jsfuncs_load, expected
-
- out, err = Popen([PYTHON, EMCC, '-O2', '-g', path_from_root('tests', input_file)] + args, stdout=PIPE, stderr=PIPE).communicate()
- errtail = err.split('emcc invocation')[-1]
- self.assertContained('hello, world!', run_js('a.out.js'), errtail)
- assert (PRE_SAVE_MSG in err) == expect_pre_save, errtail
- assert (PRE_LOAD_MSG in err) == expect_pre_load, errtail
- assert (FUNC_CHUNKS_SAVE_MSG in err) == expect_funcs_save, errtail
- assert (FUNC_CHUNKS_LOAD_MSG in err) == expect_funcs_load, errtail
- assert (JSFUNC_CHUNKS_SAVE_MSG in err) == expect_jsfuncs_save, errtail
- assert (JSFUNC_CHUNKS_LOAD_MSG in err) == expect_jsfuncs_load, errtail
- for expect in expected: assert expect in err, expect + ' ? ' + errtail
- curr = open('a.out.js').read()
- 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)
- 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'))
- #print >> sys.stderr, errtail
+ os.environ['EMCC_FAST_COMPILER'] = '0'
+ RELOOPER = Cache.get_path('relooper.js')
+
+ restore()
+ for phase in range(2): # 0: we wipe the relooper dir. 1: we have it, so should just update
+ if phase == 0: Cache.erase()
+ try_delete(RELOOPER)
+
+ for i in range(4):
+ print >> sys.stderr, phase, i
+ opt = min(i, 2)
+ try_delete('a.out.js')
+ output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_loop.cpp'), '-O' + str(opt), '-g'],
+ stdout=PIPE, stderr=PIPE).communicate()
+ self.assertContained('hello, world!', run_js('a.out.js'))
+ output = '\n'.join(output)
+ assert ('bootstrapping relooper succeeded' in output) == (i == 1), 'only bootstrap on first O2: ' + output
+ assert os.path.exists(RELOOPER) == (i >= 1), 'have relooper on O2: ' + output
+ src = open('a.out.js').read()
+ main = src.split('function _main()')[1].split('\n}\n')[0]
+ assert ('while (1) {' in main or 'while(1){' in main or 'while(1) {' in main or '} while ($' in main or '}while($' in main) == (i >= 1), 'reloop code on O2: ' + main
+ assert ('switch' not in main) == (i >= 1), 'reloop code on O2: ' + main
finally:
- del os.environ['EMCC_DEBUG']
- del os.environ['EMCC_JSOPT_MIN_CHUNK_SIZE']
+ del os.environ['EMCC_FAST_COMPILER']
def test_nostdincxx(self):
restore()
@@ -559,7 +531,7 @@ fi
try:
old = os.environ.get('EMCC_LLVM_TARGET') or ''
for compiler in [EMCC, EMXX]:
- for target in ['i386-pc-linux-gnu', 'le32-unknown-nacl']:
+ for target in ['i386-pc-linux-gnu', 'asmjs-unknown-emscripten']:
print compiler, target
os.environ['EMCC_LLVM_TARGET'] = target
out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp'), '-v'], stdout=PIPE, stderr=PIPE).communicate()
@@ -594,7 +566,7 @@ fi
temp_dir = tempfile.mkdtemp(prefix='emscripten_temp_')
os.chdir(temp_dir)
- self.do([EMCC, '-O2', '--em-config', custom_config_filename, path_from_root('tests', 'hello_world.c')])
+ self.do([PYTHON, EMCC, '-O2', '--em-config', custom_config_filename, path_from_root('tests', 'hello_world.c')])
result = run_js('a.out.js')
# Clean up created temp files.
diff --git a/tests/test_sockets.py b/tests/test_sockets.py
index f9dcbc68..3a5555ed 100644
--- a/tests/test_sockets.py
+++ b/tests/test_sockets.py
@@ -220,6 +220,7 @@ class sockets(BrowserCore):
)
def test_getaddrinfo(self):
+ self.emcc_args=[]
self.do_run(open(path_from_root('tests', 'sockets', 'test_getaddrinfo.c')).read(), 'success')
def test_getnameinfo(self):
diff --git a/tests/tex_nonbyte.c b/tests/tex_nonbyte.c
index 960d0efb..ffeb9f24 100644
--- a/tests/tex_nonbyte.c
+++ b/tests/tex_nonbyte.c
@@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR
REDISTRIBUTION OF THIS SOFTWARE.
*/
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
#define USE_GLEW 1
#endif
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
glClearColor( 0, 0, 0, 0 );
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL
#endif
@@ -192,7 +192,7 @@ int main(int argc, char *argv[])
SDL_GL_SwapBuffers();
-#if !EMSCRIPTEN
+#ifndef __EMSCRIPTEN__
// Wait for 3 seconds to give us a chance to see the image
SDL_Delay(3000);
#endif
diff --git a/tests/unistd/unlink.c b/tests/unistd/unlink.c
index 9f532325..a15baab8 100644
--- a/tests/unistd/unlink.c
+++ b/tests/unistd/unlink.c
@@ -7,7 +7,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
@@ -23,7 +23,7 @@ static void create_file(const char *path, const char *buffer, int mode) {
void setup() {
mkdir("working", 0777);
-#if EMSCRIPTEN
+#ifdef __EMSCRIPTEN__
EM_ASM(
#if NODEFS
FS.mount(NODEFS, { root: '.' }, 'working');
diff --git a/tests/utf32.cpp b/tests/utf32.cpp
index 6b75b244..d00338a6 100644
--- a/tests/utf32.cpp
+++ b/tests/utf32.cpp
@@ -16,11 +16,11 @@ int main() {
if (sizeof(wchar_t) == 4) {
utf32 *memory = new utf32[wstr.length()+1];
- asm("var str = Module.UTF32ToString(%0);"
- "Module.print(str);"
- "Module.stringToUTF32(str, %1);"
- :
- : "r"(wstr.c_str()), "r"(memory));
+ EM_ASM_INT({
+ var str = Module.UTF32ToString($0);
+ Module.print(str);
+ Module.stringToUTF32(str, $1);
+ }, wstr.c_str(), memory);
// Compare memory to confirm that the string is intact after taking a route through JS side.
const utf32 *srcPtr = reinterpret_cast<const utf32 *>(wstr.c_str());
@@ -33,11 +33,11 @@ int main() {
} else { // sizeof(wchar_t) == 2, and we're building with -fshort-wchar.
utf16 *memory = new utf16[2*wstr.length()+1];
- asm("var str = Module.UTF16ToString(%0);"
- "Module.print(str);"
- "Module.stringToUTF16(str, %1);"
- :
- : "r"(wstr.c_str()), "r"(memory));
+ EM_ASM_INT({
+ var str = Module.UTF16ToString($0);
+ Module.print(str);
+ Module.stringToUTF16(str, $1);
+ }, wstr.c_str(), memory);
// Compare memory to confirm that the string is intact after taking a route through JS side.
const utf16 *srcPtr = reinterpret_cast<const utf16 *>(wstr.c_str());
diff --git a/tests/uuid/test.c b/tests/uuid/test.c
index dc2c6589..f5f84011 100644
--- a/tests/uuid/test.c
+++ b/tests/uuid/test.c
@@ -59,7 +59,7 @@ int main() {
// The following lets the browser test exit cleanly.
int result = 1;
- #if EMSCRIPTEN
+ #if defined(__EMSCRIPTEN__)
#ifdef REPORT_RESULT
REPORT_RESULT();
#endif
diff --git a/tools/asm_module.py b/tools/asm_module.py
index f383eba6..a1aecdda 100644
--- a/tools/asm_module.py
+++ b/tools/asm_module.py
@@ -107,6 +107,9 @@ class AsmModule():
all_imports[key] = value
if (value_concrete or main_value_concrete) and key in all_sendings:
del all_sendings[key] # import of external value no longer needed
+ for key in all_imports.keys():
+ if key in self.funcs:
+ del all_imports[key] # import in main, provided in side
main.imports_js = '\n'.join(['var %s = %s;' % (key, value) for key, value in all_imports.iteritems()]) + '\n'
# check for undefined references to global variables
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js
index a344fc35..7a8baef2 100644
--- a/tools/eliminator/asm-eliminator-test-output.js
+++ b/tools/eliminator/asm-eliminator-test-output.js
@@ -304,4 +304,510 @@ function binary(x) {
memset(f(x)) | 0;
+dmemset(f(x));
}
+function cute($this, $outImage) {
+ $this = $this | 0;
+ $outImage = $outImage | 0;
+ var $retval = 0, $outImage_addr = 0, $width = 0, $height = 0, $bit_depth = 0, $color_type = 0, $data = 0, $bpl = 0, $y = 0, $i = 0, $y76 = 0, $p = 0, $end = 0, $this1 = 0, $call = 0, $call7 = 0, $call8 = 0, $3 = 0, $call17 = 0, $10 = 0, $call32 = 0, $call33 = 0, $17$0 = 0, $call34 = 0, $add_ptr = 0, $32 = 0, $call42 = 0, $35 = 0, $call45 = 0, $41 = 0, $call51 = 0, $43 = 0, $call55 = 0, $call57 = 0, $49 = 0, $call72 = 0, $call75 = 0, label = 0, setjmpLabel = 0, setjmpTable = 0, sp = 0;
+ sp = STACKTOP;
+ STACKTOP = STACKTOP + 32 | 0;
+ label = 1;
+ setjmpLabel = 0;
+ setjmpTable = STACKTOP;
+ STACKTOP = STACKTOP + 168 | 0;
+ HEAP32[setjmpTable >> 2] = 0;
+ while (1) switch (label | 0) {
+ case 1:
+ $width = sp | 0;
+ $height = sp + 8 | 0;
+ $bit_depth = sp + 16 | 0;
+ $color_type = sp + 24 | 0;
+ $outImage_addr = $outImage;
+ $this1 = $this;
+ if ((HEAP32[($this1 + 32 | 0) >> 2] | 0 | 0) == 3) {
+ label = 2;
+ break;
+ } else {
+ label = 3;
+ break;
+ }
+ case 2:
+ $retval = 0;
+ label = 37;
+ break;
+ case 3:
+ if ((HEAP32[($this1 + 32 | 0) >> 2] | 0 | 0) == 0) {
+ label = 4;
+ break;
+ } else {
+ label = 6;
+ break;
+ }
+ case 4:
+ $call = invoke_ii(900, $this1 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if ($call) {
+ label = 6;
+ break;
+ } else {
+ label = 5;
+ break;
+ }
+ case 5:
+ HEAP32[($this1 + 32 | 0) >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 6:
+ HEAP32[($this1 + 28 | 0) >> 2] = 0;
+ $call7 = invoke_iiii(30, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, 2638 | 0, 156 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $call8 = _saveSetjmp($call7 | 0 | 0, label, setjmpTable) | 0;
+ label = 38;
+ break;
+ case 38:
+ if (($call8 | 0) != 0) {
+ label = 7;
+ break;
+ } else {
+ label = 10;
+ break;
+ }
+ case 7:
+ invoke_viii(640, $this1 + 16 | 0 | 0, $this1 + 20 | 0 | 0, $this1 + 24 | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $3 = HEAP32[($this1 + 28 | 0) >> 2] | 0;
+ if (($3 | 0) == 0) {
+ label = 9;
+ break;
+ } else {
+ label = 8;
+ break;
+ }
+ case 8:
+ invoke_vi(926, $3 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 9;
+ break;
+ case 9:
+ HEAP32[($this1 + 16 | 0) >> 2] = 0;
+ HEAP32[($this1 + 32 | 0) >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 10:
+ invoke_viiif(2, $outImage_addr | 0, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 20 | 0) >> 2] | 0 | 0, +(+HEAPF32[($this1 | 0) >> 2]));
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $call17 = invoke_ii(832, $outImage_addr | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if ($call17) {
+ label = 11;
+ break;
+ } else {
+ label = 14;
+ break;
+ }
+ case 11:
+ invoke_viii(640, $this1 + 16 | 0 | 0, $this1 + 20 | 0 | 0, $this1 + 24 | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $10 = HEAP32[($this1 + 28 | 0) >> 2] | 0;
+ if (($10 | 0) == 0) {
+ label = 13;
+ break;
+ } else {
+ label = 12;
+ break;
+ }
+ case 12:
+ invoke_vi(926, $10 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 13;
+ break;
+ case 13:
+ HEAP32[($this1 + 16 | 0) >> 2] = 0;
+ HEAP32[($this1 + 32 | 0) >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 14:
+ invoke_iiiiiiiiii(2, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 20 | 0) >> 2] | 0 | 0, $width | 0, $height | 0, $bit_depth | 0, $color_type | 0, 0 | 0, 0 | 0, 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $call32 = invoke_ii(850, $outImage_addr | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $data = $call32;
+ $call33 = invoke_ii(284, $outImage_addr | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $bpl = $call33;
+ $17$0 = invoke_iii(860, HEAP32[$height >> 2] | 0 | 0, 4 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $call34 = invoke_ii(550, (tempRet0 ? -1 : $17$0) | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ HEAP32[($this1 + 28 | 0) >> 2] = $call34;
+ $y = 0;
+ label = 15;
+ break;
+ case 15:
+ if ($y >>> 0 < (HEAP32[$height >> 2] | 0) >>> 0) {
+ label = 16;
+ break;
+ } else {
+ label = 18;
+ break;
+ }
+ case 16:
+ $add_ptr = $data + (Math_imul($y, $bpl) | 0) | 0;
+ HEAP32[((HEAP32[($this1 + 28 | 0) >> 2] | 0) + ($y << 2) | 0) >> 2] = $add_ptr;
+ label = 17;
+ break;
+ case 17:
+ $y = $y + 1 | 0;
+ label = 15;
+ break;
+ case 18:
+ invoke_vii(858, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 28 | 0) >> 2] | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $32 = $outImage_addr;
+ $call42 = invoke_iii(690, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 20 | 0) >> 2] | 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_vii(1890, $32 | 0, $call42 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $35 = $outImage_addr;
+ $call45 = invoke_iii(256, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 20 | 0) >> 2] | 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_vii(2126, $35 | 0, $call45 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ HEAP32[($this1 + 32 | 0) >> 2] = 2;
+ invoke_vii(36, HEAP32[($this1 + 16 | 0) >> 2] | 0 | 0, HEAP32[($this1 + 24 | 0) >> 2] | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_vii(2752, $this1 | 0, HEAP32[($this1 + 24 | 0) >> 2] | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $i = 0;
+ label = 19;
+ break;
+ case 19:
+ $41 = $i;
+ $call51 = invoke_ii(618, $this1 + 12 | 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if (($41 | 0) < ($call51 - 1 | 0 | 0)) {
+ label = 20;
+ break;
+ } else {
+ label = 22;
+ break;
+ }
+ case 20:
+ $43 = $outImage_addr;
+ $call55 = invoke_iii(502, $this1 + 12 | 0 | 0, $i | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $call57 = invoke_iii(502, $this1 + 12 | 0 | 0, $i + 1 | 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_viii(550, $43 | 0, $call55 | 0, $call57 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 21;
+ break;
+ case 21:
+ $i = $i + 2 | 0;
+ label = 19;
+ break;
+ case 22:
+ invoke_viii(640, $this1 + 16 | 0 | 0, $this1 + 20 | 0 | 0, $this1 + 24 | 0 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $49 = HEAP32[($this1 + 28 | 0) >> 2] | 0;
+ if (($49 | 0) == 0) {
+ label = 24;
+ break;
+ } else {
+ label = 23;
+ break;
+ }
+ case 23:
+ invoke_vi(926, $49 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 24;
+ break;
+ case 24:
+ HEAP32[($this1 + 16 | 0) >> 2] = 0;
+ HEAP32[($this1 + 32 | 0) >> 2] = 0;
+ if ((HEAP32[$color_type >> 2] | 0 | 0) == 3) {
+ label = 25;
+ break;
+ } else {
+ label = 36;
+ break;
+ }
+ case 25:
+ $call72 = invoke_ii(926, $outImage_addr | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if (($call72 | 0) == 3) {
+ label = 26;
+ break;
+ } else {
+ label = 36;
+ break;
+ }
+ case 26:
+ $call75 = invoke_ii(860, $outImage_addr | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $y76 = 0;
+ label = 27;
+ break;
+ case 27:
+ if (($y76 | 0) < (HEAP32[$height >> 2] | 0 | 0)) {
+ label = 28;
+ break;
+ } else {
+ label = 35;
+ break;
+ }
+ case 28:
+ $p = $data + (Math_imul($y76, $bpl) | 0) | 0;
+ $end = $p + (HEAP32[$width >> 2] | 0) | 0;
+ label = 29;
+ break;
+ case 29:
+ if ($p >>> 0 < $end >>> 0) {
+ label = 30;
+ break;
+ } else {
+ label = 33;
+ break;
+ }
+ case 30:
+ if (((HEAP8[$p] | 0) & 255 | 0) >= ($call75 | 0)) {
+ label = 31;
+ break;
+ } else {
+ label = 32;
+ break;
+ }
+ case 31:
+ HEAP8[$p] = 0;
+ label = 32;
+ break;
+ case 32:
+ $p = $p + 1 | 0;
+ label = 29;
+ break;
+ case 33:
+ label = 34;
+ break;
+ case 34:
+ $y76 = $y76 + 1 | 0;
+ label = 27;
+ break;
+ case 35:
+ label = 36;
+ break;
+ case 36:
+ $retval = 1;
+ label = 37;
+ break;
+ case 37:
+ STACKTOP = sp;
+ return $retval | 0;
+ case -1:
+ if ((setjmpLabel | 0) == 6) {
+ $call8 = threwValue;
+ label = 38;
+ }
+ __THREW__ = threwValue = 0;
+ break;
+ }
+ return 0;
+}
diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js
index 4b45e4d4..ad1ed05e 100644
--- a/tools/eliminator/asm-eliminator-test.js
+++ b/tools/eliminator/asm-eliminator-test.js
@@ -378,5 +378,654 @@ function binary(x) {
z = f(x);
+dmemset(z);
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble", "_org_apache_harmony_luni_util_NumberConverter_freeFormat__", "__ZN23b2EdgeAndPolygonContact8EvaluateEP10b2ManifoldRK11b2TransformS4_", "_java_nio_charset_Charset_forNameInternal___java_lang_String", "looop2", "looop3", "looop4", "looop5", "looop6", "looop7", "looop8", "multiloop", "multiloop2", "tempDouble2", "watIf", "select2", "binary"]
+function cute($this, $outImage) {
+ $this = $this | 0;
+ $outImage = $outImage | 0;
+ var $retval = 0, $this_addr = 0, $outImage_addr = 0, $width = 0, $height = 0, $bit_depth = 0, $color_type = 0, $data = 0, $bpl = 0, $y = 0, $i = 0, $color_table_size = 0, $y76 = 0, $p = 0, $end = 0, $this1 = 0, $state = 0, $0 = 0, $cmp = 0, $state2 = 0;
+ var $1 = 0, $cmp3 = 0, $call = 0, $state5 = 0, $row_pointers = 0, $png_ptr = 0, $2 = 0, $call7 = 0, $arraydecay = 0, $call8 = 0, $tobool = 0, $png_ptr10 = 0, $info_ptr = 0, $end_info = 0, $row_pointers11 = 0, $3 = 0, $isnull = 0, $4 = 0, $png_ptr12 = 0, $state13 = 0;
+ var $5 = 0, $png_ptr15 = 0, $6 = 0, $info_ptr16 = 0, $7 = 0, $gamma = 0, $8 = +0, $9 = 0, $call17 = 0, $png_ptr19 = 0, $info_ptr20 = 0, $end_info21 = 0, $row_pointers22 = 0, $10 = 0, $isnull23 = 0, $11 = 0, $png_ptr26 = 0, $state27 = 0, $png_ptr29 = 0, $12 = 0;
+ var $info_ptr30 = 0, $13 = 0, $call31 = 0, $14 = 0, $call32 = 0, $15 = 0, $call33 = 0, $16 = 0, $17$0 = 0, $17$1 = 0, $18 = 0, $19 = 0, $20 = 0, $call34 = 0, $21 = 0, $row_pointers35 = 0, $22 = 0, $23 = 0, $cmp36 = 0, $24 = 0;
+ var $25 = 0, $26 = 0, $mul = 0, $add_ptr = 0, $27 = 0, $row_pointers37 = 0, $28 = 0, $arrayidx = 0, $29 = 0, $inc = 0, $png_ptr38 = 0, $30 = 0, $row_pointers39 = 0, $31 = 0, $32 = 0, $png_ptr40 = 0, $33 = 0, $info_ptr41 = 0, $34 = 0, $call42 = 0;
+ var $35 = 0, $png_ptr43 = 0, $36 = 0, $info_ptr44 = 0, $37 = 0, $call45 = 0, $state46 = 0, $png_ptr47 = 0, $38 = 0, $end_info48 = 0, $39 = 0, $end_info49 = 0, $40 = 0, $41 = 0, $readTexts = 0, $42 = 0, $call51 = 0, $sub = 0, $cmp52 = 0, $43 = 0;
+ var $readTexts54 = 0, $44 = 0, $45 = 0, $call55 = 0, $readTexts56 = 0, $46 = 0, $47 = 0, $add = 0, $call57 = 0, $48 = 0, $add59 = 0, $png_ptr61 = 0, $info_ptr62 = 0, $end_info63 = 0, $row_pointers64 = 0, $49 = 0, $isnull65 = 0, $50 = 0, $png_ptr68 = 0, $state69 = 0;
+ var $51 = 0, $cmp70 = 0, $52 = 0, $call72 = 0, $cmp73 = 0, $53 = 0, $call75 = 0, $54 = 0, $55 = 0, $cmp78 = 0, $56 = 0, $57 = 0, $58 = 0, $mul80 = 0, $add_ptr81 = 0, $59 = 0, $60 = 0, $add_ptr82 = 0, $61 = 0, $62 = 0;
+ var $cmp83 = 0, $63 = 0, $64 = 0, $conv = 0, $65 = 0, $cmp84 = 0, $66 = 0, $67 = 0, $incdec_ptr = 0, $68 = 0, $inc88 = 0, $69 = 0, label = 0, setjmpLabel = 0, setjmpTable = 0;
+ var sp = 0;
+ sp = STACKTOP;
+ STACKTOP = STACKTOP + 32 | 0;
+ label = 1;
+ setjmpLabel = 0;
+ setjmpTable = STACKTOP;
+ STACKTOP = STACKTOP + 168 | 0;
+ HEAP32[setjmpTable >> 2] = 0;
+ while (1) switch (label | 0) {
+ case 1:
+ $width = sp | 0;
+ $height = sp + 8 | 0;
+ $bit_depth = sp + 16 | 0;
+ $color_type = sp + 24 | 0;
+ $this_addr = $this;
+ $outImage_addr = $outImage;
+ $this1 = $this_addr;
+ $state = $this1 + 32 | 0;
+ $0 = HEAP32[$state >> 2] | 0;
+ $cmp = ($0 | 0) == 3;
+ if ($cmp) {
+ label = 2;
+ break;
+ } else {
+ label = 3;
+ break;
+ }
+ case 2:
+ $retval = 0;
+ label = 37;
+ break;
+ case 3:
+ $state2 = $this1 + 32 | 0;
+ $1 = HEAP32[$state2 >> 2] | 0;
+ $cmp3 = ($1 | 0) == 0;
+ if ($cmp3) {
+ label = 4;
+ break;
+ } else {
+ label = 6;
+ break;
+ }
+ case 4:
+ $call = invoke_ii(900, $this1 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if ($call) {
+ label = 6;
+ break;
+ } else {
+ label = 5;
+ break;
+ }
+ case 5:
+ $state5 = $this1 + 32 | 0;
+ HEAP32[$state5 >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 6:
+ $row_pointers = $this1 + 28 | 0;
+ HEAP32[$row_pointers >> 2] = 0;
+ $png_ptr = $this1 + 16 | 0;
+ $2 = HEAP32[$png_ptr >> 2] | 0;
+ $call7 = invoke_iiii(30, $2 | 0, 2638 | 0, 156 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $arraydecay = $call7 | 0;
+ $call8 = _saveSetjmp($arraydecay | 0, label, setjmpTable) | 0;
+ label = 38;
+ break;
+ case 38:
+ $tobool = ($call8 | 0) != 0;
+ if ($tobool) {
+ label = 7;
+ break;
+ } else {
+ label = 10;
+ break;
+ }
+ case 7:
+ $png_ptr10 = $this1 + 16 | 0;
+ $info_ptr = $this1 + 20 | 0;
+ $end_info = $this1 + 24 | 0;
+ invoke_viii(640, $png_ptr10 | 0, $info_ptr | 0, $end_info | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $row_pointers11 = $this1 + 28 | 0;
+ $3 = HEAP32[$row_pointers11 >> 2] | 0;
+ $isnull = ($3 | 0) == 0;
+ if ($isnull) {
+ label = 9;
+ break;
+ } else {
+ label = 8;
+ break;
+ }
+ case 8:
+ $4 = $3;
+ invoke_vi(926, $4 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 9;
+ break;
+ case 9:
+ $png_ptr12 = $this1 + 16 | 0;
+ HEAP32[$png_ptr12 >> 2] = 0;
+ $state13 = $this1 + 32 | 0;
+ HEAP32[$state13 >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 10:
+ $5 = $outImage_addr;
+ $png_ptr15 = $this1 + 16 | 0;
+ $6 = HEAP32[$png_ptr15 >> 2] | 0;
+ $info_ptr16 = $this1 + 20 | 0;
+ $7 = HEAP32[$info_ptr16 >> 2] | 0;
+ $gamma = $this1 | 0;
+ $8 = +HEAPF32[$gamma >> 2];
+ invoke_viiif(2, $5 | 0, $6 | 0, $7 | 0, +$8);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $9 = $outImage_addr;
+ $call17 = invoke_ii(832, $9 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ if ($call17) {
+ label = 11;
+ break;
+ } else {
+ label = 14;
+ break;
+ }
+ case 11:
+ $png_ptr19 = $this1 + 16 | 0;
+ $info_ptr20 = $this1 + 20 | 0;
+ $end_info21 = $this1 + 24 | 0;
+ invoke_viii(640, $png_ptr19 | 0, $info_ptr20 | 0, $end_info21 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $row_pointers22 = $this1 + 28 | 0;
+ $10 = HEAP32[$row_pointers22 >> 2] | 0;
+ $isnull23 = ($10 | 0) == 0;
+ if ($isnull23) {
+ label = 13;
+ break;
+ } else {
+ label = 12;
+ break;
+ }
+ case 12:
+ $11 = $10;
+ invoke_vi(926, $11 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 13;
+ break;
+ case 13:
+ $png_ptr26 = $this1 + 16 | 0;
+ HEAP32[$png_ptr26 >> 2] = 0;
+ $state27 = $this1 + 32 | 0;
+ HEAP32[$state27 >> 2] = 3;
+ $retval = 0;
+ label = 37;
+ break;
+ case 14:
+ $png_ptr29 = $this1 + 16 | 0;
+ $12 = HEAP32[$png_ptr29 >> 2] | 0;
+ $info_ptr30 = $this1 + 20 | 0;
+ $13 = HEAP32[$info_ptr30 >> 2] | 0;
+ $call31 = invoke_iiiiiiiiii(2, $12 | 0, $13 | 0, $width | 0, $height | 0, $bit_depth | 0, $color_type | 0, 0 | 0, 0 | 0, 0 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $14 = $outImage_addr;
+ $call32 = invoke_ii(850, $14 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $data = $call32;
+ $15 = $outImage_addr;
+ $call33 = invoke_ii(284, $15 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $bpl = $call33;
+ $16 = HEAP32[$height >> 2] | 0;
+ $17$0 = invoke_iii(860, $16 | 0, 4 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $17$1 = tempRet0;
+ $18 = $17$1;
+ $19 = $17$0;
+ $20 = $18 ? -1 : $19;
+ $call34 = invoke_ii(550, $20 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $21 = $call34;
+ $row_pointers35 = $this1 + 28 | 0;
+ HEAP32[$row_pointers35 >> 2] = $21;
+ $y = 0;
+ label = 15;
+ break;
+ case 15:
+ $22 = $y;
+ $23 = HEAP32[$height >> 2] | 0;
+ $cmp36 = $22 >>> 0 < $23 >>> 0;
+ if ($cmp36) {
+ label = 16;
+ break;
+ } else {
+ label = 18;
+ break;
+ }
+ case 16:
+ $24 = $data;
+ $25 = $y;
+ $26 = $bpl;
+ $mul = Math_imul($25, $26) | 0;
+ $add_ptr = $24 + $mul | 0;
+ $27 = $y;
+ $row_pointers37 = $this1 + 28 | 0;
+ $28 = HEAP32[$row_pointers37 >> 2] | 0;
+ $arrayidx = $28 + ($27 << 2) | 0;
+ HEAP32[$arrayidx >> 2] = $add_ptr;
+ label = 17;
+ break;
+ case 17:
+ $29 = $y;
+ $inc = $29 + 1 | 0;
+ $y = $inc;
+ label = 15;
+ break;
+ case 18:
+ $png_ptr38 = $this1 + 16 | 0;
+ $30 = HEAP32[$png_ptr38 >> 2] | 0;
+ $row_pointers39 = $this1 + 28 | 0;
+ $31 = HEAP32[$row_pointers39 >> 2] | 0;
+ invoke_vii(858, $30 | 0, $31 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $32 = $outImage_addr;
+ $png_ptr40 = $this1 + 16 | 0;
+ $33 = HEAP32[$png_ptr40 >> 2] | 0;
+ $info_ptr41 = $this1 + 20 | 0;
+ $34 = HEAP32[$info_ptr41 >> 2] | 0;
+ $call42 = invoke_iii(690, $33 | 0, $34 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_vii(1890, $32 | 0, $call42 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $35 = $outImage_addr;
+ $png_ptr43 = $this1 + 16 | 0;
+ $36 = HEAP32[$png_ptr43 >> 2] | 0;
+ $info_ptr44 = $this1 + 20 | 0;
+ $37 = HEAP32[$info_ptr44 >> 2] | 0;
+ $call45 = invoke_iii(256, $36 | 0, $37 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_vii(2126, $35 | 0, $call45 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $state46 = $this1 + 32 | 0;
+ HEAP32[$state46 >> 2] = 2;
+ $png_ptr47 = $this1 + 16 | 0;
+ $38 = HEAP32[$png_ptr47 >> 2] | 0;
+ $end_info48 = $this1 + 24 | 0;
+ $39 = HEAP32[$end_info48 >> 2] | 0;
+ invoke_vii(36, $38 | 0, $39 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $end_info49 = $this1 + 24 | 0;
+ $40 = HEAP32[$end_info49 >> 2] | 0;
+ invoke_vii(2752, $this1 | 0, $40 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $i = 0;
+ label = 19;
+ break;
+ case 19:
+ $41 = $i;
+ $readTexts = $this1 + 12 | 0;
+ $42 = $readTexts;
+ $call51 = invoke_ii(618, $42 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $sub = $call51 - 1 | 0;
+ $cmp52 = ($41 | 0) < ($sub | 0);
+ if ($cmp52) {
+ label = 20;
+ break;
+ } else {
+ label = 22;
+ break;
+ }
+ case 20:
+ $43 = $outImage_addr;
+ $readTexts54 = $this1 + 12 | 0;
+ $44 = $readTexts54;
+ $45 = $i;
+ $call55 = invoke_iii(502, $44 | 0, $45 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $readTexts56 = $this1 + 12 | 0;
+ $46 = $readTexts56;
+ $47 = $i;
+ $add = $47 + 1 | 0;
+ $call57 = invoke_iii(502, $46 | 0, $add | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ invoke_viii(550, $43 | 0, $call55 | 0, $call57 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 21;
+ break;
+ case 21:
+ $48 = $i;
+ $add59 = $48 + 2 | 0;
+ $i = $add59;
+ label = 19;
+ break;
+ case 22:
+ $png_ptr61 = $this1 + 16 | 0;
+ $info_ptr62 = $this1 + 20 | 0;
+ $end_info63 = $this1 + 24 | 0;
+ invoke_viii(640, $png_ptr61 | 0, $info_ptr62 | 0, $end_info63 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $row_pointers64 = $this1 + 28 | 0;
+ $49 = HEAP32[$row_pointers64 >> 2] | 0;
+ $isnull65 = ($49 | 0) == 0;
+ if ($isnull65) {
+ label = 24;
+ break;
+ } else {
+ label = 23;
+ break;
+ }
+ case 23:
+ $50 = $49;
+ invoke_vi(926, $50 | 0);
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ label = 24;
+ break;
+ case 24:
+ $png_ptr68 = $this1 + 16 | 0;
+ HEAP32[$png_ptr68 >> 2] = 0;
+ $state69 = $this1 + 32 | 0;
+ HEAP32[$state69 >> 2] = 0;
+ $51 = HEAP32[$color_type >> 2] | 0;
+ $cmp70 = ($51 | 0) == 3;
+ if ($cmp70) {
+ label = 25;
+ break;
+ } else {
+ label = 36;
+ break;
+ }
+ case 25:
+ $52 = $outImage_addr;
+ $call72 = invoke_ii(926, $52 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $cmp73 = ($call72 | 0) == 3;
+ if ($cmp73) {
+ label = 26;
+ break;
+ } else {
+ label = 36;
+ break;
+ }
+ case 26:
+ $53 = $outImage_addr;
+ $call75 = invoke_ii(860, $53 | 0) | 0;
+ if ((__THREW__ | 0) != 0 & (threwValue | 0) != 0) {
+ setjmpLabel = _testSetjmp(HEAP32[__THREW__ >> 2] | 0, setjmpTable) | 0;
+ if ((setjmpLabel | 0) > 0) {
+ label = -1;
+ break;
+ } else return 0 | 0;
+ }
+ __THREW__ = threwValue = 0;
+ $color_table_size = $call75;
+ $y76 = 0;
+ label = 27;
+ break;
+ case 27:
+ $54 = $y76;
+ $55 = HEAP32[$height >> 2] | 0;
+ $cmp78 = ($54 | 0) < ($55 | 0);
+ if ($cmp78) {
+ label = 28;
+ break;
+ } else {
+ label = 35;
+ break;
+ }
+ case 28:
+ $56 = $data;
+ $57 = $y76;
+ $58 = $bpl;
+ $mul80 = Math_imul($57, $58) | 0;
+ $add_ptr81 = $56 + $mul80 | 0;
+ $p = $add_ptr81;
+ $59 = $p;
+ $60 = HEAP32[$width >> 2] | 0;
+ $add_ptr82 = $59 + $60 | 0;
+ $end = $add_ptr82;
+ label = 29;
+ break;
+ case 29:
+ $61 = $p;
+ $62 = $end;
+ $cmp83 = $61 >>> 0 < $62 >>> 0;
+ if ($cmp83) {
+ label = 30;
+ break;
+ } else {
+ label = 33;
+ break;
+ }
+ case 30:
+ $63 = $p;
+ $64 = HEAP8[$63] | 0;
+ $conv = $64 & 255;
+ $65 = $color_table_size;
+ $cmp84 = ($conv | 0) >= ($65 | 0);
+ if ($cmp84) {
+ label = 31;
+ break;
+ } else {
+ label = 32;
+ break;
+ }
+ case 31:
+ $66 = $p;
+ HEAP8[$66] = 0;
+ label = 32;
+ break;
+ case 32:
+ $67 = $p;
+ $incdec_ptr = $67 + 1 | 0;
+ $p = $incdec_ptr;
+ label = 29;
+ break;
+ case 33:
+ label = 34;
+ break;
+ case 34:
+ $68 = $y76;
+ $inc88 = $68 + 1 | 0;
+ $y76 = $inc88;
+ label = 27;
+ break;
+ case 35:
+ label = 36;
+ break;
+ case 36:
+ $retval = 1;
+ label = 37;
+ break;
+ case 37:
+ $69 = $retval;
+ STACKTOP = sp;
+ return $69 | 0;
+ case -1:
+ if ((setjmpLabel | 0) == 6) {
+ $call8 = threwValue;
+ label = 38;
+ }
+ __THREW__ = threwValue = 0;
+ break;
+ }
+ return 0;
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "__Z11printResultPiS_j", "_segment_holding", "__ZN5identC2EiPKcPci", "_vec2Length", "exc", "label", "confuusion", "tempDouble", "_org_apache_harmony_luni_util_NumberConverter_freeFormat__", "__ZN23b2EdgeAndPolygonContact8EvaluateEP10b2ManifoldRK11b2TransformS4_", "_java_nio_charset_Charset_forNameInternal___java_lang_String", "looop2", "looop3", "looop4", "looop5", "looop6", "looop7", "looop8", "multiloop", "multiloop2", "tempDouble2", "watIf", "select2", "binary", "cute"]
diff --git a/tools/file_packager.py b/tools/file_packager.py
index 8b65b219..12cc5475 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -13,6 +13,9 @@ Usage:
file_packager.py TARGET [--preload A [B..]] [--embed C [D..]] [--exclude E [F..]] [--compress COMPRESSION_DATA] [--crunch[=X]] [--js-output=OUTPUT.js] [--no-force] [--use-preload-cache] [--no-heap-copy]
+ --preload ,
+ --embed See emcc --help for more details on those options.
+
--crunch=X Will compress dxt files to crn with quality level X. The crunch commandline tool must be present
and CRUNCH should be defined in ~/.emscripten that points to it. JS crunch decompressing code will
be added to convert the crn to dds in the browser.
@@ -107,7 +110,11 @@ for arg in sys.argv[2:]:
jsoutput = arg.split('=')[1] if '=' in arg else None
leading = ''
elif arg.startswith('--crunch'):
- from shared import CRUNCH
+ try:
+ from shared import CRUNCH
+ except Exception, e:
+ print >> sys.stderr, 'count not import CRUNCH (make sure it is defined properly in ~/.emscripten)'
+ raise e
crunch = arg.split('=')[1] if '=' in arg else '128'
leading = ''
elif arg.startswith('--plugin'):
@@ -461,8 +468,11 @@ if has_preloaded:
''' % use_data
package_uuid = uuid.uuid4();
- remote_package_name = os.path.basename(Compression.compressed_name(data_target) if Compression.on else data_target)
- code += r'''
+ package_name = Compression.compressed_name(data_target) if Compression.on else data_target
+ statinfo = os.stat(package_name)
+ remote_package_size = statinfo.st_size
+ remote_package_name = os.path.basename(package_name)
+ ret += r'''
var PACKAGE_PATH;
if (typeof window === 'object') {
PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/');
@@ -471,9 +481,10 @@ if has_preloaded:
PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/');
}
var PACKAGE_NAME = '%s';
- var REMOTE_PACKAGE_NAME = '%s';
+ var REMOTE_PACKAGE_NAME = (Module['filePackagePrefixURL'] || '') + '%s';
+ var REMOTE_PACKAGE_SIZE = %d;
var PACKAGE_UUID = '%s';
- ''' % (data_target, remote_package_name, package_uuid)
+ ''' % (data_target, remote_package_name, remote_package_size, package_uuid)
if use_preload_cache:
code += r'''
@@ -567,19 +578,21 @@ if has_preloaded:
'''
ret += r'''
- function fetchRemotePackage(packageName, callback, errback) {
+ function fetchRemotePackage(packageName, packageSize, callback, errback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', packageName, true);
xhr.responseType = 'arraybuffer';
xhr.onprogress = function(event) {
var url = packageName;
- if (event.loaded && event.total) {
+ var size = packageSize;
+ if (event.total) size = event.total;
+ if (event.loaded) {
if (!xhr.addedTotal) {
xhr.addedTotal = true;
if (!Module.dataFileDownloads) Module.dataFileDownloads = {};
Module.dataFileDownloads[url] = {
loaded: event.loaded,
- total: event.total
+ total: size
};
} else {
Module.dataFileDownloads[url].loaded = event.loaded;
@@ -631,7 +644,7 @@ if has_preloaded:
function preloadFallback(error) {
console.error(error);
console.error('falling back to default preload behavior');
- fetchRemotePackage(REMOTE_PACKAGE_NAME, processPackageData, handleError);
+ fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, processPackageData, handleError);
};
openDatabase(
@@ -644,7 +657,7 @@ if has_preloaded:
fetchCachedPackage(db, PACKAGE_PATH + PACKAGE_NAME, processPackageData, preloadFallback);
} else {
console.info('loading ' + PACKAGE_NAME + ' from remote');
- fetchRemotePackage(REMOTE_PACKAGE_NAME,
+ fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE,
function(packageData) {
cacheRemotePackage(db, PACKAGE_PATH + PACKAGE_NAME, packageData, {uuid:PACKAGE_UUID}, processPackageData,
function(error) {
@@ -666,7 +679,7 @@ if has_preloaded:
# Only tricky bit is the fetch is async, but also when runWithFS is called is async, so we handle both orderings.
ret += r'''
var fetched = null, fetchedCallback = null;
- fetchRemotePackage('%s', function(data) {
+ fetchRemotePackage(REMOTE_PACKAGE_NAME, REMOTE_PACKAGE_SIZE, function(data) {
if (fetchedCallback) {
fetchedCallback(data);
fetchedCallback = null;
@@ -674,7 +687,7 @@ if has_preloaded:
fetched = data;
}
}, handleError);
- ''' % os.path.basename(Compression.compressed_name(data_target) if Compression.on else data_target)
+ '''
code += r'''
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
diff --git a/tools/find_bigis.py b/tools/find_bigis.py
index d11c1a81..1261e7ff 100644
--- a/tools/find_bigis.py
+++ b/tools/find_bigis.py
@@ -6,7 +6,7 @@ import os, sys, re
filename = sys.argv[1]
data = open(filename).read()
-iss = re.findall('[^%]i\d+ [^=]', data)
+iss = re.findall(' i\d+ [^=]', data)
set_iss = set(iss)
bigs = []
for iss in set_iss:
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 3a6d70bc..240ee2bd 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -140,6 +140,8 @@ var ALTER_FLOW = set('break', 'continue', 'return');
var BREAK_CAPTURERS = set('do', 'while', 'for', 'switch');
var CONTINUE_CAPTURERS = LOOP;
+var FUNCTIONS_THAT_ALWAYS_THROW = set('abort', '___resumeException', '___cxa_throw', '___cxa_rethrow');
+
var NULL_NODE = ['name', 'null'];
var UNDEFINED_NODE = ['unary-prefix', 'void', ['num', 0]];
var TRUE_NODE = ['unary-prefix', '!', ['num', 0]];
@@ -214,16 +216,6 @@ function traverse(node, pre, post, stack) {
}
// Only walk through the generated functions
-function traverseGenerated(ast, pre, post, stack) {
- assert(generatedFunctions);
- traverse(ast, function(node) {
- if (node[0] === 'defun') {
- traverse(node, pre, post, stack);
- return null;
- }
- });
-}
-
function traverseGeneratedFunctions(ast, callback) {
assert(generatedFunctions);
if (ast[0] === 'toplevel') {
@@ -237,6 +229,12 @@ function traverseGeneratedFunctions(ast, callback) {
}
}
+function traverseGenerated(ast, pre, post, stack) {
+ traverseGeneratedFunctions(ast, function(func) {
+ traverse(func, pre, post, stack);
+ });
+}
+
// Walk the ast in a simple way, with an understanding of which JS variables are defined)
function traverseWithVariables(ast, callback) {
traverse(ast, function(node, type, stack) {
@@ -722,14 +720,19 @@ function simplifyExpressions(ast) {
if (correct === 'HEAP32') {
define[3] = ['binary', '|', define[3], ['num', 0]];
} else {
- define[3] = ['unary-prefix', '+', define[3]];
+ define[3] = makeAsmCoercion(define[3], asmPreciseF32 ? ASM_FLOAT : ASM_DOUBLE);
}
// do we want a simplifybitops on the new values here?
});
info.uses.forEach(function(use) {
use[2][1][1] = correct;
});
- asmData.vars[v] = 1 - asmData.vars[v];
+ var correctType;
+ switch(asmData.vars[v]) {
+ case ASM_INT: correctType = asmPreciseF32 ? ASM_FLOAT : ASM_DOUBLE; break;
+ case ASM_FLOAT: case ASM_DOUBLE: correctType = ASM_INT; break;
+ }
+ asmData.vars[v] = correctType;
}
}
denormalizeAsm(ast, asmData);
@@ -1138,7 +1141,9 @@ function optimizeShiftsAggressive(ast) {
// or such. Simplifying these saves space and time.
function simplifyNotCompsDirect(node) {
if (node[0] === 'unary-prefix' && node[1] === '!') {
- if (node[2][0] === 'binary') {
+ // de-morgan's laws do not work on floats, due to nans >:(
+ if (node[2][0] === 'binary' && (!asm || (((node[2][2][0] === 'binary' && node[2][2][1] === '|') || node[2][2][0] === 'num') &&
+ ((node[2][3][0] === 'binary' && node[2][3][1] === '|') || node[2][3][0] === 'num')))) {
switch(node[2][1]) {
case '<': return ['binary', '>=', node[2][2], node[2][3]];
case '>': return ['binary', '<=', node[2][2], node[2][3]];
@@ -1553,6 +1558,7 @@ function unVarify(vars, ret) { // transform var x=1, y=2 etc. into (x=1, y=2), i
var ASM_INT = 0;
var ASM_DOUBLE = 1;
var ASM_FLOAT = 2;
+var ASM_NONE = 3;
function detectAsmCoercion(node, asmInfo) {
// for params, +x vs x|0, for vars, 0.0 vs 0
@@ -1560,6 +1566,7 @@ function detectAsmCoercion(node, asmInfo) {
if (node[0] === 'unary-prefix') return ASM_DOUBLE;
if (node[0] === 'call' && node[1][0] === 'name' && node[1][1] === 'Math_fround') return ASM_FLOAT;
if (asmInfo && node[0] == 'name') return getAsmType(node[1], asmInfo);
+ if (node[0] === 'name') return ASM_NONE;
return ASM_INT;
}
@@ -1568,7 +1575,8 @@ function makeAsmCoercion(node, type) {
case ASM_INT: return ['binary', '|', node, ['num', 0]];
case ASM_DOUBLE: return ['unary-prefix', '+', node];
case ASM_FLOAT: return ['call', ['name', 'Math_fround'], [node]];
- default: throw 'wha? ' + JSON.stringify([node, type]) + new Error().stack;
+ case ASM_NONE: return node; // non-validating code, emit nothing
+ default: throw 'whaa?';
}
}
@@ -1577,7 +1585,7 @@ function makeAsmVarDef(v, type) {
case ASM_INT: return [v, ['num', 0]];
case ASM_DOUBLE: return [v, ['unary-prefix', '+', ['num', 0]]];
case ASM_FLOAT: return [v, ['call', ['name', 'Math_fround'], [['num', 0]]]];
- default: throw 'wha?';
+ default: throw 'wha? ' + JSON.stringify([node, type]) + new Error().stack;
}
}
@@ -1593,6 +1601,7 @@ function normalizeAsm(func) {
params: {}, // ident => ASM_* type
vars: {}, // ident => ASM_* type
inlines: [], // list of inline assembly copies
+ ret: undefined,
};
// process initial params
var stats = func[3];
@@ -1603,6 +1612,7 @@ function normalizeAsm(func) {
node = node[1];
var name = node[2][1];
if (func[2] && func[2].indexOf(name) < 0) break; // not an assign into a parameter, but a global
+ if (name in data.params) break; // already done that param, must be starting function body
data.params[name] = detectAsmCoercion(node[3]);
stats[i] = emptyNode();
i++;
@@ -1628,7 +1638,7 @@ function normalizeAsm(func) {
}
i++;
}
- // finally, look for other var definitions and collect them
+ // look for other var definitions and collect them
while (i < stats.length) {
traverse(stats[i], function(node, type) {
if (type === 'var') {
@@ -1657,6 +1667,11 @@ function normalizeAsm(func) {
});
i++;
}
+ // look for final 'return' statement to get return type.
+ var retStmt = stats[stats.length - 1];
+ if (retStmt && retStmt[0] === 'return' && retStmt[1]) {
+ data.ret = detectAsmCoercion(retStmt[1]);
+ }
//printErr('normalized \n\n' + astToSrc(func) + '\n\nwith: ' + JSON.stringify(data));
return data;
}
@@ -1709,6 +1724,17 @@ function denormalizeAsm(func, data) {
}
});
}
+ // ensure that there's a final 'return' statement if needed.
+ if (data.ret !== undefined) {
+ var retStmt = stats[stats.length - 1];
+ if (!retStmt || retStmt[0] !== 'return') {
+ var retVal = ['num', 0];
+ if (data.ret !== ASM_INT) {
+ retVal = makeAsmCoercion(retVal, data.ret);
+ }
+ stats.push(['return', retVal]);
+ }
+ }
//printErr('denormalized \n\n' + astToSrc(func) + '\n\n');
}
@@ -1773,9 +1799,7 @@ function ensureMinifiedNames(n) { // make sure the nth index in minifiedNames ex
}
}
-// Very simple 'registerization', coalescing of variables into a smaller number,
-// as part of minification. Globals-level minification began in a previous pass,
-// we receive extraInfo which tells us how to rename globals. (Only in asm.js.)
+// Very simple 'registerization', coalescing of variables into a smaller number.
//
// We do not optimize when there are switches, so this pass only makes sense with
// relooping.
@@ -1811,6 +1835,7 @@ function registerize(ast) {
// Replace all var definitions with assignments; we will add var definitions at the top after we registerize
// We also mark local variables - i.e., having a var definition
var localVars = {};
+ var allVars = {};
var hasSwitch = false; // we cannot optimize variables if there is a switch, unless in asm mode
traverse(fun, function(node, type) {
if (type === 'var') {
@@ -1823,74 +1848,25 @@ function registerize(ast) {
}
} else if (type === 'switch') {
hasSwitch = true;
+ } else if (type === 'name') {
+ allVars[node[1]] = 1;
}
});
vacuum(fun);
- if (extraInfo && extraInfo.globals) {
- assert(asm);
- var usedGlobals = {};
- var nextLocal = 0;
- // Minify globals using the mapping we were given
- traverse(fun, function(node, type) {
- if (type === 'name') {
- var name = node[1];
- var minified = extraInfo.globals[name];
- if (minified) {
- assert(!localVars[name], name); // locals must not shadow globals, or else we don't know which is which
- if (localVars[minified]) {
- // trying to minify a global into a name used locally. rename all the locals
- var newName = '$_newLocal_' + (nextLocal++);
- assert(!localVars[newName]);
- if (params[minified]) {
- params[newName] = 1;
- delete params[minified];
- }
- localVars[newName] = 1;
- delete localVars[minified];
- asmData.vars[newName] = asmData.vars[minified];
- delete asmData.vars[minified];
- asmData.params[newName] = asmData.params[minified];
- delete asmData.params[minified];
- traverse(fun, function(node, type) {
- if (type === 'name' && node[1] === minified) {
- node[1] = newName;
- }
- });
- if (fun[2]) {
- for (var i = 0; i < fun[2].length; i++) {
- if (fun[2][i] === minified) fun[2][i] = newName;
- }
- }
- }
- node[1] = minified;
- usedGlobals[minified] = 1;
- }
- }
- });
- if (fun[1] in extraInfo.globals) { // if fun was created by a previous optimization pass, it will not be here
- fun[1] = extraInfo.globals[fun[1]];
- assert(fun[1]);
- }
- var nextRegName = 0;
- }
var regTypes = {};
function getNewRegName(num, name) {
- if (!asm) return 'r' + num;
- var type = asmData.vars[name];
- if (!extraInfo || !extraInfo.globals) {
- var ret = (type ? 'd' : 'i') + num;
+ var ret;
+ if (!asm) {
+ ret = 'r' + num;
+ } else {
+ var type = asmData.vars[name];
+ ret = (type ? 'd' : 'i') + num;
regTypes[ret] = type;
- return ret;
}
- // find the next free minified name that is not used by a global that shows up in this function
- while (1) {
- ensureMinifiedNames(nextRegName);
- var ret = minifiedNames[nextRegName++];
- if (!usedGlobals[ret]) {
- regTypes[ret] = type;
- return ret;
- }
+ if (ret in allVars) {
+ assert(ret in localVars, 'register shadows non-local name');
}
+ return ret;
}
// Find the # of uses of each variable.
// While doing so, check if all a variable's uses are dominated in a simple
@@ -1997,7 +1973,7 @@ function registerize(ast) {
// we just use a fresh register to make sure we avoid this, but it could be
// optimized to check for safe registers (free, and not used in this loop level).
var varRegs = {}; // maps variables to the register they will use all their life
- var freeRegsClasses = asm ? [[], [], []] : []; // two classes for asm, one otherwise XXX - hardcoded length
+ var freeRegsClasses = asm ? [[], [], [], []] : []; // two classes for asm, one otherwise XXX - hardcoded length
var nextReg = 1;
var fullNames = {};
var loopRegs = {}; // for each loop nesting level, the list of bound variables
@@ -2099,6 +2075,7 @@ function registerize(ast) {
params: {},
vars: {},
inlines: asmData.inlines,
+ ret: asmData.ret,
};
for (var i = 1; i < nextReg; i++) {
var reg = fullNames[i];
@@ -2111,37 +2088,1067 @@ function registerize(ast) {
}
}
denormalizeAsm(fun, finalAsmData);
- if (extraInfo && extraInfo.globals) {
- // minify in asm var definitions, that denormalizeAsm just generated
- function minify(value) {
- if (value && value[0] === 'call' && value[1][0] === 'name') {
- var name = value[1][1];
- var minified = extraInfo.globals[name];
- if (minified) {
- value[1][1] = minified;
+ }
+ });
+}
+
+
+// Assign variables to 'registers', coalescing them onto a smaller number of shared
+// variables.
+//
+// This does the same job as 'registerize' above, but burns a lot more cycles trying
+// to reduce the total number of register variables. Key points about the operation:
+//
+// * we decompose the AST into a flow graph and perform a full liveness
+// analysis, to determine which variables are live at each point.
+//
+// * variables that are live concurrently are assigned to different registers.
+//
+// * variables that are linked via 'x=y' style statements are assigned the same
+// register if possible, so that the redundant assignment can be removed.
+// (e.g. assignments used to pass state around through loops).
+//
+// * any code that cannot be reached through the flow-graph is removed.
+// (e.g. redundant break statements like 'break L123; break;').
+//
+// * any assignments that we can prove are not subsequently used are removed.
+// (e.g. unnecessary assignments to the 'label' variable).
+//
+function registerizeHarder(ast) {
+ assert(asm);
+
+ traverseGeneratedFunctions(ast, function(fun) {
+
+ var asmData = normalizeAsm(fun);
+
+ var localVars = asmData.vars;
+ for (var name in asmData.params) {
+ localVars[name] = asmData.params[name];
+ }
+
+ // Utilities for allocating register variables.
+ // We need distinct register pools for each type of variable.
+
+ var allRegsByType = [{}, {}, {}, {}];
+ var regPrefixByType = ['i', 'd', 'f', 'n'];
+ var nextReg = 1;
+
+ function createReg(forName) {
+ // Create a new register of type suitable for the given variable name.
+ var allRegs = allRegsByType[localVars[forName]];
+ reg = nextReg++;
+ allRegs[reg] = regPrefixByType[localVars[forName]] + reg;
+ return reg;
+ }
+
+ // Traverse the tree in execution order and synthesize a basic flow-graph.
+ // It's convenient to build a kind of "dual" graph where the nodes identify
+ // the junctions between blocks at which control-flow may branch, and each
+ // basic block is an edge connecting two such junctions.
+ // For each junction we store:
+ // * set of blocks that originate at the junction
+ // * set of blocks that terminate at the junction
+ // For each block we store:
+ // * a single entry junction
+ // * a single exit junction
+ // * a 'use' and 'kill' set of names for the block
+ // * full sequence of 'name' and 'assign' nodes in the block
+ // * whether each such node appears as part of a larger expression
+ // (and therefore cannot be safely eliminated)
+ // * set of labels that can be used to jump to this block
+
+ var junctions = [];
+ var blocks = [];
+ var currEntryJunction = null;
+ var nextBasicBlock = null;
+ var isInExpr = 0;
+ var activeLabels = [{}];
+ var nextLoopLabel = null;
+
+ var ENTRY_JUNCTION = 0;
+ var EXIT_JUNCTION = 1;
+ var ENTRY_BLOCK = 0;
+
+ function addJunction() {
+ // Create a new junction, without inserting it into the graph.
+ // This is useful for e.g. pre-allocating an exit node.
+ var id = junctions.length;
+ junctions[id] = {id: id, inblocks: {}, outblocks: {}};
+ return id;
+ }
+
+ function markJunction(id) {
+ // Mark current traversal location as a junction.
+ // This makes a new basic block exiting at this position.
+ if (id === undefined || id === null) {
+ id = addJunction();
+ }
+ joinJunction(id, true);
+ return id;
+ }
+
+ function setJunction(id, force) {
+ // Set the next entry junction to the given id.
+ // This can be used to enter at a previously-declared point.
+ // You can't return to a junction with no incoming blocks
+ // unless the 'force' parameter is specified.
+ assert(nextBasicBlock.nodes.length === 0, 'refusing to abandon an in-progress basic block')
+ if (force || setSize(junctions[id].inblocks) > 0) {
+ currEntryJunction = id;
+ } else {
+ currEntryJunction = null;
+ }
+ }
+
+ function joinJunction(id, force) {
+ // Complete the pending basic block by exiting at this position.
+ // This can be used to exit at a previously-declared point.
+ if (currEntryJunction !== null) {
+ nextBasicBlock.id = blocks.length;
+ nextBasicBlock.entry = currEntryJunction;
+ nextBasicBlock.exit = id;
+ junctions[currEntryJunction].outblocks[nextBasicBlock.id] = 1;
+ junctions[id].inblocks[nextBasicBlock.id] = 1;
+ blocks.push(nextBasicBlock);
+ }
+ nextBasicBlock = { id: null, entry: null, exit: null, labels: {}, nodes: [], isexpr: [], use: {}, kill: {} };
+ setJunction(id, force);
+ return id;
+ }
+
+ function pushActiveLabels(onContinue, onBreak) {
+ // Push the target junctions for continuing/breaking a loop.
+ // This should be called before traversing into a loop.
+ var newLabels = copy(activeLabels[activeLabels.length-1]);
+ newLabels[null] = [onContinue, onBreak];
+ if (nextLoopLabel) {
+ newLabels[nextLoopLabel] = [onContinue, onBreak];
+ nextLoopLabel = null;
+ }
+ activeLabels.push(newLabels);
+ }
+
+ function popActiveLabels() {
+ // Pop the target junctions for continuing/breaking a loop.
+ // This should be called after traversing into a loop.
+ activeLabels.pop();
+ }
+
+ function markNonLocalJump(type, label) {
+ // Complete a block via 'return', 'break' or 'continue'.
+ // This joins the targetted junction and then sets the current junction to null.
+ // Any code traversed before we get back an existing junction is dead code.
+ if (type === 'return') {
+ joinJunction(EXIT_JUNCTION);
+ } else {
+ label = label ? label : null;
+ var targets = activeLabels[activeLabels.length-1][label];
+ assert(targets, 'jump to unknown label');
+ if (type === 'continue') {
+ joinJunction(targets[0]);
+ } else if (type === 'break') {
+ joinJunction(targets[1]);
+ } else {
+ assert(false, 'unknown jump node type');
+ }
+ }
+ currEntryJunction = null;
+ }
+
+ function addUseNode(node) {
+ // Mark a use of the given name node in the current basic block.
+ assert(node[0] === 'name', 'not a use node');
+ var name = node[1];
+ if (name in localVars) {
+ nextBasicBlock.nodes.push(node);
+ nextBasicBlock.isexpr.push(isInExpr);
+ if (!nextBasicBlock.kill[name]) {
+ nextBasicBlock.use[name] = 1;
+ }
+ }
+ }
+
+ function addKillNode(node) {
+ // Mark an assignment to the given name node in the current basic block.
+ assert(node[0] === 'assign', 'not a kill node');
+ assert(node[1] === true, 'not a kill node');
+ assert(node[2][0] === 'name', 'not a kill node');
+ var name = node[2][1];
+ if (name in localVars) {
+ nextBasicBlock.nodes.push(node);
+ nextBasicBlock.isexpr.push(isInExpr);
+ nextBasicBlock.kill[name] = 1;
+ }
+ }
+
+ function lookThroughCasts(node) {
+ // Look through value-preserving casts, like "x | 0" => "x"
+ if (node[0] === 'binary' && node[1] === '|') {
+ if (node[3][0] === 'num' && node[3][1] === 0) {
+ return lookThroughCasts(node[2]);
+ }
+ }
+ return node;
+ }
+
+ function addBlockLabel(node) {
+ assert(nextBasicBlock.nodes.length === 0, 'cant add label to an in-progress basic block')
+ if (node[0] === 'num') {
+ nextBasicBlock.labels[node[1]] = 1;
+ }
+ }
+
+ function isTrueNode(node) {
+ // Check if the given node is statically truthy.
+ return (node[0] === 'num' && node[1] != 0);
+ }
+
+ function isFalseNode(node) {
+ // Check if the given node is statically falsy.
+ return (node[0] === 'num' && node[1] == 0);
+ }
+
+ function morphNode(node, newNode) {
+ // In-place morph a node into some other type of node.
+ var i = 0;
+ while (i < node.length && i < newNode.length) {
+ node[i] = newNode[i];
+ i++;
+ }
+ while (i < newNode.length) {
+ node.push(newNode[i]);
+ i++;
+ }
+ if (node.length > newNode.length) {
+ node.length = newNode.length;
+ }
+ }
+
+ function buildFlowGraph(node) {
+ // Recursive function to build up the flow-graph.
+ // It walks the tree in execution order, calling the above state-management
+ // functions at appropriate points in the traversal.
+ var type = node[0];
+
+ // Any code traversed without an active entry junction must be dead,
+ // as the resulting block could never be entered. Let's remove it.
+ if (currEntryJunction === null && junctions.length > 0) {
+ morphNode(node, ['block', []]);
+ return;
+ }
+
+ // Traverse each node type according to its particular control-flow semantics.
+ switch (type) {
+ case 'defun':
+ var jEntry = markJunction();
+ assert(jEntry === ENTRY_JUNCTION);
+ var jExit = addJunction();
+ assert(jExit === EXIT_JUNCTION);
+ for (var i = 0; i < node[3].length; i++) {
+ buildFlowGraph(node[3][i]);
+ }
+ joinJunction(jExit);
+ break;
+ case 'if':
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ var jEnter = markJunction();
+ var jExit = addJunction();
+ if (node[2]) {
+ // Detect and mark "if (label == N) { <labelled block> }".
+ if (node[1][0] === 'binary' && node[1][1] === '==') {
+ var lhs = lookThroughCasts(node[1][2]);
+ if (lhs[0] === 'name' && lhs[1] === 'label') {
+ addBlockLabel(lookThroughCasts(node[1][3]));
+ }
+ }
+ buildFlowGraph(node[2]);
+ }
+ joinJunction(jExit);
+ setJunction(jEnter);
+ if (node[3]) {
+ buildFlowGraph(node[3]);
+ }
+ joinJunction(jExit);
+ break;
+ case 'conditional':
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ var jEnter = markJunction();
+ var jExit = addJunction();
+ if (node[2]) {
+ buildFlowGraph(node[2]);
+ }
+ joinJunction(jExit);
+ setJunction(jEnter);
+ if (node[3]) {
+ buildFlowGraph(node[3]);
+ }
+ joinJunction(jExit);
+ isInExpr--;
+ break;
+ case 'while':
+ // Special-case "while (1) {}" to use fewer junctions,
+ // since emscripten generates a lot of these.
+ if (isTrueNode(node[1])) {
+ var jLoop = markJunction();
+ var jExit = addJunction();
+ pushActiveLabels(jLoop, jExit);
+ buildFlowGraph(node[2]);
+ popActiveLabels();
+ joinJunction(jLoop);
+ setJunction(jExit);
+ } else {
+ var jCond = markJunction();
+ var jLoop = addJunction();
+ var jExit = addJunction();
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ joinJunction(jLoop);
+ pushActiveLabels(jCond, jExit);
+ buildFlowGraph(node[2]);
+ popActiveLabels();
+ joinJunction(jCond);
+ // An empty basic-block linking condition exit to loop exit.
+ setJunction(jLoop);
+ joinJunction(jExit);
+ }
+ break;
+ case 'do':
+ // Special-case "do {} while (1)" and "do {} while (0)" to use
+ // fewer junctions, since emscripten generates a lot of these.
+ if (isFalseNode(node[1])) {
+ var jExit = addJunction();
+ pushActiveLabels(jExit, jExit);
+ buildFlowGraph(node[2]);
+ popActiveLabels();
+ joinJunction(jExit);
+ } else if (isTrueNode(node[1])) {
+ var jLoop = markJunction();
+ var jExit = addJunction();
+ pushActiveLabels(jLoop, jExit);
+ buildFlowGraph(node[2]);
+ popActiveLabels();
+ joinJunction(jLoop);
+ setJunction(jExit);
+ } else {
+ var jLoop = markJunction();
+ var jCond = addJunction();
+ var jCondExit = addJunction();
+ var jExit = addJunction();
+ pushActiveLabels(jCond, jExit);
+ buildFlowGraph(node[2]);
+ popActiveLabels();
+ joinJunction(jCond);
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ joinJunction(jCondExit);
+ joinJunction(jLoop);
+ setJunction(jCondExit);
+ joinJunction(jExit)
+ }
+ break;
+ case 'for':
+ var jTest = addJunction();
+ var jBody = addJunction();
+ var jStep = addJunction();
+ var jExit = addJunction();
+ buildFlowGraph(node[1]);
+ joinJunction(jTest);
+ isInExpr++;
+ buildFlowGraph(node[2]);
+ isInExpr--;
+ joinJunction(jBody);
+ pushActiveLabels(jStep, jExit);
+ buildFlowGraph(node[4]);
+ popActiveLabels();
+ joinJunction(jStep);
+ buildFlowGraph(node[3]);
+ joinJunction(jTest);
+ setJunction(jBody);
+ joinJunction(jExit);
+ break;
+ case 'label':
+ assert(node[2][0] in BREAK_CAPTURERS, 'label on non-loop, non-switch statement')
+ nextLoopLabel = node[1];
+ buildFlowGraph(node[2]);
+ break;
+ case 'switch':
+ // Emscripten generates switch statements of a very limited
+ // form: all case clauses are numeric literals, and all
+ // case bodies end with a (maybe implicit) break. So it's
+ // basically equivalent to a multi-way 'if' statement.
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ var condition = lookThroughCasts(node[1]);
+ var jCheckExit = markJunction();
+ var jExit = addJunction();
+ pushActiveLabels(null, jExit);
+ var hasDefault = false;
+ for (var i=0; i<node[2].length; i++) {
+ setJunction(jCheckExit);
+ // All case clauses are either 'default' or a numeric literal.
+ if (!node[2][i][0]) {
+ hasDefault = true;
+ } else {
+ // Detect switches dispatching to labelled blocks.
+ if (condition[0] === 'name' && condition[1] === 'label') {
+ addBlockLabel(lookThroughCasts(node[2][i][0]));
+ }
+ }
+ for (var j = 0; j < node[2][i][1].length; j++) {
+ buildFlowGraph(node[2][i][1][j]);
+ }
+ // Control flow will never actually reach the end of the case body.
+ // If there's live code here, assume it jumps to case exit.
+ if (currEntryJunction !== null && nextBasicBlock.nodes.length > 0) {
+ if (node[2][i][0]) {
+ markNonLocalJump('return');
+ } else {
+ joinJunction(jExit);
+ }
}
}
+ // If there was no default case, we also need an empty block
+ // linking straight from the test evaluation to the exit.
+ if (!hasDefault) {
+ setJunction(jCheckExit);
+ }
+ joinJunction(jExit);
+ popActiveLabels()
+ break;
+ case 'return':
+ if (node[1]) {
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ }
+ markNonLocalJump(type);
+ break;
+ case 'break':
+ case 'continue':
+ markNonLocalJump(type, node[1]);
+ break;
+ case 'assign':
+ isInExpr++;
+ buildFlowGraph(node[3]);
+ isInExpr--;
+ if (node[1] === true && node[2][0] === 'name') {
+ addKillNode(node);
+ } else {
+ buildFlowGraph(node[2]);
+ }
+ break;
+ case 'name':
+ addUseNode(node);
+ break;
+ case 'block':
+ case 'toplevel':
+ if (node[1]) {
+ for (var i = 0; i < node[1].length; i++) {
+ buildFlowGraph(node[1][i]);
+ }
+ }
+ break;
+ case 'stat':
+ buildFlowGraph(node[1]);
+ break;
+ case 'unary-prefix':
+ case 'unary-postfix':
+ isInExpr++;
+ buildFlowGraph(node[2]);
+ isInExpr--;
+ break;
+ case 'binary':
+ isInExpr++;
+ buildFlowGraph(node[2]);
+ buildFlowGraph(node[3]);
+ isInExpr--;
+ break;
+ case 'call':
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ if (node[2]) {
+ for (var i = 0; i < node[2].length; i++) {
+ buildFlowGraph(node[2][i]);
+ }
+ }
+ isInExpr--;
+ // If the call is statically known to throw,
+ // treat it as a jump to function exit.
+ if (!isInExpr && node[1][0] === 'name') {
+ if (node[1][1] in FUNCTIONS_THAT_ALWAYS_THROW) {
+ markNonLocalJump('return');
+ }
+ }
+ break;
+ case 'seq':
+ case 'sub':
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ buildFlowGraph(node[2]);
+ isInExpr--;
+ break;
+ case 'dot':
+ case 'throw':
+ isInExpr++;
+ buildFlowGraph(node[1]);
+ isInExpr--;
+ break;
+ case 'num':
+ case 'string':
+ case 'var':
+ break;
+ default:
+ printErr(JSON.stringify(node));
+ assert(false, 'unsupported node type: ' + type);
+ }
+ }
+ buildFlowGraph(fun);
+
+ assert(setSize(junctions[ENTRY_JUNCTION].inblocks) === 0, 'function entry must have no incoming blocks');
+ assert(setSize(junctions[EXIT_JUNCTION].outblocks) === 0, 'function exit must have no outgoing blocks');
+ assert(blocks[ENTRY_BLOCK].entry === ENTRY_JUNCTION, 'block zero must be the initial block');
+
+ // Fix up implicit jumps done by assigning to the 'label' variable.
+ // If a block ends with an assignment to 'label' and there's another block
+ // with that value of 'label' as precondition, we tweak the flow graph so
+ // that the former jumps straight to the later.
+
+ var labelledBlocks = {};
+ var labelledJumps = [];
+ FINDLABELLEDBLOCKS:
+ for (var i = 0; i < blocks.length; i++) {
+ var block = blocks[i];
+ // Does it have any labels as preconditions to its entry?
+ for (var labelVal in block.labels) {
+ // If there are multiple blocks with the same label, all bets are off.
+ // This seems to happen sometimes for short blocks that end with a return.
+ // TODO: it should be safe to merge the duplicates if they're identical.
+ if (labelVal in labelledBlocks) {
+ labelledBlocks = {};
+ labelledJumps = [];
+ break FINDLABELLEDBLOCKS;
}
- var stats = fun[3];
- for (var i = 0; i < stats.length; i++) {
- var line = stats[i];
- if (i >= fun[2].length && line[0] !== 'var') break; // when we pass the arg and var coercions, break
- if (line[0] === 'stat') {
- assert(line[1][0] === 'assign');
- minify(line[1][3]);
+ labelledBlocks[labelVal] = block;
+ }
+ // Does it assign a specific label value at exit?
+ if ('label' in block.kill) {
+ var finalNode = block.nodes[block.nodes.length - 1];
+ if (finalNode[0] === 'assign' && finalNode[2][1] === 'label') {
+ // If labels are computed dynamically then all bets are off.
+ // This can happen due to indirect branching in llvm output.
+ if (finalNode[3][0] !== 'num') {
+ labelledBlocks = {};
+ labelledJumps = [];
+ break FINDLABELLEDBLOCKS;
+ }
+ labelledJumps.push([finalNode[3][1], block]);
+ } else {
+ // If label is assigned a non-zero value elsewhere in the block
+ // then all bets are off. This can happen e.g. due to outlining
+ // saving/restoring label to the stack.
+ for (var j = 0; j < block.nodes.length - 1; j++) {
+ if (block.nodes[j][0] === 'assign' && block.nodes[j][2][1] === 'label') {
+ if (block.nodes[j][3][0] !== 'num' && block.nodes[j][3][1] !== 0) {
+ labelledBlocks = {};
+ labelledJumps = [];
+ break FINDLABELLEDBLOCKS;
+ }
+ }
+ }
+ }
+ }
+ }
+ for (var labelVal in labelledBlocks) {
+ var block = labelledBlocks[labelVal];
+ // Disconnect it from the graph, and create a
+ // new junction for jumps targetting this label.
+ delete junctions[block.entry].outblocks[block.id];
+ block.entry = addJunction();
+ junctions[block.entry].outblocks[block.id] = 1;
+ // Add a fake use of 'label' to keep it alive in predecessor.
+ block.use['label'] = 1;
+ block.nodes.unshift(['name', 'label']);
+ block.isexpr.unshift(1);
+ }
+ for (var i = 0; i < labelledJumps.length; i++) {
+ var labelVal = labelledJumps[i][0];
+ var block = labelledJumps[i][1];
+ var targetBlock = labelledBlocks[labelVal];
+ if (targetBlock) {
+ // Redirect its exit to entry of the target block.
+ delete junctions[block.exit].inblocks[block.id];
+ block.exit = targetBlock.entry;
+ junctions[block.exit].inblocks[block.id] = 1;
+ }
+ }
+ labelledBlocks = null;
+ labelledJumps = null;
+
+ // Do a backwards data-flow analysis to determine the set of live
+ // variables at each junction, and to use this information to eliminate
+ // any unused assignments.
+ // We run two nested phases. The inner phase builds the live set for each
+ // junction. The outer phase uses this to try to eliminate redundant
+ // stores in each basic block, which might in turn affect liveness info.
+
+ function analyzeJunction(junc) {
+ // Update the live set for this junction.
+ var live = {};
+ for (var b in junc.outblocks) {
+ var block = blocks[b];
+ var liveSucc = junctions[block.exit].live || {};
+ for (var name in liveSucc) {
+ if (!(name in block.kill)) {
+ live[name] = 1;
+ }
+ }
+ for (var name in block.use) {
+ live[name] = 1;
+ }
+ }
+ junc.live = live;
+ }
+
+ function analyzeBlock(block) {
+ // Update information about the behaviour of the block.
+ // This includes the standard 'use' and 'kill' information,
+ // plus a 'link' set naming values that flow through from entry
+ // to exit, possibly changing names via simple 'x=y' assignments.
+ // As we go, we eliminate assignments if the variable is not
+ // subsequently used.
+ var live = copy(junctions[block.exit].live);
+ var use = {};
+ var kill = {};
+ var link = {};
+ var lastUseLoc = {};
+ var firstDeadLoc = {};
+ var firstKillLoc = {};
+ var lastKillLoc = {};
+ for (var name in live) {
+ link[name] = name;
+ lastUseLoc[name] = block.nodes.length;
+ firstDeadLoc[name] = block.nodes.length;
+ }
+ for (var j = block.nodes.length - 1; j >=0 ; j--) {
+ var node = block.nodes[j];
+ if (node[0] === 'name') {
+ var name = node[1];
+ live[name] = 1;
+ use[name] = j;
+ if (lastUseLoc[name] === undefined) {
+ lastUseLoc[name] = j;
+ firstDeadLoc[name] = j;
+ }
+ } else {
+ var name = node[2][1];
+ // We only keep assignments if they will be subsequently used.
+ if (name in live) {
+ kill[name] = 1;
+ delete use[name];
+ delete live[name];
+ firstDeadLoc[name] = j;
+ firstKillLoc[name] = j;
+ if (lastUseLoc[name] === undefined) {
+ lastUseLoc[name] = j;
+ }
+ if (lastKillLoc[name] === undefined) {
+ lastKillLoc[name] = j;
+ }
+ // If it's an "x=y" and "y" is not live, then we can create a
+ // flow-through link from "y" to "x". If not then there's no
+ // flow-through link for "x".
+ var oldLink = link[name];
+ if (oldLink) {
+ delete link[name];
+ if (node[3][0] === 'name') {
+ if (node[3][1] in localVars) {
+ link[node[3][1]] = oldLink;
+ }
+ }
+ }
} else {
- assert(line[0] === 'var');
- var pairs = line[1];
- for (var j = 0; j < pairs.length; j++) {
- minify(pairs[j][1]);
+ // The result of this assignment is never used, so delete it.
+ // We may need to keep the RHS for its value or its side-effects.
+ function removeUnusedNodes(j, n) {
+ for (var name in lastUseLoc) {
+ lastUseLoc[name] -= n;
+ }
+ for (var name in firstKillLoc) {
+ firstKillLoc[name] -= n;
+ }
+ for (var name in lastKillLoc) {
+ lastKillLoc[name] -= n;
+ }
+ for (var name in firstDeadLoc) {
+ firstDeadLoc[name] -= n;
+ }
+ block.nodes.splice(j, n);
+ block.isexpr.splice(j, n);
+ }
+ if (block.isexpr[j] || hasSideEffects(node[3])) {
+ morphNode(node, node[3]);
+ removeUnusedNodes(j, 1);
+ } else {
+ var numUsesInExpr = 0;
+ traverse(node[3], function(node, type) {
+ if (type === 'name' && node[1] in localVars) {
+ numUsesInExpr++;
+ }
+ });
+ morphNode(node, ['block', []]);
+ j = j - numUsesInExpr;
+ removeUnusedNodes(j, 1 + numUsesInExpr);
+ }
+ }
+ }
+ }
+ block.use = use;
+ block.kill = kill;
+ block.link = link;
+ block.lastUseLoc = lastUseLoc;
+ block.firstDeadLoc = firstDeadLoc;
+ block.firstKillLoc = firstKillLoc;
+ block.lastKillLoc = lastKillLoc;
+ }
+
+ var jWorklistMap = { EXIT_JUNCTION: 1 };
+ var jWorklist = [EXIT_JUNCTION];
+ var bWorklistMap = {};
+ var bWorklist = [];
+
+ // Be sure to visit every junction at least once.
+ // This avoids missing some vars because we disconnected them
+ // when processing the labelled jumps.
+ for (var i = junctions.length - 1; i >= EXIT_JUNCTION; i--) {
+ jWorklistMap[i] = 1;
+ jWorklist.push(i);
+ }
+
+ while (jWorklist.length > 0) {
+ // Iterate on just the junctions until we get stable live sets.
+ // The first run of this loop will grow the live sets to their maximal size.
+ // Subsequent runs will shrink them based on eliminated in-block uses.
+ while (jWorklist.length > 0) {
+ var junc = junctions[jWorklist.pop()];
+ delete jWorklistMap[junc.id];
+ var oldLive = junc.live || null;
+ analyzeJunction(junc);
+ if (!sortedJsonCompare(oldLive, junc.live)) {
+ // Live set changed, updated predecessor blocks and junctions.
+ for (var b in junc.inblocks) {
+ if (!(b in bWorklistMap)) {
+ bWorklistMap[b] = 1;
+ bWorklist.push(b);
+ }
+ var jPred = blocks[b].entry;
+ if (!(jPred in jWorklistMap)) {
+ jWorklistMap[jPred] = 1;
+ jWorklist.push(jPred);
+ }
+ }
+ }
+ }
+ // Now update the blocks based on the calculated live sets.
+ while (bWorklist.length > 0) {
+ var block = blocks[bWorklist.pop()];
+ delete bWorklistMap[block.id];
+ var oldUse = block.use;
+ analyzeBlock(block);
+ if (!sortedJsonCompare(oldUse, block.use)) {
+ // The use set changed, re-process the entry junction.
+ if (!(block.entry in jWorklistMap)) {
+ jWorklistMap[block.entry] = 1;
+ jWorklist.push(block.entry);
+ }
+ }
+ }
+ }
+
+ // Insist that all function parameters are alive at function entry.
+ // This ensures they will be assigned independent registers, even
+ // if they happen to be unused.
+
+ for (var name in asmData.params) {
+ junctions[ENTRY_JUNCTION].live[name] = 1;
+ }
+
+ // For variables that are live at one or more junctions, we assign them
+ // a consistent register for the entire scope of the function. Find pairs
+ // of variable that cannot use the same register (the "conflicts") as well
+ // as pairs of variables that we'd like to have share the same register
+ // (the "links").
+
+ var junctionVariables = {};
+
+ function initializeJunctionVariable(name) {
+ junctionVariables[name] = { conf: {}, link: {}, excl: {}, reg: null };
+ }
+
+ for (var i = 0; i < junctions.length; i++) {
+ var junc = junctions[i];
+ for (var name in junc.live) {
+ if (!junctionVariables[name]) initializeJunctionVariable(name);
+ // It conflicts with all other names live at this junction.
+ for (var otherName in junc.live) {
+ if (otherName == name) continue;
+ junctionVariables[name].conf[otherName] = 1;
+ }
+ for (var b in junc.outblocks) {
+ // It conflits with any output vars of successor blocks,
+ // if they're assigned before it goes dead in that block.
+ block = blocks[b];
+ var jSucc = junctions[block.exit];
+ for (var otherName in jSucc.live) {
+ if (junc.live[otherName]) continue;
+ if (block.lastKillLoc[otherName] < block.firstDeadLoc[name]) {
+ if (!junctionVariables[otherName]) initializeJunctionVariable(otherName);
+ junctionVariables[name].conf[otherName] = 1;
+ junctionVariables[otherName].conf[name] = 1;
}
}
+ // It links with any linkages in the outgoing blocks.
+ var linkName = block.link[name];
+ if (linkName && linkName !== name) {
+ if (!junctionVariables[linkName]) initializeJunctionVariable(linkName);
+ junctionVariables[name].link[linkName] = 1;
+ junctionVariables[linkName].link[name] = 1;
+ }
}
}
}
+
+ // Attempt to sort the junction variables to heuristically reduce conflicts.
+ // Simple starting point: handle the most-conflicted variables first.
+ // This seems to work pretty well.
+
+ var sortedJunctionVariables = keys(junctionVariables);
+ sortedJunctionVariables.sort(function(name1, name2) {
+ var jv1 = junctionVariables[name1];
+ var jv2 = junctionVariables[name2];
+ if (jv1.numConfs === undefined) {
+ jv1.numConfs = setSize(jv1.conf);
+ }
+ if (jv2.numConfs === undefined) {
+ jv2.numConfs = setSize(jv2.conf);
+ }
+ return jv2.numConfs - jv1.numConfs;
+ });
+
+ // We can now assign a register to each junction variable.
+ // Process them in order, trying available registers until we find
+ // one that works, and propagating the choice to linked/conflicted
+ // variables as we go.
+
+ function tryAssignRegister(name, reg) {
+ // Try to assign the given register to the given variable,
+ // and propagate that choice throughout the graph.
+ // Returns true if successful, false if there was a conflict.
+ var jv = junctionVariables[name];
+ if (jv.reg !== null) {
+ return jv.reg === reg;
+ }
+ if (jv.excl[reg]) {
+ return false;
+ }
+ jv.reg = reg;
+ // Exclude use of this register at all conflicting variables.
+ for (var confName in jv.conf) {
+ junctionVariables[confName].excl[reg] = 1;
+ }
+ // Try to propagate it into linked variables.
+ // It's not an error if we can't.
+ for (var linkName in jv.link) {
+ tryAssignRegister(linkName, reg);
+ }
+ return true;
+ }
+
+ NEXTVARIABLE:
+ for (var i = 0; i < sortedJunctionVariables.length; i++) {
+ var name = sortedJunctionVariables[i];
+ // It may already be assigned due to linked-variable propagation.
+ if (junctionVariables[name].reg !== null) {
+ continue NEXTVARIABLE;
+ }
+ // Try to use existing registers first.
+ var allRegs = allRegsByType[localVars[name]];
+ for (var reg in allRegs) {
+ if (tryAssignRegister(name, reg)) {
+ continue NEXTVARIABLE;
+ }
+ }
+ // They're all taken, create a new one.
+ tryAssignRegister(name, createReg(name));
+ }
+
+ // Each basic block can now be processed in turn.
+ // There may be internal-use-only variables that still need a register
+ // assigned, but they can be treated just for this block. We know
+ // that all inter-block variables are in a good state thanks to
+ // junction variable consistency.
+
+ for (var i = 0; i < blocks.length; i++) {
+ var block = blocks[i];
+ if (block.nodes.length === 0) continue;
+ var jEnter = junctions[block.entry];
+ var jExit = junctions[block.exit];
+ // Mark the point at which each input reg becomes dead.
+ // Variables alive before this point must not be assigned
+ // to that register.
+ var inputVars = {}
+ var inputDeadLoc = {};
+ var inputVarsByReg = {};
+ for (var name in jExit.live) {
+ if (!(name in block.kill)) {
+ inputVars[name] = 1;
+ var reg = junctionVariables[name].reg;
+ assert(reg !== null, 'input variable doesnt have a register');
+ inputDeadLoc[reg] = block.firstDeadLoc[name];
+ inputVarsByReg[reg] = name;
+ }
+ }
+ for (var name in block.use) {
+ if (!(name in inputVars)) {
+ inputVars[name] = 1;
+ var reg = junctionVariables[name].reg;
+ assert(reg !== null, 'input variable doesnt have a register');
+ inputDeadLoc[reg] = block.firstDeadLoc[name];
+ inputVarsByReg[reg] = name;
+ }
+ }
+ assert(setSize(setSub(inputVars, jEnter.live)) == 0);
+ // Scan through backwards, allocating registers on demand.
+ // Be careful to avoid conflicts with the input registers.
+ // We consume free registers in last-used order, which helps to
+ // eliminate "x=y" assignments that are the last use of "y".
+ var assignedRegs = {};
+ var freeRegsByType = copy(allRegsByType);
+ // Begin with all live vars assigned per the exit junction.
+ for (var name in jExit.live) {
+ var reg = junctionVariables[name].reg;
+ assert(reg !== null, 'output variable doesnt have a register');
+ assignedRegs[name] = reg;
+ delete freeRegsByType[localVars[name]][reg];
+ }
+ for (var j = 0; j < freeRegsByType.length; j++) {
+ freeRegsByType[j] = keys(freeRegsByType[j]);
+ }
+ // Scan through the nodes in sequence, modifying each node in-place
+ // and grabbing/freeing registers as needed.
+ var maybeRemoveNodes = [];
+ for (var j = block.nodes.length - 1; j >= 0; j--) {
+ var node = block.nodes[j];
+ var name = node[0] === 'assign' ? node[2][1] : node[1];
+ var allRegs = allRegsByType[localVars[name]];
+ var freeRegs = freeRegsByType[localVars[name]];
+ var reg = assignedRegs[name];
+ if (node[0] === 'name') {
+ // A use. Grab a register if it doesn't have one.
+ if (!reg) {
+ if (name in inputVars && j <= block.firstDeadLoc[name]) {
+ // Assignment to an input variable, must use pre-assigned reg.
+ reg = junctionVariables[name].reg;
+ assignedRegs[name] = reg;
+ for (var k = freeRegs.length - 1; k >= 0; k--) {
+ if (freeRegs[k] === reg) {
+ freeRegs.splice(k, 1);
+ break;
+ }
+ }
+ } else {
+ // Try to use one of the existing free registers.
+ // It must not conflict with an input register.
+ for (var k = freeRegs.length - 1; k >= 0; k--) {
+ reg = freeRegs[k];
+ // Check for conflict with input registers.
+ if (block.firstKillLoc[name] <= inputDeadLoc[reg]) {
+ if (name !== inputVarsByReg[reg]) {
+ continue;
+ }
+ }
+ // Found one!
+ assignedRegs[name] = reg;
+ freeRegs.splice(k, 1);
+ break;
+ }
+ // If we didn't find a suitable register, create a new one.
+ if (!assignedRegs[name]) {
+ reg = createReg(name);
+ assignedRegs[name] = reg;
+ }
+ }
+ }
+ node[1] = allRegs[reg];
+ } else {
+ // A kill. This frees the assigned register.
+ assert(reg, 'live variable doesnt have a reg?')
+ node[2][1] = allRegs[reg];
+ freeRegs.push(reg);
+ delete assignedRegs[name];
+ if (node[3][0] === 'name' && node[3][1] in localVars) {
+ maybeRemoveNodes.push([j, node]);
+ }
+ }
+ }
+ // If we managed to create an "x=x" assignments, remove them.
+ for (var j = 0; j < maybeRemoveNodes.length; j++) {
+ var node = maybeRemoveNodes[j][1];
+ if (node[2][1] === node[3][1]) {
+ if (block.isexpr[maybeRemoveNodes[j][0]]) {
+ morphNode(node, node[2]);
+ } else {
+ morphNode(node, ['block', []]);
+ }
+ }
+ }
+ }
+
+ // Assign registers to function params based on entry junction
+
+ var paramRegs = {}
+ if (fun[2]) {
+ for (var i = 0; i < fun[2].length; i++) {
+ var allRegs = allRegsByType[localVars[fun[2][i]]];
+ fun[2][i] = allRegs[junctionVariables[fun[2][i]].reg];
+ paramRegs[fun[2][i]] = 1;
+ }
+ }
+
+ // That's it!
+ // Re-construct the function with appropriate variable definitions.
+
+ var finalAsmData = {
+ params: {},
+ vars: {},
+ inlines: asmData.inlines,
+ ret: asmData.ret,
+ };
+ for (var i = 1; i < nextReg; i++) {
+ var reg;
+ for (var type=0; type<allRegsByType.length; type++) {
+ reg = allRegsByType[type][i];
+ if (reg) break;
+ }
+ if (!paramRegs[reg]) {
+ finalAsmData.vars[reg] = type;
+ } else {
+ finalAsmData.params[reg] = type;
+ }
+ }
+ denormalizeAsm(fun, finalAsmData);
+
+ vacuum(fun);
+
});
}
+
// Eliminator aka Expressionizer
//
// The goal of this pass is to eliminate unneeded variables (which represent one of the infinite registers in the LLVM
@@ -2322,7 +3329,7 @@ function eliminate(ast, memSafe) {
var memoryInvalidated = false;
var callsInvalidated = false;
function track(name, value, defNode) { // add a potential that has just been defined to the tracked list, we hope to eliminate it
- var usesGlobals = false, usesMemory = false, deps = {}, doesCall = false;
+ var usesGlobals = false, usesMemory = false, deps = {}, doesCall = false, hasDeps = false;
var ignoreName = false; // one-time ignorings of names, as first op in sub and call
traverse(value, function(node, type) {
if (type === 'name') {
@@ -2333,6 +3340,7 @@ function eliminate(ast, memSafe) {
}
if (!(name in potentials)) { // deps do not matter for potentials - they are defined once, so no complexity
deps[name] = 1;
+ hasDeps = true;
}
} else {
ignoreName = false;
@@ -2354,6 +3362,7 @@ function eliminate(ast, memSafe) {
usesMemory: usesMemory,
defNode: defNode,
deps: deps,
+ hasDeps: hasDeps,
doesCall: doesCall
};
globalsInvalidated = false;
@@ -2426,7 +3435,7 @@ function eliminate(ast, memSafe) {
function traverseInOrder(node, ignoreSub, ignoreName) {
if (abort) return;
//nesting++; // printErr-related
- //printErr(spaces(2*(nesting+1)) + 'trav: ' + JSON.stringify(node).substr(0, 50) + ' : ' + keys(tracked) + ' : ' + [allowTracking, ignoreSub, ignoreName]);
+ //printErr(JSON.stringify(node).substr(0, 50) + ' : ' + keys(tracked) + ' : ' + [allowTracking, ignoreSub, ignoreName]);
var type = node[0];
if (type === 'assign') {
var target = node[2];
@@ -2602,6 +3611,8 @@ function eliminate(ast, memSafe) {
traverseInOrder(node[3]);
} else if (type === 'switch') {
traverseInOrder(node[1]);
+ var originalTracked = {};
+ for (var o in tracked) originalTracked[o] = 1;
var cases = node[2];
for (var i = 0; i < cases.length; i++) {
var c = cases[i];
@@ -2610,6 +3621,15 @@ function eliminate(ast, memSafe) {
for (var j = 0; j < stats.length; j++) {
traverseInOrder(stats[j]);
}
+ // We cannot track from one switch case into another, undo all new trackings TODO: general framework here, use in if-else as well
+ for (var t in tracked) {
+ if (!(t in originalTracked)) {
+ var info = tracked[t];
+ if (info.usesGlobals || info.usesMemory || info.hasDeps) {
+ delete tracked[t];
+ }
+ }
+ }
}
} else {
if (!(type in ABORTING_ELIMINATOR_SCAN_NODES)) {
@@ -2900,6 +3920,111 @@ function minifyGlobals(ast) {
suffix = '// EXTRA_INFO:' + JSON.stringify(minified);
}
+
+function minifyLocals(ast) {
+ assert(asm)
+ assert(extraInfo && extraInfo.globals)
+
+ traverseGeneratedFunctions(ast, function(fun, type) {
+
+ // Analyse the asmjs to figure out local variable names,
+ // but operate on the original source tree so that we don't
+ // miss any global names in e.g. variable initializers.
+ var asmData = normalizeAsm(fun); denormalizeAsm(fun, asmData); // TODO: we can avoid modifying at all here - we just need a list of local vars+params
+ var newNames = {};
+ var usedNames = {};
+
+ // Find all the globals that we need to minify using
+ // pre-assigned names. Don't actually minify them yet
+ // as that might interfere with local variable names.
+ function isLocalName(name) {
+ return name in asmData.vars || name in asmData.params;
+ }
+ traverse(fun, function(node, type) {
+ if (type === 'name') {
+ var name = node[1];
+ if (!isLocalName(name)) {
+ var minified = extraInfo.globals[name];
+ if (minified){
+ newNames[name] = minified;
+ usedNames[minified] = 1;
+ }
+ }
+ }
+ });
+
+ // The first time we encounter a local name, we assign it a
+ // minified name that's not currently in use. Allocating on
+ // demand means they're processed in a predicatable order,
+ // which is very handy for testing/debugging purposes.
+ var nextMinifiedName = 0;
+ function getNextMinifiedName() {
+ var minified;
+ while (1) {
+ ensureMinifiedNames(nextMinifiedName);
+ minified = minifiedNames[nextMinifiedName++];
+ // TODO: we can probably remove !isLocalName here
+ if (!usedNames[minified] && !isLocalName(minified)) {
+ return minified;
+ }
+ }
+ }
+
+ // We can also minify loop labels, using a separate namespace
+ // to the variable declarations.
+ var newLabels = {};
+ var nextMinifiedLabel = 0;
+ function getNextMinifiedLabel() {
+ ensureMinifiedNames(nextMinifiedLabel);
+ return minifiedNames[nextMinifiedLabel++];
+ }
+
+ // Traverse and minify all names.
+ if (fun[1] in extraInfo.globals) {
+ fun[1] = extraInfo.globals[fun[1]];
+ assert(fun[1]);
+ }
+ if (fun[2]) {
+ for (var i = 0; i < fun[2].length; i++) {
+ var minified = getNextMinifiedName();
+ newNames[fun[2][i]] = minified;
+ fun[2][i] = minified;
+ }
+ }
+ traverse(fun[3], function(node, type) {
+ if (type === 'name') {
+ var name = node[1];
+ var minified = newNames[name];
+ if (minified) {
+ node[1] = minified;
+ } else if (isLocalName(name)) {
+ minified = getNextMinifiedName();
+ newNames[name] = minified;
+ node[1] = minified;
+ }
+ } else if (type === 'var') {
+ node[1].forEach(function(defn) {
+ var name = defn[0];
+ if (!(name in newNames)) {
+ newNames[name] = getNextMinifiedName();
+ }
+ defn[0] = newNames[name];
+ });
+ } else if (type === 'label') {
+ if (!newLabels[node[1]]) {
+ newLabels[node[1]] = getNextMinifiedLabel();
+ }
+ node[1] = newLabels[node[1]];
+ } else if (type === 'break' || type === 'continue') {
+ if (node[1]) {
+ node[1] = newLabels[node[1]];
+ }
+ }
+ });
+
+ });
+}
+
// Relocation pass for a shared module (for the functions part of the module)
//
// 1. Replace function names with alternate names as defined (to avoid colliding with
@@ -3400,10 +4525,10 @@ function outline(ast) {
var size = measureSize(func);
if (size <= extraInfo.sizeToOutline) {
sizeToOutline = Infinity;
- printErr(' no point in trying to reduce the size of ' + func[1] + ' which is ' + size + ' <= ' + extraInfo.sizeToOutline);
+ //printErr(' no point in trying to reduce the size of ' + func[1] + ' which is ' + size + ' <= ' + extraInfo.sizeToOutline);
} else {
sizeToOutline = Math.round(size/Math.max(2, asmData.intendedPieces--));
- printErr('trying to reduce the size of ' + func[1] + ' which is ' + size + ' (>=? ' + extraInfo.sizeToOutline + '), aim for ' + sizeToOutline);
+ //printErr('trying to reduce the size of ' + func[1] + ' which is ' + size + ' (>=? ' + extraInfo.sizeToOutline + '), aim for ' + sizeToOutline);
}
}
@@ -3628,7 +4753,7 @@ function outline(ast) {
}
}
outliningParents[newIdent] = func[1];
- printErr('performed outline ' + [func[1], newIdent, 'pre size', originalCodeSize, 'resulting size', measureSize(code), 'overhead (w/r):', setSize(setSub(codeInfo.writes, owned)), setSize(setSub(codeInfo.reads, owned)), ' owned: ', setSize(owned), ' left: ', setSize(asmData.vars), setSize(asmData.params), ' loopsDepth: ', loops]);
+ //printErr('performed outline ' + [func[1], newIdent, 'pre size', originalCodeSize, 'resulting size', measureSize(code), 'overhead (w/r):', setSize(setSub(codeInfo.writes, owned)), setSize(setSub(codeInfo.reads, owned)), ' owned: ', setSize(owned), ' left: ', setSize(asmData.vars), setSize(asmData.params), ' loopsDepth: ', loops]);
calculateThreshold(func, asmData);
return [newFunc];
}
@@ -3650,7 +4775,16 @@ function outline(ast) {
for (var i = minIndex; i < stats.length; i++) {
var stat = stats[i];
if (stat[0] == 'stat') stat = stat[1];
- if (stat[0] == 'assign' && stat[2][0] == 'name' && stat[2][1] == 'sp') minIndex = i+1; // cannot outline |sp = |
+ if (stat[0] == 'assign' && stat[2][0] == 'name' && stat[2][1] == 'sp') {
+ // cannot outline |sp = |
+ minIndex = i+1;
+ // When followed by a STACKTOP bump, preserve that too (we may need to replace it later)
+ stat = stats[i+1];
+ if (stat[0] == 'stat') stat = stat[1];
+ if (stat && stat[0] == 'assign' && stat[2][0] == 'name' && stat[2][1] == 'STACKTOP') {
+ minIndex = i+2;
+ }
+ }
}
}
}
@@ -3774,7 +4908,7 @@ function outline(ast) {
var maxTotalFunctions = Infinity; // debugging tool
- printErr('\n');
+ //printErr('\n');
var more = true;
while (more) {
@@ -3801,7 +4935,27 @@ function outline(ast) {
if ('sp' in asmData.vars) {
// find stack bump (STACKTOP = STACKTOP + X | 0) and add the extra space
var stackBumpNode = getStackBumpNode(stats);
- if (stackBumpNode) stackBumpNode[3][2][3][1] = asmData.totalStackSize;
+ if (stackBumpNode) {
+ stackBumpNode[3][2][3][1] = asmData.totalStackSize;
+ } else {
+ // sp exists, but no stack bump, so we need to add it
+ var found = false;
+ for (var i = 0; i < stats.length; i++) {
+ var stat = stats[i];
+ if (stat[0] === 'stat') stat = stat[1];
+ if (stat[0] === 'assign' && stat[2][0] === 'name' && stat[2][1] === 'sp') {
+ var newNode = ['stat', makeAssign(['name', 'STACKTOP'], ['binary', '|', ['binary', '+', ['name', 'STACKTOP'], ['num', asmData.totalStackSize]], ['num', 0]])];
+ if (i+1 < stats.length) {
+ stats.splice(i+1, 0, newNode);
+ } else {
+ stats.push(newNode);
+ }
+ found = true;
+ break;
+ }
+ }
+ assert(found);
+ }
} else if (!('sp' in asmData.params)) { // if sp is a param, then we are an outlined function, no need to add stack support for us
// add sp variable and stack bump
var index = getFirstIndexInNormalized(func, asmData);
@@ -3836,7 +4990,7 @@ function outline(ast) {
}
if (ret) {
ret.push(func);
- printErr('... resulting sizes of ' + func[1] + ' is ' + ret.map(measureSize) + '\n');
+ //printErr('... resulting sizes of ' + func[1] + ' is ' + ret.map(measureSize) + '\n');
}
}
denormalizeAsm(func, asmData);
@@ -3866,6 +5020,124 @@ function outline(ast) {
});
}
+function safeHeap(ast) {
+ function fixPtr(ptr, heap) {
+ switch (heap) {
+ case 'HEAP8': case 'HEAPU8': break;
+ case 'HEAP16': case 'HEAPU16': {
+ if (ptr[0] === 'binary') {
+ assert(ptr[1] === '>>' && ptr[3][0] === 'num' && ptr[3][1] === 1);
+ ptr = ptr[2]; // skip the shift
+ } else {
+ ptr = ['binary', '*', ptr, ['num', 2]]; // was unshifted, convert to absolute address
+ }
+ break;
+ }
+ case 'HEAP32': case 'HEAPU32': {
+ if (ptr[0] === 'binary') {
+ assert(ptr[1] === '>>' && ptr[3][0] === 'num' && ptr[3][1] === 2);
+ ptr = ptr[2]; // skip the shift
+ } else {
+ ptr = ['binary', '*', ptr, ['num', 4]]; // was unshifted, convert to absolute address
+ }
+ break;
+ }
+ case 'HEAPF32': {
+ if (ptr[0] === 'binary') {
+ assert(ptr[1] === '>>' && ptr[3][0] === 'num' && ptr[3][1] === 2);
+ ptr = ptr[2]; // skip the shift
+ } else {
+ ptr = ['binary', '*', ptr, ['num', 4]]; // was unshifted, convert to absolute address
+ }
+ break;
+ }
+ case 'HEAPF64': {
+ if (ptr[0] === 'binary') {
+ assert(ptr[1] === '>>' && ptr[3][0] === 'num' && ptr[3][1] === 3);
+ ptr = ptr[2]; // skip the shift
+ } else {
+ ptr = ['binary', '*', ptr, ['num', 8]]; // was unshifted, convert to absolute address
+ }
+ break;
+ }
+ default: throw 'bad heap ' + heap;
+ }
+ ptr = ['binary', '|', ptr, ['num', 0]];
+ return ptr;
+ }
+ traverseGenerated(ast, function(node, type) {
+ if (type === 'assign') {
+ if (node[1] === true && node[2][0] === 'sub') {
+ var heap = node[2][1][1];
+ var ptr = fixPtr(node[2][2], heap);
+ var value = node[3];
+ // SAFE_HEAP_STORE(ptr, value, bytes, isFloat)
+ switch (heap) {
+ case 'HEAP8': case 'HEAPU8': {
+ return ['call', ['name', 'SAFE_HEAP_STORE'], [ptr, makeAsmCoercion(value, ASM_INT), ['num', 1], ['num', '0']]];
+ }
+ case 'HEAP16': case 'HEAPU16': {
+ return ['call', ['name', 'SAFE_HEAP_STORE'], [ptr, makeAsmCoercion(value, ASM_INT), ['num', 2], ['num', '0']]];
+ }
+ case 'HEAP32': case 'HEAPU32': {
+ return ['call', ['name', 'SAFE_HEAP_STORE'], [ptr, makeAsmCoercion(value, ASM_INT), ['num', 4], ['num', '0']]];
+ }
+ case 'HEAPF32': {
+ return ['call', ['name', 'SAFE_HEAP_STORE'], [ptr, makeAsmCoercion(value, ASM_DOUBLE), ['num', 4], ['num', '1']]];
+ }
+ case 'HEAPF64': {
+ return ['call', ['name', 'SAFE_HEAP_STORE'], [ptr, makeAsmCoercion(value, ASM_DOUBLE), ['num', 8], ['num', '1']]];
+ }
+ default: throw 'bad heap ' + heap;
+ }
+ }
+ } else if (type === 'sub') {
+ var heap = node[1][1];
+ if (heap[0] !== 'H') return;
+ var ptr = fixPtr(node[2], heap);
+ // SAFE_HEAP_LOAD(ptr, bytes, isFloat)
+ switch (heap) {
+ case 'HEAP8': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 1], ['num', '0'], ['num', '0']]], ASM_INT);
+ }
+ case 'HEAPU8': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 1], ['num', '0'], ['num', '1']]], ASM_INT);
+ }
+ case 'HEAP16': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 2], ['num', '0'], ['num', '0']]], ASM_INT);
+ }
+ case 'HEAPU16': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 2], ['num', '0'], ['num', '1']]], ASM_INT);
+ }
+ case 'HEAP32': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 4], ['num', '0'], ['num', '0']]], ASM_INT);
+ }
+ case 'HEAPU32': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 4], ['num', '0'], ['num', '1']]], ASM_INT);
+ }
+ case 'HEAPF32': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 4], ['num', '1'], ['num', '0']]], ASM_DOUBLE);
+ }
+ case 'HEAPF64': {
+ return makeAsmCoercion(['call', ['name', 'SAFE_HEAP_LOAD'], [ptr, ['num', 8], ['num', '1'], ['num', '0']]], ASM_DOUBLE);
+ }
+ default: throw 'bad heap ' + heap;
+ }
+ }
+ });
+}
+
+function optimizeFrounds(ast) {
+ // collapse fround(fround(..)), which can happen due to elimination
+ function fix(node) {
+ traverseChildren(node, fix);
+ if (node[0] === 'call' && node[1][0] === 'name' && node[1][1] === 'Math_fround' && node[2][0][0] === 'call' && node[2][0][1][0] === 'name' && node[2][0][1][1] === 'Math_fround') {
+ return node[2][0];
+ }
+ }
+ traverseChildren(ast, fix);
+}
+
// Last pass utilities
// Change +5 to DOT$ZERO(5). We then textually change 5 to 5.0 (uglify's ast cannot differentiate between 5 and 5.0 directly)
@@ -3894,7 +5166,7 @@ function fixDotZero(js) {
function asmLastOpts(ast) {
traverseGeneratedFunctions(ast, function(fun) {
traverse(fun, function(node, type) {
- if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block') {
+ if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block' && node[2].length == 2) {
// This is at the end of the pipeline, we can assume all other optimizations are done, and we modify loops
// into shapes that might confuse other passes
@@ -3953,9 +5225,10 @@ function asmLastOpts(ast) {
// Passes table
-var minifyWhitespace = false, printMetadata = true, asm = false, last = false;
+var minifyWhitespace = false, printMetadata = true, asm = false, asmPreciseF32 = false, last = false;
var passes = {
+ // passes
dumpAst: dumpAst,
dumpSrc: dumpSrc,
unGlobalize: unGlobalize,
@@ -3967,15 +5240,22 @@ var passes = {
hoistMultiples: hoistMultiples,
loopOptimizer: loopOptimizer,
registerize: registerize,
+ registerizeHarder: registerizeHarder,
eliminate: eliminate,
eliminateMemSafe: eliminateMemSafe,
aggressiveVariableElimination: aggressiveVariableElimination,
minifyGlobals: minifyGlobals,
+ minifyLocals: minifyLocals,
relocate: relocate,
outline: outline,
+ safeHeap: safeHeap,
+ optimizeFrounds: optimizeFrounds,
+
+ // flags
minifyWhitespace: function() { minifyWhitespace = true },
noPrintMetadata: function() { printMetadata = false },
asm: function() { asm = true },
+ asmPreciseF32: function() { asmPreciseF32 = true },
last: function() { last = true },
};
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py
index 71b6f377..4821cc81 100644
--- a/tools/js_optimizer.py
+++ b/tools/js_optimizer.py
@@ -11,9 +11,9 @@ def path_from_root(*pathelems):
JS_OPTIMIZER = path_from_root('tools', 'js-optimizer.js')
-NUM_CHUNKS_PER_CORE = 1.5
-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
+NUM_CHUNKS_PER_CORE = 3
+MIN_CHUNK_SIZE = int(os.environ.get('EMCC_JSOPT_MIN_CHUNK_SIZE') or 512*1024) # configuring this is just for debugging purposes
+MAX_CHUNK_SIZE = int(os.environ.get('EMCC_JSOPT_MAX_CHUNK_SIZE') or 5*1024*1024)
WINDOWS = sys.platform.startswith('win')
@@ -26,7 +26,7 @@ class Minifier:
'''
asm.js minification support. We calculate minification of
globals here, then pass that into the parallel js-optimizer.js runners which
- during registerize perform minification of locals.
+ perform minification of locals.
'''
def __init__(self, js, js_engine):
@@ -117,9 +117,9 @@ def run_on_js(filename, passes, js_engine, jcache, source_map=False, extra_info=
know_generated = suffix or start_funcs >= 0
- minify_globals = 'registerizeAndMinify' in passes and 'asm' in passes
+ minify_globals = 'minifyNames' in passes and 'asm' in passes
if minify_globals:
- passes = map(lambda p: p if p != 'registerizeAndMinify' else 'registerize', passes)
+ passes = map(lambda p: p if p != 'minifyNames' else 'minifyLocals', passes)
start_asm = js.find(start_asm_marker)
end_asm = js.rfind(end_asm_marker)
assert (start_asm >= 0) == (end_asm >= 0)
@@ -212,6 +212,7 @@ EMSCRIPTEN_FUNCS();
chunk_size = min(MAX_CHUNK_SIZE, max(MIN_CHUNK_SIZE, total_size / intended_num_chunks))
chunks = shared.chunkify(funcs, chunk_size, jcache.get_cachename('jsopt') if jcache else None)
+ if DEBUG and len(chunks) > 0: print >> sys.stderr, 'chunkification: intended size:', chunk_size, 'num funcs:', len(funcs), 'actual num chunks:', len(chunks), 'chunk size range:', max(map(len, chunks)), '-', min(map(len, chunks))
funcs = None
if jcache:
diff --git a/tools/make_minigzip.py b/tools/make_minigzip.py
index 0c96457b..cc097a6e 100644
--- a/tools/make_minigzip.py
+++ b/tools/make_minigzip.py
@@ -9,5 +9,5 @@ zlib = shared.Building.build_library('zlib', shared.EMSCRIPTEN_TEMP_DIR, shared.
print 'Building minigzip'
-Popen(['python2', shared.EMCC, '-O2', shared.path_from_root('tests', 'zlib', 'minigzip.c'), zlib, '-o', shared.path_from_root('tools', 'minigzip.js')]).communicate()
+Popen([shared.PYTHON, shared.EMCC, '-O2', shared.path_from_root('tests', 'zlib', 'minigzip.c'), zlib, '-o', shared.path_from_root('tools', 'minigzip.js')]).communicate()
diff --git a/tools/nativize_llvm.py b/tools/nativize_llvm.py
index b327bdfc..52dfdea1 100755
--- a/tools/nativize_llvm.py
+++ b/tools/nativize_llvm.py
@@ -25,9 +25,11 @@ Popen([LLVM_OPT, filename, '-strip-debug', '-o', filename + '.clean.bc']).commun
print 'bc => s'
for params in [['-march=x86'], ['-march=x86-64']]: # try x86, then x86-64 FIXME
print 'params', params
- Popen([LLVM_COMPILER] + params + [filename + '.clean.bc', '-o', filename + '.s']).communicate()[0]
- print 's => o'
- Popen(['as', filename + '.s', '-o', filename + '.o']).communicate()[0]
+ for triple in [['-mtriple=i386-pc-linux-gnu'], []]:
+ Popen([LLVM_COMPILER] + params + triple + [filename + '.clean.bc', '-o', filename + '.s']).communicate()[0]
+ print 's => o'
+ Popen(['as', filename + '.s', '-o', filename + '.o']).communicate()[0]
+ if os.path.exists(filename + '.o'): break
if os.path.exists(filename + '.o'): break
print 'o => runnable'
Popen(['g++', path_from_root('system', 'lib', 'debugging.cpp'), filename + '.o', '-o', filename + '.run'] + ['-l' + lib for lib in libs]).communicate()[0]
diff --git a/tools/parse_unaligned.py b/tools/parse_unaligned.py
new file mode 100644
index 00000000..614ea692
--- /dev/null
+++ b/tools/parse_unaligned.py
@@ -0,0 +1,17 @@
+import os, sys
+from subprocess import Popen, PIPE, STDOUT
+
+shown = set()
+
+for line in open(sys.argv[1]).readlines():
+ try:
+ x = line.split(' in ')[1].split(':')[0]
+ #output = str([x, Popen(['c++filt', x], stdout=PIPE).communicate()])
+ output = Popen(['c++filt', x], stdout=PIPE).communicate()[0]
+ if output not in shown:
+ shown.add(output)
+ print output,
+ except:
+ pass
+
+
diff --git a/tools/shared.py b/tools/shared.py
index 2ae37f91..31f0aad9 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -270,7 +270,7 @@ if EM_POPEN_WORKAROUND and os.name == 'nt':
# Expectations
-EXPECTED_LLVM_VERSION = (3,2)
+EXPECTED_LLVM_VERSION = (3,3)
actual_clang_version = None
@@ -303,10 +303,31 @@ def check_fastcomp():
print >> sys.stderr, '==========================================================================='
print >> sys.stderr, llc_version_info,
print >> sys.stderr, '==========================================================================='
+ logging.critical('you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend')
return False
+
+ # look for a source tree under the llvm binary directory. if there is one, look for emscripten-version.txt files
+ seen = False
+ d = os.path.dirname(LLVM_COMPILER)
+ while d != os.path.dirname(d):
+ # look for version file in llvm repo, making sure not to mistake the emscripten repo for it
+ if os.path.exists(os.path.join(d, 'emscripten-version.txt')) and not os.path.abspath(d) == os.path.abspath(path_from_root()):
+ seen = True
+ llvm_version = open(os.path.join(d, 'emscripten-version.txt')).read().strip()
+ if os.path.exists(os.path.join(d, 'tools', 'clang', 'emscripten-version.txt')):
+ clang_version = open(os.path.join(d, 'tools', 'clang', 'emscripten-version.txt')).read().strip()
+ else:
+ clang_version = '?'
+ if EMSCRIPTEN_VERSION != llvm_version or EMSCRIPTEN_VERSION != clang_version:
+ logging.error('Emscripten, llvm and clang versions do not match, this is dangerous (%s, %s, %s)', EMSCRIPTEN_VERSION, llvm_version, clang_version)
+ logging.error('Make sure to use the same branch in each repo, and to be up-to-date on each. See https://github.com/kripken/emscripten/wiki/LLVM-Backend')
+ break
+ d = os.path.dirname(d)
+ if not seen:
+ logging.warning('did not see a source tree above LLVM_DIR, could not verify version numbers match')
return True
except Exception, e:
- logging.warning('cound not check fastcomp: %s' % str(e))
+ logging.warning('could not check fastcomp: %s' % str(e))
return True
EXPECTED_NODE_VERSION = (0,8,0)
@@ -345,7 +366,11 @@ def find_temp_directory():
# we re-check sanity when the settings are changed)
# We also re-check sanity and clear the cache when the version changes
-EMSCRIPTEN_VERSION = '1.9.0'
+try:
+ EMSCRIPTEN_VERSION = open(path_from_root('emscripten-version.txt')).read().strip()
+except Exception, e:
+ logging.error('cannot find emscripten version ' + str(e))
+ EMSCRIPTEN_VERSION = 'unknown'
def generate_sanity():
return EMSCRIPTEN_VERSION + '|' + get_llvm_target() + '|' + LLVM_ROOT + '|' + get_clang_version()
@@ -379,7 +404,7 @@ def check_sanity(force=False):
# some warning, mostly not fatal checks - do them even if EM_IGNORE_SANITY is on
check_llvm_version()
check_node_version()
- if os.environ.get('EMCC_FAST_COMPILER') == '1':
+ if os.environ.get('EMCC_FAST_COMPILER') != '0':
fastcomp_ok = check_fastcomp()
if os.environ.get('EM_IGNORE_SANITY'):
@@ -402,7 +427,7 @@ def check_sanity(force=False):
logging.critical('Cannot find %s, check the paths in %s' % (cmd, EM_CONFIG))
sys.exit(1)
- if os.environ.get('EMCC_FAST_COMPILER') == '1':
+ if os.environ.get('EMCC_FAST_COMPILER') != '0':
if not fastcomp_ok:
logging.critical('failing sanity checks due to previous fastcomp failure')
sys.exit(1)
@@ -602,7 +627,11 @@ except:
# Target choice. Must be synced with src/settings.js (TARGET_*)
def get_llvm_target():
- return os.environ.get('EMCC_LLVM_TARGET') or 'le32-unknown-nacl' # 'i386-pc-linux-gnu'
+ if os.environ.get('EMCC_FAST_COMPILER') == '0':
+ if not os.environ.get('EMCC_LLVM_TARGET'):
+ os.environ['EMCC_LLVM_TARGET'] = 'le32-unknown-nacl'
+ return os.environ.get('EMCC_LLVM_TARGET')
+ return os.environ.get('EMCC_LLVM_TARGET') or 'asmjs-unknown-emscripten'
LLVM_TARGET = get_llvm_target()
# COMPILER_OPTS: options passed to clang when generating bitcode for us
@@ -610,19 +639,28 @@ try:
COMPILER_OPTS # Can be set in EM_CONFIG, optionally
except:
COMPILER_OPTS = []
-COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-DEMSCRIPTEN', '-D__EMSCRIPTEN__',
- '-fno-math-errno',
- #'-fno-threadsafe-statics', # disabled due to issue 1289
+COMPILER_OPTS = COMPILER_OPTS + [#'-fno-threadsafe-statics', # disabled due to issue 1289
'-target', LLVM_TARGET]
-if LLVM_TARGET == 'le32-unknown-nacl':
- COMPILER_OPTS = filter(lambda opt: opt != '-m32', COMPILER_OPTS) # le32 target is 32-bit anyhow, no need for -m32
- COMPILER_OPTS += ['-U__native_client__', '-U__pnacl__', '-U__ELF__'] # The nacl target is originally used for Google Native Client. Emscripten is not NaCl, so remove the platform #define, when using their triple.
-
-# Remove various platform specific defines, and set little endian
-COMPILER_STANDARDIZATION_OPTS = ['-U__i386__', '-U__i386', '-Ui386', '-U__STRICT_ANSI__', '-D__IEEE_LITTLE_ENDIAN',
- '-U__SSE__', '-U__SSE_MATH__', '-U__SSE2__', '-U__SSE2_MATH__', '-U__MMX__',
- '-U__APPLE__', '-U__linux__']
+# COMPILER_STANDARDIZATION_OPTS: Options to correct various predefined macro options.
+COMPILER_STANDARDIZATION_OPTS = []
+
+# When we're not using an appropriate target triple, use -m32 to get i386, which we
+# can mostly make work.
+if LLVM_TARGET != 'asmjs-unknown-emscripten' and LLVM_TARGET != 'le32-unknown-nacl':
+ COMPILER_OPTS += ['-m32']
+ COMPILER_STANDARDIZATION_OPTS += ['-U__i386__', '-U__i386', '-Ui386',
+ '-U__SSE__', '-U__SSE_MATH__', '-U__SSE2__', '-U__SSE2_MATH__', '-U__MMX__',
+ '-U__APPLE__', '-U__linux__']
+
+# With the asmjs-unknown-emscripten target triple, clang sets up language modes
+# and predefined macros properly. When using the other targets, we have to set things
+# up manually.
+if LLVM_TARGET != 'asmjs-unknown-emscripten':
+ COMPILER_OPTS += ['-fno-math-errno']
+ COMPILER_STANDARDIZATION_OPTS += ['-D__IEEE_LITTLE_ENDIAN']
+ COMPILER_OPTS += ['-DEMSCRIPTEN', '-D__EMSCRIPTEN__', '-fno-math-errno',
+ '-U__native_client__', '-U__pnacl__', '-U__ELF__']
USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK')
@@ -642,8 +680,10 @@ if USE_EMSDK:
'-Xclang', '-isystem' + path_from_root('system', 'include', 'SDL'),
]
EMSDK_OPTS += COMPILER_STANDARDIZATION_OPTS
- if LLVM_TARGET != 'le32-unknown-nacl':
- EMSDK_CXX_OPTS = ['-nostdinc++'] # le32 target does not need -nostdinc++
+ # For temporary compatibility, treat 'le32-unknown-nacl' as 'asmjs-unknown-emscripten'.
+ if LLVM_TARGET != 'asmjs-unknown-emscripten' and \
+ LLVM_TARGET != 'le32-unknown-pnacl':
+ EMSDK_CXX_OPTS = ['-nostdinc++'] # asmjs-unknown-emscripten target does not need -nostdinc++
else:
EMSDK_CXX_OPTS = []
COMPILER_OPTS += EMSDK_OPTS
@@ -659,9 +699,12 @@ else:
try:
if 'gcparam' not in str(SPIDERMONKEY_ENGINE):
+ new_spidermonkey = SPIDERMONKEY_ENGINE
if type(SPIDERMONKEY_ENGINE) is str:
- SPIDERMONKEY_ENGINE = [SPIDERMONKEY_ENGINE]
- SPIDERMONKEY_ENGINE += ['-e', "gcparam('maxBytes', 1024*1024*1024);"] # Our very large files need lots of gc heap
+ new_spidermonkey = [SPIDERMONKEY_ENGINE]
+ new_spidermonkey += ['-e', "gcparam('maxBytes', 1024*1024*1024);"] # Our very large files need lots of gc heap
+ JS_ENGINES = map(lambda x: x if x != SPIDERMONKEY_ENGINE else new_spidermonkey, JS_ENGINES)
+ SPIDERMONKEY_ENGINE = new_spidermonkey
except NameError:
pass
@@ -803,18 +846,14 @@ class Settings2(type):
@classmethod
def apply_opt_level(self, opt_level, noisy=False):
+ if opt_level == 0 and os.environ.get('EMCC_FAST_COMPILER') == '0':
+ self.attrs['ASM_JS'] = 0 # non-fastcomp has asm off in -O1
if opt_level >= 1:
self.attrs['ASM_JS'] = 1
self.attrs['ASSERTIONS'] = 0
self.attrs['DISABLE_EXCEPTION_CATCHING'] = 1
self.attrs['RELOOP'] = 1
self.attrs['ALIASING_FUNCTION_POINTERS'] = 1
- if opt_level >= 3:
- # Aside from these, -O3 also runs closure compiler and llvm lto
- self.attrs['FORCE_ALIGNED_MEMORY'] = 1
- self.attrs['DOUBLE_MODE'] = 0
- self.attrs['PRECISE_I64_MATH'] = 0
- if noisy: logging.warning('Applying some potentially unsafe optimizations! (Use -O2 if this fails.)')
def __getattr__(self, attr):
if attr in self.attrs:
@@ -1173,7 +1212,7 @@ class Building:
#opts += ['-debug-pass=Arguments']
if get_clang_version() == '3.4' and not Settings.SIMD:
opts += ['-disable-loop-vectorization', '-disable-slp-vectorization'] # llvm 3.4 has these on by default
- logging.debug('emcc: LLVM opts: ' + str(opts))
+ logging.debug('emcc: LLVM opts: ' + ' '.join(opts))
target = out or (filename + '.opt.bc')
output = Popen([LLVM_OPT, filename] + opts + ['-o', target], stdout=PIPE).communicate()[0]
assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
@@ -1473,7 +1512,7 @@ class Building:
@staticmethod
def ensure_relooper(relooper):
if os.path.exists(relooper): return
- if os.environ.get('EMCC_FAST_COMPILER') == '1':
+ if os.environ.get('EMCC_FAST_COMPILER') != '0':
logging.debug('not building relooper to js, using it in c++ backend')
return
@@ -1548,7 +1587,7 @@ class Building:
text = m.groups(0)[0]
assert text.count('(') == 1 and text.count(')') == 1, 'must have simple expressions in emscripten_jcache_printf calls, no parens'
assert text.count('"') == 2, 'must have simple expressions in emscripten_jcache_printf calls, no strings as varargs parameters'
- if os.environ.get('EMCC_FAST_COMPILER') == '1': # fake it in fastcomp
+ if os.environ.get('EMCC_FAST_COMPILER') != '0': # fake it in fastcomp
return text.replace('emscripten_jcache_printf', 'printf')
start = text.index('(')
end = text.rindex(')')
@@ -1568,7 +1607,7 @@ JCache = cache.JCache(Cache)
chunkify = cache.chunkify
class JS:
- memory_initializer_pattern = '/\* memory initializer \*/ allocate\(([\d,\.concat\(\)\[\]\\n ]+)"i8", ALLOC_NONE, ([\dRuntime\.GLOBAL_BASEH+]+)\)'
+ memory_initializer_pattern = '/\* memory initializer \*/ allocate\(\[([\d, ]+)\], "i8", ALLOC_NONE, ([\d+Runtime\.GLOBAL_BASEH]+)\);'
no_memory_initializer_pattern = '/\* no memory initializer \*/'
memory_staticbump_pattern = 'STATICTOP = STATIC_BASE \+ (\d+);'
@@ -1652,6 +1691,75 @@ class JS:
while x % by != 0: x += 1
return x
+ INITIALIZER_CHUNK_SIZE = 10240
+
+ @staticmethod
+ def collect_initializers(src):
+ ret = []
+ max_offset = -1
+ for init in re.finditer(JS.memory_initializer_pattern, src):
+ contents = init.group(1).split(',')
+ offset = sum([int(x) if x[0] != 'R' else 0 for x in init.group(2).split('+')])
+ ret.append((offset, contents))
+ assert offset > max_offset
+ max_offset = offset
+ return ret
+
+ @staticmethod
+ def split_initializer(contents):
+ # given a memory initializer (see memory_initializer_pattern), split it up into multiple initializers to avoid long runs of zeros or a single overly-large allocator
+ ret = []
+ l = len(contents)
+ maxx = JS.INITIALIZER_CHUNK_SIZE
+ i = 0
+ start = 0
+ while 1:
+ if i - start >= maxx or (i > start and i == l):
+ #print >> sys.stderr, 'new', start, i-start
+ ret.append((start, contents[start:i]))
+ start = i
+ if i == l: break
+ if contents[i] != '0':
+ i += 1
+ else:
+ # look for a sequence of zeros
+ j = i + 1
+ while j < l and contents[j] == '0': j += 1
+ if j-i > maxx/10 or j-start >= maxx:
+ #print >> sys.stderr, 'skip', start, i-start, j-start
+ ret.append((start, contents[start:i])) # skip over the zeros starting at i and ending at j
+ start = j
+ i = j
+ return ret
+
+ @staticmethod
+ def replace_initializers(src, inits):
+ class State:
+ first = True
+ def rep(m):
+ if not State.first: return ''
+ # write out all the new initializers in place of the first old one
+ State.first = False
+ def gen_init(init):
+ offset, contents = init
+ return '/* memory initializer */ allocate([%s], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE%s);' % (
+ ','.join(contents),
+ '' if offset == 0 else ('+%d' % offset)
+ )
+ return '\n'.join(map(gen_init, inits))
+ return re.sub(JS.memory_initializer_pattern, rep, src)
+
+ @staticmethod
+ def optimize_initializer(src):
+ inits = JS.collect_initializers(src)
+ if len(inits) == 0: return None
+ assert len(inits) == 1
+ init = inits[0]
+ offset, contents = init
+ assert offset == 0 # offset 0, singleton
+ if len(contents) <= JS.INITIALIZER_CHUNK_SIZE: return None
+ return JS.replace_initializers(src, JS.split_initializer(contents))
+
# Compression of code and data for smaller downloads
class Compression:
on = False
diff --git a/tools/source-maps/sourcemapper.js b/tools/source-maps/sourcemapper.js
index 06c9a227..5193b3a8 100755
--- a/tools/source-maps/sourcemapper.js
+++ b/tools/source-maps/sourcemapper.js
@@ -153,7 +153,7 @@ function generateMap(mappings, sourceRoot, mapFileBaseName, generatedLineOffset)
function appendMappingURL(fileName, source, mapFileName) {
var lastLine = source.slice(source.lastIndexOf('\n'));
if (!/sourceMappingURL/.test(lastLine))
- fs.appendFileSync(fileName, '//@ sourceMappingURL=' + path.basename(mapFileName));
+ fs.appendFileSync(fileName, '//# sourceMappingURL=' + path.basename(mapFileName));
}
function parseArgs(args) {
diff --git a/tools/stubify_ll.py b/tools/stubify_ll.py
new file mode 100644
index 00000000..1e10ae4e
--- /dev/null
+++ b/tools/stubify_ll.py
@@ -0,0 +1,28 @@
+
+# given a file of ll and a list of names to retain, makes all other functions into stubs.
+# you can then build with -s LINKABLE=1 and see any compilation errors on the specific functions
+
+import os, sys
+
+kill = False
+
+valids = sys.argv[2].split(',')
+
+for line in open(sys.argv[1]).readlines():
+ line = line.replace('\n', '')
+ if line.startswith('define ') and line.endswith('{'):
+ ok = False
+ for valid in valids:
+ if valid in line: ok = True
+ if not ok:
+ line = line.replace('define ', 'declare ').replace(' internal ', ' ').replace(' weak ', ' ')[:-1]
+ kill = True
+ else:
+ line = line.replace(' internal ', ' ')
+ print line
+ else:
+ if not kill:
+ print line
+ else:
+ if line == '}': kill = False
+
diff --git a/tools/system_libs.py b/tools/system_libs.py
new file mode 100644
index 00000000..3723a5c3
--- /dev/null
+++ b/tools/system_libs.py
@@ -0,0 +1,397 @@
+import os, json, logging
+import shared
+from tools.shared import execute
+
+def calculate(temp_files, in_temp, stdout, stderr):
+ # Check if we need to include some libraries that we compile. (We implement libc ourselves in js, but
+ # compile a malloc implementation and stdlibc++.)
+
+ def read_symbols(path, exclude=None):
+ symbols = map(lambda line: line.strip().split(' ')[1], open(path).readlines())
+ if exclude:
+ symbols = filter(lambda symbol: symbol not in exclude, symbols)
+ return set(symbols)
+
+ lib_opts = ['-O2']
+
+ # XXX We also need to add libc symbols that use malloc, for example strdup. It's very rare to use just them and not
+ # a normal malloc symbol (like free, after calling strdup), so we haven't hit this yet, but it is possible.
+ libc_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libc.symbols'))
+ libcextra_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcextra.symbols'))
+ libcxx_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcxx', 'symbols'), exclude=libc_symbols)
+ libcxxabi_symbols = read_symbols(shared.path_from_root('system', 'lib', 'libcxxabi', 'symbols'), exclude=libc_symbols)
+ gl_symbols = read_symbols(shared.path_from_root('system', 'lib', 'gl.symbols'))
+
+ # XXX we should disable EMCC_DEBUG when building libs, just like in the relooper
+
+ def build_libc(lib_filename, files):
+ o_s = []
+ prev_cxx = os.environ.get('EMMAKEN_CXX')
+ if prev_cxx: os.environ['EMMAKEN_CXX'] = ''
+ musl_internal_includes = shared.path_from_root('system', 'lib', 'libc', 'musl', 'src', 'internal')
+ for src in files:
+ o = in_temp(os.path.basename(src) + '.o')
+ execute([shared.PYTHON, shared.EMCC, shared.path_from_root('system', 'lib', src), '-o', o, '-I', musl_internal_includes] + lib_opts, stdout=stdout, stderr=stderr)
+ o_s.append(o)
+ if prev_cxx: os.environ['EMMAKEN_CXX'] = prev_cxx
+ shared.Building.link(o_s, in_temp(lib_filename))
+ return in_temp(lib_filename)
+
+ def build_libcxx(src_dirname, lib_filename, files):
+ o_s = []
+ for src in files:
+ o = in_temp(src + '.o')
+ srcfile = shared.path_from_root(src_dirname, src)
+ execute([shared.PYTHON, shared.EMXX, srcfile, '-o', o, '-std=c++11'] + lib_opts, stdout=stdout, stderr=stderr)
+ o_s.append(o)
+ shared.Building.link(o_s, in_temp(lib_filename))
+ return in_temp(lib_filename)
+
+ # libc
+ def create_libc():
+ logging.debug(' building libc for cache')
+ libc_files = [
+ 'dlmalloc.c',
+ os.path.join('libcxx', 'new.cpp'),
+ ]
+ musl_files = [
+ ['internal', [
+ 'floatscan.c',
+ 'shgetc.c',
+ ]],
+ ['math', [
+ 'scalbn.c',
+ 'scalbnl.c',
+ ]],
+ ['stdio', [
+ '__overflow.c',
+ '__toread.c',
+ '__towrite.c',
+ '__uflow.c',
+ ]],
+ ['stdlib', [
+ 'atof.c',
+ 'strtod.c',
+ ]],
+ ['string', [
+ 'memcmp.c',
+ 'strcasecmp.c',
+ 'strcmp.c',
+ 'strncasecmp.c',
+ 'strncmp.c',
+ ]]
+ ]
+ for directory, sources in musl_files:
+ libc_files += [os.path.join('libc', 'musl', 'src', directory, source) for source in sources]
+ return build_libc('libc.bc', libc_files)
+
+ def apply_libc(need):
+ # libc needs some sign correction. # If we are in mode 0, switch to 2. We will add our lines
+ try:
+ if shared.Settings.CORRECT_SIGNS == 0: raise Exception('we need to change to 2')
+ except: # we fail if equal to 0 - so we need to switch to 2 - or if CORRECT_SIGNS is not even in Settings
+ shared.Settings.CORRECT_SIGNS = 2
+ if shared.Settings.CORRECT_SIGNS == 2:
+ shared.Settings.CORRECT_SIGNS_LINES = [shared.path_from_root('src', 'dlmalloc.c') + ':' + str(i+4) for i in [4816, 4191, 4246, 4199, 4205, 4235, 4227]]
+ # If we are in mode 1, we are correcting everything anyhow. If we are in mode 3, we will be corrected
+ # so all is well anyhow too.
+ return True
+
+ # libcextra
+ def create_libcextra():
+ logging.debug('building libcextra for cache')
+ musl_files = [
+ ['ctype', [
+ 'iswalnum.c',
+ 'iswalpha.c',
+ 'iswblank.c',
+ 'iswcntrl.c',
+ 'iswctype.c',
+ 'iswdigit.c',
+ 'iswgraph.c',
+ 'iswlower.c',
+ 'iswprint.c',
+ 'iswpunct.c',
+ 'iswspace.c',
+ 'iswupper.c',
+ 'iswxdigit.c',
+ 'towctrans.c',
+ 'wcswidth.c',
+ 'wctrans.c',
+ 'wcwidth.c',
+ ]],
+ ['internal', [
+ 'intscan.c',
+ ]],
+ ['legacy', [
+ 'err.c',
+ ]],
+ ['locale', [
+ 'iconv.c',
+ 'iswalnum_l.c',
+ 'iswalpha_l.c',
+ 'iswblank_l.c',
+ 'iswcntrl_l.c',
+ 'iswctype_l.c',
+ 'iswdigit_l.c',
+ 'iswgraph_l.c',
+ 'iswlower_l.c',
+ 'iswprint_l.c',
+ 'iswpunct_l.c',
+ 'iswspace_l.c',
+ 'iswupper_l.c',
+ 'iswxdigit_l.c',
+ 'strcoll.c',
+ 'strcasecmp_l.c',
+ 'strfmon.c',
+ 'strncasecmp_l.c',
+ 'strxfrm.c',
+ 'towctrans_l.c',
+ 'towlower_l.c',
+ 'towupper_l.c',
+ 'wcscoll.c',
+ 'wcscoll_l.c',
+ 'wcsxfrm.c',
+ 'wcsxfrm_l.c',
+ 'wctrans_l.c',
+ 'wctype_l.c',
+ ]],
+ ['math', [
+ '__cos.c',
+ '__cosdf.c',
+ '__sin.c',
+ '__sindf.c',
+ 'ilogb.c',
+ 'ilogbf.c',
+ 'ilogbl.c',
+ 'ldexp.c',
+ 'ldexpf.c',
+ 'ldexpl.c',
+ 'logb.c',
+ 'logbf.c',
+ 'logbl.c',
+ 'lgamma.c',
+ 'lgamma_r.c',
+ 'lgammaf.c',
+ 'lgammaf_r.c',
+ 'lgammal.c',
+ 'scalbnf.c',
+ 'signgam.c',
+ 'tgamma.c',
+ 'tgammaf.c',
+ 'tgammal.c'
+ ]],
+ ['misc', [
+ 'getopt.c',
+ 'getopt_long.c',
+ ]],
+ ['multibyte', [
+ 'btowc.c',
+ 'internal.c',
+ 'mblen.c',
+ 'mbrlen.c',
+ 'mbrtowc.c',
+ 'mbsinit.c',
+ 'mbsnrtowcs.c',
+ 'mbsrtowcs.c',
+ 'mbstowcs.c',
+ 'mbtowc.c',
+ 'wcrtomb.c',
+ 'wcsnrtombs.c',
+ 'wcsrtombs.c',
+ 'wcstombs.c',
+ 'wctob.c',
+ 'wctomb.c',
+ ]],
+ ['regex', [
+ 'fnmatch.c',
+ 'regcomp.c',
+ 'regerror.c',
+ 'regexec.c',
+ 'tre-mem.c',
+ ]],
+ ['stdio', [
+ 'fwprintf.c',
+ 'swprintf.c',
+ 'vfwprintf.c',
+ 'vswprintf.c',
+ 'vwprintf.c',
+ 'wprintf.c',
+ 'fputwc.c',
+ 'fputws.c',
+ ]],
+ ['stdlib', [
+ 'ecvt.c',
+ 'fcvt.c',
+ 'gcvt.c',
+ 'wcstod.c',
+ 'wcstol.c',
+ ]],
+ ['string', [
+ 'memccpy.c',
+ 'memmem.c',
+ 'mempcpy.c',
+ 'memrchr.c',
+ 'strcasestr.c',
+ 'strchrnul.c',
+ 'strlcat.c',
+ 'strlcpy.c',
+ 'strsep.c',
+ 'strverscmp.c',
+ 'wcpcpy.c',
+ 'wcpncpy.c',
+ 'wcscasecmp.c',
+ 'wcscasecmp_l.c',
+ 'wcscat.c',
+ 'wcschr.c',
+ 'wcscmp.c',
+ 'wcscpy.c',
+ 'wcscspn.c',
+ 'wcsdup.c',
+ 'wcslen.c',
+ 'wcsncasecmp.c',
+ 'wcsncasecmp_l.c',
+ 'wcsncat.c',
+ 'wcsncmp.c',
+ 'wcsncpy.c',
+ 'wcsnlen.c',
+ 'wcspbrk.c',
+ 'wcsrchr.c',
+ 'wcsspn.c',
+ 'wcsstr.c',
+ 'wcstok.c',
+ 'wcswcs.c',
+ 'wmemchr.c',
+ 'wmemcmp.c',
+ 'wmemcpy.c',
+ 'wmemmove.c',
+ 'wmemset.c',
+ ]]
+ ]
+ libcextra_files = []
+ for directory, sources in musl_files:
+ libcextra_files += [os.path.join('libc', 'musl', 'src', directory, source) for source in sources]
+ return build_libc('libcextra.bc', libcextra_files)
+
+ # libcxx
+ def create_libcxx():
+ logging.debug('building libcxx for cache')
+ libcxx_files = [
+ 'algorithm.cpp',
+ 'condition_variable.cpp',
+ 'future.cpp',
+ 'iostream.cpp',
+ 'memory.cpp',
+ 'random.cpp',
+ 'stdexcept.cpp',
+ 'system_error.cpp',
+ 'utility.cpp',
+ 'bind.cpp',
+ 'debug.cpp',
+ 'hash.cpp',
+ 'mutex.cpp',
+ 'string.cpp',
+ 'thread.cpp',
+ 'valarray.cpp',
+ 'chrono.cpp',
+ 'exception.cpp',
+ 'ios.cpp',
+ 'locale.cpp',
+ 'regex.cpp',
+ 'strstream.cpp'
+ ]
+ return build_libcxx(os.path.join('system', 'lib', 'libcxx'), 'libcxx.bc', libcxx_files)
+
+ def apply_libcxx(need):
+ assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++ with QUANTUM_SIZE == 1'
+ # libcxx might need corrections, so turn them all on. TODO: check which are actually needed
+ shared.Settings.CORRECT_SIGNS = shared.Settings.CORRECT_OVERFLOWS = shared.Settings.CORRECT_ROUNDINGS = 1
+ #logging.info('using libcxx turns on CORRECT_* options')
+ return True
+
+ # libcxxabi - just for dynamic_cast for now
+ def create_libcxxabi():
+ logging.debug('building libcxxabi for cache')
+ libcxxabi_files = [
+ 'typeinfo.cpp',
+ 'private_typeinfo.cpp'
+ ]
+ return build_libcxx(os.path.join('system', 'lib', 'libcxxabi', 'src'), 'libcxxabi.bc', libcxxabi_files)
+
+ def apply_libcxxabi(need):
+ assert shared.Settings.QUANTUM_SIZE == 4, 'We do not support libc++abi with QUANTUM_SIZE == 1'
+ #logging.info('using libcxxabi, this may need CORRECT_* options')
+ #shared.Settings.CORRECT_SIGNS = shared.Settings.CORRECT_OVERFLOWS = shared.Settings.CORRECT_ROUNDINGS = 1
+ return True
+
+ # gl
+ def create_gl():
+ prev_cxx = os.environ.get('EMMAKEN_CXX')
+ if prev_cxx: os.environ['EMMAKEN_CXX'] = ''
+ o = in_temp('gl.o')
+ execute([shared.PYTHON, shared.EMCC, shared.path_from_root('system', 'lib', 'gl.c'), '-o', o])
+ if prev_cxx: os.environ['EMMAKEN_CXX'] = prev_cxx
+ return o
+
+ # Settings this in the environment will avoid checking dependencies and make building big projects a little faster
+ # 1 means include everything; otherwise it can be the name of a lib (libcxx, etc.)
+ force = os.environ.get('EMCC_FORCE_STDLIBS')
+ force_all = force == '1'
+
+ # Scan symbols
+ symbolses = map(lambda temp_file: shared.Building.llvm_nm(temp_file), temp_files)
+
+ # Add in some hacks for js libraries. If a js lib depends on a symbol provided by a C library, it must be
+ # added to here, because our deps go only one way (each library here is checked, then we check the next
+ # in order - libcxx, libcxextra, etc. - and then we run the JS compiler and provide extra symbols from
+ # library*.js files. But we cannot then go back to the C libraries if a new dep was added!
+ # TODO: Move all __deps from src/library*.js to deps_info.json, and use that single source of info
+ # both here and in the JS compiler.
+ deps_info = json.loads(open(shared.path_from_root('src', 'deps_info.json')).read())
+ def add_back_deps(need):
+ for ident, deps in deps_info.iteritems():
+ if ident in need.undefs:
+ for dep in deps:
+ need.undefs.add(dep)
+ shared.Settings.EXPORTED_FUNCTIONS.append('_' + dep)
+ for symbols in symbolses:
+ add_back_deps(symbols)
+
+ all_needed = set()
+ for symbols in symbolses:
+ all_needed.update(symbols.undefs)
+ for symbols in symbolses:
+ all_needed.difference_update(symbols.defs)
+
+ # Go over libraries to figure out which we must include
+ # If we have libcxx, we must force inclusion of libc, since libcxx uses new internally. Note: this is kind of hacky.
+ ret = []
+ has = need = None
+ for name, create, apply_, library_symbols in [('libcxx', create_libcxx, apply_libcxx, libcxx_symbols),
+ ('libcextra', create_libcextra, lambda x: True, libcextra_symbols),
+ ('libcxxabi', create_libcxxabi, apply_libcxxabi, libcxxabi_symbols),
+ ('gl', create_gl, lambda x: True, gl_symbols),
+ ('libc', create_libc, apply_libc, libc_symbols)]:
+ force_this = force_all or force == name
+ if not force_this:
+ need = set()
+ has = set()
+ for symbols in symbolses:
+ for library_symbol in library_symbols:
+ if library_symbol in symbols.undefs:
+ need.add(library_symbol)
+ if library_symbol in symbols.defs:
+ has.add(library_symbol)
+ for haz in has: # remove symbols that are supplied by another of the inputs
+ if haz in need:
+ need.remove(haz)
+ if shared.Settings.VERBOSE: logging.debug('considering %s: we need %s and have %s' % (name, str(need), str(has)))
+ if force_this or len(need) > 0:
+ force_all = True
+ if apply_(need):
+ # We need to build and link the library in
+ logging.debug('including %s' % name)
+ libfile = shared.Cache.get(name, create)
+ ret.append(libfile)
+ return ret
+
diff --git a/tools/test-js-optimizer-asm-last-output.js b/tools/test-js-optimizer-asm-last-output.js
index f850b18f..1b9ac585 100644
--- a/tools/test-js-optimizer-asm-last-output.js
+++ b/tools/test-js-optimizer-asm-last-output.js
@@ -39,7 +39,7 @@ function looop() {
} while (!condition());
do {
do_it();
- } while (a <= b);
+ } while (!(a > b));
do {
do_it();
} while (x());
diff --git a/tools/test-js-optimizer-asm-outline1-output.js b/tools/test-js-optimizer-asm-outline1-output.js
index 27f93d8a..c4792c51 100644
--- a/tools/test-js-optimizer-asm-outline1-output.js
+++ b/tools/test-js-optimizer-asm-outline1-output.js
@@ -423,6 +423,32 @@ function switchh2() {
}
STACKTOP = sp;
}
+function stackSet(x1, x2, x3, x4, x5) {
+ x1 = x1 | 0;
+ x2 = x2 | 0;
+ x3 = x3 | 0;
+ x4 = x4 | 0;
+ x5 = x5 | 0;
+ var sp = 0;
+ sp = STACKTOP;
+ STACKTOP = STACKTOP + 282 | 0;
+ c(1);
+ c(2);
+ c(3);
+ c(4);
+ c(5);
+ c(6);
+ c(7);
+ c(8);
+ c(9);
+ c(10);
+ HEAP32[sp + 66 >> 2] = 0;
+ HEAP32[sp + 70 >> 2] = 0;
+ stackSet$1(sp);
+ HEAP32[sp + 58 >> 2] = 0;
+ HEAP32[sp + 62 >> 2] = 0;
+ stackSet$0(sp);
+}
function lin$0(sp) {
sp = sp | 0;
c(14);
@@ -926,4 +952,26 @@ function switchh2$2(sp) {
} while (0);
HEAP32[sp + 8 >> 2] = helper$0;
}
+function stackSet$0(sp) {
+ sp = sp | 0;
+ c(7);
+ c(8);
+ c(9);
+ c(10);
+ c(11);
+ c(12);
+ c(13);
+}
+function stackSet$1(sp) {
+ sp = sp | 0;
+ c(11);
+ c(12);
+ c(13);
+ c(1);
+ c(2);
+ c(3);
+ c(4);
+ c(5);
+ c(6);
+}
diff --git a/tools/test-js-optimizer-asm-outline1.js b/tools/test-js-optimizer-asm-outline1.js
index b7ec9011..f640d11d 100644
--- a/tools/test-js-optimizer-asm-outline1.js
+++ b/tools/test-js-optimizer-asm-outline1.js
@@ -347,5 +347,42 @@ function switchh2() {
print(9);
}
}
+function stackSet(x1, x2, x3, x4, x5) {
+ x1 = x1 | 0;
+ x2 = x2 | 0;
+ x3 = x3 | 0;
+ x4 = x4 | 0;
+ x5 = x5 | 0;
+ var sp = 0, a = 0, b = 0, cc = 0, d = 0, e = 0, f = 0, g = 0;
+ var sp1 = 0, a1 = 0, b1 = 0, c1 = 0, d1 = 0, e1 = 0, f1 = 0, g1 = 0;
+ sp = STACKTOP;
+ STACKTOP = STACKTOP + 10 | 0;
+ c(1);
+ c(2);
+ c(3);
+ c(4);
+ c(5);
+ c(6);
+ c(7);
+ c(8);
+ c(9);
+ c(10);
+ c(11);
+ c(12);
+ c(13);
+ c(1);
+ c(2);
+ c(3);
+ c(4);
+ c(5);
+ c(6);
+ c(7);
+ c(8);
+ c(9);
+ c(10);
+ c(11);
+ c(12);
+ c(13);
+}
// EMSCRIPTEN_GENERATED_FUNCTIONS
// EXTRA_INFO: { "sizeToOutline": 30, "allowCostlyOutlines": 1 }
diff --git a/tools/test-js-optimizer-asm-outline2-output.js b/tools/test-js-optimizer-asm-outline2-output.js
index 2658fda0..923cd7df 100644
--- a/tools/test-js-optimizer-asm-outline2-output.js
+++ b/tools/test-js-optimizer-asm-outline2-output.js
@@ -25,6 +25,7 @@ function _free($mem) {
$mem = $mem | 0;
var $5 = 0, $10 = 0, $16 = 0, $21 = 0, $25 = 0, $26 = 0, $psize_0 = 0, $p_0 = 0, $189 = 0, $194 = 0, sp = 0, helper$0 = 0;
sp = STACKTOP;
+ STACKTOP = STACKTOP + 864 | 0;
if (($mem | 0) == 0) {
STACKTOP = sp;
return;
diff --git a/tools/test-js-optimizer-asm-pre-f32.js b/tools/test-js-optimizer-asm-pre-f32.js
new file mode 100644
index 00000000..5471deeb
--- /dev/null
+++ b/tools/test-js-optimizer-asm-pre-f32.js
@@ -0,0 +1,17 @@
+function badf() {
+ var $9 = Math_fround(0);
+ $9 = (HEAP32[tempDoublePtr>>2]=$8,Math_fround(HEAPF32[tempDoublePtr>>2]));
+ HEAPF32[$gep23_asptr>>2] = $9;
+}
+function badf2() {
+ var $9 = 0;
+ $9 = (HEAPF32[tempDoublePtr>>2]=$8,HEAP32[tempDoublePtr>>2]|0);
+ HEAP32[$gep23_asptr>>2] = $9;
+}
+function dupe() {
+ x = Math_fround(x);
+ x = Math_fround(Math_fround(x));
+ x = Math_fround(Math_fround(Math_fround(x)));
+ x = Math_fround(Math_fround(Math_fround(Math_fround(x))));
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["badf", "badf2", "dupe"]
diff --git a/tools/test-js-optimizer-asm-pre-output-f32.js b/tools/test-js-optimizer-asm-pre-output-f32.js
new file mode 100644
index 00000000..19059619
--- /dev/null
+++ b/tools/test-js-optimizer-asm-pre-output-f32.js
@@ -0,0 +1,17 @@
+function badf() {
+ var $9 = 0;
+ $9 = $8 | 0;
+ HEAP32[$gep23_asptr >> 2] = $9;
+}
+function badf2() {
+ var $9 = Math_fround(0);
+ $9 = Math_fround($8);
+ HEAPF32[$gep23_asptr >> 2] = $9;
+}
+function dupe() {
+ x = Math_fround(x);
+ x = Math_fround(x);
+ x = Math_fround(x);
+ x = Math_fround(x);
+}
+
diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js
index 0fa81050..c9746e78 100644
--- a/tools/test-js-optimizer-asm-pre-output.js
+++ b/tools/test-js-optimizer-asm-pre-output.js
@@ -519,4 +519,23 @@ function _main($argc, $argv) {
STACKTOP = __stackBase__;
return $_0 | 0;
}
+function badf() {
+ var $9 = 0;
+ $9 = $8 | 0;
+ HEAP32[$gep23_asptr >> 2] = $9;
+}
+function badf2() {
+ var $9 = +0;
+ $9 = +$8;
+ HEAPF32[$gep23_asptr >> 2] = $9;
+}
+function fcomp() {
+ if (!($y < $x)) return 5;
+ if (!(5 < $x)) return 5;
+ if (!($y < 5)) return 5;
+ if (($a | 0) >= ($b | 0)) return 5;
+ if (($a | 0) >= 5) return 5;
+ if (5 >= ($b | 0)) return 5;
+ if (5 >= 5) return 5;
+}
diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js
index dadeef53..00ebd7d7 100644
--- a/tools/test-js-optimizer-asm-pre.js
+++ b/tools/test-js-optimizer-asm-pre.js
@@ -530,4 +530,24 @@ function _main($argc, $argv) {
STACKTOP = __stackBase__;
return $_0 | 0;
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "rett", "ret2t", "retf", "i32_8", "tempDoublePtr", "boxx", "_main"]
+function badf() {
+ var $9 = Math_fround(0);
+ $9 = (HEAP32[tempDoublePtr>>2]=$8,Math_fround(HEAPF32[tempDoublePtr>>2]));
+ HEAPF32[$gep23_asptr>>2] = $9;
+}
+function badf2() {
+ var $9 = 0;
+ $9 = (HEAPF32[tempDoublePtr>>2]=$8,HEAP32[tempDoublePtr>>2]|0);
+ HEAP32[$gep23_asptr>>2] = $9;
+}
+function fcomp() {
+ // de-morgan's laws are not valid on floats, due to NaNs >:(
+ if (!($y < $x)) return 5;
+ if (!(5 < $x)) return 5;
+ if (!($y < 5)) return 5;
+ if (!(($a|0) < ($b|0))) return 5;
+ if (!(($a|0) < 5)) return 5;
+ if (!(5 < ($b|0))) return 5;
+ if (!(5 < 5)) return 5;
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "rett", "ret2t", "retf", "i32_8", "tempDoublePtr", "boxx", "_main", "badf", "badf2", "fcomp"]
diff --git a/tools/test-js-optimizer-asm-regs-harder-output.js b/tools/test-js-optimizer-asm-regs-harder-output.js
new file mode 100644
index 00000000..e1df42cb
--- /dev/null
+++ b/tools/test-js-optimizer-asm-regs-harder-output.js
@@ -0,0 +1,132 @@
+function asm(d1, i2) {
+ d1 = +d1;
+ i2 = i2 | 0;
+ i2 = d1 + d1 | 0;
+ d1 = d(Math_max(10, Math_min(5, f())));
+ i2 = i2 + 2 | 0;
+ print(i2);
+ d1 = d1 * 5;
+ return d1;
+}
+function _doit(i3, i2, i1) {
+ i3 = i3 | 0;
+ i2 = i2 | 0;
+ i1 = i1 | 0;
+ i3 = STACKTOP;
+ _printf(__str | 0, (tempInt = STACKTOP, STACKTOP = STACKTOP + 8 | 0, HEAP32[(tempInt & 16777215) >> 2] = i2, HEAP32[(tempInt + 4 & 16777215) >> 2] = i1, tempInt));
+ STACKTOP = i3;
+ return 0 | 0;
+}
+function stackRestore(i1) {
+ i1 = i1 | 0;
+ STACKTOP = i1;
+}
+function switchey(d1, i2) {
+ d1 = +d1;
+ i2 = i2 | 0;
+ switch (d1 | 0) {
+ case 0:
+ i2 = d1 + d1 | 0;
+ d1 = d(Math_max(10, Math_min(5, f())));
+ i2 = i2 + 2 | 0;
+ print(i2);
+ d1 = d1 * 5;
+ return d1;
+ case 1:
+ return 20;
+ }
+}
+function switchey2() {
+ var i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, d6 = +0, d7 = +0;
+ i2 = STACKTOP;
+ STACKTOP = STACKTOP + 8 | 0;
+ i3 = 1;
+ while (1) switch (i3 | 0) {
+ case 1:
+ i1 = i2 | 0;
+ __ZN6RandomC1Ev(i1);
+ i4 = 0;
+ i5 = 0;
+ i3 = 2;
+ break;
+ case 2:
+ d7 = +__ZN6Random3getEf(8, +1);
+ d6 = +__ZN6Random3getEf(i1, +1);
+ _printf(24, (tempInt = STACKTOP, STACKTOP = STACKTOP + 16 | 0, HEAPF64[CHECK_ALIGN_8(tempInt | 0) >> 3] = d7, HEAPF64[CHECK_ALIGN_8(tempInt + 8 | 0) >> 3] = d6, tempInt) | 0);
+ i5 = (d7 != d6 & 1) + i5 | 0;
+ i4 = i4 + 1 | 0;
+ if ((i4 | 0) < 100) {
+ i3 = 2;
+ break;
+ } else {
+ i3 = 3;
+ break;
+ }
+ case 3:
+ _printf(16, (tempInt = STACKTOP, STACKTOP = STACKTOP + 8 | 0, HEAP32[CHECK_ALIGN_4(tempInt | 0) >> 2] = i5, tempInt) | 0);
+ STACKTOP = i2;
+ return 0;
+ }
+ return 0;
+}
+function iffey() {
+ var i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, d6 = +0, d7 = +0;
+ i2 = STACKTOP;
+ STACKTOP = STACKTOP + 8 | 0;
+ i4 = 1;
+ while (1) {
+ if (i4 | 0) {
+ i1 = i2 | 0;
+ __ZN6RandomC1Ev(i1);
+ i3 = 0;
+ i5 = 0;
+ i4 = 2;
+ } else {
+ d7 = +__ZN6Random3getEf(8, +1);
+ d6 = +__ZN6Random3getEf(i1, +1);
+ _printf(24, (tempInt = STACKTOP, STACKTOP = STACKTOP + 16 | 0, HEAPF64[CHECK_ALIGN_8(tempInt | 0) >> 3] = d7, HEAPF64[CHECK_ALIGN_8(tempInt + 8 | 0) >> 3] = d6, tempInt) | 0);
+ i5 = (d7 != d6 & 1) + i5 | 0;
+ i3 = i3 + 1 | 0;
+ if ((i3 | 0) < 100) {
+ i4 = 2;
+ } else {
+ return 10;
+ }
+ }
+ }
+ return 0;
+}
+function labelledJump(i3) {
+ i3 = i3 | 0;
+ var i1 = 0, i2 = 0;
+ i2 = 2;
+ if (i3) {
+ i2 = 17;
+ i1 = 1;
+ }
+ if (i1 == 1) {
+ i3 = i2 + 1;
+ } else {
+ i3 = i2 + 1;
+ }
+ return i3;
+}
+function linkedVars() {
+ var i1 = 0, i2 = 0;
+ while (1) {
+ i2 = 9;
+ i1 = 5;
+ while (i2 > 0 || i1 > 0) {
+ if (i2 < i1) {
+ i2 = i2 - 1;
+ } else {
+ i1 = i1 - 1;
+ }
+ }
+ if (i2 < i1) {
+ break;
+ }
+ }
+ return i2 + i1;
+}
+
diff --git a/tools/test-js-optimizer-asm-regs-harder.js b/tools/test-js-optimizer-asm-regs-harder.js
new file mode 100644
index 00000000..0231a215
--- /dev/null
+++ b/tools/test-js-optimizer-asm-regs-harder.js
@@ -0,0 +1,153 @@
+function asm(x, y) {
+ x = +x;
+ y = y | 0;
+ var int1 = 0, int2 = 0; // do not mix the types!
+ var double1 = +0, double2 = +0;
+ int1 = (x+x)|0;
+ double1 = d(Math_max(10, Math_min(5, f())));
+ int2 = (int1+2)|0;
+ print(int2);
+ double2 = double1*5;
+ return double2;
+}
+function _doit($x, $y$0, $y$1) {
+ $x = $x | 0;
+ $y$0 = $y$0 | 0;
+ $y$1 = $y$1 | 0;
+ var __stackBase__ = 0;
+ __stackBase__ = STACKTOP;
+ _printf(__str | 0, (tempInt = STACKTOP, STACKTOP = STACKTOP + 8 | 0, HEAP32[(tempInt & 16777215) >> 2] = $y$0, HEAP32[(tempInt + 4 & 16777215) >> 2] = $y$1, tempInt));
+ STACKTOP = __stackBase__;
+ return 0 | 0;
+}
+function stackRestore(top) {
+ top = top|0;
+ STACKTOP = top;
+}
+function switchey(x, y) {
+ x = +x;
+ y = y | 0;
+ var int1 = 0, int2 = 0; // do not mix the types!
+ var double1 = +0, double2 = +0;
+ switch(x|0) {
+ case 0:
+ int1 = (x+x)|0;
+ double1 = d(Math_max(10, Math_min(5, f())));
+ int2 = (int1+2)|0;
+ print(int2);
+ double2 = double1*5;
+ return double2;
+ case 1:
+ return 20;
+ }
+}
+function switchey2() {
+ var $rng2 = 0, $count_06 = 0, $i_05 = 0, $2 = +0, $3 = +0, $count_1 = 0, $9 = 0, label = 0, __stackBase__ = 0;
+ __stackBase__ = STACKTOP;
+ STACKTOP = STACKTOP + 8 | 0;
+ label = 1;
+ while (1) switch (label | 0) {
+ case 1:
+ $rng2 = __stackBase__ | 0;
+ __ZN6RandomC1Ev($rng2);
+ $i_05 = 0;
+ $count_06 = 0;
+ label = 2;
+ break;
+ case 2:
+ $2 = +__ZN6Random3getEf(8, +1);
+ $3 = +__ZN6Random3getEf($rng2, +1);
+ _printf(24, (tempInt = STACKTOP, STACKTOP = STACKTOP + 16 | 0, HEAPF64[CHECK_ALIGN_8(tempInt | 0) >> 3] = $2, HEAPF64[CHECK_ALIGN_8(tempInt + 8 | 0) >> 3] = $3, tempInt) | 0);
+ $count_1 = ($2 != $3 & 1) + $count_06 | 0;
+ $9 = $i_05 + 1 | 0;
+ if (($9 | 0) < 100) {
+ $i_05 = $9;
+ $count_06 = $count_1;
+ label = 2;
+ break;
+ } else {
+ label = 3;
+ break;
+ }
+ case 3:
+ _printf(16, (tempInt = STACKTOP, STACKTOP = STACKTOP + 8 | 0, HEAP32[CHECK_ALIGN_4(tempInt | 0) >> 2] = $count_1, tempInt) | 0);
+ STACKTOP = __stackBase__;
+ return 0;
+ }
+ return 0;
+}
+function iffey() {
+ var $rng2 = 0, $count_06 = 0, $i_05 = 0, $2 = +0, $3 = +0, $count_1 = 0, $9 = 0, label = 0, __stackBase__ = 0;
+ __stackBase__ = STACKTOP;
+ STACKTOP = STACKTOP + 8 | 0;
+ label = 1;
+ while (1) {
+ if (label | 0) {
+ $rng2 = __stackBase__ | 0;
+ __ZN6RandomC1Ev($rng2);
+ $i_05 = 0;
+ $count_06 = 0;
+ label = 2;
+ } else {
+ $2 = +__ZN6Random3getEf(8, +1);
+ $3 = +__ZN6Random3getEf($rng2, +1);
+ _printf(24, (tempInt = STACKTOP, STACKTOP = STACKTOP + 16 | 0, HEAPF64[CHECK_ALIGN_8(tempInt | 0) >> 3] = $2, HEAPF64[CHECK_ALIGN_8(tempInt + 8 | 0) >> 3] = $3, tempInt) | 0);
+ $count_1 = ($2 != $3 & 1) + $count_06 | 0;
+ $9 = $i_05 + 1 | 0;
+ if (($9 | 0) < 100) {
+ $i_05 = $9;
+ $count_06 = $count_1;
+ label = 2;
+ } else {
+ label = 3;
+ return 10;
+ }
+ }
+ }
+ return 0;
+}
+function labelledJump(x) {
+ x = x | 0;
+ var label = 0
+ // y and z don't conflict, but only if you know about labelled jumps.
+ var y = 0, z = 0;
+ y = 2;
+ if (x) {
+ z = 17;
+ label = 1;
+ }
+ if (label == 1) {
+ x = z + 1;
+ } else {
+ x = y + 1;
+ }
+ return x;
+}
+function linkedVars() {
+ var outer1 = 0, outer2 = 0;
+ var inner1_0 = 0, inner1_1 = 0, inner2_0 = 0, inner2_1 = 0;
+ while (1) {
+ outer1 = 9;
+ outer2 = 5;
+ while (outer1 > 0 || outer2 > 0) {
+ // All these copy assignment should be eliminated by var sharing.
+ inner1_0 = outer1;
+ inner2_0 = outer2;
+ if (inner1_0 < inner2_0) {
+ inner1_1 = inner1_0 - 1;
+ inner2_1 = inner2_0;
+ } else {
+ inner1_1 = inner1_0;
+ inner2_1 = inner2_0 - 1;
+ }
+ outer1 = inner1_1;
+ outer2 = inner2_1;
+ }
+ if (outer1 < outer2) {
+ break;
+ }
+ }
+ return outer1 + outer2;
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["asm", "_doit", "stackRestore", "switchey", "switchey2", "iffey", "labelledJump", "linkedVars']
+
diff --git a/tools/test-js-optimizer-asm-regs-min-output.js b/tools/test-js-optimizer-asm-regs-min-output.js
index 3955e48a..748b8e0a 100644
--- a/tools/test-js-optimizer-asm-regs-min-output.js
+++ b/tools/test-js-optimizer-asm-regs-min-output.js
@@ -33,4 +33,9 @@ function cl(b) {
a(c);
i1(b);
}
+function cl(b) {
+ b = b | 0;
+ b = b + 4;
+ a(b);
+}
diff --git a/tools/test-js-optimizer-asm-regs-min.js b/tools/test-js-optimizer-asm-regs-min.js
index a5b9427e..65d8d429 100644
--- a/tools/test-js-optimizer-asm-regs-min.js
+++ b/tools/test-js-optimizer-asm-regs-min.js
@@ -33,5 +33,10 @@ function collideLocal(i1) {
aGlobal(a); // multiple collisions, a and i1
bGlobal(i1);
}
+function collideLocal(i1) {
+ i1 = i1 | 0;
+ i1 = i1 + 4; // statement is of similar shape to a param coercion
+ aGlobal(i1);
+}
// EMSCRIPTEN_GENERATED_FUNCTIONS
// EXTRA_INFO: { "names": ["a", "b", "c", "d", "e", "f", "g", "h", "i", "i1", "cl"], "globals": { "aGlobal": "a", "bGlobal": "i1", "collideLocal": "cl" } }