summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--README.md2
-rwxr-xr-xemcc68
-rw-r--r--emscripten-version.txt2
-rw-r--r--src/embind/embind.js154
-rw-r--r--src/embind/emval.js156
-rw-r--r--src/jsifier.js6
-rw-r--r--src/library.js16
-rw-r--r--src/library_glfw.js231
-rw-r--r--src/library_sdl.js199
-rw-r--r--src/library_sockfs.js38
-rw-r--r--src/relooper/test.cpp33
-rw-r--r--src/relooper/test.txt26
-rw-r--r--src/runtime.js18
-rw-r--r--src/settings.js19
-rw-r--r--system/include/emscripten/bind.h15
-rw-r--r--system/include/emscripten/emscripten.h5
-rw-r--r--system/include/emscripten/val.h200
-rw-r--r--system/include/emscripten/wire.h2
-rw-r--r--system/lib/embind/bind.cpp41
-rw-r--r--tests/cases/fixablebadcasts_fastcomp.ll27
-rw-r--r--tests/cases/fixablebadcasts_fastcomp.txt1
-rw-r--r--tests/cases/i24_ce_fastcomp.ll11393
-rw-r--r--tests/cases/i24_ce_fastcomp.txt1
-rw-r--r--tests/cases/icmp64.ll32
-rw-r--r--tests/cases/icmp64.txt4
-rw-r--r--tests/cases/returnnan_fastcomp.ll34
-rw-r--r--tests/cases/returnnan_fastcomp.txt3
-rw-r--r--tests/cases/switch64c_ta2.ll68
-rw-r--r--tests/cases/switch64c_ta2.txt3
-rw-r--r--tests/cases/usenullcall_fastcomp.ll31
-rw-r--r--tests/cases/usenullcall_fastcomp.txt1
-rw-r--r--tests/core/test_inlinejs3.in6
-rw-r--r--tests/core/test_inlinejs3.out3
-rw-r--r--tests/dirent/test_readdir_empty.c47
-rw-r--r--tests/embind/embind.test.js76
-rw-r--r--tests/embind/embind_test.cpp59
-rw-r--r--tests/fs/test_idbfs_sync.c26
-rw-r--r--tests/hello_world.ll9
-rwxr-xr-xtests/runner.py6
-rw-r--r--tests/sdl_free_screen.cpp29
-rw-r--r--tests/sockets/p2p/.gitignore2
-rw-r--r--tests/sockets/p2p/broker/p2p-broker.js231
-rw-r--r--tests/sockets/p2p/client/p2p-client.js4485
-rw-r--r--tests/sockets/p2p/package.json17
-rw-r--r--tests/sockets/webrtc_host.c11
-rw-r--r--tests/sockets/webrtc_peer.c4
-rw-r--r--tests/test_benchmark.py58
-rw-r--r--tests/test_browser.py3
-rw-r--r--tests/test_core.py8
-rw-r--r--tests/test_other.py178
-rw-r--r--tests/test_sockets.py67
-rw-r--r--tools/eliminator/asm-eliminator-test-output.js47
-rw-r--r--tools/eliminator/asm-eliminator-test.js61
-rw-r--r--tools/js-optimizer.js607
-rw-r--r--tools/js_optimizer.py15
-rw-r--r--tools/shared.py46
-rw-r--r--tools/test-js-optimizer-output.js78
-rw-r--r--tools/test-js-optimizer-si-output.js197
-rw-r--r--tools/test-js-optimizer-si.js258
-rw-r--r--tools/test-js-optimizer-t2-output.js91
-rw-r--r--tools/test-js-optimizer-t2.js92
-rw-r--r--tools/test-js-optimizer-t2c-output.js17
-rw-r--r--tools/test-js-optimizer-t2c.js18
-rw-r--r--tools/test-js-optimizer-t3-output.js49
-rw-r--r--tools/test-js-optimizer-t3.js50
66 files changed, 18501 insertions, 1281 deletions
diff --git a/AUTHORS b/AUTHORS
index 03abe143..99703f93 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -132,4 +132,6 @@ a license to everyone to use it as detailed in LICENSE.)
* Dave Nicponski <dave.nicponski@gmail.com>
* Jonathan Jarri <noxalus@gmail.com>
* Daniele Di Proietto <daniele.di.proietto@gmail.com>
+* Dan Dascalescu <dNOSPAMdascalescu@gmail.com>
+* Thomas Borsos <thomasborsos@gmail.com>
diff --git a/README.md b/README.md
index 8f0d244e..27da7513 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
![emscripten logo](media/switch_logo.png)
-Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated
+Emscripten is an [LLVM](https://en.wikipedia.org/wiki/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).
diff --git a/emcc b/emcc
index 45df432d..c8e1814b 100755
--- a/emcc
+++ b/emcc
@@ -50,7 +50,7 @@ emcc can be influenced by a few environment variables:
import os, sys, shutil, tempfile, subprocess, shlex, time, re, logging
from subprocess import PIPE
from tools import shared, jsrun, system_libs
-from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename, WINDOWS
+from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename, WINDOWS, safe_move
from tools.response_file import read_response_file
# endings = dot + a suffix, safe to test by filename.endswith(endings)
@@ -95,7 +95,7 @@ AUTODEBUG = os.environ.get('EMCC_AUTODEBUG') # If set to 1, we will run the auto
# dlmalloc makes it hard to compare native and js builds
EMCC_CFLAGS = os.environ.get('EMCC_CFLAGS') # Additional compiler flags that we treat as if they were passed to us on the commandline
-logging.debug('invocation: ' + ' '.join(sys.argv) + (' + ' + EMCC_CFLAGS if EMCC_CFLAGS else ''))
+if DEBUG: logging.warning('invocation: ' + ' '.join(sys.argv) + (' + ' + EMCC_CFLAGS if EMCC_CFLAGS else '') + ' (in ' + os.getcwd() + ')')
if EMCC_CFLAGS: sys.argv.append(EMCC_CFLAGS)
if DEBUG and LEAVE_INPUTS_RAW: logging.warning('leaving inputs raw')
@@ -242,6 +242,14 @@ Options that are modified or new in %s include:
performance and otherwise might not be
performed in -g2.
+ --emit-symbol-map Save a map file between the minified
+ global names and the original function names.
+ This allows you to reconstruct meaningful
+ stack traces, for example. (This is only
+ relevant when minifying global names, which
+ happens in -O2 and above, and when no -g
+ option to prevent minification was specified.)
+
--typed-arrays <mode> 0: No typed arrays
1: Parallel typed arrays
2: Shared (C-like) typed arrays (default)
@@ -789,6 +797,7 @@ try:
opt_level = 0
debug_level = 0
profiling = False
+ emit_symbol_map = False
js_opts = None
llvm_opts = None
llvm_lto = None
@@ -921,6 +930,9 @@ try:
debug_level = 2
profiling = True
newargs[i] = ''
+ elif newargs[i] == '--emit-symbol-map':
+ emit_symbol_map = True
+ newargs[i] = ''
elif newargs[i] == '--bind':
bind = True
newargs[i] = ''
@@ -981,7 +993,7 @@ try:
# swap in debug logging
DEBUG = 1
shared.set_logging()
- logging.debug('invocation: ' + ' '.join(sys.argv))
+ logging.debug('-v invocation: ' + ' '.join(sys.argv))
shared.apply_configuration() # reset config to pick up change
shared.check_sanity(force=True)
newargs[i] = ''
@@ -1158,6 +1170,7 @@ try:
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'
+ final_ending = ('.' + final_suffix) if len(final_suffix) > 0 else ''
# Find library files
for lib in libs:
@@ -1363,13 +1376,25 @@ try:
execute([call] + args) # let compiler frontend print directly, so colors are saved (PIPE kills that)
sys.exit(1)
+ def get_bitcode_file(input_file):
+ if final_suffix not in JS_CONTAINING_SUFFIXES:
+ # no need for a temp file, just emit to the right place
+ if len(input_files) == 1:
+ # can just emit directly to the target
+ if specified_target:
+ if specified_target.endswith('/') or specified_target.endswith('\\') or os.path.isdir(specified_target):
+ return os.path.join(specified_target, os.path.basename(unsuffixed(input_file))) + default_object_extension
+ return specified_target
+ return unsuffixed(input_file) + final_ending
+ return unsuffixed(input_file) + default_object_extension
+ return in_temp(unsuffixed(uniquename(input_file)) + default_object_extension)
+
# 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)
if file_ending.endswith(SOURCE_ENDINGS):
logging.debug('compiling source file: ' + input_file)
- input_file = shared.Building.preprocess(input_file, in_temp(uniquename(input_file)))
- output_file = in_temp(unsuffixed(uniquename(input_file)) + '.o')
+ output_file = get_bitcode_file(input_file)
temp_files.append(output_file)
args = newargs + ['-emit-llvm', '-c', input_file, '-o', output_file]
if file_ending.endswith(CXX_ENDINGS):
@@ -1392,8 +1417,6 @@ try:
temp_files.append(temp_file)
elif file_ending.endswith(ASSEMBLY_ENDINGS):
if not LEAVE_INPUTS_RAW:
- # Note that by assembling the .ll file, then disassembling it later, we will
- # remove annotations which is a good thing for compilation time
logging.debug('assembling assembly file: ' + input_file)
temp_file = in_temp(unsuffixed(uniquename(input_file)) + '.o')
shared.Building.llvm_as(input_file, temp_file)
@@ -1421,26 +1444,17 @@ try:
if final_suffix not in JS_CONTAINING_SUFFIXES:
if not specified_target:
for input_file in input_files:
- shutil.move(in_temp(unsuffixed(uniquename(input_file)) + '.o'), unsuffixed_basename(input_file) + '.' + final_suffix)
+ safe_move(get_bitcode_file(input_file), unsuffixed_basename(input_file) + final_ending)
else:
if len(input_files) == 1:
- temp_output_base = in_temp(unsuffixed(uniquename(input_files[0])))
- if specified_target.endswith('/') or specified_target.endswith('\\') or os.path.isdir(specified_target): # User passed '-o <directory' as the location to output to.
- obj_output_name = os.path.join(specified_target, os.path.splitext(os.path.basename(input_file))[0] + default_object_extension)
- logging.debug('User specified -o <directoryname> as the location of the output. Generating output file ' + obj_output_name)
- try:
- shutil.move(temp_output_base + '.o', obj_output_name)
- except IOError, e:
- logging.error('Could not write to output file ' + obj_output_name + '. Perhaps the output directory does not exist?')
- exit(1)
- else: # User passed '-o <filename>' as the location to output to.
- shutil.move(temp_output_base + '.o', specified_target)
+ safe_move(temp_files[0], specified_target if specified_target else unsuffixed_basename(input_file) + final_ending)
+ temp_output_base = unsuffixed(temp_files[0])
if os.path.exists(temp_output_base + '.d'):
# There was a .d file generated, from -MD or -MMD and friends, save a copy of it to where the output resides,
# adjusting the target name away from the temporary file name to the specified target.
# It will be deleted with the rest of the temporary directory.
deps = open(temp_output_base + '.d').read()
- deps = deps.replace(temp_output_base + '.o', specified_target)
+ deps = deps.replace(temp_output_base + default_object_extension, specified_target)
with open(os.path.join(os.path.dirname(specified_target), os.path.basename(unsuffixed(input_files[0]) + '.d')), "w") as out_dep:
out_dep.write(deps)
else:
@@ -1449,9 +1463,10 @@ try:
# we have multiple files: Link them
logging.debug('link: ' + str(temp_files) + specified_target)
shared.Building.link(temp_files, specified_target)
+ logging.debug('stopping at bitcode')
exit(0)
- log_time('bitcodeize inputs')
+ log_time('process inputs')
## Continue on to create JavaScript
@@ -1712,6 +1727,10 @@ try:
js_optimizer_queue += ['simplifyExpressions']
+ # simplify ifs if it is ok to make the code somewhat unreadable, and unless outlining (simplified ifs
+ # with commaified code breaks late aggressive variable elimination)
+ if shared.Settings.SIMPLIFY_IFS and (debug_level == 0 or profiling) and shared.Settings.OUTLINING_LIMIT == 0: js_optimizer_queue += ['simplifyIfs']
+
if opt_level >= 3 and shared.Settings.PRECISE_F32: js_optimizer_queue += ['optimizeFrounds']
if closure and not shared.Settings.ASM_JS:
@@ -1737,7 +1756,9 @@ try:
js_optimizer_queue += ['registerize']
if opt_level >= 2:
- if debug_level < 2 and shared.Settings.ASM_JS: js_optimizer_queue += ['minifyNames']
+ if debug_level < 2 and shared.Settings.ASM_JS:
+ js_optimizer_queue += ['minifyNames']
+ if emit_symbol_map: js_optimizer_queue += ['symbolMap='+target+'.symbols']
if debug_level == 0: js_optimizer_queue += ['minifyWhitespace']
if closure and shared.Settings.ASM_JS:
@@ -1931,3 +1952,6 @@ finally:
else:
logging.info('emcc saved files are in:' + temp_dir)
+#//eliminate a = a in js opt. will kill STACKTOP = STACKTOP in funcs that do not use the C stack! add test for no STACKTOP or sp in such a func
+#// minify if into ?: ?
+
diff --git a/emscripten-version.txt b/emscripten-version.txt
index 2e46fa6f..29b950e7 100644
--- a/emscripten-version.txt
+++ b/emscripten-version.txt
@@ -1,2 +1,2 @@
-1.13.2
+1.14.0
diff --git a/src/embind/embind.js b/src/embind/embind.js
index f0cd0c74..6ec07cd9 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -1,6 +1,6 @@
/*global Module*/
/*global _malloc, _free, _memcpy*/
-/*global FUNCTION_TABLE, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32*/
+/*global FUNCTION_TABLE, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64*/
/*global readLatin1String*/
/*global __emval_register, _emval_handle_array, __emval_decref*/
/*global ___getTypeName*/
@@ -35,7 +35,7 @@ function throwUnboundTypeError(message, types) {
seen[type] = true;
}
types.forEach(visit);
-
+
throw new UnboundTypeError(message + ': ' + unboundTypes.map(getTypeName).join([', ']));
}
@@ -55,7 +55,7 @@ function ensureOverloadTable(proto, methodName, humanName) {
// Move the previous function into the overload table.
proto[methodName].overloadTable = [];
proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
- }
+ }
}
/* Registers a symbol (function, class, enum, ...) as part of the Module JS object so that
@@ -72,7 +72,7 @@ function exposePublicSymbol(name, value, numArguments) {
if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
throwBindingError("Cannot register public name '" + name + "' twice");
}
-
+
// We are exposing a function with the same name as an existing function. Create an overload table and a function selector
// that routes between the two.
ensureOverloadTable(Module, name, name);
@@ -164,6 +164,10 @@ var typeDependencies = {};
var registeredPointers = {};
function registerType(rawType, registeredInstance) {
+ if (!('argPackAdvance' in registeredInstance)) {
+ throw new TypeError('registerType registeredInstance requires argPackAdvance');
+ }
+
var name = registeredInstance.name;
if (!rawType) {
throwBindingError('type "' + name + '" must have a positive integer typeid pointer');
@@ -268,6 +272,7 @@ function __embind_register_void(rawType, name) {
name = readLatin1String(name);
registerType(rawType, {
name: name,
+ 'argPackAdvance': 0,
'fromWireType': function() {
return undefined;
},
@@ -278,7 +283,9 @@ function __embind_register_void(rawType, name) {
});
}
-function __embind_register_bool(rawType, name, trueValue, falseValue) {
+function __embind_register_bool(rawType, name, size, trueValue, falseValue) {
+ var shift = getShiftFromSize(size);
+
name = readLatin1String(name);
registerType(rawType, {
name: name,
@@ -290,21 +297,80 @@ function __embind_register_bool(rawType, name, trueValue, falseValue) {
'toWireType': function(destructors, o) {
return o ? trueValue : falseValue;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': function(pointer) {
+ // TODO: if heap is fixed (like in asm.js) this could be executed outside
+ var heap;
+ if (size === 1) {
+ heap = HEAP8;
+ } else if (size === 2) {
+ heap = HEAP16;
+ } else if (size === 4) {
+ heap = HEAP32;
+ } else {
+ throw new TypeError("Unknown boolean type size: " + name);
+ }
+ return this['fromWireType'](heap[pointer >> shift]);
+ },
destructorFunction: null, // This type does not need a destructor
});
}
+function getShiftFromSize(size) {
+ switch (size) {
+ case 1: return 0;
+ case 2: return 1;
+ case 4: return 2;
+ case 8: return 3;
+ default:
+ throw new TypeError('Unknown type size: ' + size);
+ }
+}
+
+function integerReadValueFromPointer(name, shift, signed) {
+ switch (shift) {
+ case 0: return function(pointer) {
+ var heap = signed ? HEAP8 : HEAPU8;
+ return this['fromWireType'](heap[pointer]);
+ };
+ case 1: return function(pointer) {
+ var heap = signed ? HEAP16 : HEAPU16;
+ return this['fromWireType'](heap[pointer >> 1]);
+ };
+ case 2: return function(pointer) {
+ var heap = signed ? HEAP32 : HEAPU32;
+ return this['fromWireType'](heap[pointer >> 2]);
+ };
+ default:
+ throw new TypeError("Unknown integer type: " + name);
+ }
+}
+
+function floatReadValueFromPointer(name, shift) {
+ switch (shift) {
+ case 2: return function(pointer) {
+ return this['fromWireType'](HEAPF32[pointer >> 2]);
+ };
+ case 3: return function(pointer) {
+ return this['fromWireType'](HEAPF64[pointer >> 3]);
+ };
+ default:
+ throw new TypeError("Unknown float type: " + name);
+ }
+}
+
// When converting a number from JS to C++ side, the valid range of the number is
// [minRange, maxRange], inclusive.
-function __embind_register_integer(primitiveType, name, minRange, maxRange) {
+function __embind_register_integer(primitiveType, name, size, minRange, maxRange) {
name = readLatin1String(name);
if (maxRange === -1) { // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come out as 'i32 -1'. Always treat those as max u32.
maxRange = 4294967295;
}
+
+ var shift = getShiftFromSize(size);
+
registerType(primitiveType, {
name: name,
- minRange: minRange,
- maxRange: maxRange,
'fromWireType': function(value) {
return value;
},
@@ -319,11 +385,16 @@ function __embind_register_integer(primitiveType, name, minRange, maxRange) {
}
return value | 0;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0),
destructorFunction: null, // This type does not need a destructor
});
}
-function __embind_register_float(rawType, name) {
+
+
+function __embind_register_float(rawType, name, size) {
+ var shift = getShiftFromSize(size);
name = readLatin1String(name);
registerType(rawType, {
name: name,
@@ -338,10 +409,17 @@ function __embind_register_float(rawType, name) {
}
return value;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': floatReadValueFromPointer(name, shift),
destructorFunction: null, // This type does not need a destructor
});
}
+// For types whose wire types are 32-bit pointers.
+function simpleReadValueFromPointer(pointer) {
+ return this['fromWireType'](HEAPU32[pointer >> 2]);
+}
+
function __embind_register_std_string(rawType, name) {
name = readLatin1String(name);
registerType(rawType, {
@@ -394,6 +472,8 @@ function __embind_register_std_string(rawType, name) {
}
return ptr;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': simpleReadValueFromPointer,
destructorFunction: function(ptr) { _free(ptr); },
});
}
@@ -434,6 +514,8 @@ function __embind_register_std_wstring(rawType, charSize, name) {
}
return ptr;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': simpleReadValueFromPointer,
destructorFunction: function(ptr) { _free(ptr); },
});
}
@@ -450,6 +532,8 @@ function __embind_register_emval(rawType, name) {
'toWireType': function(destructors, value) {
return __emval_register(value);
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': simpleReadValueFromPointer,
destructorFunction: null, // This type does not need a destructor
});
}
@@ -463,7 +547,7 @@ function __embind_register_memory_view(rawType, name) {
Int32Array,
Uint32Array,
Float32Array,
- Float64Array,
+ Float64Array,
];
name = readLatin1String(name);
@@ -476,6 +560,10 @@ function __embind_register_memory_view(rawType, name) {
var TA = typeMapping[type];
return new TA(HEAP8.buffer, data, size);
},
+ 'argPackAdvance': 16,
+ 'readValueFromPointer': function(ptr) {
+ return this['fromWireType'](ptr);
+ },
});
}
@@ -531,7 +619,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp
if (argCount < 2) {
throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
}
-
+
var isClassMethodFunc = (argTypes[1] !== null && classType !== null);
if (!isClassMethodFunc && !FUNCTION_TABLE[cppTargetFunc]) {
@@ -560,7 +648,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp
// Determine if we need to use a dynamic stack to store the destructors for the function parameters.
// TODO: Remove this completely once all function invokers are being dynamically generated.
var needsDestructorStack = false;
-
+
for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here.
if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack
needsDestructorStack = true;
@@ -595,7 +683,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp
invokerFnBody +=
(returns?"var rv = ":"") + "invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";
-
+
if (needsDestructorStack) {
invokerFnBody += "runDestructors(destructors);\n";
} else {
@@ -608,7 +696,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp
}
}
}
-
+
if (returns) {
invokerFnBody += "return retType.fromWireType(rv);\n";
}
@@ -676,7 +764,7 @@ function __embind_finalize_value_array(rawTupleType) {
var rawConstructor = reg.rawConstructor;
var rawDestructor = reg.rawDestructor;
-
+
whenDependentTypesAreResolved([rawTupleType], elementTypes, function(elementTypes) {
elements.forEach(function(elt, i) {
var getterReturnType = elementTypes[i];
@@ -718,6 +806,8 @@ function __embind_finalize_value_array(rawTupleType) {
}
return ptr;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': simpleReadValueFromPointer,
destructorFunction: rawDestructor,
}];
});
@@ -819,6 +909,8 @@ function __embind_finalize_value_object(structType) {
}
return ptr;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': simpleReadValueFromPointer,
destructorFunction: rawDestructor,
}];
});
@@ -860,7 +952,7 @@ var genericPointerToWireType = function(destructors, handle) {
if (undefined === handle.$$.smartPtr) {
throwBindingError('Passing raw pointer to smart pointer is illegal');
}
-
+
switch (this.sharingPolicy) {
case 0: // NONE
// no upcasting
@@ -870,11 +962,11 @@ var genericPointerToWireType = function(destructors, handle) {
throwBindingError('Cannot convert argument of type ' + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + ' to parameter type ' + this.name);
}
break;
-
+
case 1: // INTRUSIVE
ptr = handle.$$.smartPtr;
break;
-
+
case 2: // BY_EMVAL
if (handle.$$.smartPtrType === this) {
ptr = handle.$$.smartPtr;
@@ -891,7 +983,7 @@ var genericPointerToWireType = function(destructors, handle) {
}
}
break;
-
+
default:
throwBindingError('Unsupporting sharing policy');
}
@@ -985,7 +1077,7 @@ function RegisteredPointer(
this['toWireType'] = genericPointerToWireType;
// Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns
// a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time.
- // TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in
+ // TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in
// craftInvokerFunction altogether.
}
}
@@ -1003,6 +1095,9 @@ RegisteredPointer.prototype.destructor = function(ptr) {
}
};
+RegisteredPointer.prototype['argPackAdvance'] = 8;
+RegisteredPointer.prototype['readValueFromPointer'] = simpleReadValueFromPointer;
+
RegisteredPointer.prototype['fromWireType'] = function(ptr) {
// ptr is a raw pointer (or a raw smartpointer)
@@ -1110,7 +1205,7 @@ ClassHandle.prototype['isAliasOf'] = function(other) {
right = rightClass.upcast(right);
rightClass = rightClass.baseClass;
}
-
+
return leftClass === rightClass && left === right;
};
@@ -1195,7 +1290,7 @@ Module['setDelayFunction'] = function setDelayFunction(fn) {
delayFunction(flushPendingDeletes);
}
};
-
+
function RegisteredClass(
name,
constructor,
@@ -1298,7 +1393,7 @@ function __embind_register_class(
true,
false,
false);
-
+
var pointerConverter = new RegisteredPointer(
name + '*',
registeredClass,
@@ -1360,10 +1455,10 @@ function __embind_register_class_constructor(
for (var i = 1; i < argCount; ++i) {
args[i] = argTypes[i]['toWireType'](destructors, arguments[i - 1]);
}
-
+
var ptr = invoker.apply(null, args);
runDestructors(destructors);
-
+
return argTypes[0]['fromWireType'](ptr);
};
return [];
@@ -1447,7 +1542,7 @@ function __embind_register_class_function(
}
whenDependentTypesAreResolved([], rawArgTypes, function(argTypes) {
-
+
var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context);
// Replace the initial unbound-handler-stub function with the appropriate member function, now that all types
@@ -1627,8 +1722,11 @@ function __embind_register_smart_ptr(
function __embind_register_enum(
rawType,
- name
+ name,
+ size,
+ isSigned
) {
+ var shift = getShiftFromSize(size);
name = readLatin1String(name);
function constructor() {
@@ -1644,6 +1742,8 @@ function __embind_register_enum(
'toWireType': function(destructors, c) {
return c.value;
},
+ 'argPackAdvance': 8,
+ 'readValueFromPointer': integerReadValueFromPointer(name, shift, isSigned),
destructorFunction: null,
});
exposePublicSymbol(name, constructor);
diff --git a/src/embind/emval.js b/src/embind/emval.js
index 039f1d61..4007701a 100644
--- a/src/embind/emval.js
+++ b/src/embind/emval.js
@@ -55,6 +55,7 @@ function requireHandle(handle) {
if (!handle) {
throwBindingError('Cannot use deleted val. handle = ' + handle);
}
+ return _emval_handle_array[handle].value;
}
function __emval_register(value) {
@@ -105,9 +106,9 @@ function __emval_new_cstring(v) {
return __emval_register(getStringOrSymbol(v));
}
-function __emval_take_value(type, v) {
+function __emval_take_value(type, argv) {
type = requireRegisteredType(type, '_emval_take_value');
- v = type['fromWireType'](v);
+ var v = type['readValueFromPointer'](argv);
return __emval_register(v);
}
@@ -116,70 +117,51 @@ var __newers = {}; // arity -> function
function craftEmvalAllocator(argCount) {
/*This function returns a new function that looks like this:
- function emval_allocator_3(handle, argTypes, arg0Wired, arg1Wired, arg2Wired) {
+ function emval_allocator_3(constructor, argTypes, args) {
var argType0 = requireRegisteredType(HEAP32[(argTypes >> 2)], "parameter 0");
- var arg0 = argType0.fromWireType(arg0Wired);
+ var arg0 = argType0.readValueFromPointer(args);
var argType1 = requireRegisteredType(HEAP32[(argTypes >> 2) + 1], "parameter 1");
- var arg1 = argType1.fromWireType(arg1Wired);
+ var arg1 = argType1.readValueFromPointer(args + 8);
var argType2 = requireRegisteredType(HEAP32[(argTypes >> 2) + 2], "parameter 2");
- var arg2 = argType2.fromWireType(arg2Wired);
- var constructor = _emval_handle_array[handle].value;
- var emval = new constructor(arg0, arg1, arg2);
- return emval;
+ var arg2 = argType2.readValueFromPointer(args + 16);
+ var obj = new constructor(arg0, arg1, arg2);
+ return __emval_register(obj);
} */
- var args1 = ["requireRegisteredType", "HEAP32", "_emval_handle_array", "__emval_register"];
- var args2 = [requireRegisteredType, HEAP32, _emval_handle_array, __emval_register];
-
var argsList = "";
- var argsListWired = "";
for(var i = 0; i < argCount; ++i) {
argsList += (i!==0?", ":"")+"arg"+i; // 'arg0, arg1, ..., argn'
- argsListWired += ", arg"+i+"Wired"; // ', arg0Wired, arg1Wired, ..., argnWired'
}
- var invokerFnBody =
- "return function emval_allocator_"+argCount+"(handle, argTypes " + argsListWired + ") {\n";
+ var functionBody =
+ "return function emval_allocator_"+argCount+"(constructor, argTypes, args) {\n";
for(var i = 0; i < argCount; ++i) {
- invokerFnBody +=
+ functionBody +=
"var argType"+i+" = requireRegisteredType(HEAP32[(argTypes >> 2) + "+i+"], \"parameter "+i+"\");\n" +
- "var arg"+i+" = argType"+i+".fromWireType(arg"+i+"Wired);\n";
+ "var arg"+i+" = argType"+i+".readValueFromPointer(args);\n" +
+ "args += argType"+i+".argPackAdvance;\n";
}
- invokerFnBody +=
- "var constructor = _emval_handle_array[handle].value;\n" +
+ functionBody +=
"var obj = new constructor("+argsList+");\n" +
"return __emval_register(obj);\n" +
"}\n";
- args1.push(invokerFnBody);
- var invokerFunction = new_(Function, args1).apply(null, args2);
- return invokerFunction;
+ /*jshint evil:true*/
+ return (new Function("requireRegisteredType", "HEAP32", "__emval_register", functionBody))(
+ requireRegisteredType, HEAP32, __emval_register);
}
-function __emval_new(handle, argCount, argTypes) {
- requireHandle(handle);
-
+function __emval_new(handle, argCount, argTypes, args) {
+ handle = requireHandle(handle);
+
var newer = __newers[argCount];
if (!newer) {
newer = craftEmvalAllocator(argCount);
__newers[argCount] = newer;
}
- if (argCount === 0) {
- return newer(handle, argTypes);
- } else if (argCount === 1) {
- return newer(handle, argTypes, arguments[3]);
- } else if (argCount === 2) {
- return newer(handle, argTypes, arguments[3], arguments[4]);
- } else if (argCount === 3) {
- return newer(handle, argTypes, arguments[3], arguments[4], arguments[5]);
- } else if (argCount === 4) {
- return newer(handle, argTypes, arguments[3], arguments[4], arguments[5], arguments[6]);
- } else {
- // This is a slow path! (.apply and .splice are slow), so a few specializations are present above.
- return newer.apply(null, arguments.splice(1));
- }
+ return newer(handle, argTypes, args);
}
// appease jshint (technically this code uses eval)
@@ -196,46 +178,39 @@ function __emval_get_module_property(name) {
}
function __emval_get_property(handle, key) {
- requireHandle(handle);
- return __emval_register(_emval_handle_array[handle].value[_emval_handle_array[key].value]);
+ handle = requireHandle(handle);
+ key = requireHandle(key);
+ return __emval_register(handle[key]);
}
function __emval_set_property(handle, key, value) {
- requireHandle(handle);
- _emval_handle_array[handle].value[_emval_handle_array[key].value] = _emval_handle_array[value].value;
+ handle = requireHandle(handle);
+ key = requireHandle(key);
+ value = requireHandle(value);
+ handle[key] = value;
}
function __emval_as(handle, returnType, destructorsRef) {
- requireHandle(handle);
+ handle = requireHandle(handle);
returnType = requireRegisteredType(returnType, 'emval::as');
var destructors = [];
var rd = __emval_register(destructors);
HEAP32[destructorsRef >> 2] = rd;
- return returnType['toWireType'](destructors, _emval_handle_array[handle].value);
+ return returnType['toWireType'](destructors, handle);
}
-function parseParameters(argCount, argTypes, argWireTypes) {
- var a = new Array(argCount);
- for (var i = 0; i < argCount; ++i) {
- var argType = requireRegisteredType(
- HEAP32[(argTypes >> 2) + i],
- "parameter " + i);
- a[i] = argType['fromWireType'](argWireTypes[i]);
- }
- return a;
-}
-
-function __emval_call(handle, argCount, argTypes) {
- requireHandle(handle);
+function __emval_call(handle, argCount, argTypes, argv) {
+ handle = requireHandle(handle);
var types = lookupTypes(argCount, argTypes);
var args = new Array(argCount);
for (var i = 0; i < argCount; ++i) {
- args[i] = types[i]['fromWireType'](arguments[3 + i]);
+ var type = types[i];
+ args[i] = type['readValueFromPointer'](argv);
+ argv += type.argPackAdvance;
}
- var fn = _emval_handle_array[handle].value;
- var rv = fn.apply(undefined, args);
+ var rv = handle.apply(undefined, args);
return __emval_register(rv);
}
@@ -255,44 +230,59 @@ function allocateDestructors(destructorsRef) {
return destructors;
}
+// Leave id 0 undefined. It's not a big deal, but might be confusing
+// to have null be a valid method caller.
+var methodCallers = [undefined];
+
+function addMethodCaller(caller) {
+ var id = methodCallers.length;
+ methodCallers.push(caller);
+ return id;
+}
+
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", "allocateDestructors"];
- var args2 = [Runtime.addFunction, createNamedFunction, requireHandle, getStringOrSymbol, _emval_handle_array, retType, allocateDestructors];
+ var params = ["retType"];
+ var args = [retType];
var argsList = ""; // 'arg0, arg1, arg2, ... , argN'
- var argsListWired = ""; // 'arg0Wired, ..., argNWired'
for (var i = 0; i < argCount - 1; ++i) {
argsList += (i !== 0 ? ", " : "") + "arg" + i;
- argsListWired += ", arg" + i + "Wired";
- args1.push("argType" + i);
- args2.push(types[1 + i]);
+ params.push("argType" + i);
+ args.push(types[1 + i]);
}
- var invokerFnBody =
- "return addFunction(createNamedFunction('" + signatureName + "', function (handle, name, destructorsRef" + argsListWired + ") {\n" +
- " requireHandle(handle);\n" +
- " name = getStringOrSymbol(name);\n";
+ var functionBody =
+ "return function (handle, name, destructors, args) {\n";
for (var i = 0; i < argCount - 1; ++i) {
- invokerFnBody += " var arg" + i + " = argType" + i + ".fromWireType(arg" + i + "Wired);\n";
+ functionBody +=
+ " var arg" + i + " = argType" + i + ".readValueFromPointer(args);\n" +
+ " args += argType" + i + ".argPackAdvance;\n";
}
- invokerFnBody +=
- " 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);
- var invokerFunction = new_(Function, args1).apply(null, args2);
- return invokerFunction;
+ functionBody +=
+ " var rv = handle[name](" + argsList + ");\n" +
+ " return retType.toWireType(destructors, rv);\n" +
+ "};\n";
+
+ params.push(functionBody);
+ var invokerFunction = new_(Function, params).apply(null, args);
+ return addMethodCaller(createNamedFunction(signatureName, invokerFunction));
+}
+
+function __emval_call_method(caller, handle, methodName, destructorsRef, args) {
+ caller = methodCallers[caller];
+ handle = requireHandle(handle);
+ methodName = getStringOrSymbol(methodName);
+ return caller(handle, methodName, allocateDestructors(destructorsRef), args);
}
function __emval_has_function(handle, name) {
+ handle = requireHandle(handle);
name = getStringOrSymbol(name);
- return _emval_handle_array[handle].value[name] instanceof Function;
+ return handle[name] instanceof Function;
}
diff --git a/src/jsifier.js b/src/jsifier.js
index 503f0b71..065c66a8 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -397,8 +397,10 @@ function JSify(data, functionsOnly) {
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);
+ if (VERBOSE || ident.substr(0, 11) !== 'emscripten_') { // avoid warning on emscripten_* functions which are for internal usage anyhow
+ 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);");
diff --git a/src/library.js b/src/library.js
index f7155e9d..e0d8c5b7 100644
--- a/src/library.js
+++ b/src/library.js
@@ -325,6 +325,9 @@ LibraryManager.library = {
// int mkdir(const char *path, mode_t mode);
// http://pubs.opengroup.org/onlinepubs/7908799/xsh/mkdir.html
path = Pointer_stringify(path);
+ // remove a trailing slash, if one - /a/b/ has basename of '', but
+ // we want to create b in the context of this function
+ if (path[path.length-1] === '/') path = path.substr(0, path.length-1);
try {
FS.mkdir(path, mode, 0);
return 0;
@@ -4600,8 +4603,6 @@ LibraryManager.library = {
return __ZNKSt9exception4whatEv.buffer;
},
- _ZNSt9type_infoD2Ev: function(){},
-
// RTTI hacks for exception handling, defining type_infos for common types.
// The values are dummies. We simply use the addresses of these statically
// allocated variables as unique identifiers.
@@ -6402,6 +6403,13 @@ LibraryManager.library = {
siginterrupt: function() { throw 'siginterrupt not implemented' },
+ raise__deps: ['$ERRNO_CODES', '__setErrNo'],
+ raise: function(sig) {
+ // TODO:
+ ___setErrNo(ERRNO_CODES.ENOSYS);
+ return -1;
+ },
+
// ==========================================================================
// sys/wait.h
// ==========================================================================
@@ -8169,7 +8177,9 @@ LibraryManager.library = {
},
setsockopt: function(d, level, optname, optval, optlen) {
+#if SOCKET_DEBUG
console.log('ignoring setsockopt command');
+#endif
return 0;
},
@@ -8658,7 +8668,9 @@ LibraryManager.library = {
},
setsockopt: function(fd, level, optname, optval, optlen) {
+#if SOCKET_DEBUG
console.log('ignoring setsockopt command');
+#endif
return 0;
},
diff --git a/src/library_glfw.js b/src/library_glfw.js
index e5782900..f72aeb24 100644
--- a/src/library_glfw.js
+++ b/src/library_glfw.js
@@ -18,6 +18,7 @@
*
* Authors:
* - Éloi Rivard <eloi.rivard@gmail.com>
+ * - Thomas Borsos <thomasborsos@gmail.com>
*
******************************************************************************/
@@ -50,58 +51,60 @@ var LibraryGLFW = {
DOMToGLFWKeyCode: function(keycode) {
switch (keycode) {
- case 0x09: return 295 ; //DOM_VK_TAB -> GLFW_KEY_TAB
- case 0x1B: return 257 ; //DOM_VK_ESCAPE -> GLFW_KEY_ESC
- case 0x6A: return 313 ; //DOM_VK_MULTIPLY -> GLFW_KEY_KP_MULTIPLY
- case 0x6B: return 315 ; //DOM_VK_ADD -> GLFW_KEY_KP_ADD
- case 0x6D: return 314 ; //DOM_VK_SUBTRACT -> GLFW_KEY_KP_SUBTRACT
- case 0x6E: return 316 ; //DOM_VK_DECIMAL -> GLFW_KEY_KP_DECIMAL
- case 0x6F: return 312 ; //DOM_VK_DIVIDE -> GLFW_KEY_KP_DIVIDE
- case 0x70: return 258 ; //DOM_VK_F1 -> GLFW_KEY_F1
- case 0x71: return 259 ; //DOM_VK_F2 -> GLFW_KEY_F2
- case 0x72: return 260 ; //DOM_VK_F3 -> GLFW_KEY_F3
- case 0x73: return 261 ; //DOM_VK_F4 -> GLFW_KEY_F4
- case 0x74: return 262 ; //DOM_VK_F5 -> GLFW_KEY_F5
- case 0x75: return 263 ; //DOM_VK_F6 -> GLFW_KEY_F6
- case 0x76: return 264 ; //DOM_VK_F7 -> GLFW_KEY_F7
- case 0x77: return 265 ; //DOM_VK_F8 -> GLFW_KEY_F8
- case 0x78: return 266 ; //DOM_VK_F9 -> GLFW_KEY_F9
- case 0x79: return 267 ; //DOM_VK_F10 -> GLFW_KEY_F10
- case 0x7a: return 268 ; //DOM_VK_F11 -> GLFW_KEY_F11
- case 0x7b: return 269 ; //DOM_VK_F12 -> GLFW_KEY_F12
- case 0x25: return 285 ; //DOM_VK_LEFT -> GLFW_KEY_LEFT
- case 0x26: return 283 ; //DOM_VK_UP -> GLFW_KEY_UP
- case 0x27: return 286 ; //DOM_VK_RIGHT -> GLFW_KEY_RIGHT
- case 0x28: return 284 ; //DOM_VK_DOWN -> GLFW_KEY_DOWN
- case 0x21: return 298 ; //DOM_VK_PAGE_UP -> GLFW_KEY_PAGEUP
- case 0x22: return 299 ; //DOM_VK_PAGE_DOWN -> GLFW_KEY_PAGEDOWN
- case 0x24: return 300 ; //DOM_VK_HOME -> GLFW_KEY_HOME
- case 0x23: return 301 ; //DOM_VK_END -> GLFW_KEY_END
- case 0x2d: return 296 ; //DOM_VK_INSERT -> GLFW_KEY_INSERT
- case 16 : return 287 ; //DOM_VK_SHIFT -> GLFW_KEY_LSHIFT
- case 0x05: return 287 ; //DOM_VK_LEFT_SHIFT -> GLFW_KEY_LSHIFT
- case 0x06: return 288 ; //DOM_VK_RIGHT_SHIFT -> GLFW_KEY_RSHIFT
- case 17 : return 289 ; //DOM_VK_CONTROL -> GLFW_KEY_LCTRL
- case 0x03: return 289 ; //DOM_VK_LEFT_CONTROL -> GLFW_KEY_LCTRL
- case 0x04: return 290 ; //DOM_VK_RIGHT_CONTROL -> GLFW_KEY_RCTRL
- case 18 : return 291 ; //DOM_VK_ALT -> GLFW_KEY_LALT
- case 0x02: return 291 ; //DOM_VK_LEFT_ALT -> GLFW_KEY_LALT
- case 0x01: return 292 ; //DOM_VK_RIGHT_ALT -> GLFW_KEY_RALT
- case 96 : return 302 ; //GLFW_KEY_KP_0
- case 97 : return 303 ; //GLFW_KEY_KP_1
- case 98 : return 304 ; //GLFW_KEY_KP_2
- case 99 : return 305 ; //GLFW_KEY_KP_3
- case 100 : return 306 ; //GLFW_KEY_KP_4
- case 101 : return 307 ; //GLFW_KEY_KP_5
- case 102 : return 308 ; //GLFW_KEY_KP_6
- case 103 : return 309 ; //GLFW_KEY_KP_7
- case 104 : return 310 ; //GLFW_KEY_KP_8
- case 105 : return 311 ; //GLFW_KEY_KP_9
+ case 0x08: return 295 ; // DOM_VK_BACKSPACE -> GLFW_KEY_BACKSPACE
+ case 0x09: return 293 ; // DOM_VK_TAB -> GLFW_KEY_TAB
+ case 0x0D: return 294 ; // DOM_VK_ENTER -> GLFW_KEY_ENTER
+ case 0x1B: return 257 ; // DOM_VK_ESCAPE -> GLFW_KEY_ESC
+ case 0x6A: return 313 ; // DOM_VK_MULTIPLY -> GLFW_KEY_KP_MULTIPLY
+ case 0x6B: return 315 ; // DOM_VK_ADD -> GLFW_KEY_KP_ADD
+ case 0x6D: return 314 ; // DOM_VK_SUBTRACT -> GLFW_KEY_KP_SUBTRACT
+ case 0x6E: return 316 ; // DOM_VK_DECIMAL -> GLFW_KEY_KP_DECIMAL
+ case 0x6F: return 312 ; // DOM_VK_DIVIDE -> GLFW_KEY_KP_DIVIDE
+ case 0x70: return 258 ; // DOM_VK_F1 -> GLFW_KEY_F1
+ case 0x71: return 259 ; // DOM_VK_F2 -> GLFW_KEY_F2
+ case 0x72: return 260 ; // DOM_VK_F3 -> GLFW_KEY_F3
+ case 0x73: return 261 ; // DOM_VK_F4 -> GLFW_KEY_F4
+ case 0x74: return 262 ; // DOM_VK_F5 -> GLFW_KEY_F5
+ case 0x75: return 263 ; // DOM_VK_F6 -> GLFW_KEY_F6
+ case 0x76: return 264 ; // DOM_VK_F7 -> GLFW_KEY_F7
+ case 0x77: return 265 ; // DOM_VK_F8 -> GLFW_KEY_F8
+ case 0x78: return 266 ; // DOM_VK_F9 -> GLFW_KEY_F9
+ case 0x79: return 267 ; // DOM_VK_F10 -> GLFW_KEY_F10
+ case 0x7a: return 268 ; // DOM_VK_F11 -> GLFW_KEY_F11
+ case 0x7b: return 269 ; // DOM_VK_F12 -> GLFW_KEY_F12
+ case 0x25: return 285 ; // DOM_VK_LEFT -> GLFW_KEY_LEFT
+ case 0x26: return 283 ; // DOM_VK_UP -> GLFW_KEY_UP
+ case 0x27: return 286 ; // DOM_VK_RIGHT -> GLFW_KEY_RIGHT
+ case 0x28: return 284 ; // DOM_VK_DOWN -> GLFW_KEY_DOWN
+ case 0x21: return 298 ; // DOM_VK_PAGE_UP -> GLFW_KEY_PAGEUP
+ case 0x22: return 299 ; // DOM_VK_PAGE_DOWN -> GLFW_KEY_PAGEDOWN
+ case 0x24: return 300 ; // DOM_VK_HOME -> GLFW_KEY_HOME
+ case 0x23: return 301 ; // DOM_VK_END -> GLFW_KEY_END
+ case 0x2d: return 296 ; // DOM_VK_INSERT -> GLFW_KEY_INSERT
+ case 16 : return 287 ; // DOM_VK_SHIFT -> GLFW_KEY_LSHIFT
+ case 0x05: return 287 ; // DOM_VK_LEFT_SHIFT -> GLFW_KEY_LSHIFT
+ case 0x06: return 288 ; // DOM_VK_RIGHT_SHIFT -> GLFW_KEY_RSHIFT
+ case 17 : return 289 ; // DOM_VK_CONTROL -> GLFW_KEY_LCTRL
+ case 0x03: return 289 ; // DOM_VK_LEFT_CONTROL -> GLFW_KEY_LCTRL
+ case 0x04: return 290 ; // DOM_VK_RIGHT_CONTROL -> GLFW_KEY_RCTRL
+ case 18 : return 291 ; // DOM_VK_ALT -> GLFW_KEY_LALT
+ case 0x02: return 291 ; // DOM_VK_LEFT_ALT -> GLFW_KEY_LALT
+ case 0x01: return 292 ; // DOM_VK_RIGHT_ALT -> GLFW_KEY_RALT
+ case 96 : return 302 ; // GLFW_KEY_KP_0
+ case 97 : return 303 ; // GLFW_KEY_KP_1
+ case 98 : return 304 ; // GLFW_KEY_KP_2
+ case 99 : return 305 ; // GLFW_KEY_KP_3
+ case 100 : return 306 ; // GLFW_KEY_KP_4
+ case 101 : return 307 ; // GLFW_KEY_KP_5
+ case 102 : return 308 ; // GLFW_KEY_KP_6
+ case 103 : return 309 ; // GLFW_KEY_KP_7
+ case 104 : return 310 ; // GLFW_KEY_KP_8
+ case 105 : return 311 ; // GLFW_KEY_KP_9
default : return keycode;
};
},
- //UCS-2 to UTF16 (ISO 10646)
+ // UCS-2 to UTF16 (ISO 10646)
getUnicodeChar: function(value) {
var output = '';
if (value > 0xFFFF) {
@@ -114,7 +117,7 @@ var LibraryGLFW = {
},
onKeyPress: function(event) {
- //charCode is only available whith onKeyPress event
+ // charCode is only available whith onKeyPress event
var char = GLFW.getUnicodeChar(event.charCode);
if (event.charCode) {
@@ -134,7 +137,7 @@ var LibraryGLFW = {
},
onKeydown: function(event) {
- GLFW.onKeyChanged(event, 1);//GLFW_PRESS
+ GLFW.onKeyChanged(event, 1);// GLFW_PRESS
// This logic comes directly from the sdl implementation. We cannot
// call preventDefault on all keydown events otherwise onKeyPress will
// not get called
@@ -144,7 +147,7 @@ var LibraryGLFW = {
},
onKeyup: function(event) {
- GLFW.onKeyChanged(event, 0);//GLFW_RELEASE
+ GLFW.onKeyChanged(event, 0);// GLFW_RELEASE
},
onMousemove: function(event) {
@@ -175,25 +178,34 @@ var LibraryGLFW = {
return;
}
- if (status == 1) {//GLFW_PRESS
+ if (status == 1) {// GLFW_PRESS
try {
event.target.setCapture();
} catch (e) {}
}
event.preventDefault();
- //DOM and glfw have the same button codes
- Runtime.dynCall('vii', GLFW.mouseButtonFunc, [event['button'], status]);
+
+ // DOM and glfw have different button codes
+ var eventButton = event['button'];
+ if (eventButton > 0) {
+ if (eventButton == 1) {
+ eventButton = 2;
+ } else {
+ eventButton = 1;
+ }
+ }
+ Runtime.dynCall('vii', GLFW.mouseButtonFunc, [eventButton, status]);
},
onMouseButtonDown: function(event) {
GLFW.buttons |= (1 << event['button']);
- GLFW.onMouseButtonChanged(event, 1);//GLFW_PRESS
+ GLFW.onMouseButtonChanged(event, 1);// GLFW_PRESS
},
onMouseButtonUp: function(event) {
GLFW.buttons &= ~(1 << event['button']);
- GLFW.onMouseButtonChanged(event, 0);//GLFW_RELEASE
+ GLFW.onMouseButtonChanged(event, 0);// GLFW_RELEASE
},
onMouseWheel: function(event) {
@@ -213,8 +225,7 @@ var LibraryGLFW = {
if (document["fullScreen"] || document["mozFullScreen"] || document["webkitIsFullScreen"]) {
width = screen["width"];
height = screen["height"];
- }
- else {
+ } else {
width = GLFW.windowWidth;
height = GLFW.windowHeight;
// TODO set position
@@ -279,40 +290,40 @@ var LibraryGLFW = {
//TODO: Init with correct values
GLFW.params = new Array();
- GLFW.params[0x00030001] = true; //GLFW_MOUSE_CURSOR
- GLFW.params[0x00030002] = false; //GLFW_STICKY_KEYS
- GLFW.params[0x00030003] = true; //GLFW_STICKY_MOUSE_BUTTONS
- GLFW.params[0x00030004] = false; //GLFW_SYSTEM_KEYS
- GLFW.params[0x00030005] = false; //GLFW_KEY_REPEAT
- GLFW.params[0x00030006] = true; //GLFW_AUTO_POLL_EVENTS
- GLFW.params[0x00020001] = true; //GLFW_OPENED
- GLFW.params[0x00020002] = true; //GLFW_ACTIVE
- GLFW.params[0x00020003] = false; //GLFW_ICONIFIED
- GLFW.params[0x00020004] = true; //GLFW_ACCELERATED
- GLFW.params[0x00020005] = 0; //GLFW_RED_BITS
- GLFW.params[0x00020006] = 0; //GLFW_GREEN_BITS
- GLFW.params[0x00020007] = 0; //GLFW_BLUE_BITS
- GLFW.params[0x00020008] = 0; //GLFW_ALPHA_BITS
- GLFW.params[0x00020009] = 0; //GLFW_DEPTH_BITS
- GLFW.params[0x0002000A] = 0; //GLFW_STENCIL_BITS
- GLFW.params[0x0002000B] = 0; //GLFW_REFRESH_RATE
- GLFW.params[0x0002000C] = 0; //GLFW_ACCUM_RED_BITS
- GLFW.params[0x0002000D] = 0; //GLFW_ACCUM_GREEN_BITS
- GLFW.params[0x0002000E] = 0; //GLFW_ACCUM_BLUE_BITS
- GLFW.params[0x0002000F] = 0; //GLFW_ACCUM_ALPHA_BITS
- GLFW.params[0x00020010] = 0; //GLFW_AUX_BUFFERS
- GLFW.params[0x00020011] = 0; //GLFW_STEREO
- GLFW.params[0x00020012] = 0; //GLFW_WINDOW_NO_RESIZE
- GLFW.params[0x00020013] = 0; //GLFW_FSAA_SAMPLES
- GLFW.params[0x00020014] = 0; //GLFW_OPENGL_VERSION_MAJOR
- GLFW.params[0x00020015] = 0; //GLFW_OPENGL_VERSION_MINOR
- GLFW.params[0x00020016] = 0; //GLFW_OPENGL_FORWARD_COMPAT
- GLFW.params[0x00020017] = 0; //GLFW_OPENGL_DEBUG_CONTEXT
- GLFW.params[0x00020018] = 0; //GLFW_OPENGL_PROFILE
+ GLFW.params[0x00030001] = true; // GLFW_MOUSE_CURSOR
+ GLFW.params[0x00030002] = false; // GLFW_STICKY_KEYS
+ GLFW.params[0x00030003] = true; // GLFW_STICKY_MOUSE_BUTTONS
+ GLFW.params[0x00030004] = false; // GLFW_SYSTEM_KEYS
+ GLFW.params[0x00030005] = false; // GLFW_KEY_REPEAT
+ GLFW.params[0x00030006] = true; // GLFW_AUTO_POLL_EVENTS
+ GLFW.params[0x00020001] = true; // GLFW_OPENED
+ GLFW.params[0x00020002] = true; // GLFW_ACTIVE
+ GLFW.params[0x00020003] = false; // GLFW_ICONIFIED
+ GLFW.params[0x00020004] = true; // GLFW_ACCELERATED
+ GLFW.params[0x00020005] = 0; // GLFW_RED_BITS
+ GLFW.params[0x00020006] = 0; // GLFW_GREEN_BITS
+ GLFW.params[0x00020007] = 0; // GLFW_BLUE_BITS
+ GLFW.params[0x00020008] = 0; // GLFW_ALPHA_BITS
+ GLFW.params[0x00020009] = 0; // GLFW_DEPTH_BITS
+ GLFW.params[0x0002000A] = 0; // GLFW_STENCIL_BITS
+ GLFW.params[0x0002000B] = 0; // GLFW_REFRESH_RATE
+ GLFW.params[0x0002000C] = 0; // GLFW_ACCUM_RED_BITS
+ GLFW.params[0x0002000D] = 0; // GLFW_ACCUM_GREEN_BITS
+ GLFW.params[0x0002000E] = 0; // GLFW_ACCUM_BLUE_BITS
+ GLFW.params[0x0002000F] = 0; // GLFW_ACCUM_ALPHA_BITS
+ GLFW.params[0x00020010] = 0; // GLFW_AUX_BUFFERS
+ GLFW.params[0x00020011] = 0; // GLFW_STEREO
+ GLFW.params[0x00020012] = 0; // GLFW_WINDOW_NO_RESIZE
+ GLFW.params[0x00020013] = 0; // GLFW_FSAA_SAMPLES
+ GLFW.params[0x00020014] = 0; // GLFW_OPENGL_VERSION_MAJOR
+ GLFW.params[0x00020015] = 0; // GLFW_OPENGL_VERSION_MINOR
+ GLFW.params[0x00020016] = 0; // GLFW_OPENGL_FORWARD_COMPAT
+ GLFW.params[0x00020017] = 0; // GLFW_OPENGL_DEBUG_CONTEXT
+ GLFW.params[0x00020018] = 0; // GLFW_OPENGL_PROFILE
GLFW.keys = new Array();
- return 1; //GL_TRUE
+ return 1; // GL_TRUE
},
glfwTerminate: function() {},
@@ -332,33 +343,31 @@ var LibraryGLFW = {
if (width > 0 && height == 0) {
height = 3 * width / 4;
}
- GLFW.params[0x00020005] = redbits; //GLFW_RED_BITS
- GLFW.params[0x00020006] = greenbits; //GLFW_GREEN_BITS
- GLFW.params[0x00020007] = bluebits; //GLFW_BLUE_BITS
- GLFW.params[0x00020008] = alphabits; //GLFW_ALPHA_BITS
- GLFW.params[0x00020009] = depthbits; //GLFW_DEPTH_BITS
- GLFW.params[0x0002000A] = stencilbits; //GLFW_STENCIL_BITS
-
- if (mode == 0x00010001) {//GLFW_WINDOW
+ GLFW.params[0x00020005] = redbits; // GLFW_RED_BITS
+ GLFW.params[0x00020006] = greenbits; // GLFW_GREEN_BITS
+ GLFW.params[0x00020007] = bluebits; // GLFW_BLUE_BITS
+ GLFW.params[0x00020008] = alphabits; // GLFW_ALPHA_BITS
+ GLFW.params[0x00020009] = depthbits; // GLFW_DEPTH_BITS
+ GLFW.params[0x0002000A] = stencilbits; // GLFW_STENCIL_BITS
+
+ if (mode == 0x00010001) {// GLFW_WINDOW
Browser.setCanvasSize(GLFW.initWindowWidth = width,
GLFW.initWindowHeight = height);
- GLFW.params[0x00030003] = true; //GLFW_STICKY_MOUSE_BUTTONS
- }
- else if (mode == 0x00010002) {//GLFW_FULLSCREEN
+ GLFW.params[0x00030003] = true; // GLFW_STICKY_MOUSE_BUTTONS
+ } else if (mode == 0x00010002) {// GLFW_FULLSCREEN
GLFW.requestFullScreen();
- GLFW.params[0x00030003] = false; //GLFW_STICKY_MOUSE_BUTTONS
- }
- else{
+ GLFW.params[0x00030003] = false; // GLFW_STICKY_MOUSE_BUTTONS
+ } else {
throw "Invalid glfwOpenWindow mode.";
}
var contextAttributes = {
- antialias: (GLFW.params[0x00020013] > 1), //GLFW_FSAA_SAMPLES
- depth: (GLFW.params[0x00020009] > 0), //GLFW_DEPTH_BITS
- stencil: (GLFW.params[0x0002000A] > 0) //GLFW_STENCIL_BITS
+ antialias: (GLFW.params[0x00020013] > 1), // GLFW_FSAA_SAMPLES
+ depth: (GLFW.params[0x00020009] > 0), // GLFW_DEPTH_BITS
+ stencil: (GLFW.params[0x0002000A] > 0) // GLFW_STENCIL_BITS
}
Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes);
- return 1; //GL_TRUE
+ return 1; // GL_TRUE
},
glfwOpenWindowHint: function(target, hint) {
@@ -439,7 +448,7 @@ var LibraryGLFW = {
setValue(ypos, Browser.mouseY, 'i32');
},
- //I believe it is not possible to move the mouse with javascript
+ // I believe it is not possible to move the mouse with javascript
glfwSetMousePos: function(xpos, ypos) {},
glfwGetMouseWheel: function() {
@@ -514,7 +523,7 @@ var LibraryGLFW = {
str += 'i';
}
Runtime.dynCall(str, fun, arg);
- //One single thread
+ // One single thread
return 0;
},
@@ -523,7 +532,7 @@ var LibraryGLFW = {
glfwWaitThread: function(ID, waitmode) {},
glfwGetThreadID: function() {
- //One single thread
+ // One single thread
return 0;
},
@@ -546,7 +555,7 @@ var LibraryGLFW = {
glfwBroadcastCond: function(cond) { throw "glfwBroadcastCond is not implemented."; },
glfwGetNumberOfProcessors: function() {
- //Threads are disabled anyway…
+ // Threads are disabled anyway…
return 1;
},
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 364349b6..d90484ad 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -83,21 +83,28 @@ var LibrarySDL = {
DOMEventToSDLEvent: {},
keyCodes: { // DOM code ==> SDL code. See https://developer.mozilla.org/en/Document_Object_Model_%28DOM%29/KeyboardEvent and SDL_keycode.h
+ // For keys that don't have unicode value, we map DOM codes with the corresponding scan codes + 1024 (using "| 1 << 10")
+ 16: 225 | 1<<10, // shift
+ 17: 224 | 1<<10, // control (right, or left)
+ 18: 226 | 1<<10, // alt
+ 20: 57 | 1<<10, // caps lock
+
+ 33: 75 | 1<<10, // pagedup
+ 34: 78 | 1<<10, // pagedown
+ 35: 77 | 1<<10, // end
+ 36: 74 | 1<<10, // home
+ 37: 80 | 1<<10, // left arrow
+ 38: 82 | 1<<10, // up arrow
+ 39: 79 | 1<<10, // right arrow
+ 40: 81 | 1<<10, // down arrow
+ 44: 316, // print screen
+ 45: 73 | 1<<10, // insert
46: 127, // SDLK_DEL == '\177'
- 38: 1106, // up arrow
- 40: 1105, // down arrow
- 37: 1104, // left arrow
- 39: 1103, // right arrow
-
- 33: 1099, // pagedup
- 34: 1102, // pagedown
-
- 17: 1248, // control (right, or left)
- 18: 1250, // alt
- 173: 45, // minus
- 16: 1249, // shift
- 96: 88 | 1<<10, // keypad 0
+ 91: 227 | 1<<10, // windows key or super key on linux (doesn't work on Mac)
+ 93: 101 | 1<<10, // application
+
+ 96: 98 | 1<<10, // keypad 0
97: 89 | 1<<10, // keypad 1
98: 90 | 1<<10, // keypad 2
99: 91 | 1<<10, // keypad 3
@@ -107,7 +114,11 @@ var LibrarySDL = {
103: 95 | 1<<10, // keypad 7
104: 96 | 1<<10, // keypad 8
105: 97 | 1<<10, // keypad 9
-
+ 106: 85 | 1<<10, // keypad multiply
+ 107: 87 | 1<<10, // keypad plus
+ 109: 86 | 1<<10, // keypad minus
+ 110: 99 | 1<<10, // keypad decimal point
+ 111: 84 | 1<<10, // keypad divide
112: 58 | 1<<10, // F1
113: 59 | 1<<10, // F2
114: 60 | 1<<10, // F3
@@ -119,67 +130,121 @@ var LibrarySDL = {
120: 66 | 1<<10, // F9
121: 67 | 1<<10, // F10
122: 68 | 1<<10, // F11
- 123: 69 | 1<<10, // F12
-
+ 123: 69 | 1<<10, // F12
+ 124: 104 | 1<<10, // F13
+ 125: 105 | 1<<10, // F14
+ 126: 106 | 1<<10, // F15
+ 127: 107 | 1<<10, // F16
+ 128: 108 | 1<<10, // F17
+ 129: 109 | 1<<10, // F18
+ 130: 110 | 1<<10, // F19
+ 131: 111 | 1<<10, // F20
+ 132: 112 | 1<<10, // F21
+ 133: 113 | 1<<10, // F22
+ 134: 114 | 1<<10, // F23
+ 135: 115 | 1<<10, // F24
+
+ 144: 83 | 1<<10, // keypad num lock
+
+ 160: 94, // caret
+ 161: 33, // exclaim
+ 162: 34, // double quote
+ 163: 35, // hash
+ 164: 36, // dollar
+ 165: 37, // percent
+ 166: 38, // ampersand
+ 167: 95, // underscore
+ 168: 40, // open parenthesis
+ 169: 41, // close parenthesis
+ 170: 42, // asterix
+ 171: 43, // plus
+ 172: 124, // pipe
+ 173: 45, // minus
+ 174: 123, // open curly bracket
+ 175: 125, // close curly bracket
+ 176: 126, // tilde
+
+ 181: 127, // audio mute
+ 182: 129, // audio volume down
+ 183: 128, // audio volume up
+
188: 44, // comma
190: 46, // period
191: 47, // slash (/)
192: 96, // backtick/backquote (`)
+ 219: 91, // open square bracket
+ 220: 92, // back slash
+ 221: 93, // close square bracket
+ 222: 39, // quote
},
scanCodes: { // SDL keycode ==> SDL scancode. See SDL_scancode.h
+ 8: 42, // backspace
+ 9: 43, // tab
+ 13: 40, // return
+ 27: 41, // escape
+ 32: 44, // space
+ 35: 204, // hash
+
+ 39: 53, // grave
+
+ 44: 54, // comma
+ 46: 55, // period
+ 47: 56, // slash
+ 48: 39, // 0
+ 49: 30, // 1
+ 50: 31, // 2
+ 51: 32, // 3
+ 52: 33, // 4
+ 53: 34, // 5
+ 54: 35, // 6
+ 55: 36, // 7
+ 56: 37, // 8
+ 57: 38, // 9
+ 58: 203, // colon
+ 59: 51, // semicolon
+
+ 61: 46, // equals
+
+ 91: 47, // left bracket
+ 92: 49, // backslash
+ 93: 48, // right bracket
+
+ 96: 52, // apostrophe
97: 4, // A
- 98: 5,
- 99: 6,
- 100: 7,
- 101: 8,
- 102: 9,
- 103: 10,
- 104: 11,
- 105: 12,
- 106: 13,
- 107: 14,
- 108: 15,
- 109: 16,
- 110: 17,
- 111: 18,
- 112: 19,
- 113: 20,
- 114: 21,
- 115: 22,
- 116: 23,
- 117: 24,
- 118: 25,
- 119: 26,
- 120: 27,
- 121: 28,
+ 98: 5, // B
+ 99: 6, // C
+ 100: 7, // D
+ 101: 8, // E
+ 102: 9, // F
+ 103: 10, // G
+ 104: 11, // H
+ 105: 12, // I
+ 106: 13, // J
+ 107: 14, // K
+ 108: 15, // L
+ 109: 16, // M
+ 110: 17, // N
+ 111: 18, // O
+ 112: 19, // P
+ 113: 20, // Q
+ 114: 21, // R
+ 115: 22, // S
+ 116: 23, // T
+ 117: 24, // U
+ 118: 25, // V
+ 119: 26, // W
+ 120: 27, // X
+ 121: 28, // Y
122: 29, // Z
- 49: 30, // 1
- 50: 31,
- 51: 32,
- 52: 33,
- 53: 34,
- 54: 35,
- 55: 36,
- 56: 37,
- 57: 38, // 9
- 48: 39, // 0
- 13: 40, // return
- 27: 41, // escape
- 8: 42, // backspace
- 9: 43, // tab
- 32: 44, // space
- 61: 46, // equals
- 91: 47, // left bracket
- 93: 48, // right bracket
- 92: 49, // backslash
- 59: 51, // ;
- 96: 52, // apostrophe
- 44: 54, // comma
- 46: 55, // period
- 47: 56, // slash
+
+ 127: 76, // delete
+
305: 224, // ctrl
+
308: 226, // alt
+
+ 316: 70, // print screen
},
loadRect: function(rect) {
return {
@@ -346,6 +411,10 @@ var LibrarySDL = {
_free(info.pixelFormat);
_free(surf);
SDL.surfaces[surf] = null;
+
+ if (surf === SDL.screen) {
+ SDL.screen = null;
+ }
},
touchX: 0, touchY: 0,
@@ -971,7 +1040,7 @@ var LibrarySDL = {
// Free the old surface first.
if (SDL.screen) {
SDL.freeSurface(SDL.screen);
- SDL.screen = null;
+ assert(!SDL.screen);
}
SDL.screen = SDL.makeSurface(width, height, flags, true, 'screen');
if (!SDL.addedResizeListener) {
diff --git a/src/library_sockfs.js b/src/library_sockfs.js
index 22fd8761..23641464 100644
--- a/src/library_sockfs.js
+++ b/src/library_sockfs.js
@@ -133,12 +133,42 @@ mergeInto(LibraryManager.library, {
} else {
// create the actual websocket object and connect
try {
- var url = 'ws://' + addr + ':' + port;
+ // runtimeConfig gets set to true if WebSocket runtime configuration is available.
+ var runtimeConfig = (Module['websocket'] && ('object' === typeof Module['websocket']));
+
+ // The default value is 'ws://' the replace is needed because the compiler replaces "//" comments with '#'
+ // comments without checking context, so we'd end up with ws:#, the replace swaps the "#" for "//" again.
+ var url = '{{{ WEBSOCKET_URL }}}'.replace('#', '//');
+
+ if (runtimeConfig) {
+ if ('string' === typeof Module['websocket']['url']) {
+ url = Module['websocket']['url']; // Fetch runtime WebSocket URL config.
+ }
+ }
+
+ if (url === 'ws://' || url === 'wss://') { // Is the supplied URL config just a prefix, if so complete it.
+ url = url + addr + ':' + port;
+ }
+
+ // Make the WebSocket subprotocol (Sec-WebSocket-Protocol) default to binary if no configuration is set.
+ var subProtocols = '{{{ WEBSOCKET_SUBPROTOCOL }}}'; // The default value is 'binary'
+
+ if (runtimeConfig) {
+ if ('string' === typeof Module['websocket']['subprotocol']) {
+ subProtocols = Module['websocket']['subprotocol']; // Fetch runtime WebSocket subprotocol config.
+ }
+ }
+
+ // The regex trims the string (removes spaces at the beginning and end, then splits the string by
+ // <any space>,<any space> into an Array. Whitespace removal is important for Websockify and ws.
+ subProtocols = subProtocols.replace(/^ +| +$/g,"").split(/ *, */);
+
+ // The node ws library API for specifying optional subprotocol is slightly different than the browser's.
+ var opts = ENVIRONMENT_IS_NODE ? {'protocol': subProtocols.toString()} : subProtocols;
+
#if SOCKET_DEBUG
- console.log('connect: ' + url);
+ Module.print('connect: ' + url + ', ' + subProtocols.toString());
#endif
- // the node ws library API is slightly different than the browser's
- var opts = ENVIRONMENT_IS_NODE ? {headers: {'websocket-protocol': ['binary']}} : ['binary'];
// If node we use the ws library.
var WebSocket = ENVIRONMENT_IS_NODE ? require('ws') : window['WebSocket'];
ws = new WebSocket(url, opts);
diff --git a/src/relooper/test.cpp b/src/relooper/test.cpp
index 2b25001b..9f3ddceb 100644
--- a/src/relooper/test.cpp
+++ b/src/relooper/test.cpp
@@ -312,7 +312,7 @@ int main() {
printf("\n\n", "the_var");
r.Render();
- puts(buffer);
+ puts(r.GetOutputBuffer());
}
if (1) {
@@ -404,5 +404,36 @@ int main() {
puts(r.GetOutputBuffer());
}
+
+ if (1) {
+ Relooper::MakeOutputBuffer(10);
+
+ printf("\n\n-- If chain (optimized, lead to complex) --\n\n");
+
+ Block *b_a = new Block("// block A\n", NULL);
+ Block *b_b = new Block("// block B\n", NULL);
+ Block *b_c = new Block("// block C\n", NULL);
+ Block *b_d = new Block("// block D\n", NULL);
+
+ b_a->AddBranchTo(b_b, "a == 10", NULL);
+ b_a->AddBranchTo(b_d, NULL, NULL);
+
+ b_b->AddBranchTo(b_c, "b == 10", NULL);
+ b_b->AddBranchTo(b_d, NULL, NULL);
+
+ b_c->AddBranchTo(b_c, "loop", NULL);
+ b_c->AddBranchTo(b_d, NULL, NULL);
+
+ Relooper r;
+ r.AddBlock(b_a);
+ r.AddBlock(b_b);
+ r.AddBlock(b_c);
+ r.AddBlock(b_d);
+
+ r.Calculate(b_a);
+ r.Render();
+
+ puts(r.GetOutputBuffer());
+ }
}
diff --git a/src/relooper/test.txt b/src/relooper/test.txt
index 1fa205ba..d53aeeb1 100644
--- a/src/relooper/test.txt
+++ b/src/relooper/test.txt
@@ -324,10 +324,6 @@
label = 1;
L0: while(1) {
switch(label|0) {
- case 3: {
- // block C
- break;
- }
case 1: {
// block A
if (check == 10) {
@@ -357,6 +353,10 @@
}
break;
}
+ case 3: {
+ // block C
+ break;
+ }
}
}
@@ -399,3 +399,21 @@
}
// block E
+
+
+-- If chain (optimized, lead to complex) --
+
+ // block A
+ if (a == 10) {
+ // block B
+ if (b == 10) {
+ while(1) {
+ // block C
+ if (!(loop)) {
+ break;
+ }
+ }
+ }
+ }
+ // block D
+
diff --git a/src/runtime.js b/src/runtime.js
index 2ae68279..63610d3b 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -399,17 +399,23 @@ var Runtime = {
for (var i = 0; i < numArgs; i++) {
args.push(String.fromCharCode(36) + i); // $0, $1 etc
}
- code = Pointer_stringify(code);
- if (code[0] === '"') {
+ var source = Pointer_stringify(code);
+ if (source[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);
+ if (source.indexOf('"', 1) === source.length-1) {
+ source = source.substr(1, source.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)');
+ abort('invalid EM_ASM input |' + source + '|. 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
+ try {
+ var evalled = eval('(function(' + args.join(',') + '){ ' + source + ' })'); // new Function does not allow upvars in node
+ } catch(e) {
+ Module.printErr('error in executing inline EM_ASM code: ' + e + ' on: \n\n' + source + '\n\nwith args |' + args + '| (make sure to use the right one out of EM_ASM, EM_ASM_ARGS, etc.)');
+ throw e;
+ }
+ return Runtime.asmConstCache[code] = evalled;
},
warnOnce: function(text) {
diff --git a/src/settings.js b/src/settings.js
index 1c41676d..8b046e95 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -165,8 +165,14 @@ var OUTLINING_LIMIT = 0; // A function size above which we try to automatically
// throughput. It is hard to say what values to start testing
// with, but something around 20,000 to 100,000 might make sense.
// (The unit size is number of AST nodes.)
+ // Outlining decreases maximum function size, but does so at the
+ // cost of increasing overall code size as well as performance
+ // (outlining itself makes code less optimized, and requires
+ // emscripten to disable some passes that are incompatible with
+ // it).
var AGGRESSIVE_VARIABLE_ELIMINATION = 0; // Run aggressiveVariableElimination in js-optimizer.js
+var SIMPLIFY_IFS = 1; // Whether to simplify ifs in js-optimizer.js
// Generated code debugging options
var SAFE_HEAP = 0; // Check each write to the heap, for example, this will give a clear
@@ -225,6 +231,19 @@ var LIBRARY_DEBUG = 0; // Print out when we enter a library call (library*.js).
var SOCKET_DEBUG = 0; // Log out socket/network data transfer.
var SOCKET_WEBRTC = 0; // Select socket backend, either webrtc or websockets.
+// As well as being configurable at compile time via the "-s" option the WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL
+// settings may configured at run time via the Module object e.g.
+// Module['websocket'] = {subprotocol: 'base64, binary, text'};
+// Module['websocket'] = {url: 'wss://', subprotocol: 'base64'};
+// Run time configuration may be useful as it lets an application select multiple different services.
+var WEBSOCKET_URL = 'ws://'; // A string containing either a WebSocket URL prefix (ws:// or wss://) or a complete
+ // RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ].
+ // In the (default) case of only a prefix being specified the URL will be constructed from
+ // prefix + addr + ':' + port
+ // where addr and port are derived from the socket connect/bind/accept calls.
+var WEBSOCKET_SUBPROTOCOL = 'binary'; // A string containing a comma separated list of WebSocket subprotocols
+ // as would be present in the Sec-WebSocket-Protocol header.
+
var OPENAL_DEBUG = 0; // Print out debugging information from our OpenAL implementation.
var GL_ASSERTIONS = 0; // Adds extra checks for error situations in the GL library. Can impact performance.
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h
index 390533f3..872f279b 100644
--- a/system/include/emscripten/bind.h
+++ b/system/include/emscripten/bind.h
@@ -17,8 +17,6 @@ namespace emscripten {
BY_EMVAL = 2,
};
-#define EMSCRIPTEN_ALWAYS_INLINE __attribute__((always_inline))
-
namespace internal {
typedef long GenericEnumValue;
@@ -35,18 +33,21 @@ namespace emscripten {
void _embind_register_bool(
TYPEID boolType,
const char* name,
+ size_t size,
bool trueValue,
bool falseValue);
void _embind_register_integer(
TYPEID integerType,
const char* name,
+ size_t size,
long minRange,
unsigned long maxRange);
void _embind_register_float(
TYPEID floatType,
- const char* name);
+ const char* name,
+ size_t size);
void _embind_register_std_string(
TYPEID stringType,
@@ -163,7 +164,9 @@ namespace emscripten {
void _embind_register_enum(
TYPEID enumType,
- const char* name);
+ const char* name,
+ size_t size,
+ bool isSigned);
void _embind_register_enum_value(
TYPEID enumType,
@@ -1182,7 +1185,9 @@ namespace emscripten {
enum_(const char* name) {
_embind_register_enum(
internal::TypeID<EnumType>::get(),
- name);
+ name,
+ sizeof(EnumType),
+ std::is_signed<typename std::underlying_type<EnumType>::type>::value);
}
enum_& value(const char* name, EnumType value) {
diff --git a/system/include/emscripten/emscripten.h b/system/include/emscripten/emscripten.h
index 2b883f93..73836018 100644
--- a/system/include/emscripten/emscripten.h
+++ b/system/include/emscripten/emscripten.h
@@ -42,8 +42,8 @@ extern "C" {
/*
* 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_ (an extra _ is added) or EM_ASM_ARGS allow 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.
@@ -60,6 +60,7 @@ extern "C" {
* EM_ASM_INT_V and EM_ASM_DOUBLE_V respectively.
*/
#define EM_ASM_(code, ...) emscripten_asm_const_int(#code, __VA_ARGS__)
+#define EM_ASM_ARGS(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)
diff --git a/system/include/emscripten/val.h b/system/include/emscripten/val.h
index 19b1beb1..e217c959 100644
--- a/system/include/emscripten/val.h
+++ b/system/include/emscripten/val.h
@@ -2,6 +2,7 @@
#include <stdint.h> // uintptr_t
#include <emscripten/wire.h>
+#include <array>
#include <vector>
namespace emscripten {
@@ -12,12 +13,10 @@ namespace emscripten {
typedef struct _EM_VAL* EM_VAL;
typedef struct _EM_DESTRUCTORS* EM_DESTRUCTORS;
+ typedef struct _EM_METHOD_CALLER* EM_METHOD_CALLER;
+ typedef double EM_GENERIC_WIRE_TYPE;
+ typedef const void* EM_VAR_ARGS;
- // 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);
@@ -28,37 +27,45 @@ namespace emscripten {
EM_VAL _emval_undefined();
EM_VAL _emval_null();
EM_VAL _emval_new_cstring(const char*);
- void _emval_take_value(TYPEID type/*, ...*/);
+
+ EM_VAL _emval_take_value(TYPEID type, EM_VAR_ARGS argv);
EM_VAL _emval_new(
EM_VAL value,
unsigned argCount,
- internal::TYPEID argTypes[]
- /*, ... */);
+ internal::TYPEID argTypes[],
+ EM_VAR_ARGS argv);
EM_VAL _emval_get_global(const char* name);
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);
- _POLYMORPHIC_RESULT _emval_as(EM_VAL value, TYPEID returnType, EM_DESTRUCTORS* runDestructors);
+ EM_GENERIC_WIRE_TYPE _emval_as(EM_VAL value, TYPEID returnType, EM_DESTRUCTORS* destructors);
EM_VAL _emval_call(
EM_VAL value,
unsigned argCount,
- internal::TYPEID argTypes[]
- /*, ... */);
+ internal::TYPEID argTypes[],
+ EM_VAR_ARGS argv);
- // DO NOT call this more than once per signature. It will leak function pointer offsets!
- GenericFunction _emval_get_method_caller(
+ // DO NOT call this more than once per signature. It will
+ // leak generated function objects!
+ EM_METHOD_CALLER _emval_get_method_caller(
unsigned argCount, // including return value
internal::TYPEID argTypes[]);
+ EM_GENERIC_WIRE_TYPE _emval_call_method(
+ EM_METHOD_CALLER caller,
+ EM_VAL handle,
+ const char* methodName,
+ EM_DESTRUCTORS* destructors,
+ EM_VAR_ARGS argv);
bool _emval_has_function(
EM_VAL value,
const char* methodName);
}
template<const char* address>
- struct symbol_registrar {
+ struct symbol_registrar {
symbol_registrar() {
internal::_emval_register_symbol(address);
}
@@ -66,19 +73,21 @@ namespace emscripten {
template<typename ReturnType, typename... Args>
struct Signature {
+ /*
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());
- return fp;
+ static EM_METHOD_CALLER get_method_caller() {
+ static EM_METHOD_CALLER mc = init_method_caller();
+ return mc;
}
private:
- static GenericFunction init_method_caller() {
+ static EM_METHOD_CALLER init_method_caller() {
WithPolicies<>::ArgTypeList<ReturnType, Args...> args;
return _emval_get_method_caller(args.count, args.types);
}
@@ -100,19 +109,119 @@ namespace emscripten {
EM_DESTRUCTORS destructors;
};
+ template<typename WireType>
+ struct GenericWireTypeConverter {
+ static WireType from(double wt) {
+ return static_cast<WireType>(wt);
+ }
+ };
+
+ template<typename Pointee>
+ struct GenericWireTypeConverter<Pointee*> {
+ static Pointee* from(double wt) {
+ return reinterpret_cast<Pointee*>(static_cast<uintptr_t>(wt));
+ }
+ };
+
+ template<typename T>
+ T fromGenericWireType(double g) {
+ typedef typename BindingType<T>::WireType WireType;
+ WireType wt = GenericWireTypeConverter<WireType>::from(g);
+ return BindingType<T>::fromWireType(wt);
+ }
+
+ template<typename... Args>
+ struct PackSize;
+
+ template<>
+ struct PackSize<> {
+ static constexpr size_t value = 0;
+ };
+
+ template<typename Arg, typename... Args>
+ struct PackSize<Arg, Args...> {
+ static constexpr size_t value = (sizeof(typename BindingType<Arg>::WireType) + 7) / 8 + PackSize<Args...>::value;
+ };
+
+ union GenericWireType {
+ union {
+ unsigned u;
+ float f;
+ const void* p;
+ } w[2];
+ double d;
+ };
+ static_assert(sizeof(GenericWireType) == 8, "GenericWireType must be 8 bytes");
+ static_assert(alignof(GenericWireType) == 8, "GenericWireType must be 8-byte-aligned");
+
+ inline void writeGenericWireType(GenericWireType*& cursor, float wt) {
+ cursor->w[0].f = wt;
+ ++cursor;
+ }
+
+ inline void writeGenericWireType(GenericWireType*& cursor, double wt) {
+ cursor->d = wt;
+ ++cursor;
+ }
+
+ template<typename T>
+ void writeGenericWireType(GenericWireType*& cursor, T* wt) {
+ cursor->w[0].p = wt;
+ ++cursor;
+ }
+
+ inline void writeGenericWireType(GenericWireType*& cursor, const memory_view& wt) {
+ cursor[0].w[0].u = static_cast<unsigned>(wt.type);
+ cursor[0].w[1].u = wt.size;
+ cursor[1].w[0].p = wt.data;
+ cursor += 2;
+ }
+
+ template<typename T>
+ void writeGenericWireType(GenericWireType*& cursor, T wt) {
+ cursor->w[0].u = static_cast<unsigned>(wt);
+ ++cursor;
+ }
+
+ inline void writeGenericWireTypes(GenericWireType*&) {
+ }
+
+ template<typename First, typename... Rest>
+ EMSCRIPTEN_ALWAYS_INLINE void writeGenericWireTypes(GenericWireType*& cursor, First&& first, Rest&&... rest) {
+ writeGenericWireType(cursor, BindingType<First>::toWireType(std::forward<First>(first)));
+ writeGenericWireTypes(cursor, std::forward<Rest>(rest)...);
+ }
+
+ template<typename... Args>
+ struct WireTypePack {
+ WireTypePack(Args&&... args) {
+ GenericWireType* cursor = elements.data();
+ writeGenericWireTypes(cursor, std::forward<Args>(args)...);
+ }
+
+ operator EM_VAR_ARGS() const {
+ return elements.data();
+ }
+
+ private:
+ std::array<GenericWireType, PackSize<Args...>::value> elements;
+ };
+
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();
+ WireTypePack<Args...> argv(std::forward<Args>(args)...);
EM_DESTRUCTORS destructors;
- auto wireType = caller(
+ EM_GENERIC_WIRE_TYPE result = _emval_call_method(
+ caller,
handle,
methodName,
&destructors,
- toWireType(std::forward<Args>(args))...);
+ argv);
DestructorsRunner rd(destructors);
- return BindingType<ReturnType>::fromWireType(wireType);
+ return fromGenericWireType<ReturnType>(result);
}
};
@@ -121,12 +230,14 @@ namespace emscripten {
static void call(EM_VAL handle, const char* methodName, Args&&... args) {
auto caller = Signature<void, Args...>::get_method_caller();
+ WireTypePack<Args...> argv(std::forward<Args>(args)...);
EM_DESTRUCTORS destructors;
- caller(
+ _emval_call_method(
+ caller,
handle,
methodName,
&destructors,
- toWireType(std::forward<Args>(args))...);
+ argv);
DestructorsRunner rd(destructors);
// void requires no translation
}
@@ -185,9 +296,13 @@ namespace emscripten {
template<typename T>
explicit val(T&& value) {
+ using namespace internal;
+
typedef internal::BindingType<T> BT;
- auto taker = reinterpret_cast<internal::EM_VAL (*)(internal::TYPEID, typename BT::WireType)>(&internal::_emval_take_value);
- handle = taker(internal::TypeID<T>::get(), BT::toWireType(std::forward<T>(value)));
+ WireTypePack<T> argv(std::forward<T>(value));
+ handle = _emval_take_value(
+ internal::TypeID<T>::get(),
+ argv);
}
val() = delete;
@@ -235,20 +350,15 @@ namespace emscripten {
using namespace internal;
WithPolicies<>::ArgTypeList<Args...> argList;
+ WireTypePack<Args...> argv(std::forward<Args>(args)...);
// todo: this is awfully similar to operator(), can we
// merge them somehow?
- typedef EM_VAL (*TypedNew)(
- EM_VAL,
- unsigned,
- TYPEID argTypes[],
- typename BindingType<Args>::WireType...);
- TypedNew typedNew = reinterpret_cast<TypedNew>(&_emval_new);
return val(
- typedNew(
+ _emval_new(
handle,
argList.count,
argList.types,
- toWireType(std::forward<Args>(args))...));
+ argv));
}
template<typename T>
@@ -266,18 +376,13 @@ namespace emscripten {
using namespace internal;
WithPolicies<>::ArgTypeList<Args...> argList;
- typedef EM_VAL (*TypedCall)(
- EM_VAL,
- unsigned,
- TYPEID argTypes[],
- typename BindingType<Args>::WireType...);
- TypedCall typedCall = reinterpret_cast<TypedCall>(&_emval_call);
+ WireTypePack<Args...> argv(std::forward<Args>(args)...);
return val(
- typedCall(
+ _emval_call(
handle,
argList.count,
argList.types,
- toWireType(std::forward<Args>(args))...));
+ argv));
}
template<typename ReturnValue, typename... Args>
@@ -297,16 +402,13 @@ namespace emscripten {
typedef BindingType<T> BT;
- typedef typename BT::WireType (*TypedAs)(
- EM_VAL value,
- TYPEID returnType,
- EM_DESTRUCTORS* runDestructors);
- TypedAs typedAs = reinterpret_cast<TypedAs>(&_emval_as);
-
EM_DESTRUCTORS destructors;
- typename BT::WireType wt = typedAs(handle, TypeID<T>::get(), &destructors);
+ EM_GENERIC_WIRE_TYPE result = _emval_as(
+ handle,
+ TypeID<T>::get(),
+ &destructors);
DestructorsRunner dr(destructors);
- return BT::fromWireType(wt);
+ return fromGenericWireType<T>(result);
}
private:
diff --git a/system/include/emscripten/wire.h b/system/include/emscripten/wire.h
index c3ce8dd0..05b3ac33 100644
--- a/system/include/emscripten/wire.h
+++ b/system/include/emscripten/wire.h
@@ -12,6 +12,8 @@
#include <memory>
#include <string>
+#define EMSCRIPTEN_ALWAYS_INLINE __attribute__((always_inline))
+
namespace emscripten {
namespace internal {
typedef void (*GenericFunction)();
diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp
index 12264dfd..f43d1ea1 100644
--- a/system/lib/embind/bind.cpp
+++ b/system/lib/embind/bind.cpp
@@ -8,6 +8,7 @@
#include <algorithm>
#include <emscripten/emscripten.h>
#include <climits>
+#include <limits>
using namespace emscripten;
@@ -36,25 +37,39 @@ extern "C" {
}
}
+namespace {
+ template<typename T>
+ static void register_integer(const char* name) {
+ using namespace internal;
+ _embind_register_integer(TypeID<T>::get(), name, sizeof(T), std::numeric_limits<T>::min(), std::numeric_limits<T>::max());
+ }
+
+ template<typename T>
+ static void register_float(const char* name) {
+ using namespace internal;
+ _embind_register_float(TypeID<T>::get(), name, sizeof(T));
+ }
+}
+
EMSCRIPTEN_BINDINGS(native_and_builtin_types) {
using namespace emscripten::internal;
_embind_register_void(TypeID<void>::get(), "void");
- _embind_register_bool(TypeID<bool>::get(), "bool", true, false);
-
- _embind_register_integer(TypeID<char>::get(), "char", CHAR_MIN, CHAR_MAX);
- _embind_register_integer(TypeID<signed char>::get(), "signed char", SCHAR_MIN, SCHAR_MAX);
- _embind_register_integer(TypeID<unsigned char>::get(), "unsigned char", 0, UCHAR_MAX);
- _embind_register_integer(TypeID<signed short>::get(), "short", SHRT_MIN, SHRT_MAX);
- _embind_register_integer(TypeID<unsigned short>::get(), "unsigned short", 0, USHRT_MAX);
- _embind_register_integer(TypeID<signed int>::get(), "int", INT_MIN, INT_MAX);
- _embind_register_integer(TypeID<unsigned int>::get(), "unsigned int", 0, UINT_MAX);
- _embind_register_integer(TypeID<signed long>::get(), "long", LONG_MIN, LONG_MAX);
- _embind_register_integer(TypeID<unsigned long>::get(), "unsigned long", 0, ULONG_MAX);
+ _embind_register_bool(TypeID<bool>::get(), "bool", sizeof(bool), true, false);
+
+ register_integer<char>("char");
+ register_integer<signed char>("signed char");
+ register_integer<unsigned char>("unsigned char");
+ register_integer<signed short>("short");
+ register_integer<unsigned short>("unsigned short");
+ register_integer<signed int>("int");
+ register_integer<unsigned int>("unsigned int");
+ register_integer<signed long>("long");
+ register_integer<unsigned long>("unsigned long");
- _embind_register_float(TypeID<float>::get(), "float");
- _embind_register_float(TypeID<double>::get(), "double");
+ register_float<float>("float");
+ register_float<double>("double");
_embind_register_std_string(TypeID<std::string>::get(), "std::string");
_embind_register_std_wstring(TypeID<std::wstring>::get(), sizeof(wchar_t), "std::wstring");
diff --git a/tests/cases/fixablebadcasts_fastcomp.ll b/tests/cases/fixablebadcasts_fastcomp.ll
new file mode 100644
index 00000000..3870e0e0
--- /dev/null
+++ b/tests/cases/fixablebadcasts_fastcomp.ll
@@ -0,0 +1,27 @@
+; 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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [18 x i8] c"hello, world %d!\0A\00", align 1
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ store i32 0, i32* %retval
+ %a = call i32 bitcast (i32 (i32)* @twoparam to i32 (i32, i32)*)(i32 5, i32 6)
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %a) ; [#uses=0 type=i32]
+ call void bitcast (void (i32, i32*, i32*)* @_ZN7WebCore33signedPublicKeyAndChallengeStringEjRKN3WTF6StringERKNS_3URLE to void (i32*, i32, i32*, i32*)*)(i32* sret null, i32 0, i32* null, i32* null)
+ ret i32 1
+}
+
+define i32 @twoparam(i32 %x) {
+ ret i32 %x
+}
+
+define void @_ZN7WebCore33signedPublicKeyAndChallengeStringEjRKN3WTF6StringERKNS_3URLE(i32, i32* nocapture, i32* nocapture) {
+ ret void
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/fixablebadcasts_fastcomp.txt b/tests/cases/fixablebadcasts_fastcomp.txt
new file mode 100644
index 00000000..47abd748
--- /dev/null
+++ b/tests/cases/fixablebadcasts_fastcomp.txt
@@ -0,0 +1 @@
+hello, world 5!
diff --git a/tests/cases/i24_ce_fastcomp.ll b/tests/cases/i24_ce_fastcomp.ll
new file mode 100644
index 00000000..69b580a2
--- /dev/null
+++ b/tests/cases/i24_ce_fastcomp.ll
@@ -0,0 +1,11393 @@
+; 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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+; Tests i24 constantExprs nested heavily
+
+%struct.S0 = type { i16, i8, i32 }
+%struct.malloc_state = type { i32, i32, i32, i32, i8*, %struct.malloc_chunk*, %struct.malloc_chunk*, i32, i32, i32, [66 x %struct.malloc_chunk*], [32 x %struct.malloc_tree_chunk*], i32, i32, i32, i32, %struct.malloc_segment, i8*, i32 }
+%struct.malloc_chunk = type { i32, i32, %struct.malloc_chunk*, %struct.malloc_chunk* }
+%struct.malloc_tree_chunk = type { i32, i32, %struct.malloc_tree_chunk*, %struct.malloc_tree_chunk*, [2 x %struct.malloc_tree_chunk*], %struct.malloc_tree_chunk*, i32 }
+%struct.malloc_segment = type { i8*, i32, %struct.malloc_segment*, i32 }
+%struct.malloc_params = type { i32, i32, i32, i32, i32, i32 }
+%struct._IO_FILE = type { i32, i8*, i8*, i32 (%struct._IO_FILE*)*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE*, i8*, i32)*, i32 (%struct._IO_FILE*, i8*, i32)*, i32 (%struct._IO_FILE*, i32, i32)*, i8*, i32, %struct._IO_FILE*, %struct._IO_FILE*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 }
+%"struct.std::nothrow_t" = type { i8 }
+%"class.std::bad_alloc" = type { %"class.std::exception" }
+%"class.std::exception" = type { i32 (...)** }
+%"class.std::bad_array_new_length" = type { %"class.std::bad_alloc" }
+%"class.std::bad_array_length" = type { %"class.std::bad_alloc" }
+%struct.__locale_struct = type opaque
+%struct.__locale_struct.0 = type opaque
+%struct.__locale_struct.1 = type opaque
+%union.U1 = type { i8* }
+%struct.mallinfo = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
+%struct._IO_FILE.3 = type { i32, i8*, i8*, {}*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE.3*, i8*, i32)*, i32 (%struct._IO_FILE.3*, i8*, i32)*, i32 (%struct._IO_FILE.3*, i32, i32)*, i8*, i32, %struct._IO_FILE.3*, %struct._IO_FILE.3*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 }
+%struct._IO_FILE.4 = type { i32, i8*, i8*, {}*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE.4*, i8*, i32)*, i32 (%struct._IO_FILE.4*, i8*, i32)*, i32 (%struct._IO_FILE.4*, i32, i32)*, i8*, i32, %struct._IO_FILE.4*, %struct._IO_FILE.4*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 }
+
+@.str = private unnamed_addr constant [2 x i8] c"1\00", align 1
+@_ZL3g_2 = internal global i32 -8, align 4
+@.str1 = private unnamed_addr constant [4 x i8] c"g_2\00", align 1
+@_ZL4g_52 = internal global [4 x [6 x [6 x i8]]] [[6 x [6 x i8]] [[6 x i8] c"\00\02Q\07\07Q", [6 x i8] c"\09\09\8F\01\00\00", [6 x i8] c"\FFO\09\07\00\8F", [6 x i8] c"\D1\FF\09\02\09\00", [6 x i8] c"\FD\02\8FE\FFQ", [6 x i8] c"E\FFQ\01\D1\D1"], [6 x [6 x i8]] [[6 x i8] c"EOOE\FD\8F", [6 x i8] c"\FD\09\01\02E\D1", [6 x i8] c"\D1\02M\07EQ", [6 x i8] c"\FF\09\01\01\FD\00", [6 x i8] c"\09O\02\07\D1\8F", [6 x i8] c"\00\FF\02\02\FF\00"], [6 x [6 x i8]] [[6 x i8] c"\00\02\01E\09Q", [6 x i8] c"\07\FFM\01\00\D1", [6 x i8] c"\07O\01E\00\8F", [6 x i8] c"\00\09O\02\07\D1", [6 x i8] c"\00\02Q\07\07Q", [6 x i8] c"\09\09\8F\01\00\00"], [6 x [6 x i8]] [[6 x i8] c"\FFO\09\07\00\8F", [6 x i8] c"\D1\FF\09\02\09\00", [6 x i8] c"\FD\02\8FE\FFQ", [6 x i8] c"E\FFQ\01\D1\D1", [6 x i8] c"EOOE\FD\8F", [6 x i8] c"\FD\09\01\02E\D1"]], align 1
+@.str2 = private unnamed_addr constant [14 x i8] c"g_52[i][j][k]\00", align 1
+@.str3 = private unnamed_addr constant [22 x i8] c"index = [%d][%d][%d]\0A\00", align 1
+@_ZL4g_53 = internal global i32 -1550080695, align 4
+@.str4 = private unnamed_addr constant [5 x i8] c"g_53\00", align 1
+@.str5 = private unnamed_addr constant [8 x i8] c"g_74.f0\00", align 1
+@.str6 = private unnamed_addr constant [8 x i8] c"g_74.f4\00", align 1
+@_ZL4g_77 = internal global i16 1, align 2
+@.str7 = private unnamed_addr constant [5 x i8] c"g_77\00", align 1
+@_ZL4g_79 = internal global i16 -1, align 2
+@.str8 = private unnamed_addr constant [5 x i8] c"g_79\00", align 1
+@_ZL4g_82 = internal global i16 -4597, align 2
+@.str9 = private unnamed_addr constant [5 x i8] c"g_82\00", align 1
+@_ZL4g_83 = internal global %struct.S0 { i16 -20724, i8 -72, i32 1 }, align 8
+@.str10 = private unnamed_addr constant [8 x i8] c"g_83.f0\00", align 1
+@.str11 = private unnamed_addr constant [8 x i8] c"g_83.f1\00", align 1
+@.str12 = private unnamed_addr constant [8 x i8] c"g_83.f2\00", align 1
+@_ZL4g_93 = internal global i32 -911546352, align 4
+@.str13 = private unnamed_addr constant [5 x i8] c"g_93\00", align 1
+@_ZL5g_103 = internal global i16 -1, align 2
+@.str14 = private unnamed_addr constant [6 x i8] c"g_103\00", align 1
+@_ZL5g_126 = internal global i8 6, align 1
+@.str15 = private unnamed_addr constant [6 x i8] c"g_126\00", align 1
+@_ZL5g_132 = internal global i32 -782244254, align 4
+@.str16 = private unnamed_addr constant [6 x i8] c"g_132\00", align 1
+@_ZL5g_133 = internal unnamed_addr global i8 -17, align 1
+@.str17 = private unnamed_addr constant [6 x i8] c"g_133\00", align 1
+@_ZL5g_135 = internal global i32 -3, align 4
+@.str18 = private unnamed_addr constant [6 x i8] c"g_135\00", align 1
+@_ZL5g_136 = internal global i8 -1, align 1
+@.str19 = private unnamed_addr constant [6 x i8] c"g_136\00", align 1
+@_ZL5g_138 = internal global i32 1083335064, align 4
+@.str20 = private unnamed_addr constant [6 x i8] c"g_138\00", align 1
+@_ZL5g_162 = internal global i16 17495, align 2
+@.str21 = private unnamed_addr constant [6 x i8] c"g_162\00", align 1
+@_ZL5g_168 = internal global i16 8, align 2
+@.str22 = private unnamed_addr constant [6 x i8] c"g_168\00", align 1
+@_ZL5g_170 = internal global i8 -109, align 1
+@.str23 = private unnamed_addr constant [6 x i8] c"g_170\00", align 1
+@_ZL5g_171 = internal global [8 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF", align 1
+@.str24 = private unnamed_addr constant [9 x i8] c"g_171[i]\00", align 1
+@.str25 = private unnamed_addr constant [14 x i8] c"index = [%d]\0A\00", align 1
+@_ZL5g_172 = internal global i16 0, align 2
+@.str26 = private unnamed_addr constant [6 x i8] c"g_172\00", align 1
+@_ZL5g_257 = internal global i32 2067456055, align 4
+@.str27 = private unnamed_addr constant [6 x i8] c"g_257\00", align 1
+@_ZL5g_304 = internal global i8 1, align 1
+@.str28 = private unnamed_addr constant [6 x i8] c"g_304\00", align 1
+@_ZL5g_308 = internal global i16 -3, align 2
+@.str29 = private unnamed_addr constant [6 x i8] c"g_308\00", align 1
+@_ZL5g_361 = internal global i16 1, align 2
+@.str30 = private unnamed_addr constant [6 x i8] c"g_361\00", align 1
+@_ZL5g_400 = internal global i32 711639049, align 4
+@.str31 = private unnamed_addr constant [6 x i8] c"g_400\00", align 1
+@.str32 = private unnamed_addr constant [6 x i8] c"g_428\00", align 1
+@_ZL5g_471 = internal global %struct.S0 { i16 0, i8 6, i32 1033957816 }, align 8
+@.str33 = private unnamed_addr constant [9 x i8] c"g_471.f0\00", align 1
+@.str34 = private unnamed_addr constant [9 x i8] c"g_471.f1\00", align 1
+@.str35 = private unnamed_addr constant [9 x i8] c"g_471.f2\00", align 1
+@_ZL5g_546 = internal global i32 1, align 4
+@.str36 = private unnamed_addr constant [6 x i8] c"g_546\00", align 1
+@.str37 = private unnamed_addr constant [6 x i8] c"g_687\00", align 1
+@.str38 = private unnamed_addr constant [6 x i8] c"g_711\00", align 1
+@_ZL5g_935 = internal unnamed_addr constant [10 x i32] [i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994], align 4
+@.str39 = private unnamed_addr constant [9 x i8] c"g_935[i]\00", align 1
+@_ZL6g_1010 = internal global i8 1, align 1
+@.str40 = private unnamed_addr constant [7 x i8] c"g_1010\00", align 1
+@_ZL6g_1025 = internal unnamed_addr global i8 -7, align 1
+@.str41 = private unnamed_addr constant [7 x i8] c"g_1025\00", align 1
+@_ZL6g_1136 = internal unnamed_addr global i8 -108, align 1
+@.str42 = private unnamed_addr constant [7 x i8] c"g_1136\00", align 1
+@.str43 = private unnamed_addr constant [7 x i8] c"g_1165\00", align 1
+@.str44 = private unnamed_addr constant [7 x i8] c"g_1176\00", align 1
+@_ZL6g_1198 = internal global i32 1, align 4
+@.str45 = private unnamed_addr constant [7 x i8] c"g_1198\00", align 1
+@_ZL6g_1442 = internal unnamed_addr constant [8 x i32] [i32 -3, i32 -1424736723, i32 -1424736723, i32 -3, i32 -1424736723, i32 -1424736723, i32 -3, i32 -1424736723], align 4
+@.str46 = private unnamed_addr constant [10 x i8] c"g_1442[i]\00", align 1
+@_ZL13crc32_context = internal unnamed_addr global i32 -1, align 4
+@.str47 = private unnamed_addr constant [15 x i8] c"checksum = %X\0A\00", align 1
+@_ZL4g_74 = internal global { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, align 4
+@.str48 = private unnamed_addr constant [36 x i8] c"...checksum after hashing %s : %lX\0A\00", align 1
+@_ZL9crc32_tab = internal unnamed_addr global [256 x i32] zeroinitializer, align 4
+@_ZZL6func_1vE6l_1011 = private unnamed_addr constant [7 x [1 x [7 x %struct.S0]]] [[1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }]]], align 8
+@_ZL5g_984 = internal global i8** @_ZL5g_985, align 4
+@_ZZL6func_1vE6l_1499 = private unnamed_addr constant [9 x i8] c"\98\98\98\98\98\98\98\98\98", align 1
+@_ZZL6func_1vE6l_1006 = private unnamed_addr constant [10 x [7 x [3 x i32]]] [[7 x [3 x i32]] [[3 x i32] [i32 1841884517, i32 -1, i32 -1613798643], [3 x i32] [i32 2091444926, i32 -2138639918, i32 0], [3 x i32] [i32 283017736, i32 -7, i32 1698185546], [3 x i32] [i32 1628157269, i32 0, i32 1044216359], [3 x i32] [i32 1547065395, i32 -1, i32 -7], [3 x i32] [i32 8, i32 -1, i32 1], [3 x i32] [i32 1841884517, i32 0, i32 2]], [7 x [3 x i32]] [[3 x i32] [i32 7, i32 -7, i32 2087377514], [3 x i32] [i32 834421965, i32 -2138639918, i32 2], [3 x i32] [i32 1, i32 -1, i32 1044216359], [3 x i32] [i32 7, i32 -10, i32 -1], [3 x i32] [i32 7, i32 -1, i32 -328727838], [3 x i32] [i32 360433363, i32 -2138639918, i32 -1613798643], [3 x i32] [i32 1547065395, i32 -7, i32 -1]], [7 x [3 x i32]] [[3 x i32] [i32 0, i32 0, i32 -1129666350], [3 x i32] [i32 -1120699426, i32 -1, i32 -8], [3 x i32] [i32 2091444926, i32 -1, i32 2087377514], [3 x i32] [i32 7, i32 0, i32 -5], [3 x i32] [i32 679230240, i32 -7, i32 -5], [3 x i32] [i32 1, i32 -2138639918, i32 -7], [3 x i32] [i32 834421965, i32 -1, i32 -1129666350]], [7 x [3 x i32]] [[3 x i32] [i32 679230240, i32 -10, i32 -4], [3 x i32] [i32 -1, i32 -1, i32 0], [3 x i32] [i32 8, i32 -2138639918, i32 -328727838], [3 x i32] [i32 -1120699426, i32 -7, i32 -4], [3 x i32] [i32 1, i32 0, i32 -1], [3 x i32] [i32 283017736, i32 -1, i32 2], [3 x i32] [i32 360433363, i32 -1, i32 -5]], [7 x [3 x i32]] [[3 x i32] [i32 -1, i32 0, i32 0], [3 x i32] [i32 555482698, i32 -7, i32 1], [3 x i32] [i32 1, i32 -2138639918, i32 -8], [3 x i32] [i32 1, i32 -1, i32 -1], [3 x i32] [i32 555482698, i32 -10, i32 1698185546], [3 x i32] [i32 1841884517, i32 -1, i32 -1613798643], [3 x i32] [i32 2091444926, i32 -2138639918, i32 0]], [7 x [3 x i32]] [[3 x i32] [i32 283017736, i32 -7, i32 1698185546], [3 x i32] [i32 1628157269, i32 0, i32 1044216359], [3 x i32] [i32 1547065395, i32 -1, i32 -7], [3 x i32] [i32 8, i32 -1, i32 1], [3 x i32] [i32 1841884517, i32 0, i32 2], [3 x i32] [i32 7, i32 -7, i32 2087377514], [3 x i32] [i32 834421965, i32 -2138639918, i32 2]], [7 x [3 x i32]] [[3 x i32] [i32 1, i32 1023954582, i32 -1], [3 x i32] [i32 -1, i32 -1579985206, i32 8], [3 x i32] [i32 2, i32 1023954582, i32 -1425719182], [3 x i32] [i32 87909934, i32 0, i32 0], [3 x i32] [i32 0, i32 7, i32 8], [3 x i32] [i32 702414371, i32 0, i32 2], [3 x i32] [i32 -328727838, i32 -2, i32 -2]], [7 x [3 x i32]] [[3 x i32] [i32 -10, i32 -2, i32 96667756], [3 x i32] [i32 2, i32 0, i32 1924945160], [3 x i32] [i32 -1, i32 7, i32 -1402097775], [3 x i32] [i32 -1, i32 0, i32 7], [3 x i32] [i32 -4, i32 1023954582, i32 2], [3 x i32] [i32 -1, i32 -1579985206, i32 73780325], [3 x i32] [i32 0, i32 1023954582, i32 -1893771394]], [7 x [3 x i32]] [[3 x i32] [i32 4, i32 0, i32 -1425719182], [3 x i32] [i32 -328727838, i32 7, i32 73780325], [3 x i32] [i32 6, i32 0, i32 -2], [3 x i32] [i32 -1613798643, i32 -2, i32 -1986717165], [3 x i32] [i32 87909934, i32 -2, i32 -1402097775], [3 x i32] zeroinitializer, [3 x i32] [i32 320804302, i32 7, i32 -2139698281]], [7 x [3 x i32]] [[3 x i32] [i32 1698185546, i32 0, i32 -2], [3 x i32] [i32 -1, i32 1023954582, i32 -2], [3 x i32] [i32 320804302, i32 -1579985206, i32 -1878118873], [3 x i32] [i32 -5, i32 1023954582, i32 0], [3 x i32] [i32 -10, i32 0, i32 -1893771394], [3 x i32] [i32 -1613798643, i32 7, i32 -1878118873], [3 x i32] [i32 653753375, i32 0, i32 -1]]], align 4
+@_ZL5g_983 = internal global i8*** @_ZL5g_984, align 4
+@_ZZL6func_1vE6l_1324 = private unnamed_addr constant [7 x [3 x [10 x i8****]]] [[3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]]], align 4
+@_ZZL6func_1vE6l_1346 = private unnamed_addr constant [10 x i32] [i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2], align 4
+@_ZZL6func_1vE6l_1519 = private unnamed_addr constant [10 x %struct.S0] [%struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }], align 8
+@_ZL5g_189 = internal constant %struct.S0* @_ZL4g_83, align 4
+@_ZZL6func_1vE6l_1263 = private unnamed_addr constant [2 x [1 x [8 x i32]]] [[1 x [8 x i32]] [[8 x i32] [i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]], [1 x [8 x i32]] [[8 x i32] [i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]]], align 4
+@_ZZL6func_1vE6l_1364 = private unnamed_addr constant %struct.S0 { i16 12857, i8 -1, i32 103472530 }, align 4
+@_ZZL6func_1vE6l_1204 = private unnamed_addr constant [10 x i32*] [i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138], align 4
+@_ZZL6func_1vE6l_1278 = private unnamed_addr constant [7 x [9 x [4 x i32]]] [[9 x [4 x i32]] [[4 x i32] [i32 0, i32 -9, i32 -608911817, i32 -1137618830], [4 x i32] [i32 -1673477626, i32 1178455578, i32 -1, i32 1], [4 x i32] [i32 1749634172, i32 -608911817, i32 -1750306944, i32 5], [4 x i32] [i32 -1, i32 -267173613, i32 1, i32 -267173613], [4 x i32] [i32 342924466, i32 -1137618830, i32 5, i32 0], [4 x i32] [i32 -1, i32 5, i32 -2032672910, i32 2], [4 x i32] [i32 -267173613, i32 1687884857, i32 -7, i32 0], [4 x i32] [i32 -267173613, i32 60247711, i32 -2032672910, i32 -829052586], [4 x i32] [i32 -1, i32 0, i32 5, i32 -9]], [9 x [4 x i32]] [[4 x i32] [i32 342924466, i32 6, i32 1, i32 -1750306944], [4 x i32] [i32 -1, i32 -2032672910, i32 -1750306944, i32 1], [4 x i32] [i32 1749634172, i32 -1, i32 -1, i32 1749634172], [4 x i32] [i32 -1673477626, i32 -920516504, i32 -608911817, i32 -5], [4 x i32] [i32 0, i32 -1, i32 1687884857, i32 0], [4 x i32] [i32 -829052586, i32 -1750306944, i32 1749634172, i32 0], [4 x i32] [i32 -1137618830, i32 -1, i32 342924466, i32 -5], [4 x i32] [i32 6, i32 -920516504, i32 -829052586, i32 1749634172], [4 x i32] [i32 1178455578, i32 -1, i32 1, i32 1]], [9 x [4 x i32]] [[4 x i32] [i32 0, i32 -2032672910, i32 -920516504, i32 -1750306944], [4 x i32] [i32 -852752877, i32 6, i32 -852752877, i32 -9], [4 x i32] [i32 1, i32 0, i32 6, i32 -829052586], [4 x i32] [i32 2, i32 60247711, i32 1, i32 0], [4 x i32] [i32 -608911817, i32 6, i32 -7, i32 -5], [4 x i32] [i32 -5, i32 0, i32 1749634172, i32 -1750306944], [4 x i32] [i32 -2032672910, i32 -1, i32 2, i32 -608911817], [4 x i32] [i32 2, i32 -608911817, i32 -1673477626, i32 0], [4 x i32] [i32 -267173613, i32 1, i32 -920516504, i32 -920516504]], [9 x [4 x i32]] [[4 x i32] [i32 -1692884230, i32 -1692884230, i32 1178455578, i32 -1], [4 x i32] [i32 1749634172, i32 1687884857, i32 0, i32 -1673477626], [4 x i32] [i32 -1, i32 -1750306944, i32 -1, i32 0], [4 x i32] [i32 1178455578, i32 -1750306944, i32 6, i32 -1673477626], [4 x i32] [i32 -1750306944, i32 1687884857, i32 1, i32 -1], [4 x i32] [i32 5, i32 -1692884230, i32 -1, i32 -920516504], [4 x i32] [i32 -1, i32 1, i32 1, i32 0], [4 x i32] [i32 -1, i32 -608911817, i32 -2032672910, i32 -608911817], [4 x i32] [i32 0, i32 -1, i32 0, i32 -1750306944]], [9 x [4 x i32]] [[4 x i32] [i32 -829052586, i32 0, i32 0, i32 -5], [4 x i32] [i32 -608911817, i32 6, i32 -1137618830, i32 -267173613], [4 x i32] [i32 -608911817, i32 -9, i32 0, i32 1178455578], [4 x i32] [i32 -829052586, i32 -267173613, i32 0, i32 1687884857], [4 x i32] [i32 0, i32 1749634172, i32 -2032672910, i32 1], [4 x i32] [i32 -1, i32 0, i32 1, i32 -7], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 5, i32 -1673477626, i32 1, i32 0], [4 x i32] [i32 -1750306944, i32 1, i32 6, i32 342924466]], [9 x [4 x i32]] [[4 x i32] [i32 1178455578, i32 1, i32 -1, i32 342924466], [4 x i32] [i32 -1, i32 1, i32 0, i32 0], [4 x i32] [i32 1749634172, i32 -1673477626, i32 1178455578, i32 -1], [4 x i32] [i32 -1692884230, i32 -1, i32 -920516504, i32 -7], [4 x i32] [i32 -267173613, i32 0, i32 -1673477626, i32 1], [4 x i32] [i32 2, i32 1749634172, i32 2, i32 1687884857], [4 x i32] [i32 -2032672910, i32 -267173613, i32 1749634172, i32 1178455578], [4 x i32] [i32 -5, i32 -9, i32 -7, i32 -267173613], [4 x i32] [i32 1, i32 6, i32 -7, i32 -5]], [9 x [4 x i32]] [[4 x i32] [i32 -5, i32 0, i32 1749634172, i32 -1750306944], [4 x i32] [i32 -2032672910, i32 -1, i32 2, i32 -608911817], [4 x i32] [i32 2, i32 -608911817, i32 -1673477626, i32 0], [4 x i32] [i32 -267173613, i32 1, i32 -920516504, i32 -920516504], [4 x i32] [i32 -1692884230, i32 -1692884230, i32 1178455578, i32 -1], [4 x i32] [i32 1749634172, i32 1687884857, i32 0, i32 -1673477626], [4 x i32] [i32 -1, i32 -1750306944, i32 -1, i32 0], [4 x i32] [i32 1178455578, i32 -1750306944, i32 6, i32 -1673477626], [4 x i32] [i32 -1750306944, i32 1687884857, i32 1, i32 -1]]], align 4
+@_ZZL6func_1vE6l_1365 = private unnamed_addr constant [8 x [3 x [5 x i16]]] [[3 x [5 x i16]] [[5 x i16] [i16 -1, i16 -10870, i16 20658, i16 0, i16 3], [5 x i16] [i16 22073, i16 24925, i16 -13292, i16 -10870, i16 -1459], [5 x i16] [i16 1, i16 138, i16 7, i16 -26288, i16 7]], [3 x [5 x i16]] [[5 x i16] [i16 1, i16 1, i16 7, i16 5, i16 24925], [5 x i16] [i16 -30784, i16 0, i16 -13292, i16 -1, i16 -26288], [5 x i16] [i16 1, i16 9699, i16 20658, i16 5708, i16 1]], [3 x [5 x i16]] [[5 x i16] [i16 22073, i16 1, i16 20658, i16 -13292, i16 7], [5 x i16] [i16 0, i16 -1459, i16 5708, i16 -1459, i16 0], [5 x i16] [i16 0, i16 22073, i16 2965, i16 1, i16 -1459]], [3 x [5 x i16]] [[5 x i16] [i16 22073, i16 5, i16 -30784, i16 2965, i16 5708], [5 x i16] [i16 2965, i16 -30784, i16 5, i16 22073, i16 -1459], [5 x i16] [i16 1, i16 2965, i16 22073, i16 0, i16 0]], [3 x [5 x i16]] [[5 x i16] [i16 -1459, i16 5708, i16 -1459, i16 0, i16 7], [5 x i16] [i16 -13292, i16 20658, i16 1, i16 22073, i16 1], [5 x i16] [i16 5708, i16 7, i16 -1, i16 2965, i16 1]], [3 x [5 x i16]] [[5 x i16] [i16 31974, i16 -10870, i16 1, i16 1, i16 5], [5 x i16] [i16 1, i16 9699, i16 -1459, i16 -1459, i16 9699], [5 x i16] [i16 1, i16 9699, i16 22073, i16 -13292, i16 3]], [3 x [5 x i16]] [[5 x i16] [i16 -30784, i16 -10870, i16 5, i16 5708, i16 138], [5 x i16] [i16 1, i16 7, i16 -30784, i16 31974, i16 -26288], [5 x i16] [i16 -30784, i16 20658, i16 2965, i16 1, i16 22073]], [3 x [5 x i16]] [[5 x i16] [i16 1, i16 5708, i16 5708, i16 1, i16 22073], [5 x i16] [i16 1, i16 2965, i16 20658, i16 -30784, i16 -26288], [5 x i16] [i16 31974, i16 -30784, i16 7, i16 1, i16 138]]], align 2
+@_ZL5g_985 = internal global i8* @_ZL5g_304, align 4
+@_ZZL6func_1vE6l_1320 = private unnamed_addr constant <{ <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> }> <{ <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -38, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 -71, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 126, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 43, [3 x i8] undef }, { i8, [3 x i8] } { i8 -125, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -21, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 -21, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -125, [3 x i8] undef }, { i8, [3 x i8] } { i8 43, [3 x i8] undef } }> }>, align 4
+@_ZZL6func_1vE6l_1423 = private unnamed_addr constant %struct.S0 { i16 -14979, i8 -56, i32 1 }, align 4
+@_ZZL6func_1vE6l_1460 = private unnamed_addr constant [5 x [10 x i32]] [[10 x i32] [i32 -1, i32 -1, i32 -2111769585, i32 -10, i32 3, i32 -1, i32 -7, i32 -1, i32 -1, i32 -7], [10 x i32] [i32 -88107511, i32 -1, i32 -10, i32 -10, i32 -1, i32 -88107511, i32 -392857583, i32 -1, i32 1, i32 9], [10 x i32] [i32 9, i32 -1, i32 -1, i32 1, i32 -2111769585, i32 1, i32 -88107511, i32 1, i32 -2111769585, i32 1], [10 x i32] [i32 9, i32 1, i32 9, i32 -2, i32 -7, i32 -88107511, i32 -88107511, i32 -10, i32 1, i32 -2], [10 x i32] [i32 -1, i32 -88107511, i32 -10, i32 1, i32 -2, i32 -2, i32 1, i32 -10, i32 -88107511, i32 -1]], align 4
+@_ZL5g_197 = internal global [2 x [10 x i32*]] [[10 x i32*] [i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93]], align 4
+@_ZZL6func_1vE6l_1443 = private unnamed_addr constant [7 x [5 x i32]] [[5 x i32] [i32 520842546, i32 -856207067, i32 2, i32 -3, i32 -1686173722], [5 x i32] [i32 1184089122, i32 -1017155828, i32 -3, i32 -691016572, i32 -3], [5 x i32] [i32 -3, i32 -3, i32 0, i32 2, i32 8], [5 x i32] [i32 -3, i32 -10, i32 8, i32 9, i32 7], [5 x i32] [i32 1184089122, i32 -1176025092, i32 -1686173722, i32 -8, i32 -1], [5 x i32] [i32 520842546, i32 -10, i32 -10, i32 520842546, i32 1752169706], [5 x i32] [i32 -856207067, i32 -3, i32 -10, i32 8, i32 9]], align 4
+@_ZZL6func_1vE6l_1461 = private unnamed_addr constant [10 x [1 x i32]] [[1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1]], align 4
+@_ZZL6func_1vE6l_1470 = private unnamed_addr constant %struct.S0 { i16 -30104, i8 -1, i32 6 }, align 4
+@_ZL6g_1353 = internal constant %struct.S0*** @_ZL6g_1354, align 4
+@_ZL6g_1354 = internal global %struct.S0** @_ZL6g_1355, align 4
+@_ZL6g_1355 = internal global %struct.S0* null, align 4
+@_ZL6g_1393 = internal global i32** @_ZL6g_1394, align 4
+@_ZL6g_1394 = internal global i32* @_ZL5g_546, align 4
+@_ZL5g_931 = internal global i32* @_ZL4g_53, align 4
+@_ZL6g_1162 = internal unnamed_addr global { i8, [3 x i8] } { i8 0, [3 x i8] undef }, align 4
+@_ZZL7func_20iitE4l_60 = private unnamed_addr constant %struct.S0 { i16 26262, i8 73, i32 1210384164 }, align 4
+@_ZZL7func_20iitE5l_757 = private unnamed_addr constant [1 x [9 x [4 x i16]]] [[9 x [4 x i16]] [[4 x i16] [i16 -1, i16 0, i16 0, i16 -1], [4 x i16] [i16 0, i16 -1, i16 0, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0], [4 x i16] [i16 0, i16 8, i16 8, i16 0], [4 x i16] [i16 8, i16 0, i16 8, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0], [4 x i16] [i16 0, i16 8, i16 8, i16 0], [4 x i16] [i16 8, i16 0, i16 8, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0]]], align 2
+@_ZZL7func_20iitE5l_876 = private unnamed_addr constant [10 x i16] [i16 5, i16 0, i16 0, i16 5, i16 -9, i16 5, i16 0, i16 0, i16 5, i16 -9], align 2
+@_ZZL7func_20iitE5l_403 = private unnamed_addr constant [1 x [4 x i32*]] [[4 x i32*] [i32* @_ZL5g_135, i32* @_ZL5g_135, i32* @_ZL5g_135, i32* @_ZL5g_135]], align 4
+@_ZZL7func_20iitE5l_422 = private unnamed_addr constant %struct.S0 { i16 8, i8 95, i32 -1317782521 }, align 4
+@_ZZL7func_20iitE5l_516 = private unnamed_addr constant <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef } }>, align 4
+@_ZZL7func_20iitE5l_519 = private unnamed_addr constant %struct.S0 { i16 -1, i8 9, i32 -1103229061 }, align 4
+@_ZZL7func_20iitE5l_548 = private unnamed_addr constant [8 x [8 x i32]] [[8 x i32] [i32 6, i32 -1608903715, i32 -2, i32 -1608903715, i32 6, i32 -2, i32 2, i32 2], [8 x i32] [i32 3, i32 -1608903715, i32 -1, i32 -1, i32 -1608903715, i32 3, i32 7, i32 -1608903715], [8 x i32] [i32 2, i32 7, i32 -1, i32 2, i32 -1, i32 7, i32 2, i32 3], [8 x i32] [i32 -1608903715, i32 6, i32 -2, i32 2, i32 2, i32 -2, i32 6, i32 -1608903715], [8 x i32] [i32 3, i32 2, i32 7, i32 -1, i32 2, i32 -1, i32 7, i32 2], [8 x i32] [i32 -1608903715, i32 7, i32 3, i32 -1608903715, i32 -1, i32 -1, i32 -1608903715, i32 3], [8 x i32] [i32 2, i32 2, i32 -2, i32 6, i32 -1608903715, i32 -2, i32 -1608903715, i32 6], [8 x i32] [i32 3, i32 6, i32 3, i32 -1, i32 6, i32 7, i32 7, i32 6]], align 4
+@_ZZL7func_20iitE5l_495 = private unnamed_addr constant %struct.S0 { i16 -5, i8 -1, i32 -768235975 }, align 4
+@_ZZL7func_20iitE5l_467 = private unnamed_addr constant [6 x i32] [i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813], align 4
+@_ZZL7func_20iitE5l_513 = private unnamed_addr constant [2 x [3 x [9 x i16*]]] [[3 x [9 x i16*]] [[9 x i16*] [i16* @_ZL4g_79, i16* @_ZL4g_79, i16* @_ZL5g_103, i16* @_ZL4g_77, i16* @_ZL5g_361, i16* @_ZL5g_172, i16* @_ZL4g_77, i16* @_ZL5g_172, i16* @_ZL5g_361], [9 x i16*] [i16* @_ZL5g_361, i16* @_ZL5g_172, i16* @_ZL5g_172, i16* @_ZL5g_361, i16* @_ZL4g_79, i16* @_ZL5g_103, i16* null, i16* @_ZL4g_77, i16* null], [9 x i16*] [i16* @_ZL4g_77, i16* null, i16* @_ZL5g_103, i16* @_ZL5g_103, i16* null, i16* @_ZL4g_77, i16* @_ZL5g_308, i16* @_ZL4g_79, i16* null]], [3 x [9 x i16*]] [[9 x i16*] [i16* @_ZL5g_308, i16* @_ZL5g_103, i16* @_ZL4g_77, i16* @_ZL4g_79, i16* @_ZL4g_79, i16* @_ZL4g_77, i16* @_ZL5g_103, i16* @_ZL5g_308, i16* @_ZL5g_172], [9 x i16*] [i16* null, i16* @_ZL5g_103, i16* @_ZL4g_82, i16* @_ZL5g_361, i16* null, i16* null, i16* @_ZL5g_361, i16* @_ZL4g_82, i16* @_ZL4g_79], [9 x i16*] [i16* @_ZL5g_172, i16* @_ZL5g_308, i16* @_ZL4g_77, i16* @_ZL5g_361, i16* null, i16* @_ZL5g_308, i16* @_ZL5g_308, i16* null, i16* @_ZL5g_361]]], align 4
+@_ZZL7func_20iitE5l_589 = private unnamed_addr constant <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef } }>, align 4
+@_ZZL7func_20iitE5l_598 = private unnamed_addr constant [2 x [10 x %struct.S0]] [[10 x %struct.S0] [%struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }], [10 x %struct.S0] [%struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }]], align 4
+@_ZZL7func_492S0E5l_178 = private unnamed_addr constant [3 x [5 x [9 x i16*]]] [[5 x [9 x i16*]] [[9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162], [9 x i16*] [i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)], [9 x i16*] [i16* null, i16* @_ZL5g_162, i16* null, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)]], [5 x [9 x i16*]] [[9 x i16*] [i16* null, i16* @_ZL5g_162, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168], [9 x i16*] [i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* null], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* null, i16* null, i16* @_ZL5g_162, i16* null, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* null]], [5 x [9 x i16*]] [[9 x i16*] [i16* null, i16* @_ZL5g_168, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* null, i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* null]]], align 4
+@_ZZL7func_492S0E5l_198 = private unnamed_addr constant [4 x [1 x i32**]] [[1 x i32**] [i32** bitcast (i8* getelementptr (i8* bitcast ([2 x [10 x i32*]]* @_ZL5g_197 to i8*), i64 76) to i32**)], [1 x i32**] zeroinitializer, [1 x i32**] [i32** bitcast (i8* getelementptr (i8* bitcast ([2 x [10 x i32*]]* @_ZL5g_197 to i8*), i64 76) to i32**)], [1 x i32**] zeroinitializer], align 4
+@_ZZL7func_492S0E5l_119 = private unnamed_addr constant { i8, [3 x i8] } { i8 -3, [3 x i8] undef }, align 4
+@_ZZL7func_492S0E5l_125 = private unnamed_addr constant [8 x [4 x [6 x i32]]] [[4 x [6 x i32]] [[6 x i32] [i32 1, i32 -9, i32 2, i32 585837050, i32 1, i32 9], [6 x i32] [i32 -9, i32 0, i32 -5, i32 9, i32 1, i32 585837050], [6 x i32] [i32 735221361, i32 -9, i32 -626661945, i32 0, i32 -875020938, i32 -9], [6 x i32] [i32 -875020938, i32 -1969890654, i32 -5, i32 -1, i32 -1, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 -875020938, i32 -875020938, i32 2, i32 0, i32 0, i32 1], [6 x i32] [i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1, i32 2], [6 x i32] [i32 -9, i32 735221361, i32 -1969890654, i32 585837050, i32 -875020938, i32 1], [6 x i32] [i32 1, i32 585837050, i32 2, i32 -9, i32 1, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 -9, i32 1, i32 -5, i32 -5, i32 1, i32 -9], [6 x i32] [i32 735221361, i32 585837050, i32 -626661945, i32 1, i32 -875020938, i32 585837050], [6 x i32] [i32 -875020938, i32 735221361, i32 -5, i32 2, i32 -1, i32 9], [6 x i32] [i32 -875020938, i32 -626661945, i32 2, i32 1, i32 0, i32 0]], [4 x [6 x i32]] [[6 x i32] [i32 735221361, i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938], [6 x i32] [i32 735221361, i32 0, i32 0, i32 735221361, i32 0, i32 -5], [6 x i32] [i32 9, i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1], [6 x i32] [i32 735221361, i32 -5, i32 2, i32 -1, i32 9, i32 -1969890654]], [4 x [6 x i32]] [[6 x i32] [i32 1, i32 735221361, i32 459562963, i32 -5, i32 0, i32 735221361], [6 x i32] [i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938, i32 2], [6 x i32] [i32 0, i32 0, i32 -626661945, i32 -5, i32 -9, i32 9], [6 x i32] [i32 1, i32 459562963, i32 0, i32 -1, i32 -875020938, i32 -626661945]], [4 x [6 x i32]] [[6 x i32] [i32 735221361, i32 1, i32 0, i32 -1969890654, i32 0, i32 9], [6 x i32] [i32 9, i32 -1969890654, i32 -626661945, i32 735221361, i32 9, i32 2], [6 x i32] [i32 735221361, i32 9, i32 2, i32 2, i32 9, i32 735221361], [6 x i32] [i32 1, i32 -1969890654, i32 459562963, i32 9, i32 0, i32 -1969890654]], [4 x [6 x i32]] [[6 x i32] [i32 0, i32 1, i32 2, i32 -626661945, i32 -875020938, i32 -1], [6 x i32] [i32 0, i32 459562963, i32 -626661945, i32 9, i32 -9, i32 -5], [6 x i32] [i32 1, i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938], [6 x i32] [i32 735221361, i32 0, i32 0, i32 735221361, i32 0, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 9, i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1], [6 x i32] [i32 735221361, i32 -5, i32 2, i32 -1, i32 9, i32 -1969890654], [6 x i32] [i32 1, i32 735221361, i32 459562963, i32 -5, i32 0, i32 735221361], [6 x i32] [i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938, i32 2]]], align 4
+@_ZZL7func_492S0E5l_296 = private unnamed_addr constant [6 x [2 x [4 x i32]]] [[2 x [4 x i32]] [[4 x i32] [i32 -2, i32 5, i32 161729879, i32 884294967], [4 x i32] [i32 -1, i32 0, i32 -3, i32 884294967]], [2 x [4 x i32]] [[4 x i32] [i32 -1769297005, i32 5, i32 1, i32 0], [4 x i32] [i32 1136616794, i32 -1, i32 -1591181149, i32 -1]], [2 x [4 x i32]] [[4 x i32] [i32 5, i32 62548300, i32 -3, i32 -6], [4 x i32] [i32 59636063, i32 -2, i32 62548300, i32 59636063]], [2 x [4 x i32]] [[4 x i32] [i32 -2, i32 -1, i32 1, i32 1136616794], [4 x i32] [i32 -2, i32 -1769297005, i32 62548300, i32 884294967]], [2 x [4 x i32]] [[4 x i32] [i32 59636063, i32 1136616794, i32 -3, i32 -3], [4 x i32] [i32 5, i32 5, i32 -1591181149, i32 1136616794]], [2 x [4 x i32]] [[4 x i32] [i32 1136616794, i32 59636063, i32 1, i32 -1], [4 x i32] [i32 -1769297005, i32 -2, i32 -3, i32 1]]], align 4
+@_ZZL7func_40iaE5l_359 = private unnamed_addr constant [2 x [6 x [10 x i32*]]] [[6 x [10 x i32*]] [[10 x i32*] [i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* null, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL3g_2], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* @_ZL5g_132, i32* null, i32* @_ZL3g_2, i32* @_ZL5g_132], [10 x i32*] [i32* @_ZL5g_135, i32* null, i32* null, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_135, i32* @_ZL3g_2, i32* null, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* null, i32* null, i32* @_ZL5g_132, i32* @_ZL3g_2], [10 x i32*] [i32* null, i32* null, i32* null, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2]], [6 x [10 x i32*]] [[10 x i32*] [i32* @_ZL4g_93, i32* null, i32* null, i32* @_ZL5g_135, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL5g_135, i32* null, i32* null, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL5g_257, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* null, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_135, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* @_ZL5g_257, i32* @_ZL3g_2], [10 x i32*] [i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* null, i32* @_ZL5g_135, i32* @_ZL3g_2, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2]]], align 4
+@_ZZL7func_32tiPaE5l_369 = private unnamed_addr constant %struct.S0 { i16 -4, i8 1, i32 -4 }, align 4
+@_ZZL7func_32tiPaE5l_382 = private unnamed_addr constant [6 x [1 x i16*]] [[1 x i16*] [i16* @_ZL5g_308], [1 x i16*] zeroinitializer, [1 x i16*] zeroinitializer, [1 x i16*] [i16* @_ZL5g_308], [1 x i16*] zeroinitializer, [1 x i16*] zeroinitializer], align 4
+@_ZZL7func_32tiPaE5l_387 = private unnamed_addr constant %struct.S0 { i16 16776, i8 55, i32 1410444512 }, align 4
+@_ZZL7func_32tiPaE5l_392 = private unnamed_addr constant [10 x [8 x i8]] [[8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00"], align 1
+@_ZZL7func_26jPKaPaS1_iE5l_398 = private unnamed_addr constant [9 x [8 x i8]] [[8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o"], align 1
+@_ZZL6func_8ijPasS_E6l_1016 = private unnamed_addr constant [5 x [3 x i32*]] [[3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93]], align 4
+@_ZZL6func_5PahE6l_1024 = private unnamed_addr constant [6 x i32*] [i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2], align 4
+@_gm_ = internal global %struct.malloc_state zeroinitializer, align 4
+@mparams = internal global %struct.malloc_params zeroinitializer, align 4
+@stderr = external constant %struct._IO_FILE*
+@.str49 = private unnamed_addr constant [26 x i8] c"max system bytes = %10lu\0A\00", align 1
+@.str150 = private unnamed_addr constant [26 x i8] c"system bytes = %10lu\0A\00", align 1
+@.str251 = private unnamed_addr constant [26 x i8] c"in use bytes = %10lu\0A\00", align 1
+@_ZSt7nothrow = constant %"struct.std::nothrow_t" undef, align 1
+@_ZL13__new_handler = internal global void ()* null, align 4
+@_ZTVSt9bad_alloc = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_alloc"*)* @_ZNKSt9bad_alloc4whatEv to i8*)]
+@.str352 = private unnamed_addr constant [15 x i8] c"std::bad_alloc\00", align 1
+@_ZTVSt20bad_array_new_length = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt20bad_array_new_length to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_array_new_length"*)* @_ZNSt20bad_array_new_lengthD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_array_new_length"*)* @_ZNKSt20bad_array_new_length4whatEv to i8*)]
+@.str1453 = private unnamed_addr constant [17 x i8] c"bad_array_length\00", align 1
+@_ZTVSt16bad_array_length = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt16bad_array_length to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_array_length"*)* @_ZNSt16bad_array_lengthD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_array_length"*)* @_ZNKSt16bad_array_length4whatEv to i8*)]
+@.str2554 = private unnamed_addr constant [21 x i8] c"bad_array_new_length\00", align 1
+@_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8*
+@_ZTSSt9bad_alloc = constant [13 x i8] c"St9bad_alloc\00"
+@_ZTISt9exception = external constant i8*
+@_ZTISt9bad_alloc = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([13 x i8]* @_ZTSSt9bad_alloc, i32 0, i32 0), i8* bitcast (i8** @_ZTISt9exception to i8*) }
+@_ZTSSt20bad_array_new_length = constant [25 x i8] c"St20bad_array_new_length\00"
+@_ZTISt20bad_array_new_length = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([25 x i8]* @_ZTSSt20bad_array_new_length, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*) }
+@_ZTSSt16bad_array_length = constant [21 x i8] c"St16bad_array_length\00"
+@_ZTISt16bad_array_length = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([21 x i8]* @_ZTSSt16bad_array_length, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*) }
+@.str655 = private unnamed_addr constant [9 x i8] c"infinity\00", align 1
+@.str1756 = private unnamed_addr constant [4 x i8] c"nan\00", align 1
+@decfloat.th = internal unnamed_addr constant [2 x i32] [i32 9007199, i32 254740991], align 4
+@decfloat.p10s = internal unnamed_addr constant [8 x i32] [i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000], align 4
+
+@_ZNSt9bad_allocC1Ev = alias void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocC2Ev
+@_ZNSt9bad_allocD1Ev = alias void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev
+@_ZNSt20bad_array_new_lengthC1Ev = alias void (%"class.std::bad_array_new_length"*)* @_ZNSt20bad_array_new_lengthC2Ev
+@_ZNSt20bad_array_new_lengthD1Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_new_length"*)*)
+@_ZNSt20bad_array_new_lengthD2Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_new_length"*)*)
+@_ZNSt16bad_array_lengthC1Ev = alias void (%"class.std::bad_array_length"*)* @_ZNSt16bad_array_lengthC2Ev
+@_ZNSt16bad_array_lengthD1Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_length"*)*)
+@_ZNSt16bad_array_lengthD2Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_length"*)*)
+@__strtof_l = alias weak float (i8*, i8**, %struct.__locale_struct*)* @strtof_l
+@__strtod_l = alias weak double (i8*, i8**, %struct.__locale_struct.0*)* @strtod_l
+@__strtold_l = alias weak double (i8*, i8**, %struct.__locale_struct.1*)* @strtold_l
+
+; Function Attrs: nounwind
+define i32 @main(i32 %argc, i8** nocapture %argv) #0 {
+entry:
+ %cmp = icmp eq i32 %argc, 2
+ br i1 %cmp, label %land.lhs.true, label %if.end
+
+land.lhs.true: ; preds = %entry
+ %arrayidx = getelementptr inbounds i8** %argv, i32 1
+ %0 = load i8** %arrayidx, align 4, !tbaa !0
+ %call = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0))
+ %cmp1 = icmp eq i32 %call, 0
+ %. = zext i1 %cmp1 to i32
+ br label %if.end
+
+if.end: ; preds = %land.lhs.true, %entry
+ %print_hash_value.0 = phi i32 [ 0, %entry ], [ %., %land.lhs.true ]
+ tail call fastcc void @_ZL12crc32_gentabv()
+ tail call fastcc void @_ZL6func_1v()
+ %1 = load i32* @_ZL3g_2, align 4, !tbaa !3
+ %conv = sext i32 %1 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv, i8* getelementptr inbounds ([4 x i8]* @.str1, i32 0, i32 0), i32 %print_hash_value.0)
+ %tobool = icmp eq i32 %print_hash_value.0, 0
+ br label %for.cond4.preheader
+
+for.cond4.preheader: ; preds = %for.inc20, %if.end
+ %i.075 = phi i32 [ 0, %if.end ], [ %inc21, %for.inc20 ]
+ br label %for.body9
+
+for.body9: ; preds = %for.inc.5, %for.cond4.preheader
+ %j.074 = phi i32 [ 0, %for.cond4.preheader ], [ %inc18, %for.inc.5 ]
+ %arrayidx12 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 0
+ %2 = load i8* %arrayidx12, align 1, !tbaa !1
+ %conv13 = sext i8 %2 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool, label %for.inc.1.critedge, label %if.then14
+
+if.then14: ; preds = %for.body9
+ %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 0)
+ %arrayidx12.1 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 1
+ %3 = load i8* %arrayidx12.1, align 1, !tbaa !1
+ %conv13.1 = sext i8 %3 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.1, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ %call15.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 1)
+ br label %for.inc.1
+
+for.inc20: ; preds = %for.inc.5
+ %inc21 = add nsw i32 %i.075, 1
+ %exitcond76 = icmp eq i32 %inc21, 4
+ br i1 %exitcond76, label %for.body45, label %for.cond4.preheader
+
+for.body45: ; preds = %for.inc20
+ %4 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %conv23 = sext i32 %4 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv23, i8* getelementptr inbounds ([5 x i8]* @.str4, i32 0, i32 0), i32 %print_hash_value.0)
+ %5 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1
+ %conv24 = zext i8 %5 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv24, i8* getelementptr inbounds ([8 x i8]* @.str5, i32 0, i32 0), i32 %print_hash_value.0)
+ %6 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1
+ %conv25 = sext i8 %6 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv25, i8* getelementptr inbounds ([8 x i8]* @.str6, i32 0, i32 0), i32 %print_hash_value.0)
+ %7 = load i16* @_ZL4g_77, align 2, !tbaa !4
+ %conv26 = zext i16 %7 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv26, i8* getelementptr inbounds ([5 x i8]* @.str7, i32 0, i32 0), i32 %print_hash_value.0)
+ %8 = load i16* @_ZL4g_79, align 2, !tbaa !4
+ %conv27 = zext i16 %8 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv27, i8* getelementptr inbounds ([5 x i8]* @.str8, i32 0, i32 0), i32 %print_hash_value.0)
+ %9 = load i16* @_ZL4g_82, align 2, !tbaa !4
+ %conv28 = zext i16 %9 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv28, i8* getelementptr inbounds ([5 x i8]* @.str9, i32 0, i32 0), i32 %print_hash_value.0)
+ %10 = load i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), align 8, !tbaa !4
+ %conv29 = sext i16 %10 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv29, i8* getelementptr inbounds ([8 x i8]* @.str10, i32 0, i32 0), i32 %print_hash_value.0)
+ %11 = load i8* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 1), align 2, !tbaa !1
+ %conv30 = sext i8 %11 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv30, i8* getelementptr inbounds ([8 x i8]* @.str11, i32 0, i32 0), i32 %print_hash_value.0)
+ %12 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3
+ %conv31 = zext i32 %12 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv31, i8* getelementptr inbounds ([8 x i8]* @.str12, i32 0, i32 0), i32 %print_hash_value.0)
+ %13 = load i32* @_ZL4g_93, align 4, !tbaa !3
+ %conv32 = sext i32 %13 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv32, i8* getelementptr inbounds ([5 x i8]* @.str13, i32 0, i32 0), i32 %print_hash_value.0)
+ %14 = load i16* @_ZL5g_103, align 2, !tbaa !4
+ %conv33 = zext i16 %14 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv33, i8* getelementptr inbounds ([6 x i8]* @.str14, i32 0, i32 0), i32 %print_hash_value.0)
+ %15 = load i8* @_ZL5g_126, align 1, !tbaa !1
+ %conv34 = sext i8 %15 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv34, i8* getelementptr inbounds ([6 x i8]* @.str15, i32 0, i32 0), i32 %print_hash_value.0)
+ %16 = load i32* @_ZL5g_132, align 4, !tbaa !3
+ %conv35 = sext i32 %16 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv35, i8* getelementptr inbounds ([6 x i8]* @.str16, i32 0, i32 0), i32 %print_hash_value.0)
+ %17 = load i8* @_ZL5g_133, align 1, !tbaa !1
+ %conv36 = sext i8 %17 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv36, i8* getelementptr inbounds ([6 x i8]* @.str17, i32 0, i32 0), i32 %print_hash_value.0)
+ %18 = load i32* @_ZL5g_135, align 4, !tbaa !3
+ %conv37 = sext i32 %18 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv37, i8* getelementptr inbounds ([6 x i8]* @.str18, i32 0, i32 0), i32 %print_hash_value.0)
+ %19 = load i8* @_ZL5g_136, align 1, !tbaa !1
+ %conv38 = sext i8 %19 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv38, i8* getelementptr inbounds ([6 x i8]* @.str19, i32 0, i32 0), i32 %print_hash_value.0)
+ %20 = load i32* @_ZL5g_138, align 4, !tbaa !3
+ %conv39 = zext i32 %20 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv39, i8* getelementptr inbounds ([6 x i8]* @.str20, i32 0, i32 0), i32 %print_hash_value.0)
+ %21 = load i16* @_ZL5g_162, align 2, !tbaa !4
+ %conv40 = sext i16 %21 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv40, i8* getelementptr inbounds ([6 x i8]* @.str21, i32 0, i32 0), i32 %print_hash_value.0)
+ %22 = load i16* @_ZL5g_168, align 2, !tbaa !4
+ %conv41 = sext i16 %22 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv41, i8* getelementptr inbounds ([6 x i8]* @.str22, i32 0, i32 0), i32 %print_hash_value.0)
+ %23 = load i8* @_ZL5g_170, align 1, !tbaa !1
+ %conv42 = zext i8 %23 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv42, i8* getelementptr inbounds ([6 x i8]* @.str23, i32 0, i32 0), i32 %print_hash_value.0)
+ %tobool48 = icmp eq i32 %print_hash_value.0, 0
+ %24 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 0), align 1, !tbaa !1
+ %conv47 = sext i8 %24 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool48, label %for.inc52.6.thread, label %if.then49.7
+
+for.inc52.6.thread: ; preds = %for.body45
+ %25 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 1), align 1, !tbaa !1
+ %conv47.177 = sext i8 %25 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.177, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %26 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 2), align 1, !tbaa !1
+ %conv47.278 = sext i8 %26 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.278, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %27 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 3), align 1, !tbaa !1
+ %conv47.379 = sext i8 %27 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.379, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %28 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 4), align 1, !tbaa !1
+ %conv47.480 = sext i8 %28 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.480, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %29 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), align 1, !tbaa !1
+ %conv47.581 = sext i8 %29 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.581, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %30 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1
+ %conv47.682 = sext i8 %30 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.682, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %31 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 7), align 1, !tbaa !1
+ %conv47.783 = sext i8 %31 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.783, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.body70
+
+for.body70: ; preds = %if.then49.7, %for.inc52.6.thread
+ %32 = load i16* @_ZL5g_172, align 2, !tbaa !4
+ %conv55 = zext i16 %32 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv55, i8* getelementptr inbounds ([6 x i8]* @.str26, i32 0, i32 0), i32 %print_hash_value.0)
+ %33 = load i32* @_ZL5g_257, align 4, !tbaa !3
+ %conv56 = sext i32 %33 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv56, i8* getelementptr inbounds ([6 x i8]* @.str27, i32 0, i32 0), i32 %print_hash_value.0)
+ %34 = load i8* @_ZL5g_304, align 1, !tbaa !1
+ %conv57 = sext i8 %34 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv57, i8* getelementptr inbounds ([6 x i8]* @.str28, i32 0, i32 0), i32 %print_hash_value.0)
+ %35 = load i16* @_ZL5g_308, align 2, !tbaa !4
+ %conv58 = zext i16 %35 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv58, i8* getelementptr inbounds ([6 x i8]* @.str29, i32 0, i32 0), i32 %print_hash_value.0)
+ %36 = load i16* @_ZL5g_361, align 2, !tbaa !4
+ %conv59 = zext i16 %36 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv59, i8* getelementptr inbounds ([6 x i8]* @.str30, i32 0, i32 0), i32 %print_hash_value.0)
+ %37 = load i32* @_ZL5g_400, align 4, !tbaa !3
+ %conv60 = sext i32 %37 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv60, i8* getelementptr inbounds ([6 x i8]* @.str31, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 -1, i8* getelementptr inbounds ([6 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0)
+ %38 = load i16* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 0), align 8, !tbaa !4
+ %conv62 = sext i16 %38 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv62, i8* getelementptr inbounds ([9 x i8]* @.str33, i32 0, i32 0), i32 %print_hash_value.0)
+ %39 = load i8* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 1), align 2, !tbaa !1
+ %conv63 = sext i8 %39 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv63, i8* getelementptr inbounds ([9 x i8]* @.str34, i32 0, i32 0), i32 %print_hash_value.0)
+ %40 = load i32* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 2), align 4, !tbaa !3
+ %conv64 = zext i32 %40 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv64, i8* getelementptr inbounds ([9 x i8]* @.str35, i32 0, i32 0), i32 %print_hash_value.0)
+ %41 = load i32* @_ZL5g_546, align 4, !tbaa !3
+ %conv65 = sext i32 %41 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv65, i8* getelementptr inbounds ([6 x i8]* @.str36, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2891502546, i8* getelementptr inbounds ([6 x i8]* @.str37, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 255, i8* getelementptr inbounds ([6 x i8]* @.str38, i32 0, i32 0), i32 %print_hash_value.0)
+ %tobool73 = icmp eq i32 %print_hash_value.0, 0
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool73, label %for.inc77.8.thread, label %if.then74.9
+
+for.inc77.8.thread: ; preds = %for.body70
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.body88
+
+for.body88: ; preds = %if.then74.9, %for.inc77.8.thread
+ %42 = load i8* @_ZL6g_1010, align 1, !tbaa !1
+ %conv80 = sext i8 %42 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv80, i8* getelementptr inbounds ([7 x i8]* @.str40, i32 0, i32 0), i32 %print_hash_value.0)
+ %43 = load i8* @_ZL6g_1025, align 1, !tbaa !1
+ %conv81 = zext i8 %43 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv81, i8* getelementptr inbounds ([7 x i8]* @.str41, i32 0, i32 0), i32 %print_hash_value.0)
+ %44 = load i8* @_ZL6g_1136, align 1, !tbaa !1
+ %conv82 = zext i8 %44 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv82, i8* getelementptr inbounds ([7 x i8]* @.str42, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1, i8* getelementptr inbounds ([7 x i8]* @.str43, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 7, i8* getelementptr inbounds ([7 x i8]* @.str44, i32 0, i32 0), i32 %print_hash_value.0)
+ %45 = load i32* @_ZL6g_1198, align 4, !tbaa !3
+ %conv85 = sext i32 %45 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv85, i8* getelementptr inbounds ([7 x i8]* @.str45, i32 0, i32 0), i32 %print_hash_value.0)
+ %tobool91 = icmp eq i32 %print_hash_value.0, 0
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool91, label %for.inc95.6.thread, label %if.then92.7
+
+for.inc95.6.thread: ; preds = %for.body88
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.inc95.7
+
+if.then92.7: ; preds = %for.body88
+ %call93 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0)
+ %call93.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7)
+ br label %for.inc95.7
+
+for.inc95.7: ; preds = %if.then92.7, %for.inc95.6.thread
+ %46 = load i32* @_ZL13crc32_context, align 4, !tbaa !3
+ %xor = xor i32 %46, -1
+ tail call fastcc void @_ZL17platform_main_endji(i32 %xor)
+ ret i32 0
+
+if.then74.9: ; preds = %for.body70
+ %call75 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.8 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 8)
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0)
+ %call75.9 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 9)
+ br label %for.body88
+
+if.then49.7: ; preds = %for.body45
+ %call50 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0)
+ %47 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 1), align 1, !tbaa !1
+ %conv47.1 = sext i8 %47 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.1, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1)
+ %48 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 2), align 1, !tbaa !1
+ %conv47.2 = sext i8 %48 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.2, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2)
+ %49 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 3), align 1, !tbaa !1
+ %conv47.3 = sext i8 %49 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.3, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3)
+ %50 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 4), align 1, !tbaa !1
+ %conv47.4 = sext i8 %50 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.4, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4)
+ %51 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), align 1, !tbaa !1
+ %conv47.5 = sext i8 %51 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.5, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5)
+ %52 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1
+ %conv47.6 = sext i8 %52 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.6, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6)
+ %53 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 7), align 1, !tbaa !1
+ %conv47.7 = sext i8 %53 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.7, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0)
+ %call50.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7)
+ br label %for.body70
+
+for.inc.1.critedge: ; preds = %for.body9
+ %arrayidx12.1.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 1
+ %54 = load i8* %arrayidx12.1.c, align 1, !tbaa !1
+ %conv13.1.c = sext i8 %54 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.1.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.inc.1
+
+for.inc.1: ; preds = %for.inc.1.critedge, %if.then14
+ %arrayidx12.2 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 2
+ %55 = load i8* %arrayidx12.2, align 1, !tbaa !1
+ %conv13.2 = sext i8 %55 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.2, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool, label %for.inc.3.critedge, label %if.then14.2
+
+if.then14.2: ; preds = %for.inc.1
+ %call15.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 2)
+ %arrayidx12.3 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 3
+ %56 = load i8* %arrayidx12.3, align 1, !tbaa !1
+ %conv13.3 = sext i8 %56 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.3, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ %call15.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 3)
+ br label %for.inc.3
+
+for.inc.3.critedge: ; preds = %for.inc.1
+ %arrayidx12.3.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 3
+ %57 = load i8* %arrayidx12.3.c, align 1, !tbaa !1
+ %conv13.3.c = sext i8 %57 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.3.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.inc.3
+
+for.inc.3: ; preds = %for.inc.3.critedge, %if.then14.2
+ %arrayidx12.4 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 4
+ %58 = load i8* %arrayidx12.4, align 1, !tbaa !1
+ %conv13.4 = sext i8 %58 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.4, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br i1 %tobool, label %for.inc.5.critedge, label %if.then14.4
+
+if.then14.4: ; preds = %for.inc.3
+ %call15.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 4)
+ %arrayidx12.5 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 5
+ %59 = load i8* %arrayidx12.5, align 1, !tbaa !1
+ %conv13.5 = sext i8 %59 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.5, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ %call15.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 5)
+ br label %for.inc.5
+
+for.inc.5.critedge: ; preds = %for.inc.3
+ %arrayidx12.5.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 5
+ %60 = load i8* %arrayidx12.5.c, align 1, !tbaa !1
+ %conv13.5.c = sext i8 %60 to i64
+ tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.5.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0)
+ br label %for.inc.5
+
+for.inc.5: ; preds = %for.inc.5.critedge, %if.then14.4
+ %inc18 = add nsw i32 %j.074, 1
+ %exitcond = icmp eq i32 %inc18, 6
+ br i1 %exitcond, label %for.inc20, label %for.body9
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL12crc32_gentabv() #0 {
+entry:
+ br label %for.body3
+
+for.body3: ; preds = %for.body3, %entry
+ %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body3 ]
+ %and = and i32 %i.08, 1
+ %tobool = icmp eq i32 %and, 0
+ %shr = lshr i32 %i.08, 1
+ %xor = xor i32 %shr, -306674912
+ %crc.1 = select i1 %tobool, i32 %shr, i32 %xor
+ %and.1 = and i32 %crc.1, 1
+ %tobool.1 = icmp eq i32 %and.1, 0
+ %shr.1 = lshr i32 %crc.1, 1
+ %xor.1 = xor i32 %shr.1, -306674912
+ %crc.1.1 = select i1 %tobool.1, i32 %shr.1, i32 %xor.1
+ %and.2 = and i32 %crc.1.1, 1
+ %tobool.2 = icmp eq i32 %and.2, 0
+ %shr.2 = lshr i32 %crc.1.1, 1
+ %xor.2 = xor i32 %shr.2, -306674912
+ %crc.1.2 = select i1 %tobool.2, i32 %shr.2, i32 %xor.2
+ %and.3 = and i32 %crc.1.2, 1
+ %tobool.3 = icmp eq i32 %and.3, 0
+ %shr.3 = lshr i32 %crc.1.2, 1
+ %xor.3 = xor i32 %shr.3, -306674912
+ %crc.1.3 = select i1 %tobool.3, i32 %shr.3, i32 %xor.3
+ %and.4 = and i32 %crc.1.3, 1
+ %tobool.4 = icmp eq i32 %and.4, 0
+ %shr.4 = lshr i32 %crc.1.3, 1
+ %xor.4 = xor i32 %shr.4, -306674912
+ %crc.1.4 = select i1 %tobool.4, i32 %shr.4, i32 %xor.4
+ %and.5 = and i32 %crc.1.4, 1
+ %tobool.5 = icmp eq i32 %and.5, 0
+ %shr.5 = lshr i32 %crc.1.4, 1
+ %xor.5 = xor i32 %shr.5, -306674912
+ %crc.1.5 = select i1 %tobool.5, i32 %shr.5, i32 %xor.5
+ %and.6 = and i32 %crc.1.5, 1
+ %tobool.6 = icmp eq i32 %and.6, 0
+ %shr.6 = lshr i32 %crc.1.5, 1
+ %xor.6 = xor i32 %shr.6, -306674912
+ %crc.1.6 = select i1 %tobool.6, i32 %shr.6, i32 %xor.6
+ %and.7 = and i32 %crc.1.6, 1
+ %tobool.7 = icmp eq i32 %and.7, 0
+ %shr.7 = lshr i32 %crc.1.6, 1
+ %xor.7 = xor i32 %shr.7, -306674912
+ %crc.1.7 = select i1 %tobool.7, i32 %shr.7, i32 %xor.7
+ %arrayidx = getelementptr inbounds [256 x i32]* @_ZL9crc32_tab, i32 0, i32 %i.08
+ store i32 %crc.1.7, i32* %arrayidx, align 4, !tbaa !3
+ %inc = add nsw i32 %i.08, 1
+ %exitcond = icmp eq i32 %inc, 256
+ br i1 %exitcond, label %for.end6, label %for.body3
+
+for.end6: ; preds = %for.body3
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL6func_1v() #0 {
+for.end97:
+ %agg.tmp = alloca i64, align 8
+ %tmpcast = bitcast i64* %agg.tmp to %struct.S0*
+ store i32 0, i32* @_ZL3g_2, align 4, !tbaa !3
+ %call = call fastcc zeroext i8 @_ZL7func_20iit(i32 0, i16 zeroext -16644)
+ %0 = load i32* @_ZL3g_2, align 4, !tbaa !3
+ %conv98 = trunc i32 %0 to i8
+ %call105 = call fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext 7, i16 zeroext 1)
+ %conv106 = zext i16 %call105 to i32
+ %call118 = call fastcc zeroext i8 @_ZL25safe_mul_func_uint8_t_u_uhh(i8 zeroext 1, i8 zeroext 23)
+ %conv119 = zext i8 %call118 to i32
+ %cmp120 = icmp uge i32 %conv106, %conv119
+ %conv121 = zext i1 %cmp120 to i32
+ %call122 = call fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %conv98, i32 %conv121)
+ %cmp124 = icmp ult i8 %call, %call122
+ %conv125 = zext i1 %cmp124 to i8
+ store i64 -21471878022, i64* %agg.tmp, align 8
+ call fastcc void @_ZL7func_14aPaS_2S0j(i8 signext %conv125, %struct.S0* byval align 4 %tmpcast)
+ call fastcc void @_ZL6func_5Pah()
+ %1 = load i32* @_ZL6g_1198, align 4, !tbaa !3
+ %tobool = icmp eq i32 %1, 0
+ br i1 %tobool, label %if.else1462, label %for.end311
+
+for.end311: ; preds = %for.end97
+ store i8 25, i8* @_ZL6g_1136, align 1, !tbaa !1
+ %bf.load = load i24* bitcast ({ i8, [3 x i8] }* @_ZL6g_1162 to i24*), align 4
+ %bf.clear = and i24 %bf.load, -262144
+ %bf.set = or i24 %bf.clear, zext (i1 icmp slt (i32 zext (i1 icmp sge (i32 zext (i1 icmp eq (i8* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 1), i8* @_ZL6g_1010) to i32), i32 1) to i32), i32 710400751) to i24)
+ store i24 %bf.set, i24* bitcast ({ i8, [3 x i8] }* @_ZL6g_1162 to i24*), align 4
+ store i16 1, i16* @_ZL5g_162, align 2, !tbaa !4
+ br label %cleanup1590
+
+if.else1462: ; preds = %for.end97
+ %2 = load i8*** @_ZL5g_984, align 4, !tbaa !0
+ %3 = load i8** %2, align 4, !tbaa !0
+ store i8 0, i8* %3, align 1, !tbaa !1
+ %call1515 = call fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext 0, i8 signext 1)
+ %call1517 = call fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %call1515, i32 58)
+ %conv1518 = zext i8 %call1517 to i16
+ %call1519 = call fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_utj(i16 zeroext %conv1518, i32 14)
+ %cmp1522 = icmp eq i16 %call1519, 4
+ %conv1523 = zext i1 %cmp1522 to i32
+ %xor15271 = or i32 %conv1523, 4
+ store i32 %xor15271, i32* @_ZL5g_135, align 4, !tbaa !3
+ %4 = load i8* @_ZL5g_136, align 1, !tbaa !1
+ %5 = load i8* @_ZL5g_133, align 1, !tbaa !1
+ %and15422 = and i8 %5, %4
+ %cmp1543 = icmp ne i8 %and15422, 1
+ %conv1544 = zext i1 %cmp1543 to i8
+ store i8 %conv1544, i8* @_ZL6g_1010, align 1, !tbaa !1
+ %6 = load i32* @_ZL5g_135, align 4, !tbaa !3
+ %call1565 = call fastcc i32 @_ZL25safe_sub_func_int32_t_s_sii(i32 1, i32 %6)
+ %conv1566 = trunc i32 %call1565 to i8
+ %7 = load i8** @_ZL5g_985, align 4, !tbaa !0
+ store i8 %conv1566, i8* %7, align 1, !tbaa !1
+ br label %cleanup1590
+
+cleanup1590: ; preds = %if.else1462, %for.end311
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL15transparent_crcyPci(i64 %val, i8* %vname, i32 %flag) #0 {
+entry:
+ tail call fastcc void @_ZL12crc32_8bytesy(i64 %val)
+ %tobool = icmp eq i32 %flag, 0
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %0 = load i32* @_ZL13crc32_context, align 4, !tbaa !3
+ %xor = xor i32 %0, -1
+ %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([36 x i8]* @.str48, i32 0, i32 0), i8* %vname, i32 %xor)
+ br label %if.end
+
+if.end: ; preds = %if.then, %entry
+ ret void
+}
+
+; Function Attrs: nounwind
+declare i32 @printf(i8* nocapture, ...) #0
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL17platform_main_endji(i32 %crc) #0 {
+entry:
+ %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str47, i32 0, i32 0), i32 %crc)
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL12crc32_8bytesy(i64 %val) #0 {
+entry:
+ %conv = trunc i64 %val to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv)
+ %shr1 = lshr i64 %val, 8
+ %conv3 = trunc i64 %shr1 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv3)
+ %shr4 = lshr i64 %val, 16
+ %conv6 = trunc i64 %shr4 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv6)
+ %shr7 = lshr i64 %val, 24
+ %conv9 = trunc i64 %shr7 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv9)
+ %shr10 = lshr i64 %val, 32
+ %conv12 = trunc i64 %shr10 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv12)
+ %shr13 = lshr i64 %val, 40
+ %conv15 = trunc i64 %shr13 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv15)
+ %shr16 = lshr i64 %val, 48
+ %conv18 = trunc i64 %shr16 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv18)
+ %shr19 = lshr i64 %val, 56
+ %conv21 = trunc i64 %shr19 to i8
+ tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv21)
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL10crc32_byteh(i8 zeroext %b) #0 {
+entry:
+ %0 = load i32* @_ZL13crc32_context, align 4, !tbaa !3
+ %shr = lshr i32 %0, 8
+ %conv = zext i8 %b to i32
+ %.masked = and i32 %0, 255
+ %and1 = xor i32 %.masked, %conv
+ %arrayidx = getelementptr inbounds [256 x i32]* @_ZL9crc32_tab, i32 0, i32 %and1
+ %1 = load i32* %arrayidx, align 4, !tbaa !3
+ %xor2 = xor i32 %shr, %1
+ store i32 %xor2, i32* @_ZL13crc32_context, align 4, !tbaa !3
+ ret void
+}
+
+; Function Attrs: nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) #1
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL6func_5Pah() #0 {
+for.end14:
+ %0 = load i8* @_ZL6g_1025, align 1, !tbaa !1
+ %inc15 = add i8 %0, 1
+ store i8 %inc15, i8* @_ZL6g_1025, align 1, !tbaa !1
+ %1 = load i32* @_ZL5g_400, align 4, !tbaa !3
+ %tobool = icmp eq i32 %1, 0
+ br i1 %tobool, label %if.else, label %if.then
+
+if.then: ; preds = %for.end14
+ %2 = load i64* bitcast (%struct.S0* @_ZL4g_83 to i64*), align 8
+ store i64 %2, i64* bitcast (%struct.S0* @_ZL5g_471 to i64*), align 8
+ br label %if.end
+
+if.else: ; preds = %for.end14
+ %and = and i32 %1, 23
+ store i32 %and, i32* @_ZL5g_400, align 4, !tbaa !3
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ ret void
+}
+
+; Function Attrs: nounwind readonly
+define internal fastcc i8* @_ZL6func_8ijPasS_(i16 signext %p_12) #2 {
+entry:
+ %0 = load i8*** @_ZL5g_984, align 4, !tbaa !0
+ %1 = load i8** %0, align 4, !tbaa !0
+ ret i8* %1
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL7func_14aPaS_2S0j(i8 signext %p_15, %struct.S0* byval nocapture align 4 %p_18) #0 {
+entry:
+ store i16 0, i16* @_ZL5g_172, align 2, !tbaa !4
+ %0 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %f0 = getelementptr inbounds %struct.S0* %p_18, i32 0, i32 0
+ %1 = load i16* %f0, align 4, !tbaa !4
+ %conv1 = sext i16 %1 to i32
+ %f2 = getelementptr inbounds %struct.S0* %p_18, i32 0, i32 2
+ %2 = load i32* %f2, align 4, !tbaa !3
+ %3 = load i32* @_ZL4g_93, align 4, !tbaa !3
+ %cmp2 = icmp ne i32 %2, %3
+ %conv3 = zext i1 %cmp2 to i32
+ %cmp4 = icmp sgt i32 %conv1, %conv3
+ %conv5 = zext i1 %cmp4 to i32
+ %cmp6 = icmp sge i32 %0, %conv5
+ %conv7 = zext i1 %cmp6 to i16
+ %call = tail call fastcc zeroext i16 @_ZL29safe_rshift_func_uint16_t_u_sti(i16 zeroext %conv7, i32 10)
+ %conv8 = zext i16 %call to i32
+ store i32 %conv8, i32* @_ZL5g_132, align 4, !tbaa !3
+ ret void
+}
+
+; Function Attrs: nounwind
+define internal fastcc zeroext i8 @_ZL7func_20iit(i32 %p_22, i16 zeroext %p_23) #0 {
+for.end7:
+ %agg.tmp = alloca %union.U1, align 4
+ %agg.tmp9 = alloca %struct.S0, align 4
+ %0 = load i32* @_ZL3g_2, align 4, !tbaa !3
+ %conv = trunc i32 %0 to i16
+ %conv11 = trunc i32 %p_22 to i8
+ store i8 %conv11, i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1
+ %dec = add i16 %p_23, -1
+ %l_60.sroa.0.0.idx = getelementptr inbounds %struct.S0* %agg.tmp9, i32 0, i32 0
+ store i16 26262, i16* %l_60.sroa.0.0.idx, align 4
+ %l_60.sroa.1.2.idx = getelementptr inbounds %struct.S0* %agg.tmp9, i32 0, i32 1
+ store i8 73, i8* %l_60.sroa.1.2.idx, align 2
+ %l_60.sroa.2.3.raw_cast = bitcast %struct.S0* %agg.tmp9 to i8*
+ %l_60.sroa.2.3.raw_idx = getelementptr inbounds i8* %l_60.sroa.2.3.raw_cast, i32 3
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %l_60.sroa.2.3.raw_idx, i8* getelementptr ([5 x i8]* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZZL7func_20iitE4l_60 to i8*), i32 3) to [5 x i8]*), i32 0, i32 0), i32 5, i32 1, i1 false)
+ call fastcc void @_ZL7func_492S0(%union.U1* sret %agg.tmp, %struct.S0* byval align 4 %agg.tmp9)
+ %.lobit = lshr i32 %0, 31
+ %1 = trunc i32 %.lobit to i8
+ %call33 = call fastcc signext i16 @_ZL7func_40ia(i8 signext %1)
+ %cmp35 = icmp eq i16 %call33, 3880
+ %conv36 = zext i1 %cmp35 to i32
+ %2 = load i16* @_ZL5g_361, align 2, !tbaa !4
+ %conv37 = zext i16 %2 to i32
+ %xor = xor i32 %conv37, %conv36
+ %conv38 = trunc i32 %xor to i16
+ store i16 %conv38, i16* @_ZL5g_361, align 2, !tbaa !4
+ %call43 = call fastcc signext i8 @_ZL24safe_sub_func_int8_t_s_saa(i8 signext -1)
+ %conv44 = sext i8 %call43 to i32
+ %call45 = call fastcc signext i16 @_ZL7func_32tiPa(i16 zeroext %conv, i32 %conv44)
+ %3 = load i32* @_ZL5g_400, align 4, !tbaa !3
+ %and53 = and i32 %3, -98
+ store i32 %and53, i32* @_ZL5g_400, align 4, !tbaa !3
+ %4 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 0, i32 4, i32 5), align 1, !tbaa !1
+ %call104 = call fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %4, i32 1)
+ %call105 = call fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %call104, i32 1)
+ %cmp124 = icmp ne i8 %call105, 0
+ %conv125 = zext i1 %cmp124 to i32
+ %5 = load i16* @_ZL4g_77, align 2, !tbaa !4
+ %conv571 = trunc i16 %5 to i8
+ %6 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %7 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1
+ %conv432 = sext i8 %7 to i32
+ %xor434 = xor i32 %conv432, %6
+ br label %lbl_496
+
+lbl_496.loopexit: ; preds = %for.body302
+ store i16 %call312.lobit, i16* @_ZL5g_162, align 2, !tbaa !4
+ store i32 %conv357, i32* @_ZL5g_400, align 4, !tbaa !3
+ %phitmp38 = add i32 %l_404.0, -1
+ br label %lbl_496
+
+lbl_496: ; preds = %lbl_496.loopexit, %for.end7
+ %l_404.0 = phi i32 [ -1124763087, %for.end7 ], [ %phitmp38, %lbl_496.loopexit ]
+ %p_23.addr.0 = phi i16 [ %dec, %for.end7 ], [ %conv332, %lbl_496.loopexit ]
+ %p_22.addr.0 = phi i32 [ %p_22, %for.end7 ], [ %p_22.addr.235, %lbl_496.loopexit ]
+ store i32 0, i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3
+ %tobool156 = icmp ne i32 %p_22.addr.0, 0
+ %phitmp = zext i1 %tobool156 to i8
+ %conv428 = trunc i32 %p_22.addr.0 to i8
+ %8 = load i16* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 0), align 8, !tbaa !4
+ %conv438 = sext i16 %8 to i32
+ %_ZL5g_400.promoted = load i32* @_ZL5g_400, align 4, !tbaa !3
+ %_ZL5g_138.promoted = load i32* @_ZL5g_138, align 4, !tbaa !3
+ br label %for.body59
+
+for.body59: ; preds = %lor.end440.3, %lbl_496
+ %and12827 = phi i32 [ %_ZL5g_138.promoted, %lbl_496 ], [ %and128, %lor.end440.3 ]
+ %9 = phi i32 [ %_ZL5g_400.promoted, %lbl_496 ], [ 0, %lor.end440.3 ]
+ %cmp107 = icmp ult i32 %9, 255
+ br i1 %cmp107, label %lor.end, label %lor.rhs
+
+lor.rhs: ; preds = %for.body59
+ %conv117 = trunc i32 %9 to i8
+ %call118 = call fastcc zeroext i8 @_ZL25safe_add_func_uint8_t_u_uhh(i8 zeroext -15, i8 zeroext %conv117)
+ %conv119 = zext i8 %call118 to i16
+ store i16 %conv119, i16* @_ZL5g_361, align 2, !tbaa !4
+ br label %lor.end
+
+lor.end: ; preds = %lor.rhs, %for.body59
+ %10 = load i32* @_ZL4g_93, align 4, !tbaa !3
+ %or127 = or i32 %9, %10
+ %and128 = and i32 %and12827, %or127
+ br i1 %tobool156, label %if.then, label %for.body191
+
+if.then: ; preds = %lor.end
+ %call158 = call fastcc signext i8 @_ZL24safe_add_func_int8_t_s_saa(i8 signext -8, i8 signext -1)
+ %conv159 = sext i8 %call158 to i16
+ store i8 -1, i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1
+ store i16 8, i16* @_ZL5g_361, align 2, !tbaa !4
+ %call183 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %conv159, i16 signext 1)
+ %conv184 = sext i16 %call183 to i32
+ %11 = load i32* @_ZL4g_93, align 4, !tbaa !3
+ %xor185 = xor i32 %11, %conv184
+ store i32 %xor185, i32* @_ZL4g_93, align 4, !tbaa !3
+ %tobool198 = icmp eq i32 %or127, 0
+ br i1 %tobool198, label %for.body412, label %land.lhs.true
+
+for.body191: ; preds = %lor.end
+ store i32 %or127, i32* @_ZL5g_400, align 4, !tbaa !3
+ store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3
+ %conv192 = trunc i32 %or127 to i8
+ br label %cleanup583
+
+land.lhs.true: ; preds = %if.then
+ %12 = load i16* @_ZL5g_361, align 2, !tbaa !4
+ %conv201 = zext i16 %12 to i32
+ %xor202 = xor i32 %conv201, 57244
+ %conv203 = trunc i32 %xor202 to i16
+ store i16 %conv203, i16* @_ZL5g_361, align 2, !tbaa !4
+ %call204 = call fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext 0, i16 zeroext %conv203)
+ %13 = load i16* @_ZL5g_168, align 2, !tbaa !4
+ %conv207 = sext i16 %13 to i32
+ %cmp209 = icmp ne i16 %call204, 0
+ %conv210 = zext i1 %cmp209 to i32
+ %cmp212 = icmp slt i32 %conv210, %conv207
+ %conv213 = zext i1 %cmp212 to i16
+ store i16 %conv213, i16* @_ZL5g_168, align 2, !tbaa !4
+ br i1 %cmp212, label %if.then214, label %for.body412
+
+if.then214: ; preds = %land.lhs.true
+ store i32 %or127, i32* @_ZL5g_400, align 4, !tbaa !3
+ store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3
+ %tobool295 = icmp eq i32 %or127, 0
+ br i1 %tobool295, label %for.cond300.preheader, label %cleanup583
+
+for.cond300.preheader: ; preds = %if.then214
+ %14 = load i64* bitcast (%struct.S0* @_ZL4g_83 to i64*), align 8
+ %15 = load i16* @_ZL5g_168, align 2, !tbaa !4
+ %call312 = call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %15, i32 -1)
+ %call312.lobit = lshr i16 %call312, 15
+ %call331 = call fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext 1, i8 signext -7)
+ %conv332 = sext i8 %call331 to i16
+ %call354 = call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext 1, i32 1631231813)
+ %call356 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %call354, i16 signext 0)
+ %conv357 = sext i16 %call356 to i32
+ %tobool358 = icmp eq i32 %l_404.0, 0
+ br label %for.body302
+
+for.cond300: ; preds = %for.body302
+ %sub = add nsw i32 %p_22.addr.235, -1
+ %cmp301 = icmp sgt i32 %p_22.addr.235, 0
+ br i1 %cmp301, label %for.body302, label %cleanup583.loopexit32
+
+for.body302: ; preds = %for.cond300, %for.cond300.preheader
+ %p_22.addr.235 = phi i32 [ 3, %for.cond300.preheader ], [ %sub, %for.cond300 ]
+ store i64 %14, i64* bitcast (%struct.S0* @_ZL5g_471 to i64*), align 8
+ store i32 1, i32* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 2), align 4, !tbaa !3
+ br i1 %tobool358, label %for.cond300, label %lbl_496.loopexit
+
+for.body412: ; preds = %land.lhs.true, %if.then
+ %16 = load i16* @_ZL5g_168, align 2, !tbaa !4
+ %call568 = call fastcc i32 @_ZL26safe_mod_func_uint32_t_u_ujj(i32 0, i32 -13150355)
+ %cmp569 = icmp ne i32 %call568, 0
+ %conv570 = zext i1 %cmp569 to i8
+ %call572 = call fastcc signext i8 @_ZL24safe_mul_func_int8_t_s_saa(i8 signext %conv570, i8 signext %conv571)
+ %conv433 = sext i16 %16 to i32
+ %xor435 = xor i32 %xor434, %conv433
+ %cmp436 = icmp slt i32 %xor435, %p_22.addr.0
+ %conv437 = zext i1 %cmp436 to i32
+ %cmp439 = icmp sgt i32 %conv437, %conv438
+ %_ZL5g_361.promoted = load i16* @_ZL5g_361, align 2, !tbaa !4
+ br i1 %tobool156, label %lor.end440.2.thread, label %lor.rhs421.3
+
+lor.end440.2.thread: ; preds = %for.body412
+ %conv44250 = zext i16 %_ZL5g_361.promoted to i32
+ %xor443.257 = xor i32 %conv44250, 1
+ br label %lor.end440.3
+
+cleanup583.loopexit: ; preds = %lor.end440.3
+ store i32 0, i32* @_ZL5g_400, align 4, !tbaa !3
+ store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3
+ br label %cleanup583
+
+cleanup583.loopexit32: ; preds = %for.cond300
+ store i16 %call312.lobit, i16* @_ZL5g_162, align 2, !tbaa !4
+ store i32 %conv357, i32* @_ZL5g_400, align 4, !tbaa !3
+ br label %cleanup583
+
+cleanup583: ; preds = %cleanup583.loopexit32, %cleanup583.loopexit, %if.then214, %for.body191
+ %cleanup.dest.slot.2 = phi i1 [ false, %for.body191 ], [ true, %cleanup583.loopexit ], [ false, %cleanup583.loopexit32 ], [ true, %if.then214 ]
+ %retval.6 = phi i8 [ %conv192, %for.body191 ], [ undef, %cleanup583.loopexit ], [ -100, %cleanup583.loopexit32 ], [ undef, %if.then214 ]
+ %17 = load i8* @_ZL5g_170, align 1, !tbaa !1
+ %.retval.6 = select i1 %cleanup.dest.slot.2, i8 %17, i8 %retval.6
+ ret i8 %.retval.6
+
+lor.rhs421.3: ; preds = %for.body412
+ %conv441 = zext i1 %cmp439 to i32
+ %conv442 = zext i16 %_ZL5g_361.promoted to i32
+ %xor443 = xor i32 %conv442, %conv441
+ %conv441.1 = zext i1 %cmp439 to i32
+ %xor533.1 = xor i32 %xor443, %conv441.1
+ %conv441.2 = zext i1 %cmp439 to i32
+ %xor443.2 = xor i32 %xor533.1, %conv441.2
+ %call422.3 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %16, i16 signext %p_23.addr.0)
+ %tobool423.3 = icmp eq i16 %call422.3, 0
+ %phitmp..3 = select i1 %tobool423.3, i8 %phitmp, i8 1
+ %call429.3 = call fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext %phitmp..3, i8 zeroext %conv428)
+ %conv430.3 = zext i8 %call429.3 to i32
+ %xor431.3 = xor i32 %conv430.3, %conv125
+ store i32 %xor431.3, i32* @_ZL5g_546, align 4, !tbaa !3
+ br label %lor.end440.3
+
+lor.end440.3: ; preds = %lor.rhs421.3, %lor.end440.2.thread
+ %xor443.258 = phi i32 [ %xor443.2, %lor.rhs421.3 ], [ %xor443.257, %lor.end440.2.thread ]
+ %18 = phi i1 [ %cmp439, %lor.rhs421.3 ], [ true, %lor.end440.2.thread ]
+ %conv441.3 = zext i1 %18 to i32
+ %xor533.3 = xor i32 %xor443.258, %conv441.3
+ %conv534.3 = trunc i32 %xor533.3 to i16
+ %conv573 = sext i8 %call572 to i32
+ store i32 %conv573, i32* @_ZL4g_93, align 4, !tbaa !3
+ store i16 %conv534.3, i16* @_ZL5g_361, align 2, !tbaa !4
+ store i8 0, i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1
+ store i16 %16, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), align 8, !tbaa !4
+ %19 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3
+ %add581 = add i32 %19, 1
+ store i32 %add581, i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3
+ %cmp58 = icmp eq i32 %add581, 0
+ br i1 %cmp58, label %for.body59, label %cleanup583.loopexit
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %left, i32 %right) #3 {
+entry:
+ %0 = icmp ugt i32 %right, 31
+ %conv = zext i8 %left to i32
+ %shr = select i1 %0, i32 0, i32 %right
+ %conv.shr = lshr i32 %conv, %shr
+ %conv3 = trunc i32 %conv.shr to i8
+ ret i8 %conv3
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 {
+entry:
+ %conv = zext i16 %ui1 to i32
+ %conv1 = zext i16 %ui2 to i32
+ %mul = mul i32 %conv1, %conv
+ %conv2 = trunc i32 %mul to i16
+ ret i16 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @_ZL25safe_mul_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 {
+entry:
+ %conv = zext i8 %ui1 to i32
+ %conv1 = zext i8 %ui2 to i32
+ %mul = mul i32 %conv1, %conv
+ %conv2 = trunc i32 %mul to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 {
+entry:
+ %conv = zext i8 %ui1 to i32
+ %conv1 = zext i8 %ui2 to i32
+ %sub = sub nsw i32 %conv, %conv1
+ %conv2 = trunc i32 %sub to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 {
+entry:
+ %cmp = icmp eq i32 %ui2, 0
+ br i1 %cmp, label %cond.end, label %cond.false
+
+cond.false: ; preds = %entry
+ %div = udiv i32 %ui1, %ui2
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %entry
+ %cond = phi i32 [ %div, %cond.false ], [ %ui1, %entry ]
+ ret i32 %cond
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL26safe_mod_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 {
+entry:
+ %cmp = icmp eq i16 %ui2, 0
+ %conv1 = zext i16 %ui1 to i32
+ br i1 %cmp, label %cond.end, label %cond.false
+
+cond.false: ; preds = %entry
+ %0 = urem i16 %ui1, %ui2
+ %rem = zext i16 %0 to i32
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %entry
+ %cond = phi i32 [ %rem, %cond.false ], [ %conv1, %entry ]
+ %conv4 = trunc i32 %cond to i16
+ ret i16 %conv4
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %left, i32 %right) #3 {
+entry:
+ %0 = icmp ugt i32 %right, 31
+ br i1 %0, label %cond.true, label %lor.lhs.false2
+
+lor.lhs.false2: ; preds = %entry
+ %conv = zext i8 %left to i32
+ %shr = lshr i32 255, %right
+ %cmp3 = icmp sgt i32 %conv, %shr
+ br i1 %cmp3, label %cond.true, label %cond.false
+
+cond.true: ; preds = %lor.lhs.false2, %entry
+ %conv4 = zext i8 %left to i32
+ br label %cond.end
+
+cond.false: ; preds = %lor.lhs.false2
+ %shl = shl i32 %conv, %right
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv4, %cond.true ], [ %shl, %cond.false ]
+ %conv6 = trunc i32 %cond to i8
+ ret i8 %conv6
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL25safe_sub_func_int32_t_s_sii(i32 %si1, i32 %si2) #3 {
+entry:
+ %xor = xor i32 %si2, %si1
+ %and = and i32 %xor, -2147483648
+ %xor2 = xor i32 %and, %si1
+ %sub = sub nsw i32 %xor2, %si2
+ %xor3 = xor i32 %sub, %si2
+ %and4 = and i32 %xor3, %xor
+ %cmp = icmp slt i32 %and4, 0
+ %sub5 = select i1 %cmp, i32 0, i32 %si2
+ %si1.sub5 = sub nsw i32 %si1, %sub5
+ ret i32 %si1.sub5
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %si1, i16 signext %si2) #3 {
+entry:
+ %conv = sext i16 %si1 to i32
+ %conv1 = sext i16 %si2 to i32
+ %mul = mul nsw i32 %conv1, %conv
+ %conv2 = trunc i32 %mul to i16
+ ret i16 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_utj(i16 zeroext %left, i32 %right) #3 {
+entry:
+ %cmp = icmp ugt i32 %right, 31
+ br i1 %cmp, label %cond.true, label %lor.lhs.false
+
+lor.lhs.false: ; preds = %entry
+ %conv = zext i16 %left to i32
+ %shr = lshr i32 65535, %right
+ %cmp1 = icmp sgt i32 %conv, %shr
+ br i1 %cmp1, label %cond.true, label %cond.false
+
+cond.true: ; preds = %lor.lhs.false, %entry
+ %conv2 = zext i16 %left to i32
+ br label %cond.end
+
+cond.false: ; preds = %lor.lhs.false
+ %shl = shl i32 %conv, %right
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv2, %cond.true ], [ %shl, %cond.false ]
+ %conv4 = trunc i32 %cond to i16
+ ret i16 %conv4
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %left, i32 %right) #3 {
+entry:
+ %conv = sext i16 %left to i32
+ %cmp = icmp slt i16 %left, 0
+ %cmp1 = icmp ugt i32 %right, 31
+ %or.cond = or i1 %cmp, %cmp1
+ %shr = lshr i32 32767, %right
+ %cmp4 = icmp sgt i32 %conv, %shr
+ %or.cond6 = or i1 %or.cond, %cmp4
+ %shl = select i1 %or.cond6, i32 0, i32 %right
+ %cond = shl i32 %conv, %shl
+ %conv7 = trunc i32 %cond to i16
+ ret i16 %conv7
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL25safe_sub_func_int16_t_s_sss(i16 signext %si2) #3 {
+entry:
+ %conv11 = zext i16 %si2 to i32
+ %sub = sub nsw i32 1, %conv11
+ %conv2 = trunc i32 %sub to i16
+ ret i16 %conv2
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL29safe_rshift_func_uint16_t_u_utj() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL25safe_add_func_int16_t_s_sss(i16 signext %si1, i16 signext %si2) #3 {
+entry:
+ %conv3 = zext i16 %si1 to i32
+ %conv14 = zext i16 %si2 to i32
+ %add = add nsw i32 %conv14, %conv3
+ %conv2 = trunc i32 %add to i16
+ ret i16 %conv2
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL26safe_sub_func_uint32_t_u_ujj() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL25safe_mod_func_int32_t_s_sii(i32 %si1, i32 %si2) #3 {
+entry:
+ %cmp = icmp eq i32 %si2, 0
+ br i1 %cmp, label %cond.end, label %lor.lhs.false
+
+lor.lhs.false: ; preds = %entry
+ %cmp1 = icmp eq i32 %si1, -2147483648
+ %cmp2 = icmp eq i32 %si2, -1
+ %or.cond = and i1 %cmp1, %cmp2
+ br i1 %or.cond, label %cond.end, label %cond.false
+
+cond.false: ; preds = %lor.lhs.false
+ %rem = srem i32 %si1, %si2
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %lor.lhs.false, %entry
+ %cond = phi i32 [ %rem, %cond.false ], [ %si1, %lor.lhs.false ], [ %si1, %entry ]
+ ret i32 %cond
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL25safe_add_func_int32_t_s_sii(i32 %si1) #3 {
+entry:
+ %cmp3 = icmp sgt i32 %si1, 1806657196
+ %add = add nsw i32 %si1, 340826451
+ %si1.add = select i1 %cmp3, i32 %si1, i32 %add
+ ret i32 %si1.add
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL29safe_rshift_func_uint16_t_u_sti(i16 zeroext %left, i32 %right) #3 {
+entry:
+ %0 = icmp ugt i32 %right, 31
+ %conv = zext i16 %left to i32
+ %shr = select i1 %0, i32 0, i32 %right
+ %conv.shr = lshr i32 %conv, %shr
+ %conv3 = trunc i32 %conv.shr to i16
+ ret i16 %conv3
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL31safe_unary_minus_func_int16_t_ss() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL26safe_mod_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 {
+entry:
+ %cmp = icmp eq i32 %ui2, 0
+ br i1 %cmp, label %cond.end, label %cond.false
+
+cond.false: ; preds = %entry
+ %rem = urem i32 %ui1, %ui2
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %entry
+ %cond = phi i32 [ %rem, %cond.false ], [ %ui1, %entry ]
+ ret i32 %cond
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL26safe_add_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 {
+entry:
+ %conv = zext i16 %ui1 to i32
+ %conv1 = zext i16 %ui2 to i32
+ %add = add nsw i32 %conv1, %conv
+ %conv2 = trunc i32 %add to i16
+ ret i16 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i8 @_ZL25safe_add_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 {
+entry:
+ %conv = zext i8 %ui1 to i32
+ %conv1 = zext i8 %ui2 to i32
+ %add = add nsw i32 %conv1, %conv
+ %conv2 = trunc i32 %add to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL25safe_div_func_int32_t_s_sii() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL27safe_lshift_func_int8_t_s_sai(i32 %right) #3 {
+entry:
+ %0 = icmp ugt i32 %right, 31
+ %shr = lshr i32 127, %right
+ %cmp6 = icmp slt i32 %shr, 1
+ %or.cond = or i1 %0, %cmp6
+ br i1 %or.cond, label %cond.end, label %cond.false
+
+cond.false: ; preds = %entry
+ %shl = shl i32 1, %right
+ %phitmp = trunc i32 %shl to i8
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %entry
+ %cond = phi i8 [ %phitmp, %cond.false ], [ 1, %entry ]
+ ret i8 %cond
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL24safe_sub_func_int8_t_s_saa(i8 signext %si1) #3 {
+entry:
+ %conv1 = zext i8 %si1 to i32
+ %sub = add nsw i32 %conv1, 183
+ %conv2 = trunc i32 %sub to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL26safe_div_func_uint16_t_u_utt() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL28safe_rshift_func_int16_t_s_usj(i16 signext %left, i32 %right) #3 {
+entry:
+ %conv = sext i16 %left to i32
+ %cmp = icmp slt i16 %left, 0
+ %cmp1 = icmp ugt i32 %right, 31
+ %or.cond = or i1 %cmp, %cmp1
+ %shr = select i1 %or.cond, i32 0, i32 %right
+ %cond = ashr i32 %conv, %shr
+ %conv4 = trunc i32 %cond to i16
+ ret i16 %conv4
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL28safe_lshift_func_uint8_t_u_uhj() #0 {
+entry:
+ unreachable
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 {
+entry:
+ %conv = sext i8 %si2 to i32
+ %cmp = icmp eq i8 %si2, 0
+ br i1 %cmp, label %cond.true, label %lor.lhs.false
+
+lor.lhs.false: ; preds = %entry
+ %cmp2 = icmp eq i8 %si1, -128
+ %cmp4 = icmp eq i8 %si2, -1
+ %or.cond = and i1 %cmp2, %cmp4
+ br i1 %or.cond, label %cond.true, label %cond.false
+
+cond.true: ; preds = %lor.lhs.false, %entry
+ %conv5 = sext i8 %si1 to i32
+ br label %cond.end
+
+cond.false: ; preds = %lor.lhs.false
+ %conv1 = sext i8 %si1 to i32
+ %rem = srem i32 %conv1, %conv
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv5, %cond.true ], [ %rem, %cond.false ]
+ %conv8 = trunc i32 %cond to i8
+ ret i8 %conv8
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 {
+entry:
+ %conv = sext i8 %si2 to i32
+ %cmp = icmp eq i8 %si2, 0
+ br i1 %cmp, label %cond.true, label %lor.lhs.false
+
+lor.lhs.false: ; preds = %entry
+ %cmp2 = icmp eq i8 %si1, -128
+ %cmp4 = icmp eq i8 %si2, -1
+ %or.cond = and i1 %cmp2, %cmp4
+ br i1 %or.cond, label %cond.true, label %cond.false
+
+cond.true: ; preds = %lor.lhs.false, %entry
+ %conv5 = sext i8 %si1 to i32
+ br label %cond.end
+
+cond.false: ; preds = %lor.lhs.false
+ %conv1 = sext i8 %si1 to i32
+ %div = sdiv i32 %conv1, %conv
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv5, %cond.true ], [ %div, %cond.false ]
+ %conv8 = trunc i32 %cond to i8
+ ret i8 %conv8
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_sti(i16 zeroext %left, i32 %right) #3 {
+entry:
+ %0 = icmp ugt i32 %right, 31
+ br i1 %0, label %cond.true, label %lor.lhs.false2
+
+lor.lhs.false2: ; preds = %entry
+ %conv = zext i16 %left to i32
+ %shr = lshr i32 65535, %right
+ %cmp3 = icmp sgt i32 %conv, %shr
+ br i1 %cmp3, label %cond.true, label %cond.false
+
+cond.true: ; preds = %lor.lhs.false2, %entry
+ %conv4 = zext i16 %left to i32
+ br label %cond.end
+
+cond.false: ; preds = %lor.lhs.false2
+ %shl = shl i32 %conv, %right
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv4, %cond.true ], [ %shl, %cond.false ]
+ %conv6 = trunc i32 %cond to i16
+ ret i16 %conv6
+}
+
+; Function Attrs: nounwind
+define internal fastcc signext i16 @_ZL7func_32tiPa(i16 zeroext %p_33, i32 %p_34) #0 {
+return:
+ store i32 1, i32* @_ZL5g_135, align 4, !tbaa !3
+ %0 = load i8* @_ZL5g_126, align 1, !tbaa !1
+ %call8 = tail call fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext %0, i8 signext 0)
+ %conv9 = sext i8 %call8 to i32
+ %1 = load i16* @_ZL5g_168, align 2, !tbaa !4
+ %conv10 = sext i16 %1 to i32
+ %cmp11 = icmp eq i32 %conv9, %conv10
+ %conv12 = zext i1 %cmp11 to i32
+ %2 = load i8* @_ZL5g_136, align 1, !tbaa !1
+ %conv131 = zext i8 %2 to i32
+ %or = or i32 %conv12, %conv131
+ %conv14 = trunc i32 %or to i8
+ store i8 %conv14, i8* @_ZL5g_136, align 1, !tbaa !1
+ %3 = load i32* @_ZL5g_132, align 4, !tbaa !3
+ %or27 = or i32 %3, 1
+ %call28 = tail call fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 -10, i32 %or27)
+ %conv29 = trunc i32 %call28 to i16
+ store i16 %conv29, i16* @_ZL4g_82, align 2, !tbaa !4
+ %conv34 = zext i16 %p_33 to i32
+ store i8 0, i8* @_ZL5g_133, align 1, !tbaa !1
+ %4 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1
+ %not.tobool68 = icmp ne i8 %4, 0
+ %5 = zext i1 %not.tobool68 to i32
+ %or82 = or i32 %5, %conv34
+ %6 = load i8* @_ZL5g_126, align 1, !tbaa !1
+ %conv832 = zext i8 %6 to i32
+ %xor = xor i32 %or82, %conv832
+ %conv84 = trunc i32 %xor to i8
+ store i8 %conv84, i8* @_ZL5g_126, align 1, !tbaa !1
+ %lnot = icmp ne i8 %conv84, 0
+ %xor87 = zext i1 %lnot to i32
+ store i32 %xor87, i32* @_ZL5g_132, align 4, !tbaa !3
+ ret i16 -20646
+}
+
+; Function Attrs: nounwind
+define internal fastcc signext i16 @_ZL7func_40ia(i8 signext %p_42) #0 {
+entry:
+ %call = tail call fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext 0, i8 signext 7)
+ %conv2 = sext i8 %call to i32
+ %0 = load i32* @_ZL3g_2, align 4, !tbaa !3
+ %conv3 = trunc i32 %0 to i8
+ %call4 = tail call fastcc signext i8 @_ZL30safe_unary_minus_func_int8_t_sa(i8 signext %conv3)
+ %conv5 = sext i8 %call4 to i16
+ store i16 %conv5, i16* bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i16*), align 4, !tbaa !4
+ %conv6 = sext i8 %call4 to i32
+ %cmp8 = icmp sgt i32 %conv6, zext (i1 icmp ne (i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), i8* @_ZL5g_304) to i32)
+ %conv9 = zext i1 %cmp8 to i32
+ %cmp10 = icmp ne i32 %conv2, %conv9
+ %conv11 = zext i1 %cmp10 to i16
+ %call12 = tail call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %conv11, i32 7)
+ %conv13 = sext i16 %call12 to i32
+ store i32 %conv13, i32* @_ZL5g_257, align 4, !tbaa !3
+ %tobool = icmp eq i16 %call12, 0
+ br i1 %tobool, label %land.end, label %land.rhs
+
+land.rhs: ; preds = %entry
+ %1 = load i16* @_ZL5g_308, align 2, !tbaa !4
+ %conv17 = zext i16 %1 to i32
+ %xor = xor i32 %conv17, %conv13
+ %conv18 = trunc i32 %xor to i16
+ store i16 %conv18, i16* @_ZL5g_308, align 2, !tbaa !4
+ %lnot = icmp eq i16 %conv18, 0
+ %conv20 = zext i1 %lnot to i32
+ %2 = load i16* @_ZL4g_79, align 2, !tbaa !4
+ %conv21 = zext i16 %2 to i32
+ %xor22 = xor i32 %conv20, %conv21
+ %conv23 = trunc i32 %xor22 to i16
+ store i16 %conv23, i16* @_ZL4g_79, align 2, !tbaa !4
+ %tobool24 = icmp ne i16 %conv23, 0
+ %phitmp = zext i1 %tobool24 to i16
+ br label %land.end
+
+land.end: ; preds = %land.rhs, %entry
+ %3 = phi i16 [ 0, %entry ], [ %phitmp, %land.rhs ]
+ store i16 %3, i16* bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i16*), align 4, !tbaa !4
+ %conv31 = sext i8 %p_42 to i16
+ ret i16 %conv31
+}
+
+; Function Attrs: nounwind
+define internal fastcc void @_ZL7func_492S0(%union.U1* noalias nocapture sret %agg.result, %struct.S0* byval nocapture align 4 %p_50) #0 {
+entry:
+ %l_131 = alloca i32, align 4
+ %l_129 = alloca i32, align 4
+ store i32 1179615507, i32* %l_131, align 4, !tbaa !3
+ store i32 3, i32* @_ZL4g_53, align 4, !tbaa !3
+ %f1 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 1
+ %f0 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 0
+ %f2 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 2
+ br label %for.end86
+
+for.end86: ; preds = %for.inc1370, %entry
+ store i32 1795078696, i32* %l_129, align 4, !tbaa !3
+ store i8 0, i8* %f1, align 2, !tbaa !1
+ br label %for.body90
+
+for.body90: ; preds = %for.inc1329, %for.end86
+ %0 = load i16* %f0, align 4, !tbaa !4
+ %conv110 = sext i16 %0 to i32
+ %call111 = call fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 0, i32 %conv110)
+ %1 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %call112 = call fastcc i32 @_ZL25safe_mod_func_int32_t_s_sii(i32 %call111, i32 %1)
+ %cmp113 = icmp ult i32 %call112, -1508745334
+ %conv114 = zext i1 %cmp113 to i32
+ %2 = load i16* @_ZL4g_77, align 2, !tbaa !4
+ %conv116 = zext i16 %2 to i32
+ %xor117 = xor i32 %conv116, %conv114
+ %conv118 = trunc i32 %xor117 to i16
+ store i16 %conv118, i16* @_ZL4g_77, align 2, !tbaa !4
+ store i16 %conv118, i16* @_ZL4g_79, align 2, !tbaa !4
+ %and120 = and i32 %xor117, 1
+ %3 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %cmp121 = icmp eq i32 %and120, %3
+ %conv122 = zext i1 %cmp121 to i16
+ store i16 %conv122, i16* @_ZL4g_82, align 2, !tbaa !4
+ %4 = load i32* %f2, align 4, !tbaa !3
+ %conv127 = trunc i32 %4 to i8
+ %call128 = call fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext -5, i8 zeroext %conv127)
+ %tobool129 = icmp eq i8 %call128, 0
+ br i1 %tobool129, label %cleanup1367, label %land.lhs.true
+
+land.lhs.true: ; preds = %for.body90
+ %5 = load i8* %f1, align 2, !tbaa !1
+ %tobool131 = icmp eq i8 %5, 0
+ br i1 %tobool131, label %cleanup1367, label %for.end139
+
+for.end139: ; preds = %land.lhs.true
+ %6 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1
+ %tobool140 = icmp eq i8 %6, 0
+ br i1 %tobool140, label %for.end582, label %for.inc1370
+
+for.end582: ; preds = %for.end139
+ %7 = load i8* %f1, align 2, !tbaa !1
+ %conv554 = sext i8 %7 to i32
+ %add = add nsw i32 %conv554, 1
+ %8 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %add555 = add nsw i32 %8, 1
+ %arrayidx559 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %conv554, i32 %add555, i32 %add
+ %9 = load i8* %arrayidx559, align 1, !tbaa !1
+ %conv560 = sext i8 %9 to i32
+ %10 = load i32* %f2, align 4, !tbaa !3
+ %xor561 = xor i32 %conv560, %and120
+ %or563 = or i32 %xor561, %10
+ %xor561.1 = xor i32 %conv560, %or563
+ %or563.1 = or i32 %xor561.1, %10
+ %xor561.2 = xor i32 %conv560, %or563.1
+ %or563.2 = or i32 %xor561.2, %10
+ %xor561.3 = xor i32 %conv560, %or563.2
+ %or563.3 = or i32 %xor561.3, %10
+ store i32 %or563.3, i32* @_ZL4g_93, align 4, !tbaa !3
+ store i16 0, i16* %f0, align 4, !tbaa !4
+ %11 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3
+ %conv637 = trunc i32 %11 to i16
+ %call638 = call fastcc signext i16 @_ZL25safe_sub_func_int16_t_s_sss(i16 signext %conv637)
+ %tobool639 = icmp eq i16 %call638, 0
+ br i1 %tobool639, label %if.else1214, label %if.then640
+
+if.then640: ; preds = %for.end582
+ %12 = load i32* @_ZL5g_138, align 4, !tbaa !3
+ %inc733 = add i32 %12, 1
+ store i32 %inc733, i32* @_ZL5g_138, align 4, !tbaa !3
+ %13 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 0, i32 1, i32 2), align 1, !tbaa !1
+ %tobool734 = icmp eq i8 %13, 0
+ br i1 %tobool734, label %if.end1219.loopexit, label %for.inc1329
+
+if.else1214: ; preds = %for.end582
+ %14 = load i8* %f1, align 2, !tbaa !1
+ %tobool1216 = icmp eq i8 %14, 0
+ br i1 %tobool1216, label %if.end1219, label %for.inc1370
+
+if.end1219.loopexit: ; preds = %if.then640
+ store i16 -28, i16* @_ZL4g_77, align 2, !tbaa !4
+ br label %if.end1219
+
+if.end1219: ; preds = %if.end1219.loopexit, %if.else1214
+ store i32 0, i32* %l_129, align 4, !tbaa !3
+ store i32 1, i32* %l_131, align 4, !tbaa !3
+ %15 = load i8* %f1, align 2, !tbaa !1
+ %tobool1257 = icmp eq i8 %15, 0
+ br i1 %tobool1257, label %lor.lhs.false, label %for.end1334.loopexit742
+
+lor.lhs.false: ; preds = %if.end1219
+ %16 = load i16* %f0, align 4, !tbaa !4
+ %tobool1259 = icmp eq i16 %16, 0
+ br i1 %tobool1259, label %if.else1312, label %for.end1334.loopexit742
+
+if.else1312: ; preds = %lor.lhs.false
+ store i32* %l_129, i32** getelementptr inbounds ([2 x [10 x i32*]]* @_ZL5g_197, i32 0, i32 1, i32 9), align 4, !tbaa !0
+ br label %for.inc1370
+
+for.inc1329: ; preds = %if.then640
+ %17 = load i8* %f1, align 2, !tbaa !1
+ %conv1331700 = zext i8 %17 to i32
+ %add1332 = add nsw i32 %conv1331700, 1
+ %conv1333 = trunc i32 %add1332 to i8
+ store i8 %conv1333, i8* %f1, align 2, !tbaa !1
+ %cmp89 = icmp slt i8 %conv1333, 4
+ br i1 %cmp89, label %for.body90, label %for.inc1370
+
+for.end1334.loopexit742: ; preds = %lor.lhs.false, %if.end1219
+ store i8 13, i8* @_ZL5g_170, align 1, !tbaa !1
+ br label %for.inc1370
+
+cleanup1367: ; preds = %land.lhs.true, %for.body90
+ %18 = load i32* @_ZL4g_93, align 4, !tbaa !3
+ %and635 = and i32 %18, -6
+ store i32 %and635, i32* @_ZL4g_93, align 4, !tbaa !3
+ %19 = load i8** bitcast ({ i8, [3 x i8] }* @_ZZL7func_492S0E5l_119 to i8**), align 4
+ %20 = getelementptr inbounds %union.U1* %agg.result, i32 0, i32 0
+ store i8* %19, i8** %20, align 4
+ br label %cleanup1381
+
+for.inc1370: ; preds = %for.end1334.loopexit742, %for.inc1329, %if.else1312, %if.else1214, %for.end139
+ store i32* %l_131, i32** getelementptr inbounds ([2 x [10 x i32*]]* @_ZL5g_197, i32 0, i32 1, i32 7), align 4, !tbaa !0
+ store i8 -1, i8* @_ZL5g_136, align 1, !tbaa !1
+ %21 = load i32* @_ZL4g_53, align 4, !tbaa !3
+ %sub1371 = add nsw i32 %21, -1
+ store i32 %sub1371, i32* @_ZL4g_53, align 4, !tbaa !3
+ %cmp = icmp sgt i32 %21, 0
+ br i1 %cmp, label %for.end86, label %for.end1372
+
+for.end1372: ; preds = %for.inc1370
+ store i8 0, i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1
+ %22 = load i8** bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i8**), align 4
+ %23 = getelementptr inbounds %union.U1* %agg.result, i32 0, i32 0
+ store i8* %22, i8** %23, align 4
+ br label %cleanup1381
+
+cleanup1381: ; preds = %for.end1372, %cleanup1367
+ ret void
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL24safe_add_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 {
+entry:
+ %conv3 = zext i8 %si1 to i32
+ %conv14 = zext i8 %si2 to i32
+ %add = add nsw i32 %conv14, %conv3
+ %conv2 = trunc i32 %add to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL24safe_mul_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 {
+entry:
+ %conv = sext i8 %si1 to i32
+ %conv1 = sext i8 %si2 to i32
+ %mul = mul nsw i32 %conv1, %conv
+ %conv2 = trunc i32 %mul to i8
+ ret i8 %conv2
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i16 @_ZL28safe_rshift_func_int16_t_s_ssi(i16 signext %left) #3 {
+entry:
+ %conv = sext i16 %left to i32
+ %left.lobit = lshr i16 %left, 15
+ %0 = zext i16 %left.lobit to i32
+ %.not = xor i32 %0, 1
+ %cond = ashr i32 %conv, %.not
+ %conv6 = trunc i32 %cond to i16
+ ret i16 %conv6
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc signext i8 @_ZL30safe_unary_minus_func_int8_t_sa(i8 signext %si) #3 {
+entry:
+ %conv2 = zext i8 %si to i32
+ %sub = sub nsw i32 0, %conv2
+ %conv1 = trunc i32 %sub to i8
+ ret i8 %conv1
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL31safe_unary_minus_func_int32_t_si(i32 %si) #3 {
+entry:
+ %sub = sub nsw i32 0, %si
+ ret i32 %sub
+}
+
+; Function Attrs: nounwind readnone
+define internal fastcc i32 @_ZL26safe_add_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 {
+entry:
+ %add = add i32 %ui2, %ui1
+ ret i32 %add
+}
+
+; Function Attrs: nounwind
+define weak i8* @malloc(i32 %bytes) #0 {
+entry:
+ %cmp = icmp ult i32 %bytes, 245
+ br i1 %cmp, label %if.then, label %if.else137
+
+if.then: ; preds = %entry
+ %cmp1 = icmp ult i32 %bytes, 11
+ br i1 %cmp1, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.then
+ %add2 = add i32 %bytes, 11
+ %and = and i32 %add2, -8
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.then
+ %cond = phi i32 [ %and, %cond.false ], [ 16, %if.then ]
+ %shr = lshr exact i32 %cond, 3
+ %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shr3 = lshr i32 %0, %shr
+ %and4 = and i32 %shr3, 3
+ %cmp5 = icmp eq i32 %and4, 0
+ br i1 %cmp5, label %if.else28, label %if.then6
+
+if.then6: ; preds = %cond.end
+ %neg = and i32 %shr3, 1
+ %and7 = xor i32 %neg, 1
+ %add8 = add i32 %and7, %shr
+ %shl = shl nsw i32 %add8, 1
+ %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl
+ %1 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk*
+ %arrayidx.sum = add i32 %shl, 2
+ %2 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum
+ %3 = load %struct.malloc_chunk** %2, align 4, !tbaa !0
+ %fd9 = getelementptr inbounds %struct.malloc_chunk* %3, i32 0, i32 2
+ %4 = load %struct.malloc_chunk** %fd9, align 4, !tbaa !0
+ %cmp10 = icmp eq %struct.malloc_chunk* %1, %4
+ br i1 %cmp10, label %if.then11, label %if.else
+
+if.then11: ; preds = %if.then6
+ %shl12 = shl i32 1, %add8
+ %neg13 = xor i32 %shl12, -1
+ %and14 = and i32 %0, %neg13
+ store i32 %and14, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end21
+
+if.else: ; preds = %if.then6
+ %5 = bitcast %struct.malloc_chunk* %4 to i8*
+ %6 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp15 = icmp ult i8* %5, %6
+ br i1 %cmp15, label %if.else20, label %land.rhs
+
+land.rhs: ; preds = %if.else
+ %bk = getelementptr inbounds %struct.malloc_chunk* %4, i32 0, i32 3
+ %7 = load %struct.malloc_chunk** %bk, align 4, !tbaa !0
+ %cmp16 = icmp eq %struct.malloc_chunk* %7, %3
+ br i1 %cmp16, label %if.then17, label %if.else20, !prof !5
+
+if.then17: ; preds = %land.rhs
+ store %struct.malloc_chunk* %1, %struct.malloc_chunk** %bk, align 4, !tbaa !0
+ store %struct.malloc_chunk* %4, %struct.malloc_chunk** %2, align 4, !tbaa !0
+ br label %if.end21
+
+if.else20: ; preds = %land.rhs, %if.else
+ tail call void @abort() #6
+ unreachable
+
+if.end21: ; preds = %if.then17, %if.then11
+ %shl22 = shl i32 %add8, 3
+ %or23 = or i32 %shl22, 3
+ %head = getelementptr inbounds %struct.malloc_chunk* %3, i32 0, i32 1
+ store i32 %or23, i32* %head, align 4, !tbaa !3
+ %8 = bitcast %struct.malloc_chunk* %3 to i8*
+ %add.ptr.sum104 = or i32 %shl22, 4
+ %head25 = getelementptr inbounds i8* %8, i32 %add.ptr.sum104
+ %9 = bitcast i8* %head25 to i32*
+ %10 = load i32* %9, align 4, !tbaa !3
+ %or26 = or i32 %10, 1
+ store i32 %or26, i32* %9, align 4, !tbaa !3
+ %11 = bitcast %struct.malloc_chunk** %fd9 to i8*
+ br label %postaction
+
+if.else28: ; preds = %cond.end
+ %12 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %cmp29 = icmp ugt i32 %cond, %12
+ br i1 %cmp29, label %if.then30, label %if.end154
+
+if.then30: ; preds = %if.else28
+ %cmp31 = icmp eq i32 %shr3, 0
+ br i1 %cmp31, label %if.else127, label %if.then32
+
+if.then32: ; preds = %if.then30
+ %shl35 = shl i32 %shr3, %shr
+ %shl37 = shl i32 2, %shr
+ %sub = sub i32 0, %shl37
+ %or40 = or i32 %shl37, %sub
+ %and41 = and i32 %shl35, %or40
+ %sub42 = sub i32 0, %and41
+ %and43 = and i32 %and41, %sub42
+ %sub44 = add i32 %and43, -1
+ %shr45 = lshr i32 %sub44, 12
+ %and46 = and i32 %shr45, 16
+ %shr47 = lshr i32 %sub44, %and46
+ %shr48 = lshr i32 %shr47, 5
+ %and49 = and i32 %shr48, 8
+ %add50 = or i32 %and49, %and46
+ %shr51 = lshr i32 %shr47, %and49
+ %shr52 = lshr i32 %shr51, 2
+ %and53 = and i32 %shr52, 4
+ %add54 = or i32 %add50, %and53
+ %shr55 = lshr i32 %shr51, %and53
+ %shr56 = lshr i32 %shr55, 1
+ %and57 = and i32 %shr56, 2
+ %add58 = or i32 %add54, %and57
+ %shr59 = lshr i32 %shr55, %and57
+ %shr60 = lshr i32 %shr59, 1
+ %and61 = and i32 %shr60, 1
+ %add62 = or i32 %add58, %and61
+ %shr63 = lshr i32 %shr59, %and61
+ %add64 = add i32 %add62, %shr63
+ %shl65 = shl i32 %add64, 1
+ %arrayidx66 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl65
+ %13 = bitcast %struct.malloc_chunk** %arrayidx66 to %struct.malloc_chunk*
+ %arrayidx66.sum = add i32 %shl65, 2
+ %14 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx66.sum
+ %15 = load %struct.malloc_chunk** %14, align 4, !tbaa !0
+ %fd69 = getelementptr inbounds %struct.malloc_chunk* %15, i32 0, i32 2
+ %16 = load %struct.malloc_chunk** %fd69, align 4, !tbaa !0
+ %cmp70 = icmp eq %struct.malloc_chunk* %13, %16
+ br i1 %cmp70, label %if.then71, label %if.else75
+
+if.then71: ; preds = %if.then32
+ %shl72 = shl i32 1, %add64
+ %neg73 = xor i32 %shl72, -1
+ %and74 = and i32 %0, %neg73
+ store i32 %and74, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end89
+
+if.else75: ; preds = %if.then32
+ %17 = bitcast %struct.malloc_chunk* %16 to i8*
+ %18 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp76 = icmp ult i8* %17, %18
+ br i1 %cmp76, label %if.else87, label %land.rhs77
+
+land.rhs77: ; preds = %if.else75
+ %bk78 = getelementptr inbounds %struct.malloc_chunk* %16, i32 0, i32 3
+ %19 = load %struct.malloc_chunk** %bk78, align 4, !tbaa !0
+ %cmp79 = icmp eq %struct.malloc_chunk* %19, %15
+ br i1 %cmp79, label %if.then84, label %if.else87, !prof !5
+
+if.then84: ; preds = %land.rhs77
+ store %struct.malloc_chunk* %13, %struct.malloc_chunk** %bk78, align 4, !tbaa !0
+ store %struct.malloc_chunk* %16, %struct.malloc_chunk** %14, align 4, !tbaa !0
+ br label %if.end89
+
+if.else87: ; preds = %land.rhs77, %if.else75
+ tail call void @abort() #6
+ unreachable
+
+if.end89: ; preds = %if.then84, %if.then71
+ %shl90 = shl i32 %add64, 3
+ %sub91 = sub i32 %shl90, %cond
+ %or93 = or i32 %cond, 3
+ %head94 = getelementptr inbounds %struct.malloc_chunk* %15, i32 0, i32 1
+ store i32 %or93, i32* %head94, align 4, !tbaa !3
+ %20 = bitcast %struct.malloc_chunk* %15 to i8*
+ %add.ptr95 = getelementptr inbounds i8* %20, i32 %cond
+ %21 = bitcast i8* %add.ptr95 to %struct.malloc_chunk*
+ %or96 = or i32 %sub91, 1
+ %add.ptr95.sum102 = or i32 %cond, 4
+ %head97 = getelementptr inbounds i8* %20, i32 %add.ptr95.sum102
+ %22 = bitcast i8* %head97 to i32*
+ store i32 %or96, i32* %22, align 4, !tbaa !3
+ %add.ptr98 = getelementptr inbounds i8* %20, i32 %shl90
+ %prev_foot = bitcast i8* %add.ptr98 to i32*
+ store i32 %sub91, i32* %prev_foot, align 4, !tbaa !3
+ %23 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %cmp99 = icmp eq i32 %23, 0
+ br i1 %cmp99, label %if.end125, label %if.then100
+
+if.then100: ; preds = %if.end89
+ %24 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %shr101 = lshr i32 %23, 3
+ %shl102 = shl nuw nsw i32 %shr101, 1
+ %arrayidx103 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl102
+ %25 = bitcast %struct.malloc_chunk** %arrayidx103 to %struct.malloc_chunk*
+ %26 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl105 = shl i32 1, %shr101
+ %and106 = and i32 %26, %shl105
+ %tobool107 = icmp eq i32 %and106, 0
+ br i1 %tobool107, label %if.then108, label %if.else111
+
+if.then108: ; preds = %if.then100
+ %or110 = or i32 %26, %shl105
+ store i32 %or110, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx103.sum.pre = add i32 %shl102, 2
+ %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx103.sum.pre
+ br label %if.end120
+
+if.else111: ; preds = %if.then100
+ %arrayidx103.sum103 = add i32 %shl102, 2
+ %27 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx103.sum103
+ %28 = load %struct.malloc_chunk** %27, align 4, !tbaa !0
+ %29 = bitcast %struct.malloc_chunk* %28 to i8*
+ %30 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp113 = icmp ult i8* %29, %30
+ br i1 %cmp113, label %if.else118, label %if.end120, !prof !6
+
+if.else118: ; preds = %if.else111
+ tail call void @abort() #6
+ unreachable
+
+if.end120: ; preds = %if.else111, %if.then108
+ %.pre-phi = phi %struct.malloc_chunk** [ %27, %if.else111 ], [ %.pre, %if.then108 ]
+ %F104.0 = phi %struct.malloc_chunk* [ %28, %if.else111 ], [ %25, %if.then108 ]
+ store %struct.malloc_chunk* %24, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0
+ %bk122 = getelementptr inbounds %struct.malloc_chunk* %F104.0, i32 0, i32 3
+ store %struct.malloc_chunk* %24, %struct.malloc_chunk** %bk122, align 4, !tbaa !0
+ %fd123 = getelementptr inbounds %struct.malloc_chunk* %24, i32 0, i32 2
+ store %struct.malloc_chunk* %F104.0, %struct.malloc_chunk** %fd123, align 4, !tbaa !0
+ %bk124 = getelementptr inbounds %struct.malloc_chunk* %24, i32 0, i32 3
+ store %struct.malloc_chunk* %25, %struct.malloc_chunk** %bk124, align 4, !tbaa !0
+ br label %if.end125
+
+if.end125: ; preds = %if.end120, %if.end89
+ store i32 %sub91, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %21, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %31 = bitcast %struct.malloc_chunk** %fd69 to i8*
+ br label %postaction
+
+if.else127: ; preds = %if.then30
+ %32 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %cmp128 = icmp eq i32 %32, 0
+ br i1 %cmp128, label %if.end154, label %land.lhs.true
+
+land.lhs.true: ; preds = %if.else127
+ %sub.i = sub i32 0, %32
+ %and.i = and i32 %32, %sub.i
+ %sub2.i = add i32 %and.i, -1
+ %shr.i = lshr i32 %sub2.i, 12
+ %and3.i = and i32 %shr.i, 16
+ %shr4.i = lshr i32 %sub2.i, %and3.i
+ %shr5.i = lshr i32 %shr4.i, 5
+ %and6.i = and i32 %shr5.i, 8
+ %add.i = or i32 %and6.i, %and3.i
+ %shr7.i = lshr i32 %shr4.i, %and6.i
+ %shr8.i = lshr i32 %shr7.i, 2
+ %and9.i = and i32 %shr8.i, 4
+ %add10.i = or i32 %add.i, %and9.i
+ %shr11.i = lshr i32 %shr7.i, %and9.i
+ %shr12.i = lshr i32 %shr11.i, 1
+ %and13.i = and i32 %shr12.i, 2
+ %add14.i = or i32 %add10.i, %and13.i
+ %shr15.i = lshr i32 %shr11.i, %and13.i
+ %shr16.i = lshr i32 %shr15.i, 1
+ %and17.i = and i32 %shr16.i, 1
+ %add18.i = or i32 %add14.i, %and17.i
+ %shr19.i = lshr i32 %shr15.i, %and17.i
+ %add20.i = add i32 %add18.i, %shr19.i
+ %arrayidx.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %add20.i
+ %33 = load %struct.malloc_tree_chunk** %arrayidx.i, align 4, !tbaa !0
+ %head.i = getelementptr inbounds %struct.malloc_tree_chunk* %33, i32 0, i32 1
+ %34 = load i32* %head.i, align 4, !tbaa !3
+ %and21.i = and i32 %34, -8
+ %sub22.i = sub i32 %and21.i, %cond
+ br label %while.cond.i
+
+while.cond.i: ; preds = %while.body.i, %land.lhs.true
+ %rsize.0.i = phi i32 [ %sub22.i, %land.lhs.true ], [ %sub31.rsize.0.i, %while.body.i ]
+ %v.0.i = phi %struct.malloc_tree_chunk* [ %33, %land.lhs.true ], [ %cond.v.0.i, %while.body.i ]
+ %t.0.i = phi %struct.malloc_tree_chunk* [ %33, %land.lhs.true ], [ %cond6.i, %while.body.i ]
+ %arrayidx23.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 0
+ %35 = load %struct.malloc_tree_chunk** %arrayidx23.i, align 4, !tbaa !0
+ %cmp.i = icmp eq %struct.malloc_tree_chunk* %35, null
+ br i1 %cmp.i, label %cond.end.i, label %while.body.i
+
+cond.end.i: ; preds = %while.cond.i
+ %arrayidx27.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 1
+ %36 = load %struct.malloc_tree_chunk** %arrayidx27.i, align 4, !tbaa !0
+ %cmp28.i = icmp eq %struct.malloc_tree_chunk* %36, null
+ br i1 %cmp28.i, label %while.end.i, label %while.body.i
+
+while.body.i: ; preds = %cond.end.i, %while.cond.i
+ %cond6.i = phi %struct.malloc_tree_chunk* [ %36, %cond.end.i ], [ %35, %while.cond.i ]
+ %head29.i = getelementptr inbounds %struct.malloc_tree_chunk* %cond6.i, i32 0, i32 1
+ %37 = load i32* %head29.i, align 4, !tbaa !3
+ %and30.i = and i32 %37, -8
+ %sub31.i = sub i32 %and30.i, %cond
+ %cmp32.i = icmp ult i32 %sub31.i, %rsize.0.i
+ %sub31.rsize.0.i = select i1 %cmp32.i, i32 %sub31.i, i32 %rsize.0.i
+ %cond.v.0.i = select i1 %cmp32.i, %struct.malloc_tree_chunk* %cond6.i, %struct.malloc_tree_chunk* %v.0.i
+ br label %while.cond.i
+
+while.end.i: ; preds = %cond.end.i
+ %38 = bitcast %struct.malloc_tree_chunk* %v.0.i to i8*
+ %39 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp33.i = icmp ult i8* %38, %39
+ br i1 %cmp33.i, label %if.end227.i, label %if.then34.i, !prof !6
+
+if.then34.i: ; preds = %while.end.i
+ %add.ptr.i = getelementptr inbounds i8* %38, i32 %cond
+ %40 = bitcast i8* %add.ptr.i to %struct.malloc_chunk*
+ %cmp35.i = icmp ult i8* %38, %add.ptr.i
+ br i1 %cmp35.i, label %if.then39.i, label %if.end227.i, !prof !5
+
+if.then39.i: ; preds = %if.then34.i
+ %parent.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 5
+ %41 = load %struct.malloc_tree_chunk** %parent.i, align 4, !tbaa !0
+ %bk.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 3
+ %42 = load %struct.malloc_tree_chunk** %bk.i, align 4, !tbaa !0
+ %cmp40.i = icmp eq %struct.malloc_tree_chunk* %42, %v.0.i
+ br i1 %cmp40.i, label %if.else59.i, label %if.then42.i
+
+if.then42.i: ; preds = %if.then39.i
+ %fd.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2
+ %43 = load %struct.malloc_tree_chunk** %fd.i, align 4, !tbaa !0
+ %44 = bitcast %struct.malloc_tree_chunk* %43 to i8*
+ %cmp45.i = icmp ult i8* %44, %39
+ br i1 %cmp45.i, label %if.else.i, label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %if.then42.i
+ %bk47.i = getelementptr inbounds %struct.malloc_tree_chunk* %43, i32 0, i32 3
+ %45 = load %struct.malloc_tree_chunk** %bk47.i, align 4, !tbaa !0
+ %cmp48.i = icmp eq %struct.malloc_tree_chunk* %45, %v.0.i
+ br i1 %cmp48.i, label %land.rhs.i, label %if.else.i
+
+land.rhs.i: ; preds = %land.lhs.true.i
+ %fd50.i = getelementptr inbounds %struct.malloc_tree_chunk* %42, i32 0, i32 2
+ %46 = load %struct.malloc_tree_chunk** %fd50.i, align 4, !tbaa !0
+ %cmp51.i = icmp eq %struct.malloc_tree_chunk* %46, %v.0.i
+ br i1 %cmp51.i, label %if.then55.i, label %if.else.i, !prof !5
+
+if.then55.i: ; preds = %land.rhs.i
+ store %struct.malloc_tree_chunk* %42, %struct.malloc_tree_chunk** %bk47.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %43, %struct.malloc_tree_chunk** %fd50.i, align 4, !tbaa !0
+ br label %if.end89.i
+
+if.else.i: ; preds = %land.rhs.i, %land.lhs.true.i, %if.then42.i
+ tail call void @abort() #6
+ unreachable
+
+if.else59.i: ; preds = %if.then39.i
+ %arrayidx61.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1
+ %47 = load %struct.malloc_tree_chunk** %arrayidx61.i, align 4, !tbaa !0
+ %cmp62.i = icmp eq %struct.malloc_tree_chunk* %47, null
+ br i1 %cmp62.i, label %lor.lhs.false.i, label %while.cond69.i
+
+lor.lhs.false.i: ; preds = %if.else59.i
+ %arrayidx65.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0
+ %48 = load %struct.malloc_tree_chunk** %arrayidx65.i, align 4, !tbaa !0
+ %cmp66.i = icmp eq %struct.malloc_tree_chunk* %48, null
+ br i1 %cmp66.i, label %if.end89.i, label %while.cond69.i
+
+while.cond69.i: ; preds = %lor.rhs.i, %while.cond69.i, %lor.lhs.false.i, %if.else59.i
+ %RP.0.i = phi %struct.malloc_tree_chunk** [ %arrayidx65.i, %lor.lhs.false.i ], [ %arrayidx61.i, %if.else59.i ], [ %arrayidx71.i, %while.cond69.i ], [ %arrayidx75.i, %lor.rhs.i ]
+ %R.0.i = phi %struct.malloc_tree_chunk* [ %48, %lor.lhs.false.i ], [ %47, %if.else59.i ], [ %49, %while.cond69.i ], [ %50, %lor.rhs.i ]
+ %arrayidx71.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 1
+ %49 = load %struct.malloc_tree_chunk** %arrayidx71.i, align 4, !tbaa !0
+ %cmp72.i = icmp eq %struct.malloc_tree_chunk* %49, null
+ br i1 %cmp72.i, label %lor.rhs.i, label %while.cond69.i
+
+lor.rhs.i: ; preds = %while.cond69.i
+ %arrayidx75.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 0
+ %50 = load %struct.malloc_tree_chunk** %arrayidx75.i, align 4, !tbaa !0
+ %cmp76.i = icmp eq %struct.malloc_tree_chunk* %50, null
+ br i1 %cmp76.i, label %while.end79.i, label %while.cond69.i
+
+while.end79.i: ; preds = %lor.rhs.i
+ %51 = bitcast %struct.malloc_tree_chunk** %RP.0.i to i8*
+ %cmp81.i = icmp ult i8* %51, %39
+ br i1 %cmp81.i, label %if.else86.i, label %if.then85.i, !prof !6
+
+if.then85.i: ; preds = %while.end79.i
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i, align 4, !tbaa !0
+ br label %if.end89.i
+
+if.else86.i: ; preds = %while.end79.i
+ tail call void @abort() #6
+ unreachable
+
+if.end89.i: ; preds = %if.then85.i, %lor.lhs.false.i, %if.then55.i
+ %R.1.i = phi %struct.malloc_tree_chunk* [ %42, %if.then55.i ], [ %R.0.i, %if.then85.i ], [ null, %lor.lhs.false.i ]
+ %cmp90.i = icmp eq %struct.malloc_tree_chunk* %41, null
+ br i1 %cmp90.i, label %if.end173.i, label %if.then92.i
+
+if.then92.i: ; preds = %if.end89.i
+ %index.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 6
+ %52 = load i32* %index.i, align 4, !tbaa !3
+ %arrayidx94.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %52
+ %53 = load %struct.malloc_tree_chunk** %arrayidx94.i, align 4, !tbaa !0
+ %cmp95.i = icmp eq %struct.malloc_tree_chunk* %v.0.i, %53
+ br i1 %cmp95.i, label %if.then97.i, label %if.else105.i
+
+if.then97.i: ; preds = %if.then92.i
+ store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx94.i, align 4, !tbaa !0
+ %cond4.i = icmp eq %struct.malloc_tree_chunk* %R.1.i, null
+ br i1 %cond4.i, label %if.end125.thread.i, label %if.then128.i
+
+if.end125.thread.i: ; preds = %if.then97.i
+ %shl.i = shl i32 1, %52
+ %neg.i = xor i32 %shl.i, -1
+ %54 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and103.i = and i32 %54, %neg.i
+ store i32 %and103.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end173.i
+
+if.else105.i: ; preds = %if.then92.i
+ %55 = bitcast %struct.malloc_tree_chunk* %41 to i8*
+ %56 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp107.i = icmp ult i8* %55, %56
+ br i1 %cmp107.i, label %if.else123.i, label %if.then111.i, !prof !6
+
+if.then111.i: ; preds = %if.else105.i
+ %arrayidx113.i = getelementptr inbounds %struct.malloc_tree_chunk* %41, i32 0, i32 4, i32 0
+ %57 = load %struct.malloc_tree_chunk** %arrayidx113.i, align 4, !tbaa !0
+ %cmp114.i = icmp eq %struct.malloc_tree_chunk* %57, %v.0.i
+ br i1 %cmp114.i, label %if.then116.i, label %if.else119.i
+
+if.then116.i: ; preds = %if.then111.i
+ store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx113.i, align 4, !tbaa !0
+ br label %if.end125.i
+
+if.else119.i: ; preds = %if.then111.i
+ %arrayidx121.i = getelementptr inbounds %struct.malloc_tree_chunk* %41, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx121.i, align 4, !tbaa !0
+ br label %if.end125.i
+
+if.else123.i: ; preds = %if.else105.i
+ tail call void @abort() #6
+ unreachable
+
+if.end125.i: ; preds = %if.else119.i, %if.then116.i
+ %cmp126.i = icmp eq %struct.malloc_tree_chunk* %R.1.i, null
+ br i1 %cmp126.i, label %if.end173.i, label %if.then128.i
+
+if.then128.i: ; preds = %if.end125.i, %if.then97.i
+ %58 = bitcast %struct.malloc_tree_chunk* %R.1.i to i8*
+ %59 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp130.i = icmp ult i8* %58, %59
+ br i1 %cmp130.i, label %if.else170.i, label %if.then134.i, !prof !6
+
+if.then134.i: ; preds = %if.then128.i
+ %parent135.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %41, %struct.malloc_tree_chunk** %parent135.i, align 4, !tbaa !0
+ %arrayidx137.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0
+ %60 = load %struct.malloc_tree_chunk** %arrayidx137.i, align 4, !tbaa !0
+ %cmp138.i = icmp eq %struct.malloc_tree_chunk* %60, null
+ br i1 %cmp138.i, label %if.end152.i, label %if.then140.i
+
+if.then140.i: ; preds = %if.then134.i
+ %61 = bitcast %struct.malloc_tree_chunk* %60 to i8*
+ %62 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp142.i = icmp ult i8* %61, %62
+ br i1 %cmp142.i, label %if.else150.i, label %if.then146.i, !prof !6
+
+if.then146.i: ; preds = %if.then140.i
+ %arrayidx148.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %60, %struct.malloc_tree_chunk** %arrayidx148.i, align 4, !tbaa !0
+ %parent149.i = getelementptr inbounds %struct.malloc_tree_chunk* %60, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %parent149.i, align 4, !tbaa !0
+ br label %if.end152.i
+
+if.else150.i: ; preds = %if.then140.i
+ tail call void @abort() #6
+ unreachable
+
+if.end152.i: ; preds = %if.then146.i, %if.then134.i
+ %arrayidx154.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1
+ %63 = load %struct.malloc_tree_chunk** %arrayidx154.i, align 4, !tbaa !0
+ %cmp155.i = icmp eq %struct.malloc_tree_chunk* %63, null
+ br i1 %cmp155.i, label %if.end173.i, label %if.then157.i
+
+if.then157.i: ; preds = %if.end152.i
+ %64 = bitcast %struct.malloc_tree_chunk* %63 to i8*
+ %65 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp159.i = icmp ult i8* %64, %65
+ br i1 %cmp159.i, label %if.else167.i, label %if.then163.i, !prof !6
+
+if.then163.i: ; preds = %if.then157.i
+ %arrayidx165.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %63, %struct.malloc_tree_chunk** %arrayidx165.i, align 4, !tbaa !0
+ %parent166.i = getelementptr inbounds %struct.malloc_tree_chunk* %63, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %parent166.i, align 4, !tbaa !0
+ br label %if.end173.i
+
+if.else167.i: ; preds = %if.then157.i
+ tail call void @abort() #6
+ unreachable
+
+if.else170.i: ; preds = %if.then128.i
+ tail call void @abort() #6
+ unreachable
+
+if.end173.i: ; preds = %if.then163.i, %if.end152.i, %if.end125.i, %if.end125.thread.i, %if.end89.i
+ %cmp174.i = icmp ult i32 %rsize.0.i, 16
+ br i1 %cmp174.i, label %if.then176.i, label %if.else184.i
+
+if.then176.i: ; preds = %if.end173.i
+ %add177.i = add i32 %rsize.0.i, %cond
+ %or178.i = or i32 %add177.i, 3
+ %head179.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1
+ store i32 %or178.i, i32* %head179.i, align 4, !tbaa !3
+ %add.ptr181.sum.i = add i32 %add177.i, 4
+ %head182.i = getelementptr inbounds i8* %38, i32 %add.ptr181.sum.i
+ %66 = bitcast i8* %head182.i to i32*
+ %67 = load i32* %66, align 4, !tbaa !3
+ %or183.i = or i32 %67, 1
+ store i32 %or183.i, i32* %66, align 4, !tbaa !3
+ br label %tmalloc_small.exit
+
+if.else184.i: ; preds = %if.end173.i
+ %or186.i = or i32 %cond, 3
+ %head187.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1
+ store i32 %or186.i, i32* %head187.i, align 4, !tbaa !3
+ %or188.i = or i32 %rsize.0.i, 1
+ %add.ptr.sum.i173 = or i32 %cond, 4
+ %head189.i = getelementptr inbounds i8* %38, i32 %add.ptr.sum.i173
+ %68 = bitcast i8* %head189.i to i32*
+ store i32 %or188.i, i32* %68, align 4, !tbaa !3
+ %add.ptr.sum1.i = add i32 %rsize.0.i, %cond
+ %add.ptr190.i = getelementptr inbounds i8* %38, i32 %add.ptr.sum1.i
+ %prev_foot.i = bitcast i8* %add.ptr190.i to i32*
+ store i32 %rsize.0.i, i32* %prev_foot.i, align 4, !tbaa !3
+ %69 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %cmp191.i = icmp eq i32 %69, 0
+ br i1 %cmp191.i, label %if.end221.i, label %if.then193.i
+
+if.then193.i: ; preds = %if.else184.i
+ %70 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %shr194.i = lshr i32 %69, 3
+ %shl195.i = shl nuw nsw i32 %shr194.i, 1
+ %arrayidx196.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl195.i
+ %71 = bitcast %struct.malloc_chunk** %arrayidx196.i to %struct.malloc_chunk*
+ %72 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl198.i = shl i32 1, %shr194.i
+ %and199.i = and i32 %72, %shl198.i
+ %tobool200.i = icmp eq i32 %and199.i, 0
+ br i1 %tobool200.i, label %if.then201.i, label %if.else205.i
+
+if.then201.i: ; preds = %if.then193.i
+ %or204.i = or i32 %72, %shl198.i
+ store i32 %or204.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx196.sum.pre.i = add i32 %shl195.i, 2
+ %.pre.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx196.sum.pre.i
+ br label %if.end216.i
+
+if.else205.i: ; preds = %if.then193.i
+ %arrayidx196.sum2.i = add i32 %shl195.i, 2
+ %73 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx196.sum2.i
+ %74 = load %struct.malloc_chunk** %73, align 4, !tbaa !0
+ %75 = bitcast %struct.malloc_chunk* %74 to i8*
+ %76 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp208.i = icmp ult i8* %75, %76
+ br i1 %cmp208.i, label %if.else214.i, label %if.end216.i, !prof !6
+
+if.else214.i: ; preds = %if.else205.i
+ tail call void @abort() #6
+ unreachable
+
+if.end216.i: ; preds = %if.else205.i, %if.then201.i
+ %.pre-phi.i = phi %struct.malloc_chunk** [ %73, %if.else205.i ], [ %.pre.i, %if.then201.i ]
+ %F197.0.i = phi %struct.malloc_chunk* [ %74, %if.else205.i ], [ %71, %if.then201.i ]
+ store %struct.malloc_chunk* %70, %struct.malloc_chunk** %.pre-phi.i, align 4, !tbaa !0
+ %bk218.i = getelementptr inbounds %struct.malloc_chunk* %F197.0.i, i32 0, i32 3
+ store %struct.malloc_chunk* %70, %struct.malloc_chunk** %bk218.i, align 4, !tbaa !0
+ %fd219.i = getelementptr inbounds %struct.malloc_chunk* %70, i32 0, i32 2
+ store %struct.malloc_chunk* %F197.0.i, %struct.malloc_chunk** %fd219.i, align 4, !tbaa !0
+ %bk220.i = getelementptr inbounds %struct.malloc_chunk* %70, i32 0, i32 3
+ store %struct.malloc_chunk* %71, %struct.malloc_chunk** %bk220.i, align 4, !tbaa !0
+ br label %if.end221.i
+
+if.end221.i: ; preds = %if.end216.i, %if.else184.i
+ store i32 %rsize.0.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %40, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ br label %tmalloc_small.exit
+
+if.end227.i: ; preds = %if.then34.i, %while.end.i
+ tail call void @abort() #6
+ unreachable
+
+tmalloc_small.exit: ; preds = %if.end221.i, %if.then176.i
+ %add.ptr225.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2
+ %77 = bitcast %struct.malloc_tree_chunk** %add.ptr225.i to i8*
+ br label %postaction
+
+if.else137: ; preds = %entry
+ %cmp138 = icmp ugt i32 %bytes, -65
+ br i1 %cmp138, label %if.end154, label %if.else141
+
+if.else141: ; preds = %if.else137
+ %add143 = add i32 %bytes, 11
+ %and144 = and i32 %add143, -8
+ %78 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %cmp145 = icmp eq i32 %78, 0
+ br i1 %cmp145, label %if.end154, label %land.lhs.true147
+
+land.lhs.true147: ; preds = %if.else141
+ %sub.i105 = sub i32 0, %and144
+ %shr.i106 = lshr i32 %add143, 8
+ %cmp.i107 = icmp eq i32 %shr.i106, 0
+ br i1 %cmp.i107, label %if.end23.i, label %if.else.i108
+
+if.else.i108: ; preds = %land.lhs.true147
+ %cmp1.i = icmp ugt i32 %and144, 16777215
+ br i1 %cmp1.i, label %if.end23.i, label %if.else3.i
+
+if.else3.i: ; preds = %if.else.i108
+ %sub4.i = add i32 %shr.i106, 1048320
+ %shr5.i109 = lshr i32 %sub4.i, 16
+ %and.i110 = and i32 %shr5.i109, 8
+ %shl.i111 = shl i32 %shr.i106, %and.i110
+ %sub6.i = add i32 %shl.i111, 520192
+ %shr7.i112 = lshr i32 %sub6.i, 16
+ %and8.i = and i32 %shr7.i112, 4
+ %add.i113 = or i32 %and8.i, %and.i110
+ %shl9.i = shl i32 %shl.i111, %and8.i
+ %sub10.i = add i32 %shl9.i, 245760
+ %shr11.i114 = lshr i32 %sub10.i, 16
+ %and12.i = and i32 %shr11.i114, 2
+ %add13.i = or i32 %add.i113, %and12.i
+ %sub14.i = sub i32 14, %add13.i
+ %shl15.i = shl i32 %shl9.i, %and12.i
+ %shr16.i115 = lshr i32 %shl15.i, 15
+ %add17.i = add i32 %sub14.i, %shr16.i115
+ %shl18.i = shl nsw i32 %add17.i, 1
+ %add19.i = add i32 %add17.i, 7
+ %shr20.i = lshr i32 %and144, %add19.i
+ %and21.i116 = and i32 %shr20.i, 1
+ %add22.i = or i32 %and21.i116, %shl18.i
+ br label %if.end23.i
+
+if.end23.i: ; preds = %if.else3.i, %if.else.i108, %land.lhs.true147
+ %idx.0.i = phi i32 [ %add22.i, %if.else3.i ], [ 0, %land.lhs.true147 ], [ 31, %if.else.i108 ]
+ %arrayidx.i117 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %idx.0.i
+ %79 = load %struct.malloc_tree_chunk** %arrayidx.i117, align 4, !tbaa !0
+ %cmp24.i = icmp eq %struct.malloc_tree_chunk* %79, null
+ br i1 %cmp24.i, label %if.end53.i, label %if.then25.i
+
+if.then25.i: ; preds = %if.end23.i
+ %cmp26.i = icmp eq i32 %idx.0.i, 31
+ br i1 %cmp26.i, label %cond.end.i118, label %cond.false.i
+
+cond.false.i: ; preds = %if.then25.i
+ %shr27.i = lshr i32 %idx.0.i, 1
+ %sub30.i = sub i32 25, %shr27.i
+ br label %cond.end.i118
+
+cond.end.i118: ; preds = %cond.false.i, %if.then25.i
+ %cond.i = phi i32 [ %sub30.i, %cond.false.i ], [ 0, %if.then25.i ]
+ %shl31.i = shl i32 %and144, %cond.i
+ br label %for.cond.i
+
+for.cond.i: ; preds = %if.end39.i, %cond.end.i118
+ %rst.0.i = phi %struct.malloc_tree_chunk* [ null, %cond.end.i118 ], [ %rst.1.i, %if.end39.i ]
+ %sizebits.0.i = phi i32 [ %shl31.i, %cond.end.i118 ], [ %shl52.i, %if.end39.i ]
+ %t.0.i119 = phi %struct.malloc_tree_chunk* [ %79, %cond.end.i118 ], [ %82, %if.end39.i ]
+ %rsize.0.i120 = phi i32 [ %sub.i105, %cond.end.i118 ], [ %rsize.1.i, %if.end39.i ]
+ %v.0.i121 = phi %struct.malloc_tree_chunk* [ null, %cond.end.i118 ], [ %v.1.i, %if.end39.i ]
+ %head.i122 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 1
+ %80 = load i32* %head.i122, align 4, !tbaa !3
+ %and32.i = and i32 %80, -8
+ %sub33.i = sub i32 %and32.i, %and144
+ %cmp34.i = icmp ult i32 %sub33.i, %rsize.0.i120
+ br i1 %cmp34.i, label %if.then35.i, label %if.end39.i
+
+if.then35.i: ; preds = %for.cond.i
+ %cmp36.i = icmp eq i32 %and32.i, %and144
+ br i1 %cmp36.i, label %if.end53.i, label %if.end39.i
+
+if.end39.i: ; preds = %if.then35.i, %for.cond.i
+ %rsize.1.i = phi i32 [ %sub33.i, %if.then35.i ], [ %rsize.0.i120, %for.cond.i ]
+ %v.1.i = phi %struct.malloc_tree_chunk* [ %t.0.i119, %if.then35.i ], [ %v.0.i121, %for.cond.i ]
+ %arrayidx40.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 4, i32 1
+ %81 = load %struct.malloc_tree_chunk** %arrayidx40.i, align 4, !tbaa !0
+ %shr41.i = lshr i32 %sizebits.0.i, 31
+ %arrayidx44.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 4, i32 %shr41.i
+ %82 = load %struct.malloc_tree_chunk** %arrayidx44.i, align 4, !tbaa !0
+ %cmp45.i123 = icmp eq %struct.malloc_tree_chunk* %81, null
+ %cmp46.i = icmp eq %struct.malloc_tree_chunk* %81, %82
+ %or.cond.i = or i1 %cmp45.i123, %cmp46.i
+ %rst.1.i = select i1 %or.cond.i, %struct.malloc_tree_chunk* %rst.0.i, %struct.malloc_tree_chunk* %81
+ %cmp49.i = icmp eq %struct.malloc_tree_chunk* %82, null
+ %shl52.i = shl i32 %sizebits.0.i, 1
+ br i1 %cmp49.i, label %if.end53.i, label %for.cond.i
+
+if.end53.i: ; preds = %if.end39.i, %if.then35.i, %if.end23.i
+ %t.1.i = phi %struct.malloc_tree_chunk* [ null, %if.end23.i ], [ %rst.1.i, %if.end39.i ], [ %t.0.i119, %if.then35.i ]
+ %rsize.2.i = phi i32 [ %sub.i105, %if.end23.i ], [ %rsize.1.i, %if.end39.i ], [ %sub33.i, %if.then35.i ]
+ %v.2.i = phi %struct.malloc_tree_chunk* [ null, %if.end23.i ], [ %v.1.i, %if.end39.i ], [ %t.0.i119, %if.then35.i ]
+ %cmp54.i = icmp eq %struct.malloc_tree_chunk* %t.1.i, null
+ %cmp56.i = icmp eq %struct.malloc_tree_chunk* %v.2.i, null
+ %or.cond16.i = and i1 %cmp54.i, %cmp56.i
+ br i1 %or.cond16.i, label %if.then57.i, label %while.cond.preheader.i
+
+if.then57.i: ; preds = %if.end53.i
+ %shl59.i = shl i32 2, %idx.0.i
+ %sub62.i = sub i32 0, %shl59.i
+ %or.i = or i32 %shl59.i, %sub62.i
+ %and63.i = and i32 %78, %or.i
+ %cmp64.i = icmp eq i32 %and63.i, 0
+ br i1 %cmp64.i, label %if.end154, label %if.then65.i
+
+if.then65.i: ; preds = %if.then57.i
+ %sub66.i = sub i32 0, %and63.i
+ %and67.i = and i32 %and63.i, %sub66.i
+ %sub69.i = add i32 %and67.i, -1
+ %shr71.i = lshr i32 %sub69.i, 12
+ %and72.i = and i32 %shr71.i, 16
+ %shr74.i = lshr i32 %sub69.i, %and72.i
+ %shr75.i = lshr i32 %shr74.i, 5
+ %and76.i = and i32 %shr75.i, 8
+ %add77.i = or i32 %and76.i, %and72.i
+ %shr78.i = lshr i32 %shr74.i, %and76.i
+ %shr79.i = lshr i32 %shr78.i, 2
+ %and80.i = and i32 %shr79.i, 4
+ %add81.i = or i32 %add77.i, %and80.i
+ %shr82.i = lshr i32 %shr78.i, %and80.i
+ %shr83.i = lshr i32 %shr82.i, 1
+ %and84.i = and i32 %shr83.i, 2
+ %add85.i = or i32 %add81.i, %and84.i
+ %shr86.i = lshr i32 %shr82.i, %and84.i
+ %shr87.i = lshr i32 %shr86.i, 1
+ %and88.i = and i32 %shr87.i, 1
+ %add89.i = or i32 %add85.i, %and88.i
+ %shr90.i = lshr i32 %shr86.i, %and88.i
+ %add91.i = add i32 %add89.i, %shr90.i
+ %arrayidx93.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %add91.i
+ %83 = load %struct.malloc_tree_chunk** %arrayidx93.i, align 4, !tbaa !0
+ br label %while.cond.preheader.i
+
+while.cond.preheader.i: ; preds = %if.then65.i, %if.end53.i
+ %t.2.ph.i = phi %struct.malloc_tree_chunk* [ %t.1.i, %if.end53.i ], [ %83, %if.then65.i ]
+ %cmp9626.i = icmp eq %struct.malloc_tree_chunk* %t.2.ph.i, null
+ br i1 %cmp9626.i, label %while.end.i125, label %while.body.i124
+
+while.body.i124: ; preds = %while.cond.backedge.i, %while.body.i124, %while.cond.preheader.i
+ %v.329.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %while.cond.preheader.i ], [ %t.2.v.3.i, %while.body.i124 ], [ %t.2.v.3.i, %while.cond.backedge.i ]
+ %rsize.328.i = phi i32 [ %rsize.2.i, %while.cond.preheader.i ], [ %sub100.rsize.3.i, %while.body.i124 ], [ %sub100.rsize.3.i, %while.cond.backedge.i ]
+ %t.227.i = phi %struct.malloc_tree_chunk* [ %t.2.ph.i, %while.cond.preheader.i ], [ %85, %while.body.i124 ], [ %86, %while.cond.backedge.i ]
+ %head98.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 1
+ %84 = load i32* %head98.i, align 4, !tbaa !3
+ %and99.i = and i32 %84, -8
+ %sub100.i = sub i32 %and99.i, %and144
+ %cmp101.i = icmp ult i32 %sub100.i, %rsize.328.i
+ %sub100.rsize.3.i = select i1 %cmp101.i, i32 %sub100.i, i32 %rsize.328.i
+ %t.2.v.3.i = select i1 %cmp101.i, %struct.malloc_tree_chunk* %t.227.i, %struct.malloc_tree_chunk* %v.329.i
+ %arrayidx105.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 4, i32 0
+ %85 = load %struct.malloc_tree_chunk** %arrayidx105.i, align 4, !tbaa !0
+ %cmp106.i = icmp eq %struct.malloc_tree_chunk* %85, null
+ br i1 %cmp106.i, label %while.cond.backedge.i, label %while.body.i124
+
+while.cond.backedge.i: ; preds = %while.body.i124
+ %arrayidx112.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 4, i32 1
+ %86 = load %struct.malloc_tree_chunk** %arrayidx112.i, align 4, !tbaa !0
+ %cmp96.i = icmp eq %struct.malloc_tree_chunk* %86, null
+ br i1 %cmp96.i, label %while.end.i125, label %while.body.i124
+
+while.end.i125: ; preds = %while.cond.backedge.i, %while.cond.preheader.i
+ %v.3.lcssa.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %while.cond.preheader.i ], [ %t.2.v.3.i, %while.cond.backedge.i ]
+ %rsize.3.lcssa.i = phi i32 [ %rsize.2.i, %while.cond.preheader.i ], [ %sub100.rsize.3.i, %while.cond.backedge.i ]
+ %cmp115.i = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, null
+ br i1 %cmp115.i, label %if.end154, label %land.lhs.true116.i
+
+land.lhs.true116.i: ; preds = %while.end.i125
+ %87 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %sub117.i = sub i32 %87, %and144
+ %cmp118.i = icmp ult i32 %rsize.3.lcssa.i, %sub117.i
+ br i1 %cmp118.i, label %if.then119.i, label %if.end154
+
+if.then119.i: ; preds = %land.lhs.true116.i
+ %88 = bitcast %struct.malloc_tree_chunk* %v.3.lcssa.i to i8*
+ %89 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp120.i = icmp ult i8* %88, %89
+ br i1 %cmp120.i, label %if.end438.i, label %if.then121.i, !prof !6
+
+if.then121.i: ; preds = %if.then119.i
+ %add.ptr.i126 = getelementptr inbounds i8* %88, i32 %and144
+ %90 = bitcast i8* %add.ptr.i126 to %struct.malloc_chunk*
+ %cmp122.i = icmp ult i8* %88, %add.ptr.i126
+ br i1 %cmp122.i, label %if.then126.i, label %if.end438.i, !prof !5
+
+if.then126.i: ; preds = %if.then121.i
+ %parent.i127 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 5
+ %91 = load %struct.malloc_tree_chunk** %parent.i127, align 4, !tbaa !0
+ %bk.i128 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 3
+ %92 = load %struct.malloc_tree_chunk** %bk.i128, align 4, !tbaa !0
+ %cmp127.i = icmp eq %struct.malloc_tree_chunk* %92, %v.3.lcssa.i
+ br i1 %cmp127.i, label %if.else148.i, label %if.then129.i
+
+if.then129.i: ; preds = %if.then126.i
+ %fd.i129 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2
+ %93 = load %struct.malloc_tree_chunk** %fd.i129, align 4, !tbaa !0
+ %94 = bitcast %struct.malloc_tree_chunk* %93 to i8*
+ %cmp132.i = icmp ult i8* %94, %89
+ br i1 %cmp132.i, label %if.else146.i, label %land.lhs.true134.i
+
+land.lhs.true134.i: ; preds = %if.then129.i
+ %bk135.i = getelementptr inbounds %struct.malloc_tree_chunk* %93, i32 0, i32 3
+ %95 = load %struct.malloc_tree_chunk** %bk135.i, align 4, !tbaa !0
+ %cmp136.i = icmp eq %struct.malloc_tree_chunk* %95, %v.3.lcssa.i
+ br i1 %cmp136.i, label %land.rhs.i130, label %if.else146.i
+
+land.rhs.i130: ; preds = %land.lhs.true134.i
+ %fd138.i = getelementptr inbounds %struct.malloc_tree_chunk* %92, i32 0, i32 2
+ %96 = load %struct.malloc_tree_chunk** %fd138.i, align 4, !tbaa !0
+ %cmp139.i = icmp eq %struct.malloc_tree_chunk* %96, %v.3.lcssa.i
+ br i1 %cmp139.i, label %if.then143.i, label %if.else146.i, !prof !5
+
+if.then143.i: ; preds = %land.rhs.i130
+ store %struct.malloc_tree_chunk* %92, %struct.malloc_tree_chunk** %bk135.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %93, %struct.malloc_tree_chunk** %fd138.i, align 4, !tbaa !0
+ br label %if.end178.i
+
+if.else146.i: ; preds = %land.rhs.i130, %land.lhs.true134.i, %if.then129.i
+ tail call void @abort() #6
+ unreachable
+
+if.else148.i: ; preds = %if.then126.i
+ %arrayidx150.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1
+ %97 = load %struct.malloc_tree_chunk** %arrayidx150.i, align 4, !tbaa !0
+ %cmp151.i = icmp eq %struct.malloc_tree_chunk* %97, null
+ br i1 %cmp151.i, label %lor.lhs.false.i133, label %while.cond158.i
+
+lor.lhs.false.i133: ; preds = %if.else148.i
+ %arrayidx154.i131 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0
+ %98 = load %struct.malloc_tree_chunk** %arrayidx154.i131, align 4, !tbaa !0
+ %cmp155.i132 = icmp eq %struct.malloc_tree_chunk* %98, null
+ br i1 %cmp155.i132, label %if.end178.i, label %while.cond158.i
+
+while.cond158.i: ; preds = %lor.rhs.i136, %while.cond158.i, %lor.lhs.false.i133, %if.else148.i
+ %RP.0.i134 = phi %struct.malloc_tree_chunk** [ %arrayidx154.i131, %lor.lhs.false.i133 ], [ %arrayidx150.i, %if.else148.i ], [ %arrayidx160.i, %while.cond158.i ], [ %arrayidx164.i, %lor.rhs.i136 ]
+ %R.0.i135 = phi %struct.malloc_tree_chunk* [ %98, %lor.lhs.false.i133 ], [ %97, %if.else148.i ], [ %99, %while.cond158.i ], [ %100, %lor.rhs.i136 ]
+ %arrayidx160.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i135, i32 0, i32 4, i32 1
+ %99 = load %struct.malloc_tree_chunk** %arrayidx160.i, align 4, !tbaa !0
+ %cmp161.i = icmp eq %struct.malloc_tree_chunk* %99, null
+ br i1 %cmp161.i, label %lor.rhs.i136, label %while.cond158.i
+
+lor.rhs.i136: ; preds = %while.cond158.i
+ %arrayidx164.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i135, i32 0, i32 4, i32 0
+ %100 = load %struct.malloc_tree_chunk** %arrayidx164.i, align 4, !tbaa !0
+ %cmp165.i = icmp eq %struct.malloc_tree_chunk* %100, null
+ br i1 %cmp165.i, label %while.end168.i, label %while.cond158.i
+
+while.end168.i: ; preds = %lor.rhs.i136
+ %101 = bitcast %struct.malloc_tree_chunk** %RP.0.i134 to i8*
+ %cmp170.i = icmp ult i8* %101, %89
+ br i1 %cmp170.i, label %if.else175.i, label %if.then174.i, !prof !6
+
+if.then174.i: ; preds = %while.end168.i
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i134, align 4, !tbaa !0
+ br label %if.end178.i
+
+if.else175.i: ; preds = %while.end168.i
+ tail call void @abort() #6
+ unreachable
+
+if.end178.i: ; preds = %if.then174.i, %lor.lhs.false.i133, %if.then143.i
+ %R.1.i137 = phi %struct.malloc_tree_chunk* [ %92, %if.then143.i ], [ %R.0.i135, %if.then174.i ], [ null, %lor.lhs.false.i133 ]
+ %cmp179.i = icmp eq %struct.malloc_tree_chunk* %91, null
+ br i1 %cmp179.i, label %if.end263.i, label %if.then181.i
+
+if.then181.i: ; preds = %if.end178.i
+ %index.i138 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 6
+ %102 = load i32* %index.i138, align 4, !tbaa !3
+ %arrayidx183.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %102
+ %103 = load %struct.malloc_tree_chunk** %arrayidx183.i, align 4, !tbaa !0
+ %cmp184.i = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, %103
+ br i1 %cmp184.i, label %if.then186.i, label %if.else195.i
+
+if.then186.i: ; preds = %if.then181.i
+ store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx183.i, align 4, !tbaa !0
+ %cond18.i = icmp eq %struct.malloc_tree_chunk* %R.1.i137, null
+ br i1 %cond18.i, label %if.end215.thread.i, label %if.then218.i
+
+if.end215.thread.i: ; preds = %if.then186.i
+ %shl191.i = shl i32 1, %102
+ %neg.i139 = xor i32 %shl191.i, -1
+ %104 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and193.i = and i32 %104, %neg.i139
+ store i32 %and193.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end263.i
+
+if.else195.i: ; preds = %if.then181.i
+ %105 = bitcast %struct.malloc_tree_chunk* %91 to i8*
+ %106 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp197.i = icmp ult i8* %105, %106
+ br i1 %cmp197.i, label %if.else213.i, label %if.then201.i140, !prof !6
+
+if.then201.i140: ; preds = %if.else195.i
+ %arrayidx203.i = getelementptr inbounds %struct.malloc_tree_chunk* %91, i32 0, i32 4, i32 0
+ %107 = load %struct.malloc_tree_chunk** %arrayidx203.i, align 4, !tbaa !0
+ %cmp204.i = icmp eq %struct.malloc_tree_chunk* %107, %v.3.lcssa.i
+ br i1 %cmp204.i, label %if.then206.i, label %if.else209.i
+
+if.then206.i: ; preds = %if.then201.i140
+ store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx203.i, align 4, !tbaa !0
+ br label %if.end215.i
+
+if.else209.i: ; preds = %if.then201.i140
+ %arrayidx211.i = getelementptr inbounds %struct.malloc_tree_chunk* %91, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx211.i, align 4, !tbaa !0
+ br label %if.end215.i
+
+if.else213.i: ; preds = %if.else195.i
+ tail call void @abort() #6
+ unreachable
+
+if.end215.i: ; preds = %if.else209.i, %if.then206.i
+ %cmp216.i = icmp eq %struct.malloc_tree_chunk* %R.1.i137, null
+ br i1 %cmp216.i, label %if.end263.i, label %if.then218.i
+
+if.then218.i: ; preds = %if.end215.i, %if.then186.i
+ %108 = bitcast %struct.malloc_tree_chunk* %R.1.i137 to i8*
+ %109 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp220.i = icmp ult i8* %108, %109
+ br i1 %cmp220.i, label %if.else260.i, label %if.then224.i, !prof !6
+
+if.then224.i: ; preds = %if.then218.i
+ %parent225.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %91, %struct.malloc_tree_chunk** %parent225.i, align 4, !tbaa !0
+ %arrayidx227.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0
+ %110 = load %struct.malloc_tree_chunk** %arrayidx227.i, align 4, !tbaa !0
+ %cmp228.i = icmp eq %struct.malloc_tree_chunk* %110, null
+ br i1 %cmp228.i, label %if.end242.i, label %if.then230.i
+
+if.then230.i: ; preds = %if.then224.i
+ %111 = bitcast %struct.malloc_tree_chunk* %110 to i8*
+ %112 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp232.i = icmp ult i8* %111, %112
+ br i1 %cmp232.i, label %if.else240.i, label %if.then236.i, !prof !6
+
+if.then236.i: ; preds = %if.then230.i
+ %arrayidx238.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %110, %struct.malloc_tree_chunk** %arrayidx238.i, align 4, !tbaa !0
+ %parent239.i = getelementptr inbounds %struct.malloc_tree_chunk* %110, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %parent239.i, align 4, !tbaa !0
+ br label %if.end242.i
+
+if.else240.i: ; preds = %if.then230.i
+ tail call void @abort() #6
+ unreachable
+
+if.end242.i: ; preds = %if.then236.i, %if.then224.i
+ %arrayidx244.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1
+ %113 = load %struct.malloc_tree_chunk** %arrayidx244.i, align 4, !tbaa !0
+ %cmp245.i = icmp eq %struct.malloc_tree_chunk* %113, null
+ br i1 %cmp245.i, label %if.end263.i, label %if.then247.i
+
+if.then247.i: ; preds = %if.end242.i
+ %114 = bitcast %struct.malloc_tree_chunk* %113 to i8*
+ %115 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp249.i = icmp ult i8* %114, %115
+ br i1 %cmp249.i, label %if.else257.i, label %if.then253.i, !prof !6
+
+if.then253.i: ; preds = %if.then247.i
+ %arrayidx255.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx255.i, align 4, !tbaa !0
+ %parent256.i = getelementptr inbounds %struct.malloc_tree_chunk* %113, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %parent256.i, align 4, !tbaa !0
+ br label %if.end263.i
+
+if.else257.i: ; preds = %if.then247.i
+ tail call void @abort() #6
+ unreachable
+
+if.else260.i: ; preds = %if.then218.i
+ tail call void @abort() #6
+ unreachable
+
+if.end263.i: ; preds = %if.then253.i, %if.end242.i, %if.end215.i, %if.end215.thread.i, %if.end178.i
+ %cmp264.i = icmp ult i32 %rsize.3.lcssa.i, 16
+ br i1 %cmp264.i, label %if.then266.i, label %if.else275.i
+
+if.then266.i: ; preds = %if.end263.i
+ %add267.i = add i32 %rsize.3.lcssa.i, %and144
+ %or269.i = or i32 %add267.i, 3
+ %head270.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1
+ store i32 %or269.i, i32* %head270.i, align 4, !tbaa !3
+ %add.ptr272.sum.i = add i32 %add267.i, 4
+ %head273.i = getelementptr inbounds i8* %88, i32 %add.ptr272.sum.i
+ %116 = bitcast i8* %head273.i to i32*
+ %117 = load i32* %116, align 4, !tbaa !3
+ %or274.i = or i32 %117, 1
+ store i32 %or274.i, i32* %116, align 4, !tbaa !3
+ br label %tmalloc_large.exit
+
+if.else275.i: ; preds = %if.end263.i
+ %or277.i = or i32 %and144, 3
+ %head278.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1
+ store i32 %or277.i, i32* %head278.i, align 4, !tbaa !3
+ %or279.i = or i32 %rsize.3.lcssa.i, 1
+ %add.ptr.sum.i141172 = or i32 %and144, 4
+ %head280.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum.i141172
+ %118 = bitcast i8* %head280.i to i32*
+ store i32 %or279.i, i32* %118, align 4, !tbaa !3
+ %add.ptr.sum1.i142 = add i32 %rsize.3.lcssa.i, %and144
+ %add.ptr281.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum1.i142
+ %prev_foot.i143 = bitcast i8* %add.ptr281.i to i32*
+ store i32 %rsize.3.lcssa.i, i32* %prev_foot.i143, align 4, !tbaa !3
+ %shr282.i = lshr i32 %rsize.3.lcssa.i, 3
+ %cmp283.i = icmp ult i32 %rsize.3.lcssa.i, 256
+ br i1 %cmp283.i, label %if.then285.i, label %if.else313.i
+
+if.then285.i: ; preds = %if.else275.i
+ %shl287.i = shl nuw nsw i32 %shr282.i, 1
+ %arrayidx288.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl287.i
+ %119 = bitcast %struct.malloc_chunk** %arrayidx288.i to %struct.malloc_chunk*
+ %120 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl290.i = shl i32 1, %shr282.i
+ %and291.i = and i32 %120, %shl290.i
+ %tobool292.i = icmp eq i32 %and291.i, 0
+ br i1 %tobool292.i, label %if.then293.i, label %if.else297.i
+
+if.then293.i: ; preds = %if.then285.i
+ %or296.i = or i32 %120, %shl290.i
+ store i32 %or296.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx288.sum.pre.i = add i32 %shl287.i, 2
+ %.pre.i144 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx288.sum.pre.i
+ br label %if.end308.i
+
+if.else297.i: ; preds = %if.then285.i
+ %arrayidx288.sum15.i = add i32 %shl287.i, 2
+ %121 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx288.sum15.i
+ %122 = load %struct.malloc_chunk** %121, align 4, !tbaa !0
+ %123 = bitcast %struct.malloc_chunk* %122 to i8*
+ %124 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp300.i = icmp ult i8* %123, %124
+ br i1 %cmp300.i, label %if.else306.i, label %if.end308.i, !prof !6
+
+if.else306.i: ; preds = %if.else297.i
+ tail call void @abort() #6
+ unreachable
+
+if.end308.i: ; preds = %if.else297.i, %if.then293.i
+ %.pre-phi.i145 = phi %struct.malloc_chunk** [ %121, %if.else297.i ], [ %.pre.i144, %if.then293.i ]
+ %F289.0.i = phi %struct.malloc_chunk* [ %122, %if.else297.i ], [ %119, %if.then293.i ]
+ store %struct.malloc_chunk* %90, %struct.malloc_chunk** %.pre-phi.i145, align 4, !tbaa !0
+ %bk310.i = getelementptr inbounds %struct.malloc_chunk* %F289.0.i, i32 0, i32 3
+ store %struct.malloc_chunk* %90, %struct.malloc_chunk** %bk310.i, align 4, !tbaa !0
+ %add.ptr.sum13.i = add i32 %and144, 8
+ %fd311.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum13.i
+ %125 = bitcast i8* %fd311.i to %struct.malloc_chunk**
+ store %struct.malloc_chunk* %F289.0.i, %struct.malloc_chunk** %125, align 4, !tbaa !0
+ %add.ptr.sum14.i = add i32 %and144, 12
+ %bk312.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum14.i
+ %126 = bitcast i8* %bk312.i to %struct.malloc_chunk**
+ store %struct.malloc_chunk* %119, %struct.malloc_chunk** %126, align 4, !tbaa !0
+ br label %tmalloc_large.exit
+
+if.else313.i: ; preds = %if.else275.i
+ %127 = bitcast i8* %add.ptr.i126 to %struct.malloc_tree_chunk*
+ %shr317.i = lshr i32 %rsize.3.lcssa.i, 8
+ %cmp318.i = icmp eq i32 %shr317.i, 0
+ br i1 %cmp318.i, label %if.end352.i, label %if.else321.i
+
+if.else321.i: ; preds = %if.else313.i
+ %cmp322.i = icmp ugt i32 %rsize.3.lcssa.i, 16777215
+ br i1 %cmp322.i, label %if.end352.i, label %if.else325.i
+
+if.else325.i: ; preds = %if.else321.i
+ %sub328.i = add i32 %shr317.i, 1048320
+ %shr329.i = lshr i32 %sub328.i, 16
+ %and330.i = and i32 %shr329.i, 8
+ %shl332.i = shl i32 %shr317.i, %and330.i
+ %sub333.i = add i32 %shl332.i, 520192
+ %shr334.i = lshr i32 %sub333.i, 16
+ %and335.i = and i32 %shr334.i, 4
+ %add336.i = or i32 %and335.i, %and330.i
+ %shl337.i = shl i32 %shl332.i, %and335.i
+ %sub338.i = add i32 %shl337.i, 245760
+ %shr339.i = lshr i32 %sub338.i, 16
+ %and340.i = and i32 %shr339.i, 2
+ %add341.i = or i32 %add336.i, %and340.i
+ %sub342.i = sub i32 14, %add341.i
+ %shl343.i = shl i32 %shl337.i, %and340.i
+ %shr344.i = lshr i32 %shl343.i, 15
+ %add345.i = add i32 %sub342.i, %shr344.i
+ %shl346.i = shl nsw i32 %add345.i, 1
+ %add347.i = add i32 %add345.i, 7
+ %shr348.i = lshr i32 %rsize.3.lcssa.i, %add347.i
+ %and349.i = and i32 %shr348.i, 1
+ %add350.i = or i32 %and349.i, %shl346.i
+ br label %if.end352.i
+
+if.end352.i: ; preds = %if.else325.i, %if.else321.i, %if.else313.i
+ %I315.0.i = phi i32 [ %add350.i, %if.else325.i ], [ 0, %if.else313.i ], [ 31, %if.else321.i ]
+ %arrayidx354.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I315.0.i
+ %add.ptr.sum2.i = add i32 %and144, 28
+ %index355.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum2.i
+ %128 = bitcast i8* %index355.i to i32*
+ store i32 %I315.0.i, i32* %128, align 4, !tbaa !3
+ %add.ptr.sum3.i = add i32 %and144, 16
+ %child356.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum3.i
+ %child356.sum.i = add i32 %and144, 20
+ %arrayidx357.i = getelementptr inbounds i8* %88, i32 %child356.sum.i
+ %129 = bitcast i8* %arrayidx357.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %129, align 4, !tbaa !0
+ %arrayidx359.i = bitcast i8* %child356.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %arrayidx359.i, align 4, !tbaa !0
+ %130 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %shl361.i = shl i32 1, %I315.0.i
+ %and362.i = and i32 %130, %shl361.i
+ %tobool363.i = icmp eq i32 %and362.i, 0
+ br i1 %tobool363.i, label %if.then364.i, label %if.else371.i
+
+if.then364.i: ; preds = %if.end352.i
+ %or367.i = or i32 %130, %shl361.i
+ store i32 %or367.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %arrayidx354.i, align 4, !tbaa !0
+ %131 = bitcast %struct.malloc_tree_chunk** %arrayidx354.i to %struct.malloc_tree_chunk*
+ %add.ptr.sum4.i = add i32 %and144, 24
+ %parent368.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum4.i
+ %132 = bitcast i8* %parent368.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %131, %struct.malloc_tree_chunk** %132, align 4, !tbaa !0
+ %add.ptr.sum5.i = add i32 %and144, 12
+ %bk369.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum5.i
+ %133 = bitcast i8* %bk369.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %133, align 4, !tbaa !0
+ %add.ptr.sum6.i = add i32 %and144, 8
+ %fd370.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum6.i
+ %134 = bitcast i8* %fd370.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %134, align 4, !tbaa !0
+ br label %tmalloc_large.exit
+
+if.else371.i: ; preds = %if.end352.i
+ %135 = load %struct.malloc_tree_chunk** %arrayidx354.i, align 4, !tbaa !0
+ %cmp373.i = icmp eq i32 %I315.0.i, 31
+ br i1 %cmp373.i, label %cond.end381.i, label %cond.false376.i
+
+cond.false376.i: ; preds = %if.else371.i
+ %shr377.i = lshr i32 %I315.0.i, 1
+ %sub380.i = sub i32 25, %shr377.i
+ br label %cond.end381.i
+
+cond.end381.i: ; preds = %cond.false376.i, %if.else371.i
+ %cond382.i = phi i32 [ %sub380.i, %cond.false376.i ], [ 0, %if.else371.i ]
+ %head38520.i = getelementptr inbounds %struct.malloc_tree_chunk* %135, i32 0, i32 1
+ %136 = load i32* %head38520.i, align 4, !tbaa !3
+ %and38621.i = and i32 %136, -8
+ %cmp38722.i = icmp eq i32 %and38621.i, %rsize.3.lcssa.i
+ br i1 %cmp38722.i, label %if.else410.i, label %if.then389.lr.ph.i
+
+if.then389.lr.ph.i: ; preds = %cond.end381.i
+ %shl383.i = shl i32 %rsize.3.lcssa.i, %cond382.i
+ br label %if.then389.i
+
+for.cond384.i: ; preds = %if.then389.i
+ %shl394.i = shl i32 %K372.024.i, 1
+ %head385.i = getelementptr inbounds %struct.malloc_tree_chunk* %138, i32 0, i32 1
+ %137 = load i32* %head385.i, align 4, !tbaa !3
+ %and386.i = and i32 %137, -8
+ %cmp387.i = icmp eq i32 %and386.i, %rsize.3.lcssa.i
+ br i1 %cmp387.i, label %if.else410.i, label %if.then389.i
+
+if.then389.i: ; preds = %for.cond384.i, %if.then389.lr.ph.i
+ %K372.024.i = phi i32 [ %shl383.i, %if.then389.lr.ph.i ], [ %shl394.i, %for.cond384.i ]
+ %T.023.i = phi %struct.malloc_tree_chunk* [ %135, %if.then389.lr.ph.i ], [ %138, %for.cond384.i ]
+ %shr390.i = lshr i32 %K372.024.i, 31
+ %arrayidx393.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.023.i, i32 0, i32 4, i32 %shr390.i
+ %138 = load %struct.malloc_tree_chunk** %arrayidx393.i, align 4, !tbaa !0
+ %cmp395.i = icmp eq %struct.malloc_tree_chunk* %138, null
+ br i1 %cmp395.i, label %if.else398.i, label %for.cond384.i
+
+if.else398.i: ; preds = %if.then389.i
+ %139 = bitcast %struct.malloc_tree_chunk** %arrayidx393.i to i8*
+ %140 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp400.i = icmp ult i8* %139, %140
+ br i1 %cmp400.i, label %if.else408.i, label %if.then404.i, !prof !6
+
+if.then404.i: ; preds = %if.else398.i
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %arrayidx393.i, align 4, !tbaa !0
+ %add.ptr.sum10.i = add i32 %and144, 24
+ %parent405.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum10.i
+ %141 = bitcast i8* %parent405.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %T.023.i, %struct.malloc_tree_chunk** %141, align 4, !tbaa !0
+ %add.ptr.sum11.i = add i32 %and144, 12
+ %bk406.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum11.i
+ %142 = bitcast i8* %bk406.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %142, align 4, !tbaa !0
+ %add.ptr.sum12.i = add i32 %and144, 8
+ %fd407.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum12.i
+ %143 = bitcast i8* %fd407.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %143, align 4, !tbaa !0
+ br label %tmalloc_large.exit
+
+if.else408.i: ; preds = %if.else398.i
+ tail call void @abort() #6
+ unreachable
+
+if.else410.i: ; preds = %for.cond384.i, %cond.end381.i
+ %T.0.lcssa.i = phi %struct.malloc_tree_chunk* [ %135, %cond.end381.i ], [ %138, %for.cond384.i ]
+ %fd412.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i, i32 0, i32 2
+ %144 = load %struct.malloc_tree_chunk** %fd412.i, align 4, !tbaa !0
+ %145 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i to i8*
+ %146 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp414.i = icmp ult i8* %145, %146
+ br i1 %cmp414.i, label %if.else430.i, label %land.rhs416.i
+
+land.rhs416.i: ; preds = %if.else410.i
+ %147 = bitcast %struct.malloc_tree_chunk* %144 to i8*
+ %cmp418.i = icmp ult i8* %147, %146
+ br i1 %cmp418.i, label %if.else430.i, label %if.then424.i, !prof !6
+
+if.then424.i: ; preds = %land.rhs416.i
+ %bk425.i = getelementptr inbounds %struct.malloc_tree_chunk* %144, i32 0, i32 3
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %bk425.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %fd412.i, align 4, !tbaa !0
+ %add.ptr.sum7.i = add i32 %and144, 8
+ %fd427.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum7.i
+ %148 = bitcast i8* %fd427.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %144, %struct.malloc_tree_chunk** %148, align 4, !tbaa !0
+ %add.ptr.sum8.i = add i32 %and144, 12
+ %bk428.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum8.i
+ %149 = bitcast i8* %bk428.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %T.0.lcssa.i, %struct.malloc_tree_chunk** %149, align 4, !tbaa !0
+ %add.ptr.sum9.i = add i32 %and144, 24
+ %parent429.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum9.i
+ %150 = bitcast i8* %parent429.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %150, align 4, !tbaa !0
+ br label %tmalloc_large.exit
+
+if.else430.i: ; preds = %land.rhs416.i, %if.else410.i
+ tail call void @abort() #6
+ unreachable
+
+if.end438.i: ; preds = %if.then121.i, %if.then119.i
+ tail call void @abort() #6
+ unreachable
+
+tmalloc_large.exit: ; preds = %if.then424.i, %if.then404.i, %if.then364.i, %if.end308.i, %if.then266.i
+ %add.ptr436.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2
+ %151 = bitcast %struct.malloc_tree_chunk** %add.ptr436.i to i8*
+ br label %postaction
+
+if.end154: ; preds = %land.lhs.true116.i, %while.end.i125, %if.then57.i, %if.else141, %if.else137, %if.else127, %if.else28
+ %nb.0 = phi i32 [ %cond, %if.else127 ], [ %cond, %if.else28 ], [ -1, %if.else137 ], [ %and144, %if.else141 ], [ %and144, %while.end.i125 ], [ %and144, %land.lhs.true116.i ], [ %and144, %if.then57.i ]
+ %152 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %cmp155 = icmp ugt i32 %nb.0, %152
+ br i1 %cmp155, label %if.else182, label %if.then157
+
+if.then157: ; preds = %if.end154
+ %sub159 = sub i32 %152, %nb.0
+ %153 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp161 = icmp ugt i32 %sub159, 15
+ br i1 %cmp161, label %if.then163, label %if.else173
+
+if.then163: ; preds = %if.then157
+ %154 = bitcast %struct.malloc_chunk* %153 to i8*
+ %add.ptr165 = getelementptr inbounds i8* %154, i32 %nb.0
+ %155 = bitcast i8* %add.ptr165 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %155, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ store i32 %sub159, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %or166 = or i32 %sub159, 1
+ %add.ptr165.sum = add i32 %nb.0, 4
+ %head167 = getelementptr inbounds i8* %154, i32 %add.ptr165.sum
+ %156 = bitcast i8* %head167 to i32*
+ store i32 %or166, i32* %156, align 4, !tbaa !3
+ %add.ptr168 = getelementptr inbounds i8* %154, i32 %152
+ %prev_foot169 = bitcast i8* %add.ptr168 to i32*
+ store i32 %sub159, i32* %prev_foot169, align 4, !tbaa !3
+ %or171 = or i32 %nb.0, 3
+ %head172 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 1
+ store i32 %or171, i32* %head172, align 4, !tbaa !3
+ br label %if.end180
+
+if.else173: ; preds = %if.then157
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %or175 = or i32 %152, 3
+ %head176 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 1
+ store i32 %or175, i32* %head176, align 4, !tbaa !3
+ %157 = bitcast %struct.malloc_chunk* %153 to i8*
+ %add.ptr177.sum = add i32 %152, 4
+ %head178 = getelementptr inbounds i8* %157, i32 %add.ptr177.sum
+ %158 = bitcast i8* %head178 to i32*
+ %159 = load i32* %158, align 4, !tbaa !3
+ %or179 = or i32 %159, 1
+ store i32 %or179, i32* %158, align 4, !tbaa !3
+ br label %if.end180
+
+if.end180: ; preds = %if.else173, %if.then163
+ %add.ptr181 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 2
+ %160 = bitcast %struct.malloc_chunk** %add.ptr181 to i8*
+ br label %postaction
+
+if.else182: ; preds = %if.end154
+ %161 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %cmp183 = icmp ult i32 %nb.0, %161
+ br i1 %cmp183, label %if.then185, label %if.end198
+
+if.then185: ; preds = %if.else182
+ %sub187 = sub i32 %161, %nb.0
+ store i32 %sub187, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %162 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %163 = bitcast %struct.malloc_chunk* %162 to i8*
+ %add.ptr190 = getelementptr inbounds i8* %163, i32 %nb.0
+ %164 = bitcast i8* %add.ptr190 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %164, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %or191 = or i32 %sub187, 1
+ %add.ptr190.sum = add i32 %nb.0, 4
+ %head192 = getelementptr inbounds i8* %163, i32 %add.ptr190.sum
+ %165 = bitcast i8* %head192 to i32*
+ store i32 %or191, i32* %165, align 4, !tbaa !3
+ %or194 = or i32 %nb.0, 3
+ %head195 = getelementptr inbounds %struct.malloc_chunk* %162, i32 0, i32 1
+ store i32 %or194, i32* %head195, align 4, !tbaa !3
+ %add.ptr196 = getelementptr inbounds %struct.malloc_chunk* %162, i32 0, i32 2
+ %166 = bitcast %struct.malloc_chunk** %add.ptr196 to i8*
+ br label %postaction
+
+if.end198: ; preds = %if.else182
+ %167 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp.i146 = icmp eq i32 %167, 0
+ br i1 %cmp.i146, label %if.then.i.i, label %if.end8.i
+
+if.then.i.i: ; preds = %if.end198
+ %call.i.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i.i = add i32 %call.i.i, -1
+ %and.i.i = and i32 %sub.i.i, %call.i.i
+ %cmp1.i.i = icmp eq i32 %and.i.i, 0
+ br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i
+
+if.then5.i.i: ; preds = %if.then.i.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit.i: ; preds = %if.then.i.i
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i.i = tail call i32 @time(i32* null) #1
+ %xor.i.i = and i32 %call6.i.i, -16
+ %and7.i.i = xor i32 %xor.i.i, 1431655768
+ store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end8.i
+
+if.end8.i: ; preds = %init_mparams.exit.i, %if.end198
+ %add.i147 = add i32 %nb.0, 48
+ %168 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ %sub.i148 = add i32 %nb.0, 47
+ %add9.i = add i32 %168, %sub.i148
+ %neg.i149 = sub i32 0, %168
+ %and11.i = and i32 %add9.i, %neg.i149
+ %cmp12.i = icmp ugt i32 %and11.i, %nb.0
+ br i1 %cmp12.i, label %if.end14.i, label %postaction
+
+if.end14.i: ; preds = %if.end8.i
+ %169 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3
+ %cmp15.i = icmp eq i32 %169, 0
+ br i1 %cmp15.i, label %if.end24.i, label %if.then16.i
+
+if.then16.i: ; preds = %if.end14.i
+ %170 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %add17.i150 = add i32 %170, %and11.i
+ %cmp19.i = icmp ule i32 %add17.i150, %170
+ %cmp21.i = icmp ugt i32 %add17.i150, %169
+ %or.cond1.i = or i1 %cmp19.i, %cmp21.i
+ br i1 %or.cond1.i, label %postaction, label %if.end24.i
+
+if.end24.i: ; preds = %if.then16.i, %if.end14.i
+ %171 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %and26.i = and i32 %171, 4
+ %tobool27.i = icmp eq i32 %and26.i, 0
+ br i1 %tobool27.i, label %if.then28.i, label %if.end121.i
+
+if.then28.i: ; preds = %if.end24.i
+ %172 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp29.i = icmp eq %struct.malloc_chunk* %172, null
+ br i1 %cmp29.i, label %if.then33.i, label %cond.false.i151
+
+cond.false.i151: ; preds = %if.then28.i
+ %173 = bitcast %struct.malloc_chunk* %172 to i8*
+ br label %for.cond.i.i
+
+for.cond.i.i: ; preds = %if.end.i10.i, %cond.false.i151
+ %sp.0.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %cond.false.i151 ], [ %176, %if.end.i10.i ]
+ %base.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 0
+ %174 = load i8** %base.i.i, align 4, !tbaa !0
+ %cmp.i9.i = icmp ugt i8* %174, %173
+ br i1 %cmp.i9.i, label %if.end.i10.i, label %land.lhs.true.i.i
+
+land.lhs.true.i.i: ; preds = %for.cond.i.i
+ %size.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 1
+ %175 = load i32* %size.i.i, align 4, !tbaa !3
+ %add.ptr.i.i = getelementptr inbounds i8* %174, i32 %175
+ %cmp2.i.i = icmp ugt i8* %add.ptr.i.i, %173
+ br i1 %cmp2.i.i, label %cond.end.i153, label %if.end.i10.i
+
+if.end.i10.i: ; preds = %land.lhs.true.i.i, %for.cond.i.i
+ %next.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 2
+ %176 = load %struct.malloc_segment** %next.i.i, align 4, !tbaa !0
+ %cmp3.i.i = icmp eq %struct.malloc_segment* %176, null
+ br i1 %cmp3.i.i, label %if.then33.i, label %for.cond.i.i
+
+cond.end.i153: ; preds = %land.lhs.true.i.i
+ %cmp32.i152 = icmp eq %struct.malloc_segment* %sp.0.i.i, null
+ br i1 %cmp32.i152, label %if.then33.i, label %if.else.i159
+
+if.then33.i: ; preds = %cond.end.i153, %if.end.i10.i, %if.then28.i
+ %call34.i = tail call i8* @sbrk(i32 0) #1
+ %cmp35.i154 = icmp eq i8* %call34.i, inttoptr (i32 -1 to i8*)
+ br i1 %cmp35.i154, label %if.else117.i, label %if.then36.i
+
+if.then36.i: ; preds = %if.then33.i
+ %177 = ptrtoint i8* %call34.i to i32
+ %178 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ %sub38.i = add i32 %178, -1
+ %and39.i = and i32 %sub38.i, %177
+ %cmp40.i155 = icmp eq i32 %and39.i, 0
+ br i1 %cmp40.i155, label %if.end49.i, label %if.then41.i
+
+if.then41.i: ; preds = %if.then36.i
+ %add43.i = add i32 %sub38.i, %177
+ %neg45.i = sub i32 0, %178
+ %and46.i = and i32 %add43.i, %neg45.i
+ %sub47.i = sub i32 %and11.i, %177
+ %add48.i = add i32 %sub47.i, %and46.i
+ br label %if.end49.i
+
+if.end49.i: ; preds = %if.then41.i, %if.then36.i
+ %ssize.0.i = phi i32 [ %and11.i, %if.then36.i ], [ %add48.i, %if.then41.i ]
+ %179 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %add51.i = add i32 %179, %ssize.0.i
+ %cmp52.i = icmp ugt i32 %ssize.0.i, %nb.0
+ %cmp54.i156 = icmp ult i32 %ssize.0.i, 2147483647
+ %or.cond.i157 = and i1 %cmp52.i, %cmp54.i156
+ br i1 %or.cond.i157, label %land.lhs.true55.i, label %if.else117.i
+
+land.lhs.true55.i: ; preds = %if.end49.i
+ %180 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3
+ %cmp57.i = icmp eq i32 %180, 0
+ br i1 %cmp57.i, label %land.lhs.true64.i, label %lor.lhs.false58.i
+
+lor.lhs.false58.i: ; preds = %land.lhs.true55.i
+ %cmp60.i = icmp ule i32 %add51.i, %179
+ %cmp63.i = icmp ugt i32 %add51.i, %180
+ %or.cond2.i = or i1 %cmp60.i, %cmp63.i
+ br i1 %or.cond2.i, label %if.else117.i, label %land.lhs.true64.i
+
+land.lhs.true64.i: ; preds = %lor.lhs.false58.i, %land.lhs.true55.i
+ %call65.i = tail call i8* @sbrk(i32 %ssize.0.i) #1
+ %cmp66.i158 = icmp eq i8* %call65.i, %call34.i
+ %ssize.0..i = select i1 %cmp66.i158, i32 %ssize.0.i, i32 0
+ %call34..i = select i1 %cmp66.i158, i8* %call34.i, i8* inttoptr (i32 -1 to i8*)
+ br label %if.end85.i
+
+if.else.i159: ; preds = %cond.end.i153
+ %181 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add74.i = sub i32 %add9.i, %181
+ %and77.i = and i32 %add74.i, %neg.i149
+ %cmp78.i = icmp ult i32 %and77.i, 2147483647
+ br i1 %cmp78.i, label %land.lhs.true79.i, label %if.else117.i
+
+land.lhs.true79.i: ; preds = %if.else.i159
+ %call80.i = tail call i8* @sbrk(i32 %and77.i) #1
+ %182 = load i8** %base.i.i, align 4, !tbaa !0
+ %183 = load i32* %size.i.i, align 4, !tbaa !3
+ %add.ptr.i160 = getelementptr inbounds i8* %182, i32 %183
+ %cmp82.i = icmp eq i8* %call80.i, %add.ptr.i160
+ %and77..i = select i1 %cmp82.i, i32 %and77.i, i32 0
+ %call80..i = select i1 %cmp82.i, i8* %call80.i, i8* inttoptr (i32 -1 to i8*)
+ br label %if.end85.i
+
+if.end85.i: ; preds = %land.lhs.true79.i, %land.lhs.true64.i
+ %ssize.1.i = phi i32 [ %ssize.0.i, %land.lhs.true64.i ], [ %and77.i, %land.lhs.true79.i ]
+ %br.0.i = phi i8* [ %call65.i, %land.lhs.true64.i ], [ %call80.i, %land.lhs.true79.i ]
+ %tsize.0.i = phi i32 [ %ssize.0..i, %land.lhs.true64.i ], [ %and77..i, %land.lhs.true79.i ]
+ %tbase.0.i = phi i8* [ %call34..i, %land.lhs.true64.i ], [ %call80..i, %land.lhs.true79.i ]
+ %sub109.i = sub i32 0, %ssize.1.i
+ %cmp86.i = icmp eq i8* %tbase.0.i, inttoptr (i32 -1 to i8*)
+ br i1 %cmp86.i, label %if.then87.i, label %if.then145.i
+
+if.then87.i: ; preds = %if.end85.i
+ %cmp88.i = icmp ne i8* %br.0.i, inttoptr (i32 -1 to i8*)
+ %cmp90.i161 = icmp ult i32 %ssize.1.i, 2147483647
+ %or.cond3.i = and i1 %cmp88.i, %cmp90.i161
+ %cmp93.i = icmp ult i32 %ssize.1.i, %add.i147
+ %or.cond4.i = and i1 %or.cond3.i, %cmp93.i
+ br i1 %or.cond4.i, label %if.then94.i, label %if.end114.i
+
+if.then94.i: ; preds = %if.then87.i
+ %184 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ %sub96.i = sub i32 %sub.i148, %ssize.1.i
+ %add98.i = add i32 %sub96.i, %184
+ %neg100.i = sub i32 0, %184
+ %and101.i = and i32 %add98.i, %neg100.i
+ %cmp102.i = icmp ult i32 %and101.i, 2147483647
+ br i1 %cmp102.i, label %if.then103.i, label %if.end114.i
+
+if.then103.i: ; preds = %if.then94.i
+ %call104.i = tail call i8* @sbrk(i32 %and101.i) #1
+ %cmp105.i = icmp eq i8* %call104.i, inttoptr (i32 -1 to i8*)
+ br i1 %cmp105.i, label %if.else108.i, label %if.then106.i
+
+if.then106.i: ; preds = %if.then103.i
+ %add107.i = add i32 %and101.i, %ssize.1.i
+ br label %if.end114.i
+
+if.else108.i: ; preds = %if.then103.i
+ %call110.i = tail call i8* @sbrk(i32 %sub109.i) #1
+ br label %if.else117.i
+
+if.end114.i: ; preds = %if.then106.i, %if.then94.i, %if.then87.i
+ %ssize.2.i = phi i32 [ %add107.i, %if.then106.i ], [ %ssize.1.i, %if.then94.i ], [ %ssize.1.i, %if.then87.i ]
+ %cmp115.i162 = icmp eq i8* %br.0.i, inttoptr (i32 -1 to i8*)
+ br i1 %cmp115.i162, label %if.else117.i, label %if.then145.i
+
+if.else117.i: ; preds = %if.end114.i, %if.else108.i, %if.else.i159, %lor.lhs.false58.i, %if.end49.i, %if.then33.i
+ %tsize.0748284.i = phi i32 [ %tsize.0.i, %if.else108.i ], [ 0, %if.else.i159 ], [ 0, %if.then33.i ], [ 0, %if.end49.i ], [ 0, %lor.lhs.false58.i ], [ %tsize.0.i, %if.end114.i ]
+ %185 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %or.i163 = or i32 %185, 4
+ store i32 %or.i163, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ br label %if.end121.i
+
+if.end121.i: ; preds = %if.else117.i, %if.end24.i
+ %tsize.1.i = phi i32 [ 0, %if.end24.i ], [ %tsize.0748284.i, %if.else117.i ]
+ %cmp124.i = icmp ult i32 %and11.i, 2147483647
+ br i1 %cmp124.i, label %if.then125.i, label %if.end264.i
+
+if.then125.i: ; preds = %if.end121.i
+ %call128.i = tail call i8* @sbrk(i32 %and11.i) #1
+ %call129.i = tail call i8* @sbrk(i32 0) #1
+ %notlhs.i = icmp ne i8* %call128.i, inttoptr (i32 -1 to i8*)
+ %notrhs.i = icmp ne i8* %call129.i, inttoptr (i32 -1 to i8*)
+ %or.cond6.not.i = and i1 %notrhs.i, %notlhs.i
+ %cmp134.i = icmp ult i8* %call128.i, %call129.i
+ %or.cond7.i = and i1 %or.cond6.not.i, %cmp134.i
+ br i1 %or.cond7.i, label %if.end143.i, label %if.end264.i
+
+if.end143.i: ; preds = %if.then125.i
+ %sub.ptr.lhs.cast.i = ptrtoint i8* %call129.i to i32
+ %sub.ptr.rhs.cast.i = ptrtoint i8* %call128.i to i32
+ %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i
+ %add137.i = add i32 %nb.0, 40
+ %cmp138.i164 = icmp ugt i32 %sub.ptr.sub.i, %add137.i
+ %sub.ptr.sub.tsize.1.i = select i1 %cmp138.i164, i32 %sub.ptr.sub.i, i32 %tsize.1.i
+ br i1 %cmp138.i164, label %if.then145.i, label %if.end264.i
+
+if.then145.i: ; preds = %if.end143.i, %if.end114.i, %if.end85.i
+ %tbase.291.i = phi i8* [ %tbase.0.i, %if.end85.i ], [ %br.0.i, %if.end114.i ], [ %call128.i, %if.end143.i ]
+ %tsize.290.i = phi i32 [ %tsize.0.i, %if.end85.i ], [ %ssize.2.i, %if.end114.i ], [ %sub.ptr.sub.tsize.1.i, %if.end143.i ]
+ %186 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %add147.i = add i32 %186, %tsize.290.i
+ store i32 %add147.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %187 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3
+ %cmp148.i = icmp ugt i32 %add147.i, %187
+ br i1 %cmp148.i, label %if.then149.i, label %if.end152.i165
+
+if.then149.i: ; preds = %if.then145.i
+ store i32 %add147.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3
+ br label %if.end152.i165
+
+if.end152.i165: ; preds = %if.then149.i, %if.then145.i
+ %188 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp154.i = icmp eq %struct.malloc_chunk* %188, null
+ br i1 %cmp154.i, label %if.then155.i, label %land.rhs.i167
+
+if.then155.i: ; preds = %if.end152.i165
+ %189 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp156.i = icmp eq i8* %189, null
+ %cmp159.i166 = icmp ult i8* %tbase.291.i, %189
+ %or.cond8.i = or i1 %cmp156.i, %cmp159.i166
+ br i1 %or.cond8.i, label %if.then160.i, label %if.end162.i
+
+if.then160.i: ; preds = %if.then155.i
+ store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ br label %if.end162.i
+
+if.end162.i: ; preds = %if.then160.i, %if.then155.i
+ store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4, !tbaa !0
+ store i32 %tsize.290.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4, !tbaa !3
+ %190 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ store i32 %190, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 9), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3
+ br label %for.body.i.i
+
+for.body.i.i: ; preds = %for.body.i.i, %if.end162.i
+ %i.02.i.i = phi i32 [ 0, %if.end162.i ], [ %inc.i.i, %for.body.i.i ]
+ %shl.i.i = shl i32 %i.02.i.i, 1
+ %arrayidx.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i.i
+ %191 = bitcast %struct.malloc_chunk** %arrayidx.i.i to %struct.malloc_chunk*
+ %arrayidx.sum.i.i = add i32 %shl.i.i, 3
+ %192 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum.i.i
+ store %struct.malloc_chunk* %191, %struct.malloc_chunk** %192, align 4, !tbaa !0
+ %arrayidx.sum1.i.i = add i32 %shl.i.i, 2
+ %193 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum1.i.i
+ store %struct.malloc_chunk* %191, %struct.malloc_chunk** %193, align 4, !tbaa !0
+ %inc.i.i = add i32 %i.02.i.i, 1
+ %exitcond.i.i = icmp eq i32 %inc.i.i, 32
+ br i1 %exitcond.i.i, label %init_bins.exit.i, label %for.body.i.i
+
+init_bins.exit.i: ; preds = %for.body.i.i
+ %sub169.i = add i32 %tsize.290.i, -40
+ %add.ptr.i11.i = getelementptr inbounds i8* %tbase.291.i, i32 8
+ %194 = ptrtoint i8* %add.ptr.i11.i to i32
+ %and.i12.i = and i32 %194, 7
+ %cmp.i13.i = icmp eq i32 %and.i12.i, 0
+ br i1 %cmp.i13.i, label %init_top.exit.i, label %cond.false.i.i
+
+cond.false.i.i: ; preds = %init_bins.exit.i
+ %195 = sub i32 0, %194
+ %and3.i.i = and i32 %195, 7
+ br label %init_top.exit.i
+
+init_top.exit.i: ; preds = %cond.false.i.i, %init_bins.exit.i
+ %cond.i.i = phi i32 [ %and3.i.i, %cond.false.i.i ], [ 0, %init_bins.exit.i ]
+ %add.ptr4.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i.i
+ %196 = bitcast i8* %add.ptr4.i.i to %struct.malloc_chunk*
+ %sub5.i.i = sub i32 %sub169.i, %cond.i.i
+ store %struct.malloc_chunk* %196, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ store i32 %sub5.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %or.i.i = or i32 %sub5.i.i, 1
+ %add.ptr4.sum.i.i = add i32 %cond.i.i, 4
+ %head.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i.i
+ %197 = bitcast i8* %head.i.i to i32*
+ store i32 %or.i.i, i32* %197, align 4, !tbaa !3
+ %add.ptr6.sum.i.i = add i32 %tsize.290.i, -36
+ %head7.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr6.sum.i.i
+ %198 = bitcast i8* %head7.i.i to i32*
+ store i32 40, i32* %198, align 4, !tbaa !3
+ %199 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 %199, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ br label %if.end248.i
+
+land.rhs.i167: ; preds = %while.body.i168, %if.end152.i165
+ %sp.0109.i = phi %struct.malloc_segment* [ %202, %while.body.i168 ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.end152.i165 ]
+ %base184.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 0
+ %200 = load i8** %base184.i, align 4, !tbaa !0
+ %size185.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 1
+ %201 = load i32* %size185.i, align 4, !tbaa !3
+ %add.ptr186.i = getelementptr inbounds i8* %200, i32 %201
+ %cmp187.i = icmp eq i8* %tbase.291.i, %add.ptr186.i
+ br i1 %cmp187.i, label %land.lhs.true189.i, label %while.body.i168
+
+while.body.i168: ; preds = %land.rhs.i167
+ %next.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 2
+ %202 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0
+ %cmp183.i = icmp eq %struct.malloc_segment* %202, null
+ br i1 %cmp183.i, label %if.else213.i169, label %land.rhs.i167
+
+land.lhs.true189.i: ; preds = %land.rhs.i167
+ %sflags190.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 3
+ %203 = load i32* %sflags190.i, align 4, !tbaa !3
+ %and191.i = and i32 %203, 8
+ %tobool192.i = icmp eq i32 %and191.i, 0
+ br i1 %tobool192.i, label %land.lhs.true197.i, label %if.else213.i169
+
+land.lhs.true197.i: ; preds = %land.lhs.true189.i
+ %204 = bitcast %struct.malloc_chunk* %188 to i8*
+ %cmp200.i = icmp uge i8* %204, %200
+ %cmp206.i = icmp ult i8* %204, %tbase.291.i
+ %or.cond93.i = and i1 %cmp200.i, %cmp206.i
+ br i1 %or.cond93.i, label %if.then207.i, label %if.else213.i169
+
+if.then207.i: ; preds = %land.lhs.true197.i
+ %add209.i = add i32 %201, %tsize.290.i
+ store i32 %add209.i, i32* %size185.i, align 4, !tbaa !3
+ %205 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add212.i = add i32 %205, %tsize.290.i
+ %add.ptr.i22.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2
+ %206 = ptrtoint %struct.malloc_chunk** %add.ptr.i22.i to i32
+ %and.i23.i = and i32 %206, 7
+ %cmp.i24.i = icmp eq i32 %and.i23.i, 0
+ br i1 %cmp.i24.i, label %init_top.exit36.i, label %cond.false.i26.i
+
+cond.false.i26.i: ; preds = %if.then207.i
+ %207 = sub i32 0, %206
+ %and3.i25.i = and i32 %207, 7
+ br label %init_top.exit36.i
+
+init_top.exit36.i: ; preds = %cond.false.i26.i, %if.then207.i
+ %cond.i27.i = phi i32 [ %and3.i25.i, %cond.false.i26.i ], [ 0, %if.then207.i ]
+ %add.ptr4.i28.i = getelementptr inbounds i8* %204, i32 %cond.i27.i
+ %208 = bitcast i8* %add.ptr4.i28.i to %struct.malloc_chunk*
+ %sub5.i29.i = sub i32 %add212.i, %cond.i27.i
+ store %struct.malloc_chunk* %208, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ store i32 %sub5.i29.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %or.i30.i = or i32 %sub5.i29.i, 1
+ %add.ptr4.sum.i31.i = add i32 %cond.i27.i, 4
+ %head.i32.i = getelementptr inbounds i8* %204, i32 %add.ptr4.sum.i31.i
+ %209 = bitcast i8* %head.i32.i to i32*
+ store i32 %or.i30.i, i32* %209, align 4, !tbaa !3
+ %add.ptr6.sum.i33.i = add i32 %add212.i, 4
+ %head7.i34.i = getelementptr inbounds i8* %204, i32 %add.ptr6.sum.i33.i
+ %210 = bitcast i8* %head7.i34.i to i32*
+ store i32 40, i32* %210, align 4, !tbaa !3
+ %211 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 %211, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ br label %if.end248.i
+
+if.else213.i169: ; preds = %land.lhs.true197.i, %land.lhs.true189.i, %while.body.i168
+ %212 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp215.i = icmp ult i8* %tbase.291.i, %212
+ br i1 %cmp215.i, label %if.then216.i, label %while.cond220.preheader.i
+
+if.then216.i: ; preds = %if.else213.i169
+ store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ br label %while.cond220.preheader.i
+
+while.cond220.preheader.i: ; preds = %if.then216.i, %if.else213.i169
+ %add.ptr224.i = getelementptr inbounds i8* %tbase.291.i, i32 %tsize.290.i
+ br label %land.rhs222.i
+
+land.rhs222.i: ; preds = %while.body227.i, %while.cond220.preheader.i
+ %sp.1105.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %while.cond220.preheader.i ], [ %214, %while.body227.i ]
+ %base223.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 0
+ %213 = load i8** %base223.i, align 4, !tbaa !0
+ %cmp225.i = icmp eq i8* %213, %add.ptr224.i
+ br i1 %cmp225.i, label %land.lhs.true231.i, label %while.body227.i
+
+while.body227.i: ; preds = %land.rhs222.i
+ %next228.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 2
+ %214 = load %struct.malloc_segment** %next228.i, align 4, !tbaa !0
+ %cmp221.i = icmp eq %struct.malloc_segment* %214, null
+ br i1 %cmp221.i, label %if.else245.i, label %land.rhs222.i
+
+land.lhs.true231.i: ; preds = %land.rhs222.i
+ %sflags232.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 3
+ %215 = load i32* %sflags232.i, align 4, !tbaa !3
+ %and233.i = and i32 %215, 8
+ %tobool234.i = icmp eq i32 %and233.i, 0
+ br i1 %tobool234.i, label %if.then239.i, label %if.else245.i
+
+if.then239.i: ; preds = %land.lhs.true231.i
+ store i8* %tbase.291.i, i8** %base223.i, align 4, !tbaa !0
+ %size242.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 1
+ %216 = load i32* %size242.i, align 4, !tbaa !3
+ %add243.i = add i32 %216, %tsize.290.i
+ store i32 %add243.i, i32* %size242.i, align 4, !tbaa !3
+ %add.ptr.i37.i = getelementptr inbounds i8* %tbase.291.i, i32 8
+ %217 = ptrtoint i8* %add.ptr.i37.i to i32
+ %and.i38.i = and i32 %217, 7
+ %cmp.i39.i = icmp eq i32 %and.i38.i, 0
+ br i1 %cmp.i39.i, label %cond.end.i45.i, label %cond.false.i41.i
+
+cond.false.i41.i: ; preds = %if.then239.i
+ %218 = sub i32 0, %217
+ %and3.i40.i = and i32 %218, 7
+ br label %cond.end.i45.i
+
+cond.end.i45.i: ; preds = %cond.false.i41.i, %if.then239.i
+ %cond.i42.i = phi i32 [ %and3.i40.i, %cond.false.i41.i ], [ 0, %if.then239.i ]
+ %add.ptr4.i43.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i42.i
+ %add.ptr224.sum.i = add i32 %tsize.290.i, 8
+ %add.ptr5.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum.i
+ %219 = ptrtoint i8* %add.ptr5.i.i to i32
+ %and6.i44.i = and i32 %219, 7
+ %cmp7.i.i = icmp eq i32 %and6.i44.i, 0
+ br i1 %cmp7.i.i, label %cond.end14.i.i, label %cond.false9.i.i
+
+cond.false9.i.i: ; preds = %cond.end.i45.i
+ %220 = sub i32 0, %219
+ %and13.i.i = and i32 %220, 7
+ br label %cond.end14.i.i
+
+cond.end14.i.i: ; preds = %cond.false9.i.i, %cond.end.i45.i
+ %cond15.i.i = phi i32 [ %and13.i.i, %cond.false9.i.i ], [ 0, %cond.end.i45.i ]
+ %add.ptr224.sum131.i = add i32 %cond15.i.i, %tsize.290.i
+ %add.ptr16.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum131.i
+ %221 = bitcast i8* %add.ptr16.i.i to %struct.malloc_chunk*
+ %sub.ptr.lhs.cast.i46.i = ptrtoint i8* %add.ptr16.i.i to i32
+ %sub.ptr.rhs.cast.i47.i = ptrtoint i8* %add.ptr4.i43.i to i32
+ %sub.ptr.sub.i48.i = sub i32 %sub.ptr.lhs.cast.i46.i, %sub.ptr.rhs.cast.i47.i
+ %add.ptr4.sum.i49.i = add i32 %cond.i42.i, %nb.0
+ %add.ptr17.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i49.i
+ %222 = bitcast i8* %add.ptr17.i.i to %struct.malloc_chunk*
+ %sub18.i.i = sub i32 %sub.ptr.sub.i48.i, %nb.0
+ %or19.i.i = or i32 %nb.0, 3
+ %add.ptr4.sum1.i.i = add i32 %cond.i42.i, 4
+ %head.i50.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum1.i.i
+ %223 = bitcast i8* %head.i50.i to i32*
+ store i32 %or19.i.i, i32* %223, align 4, !tbaa !3
+ %224 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp20.i.i = icmp eq %struct.malloc_chunk* %221, %224
+ br i1 %cmp20.i.i, label %if.then.i51.i, label %if.else.i.i
+
+if.then.i51.i: ; preds = %cond.end14.i.i
+ %225 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add.i.i = add i32 %225, %sub18.i.i
+ store i32 %add.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ store %struct.malloc_chunk* %222, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %or22.i.i = or i32 %add.i.i, 1
+ %add.ptr17.sum35.i.i = add i32 %add.ptr4.sum.i49.i, 4
+ %head23.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum35.i.i
+ %226 = bitcast i8* %head23.i.i to i32*
+ store i32 %or22.i.i, i32* %226, align 4, !tbaa !3
+ br label %prepend_alloc.exit.i
+
+if.else.i.i: ; preds = %cond.end14.i.i
+ %227 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp24.i.i = icmp eq %struct.malloc_chunk* %221, %227
+ br i1 %cmp24.i.i, label %if.then25.i.i, label %if.else31.i.i
+
+if.then25.i.i: ; preds = %if.else.i.i
+ %228 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %add26.i.i = add i32 %228, %sub18.i.i
+ store i32 %add26.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %222, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %or28.i.i = or i32 %add26.i.i, 1
+ %add.ptr17.sum33.i.i = add i32 %add.ptr4.sum.i49.i, 4
+ %head29.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum33.i.i
+ %229 = bitcast i8* %head29.i.i to i32*
+ store i32 %or28.i.i, i32* %229, align 4, !tbaa !3
+ %add.ptr17.sum34.i.i = add i32 %add26.i.i, %add.ptr4.sum.i49.i
+ %add.ptr30.i52.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum34.i.i
+ %prev_foot.i53.i = bitcast i8* %add.ptr30.i52.i to i32*
+ store i32 %add26.i.i, i32* %prev_foot.i53.i, align 4, !tbaa !3
+ br label %prepend_alloc.exit.i
+
+if.else31.i.i: ; preds = %if.else.i.i
+ %add.ptr16.sum.i.i = add i32 %tsize.290.i, 4
+ %add.ptr224.sum132.i = add i32 %add.ptr16.sum.i.i, %cond15.i.i
+ %head32.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum132.i
+ %230 = bitcast i8* %head32.i.i to i32*
+ %231 = load i32* %230, align 4, !tbaa !3
+ %and33.i.i = and i32 %231, 3
+ %cmp34.i.i = icmp eq i32 %and33.i.i, 1
+ br i1 %cmp34.i.i, label %if.then35.i.i, label %if.end207.i.i
+
+if.then35.i.i: ; preds = %if.else31.i.i
+ %and37.i.i = and i32 %231, -8
+ %shr.i54.i = lshr i32 %231, 3
+ %cmp38.i.i = icmp ult i32 %231, 256
+ br i1 %cmp38.i.i, label %if.then39.i.i, label %if.else73.i.i
+
+if.then39.i.i: ; preds = %if.then35.i.i
+ %add.ptr16.sum3031.i.i = or i32 %cond15.i.i, 8
+ %add.ptr224.sum142.i = add i32 %add.ptr16.sum3031.i.i, %tsize.290.i
+ %fd.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum142.i
+ %232 = bitcast i8* %fd.i.i to %struct.malloc_chunk**
+ %233 = load %struct.malloc_chunk** %232, align 4, !tbaa !0
+ %add.ptr16.sum32.i.i = add i32 %tsize.290.i, 12
+ %add.ptr224.sum143.i = add i32 %add.ptr16.sum32.i.i, %cond15.i.i
+ %bk.i55.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum143.i
+ %234 = bitcast i8* %bk.i55.i to %struct.malloc_chunk**
+ %235 = load %struct.malloc_chunk** %234, align 4, !tbaa !0
+ %shl.i56.i = shl nuw nsw i32 %shr.i54.i, 1
+ %arrayidx.i57.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i56.i
+ %236 = bitcast %struct.malloc_chunk** %arrayidx.i57.i to %struct.malloc_chunk*
+ %cmp41.i.i = icmp eq %struct.malloc_chunk* %233, %236
+ br i1 %cmp41.i.i, label %if.then45.i.i, label %lor.rhs.i.i
+
+lor.rhs.i.i: ; preds = %if.then39.i.i
+ %237 = bitcast %struct.malloc_chunk* %233 to i8*
+ %238 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp42.i.i = icmp ult i8* %237, %238
+ br i1 %cmp42.i.i, label %if.else71.i.i, label %land.rhs.i58.i
+
+land.rhs.i58.i: ; preds = %lor.rhs.i.i
+ %bk43.i.i = getelementptr inbounds %struct.malloc_chunk* %233, i32 0, i32 3
+ %239 = load %struct.malloc_chunk** %bk43.i.i, align 4, !tbaa !0
+ %cmp44.i.i = icmp eq %struct.malloc_chunk* %239, %221
+ br i1 %cmp44.i.i, label %if.then45.i.i, label %if.else71.i.i, !prof !5
+
+if.then45.i.i: ; preds = %land.rhs.i58.i, %if.then39.i.i
+ %cmp46.i59.i = icmp eq %struct.malloc_chunk* %235, %233
+ br i1 %cmp46.i59.i, label %if.then47.i.i, label %if.else50.i60.i
+
+if.then47.i.i: ; preds = %if.then45.i.i
+ %shl48.i.i = shl i32 1, %shr.i54.i
+ %neg.i.i = xor i32 %shl48.i.i, -1
+ %240 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and49.i.i = and i32 %240, %neg.i.i
+ store i32 %and49.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end204.i.i
+
+if.else50.i60.i: ; preds = %if.then45.i.i
+ %cmp54.i.i = icmp eq %struct.malloc_chunk* %235, %236
+ br i1 %cmp54.i.i, label %if.else50.if.then66_crit_edge.i.i, label %lor.rhs55.i.i
+
+if.else50.if.then66_crit_edge.i.i: ; preds = %if.else50.i60.i
+ %fd68.pre.i.i = getelementptr inbounds %struct.malloc_chunk* %235, i32 0, i32 2
+ br label %if.then66.i.i
+
+lor.rhs55.i.i: ; preds = %if.else50.i60.i
+ %241 = bitcast %struct.malloc_chunk* %235 to i8*
+ %242 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp57.i.i = icmp ult i8* %241, %242
+ br i1 %cmp57.i.i, label %if.else69.i.i, label %land.rhs58.i.i
+
+land.rhs58.i.i: ; preds = %lor.rhs55.i.i
+ %fd59.i.i = getelementptr inbounds %struct.malloc_chunk* %235, i32 0, i32 2
+ %243 = load %struct.malloc_chunk** %fd59.i.i, align 4, !tbaa !0
+ %cmp60.i.i = icmp eq %struct.malloc_chunk* %243, %221
+ br i1 %cmp60.i.i, label %if.then66.i.i, label %if.else69.i.i, !prof !5
+
+if.then66.i.i: ; preds = %land.rhs58.i.i, %if.else50.if.then66_crit_edge.i.i
+ %fd68.pre-phi.i.i = phi %struct.malloc_chunk** [ %fd68.pre.i.i, %if.else50.if.then66_crit_edge.i.i ], [ %fd59.i.i, %land.rhs58.i.i ]
+ %bk67.i.i = getelementptr inbounds %struct.malloc_chunk* %233, i32 0, i32 3
+ store %struct.malloc_chunk* %235, %struct.malloc_chunk** %bk67.i.i, align 4, !tbaa !0
+ store %struct.malloc_chunk* %233, %struct.malloc_chunk** %fd68.pre-phi.i.i, align 4, !tbaa !0
+ br label %if.end204.i.i
+
+if.else69.i.i: ; preds = %land.rhs58.i.i, %lor.rhs55.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else71.i.i: ; preds = %land.rhs.i58.i, %lor.rhs.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else73.i.i: ; preds = %if.then35.i.i
+ %244 = bitcast i8* %add.ptr16.i.i to %struct.malloc_tree_chunk*
+ %add.ptr16.sum23.i.i = or i32 %cond15.i.i, 24
+ %add.ptr224.sum133.i = add i32 %add.ptr16.sum23.i.i, %tsize.290.i
+ %parent.i61.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum133.i
+ %245 = bitcast i8* %parent.i61.i to %struct.malloc_tree_chunk**
+ %246 = load %struct.malloc_tree_chunk** %245, align 4, !tbaa !0
+ %add.ptr16.sum4.i.i = add i32 %tsize.290.i, 12
+ %add.ptr224.sum134.i = add i32 %add.ptr16.sum4.i.i, %cond15.i.i
+ %bk74.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum134.i
+ %247 = bitcast i8* %bk74.i.i to %struct.malloc_tree_chunk**
+ %248 = load %struct.malloc_tree_chunk** %247, align 4, !tbaa !0
+ %cmp75.i.i = icmp eq %struct.malloc_tree_chunk* %248, %244
+ br i1 %cmp75.i.i, label %if.else95.i.i, label %if.then76.i.i
+
+if.then76.i.i: ; preds = %if.else73.i.i
+ %add.ptr16.sum2829.i.i = or i32 %cond15.i.i, 8
+ %add.ptr224.sum135.i = add i32 %add.ptr16.sum2829.i.i, %tsize.290.i
+ %fd78.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum135.i
+ %249 = bitcast i8* %fd78.i.i to %struct.malloc_tree_chunk**
+ %250 = load %struct.malloc_tree_chunk** %249, align 4, !tbaa !0
+ %251 = bitcast %struct.malloc_tree_chunk* %250 to i8*
+ %252 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp81.i.i = icmp ult i8* %251, %252
+ br i1 %cmp81.i.i, label %if.else93.i.i, label %land.lhs.true.i62.i
+
+land.lhs.true.i62.i: ; preds = %if.then76.i.i
+ %bk82.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %250, i32 0, i32 3
+ %253 = load %struct.malloc_tree_chunk** %bk82.i.i, align 4, !tbaa !0
+ %cmp83.i.i = icmp eq %struct.malloc_tree_chunk* %253, %244
+ br i1 %cmp83.i.i, label %land.rhs84.i.i, label %if.else93.i.i
+
+land.rhs84.i.i: ; preds = %land.lhs.true.i62.i
+ %fd85.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %248, i32 0, i32 2
+ %254 = load %struct.malloc_tree_chunk** %fd85.i.i, align 4, !tbaa !0
+ %cmp86.i.i = icmp eq %struct.malloc_tree_chunk* %254, %244
+ br i1 %cmp86.i.i, label %if.then90.i.i, label %if.else93.i.i, !prof !5
+
+if.then90.i.i: ; preds = %land.rhs84.i.i
+ store %struct.malloc_tree_chunk* %248, %struct.malloc_tree_chunk** %bk82.i.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %250, %struct.malloc_tree_chunk** %fd85.i.i, align 4, !tbaa !0
+ br label %if.end119.i.i
+
+if.else93.i.i: ; preds = %land.rhs84.i.i, %land.lhs.true.i62.i, %if.then76.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else95.i.i: ; preds = %if.else73.i.i
+ %add.ptr16.sum56.i.i = or i32 %cond15.i.i, 16
+ %add.ptr224.sum140.i = add i32 %add.ptr16.sum.i.i, %add.ptr16.sum56.i.i
+ %arrayidx96.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum140.i
+ %255 = bitcast i8* %arrayidx96.i.i to %struct.malloc_tree_chunk**
+ %256 = load %struct.malloc_tree_chunk** %255, align 4, !tbaa !0
+ %cmp97.i.i = icmp eq %struct.malloc_tree_chunk* %256, null
+ br i1 %cmp97.i.i, label %lor.lhs.false.i.i, label %while.cond.i.i
+
+lor.lhs.false.i.i: ; preds = %if.else95.i.i
+ %add.ptr224.sum141.i = add i32 %add.ptr16.sum56.i.i, %tsize.290.i
+ %child.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum141.i
+ %arrayidx99.i.i = bitcast i8* %child.i.i to %struct.malloc_tree_chunk**
+ %257 = load %struct.malloc_tree_chunk** %arrayidx99.i.i, align 4, !tbaa !0
+ %cmp100.i.i = icmp eq %struct.malloc_tree_chunk* %257, null
+ br i1 %cmp100.i.i, label %if.end119.i.i, label %while.cond.i.i
+
+while.cond.i.i: ; preds = %lor.rhs105.i.i, %while.cond.i.i, %lor.lhs.false.i.i, %if.else95.i.i
+ %RP.0.i.i = phi %struct.malloc_tree_chunk** [ %arrayidx99.i.i, %lor.lhs.false.i.i ], [ %255, %if.else95.i.i ], [ %arrayidx103.i.i, %while.cond.i.i ], [ %arrayidx107.i.i, %lor.rhs105.i.i ]
+ %R.0.i.i = phi %struct.malloc_tree_chunk* [ %257, %lor.lhs.false.i.i ], [ %256, %if.else95.i.i ], [ %258, %while.cond.i.i ], [ %259, %lor.rhs105.i.i ]
+ %arrayidx103.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 1
+ %258 = load %struct.malloc_tree_chunk** %arrayidx103.i.i, align 4, !tbaa !0
+ %cmp104.i.i = icmp eq %struct.malloc_tree_chunk* %258, null
+ br i1 %cmp104.i.i, label %lor.rhs105.i.i, label %while.cond.i.i
+
+lor.rhs105.i.i: ; preds = %while.cond.i.i
+ %arrayidx107.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 0
+ %259 = load %struct.malloc_tree_chunk** %arrayidx107.i.i, align 4, !tbaa !0
+ %cmp108.i.i = icmp eq %struct.malloc_tree_chunk* %259, null
+ br i1 %cmp108.i.i, label %while.end.i.i, label %while.cond.i.i
+
+while.end.i.i: ; preds = %lor.rhs105.i.i
+ %260 = bitcast %struct.malloc_tree_chunk** %RP.0.i.i to i8*
+ %261 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp112.i.i = icmp ult i8* %260, %261
+ br i1 %cmp112.i.i, label %if.else116.i.i, label %if.then115.i.i, !prof !6
+
+if.then115.i.i: ; preds = %while.end.i.i
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i.i, align 4, !tbaa !0
+ br label %if.end119.i.i
+
+if.else116.i.i: ; preds = %while.end.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end119.i.i: ; preds = %if.then115.i.i, %lor.lhs.false.i.i, %if.then90.i.i
+ %R.1.i.i = phi %struct.malloc_tree_chunk* [ %248, %if.then90.i.i ], [ %R.0.i.i, %if.then115.i.i ], [ null, %lor.lhs.false.i.i ]
+ %cmp120.i63.i = icmp eq %struct.malloc_tree_chunk* %246, null
+ br i1 %cmp120.i63.i, label %if.end204.i.i, label %if.then122.i65.i
+
+if.then122.i65.i: ; preds = %if.end119.i.i
+ %add.ptr16.sum25.i.i = add i32 %tsize.290.i, 28
+ %add.ptr224.sum136.i = add i32 %add.ptr16.sum25.i.i, %cond15.i.i
+ %index.i64.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum136.i
+ %262 = bitcast i8* %index.i64.i to i32*
+ %263 = load i32* %262, align 4, !tbaa !3
+ %arrayidx123.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %263
+ %264 = load %struct.malloc_tree_chunk** %arrayidx123.i.i, align 4, !tbaa !0
+ %cmp124.i.i = icmp eq %struct.malloc_tree_chunk* %244, %264
+ br i1 %cmp124.i.i, label %if.then126.i.i, label %if.else135.i.i
+
+if.then126.i.i: ; preds = %if.then122.i65.i
+ store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx123.i.i, align 4, !tbaa !0
+ %cond37.i.i = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null
+ br i1 %cond37.i.i, label %if.end155.thread.i.i, label %if.then158.i.i
+
+if.end155.thread.i.i: ; preds = %if.then126.i.i
+ %shl131.i.i = shl i32 1, %263
+ %neg132.i.i = xor i32 %shl131.i.i, -1
+ %265 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and133.i.i = and i32 %265, %neg132.i.i
+ store i32 %and133.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end204.i.i
+
+if.else135.i.i: ; preds = %if.then122.i65.i
+ %266 = bitcast %struct.malloc_tree_chunk* %246 to i8*
+ %267 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp137.i.i = icmp ult i8* %266, %267
+ br i1 %cmp137.i.i, label %if.else153.i.i, label %if.then141.i.i, !prof !6
+
+if.then141.i.i: ; preds = %if.else135.i.i
+ %arrayidx143.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %246, i32 0, i32 4, i32 0
+ %268 = load %struct.malloc_tree_chunk** %arrayidx143.i.i, align 4, !tbaa !0
+ %cmp144.i.i = icmp eq %struct.malloc_tree_chunk* %268, %244
+ br i1 %cmp144.i.i, label %if.then146.i.i, label %if.else149.i.i
+
+if.then146.i.i: ; preds = %if.then141.i.i
+ store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx143.i.i, align 4, !tbaa !0
+ br label %if.end155.i.i
+
+if.else149.i.i: ; preds = %if.then141.i.i
+ %arrayidx151.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %246, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx151.i.i, align 4, !tbaa !0
+ br label %if.end155.i.i
+
+if.else153.i.i: ; preds = %if.else135.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end155.i.i: ; preds = %if.else149.i.i, %if.then146.i.i
+ %cmp156.i.i = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null
+ br i1 %cmp156.i.i, label %if.end204.i.i, label %if.then158.i.i
+
+if.then158.i.i: ; preds = %if.end155.i.i, %if.then126.i.i
+ %269 = bitcast %struct.malloc_tree_chunk* %R.1.i.i to i8*
+ %270 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp160.i.i = icmp ult i8* %269, %270
+ br i1 %cmp160.i.i, label %if.else200.i.i, label %if.then164.i.i, !prof !6
+
+if.then164.i.i: ; preds = %if.then158.i.i
+ %parent165.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %246, %struct.malloc_tree_chunk** %parent165.i.i, align 4, !tbaa !0
+ %add.ptr16.sum2627.i.i = or i32 %cond15.i.i, 16
+ %add.ptr224.sum137.i = add i32 %add.ptr16.sum2627.i.i, %tsize.290.i
+ %child166.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum137.i
+ %arrayidx167.i.i = bitcast i8* %child166.i.i to %struct.malloc_tree_chunk**
+ %271 = load %struct.malloc_tree_chunk** %arrayidx167.i.i, align 4, !tbaa !0
+ %cmp168.i.i = icmp eq %struct.malloc_tree_chunk* %271, null
+ br i1 %cmp168.i.i, label %if.end182.i.i, label %if.then170.i.i
+
+if.then170.i.i: ; preds = %if.then164.i.i
+ %272 = bitcast %struct.malloc_tree_chunk* %271 to i8*
+ %273 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp172.i.i = icmp ult i8* %272, %273
+ br i1 %cmp172.i.i, label %if.else180.i.i, label %if.then176.i.i, !prof !6
+
+if.then176.i.i: ; preds = %if.then170.i.i
+ %arrayidx178.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %271, %struct.malloc_tree_chunk** %arrayidx178.i.i, align 4, !tbaa !0
+ %parent179.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %271, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %parent179.i.i, align 4, !tbaa !0
+ br label %if.end182.i.i
+
+if.else180.i.i: ; preds = %if.then170.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end182.i.i: ; preds = %if.then176.i.i, %if.then164.i.i
+ %add.ptr224.sum138.i = add i32 %add.ptr16.sum.i.i, %add.ptr16.sum2627.i.i
+ %arrayidx184.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum138.i
+ %274 = bitcast i8* %arrayidx184.i.i to %struct.malloc_tree_chunk**
+ %275 = load %struct.malloc_tree_chunk** %274, align 4, !tbaa !0
+ %cmp185.i.i = icmp eq %struct.malloc_tree_chunk* %275, null
+ br i1 %cmp185.i.i, label %if.end204.i.i, label %if.then187.i.i
+
+if.then187.i.i: ; preds = %if.end182.i.i
+ %276 = bitcast %struct.malloc_tree_chunk* %275 to i8*
+ %277 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp189.i.i = icmp ult i8* %276, %277
+ br i1 %cmp189.i.i, label %if.else197.i.i, label %if.then193.i.i, !prof !6
+
+if.then193.i.i: ; preds = %if.then187.i.i
+ %arrayidx195.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %275, %struct.malloc_tree_chunk** %arrayidx195.i.i, align 4, !tbaa !0
+ %parent196.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %275, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %parent196.i.i, align 4, !tbaa !0
+ br label %if.end204.i.i
+
+if.else197.i.i: ; preds = %if.then187.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else200.i.i: ; preds = %if.then158.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end204.i.i: ; preds = %if.then193.i.i, %if.end182.i.i, %if.end155.i.i, %if.end155.thread.i.i, %if.end119.i.i, %if.then66.i.i, %if.then47.i.i
+ %add.ptr16.sum7.i.i = or i32 %and37.i.i, %cond15.i.i
+ %add.ptr224.sum139.i = add i32 %add.ptr16.sum7.i.i, %tsize.290.i
+ %add.ptr205.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum139.i
+ %278 = bitcast i8* %add.ptr205.i.i to %struct.malloc_chunk*
+ %add206.i.i = add i32 %and37.i.i, %sub18.i.i
+ br label %if.end207.i.i
+
+if.end207.i.i: ; preds = %if.end204.i.i, %if.else31.i.i
+ %qsize.0.i.i = phi i32 [ %sub18.i.i, %if.else31.i.i ], [ %add206.i.i, %if.end204.i.i ]
+ %oldfirst.0.i.i = phi %struct.malloc_chunk* [ %221, %if.else31.i.i ], [ %278, %if.end204.i.i ]
+ %head208.i.i = getelementptr inbounds %struct.malloc_chunk* %oldfirst.0.i.i, i32 0, i32 1
+ %279 = load i32* %head208.i.i, align 4, !tbaa !3
+ %and209.i.i = and i32 %279, -2
+ store i32 %and209.i.i, i32* %head208.i.i, align 4, !tbaa !3
+ %or210.i.i = or i32 %qsize.0.i.i, 1
+ %add.ptr17.sum.i.i = add i32 %add.ptr4.sum.i49.i, 4
+ %head211.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum.i.i
+ %280 = bitcast i8* %head211.i.i to i32*
+ store i32 %or210.i.i, i32* %280, align 4, !tbaa !3
+ %add.ptr17.sum8.i.i = add i32 %qsize.0.i.i, %add.ptr4.sum.i49.i
+ %add.ptr212.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum8.i.i
+ %prev_foot213.i.i = bitcast i8* %add.ptr212.i.i to i32*
+ store i32 %qsize.0.i.i, i32* %prev_foot213.i.i, align 4, !tbaa !3
+ %shr214.i.i = lshr i32 %qsize.0.i.i, 3
+ %cmp215.i.i = icmp ult i32 %qsize.0.i.i, 256
+ br i1 %cmp215.i.i, label %if.then217.i.i, label %if.else249.i.i
+
+if.then217.i.i: ; preds = %if.end207.i.i
+ %shl221.i.i = shl nuw nsw i32 %shr214.i.i, 1
+ %arrayidx223.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl221.i.i
+ %281 = bitcast %struct.malloc_chunk** %arrayidx223.i.i to %struct.malloc_chunk*
+ %282 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl226.i.i = shl i32 1, %shr214.i.i
+ %and227.i.i = and i32 %282, %shl226.i.i
+ %tobool228.i.i = icmp eq i32 %and227.i.i, 0
+ br i1 %tobool228.i.i, label %if.then229.i.i, label %if.else233.i.i
+
+if.then229.i.i: ; preds = %if.then217.i.i
+ %or232.i.i = or i32 %282, %shl226.i.i
+ store i32 %or232.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx223.sum.pre.i.i = add i32 %shl221.i.i, 2
+ %.pre.i66.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx223.sum.pre.i.i
+ br label %if.end244.i.i
+
+if.else233.i.i: ; preds = %if.then217.i.i
+ %arrayidx223.sum24.i.i = add i32 %shl221.i.i, 2
+ %283 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx223.sum24.i.i
+ %284 = load %struct.malloc_chunk** %283, align 4, !tbaa !0
+ %285 = bitcast %struct.malloc_chunk* %284 to i8*
+ %286 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp236.i.i = icmp ult i8* %285, %286
+ br i1 %cmp236.i.i, label %if.else242.i.i, label %if.end244.i.i, !prof !6
+
+if.else242.i.i: ; preds = %if.else233.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end244.i.i: ; preds = %if.else233.i.i, %if.then229.i.i
+ %.pre-phi.i67.i = phi %struct.malloc_chunk** [ %283, %if.else233.i.i ], [ %.pre.i66.i, %if.then229.i.i ]
+ %F224.0.i.i = phi %struct.malloc_chunk* [ %284, %if.else233.i.i ], [ %281, %if.then229.i.i ]
+ store %struct.malloc_chunk* %222, %struct.malloc_chunk** %.pre-phi.i67.i, align 4, !tbaa !0
+ %bk246.i.i = getelementptr inbounds %struct.malloc_chunk* %F224.0.i.i, i32 0, i32 3
+ store %struct.malloc_chunk* %222, %struct.malloc_chunk** %bk246.i.i, align 4, !tbaa !0
+ %add.ptr17.sum22.i.i = add i32 %add.ptr4.sum.i49.i, 8
+ %fd247.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum22.i.i
+ %287 = bitcast i8* %fd247.i.i to %struct.malloc_chunk**
+ store %struct.malloc_chunk* %F224.0.i.i, %struct.malloc_chunk** %287, align 4, !tbaa !0
+ %add.ptr17.sum23.i.i = add i32 %add.ptr4.sum.i49.i, 12
+ %bk248.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum23.i.i
+ %288 = bitcast i8* %bk248.i.i to %struct.malloc_chunk**
+ store %struct.malloc_chunk* %281, %struct.malloc_chunk** %288, align 4, !tbaa !0
+ br label %prepend_alloc.exit.i
+
+if.else249.i.i: ; preds = %if.end207.i.i
+ %289 = bitcast i8* %add.ptr17.i.i to %struct.malloc_tree_chunk*
+ %shr253.i.i = lshr i32 %qsize.0.i.i, 8
+ %cmp254.i.i = icmp eq i32 %shr253.i.i, 0
+ br i1 %cmp254.i.i, label %if.end285.i.i, label %if.else257.i.i
+
+if.else257.i.i: ; preds = %if.else249.i.i
+ %cmp258.i.i = icmp ugt i32 %qsize.0.i.i, 16777215
+ br i1 %cmp258.i.i, label %if.end285.i.i, label %if.else261.i.i
+
+if.else261.i.i: ; preds = %if.else257.i.i
+ %sub262.i.i = add i32 %shr253.i.i, 1048320
+ %shr263.i.i = lshr i32 %sub262.i.i, 16
+ %and264.i.i = and i32 %shr263.i.i, 8
+ %shl265.i.i = shl i32 %shr253.i.i, %and264.i.i
+ %sub266.i.i = add i32 %shl265.i.i, 520192
+ %shr267.i.i = lshr i32 %sub266.i.i, 16
+ %and268.i.i = and i32 %shr267.i.i, 4
+ %add269.i.i = or i32 %and268.i.i, %and264.i.i
+ %shl270.i.i = shl i32 %shl265.i.i, %and268.i.i
+ %sub271.i.i = add i32 %shl270.i.i, 245760
+ %shr272.i.i = lshr i32 %sub271.i.i, 16
+ %and273.i.i = and i32 %shr272.i.i, 2
+ %add274.i.i = or i32 %add269.i.i, %and273.i.i
+ %sub275.i.i = sub i32 14, %add274.i.i
+ %shl276.i.i = shl i32 %shl270.i.i, %and273.i.i
+ %shr277.i.i = lshr i32 %shl276.i.i, 15
+ %add278.i.i = add i32 %sub275.i.i, %shr277.i.i
+ %shl279.i.i = shl nsw i32 %add278.i.i, 1
+ %add280.i.i = add i32 %add278.i.i, 7
+ %shr281.i.i = lshr i32 %qsize.0.i.i, %add280.i.i
+ %and282.i.i = and i32 %shr281.i.i, 1
+ %add283.i.i = or i32 %and282.i.i, %shl279.i.i
+ br label %if.end285.i.i
+
+if.end285.i.i: ; preds = %if.else261.i.i, %if.else257.i.i, %if.else249.i.i
+ %I252.0.i.i = phi i32 [ %add283.i.i, %if.else261.i.i ], [ 0, %if.else249.i.i ], [ 31, %if.else257.i.i ]
+ %arrayidx287.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I252.0.i.i
+ %add.ptr17.sum9.i.i = add i32 %add.ptr4.sum.i49.i, 28
+ %index288.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum9.i.i
+ %290 = bitcast i8* %index288.i.i to i32*
+ store i32 %I252.0.i.i, i32* %290, align 4, !tbaa !3
+ %add.ptr17.sum10.i.i = add i32 %add.ptr4.sum.i49.i, 16
+ %child289.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum10.i.i
+ %child289.sum.i.i = add i32 %add.ptr4.sum.i49.i, 20
+ %arrayidx290.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %child289.sum.i.i
+ %291 = bitcast i8* %arrayidx290.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %291, align 4, !tbaa !0
+ %arrayidx292.i.i = bitcast i8* %child289.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %arrayidx292.i.i, align 4, !tbaa !0
+ %292 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %shl294.i.i = shl i32 1, %I252.0.i.i
+ %and295.i.i = and i32 %292, %shl294.i.i
+ %tobool296.i.i = icmp eq i32 %and295.i.i, 0
+ br i1 %tobool296.i.i, label %if.then297.i.i, label %if.else304.i.i
+
+if.then297.i.i: ; preds = %if.end285.i.i
+ %or300.i.i = or i32 %292, %shl294.i.i
+ store i32 %or300.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %arrayidx287.i.i, align 4, !tbaa !0
+ %293 = bitcast %struct.malloc_tree_chunk** %arrayidx287.i.i to %struct.malloc_tree_chunk*
+ %add.ptr17.sum11.i.i = add i32 %add.ptr4.sum.i49.i, 24
+ %parent301.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum11.i.i
+ %294 = bitcast i8* %parent301.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %293, %struct.malloc_tree_chunk** %294, align 4, !tbaa !0
+ %add.ptr17.sum12.i.i = add i32 %add.ptr4.sum.i49.i, 12
+ %bk302.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum12.i.i
+ %295 = bitcast i8* %bk302.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %295, align 4, !tbaa !0
+ %add.ptr17.sum13.i.i = add i32 %add.ptr4.sum.i49.i, 8
+ %fd303.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum13.i.i
+ %296 = bitcast i8* %fd303.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %296, align 4, !tbaa !0
+ br label %prepend_alloc.exit.i
+
+if.else304.i.i: ; preds = %if.end285.i.i
+ %297 = load %struct.malloc_tree_chunk** %arrayidx287.i.i, align 4, !tbaa !0
+ %cmp306.i.i = icmp eq i32 %I252.0.i.i, 31
+ br i1 %cmp306.i.i, label %cond.end314.i.i, label %cond.false309.i.i
+
+cond.false309.i.i: ; preds = %if.else304.i.i
+ %shr310.i.i = lshr i32 %I252.0.i.i, 1
+ %sub313.i.i = sub i32 25, %shr310.i.i
+ br label %cond.end314.i.i
+
+cond.end314.i.i: ; preds = %cond.false309.i.i, %if.else304.i.i
+ %cond315.i.i = phi i32 [ %sub313.i.i, %cond.false309.i.i ], [ 0, %if.else304.i.i ]
+ %head31739.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %297, i32 0, i32 1
+ %298 = load i32* %head31739.i.i, align 4, !tbaa !3
+ %and31840.i.i = and i32 %298, -8
+ %cmp31941.i.i = icmp eq i32 %and31840.i.i, %qsize.0.i.i
+ br i1 %cmp31941.i.i, label %if.else342.i.i, label %if.then321.lr.ph.i.i
+
+if.then321.lr.ph.i.i: ; preds = %cond.end314.i.i
+ %shl316.i.i = shl i32 %qsize.0.i.i, %cond315.i.i
+ br label %if.then321.i.i
+
+for.cond.i68.i: ; preds = %if.then321.i.i
+ %shl326.i.i = shl i32 %K305.043.i.i, 1
+ %head317.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %300, i32 0, i32 1
+ %299 = load i32* %head317.i.i, align 4, !tbaa !3
+ %and318.i.i = and i32 %299, -8
+ %cmp319.i.i = icmp eq i32 %and318.i.i, %qsize.0.i.i
+ br i1 %cmp319.i.i, label %if.else342.i.i, label %if.then321.i.i
+
+if.then321.i.i: ; preds = %for.cond.i68.i, %if.then321.lr.ph.i.i
+ %K305.043.i.i = phi i32 [ %shl316.i.i, %if.then321.lr.ph.i.i ], [ %shl326.i.i, %for.cond.i68.i ]
+ %T.042.i.i = phi %struct.malloc_tree_chunk* [ %297, %if.then321.lr.ph.i.i ], [ %300, %for.cond.i68.i ]
+ %shr322.i.i = lshr i32 %K305.043.i.i, 31
+ %arrayidx325.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.042.i.i, i32 0, i32 4, i32 %shr322.i.i
+ %300 = load %struct.malloc_tree_chunk** %arrayidx325.i.i, align 4, !tbaa !0
+ %cmp327.i.i = icmp eq %struct.malloc_tree_chunk* %300, null
+ br i1 %cmp327.i.i, label %if.else330.i.i, label %for.cond.i68.i
+
+if.else330.i.i: ; preds = %if.then321.i.i
+ %301 = bitcast %struct.malloc_tree_chunk** %arrayidx325.i.i to i8*
+ %302 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp332.i.i = icmp ult i8* %301, %302
+ br i1 %cmp332.i.i, label %if.else340.i.i, label %if.then336.i.i, !prof !6
+
+if.then336.i.i: ; preds = %if.else330.i.i
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %arrayidx325.i.i, align 4, !tbaa !0
+ %add.ptr17.sum19.i.i = add i32 %add.ptr4.sum.i49.i, 24
+ %parent337.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum19.i.i
+ %303 = bitcast i8* %parent337.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %T.042.i.i, %struct.malloc_tree_chunk** %303, align 4, !tbaa !0
+ %add.ptr17.sum20.i.i = add i32 %add.ptr4.sum.i49.i, 12
+ %bk338.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum20.i.i
+ %304 = bitcast i8* %bk338.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %304, align 4, !tbaa !0
+ %add.ptr17.sum21.i.i = add i32 %add.ptr4.sum.i49.i, 8
+ %fd339.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum21.i.i
+ %305 = bitcast i8* %fd339.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %305, align 4, !tbaa !0
+ br label %prepend_alloc.exit.i
+
+if.else340.i.i: ; preds = %if.else330.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else342.i.i: ; preds = %for.cond.i68.i, %cond.end314.i.i
+ %T.0.lcssa.i69.i = phi %struct.malloc_tree_chunk* [ %297, %cond.end314.i.i ], [ %300, %for.cond.i68.i ]
+ %fd344.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i69.i, i32 0, i32 2
+ %306 = load %struct.malloc_tree_chunk** %fd344.i.i, align 4, !tbaa !0
+ %307 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i69.i to i8*
+ %308 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp346.i.i = icmp ult i8* %307, %308
+ br i1 %cmp346.i.i, label %if.else362.i.i, label %land.rhs348.i.i
+
+land.rhs348.i.i: ; preds = %if.else342.i.i
+ %309 = bitcast %struct.malloc_tree_chunk* %306 to i8*
+ %cmp350.i.i = icmp ult i8* %309, %308
+ br i1 %cmp350.i.i, label %if.else362.i.i, label %if.then356.i.i, !prof !6
+
+if.then356.i.i: ; preds = %land.rhs348.i.i
+ %bk357.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %306, i32 0, i32 3
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %bk357.i.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %fd344.i.i, align 4, !tbaa !0
+ %add.ptr17.sum16.i.i = add i32 %add.ptr4.sum.i49.i, 8
+ %fd359.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum16.i.i
+ %310 = bitcast i8* %fd359.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %306, %struct.malloc_tree_chunk** %310, align 4, !tbaa !0
+ %add.ptr17.sum17.i.i = add i32 %add.ptr4.sum.i49.i, 12
+ %bk360.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum17.i.i
+ %311 = bitcast i8* %bk360.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* %T.0.lcssa.i69.i, %struct.malloc_tree_chunk** %311, align 4, !tbaa !0
+ %add.ptr17.sum18.i.i = add i32 %add.ptr4.sum.i49.i, 24
+ %parent361.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum18.i.i
+ %312 = bitcast i8* %parent361.i.i to %struct.malloc_tree_chunk**
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %312, align 4, !tbaa !0
+ br label %prepend_alloc.exit.i
+
+if.else362.i.i: ; preds = %land.rhs348.i.i, %if.else342.i.i
+ tail call void @abort() #6
+ unreachable
+
+prepend_alloc.exit.i: ; preds = %if.then356.i.i, %if.then336.i.i, %if.then297.i.i, %if.end244.i.i, %if.then25.i.i, %if.then.i51.i
+ %add.ptr4.sum1415.i.i = or i32 %cond.i42.i, 8
+ %add.ptr368.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum1415.i.i
+ br label %postaction
+
+if.else245.i: ; preds = %land.lhs.true231.i, %while.body227.i
+ %313 = bitcast %struct.malloc_chunk* %188 to i8*
+ br label %for.cond.i.i.i
+
+for.cond.i.i.i: ; preds = %if.end.i.i.i, %if.else245.i
+ %sp.0.i.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.else245.i ], [ %316, %if.end.i.i.i ]
+ %base.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 0
+ %314 = load i8** %base.i.i.i, align 4, !tbaa !0
+ %cmp.i.i.i = icmp ugt i8* %314, %313
+ br i1 %cmp.i.i.i, label %if.end.i.i.i, label %land.lhs.true.i.i.i
+
+land.lhs.true.i.i.i: ; preds = %for.cond.i.i.i
+ %size.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 1
+ %315 = load i32* %size.i.i.i, align 4, !tbaa !3
+ %add.ptr.i.i.i = getelementptr inbounds i8* %314, i32 %315
+ %cmp2.i.i.i = icmp ugt i8* %add.ptr.i.i.i, %313
+ br i1 %cmp2.i.i.i, label %segment_holding.exit.i.i, label %if.end.i.i.i
+
+if.end.i.i.i: ; preds = %land.lhs.true.i.i.i, %for.cond.i.i.i
+ %next.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 2
+ %316 = load %struct.malloc_segment** %next.i.i.i, align 4, !tbaa !0
+ br label %for.cond.i.i.i
+
+segment_holding.exit.i.i: ; preds = %land.lhs.true.i.i.i
+ %add.ptr.sum.i.i = add i32 %315, -47
+ %add.ptr2.sum.i.i = add i32 %315, -39
+ %add.ptr3.i.i = getelementptr inbounds i8* %314, i32 %add.ptr2.sum.i.i
+ %317 = ptrtoint i8* %add.ptr3.i.i to i32
+ %and.i14.i = and i32 %317, 7
+ %cmp.i15.i = icmp eq i32 %and.i14.i, 0
+ br i1 %cmp.i15.i, label %cond.end.i.i, label %cond.false.i16.i
+
+cond.false.i16.i: ; preds = %segment_holding.exit.i.i
+ %318 = sub i32 0, %317
+ %and6.i.i = and i32 %318, 7
+ br label %cond.end.i.i
+
+cond.end.i.i: ; preds = %cond.false.i16.i, %segment_holding.exit.i.i
+ %cond.i17.i = phi i32 [ %and6.i.i, %cond.false.i16.i ], [ 0, %segment_holding.exit.i.i ]
+ %add.ptr2.sum1.i.i = add i32 %add.ptr.sum.i.i, %cond.i17.i
+ %add.ptr7.i.i = getelementptr inbounds i8* %314, i32 %add.ptr2.sum1.i.i
+ %add.ptr82.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1
+ %add.ptr8.i.i = bitcast %struct.malloc_chunk* %add.ptr82.i.i to i8*
+ %cmp9.i.i = icmp ult i8* %add.ptr7.i.i, %add.ptr8.i.i
+ %cond13.i.i = select i1 %cmp9.i.i, i8* %313, i8* %add.ptr7.i.i
+ %add.ptr14.i.i = getelementptr inbounds i8* %cond13.i.i, i32 8
+ %319 = bitcast i8* %add.ptr14.i.i to %struct.malloc_segment*
+ %sub16.i.i = add i32 %tsize.290.i, -40
+ %add.ptr.i10.i.i = getelementptr inbounds i8* %tbase.291.i, i32 8
+ %320 = ptrtoint i8* %add.ptr.i10.i.i to i32
+ %and.i.i.i = and i32 %320, 7
+ %cmp.i11.i.i = icmp eq i32 %and.i.i.i, 0
+ br i1 %cmp.i11.i.i, label %init_top.exit.i.i, label %cond.false.i.i.i
+
+cond.false.i.i.i: ; preds = %cond.end.i.i
+ %321 = sub i32 0, %320
+ %and3.i.i.i = and i32 %321, 7
+ br label %init_top.exit.i.i
+
+init_top.exit.i.i: ; preds = %cond.false.i.i.i, %cond.end.i.i
+ %cond.i.i.i = phi i32 [ %and3.i.i.i, %cond.false.i.i.i ], [ 0, %cond.end.i.i ]
+ %add.ptr4.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i.i.i
+ %322 = bitcast i8* %add.ptr4.i.i.i to %struct.malloc_chunk*
+ %sub5.i.i.i = sub i32 %sub16.i.i, %cond.i.i.i
+ store %struct.malloc_chunk* %322, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ store i32 %sub5.i.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %or.i.i.i = or i32 %sub5.i.i.i, 1
+ %add.ptr4.sum.i.i.i = add i32 %cond.i.i.i, 4
+ %head.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i.i.i
+ %323 = bitcast i8* %head.i.i.i to i32*
+ store i32 %or.i.i.i, i32* %323, align 4, !tbaa !3
+ %add.ptr6.sum.i.i.i = add i32 %tsize.290.i, -36
+ %head7.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr6.sum.i.i.i
+ %324 = bitcast i8* %head7.i.i.i to i32*
+ store i32 40, i32* %324, align 4, !tbaa !3
+ %325 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 %325, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ %head.i18.i = getelementptr inbounds i8* %cond13.i.i, i32 4
+ %326 = bitcast i8* %head.i18.i to i32*
+ store i32 27, i32* %326, align 4, !tbaa !3
+ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %add.ptr14.i.i, i8* bitcast (%struct.malloc_segment* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16) to i8*), i32 16, i32 4, i1 false) #1, !tbaa.struct !7
+ store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4, !tbaa !0
+ store i32 %tsize.290.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4, !tbaa !3
+ store %struct.malloc_segment* %319, %struct.malloc_segment** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), align 4, !tbaa !0
+ %add.ptr2418.i.i = getelementptr inbounds i8* %cond13.i.i, i32 28
+ %327 = bitcast i8* %add.ptr2418.i.i to i32*
+ store i32 7, i32* %327, align 4, !tbaa !3
+ %328 = getelementptr inbounds i8* %cond13.i.i, i32 32
+ %cmp2719.i.i = icmp ult i8* %328, %add.ptr.i.i.i
+ br i1 %cmp2719.i.i, label %if.then.i19.i, label %for.end.i.i
+
+if.then.i19.i: ; preds = %if.then.i19.i, %init_top.exit.i.i
+ %add.ptr2420.i.i = phi i32* [ %329, %if.then.i19.i ], [ %327, %init_top.exit.i.i ]
+ %329 = getelementptr inbounds i32* %add.ptr2420.i.i, i32 1
+ store i32 7, i32* %329, align 4, !tbaa !3
+ %330 = getelementptr inbounds i32* %add.ptr2420.i.i, i32 2
+ %331 = bitcast i32* %330 to i8*
+ %cmp27.i.i = icmp ult i8* %331, %add.ptr.i.i.i
+ br i1 %cmp27.i.i, label %if.then.i19.i, label %for.end.i.i
+
+for.end.i.i: ; preds = %if.then.i19.i, %init_top.exit.i.i
+ %cmp28.i.i = icmp eq i8* %cond13.i.i, %313
+ br i1 %cmp28.i.i, label %if.end248.i, label %if.then29.i.i
+
+if.then29.i.i: ; preds = %for.end.i.i
+ %sub.ptr.lhs.cast.i.i = ptrtoint i8* %cond13.i.i to i32
+ %sub.ptr.rhs.cast.i.i = ptrtoint %struct.malloc_chunk* %188 to i32
+ %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i
+ %add.ptr30.i.i = getelementptr inbounds i8* %313, i32 %sub.ptr.sub.i.i
+ %add.ptr30.sum.i.i = add i32 %sub.ptr.sub.i.i, 4
+ %head31.i.i = getelementptr inbounds i8* %313, i32 %add.ptr30.sum.i.i
+ %332 = bitcast i8* %head31.i.i to i32*
+ %333 = load i32* %332, align 4, !tbaa !3
+ %and32.i.i = and i32 %333, -2
+ store i32 %and32.i.i, i32* %332, align 4, !tbaa !3
+ %or33.i.i = or i32 %sub.ptr.sub.i.i, 1
+ %head34.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 1
+ store i32 %or33.i.i, i32* %head34.i.i, align 4, !tbaa !3
+ %prev_foot.i.i = bitcast i8* %add.ptr30.i.i to i32*
+ store i32 %sub.ptr.sub.i.i, i32* %prev_foot.i.i, align 4, !tbaa !3
+ %shr.i.i = lshr i32 %sub.ptr.sub.i.i, 3
+ %cmp36.i.i = icmp ult i32 %sub.ptr.sub.i.i, 256
+ br i1 %cmp36.i.i, label %if.then37.i.i, label %if.else56.i.i
+
+if.then37.i.i: ; preds = %if.then29.i.i
+ %shl.i20.i = shl nuw nsw i32 %shr.i.i, 1
+ %arrayidx.i21.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i20.i
+ %334 = bitcast %struct.malloc_chunk** %arrayidx.i21.i to %struct.malloc_chunk*
+ %335 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl39.i.i = shl i32 1, %shr.i.i
+ %and40.i.i = and i32 %335, %shl39.i.i
+ %tobool.i.i = icmp eq i32 %and40.i.i, 0
+ br i1 %tobool.i.i, label %if.then41.i.i, label %if.else45.i.i
+
+if.then41.i.i: ; preds = %if.then37.i.i
+ %or44.i.i = or i32 %335, %shl39.i.i
+ store i32 %or44.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx.sum.pre.i.i = add i32 %shl.i20.i, 2
+ %.pre.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum.pre.i.i
+ br label %if.end52.i.i
+
+if.else45.i.i: ; preds = %if.then37.i.i
+ %arrayidx.sum9.i.i = add i32 %shl.i20.i, 2
+ %336 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum9.i.i
+ %337 = load %struct.malloc_chunk** %336, align 4, !tbaa !0
+ %338 = bitcast %struct.malloc_chunk* %337 to i8*
+ %339 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp46.i.i = icmp ult i8* %338, %339
+ br i1 %cmp46.i.i, label %if.else50.i.i, label %if.end52.i.i, !prof !6
+
+if.else50.i.i: ; preds = %if.else45.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end52.i.i: ; preds = %if.else45.i.i, %if.then41.i.i
+ %.pre-phi.i.i = phi %struct.malloc_chunk** [ %336, %if.else45.i.i ], [ %.pre.i.i, %if.then41.i.i ]
+ %F.0.i.i = phi %struct.malloc_chunk* [ %337, %if.else45.i.i ], [ %334, %if.then41.i.i ]
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %.pre-phi.i.i, align 4, !tbaa !0
+ %bk.i.i = getelementptr inbounds %struct.malloc_chunk* %F.0.i.i, i32 0, i32 3
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk.i.i, align 4, !tbaa !0
+ %fd54.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2
+ store %struct.malloc_chunk* %F.0.i.i, %struct.malloc_chunk** %fd54.i.i, align 4, !tbaa !0
+ %bk55.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3
+ store %struct.malloc_chunk* %334, %struct.malloc_chunk** %bk55.i.i, align 4, !tbaa !0
+ br label %if.end248.i
+
+if.else56.i.i: ; preds = %if.then29.i.i
+ %340 = bitcast %struct.malloc_chunk* %188 to %struct.malloc_tree_chunk*
+ %shr58.i.i = lshr i32 %sub.ptr.sub.i.i, 8
+ %cmp59.i.i = icmp eq i32 %shr58.i.i, 0
+ br i1 %cmp59.i.i, label %if.end90.i.i, label %if.else62.i.i
+
+if.else62.i.i: ; preds = %if.else56.i.i
+ %cmp63.i.i = icmp ugt i32 %sub.ptr.sub.i.i, 16777215
+ br i1 %cmp63.i.i, label %if.end90.i.i, label %if.else66.i.i
+
+if.else66.i.i: ; preds = %if.else62.i.i
+ %sub67.i.i = add i32 %shr58.i.i, 1048320
+ %shr68.i.i = lshr i32 %sub67.i.i, 16
+ %and69.i.i = and i32 %shr68.i.i, 8
+ %shl70.i.i = shl i32 %shr58.i.i, %and69.i.i
+ %sub71.i.i = add i32 %shl70.i.i, 520192
+ %shr72.i.i = lshr i32 %sub71.i.i, 16
+ %and73.i.i = and i32 %shr72.i.i, 4
+ %add74.i.i = or i32 %and73.i.i, %and69.i.i
+ %shl75.i.i = shl i32 %shl70.i.i, %and73.i.i
+ %sub76.i.i = add i32 %shl75.i.i, 245760
+ %shr77.i.i = lshr i32 %sub76.i.i, 16
+ %and78.i.i = and i32 %shr77.i.i, 2
+ %add79.i.i = or i32 %add74.i.i, %and78.i.i
+ %sub80.i.i = sub i32 14, %add79.i.i
+ %shl81.i.i = shl i32 %shl75.i.i, %and78.i.i
+ %shr82.i.i = lshr i32 %shl81.i.i, 15
+ %add83.i.i = add i32 %sub80.i.i, %shr82.i.i
+ %shl84.i.i = shl nsw i32 %add83.i.i, 1
+ %add85.i.i = add i32 %add83.i.i, 7
+ %shr86.i.i = lshr i32 %sub.ptr.sub.i.i, %add85.i.i
+ %and87.i.i = and i32 %shr86.i.i, 1
+ %add88.i.i = or i32 %and87.i.i, %shl84.i.i
+ br label %if.end90.i.i
+
+if.end90.i.i: ; preds = %if.else66.i.i, %if.else62.i.i, %if.else56.i.i
+ %I57.0.i.i = phi i32 [ %add88.i.i, %if.else66.i.i ], [ 0, %if.else56.i.i ], [ 31, %if.else62.i.i ]
+ %arrayidx91.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I57.0.i.i
+ %index.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 3
+ %I57.0.c.i.i = inttoptr i32 %I57.0.i.i to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %I57.0.c.i.i, %struct.malloc_chunk** %index.i.i, align 4, !tbaa !3
+ %arrayidx92.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 1
+ store i32 0, i32* %arrayidx92.i.i, align 4, !tbaa !0
+ %341 = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 0
+ store i32 0, i32* %341, align 4, !tbaa !0
+ %342 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %shl95.i.i = shl i32 1, %I57.0.i.i
+ %and96.i.i = and i32 %342, %shl95.i.i
+ %tobool97.i.i = icmp eq i32 %and96.i.i, 0
+ br i1 %tobool97.i.i, label %if.then98.i.i, label %if.else104.i.i
+
+if.then98.i.i: ; preds = %if.end90.i.i
+ %or101.i.i = or i32 %342, %shl95.i.i
+ store i32 %or101.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %arrayidx91.i.i, align 4, !tbaa !0
+ %parent.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2
+ %.c.i.i = bitcast %struct.malloc_tree_chunk** %arrayidx91.i.i to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c.i.i, %struct.malloc_chunk** %parent.i.i, align 4, !tbaa !0
+ %bk102.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk102.i.i, align 4, !tbaa !0
+ %fd103.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %fd103.i.i, align 4, !tbaa !0
+ br label %if.end248.i
+
+if.else104.i.i: ; preds = %if.end90.i.i
+ %343 = load %struct.malloc_tree_chunk** %arrayidx91.i.i, align 4, !tbaa !0
+ %cmp106.i.i = icmp eq i32 %I57.0.i.i, 31
+ br i1 %cmp106.i.i, label %cond.end114.i.i, label %cond.false109.i.i
+
+cond.false109.i.i: ; preds = %if.else104.i.i
+ %shr110.i.i = lshr i32 %I57.0.i.i, 1
+ %sub113.i.i = sub i32 25, %shr110.i.i
+ br label %cond.end114.i.i
+
+cond.end114.i.i: ; preds = %cond.false109.i.i, %if.else104.i.i
+ %cond115.i.i = phi i32 [ %sub113.i.i, %cond.false109.i.i ], [ 0, %if.else104.i.i ]
+ %head11813.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %343, i32 0, i32 1
+ %344 = load i32* %head11813.i.i, align 4, !tbaa !3
+ %and11914.i.i = and i32 %344, -8
+ %cmp12015.i.i = icmp eq i32 %and11914.i.i, %sub.ptr.sub.i.i
+ br i1 %cmp12015.i.i, label %if.else143.i.i, label %if.then122.lr.ph.i.i
+
+if.then122.lr.ph.i.i: ; preds = %cond.end114.i.i
+ %shl116.i.i = shl i32 %sub.ptr.sub.i.i, %cond115.i.i
+ br label %if.then122.i.i
+
+for.cond117.i.i: ; preds = %if.then122.i.i
+ %shl127.i.i = shl i32 %K105.017.i.i, 1
+ %head118.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %346, i32 0, i32 1
+ %345 = load i32* %head118.i.i, align 4, !tbaa !3
+ %and119.i.i = and i32 %345, -8
+ %cmp120.i.i = icmp eq i32 %and119.i.i, %sub.ptr.sub.i.i
+ br i1 %cmp120.i.i, label %if.else143.i.i, label %if.then122.i.i
+
+if.then122.i.i: ; preds = %for.cond117.i.i, %if.then122.lr.ph.i.i
+ %K105.017.i.i = phi i32 [ %shl116.i.i, %if.then122.lr.ph.i.i ], [ %shl127.i.i, %for.cond117.i.i ]
+ %T.016.i.i = phi %struct.malloc_tree_chunk* [ %343, %if.then122.lr.ph.i.i ], [ %346, %for.cond117.i.i ]
+ %shr123.i.i = lshr i32 %K105.017.i.i, 31
+ %arrayidx126.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.016.i.i, i32 0, i32 4, i32 %shr123.i.i
+ %346 = load %struct.malloc_tree_chunk** %arrayidx126.i.i, align 4, !tbaa !0
+ %cmp128.i.i = icmp eq %struct.malloc_tree_chunk* %346, null
+ br i1 %cmp128.i.i, label %if.else131.i.i, label %for.cond117.i.i
+
+if.else131.i.i: ; preds = %if.then122.i.i
+ %347 = bitcast %struct.malloc_tree_chunk** %arrayidx126.i.i to i8*
+ %348 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp133.i.i = icmp ult i8* %347, %348
+ br i1 %cmp133.i.i, label %if.else141.i.i, label %if.then137.i.i, !prof !6
+
+if.then137.i.i: ; preds = %if.else131.i.i
+ store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %arrayidx126.i.i, align 4, !tbaa !0
+ %parent138.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2
+ %T.0.c6.i.i = bitcast %struct.malloc_tree_chunk* %T.016.i.i to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c6.i.i, %struct.malloc_chunk** %parent138.i.i, align 4, !tbaa !0
+ %bk139.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk139.i.i, align 4, !tbaa !0
+ %fd140.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2
+ store %struct.malloc_chunk* %188, %struct.malloc_chunk** %fd140.i.i, align 4, !tbaa !0
+ br label %if.end248.i
+
+if.else141.i.i: ; preds = %if.else131.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.else143.i.i: ; preds = %for.cond117.i.i, %cond.end114.i.i
+ %T.0.lcssa.i.i = phi %struct.malloc_tree_chunk* [ %343, %cond.end114.i.i ], [ %346, %for.cond117.i.i ]
+ %fd145.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i.i, i32 0, i32 2
+ %349 = load %struct.malloc_tree_chunk** %fd145.i.i, align 4, !tbaa !0
+ %350 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i.i to i8*
+ %351 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp147.i.i = icmp ult i8* %350, %351
+ br i1 %cmp147.i.i, label %if.else160.i.i, label %land.rhs.i.i
+
+land.rhs.i.i: ; preds = %if.else143.i.i
+ %352 = bitcast %struct.malloc_tree_chunk* %349 to i8*
+ %cmp150.i.i = icmp ult i8* %352, %351
+ br i1 %cmp150.i.i, label %if.else160.i.i, label %if.then154.i.i, !prof !6
+
+if.then154.i.i: ; preds = %land.rhs.i.i
+ %bk155.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %349, i32 0, i32 3
+ store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %bk155.i.i, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %fd145.i.i, align 4, !tbaa !0
+ %fd157.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2
+ %.c5.i.i = bitcast %struct.malloc_tree_chunk* %349 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c5.i.i, %struct.malloc_chunk** %fd157.i.i, align 4, !tbaa !0
+ %bk158.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3
+ %T.0.c.i.i = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i.i to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c.i.i, %struct.malloc_chunk** %bk158.i.i, align 4, !tbaa !0
+ %parent159.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent159.i.i, align 4, !tbaa !0
+ br label %if.end248.i
+
+if.else160.i.i: ; preds = %land.rhs.i.i, %if.else143.i.i
+ tail call void @abort() #6
+ unreachable
+
+if.end248.i: ; preds = %if.then154.i.i, %if.then137.i.i, %if.then98.i.i, %if.end52.i.i, %for.end.i.i, %init_top.exit36.i, %init_top.exit.i
+ %353 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %cmp250.i = icmp ugt i32 %353, %nb.0
+ br i1 %cmp250.i, label %if.then251.i, label %if.end264.i
+
+if.then251.i: ; preds = %if.end248.i
+ %sub253.i = sub i32 %353, %nb.0
+ store i32 %sub253.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %354 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %355 = bitcast %struct.malloc_chunk* %354 to i8*
+ %add.ptr255.i = getelementptr inbounds i8* %355, i32 %nb.0
+ %356 = bitcast i8* %add.ptr255.i to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %356, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %or257.i = or i32 %sub253.i, 1
+ %add.ptr255.sum.i = add i32 %nb.0, 4
+ %head258.i = getelementptr inbounds i8* %355, i32 %add.ptr255.sum.i
+ %357 = bitcast i8* %head258.i to i32*
+ store i32 %or257.i, i32* %357, align 4, !tbaa !3
+ %or260.i = or i32 %nb.0, 3
+ %head261.i = getelementptr inbounds %struct.malloc_chunk* %354, i32 0, i32 1
+ store i32 %or260.i, i32* %head261.i, align 4, !tbaa !3
+ %add.ptr262.i = getelementptr inbounds %struct.malloc_chunk* %354, i32 0, i32 2
+ %358 = bitcast %struct.malloc_chunk** %add.ptr262.i to i8*
+ br label %postaction
+
+if.end264.i: ; preds = %if.end248.i, %if.end143.i, %if.then125.i, %if.end121.i
+ %call265.i = tail call i32* @__errno_location() #7
+ store i32 12, i32* %call265.i, align 4, !tbaa !3
+ br label %postaction
+
+postaction: ; preds = %if.end264.i, %if.then251.i, %prepend_alloc.exit.i, %if.then16.i, %if.end8.i, %if.then185, %if.end180, %tmalloc_large.exit, %tmalloc_small.exit, %if.end125, %if.end21
+ %mem.0 = phi i8* [ %11, %if.end21 ], [ %31, %if.end125 ], [ %77, %tmalloc_small.exit ], [ %160, %if.end180 ], [ %166, %if.then185 ], [ %151, %tmalloc_large.exit ], [ %358, %if.then251.i ], [ null, %if.end264.i ], [ %add.ptr368.i.i, %prepend_alloc.exit.i ], [ null, %if.end8.i ], [ null, %if.then16.i ]
+ ret i8* %mem.0
+}
+
+; Function Attrs: noreturn
+declare void @abort() #4
+
+; Function Attrs: nounwind
+define weak void @free(i8* %mem) #0 {
+entry:
+ %cmp = icmp eq i8* %mem, null
+ br i1 %cmp, label %if.end635, label %if.then
+
+if.then: ; preds = %entry
+ %add.ptr = getelementptr inbounds i8* %mem, i32 -8
+ %0 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %1 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp1 = icmp ult i8* %add.ptr, %1
+ br i1 %cmp1, label %erroraction, label %land.rhs
+
+land.rhs: ; preds = %if.then
+ %head = getelementptr inbounds i8* %mem, i32 -4
+ %2 = bitcast i8* %head to i32*
+ %3 = load i32* %2, align 4, !tbaa !3
+ %and = and i32 %3, 3
+ %cmp2 = icmp eq i32 %and, 1
+ br i1 %cmp2, label %erroraction, label %if.then3, !prof !6
+
+if.then3: ; preds = %land.rhs
+ %and5 = and i32 %3, -8
+ %add.ptr.sum = add i32 %and5, -8
+ %add.ptr6 = getelementptr inbounds i8* %mem, i32 %add.ptr.sum
+ %4 = bitcast i8* %add.ptr6 to %struct.malloc_chunk*
+ %and8 = and i32 %3, 1
+ %tobool9 = icmp eq i32 %and8, 0
+ br i1 %tobool9, label %if.then10, label %if.end224
+
+if.then10: ; preds = %if.then3
+ %prev_foot = bitcast i8* %add.ptr to i32*
+ %5 = load i32* %prev_foot, align 4, !tbaa !3
+ %cmp13 = icmp eq i32 %and, 0
+ br i1 %cmp13, label %if.end635, label %if.else
+
+if.else: ; preds = %if.then10
+ %add.ptr.sum230 = sub i32 -8, %5
+ %add.ptr16 = getelementptr inbounds i8* %mem, i32 %add.ptr.sum230
+ %6 = bitcast i8* %add.ptr16 to %struct.malloc_chunk*
+ %add17 = add i32 %5, %and5
+ %cmp18 = icmp ult i8* %add.ptr16, %1
+ br i1 %cmp18, label %erroraction, label %if.then21, !prof !6
+
+if.then21: ; preds = %if.else
+ %7 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp22 = icmp eq %struct.malloc_chunk* %6, %7
+ br i1 %cmp22, label %if.else208, label %if.then24
+
+if.then24: ; preds = %if.then21
+ %shr = lshr i32 %5, 3
+ %cmp25 = icmp ult i32 %5, 256
+ br i1 %cmp25, label %if.then27, label %if.else72
+
+if.then27: ; preds = %if.then24
+ %add.ptr16.sum257 = add i32 %add.ptr.sum230, 8
+ %fd = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum257
+ %8 = bitcast i8* %fd to %struct.malloc_chunk**
+ %9 = load %struct.malloc_chunk** %8, align 4, !tbaa !0
+ %add.ptr16.sum258 = add i32 %add.ptr.sum230, 12
+ %bk = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum258
+ %10 = bitcast i8* %bk to %struct.malloc_chunk**
+ %11 = load %struct.malloc_chunk** %10, align 4, !tbaa !0
+ %shl = shl nuw nsw i32 %shr, 1
+ %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl
+ %12 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk*
+ %cmp29 = icmp eq %struct.malloc_chunk* %9, %12
+ br i1 %cmp29, label %if.then41, label %lor.rhs
+
+lor.rhs: ; preds = %if.then27
+ %13 = bitcast %struct.malloc_chunk* %9 to i8*
+ %cmp31 = icmp ult i8* %13, %1
+ br i1 %cmp31, label %if.else70, label %land.rhs33
+
+land.rhs33: ; preds = %lor.rhs
+ %bk34 = getelementptr inbounds %struct.malloc_chunk* %9, i32 0, i32 3
+ %14 = load %struct.malloc_chunk** %bk34, align 4, !tbaa !0
+ %cmp35 = icmp eq %struct.malloc_chunk* %14, %6
+ br i1 %cmp35, label %if.then41, label %if.else70, !prof !5
+
+if.then41: ; preds = %land.rhs33, %if.then27
+ %cmp42 = icmp eq %struct.malloc_chunk* %11, %9
+ br i1 %cmp42, label %if.then44, label %if.else47
+
+if.then44: ; preds = %if.then41
+ %shl45 = shl i32 1, %shr
+ %neg = xor i32 %shl45, -1
+ %15 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and46 = and i32 %15, %neg
+ store i32 %and46, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end224
+
+if.else47: ; preds = %if.then41
+ %cmp50 = icmp eq %struct.malloc_chunk* %11, %12
+ br i1 %cmp50, label %if.else47.if.then65_crit_edge, label %lor.rhs52
+
+if.else47.if.then65_crit_edge: ; preds = %if.else47
+ %fd67.pre = getelementptr inbounds %struct.malloc_chunk* %11, i32 0, i32 2
+ br label %if.then65
+
+lor.rhs52: ; preds = %if.else47
+ %16 = bitcast %struct.malloc_chunk* %11 to i8*
+ %cmp53 = icmp ult i8* %16, %1
+ br i1 %cmp53, label %if.else68, label %land.rhs55
+
+land.rhs55: ; preds = %lor.rhs52
+ %fd56 = getelementptr inbounds %struct.malloc_chunk* %11, i32 0, i32 2
+ %17 = load %struct.malloc_chunk** %fd56, align 4, !tbaa !0
+ %cmp57 = icmp eq %struct.malloc_chunk* %17, %6
+ br i1 %cmp57, label %if.then65, label %if.else68, !prof !5
+
+if.then65: ; preds = %land.rhs55, %if.else47.if.then65_crit_edge
+ %fd67.pre-phi = phi %struct.malloc_chunk** [ %fd67.pre, %if.else47.if.then65_crit_edge ], [ %fd56, %land.rhs55 ]
+ %bk66 = getelementptr inbounds %struct.malloc_chunk* %9, i32 0, i32 3
+ store %struct.malloc_chunk* %11, %struct.malloc_chunk** %bk66, align 4, !tbaa !0
+ store %struct.malloc_chunk* %9, %struct.malloc_chunk** %fd67.pre-phi, align 4, !tbaa !0
+ br label %if.end224
+
+if.else68: ; preds = %land.rhs55, %lor.rhs52
+ tail call void @abort() #6
+ unreachable
+
+if.else70: ; preds = %land.rhs33, %lor.rhs
+ tail call void @abort() #6
+ unreachable
+
+if.else72: ; preds = %if.then24
+ %18 = bitcast i8* %add.ptr16 to %struct.malloc_tree_chunk*
+ %add.ptr16.sum251 = add i32 %add.ptr.sum230, 24
+ %parent = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum251
+ %19 = bitcast i8* %parent to %struct.malloc_tree_chunk**
+ %20 = load %struct.malloc_tree_chunk** %19, align 4, !tbaa !0
+ %add.ptr16.sum252 = add i32 %add.ptr.sum230, 12
+ %bk73 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum252
+ %21 = bitcast i8* %bk73 to %struct.malloc_tree_chunk**
+ %22 = load %struct.malloc_tree_chunk** %21, align 4, !tbaa !0
+ %cmp74 = icmp eq %struct.malloc_tree_chunk* %22, %18
+ br i1 %cmp74, label %if.else98, label %if.then76
+
+if.then76: ; preds = %if.else72
+ %add.ptr16.sum256 = add i32 %add.ptr.sum230, 8
+ %fd78 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum256
+ %23 = bitcast i8* %fd78 to %struct.malloc_tree_chunk**
+ %24 = load %struct.malloc_tree_chunk** %23, align 4, !tbaa !0
+ %25 = bitcast %struct.malloc_tree_chunk* %24 to i8*
+ %cmp80 = icmp ult i8* %25, %1
+ br i1 %cmp80, label %if.else96, label %land.lhs.true
+
+land.lhs.true: ; preds = %if.then76
+ %bk82 = getelementptr inbounds %struct.malloc_tree_chunk* %24, i32 0, i32 3
+ %26 = load %struct.malloc_tree_chunk** %bk82, align 4, !tbaa !0
+ %cmp83 = icmp eq %struct.malloc_tree_chunk* %26, %18
+ br i1 %cmp83, label %land.rhs85, label %if.else96
+
+land.rhs85: ; preds = %land.lhs.true
+ %fd86 = getelementptr inbounds %struct.malloc_tree_chunk* %22, i32 0, i32 2
+ %27 = load %struct.malloc_tree_chunk** %fd86, align 4, !tbaa !0
+ %cmp87 = icmp eq %struct.malloc_tree_chunk* %27, %18
+ br i1 %cmp87, label %if.then93, label %if.else96, !prof !5
+
+if.then93: ; preds = %land.rhs85
+ store %struct.malloc_tree_chunk* %22, %struct.malloc_tree_chunk** %bk82, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %24, %struct.malloc_tree_chunk** %fd86, align 4, !tbaa !0
+ br label %if.end126
+
+if.else96: ; preds = %land.rhs85, %land.lhs.true, %if.then76
+ tail call void @abort() #6
+ unreachable
+
+if.else98: ; preds = %if.else72
+ %child.sum = add i32 %add.ptr.sum230, 20
+ %arrayidx99 = getelementptr inbounds i8* %mem, i32 %child.sum
+ %28 = bitcast i8* %arrayidx99 to %struct.malloc_tree_chunk**
+ %29 = load %struct.malloc_tree_chunk** %28, align 4, !tbaa !0
+ %cmp100 = icmp eq %struct.malloc_tree_chunk* %29, null
+ br i1 %cmp100, label %lor.lhs.false, label %while.cond
+
+lor.lhs.false: ; preds = %if.else98
+ %add.ptr16.sum253 = add i32 %add.ptr.sum230, 16
+ %child = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum253
+ %arrayidx103 = bitcast i8* %child to %struct.malloc_tree_chunk**
+ %30 = load %struct.malloc_tree_chunk** %arrayidx103, align 4, !tbaa !0
+ %cmp104 = icmp eq %struct.malloc_tree_chunk* %30, null
+ br i1 %cmp104, label %if.end126, label %while.cond
+
+while.cond: ; preds = %lor.rhs111, %while.cond, %lor.lhs.false, %if.else98
+ %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx103, %lor.lhs.false ], [ %28, %if.else98 ], [ %arrayidx108, %while.cond ], [ %arrayidx113, %lor.rhs111 ]
+ %R.0 = phi %struct.malloc_tree_chunk* [ %30, %lor.lhs.false ], [ %29, %if.else98 ], [ %31, %while.cond ], [ %32, %lor.rhs111 ]
+ %arrayidx108 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1
+ %31 = load %struct.malloc_tree_chunk** %arrayidx108, align 4, !tbaa !0
+ %cmp109 = icmp eq %struct.malloc_tree_chunk* %31, null
+ br i1 %cmp109, label %lor.rhs111, label %while.cond
+
+lor.rhs111: ; preds = %while.cond
+ %arrayidx113 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0
+ %32 = load %struct.malloc_tree_chunk** %arrayidx113, align 4, !tbaa !0
+ %cmp114 = icmp eq %struct.malloc_tree_chunk* %32, null
+ br i1 %cmp114, label %while.end, label %while.cond
+
+while.end: ; preds = %lor.rhs111
+ %33 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8*
+ %cmp118 = icmp ult i8* %33, %1
+ br i1 %cmp118, label %if.else123, label %if.then122, !prof !6
+
+if.then122: ; preds = %while.end
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0
+ br label %if.end126
+
+if.else123: ; preds = %while.end
+ tail call void @abort() #6
+ unreachable
+
+if.end126: ; preds = %if.then122, %lor.lhs.false, %if.then93
+ %R.1 = phi %struct.malloc_tree_chunk* [ %22, %if.then93 ], [ %R.0, %if.then122 ], [ null, %lor.lhs.false ]
+ %cmp127 = icmp eq %struct.malloc_tree_chunk* %20, null
+ br i1 %cmp127, label %if.end224, label %if.then129
+
+if.then129: ; preds = %if.end126
+ %add.ptr16.sum254 = add i32 %add.ptr.sum230, 28
+ %index = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum254
+ %34 = bitcast i8* %index to i32*
+ %35 = load i32* %34, align 4, !tbaa !3
+ %arrayidx130 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %35
+ %36 = load %struct.malloc_tree_chunk** %arrayidx130, align 4, !tbaa !0
+ %cmp131 = icmp eq %struct.malloc_tree_chunk* %18, %36
+ br i1 %cmp131, label %if.then133, label %if.else142
+
+if.then133: ; preds = %if.then129
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx130, align 4, !tbaa !0
+ %cond263 = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cond263, label %if.end161.thread, label %if.then164
+
+if.end161.thread: ; preds = %if.then133
+ %shl138 = shl i32 1, %35
+ %neg139 = xor i32 %shl138, -1
+ %37 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and140 = and i32 %37, %neg139
+ store i32 %and140, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end224
+
+if.else142: ; preds = %if.then129
+ %38 = bitcast %struct.malloc_tree_chunk* %20 to i8*
+ %39 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp143 = icmp ult i8* %38, %39
+ br i1 %cmp143, label %if.else159, label %if.then147, !prof !6
+
+if.then147: ; preds = %if.else142
+ %arrayidx149 = getelementptr inbounds %struct.malloc_tree_chunk* %20, i32 0, i32 4, i32 0
+ %40 = load %struct.malloc_tree_chunk** %arrayidx149, align 4, !tbaa !0
+ %cmp150 = icmp eq %struct.malloc_tree_chunk* %40, %18
+ br i1 %cmp150, label %if.then152, label %if.else155
+
+if.then152: ; preds = %if.then147
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx149, align 4, !tbaa !0
+ br label %if.end161
+
+if.else155: ; preds = %if.then147
+ %arrayidx157 = getelementptr inbounds %struct.malloc_tree_chunk* %20, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx157, align 4, !tbaa !0
+ br label %if.end161
+
+if.else159: ; preds = %if.else142
+ tail call void @abort() #6
+ unreachable
+
+if.end161: ; preds = %if.else155, %if.then152
+ %cmp162 = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cmp162, label %if.end224, label %if.then164
+
+if.then164: ; preds = %if.end161, %if.then133
+ %41 = bitcast %struct.malloc_tree_chunk* %R.1 to i8*
+ %42 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp165 = icmp ult i8* %41, %42
+ br i1 %cmp165, label %if.else203, label %if.then169, !prof !6
+
+if.then169: ; preds = %if.then164
+ %parent170 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %20, %struct.malloc_tree_chunk** %parent170, align 4, !tbaa !0
+ %add.ptr16.sum255 = add i32 %add.ptr.sum230, 16
+ %child171 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum255
+ %arrayidx172 = bitcast i8* %child171 to %struct.malloc_tree_chunk**
+ %43 = load %struct.malloc_tree_chunk** %arrayidx172, align 4, !tbaa !0
+ %cmp173 = icmp eq %struct.malloc_tree_chunk* %43, null
+ br i1 %cmp173, label %if.end186, label %if.then175
+
+if.then175: ; preds = %if.then169
+ %44 = bitcast %struct.malloc_tree_chunk* %43 to i8*
+ %45 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp176 = icmp ult i8* %44, %45
+ br i1 %cmp176, label %if.else184, label %if.then180, !prof !6
+
+if.then180: ; preds = %if.then175
+ %arrayidx182 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %43, %struct.malloc_tree_chunk** %arrayidx182, align 4, !tbaa !0
+ %parent183 = getelementptr inbounds %struct.malloc_tree_chunk* %43, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent183, align 4, !tbaa !0
+ br label %if.end186
+
+if.else184: ; preds = %if.then175
+ tail call void @abort() #6
+ unreachable
+
+if.end186: ; preds = %if.then180, %if.then169
+ %child171.sum = add i32 %add.ptr.sum230, 20
+ %arrayidx188 = getelementptr inbounds i8* %mem, i32 %child171.sum
+ %46 = bitcast i8* %arrayidx188 to %struct.malloc_tree_chunk**
+ %47 = load %struct.malloc_tree_chunk** %46, align 4, !tbaa !0
+ %cmp189 = icmp eq %struct.malloc_tree_chunk* %47, null
+ br i1 %cmp189, label %if.end224, label %if.then191
+
+if.then191: ; preds = %if.end186
+ %48 = bitcast %struct.malloc_tree_chunk* %47 to i8*
+ %49 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp192 = icmp ult i8* %48, %49
+ br i1 %cmp192, label %if.else200, label %if.then196, !prof !6
+
+if.then196: ; preds = %if.then191
+ %arrayidx198 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %47, %struct.malloc_tree_chunk** %arrayidx198, align 4, !tbaa !0
+ %parent199 = getelementptr inbounds %struct.malloc_tree_chunk* %47, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent199, align 4, !tbaa !0
+ br label %if.end224
+
+if.else200: ; preds = %if.then191
+ tail call void @abort() #6
+ unreachable
+
+if.else203: ; preds = %if.then164
+ tail call void @abort() #6
+ unreachable
+
+if.else208: ; preds = %if.then21
+ %add.ptr6.sum = add i32 %and5, -4
+ %head209 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum
+ %50 = bitcast i8* %head209 to i32*
+ %51 = load i32* %50, align 4, !tbaa !3
+ %and210 = and i32 %51, 3
+ %cmp211 = icmp eq i32 %and210, 3
+ br i1 %cmp211, label %if.then213, label %if.end224
+
+if.then213: ; preds = %if.else208
+ store i32 %add17, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %52 = load i32* %50, align 4, !tbaa !3
+ %and215 = and i32 %52, -2
+ store i32 %and215, i32* %50, align 4, !tbaa !3
+ %or = or i32 %add17, 1
+ %add.ptr16.sum = add i32 %add.ptr.sum230, 4
+ %head216 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum
+ %53 = bitcast i8* %head216 to i32*
+ store i32 %or, i32* %53, align 4, !tbaa !3
+ %prev_foot218 = bitcast i8* %add.ptr6 to i32*
+ store i32 %add17, i32* %prev_foot218, align 4, !tbaa !3
+ br label %if.end635
+
+if.end224: ; preds = %if.else208, %if.then196, %if.end186, %if.end161, %if.end161.thread, %if.end126, %if.then65, %if.then44, %if.then3
+ %psize.0 = phi i32 [ %and5, %if.then3 ], [ %add17, %if.then44 ], [ %add17, %if.then65 ], [ %add17, %if.then196 ], [ %add17, %if.end186 ], [ %add17, %if.end161 ], [ %add17, %if.end126 ], [ %add17, %if.else208 ], [ %add17, %if.end161.thread ]
+ %p.0 = phi %struct.malloc_chunk* [ %0, %if.then3 ], [ %6, %if.then44 ], [ %6, %if.then65 ], [ %6, %if.then196 ], [ %6, %if.end186 ], [ %6, %if.end161 ], [ %6, %if.end126 ], [ %6, %if.else208 ], [ %6, %if.end161.thread ]
+ %54 = bitcast %struct.malloc_chunk* %p.0 to i8*
+ %cmp225 = icmp ult i8* %54, %add.ptr6
+ br i1 %cmp225, label %land.rhs227, label %erroraction
+
+land.rhs227: ; preds = %if.end224
+ %add.ptr6.sum249 = add i32 %and5, -4
+ %head228 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum249
+ %55 = bitcast i8* %head228 to i32*
+ %56 = load i32* %55, align 4, !tbaa !3
+ %and229 = and i32 %56, 1
+ %tobool230 = icmp eq i32 %and229, 0
+ br i1 %tobool230, label %erroraction, label %if.then235, !prof !6
+
+if.then235: ; preds = %land.rhs227
+ %and237 = and i32 %56, 2
+ %tobool238 = icmp eq i32 %and237, 0
+ br i1 %tobool238, label %if.then239, label %if.else485
+
+if.then239: ; preds = %if.then235
+ %57 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp240 = icmp eq %struct.malloc_chunk* %4, %57
+ br i1 %cmp240, label %if.then242, label %if.else250
+
+if.then242: ; preds = %if.then239
+ %58 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add243 = add i32 %58, %psize.0
+ store i32 %add243, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %or244 = or i32 %add243, 1
+ %head245 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
+ store i32 %or244, i32* %head245, align 4, !tbaa !3
+ %59 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp246 = icmp eq %struct.malloc_chunk* %p.0, %59
+ br i1 %cmp246, label %if.then248, label %if.end635
+
+if.then248: ; preds = %if.then242
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ br label %if.end635
+
+if.else250: ; preds = %if.then239
+ %60 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp251 = icmp eq %struct.malloc_chunk* %4, %60
+ br i1 %cmp251, label %if.then253, label %if.else259
+
+if.then253: ; preds = %if.else250
+ %61 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %add254 = add i32 %61, %psize.0
+ store i32 %add254, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %or255 = or i32 %add254, 1
+ %head256 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
+ store i32 %or255, i32* %head256, align 4, !tbaa !3
+ %add.ptr257 = getelementptr inbounds i8* %54, i32 %add254
+ %prev_foot258 = bitcast i8* %add.ptr257 to i32*
+ store i32 %add254, i32* %prev_foot258, align 4, !tbaa !3
+ br label %if.end635
+
+if.else259: ; preds = %if.else250
+ %and261 = and i32 %56, -8
+ %add262 = add i32 %and261, %psize.0
+ %shr263 = lshr i32 %56, 3
+ %cmp264 = icmp ult i32 %56, 256
+ br i1 %cmp264, label %if.then266, label %if.else323
+
+if.then266: ; preds = %if.else259
+ %fd268 = getelementptr inbounds i8* %mem, i32 %and5
+ %62 = bitcast i8* %fd268 to %struct.malloc_chunk**
+ %63 = load %struct.malloc_chunk** %62, align 4, !tbaa !0
+ %add.ptr6.sum247248 = or i32 %and5, 4
+ %bk270 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum247248
+ %64 = bitcast i8* %bk270 to %struct.malloc_chunk**
+ %65 = load %struct.malloc_chunk** %64, align 4, !tbaa !0
+ %shl273 = shl nuw nsw i32 %shr263, 1
+ %arrayidx274 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl273
+ %66 = bitcast %struct.malloc_chunk** %arrayidx274 to %struct.malloc_chunk*
+ %cmp275 = icmp eq %struct.malloc_chunk* %63, %66
+ br i1 %cmp275, label %if.then290, label %lor.rhs277
+
+lor.rhs277: ; preds = %if.then266
+ %67 = bitcast %struct.malloc_chunk* %63 to i8*
+ %68 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp278 = icmp ult i8* %67, %68
+ br i1 %cmp278, label %if.else321, label %land.rhs280
+
+land.rhs280: ; preds = %lor.rhs277
+ %bk281 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3
+ %69 = load %struct.malloc_chunk** %bk281, align 4, !tbaa !0
+ %cmp282 = icmp eq %struct.malloc_chunk* %69, %4
+ br i1 %cmp282, label %if.then290, label %if.else321, !prof !5
+
+if.then290: ; preds = %land.rhs280, %if.then266
+ %cmp291 = icmp eq %struct.malloc_chunk* %65, %63
+ br i1 %cmp291, label %if.then293, label %if.else297
+
+if.then293: ; preds = %if.then290
+ %shl294 = shl i32 1, %shr263
+ %neg295 = xor i32 %shl294, -1
+ %70 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and296 = and i32 %70, %neg295
+ store i32 %and296, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end474
+
+if.else297: ; preds = %if.then290
+ %cmp300 = icmp eq %struct.malloc_chunk* %65, %66
+ br i1 %cmp300, label %if.else297.if.then315_crit_edge, label %lor.rhs302
+
+if.else297.if.then315_crit_edge: ; preds = %if.else297
+ %fd317.pre = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2
+ br label %if.then315
+
+lor.rhs302: ; preds = %if.else297
+ %71 = bitcast %struct.malloc_chunk* %65 to i8*
+ %72 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp303 = icmp ult i8* %71, %72
+ br i1 %cmp303, label %if.else318, label %land.rhs305
+
+land.rhs305: ; preds = %lor.rhs302
+ %fd306 = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2
+ %73 = load %struct.malloc_chunk** %fd306, align 4, !tbaa !0
+ %cmp307 = icmp eq %struct.malloc_chunk* %73, %4
+ br i1 %cmp307, label %if.then315, label %if.else318, !prof !5
+
+if.then315: ; preds = %land.rhs305, %if.else297.if.then315_crit_edge
+ %fd317.pre-phi = phi %struct.malloc_chunk** [ %fd317.pre, %if.else297.if.then315_crit_edge ], [ %fd306, %land.rhs305 ]
+ %bk316 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3
+ store %struct.malloc_chunk* %65, %struct.malloc_chunk** %bk316, align 4, !tbaa !0
+ store %struct.malloc_chunk* %63, %struct.malloc_chunk** %fd317.pre-phi, align 4, !tbaa !0
+ br label %if.end474
+
+if.else318: ; preds = %land.rhs305, %lor.rhs302
+ tail call void @abort() #6
+ unreachable
+
+if.else321: ; preds = %land.rhs280, %lor.rhs277
+ tail call void @abort() #6
+ unreachable
+
+if.else323: ; preds = %if.else259
+ %74 = bitcast i8* %add.ptr6 to %struct.malloc_tree_chunk*
+ %add.ptr6.sum232 = add i32 %and5, 16
+ %parent326 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum232
+ %75 = bitcast i8* %parent326 to %struct.malloc_tree_chunk**
+ %76 = load %struct.malloc_tree_chunk** %75, align 4, !tbaa !0
+ %add.ptr6.sum233234 = or i32 %and5, 4
+ %bk328 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum233234
+ %77 = bitcast i8* %bk328 to %struct.malloc_tree_chunk**
+ %78 = load %struct.malloc_tree_chunk** %77, align 4, !tbaa !0
+ %cmp329 = icmp eq %struct.malloc_tree_chunk* %78, %74
+ br i1 %cmp329, label %if.else354, label %if.then331
+
+if.then331: ; preds = %if.else323
+ %fd333 = getelementptr inbounds i8* %mem, i32 %and5
+ %79 = bitcast i8* %fd333 to %struct.malloc_tree_chunk**
+ %80 = load %struct.malloc_tree_chunk** %79, align 4, !tbaa !0
+ %81 = bitcast %struct.malloc_tree_chunk* %80 to i8*
+ %82 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp335 = icmp ult i8* %81, %82
+ br i1 %cmp335, label %if.else352, label %land.lhs.true337
+
+land.lhs.true337: ; preds = %if.then331
+ %bk338 = getelementptr inbounds %struct.malloc_tree_chunk* %80, i32 0, i32 3
+ %83 = load %struct.malloc_tree_chunk** %bk338, align 4, !tbaa !0
+ %cmp339 = icmp eq %struct.malloc_tree_chunk* %83, %74
+ br i1 %cmp339, label %land.rhs341, label %if.else352
+
+land.rhs341: ; preds = %land.lhs.true337
+ %fd342 = getelementptr inbounds %struct.malloc_tree_chunk* %78, i32 0, i32 2
+ %84 = load %struct.malloc_tree_chunk** %fd342, align 4, !tbaa !0
+ %cmp343 = icmp eq %struct.malloc_tree_chunk* %84, %74
+ br i1 %cmp343, label %if.then349, label %if.else352, !prof !5
+
+if.then349: ; preds = %land.rhs341
+ store %struct.malloc_tree_chunk* %78, %struct.malloc_tree_chunk** %bk338, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %80, %struct.malloc_tree_chunk** %fd342, align 4, !tbaa !0
+ br label %if.end389
+
+if.else352: ; preds = %land.rhs341, %land.lhs.true337, %if.then331
+ tail call void @abort() #6
+ unreachable
+
+if.else354: ; preds = %if.else323
+ %child356.sum = add i32 %and5, 12
+ %arrayidx357 = getelementptr inbounds i8* %mem, i32 %child356.sum
+ %85 = bitcast i8* %arrayidx357 to %struct.malloc_tree_chunk**
+ %86 = load %struct.malloc_tree_chunk** %85, align 4, !tbaa !0
+ %cmp358 = icmp eq %struct.malloc_tree_chunk* %86, null
+ br i1 %cmp358, label %lor.lhs.false360, label %while.cond367
+
+lor.lhs.false360: ; preds = %if.else354
+ %add.ptr6.sum235 = add i32 %and5, 8
+ %child356 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum235
+ %arrayidx362 = bitcast i8* %child356 to %struct.malloc_tree_chunk**
+ %87 = load %struct.malloc_tree_chunk** %arrayidx362, align 4, !tbaa !0
+ %cmp363 = icmp eq %struct.malloc_tree_chunk* %87, null
+ br i1 %cmp363, label %if.end389, label %while.cond367
+
+while.cond367: ; preds = %lor.rhs372, %while.cond367, %lor.lhs.false360, %if.else354
+ %RP355.0 = phi %struct.malloc_tree_chunk** [ %arrayidx362, %lor.lhs.false360 ], [ %85, %if.else354 ], [ %arrayidx369, %while.cond367 ], [ %arrayidx374, %lor.rhs372 ]
+ %R327.0 = phi %struct.malloc_tree_chunk* [ %87, %lor.lhs.false360 ], [ %86, %if.else354 ], [ %88, %while.cond367 ], [ %89, %lor.rhs372 ]
+ %arrayidx369 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.0, i32 0, i32 4, i32 1
+ %88 = load %struct.malloc_tree_chunk** %arrayidx369, align 4, !tbaa !0
+ %cmp370 = icmp eq %struct.malloc_tree_chunk* %88, null
+ br i1 %cmp370, label %lor.rhs372, label %while.cond367
+
+lor.rhs372: ; preds = %while.cond367
+ %arrayidx374 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.0, i32 0, i32 4, i32 0
+ %89 = load %struct.malloc_tree_chunk** %arrayidx374, align 4, !tbaa !0
+ %cmp375 = icmp eq %struct.malloc_tree_chunk* %89, null
+ br i1 %cmp375, label %while.end380, label %while.cond367
+
+while.end380: ; preds = %lor.rhs372
+ %90 = bitcast %struct.malloc_tree_chunk** %RP355.0 to i8*
+ %91 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp381 = icmp ult i8* %90, %91
+ br i1 %cmp381, label %if.else386, label %if.then385, !prof !6
+
+if.then385: ; preds = %while.end380
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP355.0, align 4, !tbaa !0
+ br label %if.end389
+
+if.else386: ; preds = %while.end380
+ tail call void @abort() #6
+ unreachable
+
+if.end389: ; preds = %if.then385, %lor.lhs.false360, %if.then349
+ %R327.1 = phi %struct.malloc_tree_chunk* [ %78, %if.then349 ], [ %R327.0, %if.then385 ], [ null, %lor.lhs.false360 ]
+ %cmp390 = icmp eq %struct.malloc_tree_chunk* %76, null
+ br i1 %cmp390, label %if.end474, label %if.then392
+
+if.then392: ; preds = %if.end389
+ %add.ptr6.sum243 = add i32 %and5, 20
+ %index394 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum243
+ %92 = bitcast i8* %index394 to i32*
+ %93 = load i32* %92, align 4, !tbaa !3
+ %arrayidx395 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %93
+ %94 = load %struct.malloc_tree_chunk** %arrayidx395, align 4, !tbaa !0
+ %cmp396 = icmp eq %struct.malloc_tree_chunk* %74, %94
+ br i1 %cmp396, label %if.then398, label %if.else407
+
+if.then398: ; preds = %if.then392
+ store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx395, align 4, !tbaa !0
+ %cond264 = icmp eq %struct.malloc_tree_chunk* %R327.1, null
+ br i1 %cond264, label %if.end426.thread, label %if.then429
+
+if.end426.thread: ; preds = %if.then398
+ %shl403 = shl i32 1, %93
+ %neg404 = xor i32 %shl403, -1
+ %95 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and405 = and i32 %95, %neg404
+ store i32 %and405, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end474
+
+if.else407: ; preds = %if.then392
+ %96 = bitcast %struct.malloc_tree_chunk* %76 to i8*
+ %97 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp408 = icmp ult i8* %96, %97
+ br i1 %cmp408, label %if.else424, label %if.then412, !prof !6
+
+if.then412: ; preds = %if.else407
+ %arrayidx414 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 4, i32 0
+ %98 = load %struct.malloc_tree_chunk** %arrayidx414, align 4, !tbaa !0
+ %cmp415 = icmp eq %struct.malloc_tree_chunk* %98, %74
+ br i1 %cmp415, label %if.then417, label %if.else420
+
+if.then417: ; preds = %if.then412
+ store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx414, align 4, !tbaa !0
+ br label %if.end426
+
+if.else420: ; preds = %if.then412
+ %arrayidx422 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx422, align 4, !tbaa !0
+ br label %if.end426
+
+if.else424: ; preds = %if.else407
+ tail call void @abort() #6
+ unreachable
+
+if.end426: ; preds = %if.else420, %if.then417
+ %cmp427 = icmp eq %struct.malloc_tree_chunk* %R327.1, null
+ br i1 %cmp427, label %if.end474, label %if.then429
+
+if.then429: ; preds = %if.end426, %if.then398
+ %99 = bitcast %struct.malloc_tree_chunk* %R327.1 to i8*
+ %100 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp430 = icmp ult i8* %99, %100
+ br i1 %cmp430, label %if.else470, label %if.then434, !prof !6
+
+if.then434: ; preds = %if.then429
+ %parent437 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %76, %struct.malloc_tree_chunk** %parent437, align 4, !tbaa !0
+ %add.ptr6.sum244 = add i32 %and5, 8
+ %child438 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum244
+ %arrayidx439 = bitcast i8* %child438 to %struct.malloc_tree_chunk**
+ %101 = load %struct.malloc_tree_chunk** %arrayidx439, align 4, !tbaa !0
+ %cmp440 = icmp eq %struct.malloc_tree_chunk* %101, null
+ br i1 %cmp440, label %if.end453, label %if.then442
+
+if.then442: ; preds = %if.then434
+ %102 = bitcast %struct.malloc_tree_chunk* %101 to i8*
+ %103 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp443 = icmp ult i8* %102, %103
+ br i1 %cmp443, label %if.else451, label %if.then447, !prof !6
+
+if.then447: ; preds = %if.then442
+ %arrayidx449 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %101, %struct.malloc_tree_chunk** %arrayidx449, align 4, !tbaa !0
+ %parent450 = getelementptr inbounds %struct.malloc_tree_chunk* %101, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %parent450, align 4, !tbaa !0
+ br label %if.end453
+
+if.else451: ; preds = %if.then442
+ tail call void @abort() #6
+ unreachable
+
+if.end453: ; preds = %if.then447, %if.then434
+ %child438.sum = add i32 %and5, 12
+ %arrayidx455 = getelementptr inbounds i8* %mem, i32 %child438.sum
+ %104 = bitcast i8* %arrayidx455 to %struct.malloc_tree_chunk**
+ %105 = load %struct.malloc_tree_chunk** %104, align 4, !tbaa !0
+ %cmp456 = icmp eq %struct.malloc_tree_chunk* %105, null
+ br i1 %cmp456, label %if.end474, label %if.then458
+
+if.then458: ; preds = %if.end453
+ %106 = bitcast %struct.malloc_tree_chunk* %105 to i8*
+ %107 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp459 = icmp ult i8* %106, %107
+ br i1 %cmp459, label %if.else467, label %if.then463, !prof !6
+
+if.then463: ; preds = %if.then458
+ %arrayidx465 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %105, %struct.malloc_tree_chunk** %arrayidx465, align 4, !tbaa !0
+ %parent466 = getelementptr inbounds %struct.malloc_tree_chunk* %105, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %parent466, align 4, !tbaa !0
+ br label %if.end474
+
+if.else467: ; preds = %if.then458
+ tail call void @abort() #6
+ unreachable
+
+if.else470: ; preds = %if.then429
+ tail call void @abort() #6
+ unreachable
+
+if.end474: ; preds = %if.then463, %if.end453, %if.end426, %if.end426.thread, %if.end389, %if.then315, %if.then293
+ %or475 = or i32 %add262, 1
+ %head476 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
+ store i32 %or475, i32* %head476, align 4, !tbaa !3
+ %add.ptr477 = getelementptr inbounds i8* %54, i32 %add262
+ %prev_foot478 = bitcast i8* %add.ptr477 to i32*
+ store i32 %add262, i32* %prev_foot478, align 4, !tbaa !3
+ %108 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp479 = icmp eq %struct.malloc_chunk* %p.0, %108
+ br i1 %cmp479, label %if.then481, label %if.end492
+
+if.then481: ; preds = %if.end474
+ store i32 %add262, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ br label %if.end635
+
+if.else485: ; preds = %if.then235
+ %and487 = and i32 %56, -2
+ store i32 %and487, i32* %55, align 4, !tbaa !3
+ %or488 = or i32 %psize.0, 1
+ %head489 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
+ store i32 %or488, i32* %head489, align 4, !tbaa !3
+ %add.ptr490 = getelementptr inbounds i8* %54, i32 %psize.0
+ %prev_foot491 = bitcast i8* %add.ptr490 to i32*
+ store i32 %psize.0, i32* %prev_foot491, align 4, !tbaa !3
+ br label %if.end492
+
+if.end492: ; preds = %if.else485, %if.end474
+ %psize.1 = phi i32 [ %psize.0, %if.else485 ], [ %add262, %if.end474 ]
+ %shr493 = lshr i32 %psize.1, 3
+ %cmp494 = icmp ult i32 %psize.1, 256
+ br i1 %cmp494, label %if.then496, label %if.else524
+
+if.then496: ; preds = %if.end492
+ %shl500 = shl nuw nsw i32 %shr493, 1
+ %arrayidx501 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl500
+ %109 = bitcast %struct.malloc_chunk** %arrayidx501 to %struct.malloc_chunk*
+ %110 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl503 = shl i32 1, %shr493
+ %and504 = and i32 %110, %shl503
+ %tobool505 = icmp eq i32 %and504, 0
+ br i1 %tobool505, label %if.then506, label %if.else509
+
+if.then506: ; preds = %if.then496
+ %or508 = or i32 %110, %shl503
+ store i32 %or508, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx501.sum.pre = add i32 %shl500, 2
+ %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx501.sum.pre
+ br label %if.end519
+
+if.else509: ; preds = %if.then496
+ %arrayidx501.sum242 = add i32 %shl500, 2
+ %111 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx501.sum242
+ %112 = load %struct.malloc_chunk** %111, align 4, !tbaa !0
+ %113 = bitcast %struct.malloc_chunk* %112 to i8*
+ %114 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp511 = icmp ult i8* %113, %114
+ br i1 %cmp511, label %if.else517, label %if.end519, !prof !6
+
+if.else517: ; preds = %if.else509
+ tail call void @abort() #6
+ unreachable
+
+if.end519: ; preds = %if.else509, %if.then506
+ %.pre-phi = phi %struct.malloc_chunk** [ %111, %if.else509 ], [ %.pre, %if.then506 ]
+ %F502.0 = phi %struct.malloc_chunk* [ %112, %if.else509 ], [ %109, %if.then506 ]
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0
+ %bk521 = getelementptr inbounds %struct.malloc_chunk* %F502.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk521, align 4, !tbaa !0
+ %fd522 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
+ store %struct.malloc_chunk* %F502.0, %struct.malloc_chunk** %fd522, align 4, !tbaa !0
+ %bk523 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
+ store %struct.malloc_chunk* %109, %struct.malloc_chunk** %bk523, align 4, !tbaa !0
+ br label %if.end635
+
+if.else524: ; preds = %if.end492
+ %115 = bitcast %struct.malloc_chunk* %p.0 to %struct.malloc_tree_chunk*
+ %shr527 = lshr i32 %psize.1, 8
+ %cmp528 = icmp eq i32 %shr527, 0
+ br i1 %cmp528, label %if.end558, label %if.else531
+
+if.else531: ; preds = %if.else524
+ %cmp532 = icmp ugt i32 %psize.1, 16777215
+ br i1 %cmp532, label %if.end558, label %if.else535
+
+if.else535: ; preds = %if.else531
+ %sub = add i32 %shr527, 1048320
+ %shr536 = lshr i32 %sub, 16
+ %and537 = and i32 %shr536, 8
+ %shl538 = shl i32 %shr527, %and537
+ %sub539 = add i32 %shl538, 520192
+ %shr540 = lshr i32 %sub539, 16
+ %and541 = and i32 %shr540, 4
+ %add542 = or i32 %and541, %and537
+ %shl543 = shl i32 %shl538, %and541
+ %sub544 = add i32 %shl543, 245760
+ %shr545 = lshr i32 %sub544, 16
+ %and546 = and i32 %shr545, 2
+ %add547 = or i32 %add542, %and546
+ %sub548 = sub i32 14, %add547
+ %shl549 = shl i32 %shl543, %and546
+ %shr550 = lshr i32 %shl549, 15
+ %add551 = add i32 %sub548, %shr550
+ %shl552 = shl nsw i32 %add551, 1
+ %add553 = add i32 %add551, 7
+ %shr554 = lshr i32 %psize.1, %add553
+ %and555 = and i32 %shr554, 1
+ %add556 = or i32 %and555, %shl552
+ br label %if.end558
+
+if.end558: ; preds = %if.else535, %if.else531, %if.else524
+ %I526.0 = phi i32 [ %add556, %if.else535 ], [ 0, %if.else524 ], [ 31, %if.else531 ]
+ %arrayidx559 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I526.0
+ %index560 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 3
+ %I526.0.c = inttoptr i32 %I526.0 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %I526.0.c, %struct.malloc_chunk** %index560, align 4, !tbaa !3
+ %arrayidx562 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 1
+ store i32 0, i32* %arrayidx562, align 4, !tbaa !0
+ %116 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 0
+ store i32 0, i32* %116, align 4, !tbaa !0
+ %117 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %shl565 = shl i32 1, %I526.0
+ %and566 = and i32 %117, %shl565
+ %tobool567 = icmp eq i32 %and566, 0
+ br i1 %tobool567, label %if.then568, label %if.else574
+
+if.then568: ; preds = %if.end558
+ %or570 = or i32 %117, %shl565
+ store i32 %or570, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %arrayidx559, align 4, !tbaa !0
+ %parent571 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
+ %.c = bitcast %struct.malloc_tree_chunk** %arrayidx559 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c, %struct.malloc_chunk** %parent571, align 4, !tbaa !0
+ %bk572 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk572, align 4, !tbaa !0
+ %fd573 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %fd573, align 4, !tbaa !0
+ br label %if.end627
+
+if.else574: ; preds = %if.end558
+ %118 = load %struct.malloc_tree_chunk** %arrayidx559, align 4, !tbaa !0
+ %cmp576 = icmp eq i32 %I526.0, 31
+ br i1 %cmp576, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.else574
+ %shr578 = lshr i32 %I526.0, 1
+ %sub581 = sub i32 25, %shr578
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.else574
+ %cond = phi i32 [ %sub581, %cond.false ], [ 0, %if.else574 ]
+ %head583266 = getelementptr inbounds %struct.malloc_tree_chunk* %118, i32 0, i32 1
+ %119 = load i32* %head583266, align 4, !tbaa !3
+ %and584267 = and i32 %119, -8
+ %cmp585268 = icmp eq i32 %and584267, %psize.1
+ br i1 %cmp585268, label %if.else607, label %if.then587.lr.ph
+
+if.then587.lr.ph: ; preds = %cond.end
+ %shl582 = shl i32 %psize.1, %cond
+ br label %if.then587
+
+for.cond: ; preds = %if.then587
+ %shl592 = shl i32 %K575.0270, 1
+ %head583 = getelementptr inbounds %struct.malloc_tree_chunk* %121, i32 0, i32 1
+ %120 = load i32* %head583, align 4, !tbaa !3
+ %and584 = and i32 %120, -8
+ %cmp585 = icmp eq i32 %and584, %psize.1
+ br i1 %cmp585, label %if.else607, label %if.then587
+
+if.then587: ; preds = %for.cond, %if.then587.lr.ph
+ %K575.0270 = phi i32 [ %shl582, %if.then587.lr.ph ], [ %shl592, %for.cond ]
+ %T.0269 = phi %struct.malloc_tree_chunk* [ %118, %if.then587.lr.ph ], [ %121, %for.cond ]
+ %shr588 = lshr i32 %K575.0270, 31
+ %arrayidx591 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0269, i32 0, i32 4, i32 %shr588
+ %121 = load %struct.malloc_tree_chunk** %arrayidx591, align 4, !tbaa !0
+ %cmp593 = icmp eq %struct.malloc_tree_chunk* %121, null
+ br i1 %cmp593, label %if.else596, label %for.cond
+
+if.else596: ; preds = %if.then587
+ %122 = bitcast %struct.malloc_tree_chunk** %arrayidx591 to i8*
+ %123 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp597 = icmp ult i8* %122, %123
+ br i1 %cmp597, label %if.else605, label %if.then601, !prof !6
+
+if.then601: ; preds = %if.else596
+ store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %arrayidx591, align 4, !tbaa !0
+ %parent602 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
+ %T.0.c239 = bitcast %struct.malloc_tree_chunk* %T.0269 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c239, %struct.malloc_chunk** %parent602, align 4, !tbaa !0
+ %bk603 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk603, align 4, !tbaa !0
+ %fd604 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
+ store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %fd604, align 4, !tbaa !0
+ br label %if.end627
+
+if.else605: ; preds = %if.else596
+ tail call void @abort() #6
+ unreachable
+
+if.else607: ; preds = %for.cond, %cond.end
+ %T.0.lcssa = phi %struct.malloc_tree_chunk* [ %118, %cond.end ], [ %121, %for.cond ]
+ %fd609 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa, i32 0, i32 2
+ %124 = load %struct.malloc_tree_chunk** %fd609, align 4, !tbaa !0
+ %125 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to i8*
+ %126 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp610 = icmp ult i8* %125, %126
+ br i1 %cmp610, label %if.else625, label %land.rhs612
+
+land.rhs612: ; preds = %if.else607
+ %127 = bitcast %struct.malloc_tree_chunk* %124 to i8*
+ %cmp613 = icmp ult i8* %127, %126
+ br i1 %cmp613, label %if.else625, label %if.then619, !prof !6
+
+if.then619: ; preds = %land.rhs612
+ %bk620 = getelementptr inbounds %struct.malloc_tree_chunk* %124, i32 0, i32 3
+ store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %bk620, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %fd609, align 4, !tbaa !0
+ %fd622 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
+ %.c238 = bitcast %struct.malloc_tree_chunk* %124 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c238, %struct.malloc_chunk** %fd622, align 4, !tbaa !0
+ %bk623 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
+ %T.0.c = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c, %struct.malloc_chunk** %bk623, align 4, !tbaa !0
+ %parent624 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent624, align 4, !tbaa !0
+ br label %if.end627
+
+if.else625: ; preds = %land.rhs612, %if.else607
+ tail call void @abort() #6
+ unreachable
+
+if.end627: ; preds = %if.then619, %if.then601, %if.then568
+ %128 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3
+ %dec = add i32 %128, -1
+ store i32 %dec, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3
+ %cmp628 = icmp eq i32 %dec, 0
+ br i1 %cmp628, label %while.cond.i, label %if.end635
+
+while.cond.i: ; preds = %while.cond.i, %if.end627
+ %sp.0.in.i = phi %struct.malloc_segment** [ %next4.i, %while.cond.i ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), %if.end627 ]
+ %sp.0.i = load %struct.malloc_segment** %sp.0.in.i, align 4
+ %cmp.i = icmp eq %struct.malloc_segment* %sp.0.i, null
+ %next4.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i, i32 0, i32 2
+ br i1 %cmp.i, label %release_unused_segments.exit, label %while.cond.i
+
+release_unused_segments.exit: ; preds = %while.cond.i
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3
+ br label %if.end635
+
+erroraction: ; preds = %land.rhs227, %if.end224, %if.else, %land.rhs, %if.then
+ tail call void @abort() #6
+ unreachable
+
+if.end635: ; preds = %release_unused_segments.exit, %if.end627, %if.end519, %if.then481, %if.then253, %if.then248, %if.then242, %if.then213, %if.then10, %entry
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak i8* @calloc(i32 %n_elements, i32 %elem_size) #0 {
+entry:
+ %cmp = icmp eq i32 %n_elements, 0
+ br i1 %cmp, label %if.end3, label %if.then
+
+if.then: ; preds = %entry
+ %mul = mul i32 %elem_size, %n_elements
+ %or = or i32 %elem_size, %n_elements
+ %tobool = icmp ugt i32 %or, 65535
+ br i1 %tobool, label %land.lhs.true, label %if.end3
+
+land.lhs.true: ; preds = %if.then
+ %div = udiv i32 %mul, %n_elements
+ %cmp1 = icmp eq i32 %div, %elem_size
+ %mul. = select i1 %cmp1, i32 %mul, i32 -1
+ br label %if.end3
+
+if.end3: ; preds = %land.lhs.true, %if.then, %entry
+ %req.0 = phi i32 [ %mul, %if.then ], [ 0, %entry ], [ %mul., %land.lhs.true ]
+ %call = tail call i8* @malloc(i32 %req.0)
+ %cmp4 = icmp eq i8* %call, null
+ br i1 %cmp4, label %if.end9, label %land.lhs.true5
+
+land.lhs.true5: ; preds = %if.end3
+ %head = getelementptr inbounds i8* %call, i32 -4
+ %0 = bitcast i8* %head to i32*
+ %1 = load i32* %0, align 4, !tbaa !3
+ %and6 = and i32 %1, 3
+ %cmp7 = icmp eq i32 %and6, 0
+ br i1 %cmp7, label %if.end9, label %if.then8
+
+if.then8: ; preds = %land.lhs.true5
+ tail call void @llvm.memset.p0i8.i32(i8* %call, i8 0, i32 %req.0, i32 1, i1 false)
+ br label %if.end9
+
+if.end9: ; preds = %if.then8, %land.lhs.true5, %if.end3
+ ret i8* %call
+}
+
+; Function Attrs: nounwind
+declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #1
+
+; Function Attrs: nounwind
+define weak i8* @realloc(i8* %oldmem, i32 %bytes) #0 {
+entry:
+ %cmp = icmp eq i8* %oldmem, null
+ br i1 %cmp, label %if.then, label %if.else
+
+if.then: ; preds = %entry
+ %call = tail call i8* @malloc(i32 %bytes)
+ br label %if.end27
+
+if.else: ; preds = %entry
+ %cmp1 = icmp ugt i32 %bytes, -65
+ br i1 %cmp1, label %if.then2, label %if.else4
+
+if.then2: ; preds = %if.else
+ %call3 = tail call i32* @__errno_location() #7
+ store i32 12, i32* %call3, align 4, !tbaa !3
+ br label %if.end27
+
+if.else4: ; preds = %if.else
+ %cmp5 = icmp ult i32 %bytes, 11
+ br i1 %cmp5, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.else4
+ %add6 = add i32 %bytes, 11
+ %and = and i32 %add6, -8
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.else4
+ %cond = phi i32 [ %and, %cond.false ], [ 16, %if.else4 ]
+ %add.ptr = getelementptr inbounds i8* %oldmem, i32 -8
+ %0 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %call7 = tail call fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %0, i32 %cond)
+ %cmp8 = icmp eq %struct.malloc_chunk* %call7, null
+ br i1 %cmp8, label %if.else11, label %if.then9
+
+if.then9: ; preds = %cond.end
+ %add.ptr10 = getelementptr inbounds %struct.malloc_chunk* %call7, i32 0, i32 2
+ %1 = bitcast %struct.malloc_chunk** %add.ptr10 to i8*
+ br label %if.end27
+
+if.else11: ; preds = %cond.end
+ %call12 = tail call i8* @malloc(i32 %bytes)
+ %cmp13 = icmp eq i8* %call12, null
+ br i1 %cmp13, label %if.end27, label %if.then14
+
+if.then14: ; preds = %if.else11
+ %head = getelementptr inbounds i8* %oldmem, i32 -4
+ %2 = bitcast i8* %head to i32*
+ %3 = load i32* %2, align 4, !tbaa !3
+ %and15 = and i32 %3, -8
+ %and17 = and i32 %3, 3
+ %cmp18 = icmp eq i32 %and17, 0
+ %cond19 = select i1 %cmp18, i32 8, i32 4
+ %sub = sub i32 %and15, %cond19
+ %cmp20 = icmp ult i32 %sub, %bytes
+ %cond24 = select i1 %cmp20, i32 %sub, i32 %bytes
+ tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %call12, i8* %oldmem, i32 %cond24, i32 1, i1 false)
+ tail call void @free(i8* %oldmem)
+ br label %if.end27
+
+if.end27: ; preds = %if.then14, %if.else11, %if.then9, %if.then2, %if.then
+ %mem.0 = phi i8* [ %call, %if.then ], [ null, %if.then2 ], [ %1, %if.then9 ], [ %call12, %if.then14 ], [ null, %if.else11 ]
+ ret i8* %mem.0
+}
+
+; Function Attrs: nounwind readnone
+declare i32* @__errno_location() #3
+
+; Function Attrs: nounwind
+define internal fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %p, i32 %nb) #0 {
+entry:
+ %head = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 1
+ %0 = load i32* %head, align 4, !tbaa !3
+ %and = and i32 %0, -8
+ %1 = bitcast %struct.malloc_chunk* %p to i8*
+ %add.ptr = getelementptr inbounds i8* %1, i32 %and
+ %2 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %3 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp = icmp ult i8* %1, %3
+ br i1 %cmp, label %if.else327, label %land.lhs.true
+
+land.lhs.true: ; preds = %entry
+ %and2 = and i32 %0, 3
+ %cmp3 = icmp ne i32 %and2, 1
+ %cmp5 = icmp ult i8* %1, %add.ptr
+ %or.cond = and i1 %cmp3, %cmp5
+ br i1 %or.cond, label %land.rhs, label %if.else327
+
+land.rhs: ; preds = %land.lhs.true
+ %add.ptr.sum1516 = or i32 %and, 4
+ %head6 = getelementptr inbounds i8* %1, i32 %add.ptr.sum1516
+ %4 = bitcast i8* %head6 to i32*
+ %5 = load i32* %4, align 4, !tbaa !3
+ %and7 = and i32 %5, 1
+ %tobool = icmp eq i32 %and7, 0
+ br i1 %tobool, label %if.else327, label %if.then, !prof !6
+
+if.then: ; preds = %land.rhs
+ %cmp11 = icmp eq i32 %and2, 0
+ br i1 %cmp11, label %if.then12, label %if.else
+
+if.then12: ; preds = %if.then
+ %cmp.i = icmp ult i32 %nb, 256
+ br i1 %cmp.i, label %if.end328, label %if.end.i
+
+if.end.i: ; preds = %if.then12
+ %add.i = add i32 %nb, 4
+ %cmp1.i = icmp ult i32 %and, %add.i
+ br i1 %cmp1.i, label %if.end34.i, label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %if.end.i
+ %sub.i = sub i32 %and, %nb
+ %6 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ %shl.i = shl i32 %6, 1
+ %cmp2.i = icmp ugt i32 %sub.i, %shl.i
+ br i1 %cmp2.i, label %if.end34.i, label %if.end328
+
+if.end34.i: ; preds = %land.lhs.true.i, %if.end.i
+ br label %if.end328
+
+if.else: ; preds = %if.then
+ %cmp13 = icmp ult i32 %and, %nb
+ br i1 %cmp13, label %if.else33, label %if.then14
+
+if.then14: ; preds = %if.else
+ %sub = sub i32 %and, %nb
+ %cmp15 = icmp ugt i32 %sub, 15
+ br i1 %cmp15, label %if.then16, label %if.end328
+
+if.then16: ; preds = %if.then14
+ %add.ptr17 = getelementptr inbounds i8* %1, i32 %nb
+ %7 = bitcast i8* %add.ptr17 to %struct.malloc_chunk*
+ %and19 = and i32 %0, 1
+ %or = or i32 %and19, %nb
+ %or20 = or i32 %or, 2
+ store i32 %or20, i32* %head, align 4, !tbaa !3
+ %add.ptr17.sum = add i32 %nb, 4
+ %head23 = getelementptr inbounds i8* %1, i32 %add.ptr17.sum
+ %8 = bitcast i8* %head23 to i32*
+ %or28 = or i32 %sub, 3
+ store i32 %or28, i32* %8, align 4, !tbaa !3
+ %9 = load i32* %4, align 4, !tbaa !3
+ %or32 = or i32 %9, 1
+ store i32 %or32, i32* %4, align 4, !tbaa !3
+ tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %7, i32 %sub)
+ br label %if.end328
+
+if.else33: ; preds = %if.else
+ %10 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp34 = icmp eq %struct.malloc_chunk* %2, %10
+ br i1 %cmp34, label %if.then35, label %if.else55
+
+if.then35: ; preds = %if.else33
+ %11 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add = add i32 %11, %and
+ %cmp36 = icmp ugt i32 %add, %nb
+ br i1 %cmp36, label %if.then37, label %if.end328
+
+if.then37: ; preds = %if.then35
+ %sub40 = sub i32 %add, %nb
+ %add.ptr41 = getelementptr inbounds i8* %1, i32 %nb
+ %12 = bitcast i8* %add.ptr41 to %struct.malloc_chunk*
+ %and43 = and i32 %0, 1
+ %or44 = or i32 %and43, %nb
+ %or45 = or i32 %or44, 2
+ store i32 %or45, i32* %head, align 4, !tbaa !3
+ %add.ptr41.sum = add i32 %nb, 4
+ %head48 = getelementptr inbounds i8* %1, i32 %add.ptr41.sum
+ %13 = bitcast i8* %head48 to i32*
+ %or50 = or i32 %sub40, 1
+ store i32 %or50, i32* %13, align 4, !tbaa !3
+ store %struct.malloc_chunk* %12, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ store i32 %sub40, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ br label %if.end328
+
+if.else55: ; preds = %if.else33
+ %14 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp56 = icmp eq %struct.malloc_chunk* %2, %14
+ br i1 %cmp56, label %if.then57, label %if.else98
+
+if.then57: ; preds = %if.else55
+ %15 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %add58 = add i32 %15, %and
+ %cmp59 = icmp ult i32 %add58, %nb
+ br i1 %cmp59, label %if.end328, label %if.then60
+
+if.then60: ; preds = %if.then57
+ %sub62 = sub i32 %add58, %nb
+ %cmp63 = icmp ugt i32 %sub62, 15
+ br i1 %cmp63, label %if.then64, label %if.else83
+
+if.then64: ; preds = %if.then60
+ %add.ptr66 = getelementptr inbounds i8* %1, i32 %nb
+ %16 = bitcast i8* %add.ptr66 to %struct.malloc_chunk*
+ %add.ptr67 = getelementptr inbounds i8* %1, i32 %add58
+ %and69 = and i32 %0, 1
+ %or70 = or i32 %and69, %nb
+ %or71 = or i32 %or70, 2
+ store i32 %or71, i32* %head, align 4, !tbaa !3
+ %add.ptr66.sum = add i32 %nb, 4
+ %head74 = getelementptr inbounds i8* %1, i32 %add.ptr66.sum
+ %17 = bitcast i8* %head74 to i32*
+ %or76 = or i32 %sub62, 1
+ store i32 %or76, i32* %17, align 4, !tbaa !3
+ %prev_foot = bitcast i8* %add.ptr67 to i32*
+ store i32 %sub62, i32* %prev_foot, align 4, !tbaa !3
+ %add.ptr67.sum = add i32 %add58, 4
+ %head79 = getelementptr inbounds i8* %1, i32 %add.ptr67.sum
+ %18 = bitcast i8* %head79 to i32*
+ %19 = load i32* %18, align 4, !tbaa !3
+ %and80 = and i32 %19, -2
+ store i32 %and80, i32* %18, align 4, !tbaa !3
+ br label %if.end96
+
+if.else83: ; preds = %if.then60
+ %and87 = and i32 %0, 1
+ %or88 = or i32 %and87, %add58
+ %or89 = or i32 %or88, 2
+ store i32 %or89, i32* %head, align 4, !tbaa !3
+ %add.ptr91.sum = add i32 %add58, 4
+ %head92 = getelementptr inbounds i8* %1, i32 %add.ptr91.sum
+ %20 = bitcast i8* %head92 to i32*
+ %21 = load i32* %20, align 4, !tbaa !3
+ %or93 = or i32 %21, 1
+ store i32 %or93, i32* %20, align 4, !tbaa !3
+ br label %if.end96
+
+if.end96: ; preds = %if.else83, %if.then64
+ %storemerge12 = phi i32 [ %sub62, %if.then64 ], [ 0, %if.else83 ]
+ %storemerge = phi %struct.malloc_chunk* [ %16, %if.then64 ], [ null, %if.else83 ]
+ store i32 %storemerge12, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %storemerge, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ br label %if.end328
+
+if.else98: ; preds = %if.else55
+ %and100 = and i32 %5, 2
+ %tobool101 = icmp eq i32 %and100, 0
+ br i1 %tobool101, label %if.then102, label %if.end328
+
+if.then102: ; preds = %if.else98
+ %and104 = and i32 %5, -8
+ %add105 = add i32 %and104, %and
+ %cmp106 = icmp ult i32 %add105, %nb
+ br i1 %cmp106, label %if.end328, label %if.then107
+
+if.then107: ; preds = %if.then102
+ %sub110 = sub i32 %add105, %nb
+ %shr = lshr i32 %5, 3
+ %cmp111 = icmp ult i32 %5, 256
+ br i1 %cmp111, label %if.then112, label %if.else154
+
+if.then112: ; preds = %if.then107
+ %add.ptr.sum10 = add i32 %and, 8
+ %fd = getelementptr inbounds i8* %1, i32 %add.ptr.sum10
+ %22 = bitcast i8* %fd to %struct.malloc_chunk**
+ %23 = load %struct.malloc_chunk** %22, align 4, !tbaa !0
+ %add.ptr.sum11 = add i32 %and, 12
+ %bk = getelementptr inbounds i8* %1, i32 %add.ptr.sum11
+ %24 = bitcast i8* %bk to %struct.malloc_chunk**
+ %25 = load %struct.malloc_chunk** %24, align 4, !tbaa !0
+ %shl = shl nuw nsw i32 %shr, 1
+ %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl
+ %26 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk*
+ %cmp114 = icmp eq %struct.malloc_chunk* %23, %26
+ br i1 %cmp114, label %if.then124, label %lor.rhs
+
+lor.rhs: ; preds = %if.then112
+ %27 = bitcast %struct.malloc_chunk* %23 to i8*
+ %cmp116 = icmp ult i8* %27, %3
+ br i1 %cmp116, label %if.else152, label %land.rhs117
+
+land.rhs117: ; preds = %lor.rhs
+ %bk118 = getelementptr inbounds %struct.malloc_chunk* %23, i32 0, i32 3
+ %28 = load %struct.malloc_chunk** %bk118, align 4, !tbaa !0
+ %cmp119 = icmp eq %struct.malloc_chunk* %28, %2
+ br i1 %cmp119, label %if.then124, label %if.else152, !prof !5
+
+if.then124: ; preds = %land.rhs117, %if.then112
+ %cmp125 = icmp eq %struct.malloc_chunk* %25, %23
+ br i1 %cmp125, label %if.then126, label %if.else129
+
+if.then126: ; preds = %if.then124
+ %shl127 = shl i32 1, %shr
+ %neg = xor i32 %shl127, -1
+ %29 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and128 = and i32 %29, %neg
+ store i32 %and128, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end287
+
+if.else129: ; preds = %if.then124
+ %cmp133 = icmp eq %struct.malloc_chunk* %25, %26
+ br i1 %cmp133, label %if.else129.if.then146_crit_edge, label %lor.rhs134
+
+if.else129.if.then146_crit_edge: ; preds = %if.else129
+ %fd148.pre = getelementptr inbounds %struct.malloc_chunk* %25, i32 0, i32 2
+ br label %if.then146
+
+lor.rhs134: ; preds = %if.else129
+ %30 = bitcast %struct.malloc_chunk* %25 to i8*
+ %cmp136 = icmp ult i8* %30, %3
+ br i1 %cmp136, label %if.else149, label %land.rhs137
+
+land.rhs137: ; preds = %lor.rhs134
+ %fd138 = getelementptr inbounds %struct.malloc_chunk* %25, i32 0, i32 2
+ %31 = load %struct.malloc_chunk** %fd138, align 4, !tbaa !0
+ %cmp139 = icmp eq %struct.malloc_chunk* %31, %2
+ br i1 %cmp139, label %if.then146, label %if.else149, !prof !5
+
+if.then146: ; preds = %land.rhs137, %if.else129.if.then146_crit_edge
+ %fd148.pre-phi = phi %struct.malloc_chunk** [ %fd148.pre, %if.else129.if.then146_crit_edge ], [ %fd138, %land.rhs137 ]
+ %bk147 = getelementptr inbounds %struct.malloc_chunk* %23, i32 0, i32 3
+ store %struct.malloc_chunk* %25, %struct.malloc_chunk** %bk147, align 4, !tbaa !0
+ store %struct.malloc_chunk* %23, %struct.malloc_chunk** %fd148.pre-phi, align 4, !tbaa !0
+ br label %if.end287
+
+if.else149: ; preds = %land.rhs137, %lor.rhs134
+ tail call void @abort() #6
+ unreachable
+
+if.else152: ; preds = %land.rhs117, %lor.rhs
+ tail call void @abort() #6
+ unreachable
+
+if.else154: ; preds = %if.then107
+ %32 = bitcast i8* %add.ptr to %struct.malloc_tree_chunk*
+ %add.ptr.sum = add i32 %and, 24
+ %parent = getelementptr inbounds i8* %1, i32 %add.ptr.sum
+ %33 = bitcast i8* %parent to %struct.malloc_tree_chunk**
+ %34 = load %struct.malloc_tree_chunk** %33, align 4, !tbaa !0
+ %add.ptr.sum2 = add i32 %and, 12
+ %bk155 = getelementptr inbounds i8* %1, i32 %add.ptr.sum2
+ %35 = bitcast i8* %bk155 to %struct.malloc_tree_chunk**
+ %36 = load %struct.malloc_tree_chunk** %35, align 4, !tbaa !0
+ %cmp156 = icmp eq %struct.malloc_tree_chunk* %36, %32
+ br i1 %cmp156, label %if.else178, label %if.then157
+
+if.then157: ; preds = %if.else154
+ %add.ptr.sum9 = add i32 %and, 8
+ %fd159 = getelementptr inbounds i8* %1, i32 %add.ptr.sum9
+ %37 = bitcast i8* %fd159 to %struct.malloc_tree_chunk**
+ %38 = load %struct.malloc_tree_chunk** %37, align 4, !tbaa !0
+ %39 = bitcast %struct.malloc_tree_chunk* %38 to i8*
+ %cmp162 = icmp ult i8* %39, %3
+ br i1 %cmp162, label %if.else176, label %land.lhs.true163
+
+land.lhs.true163: ; preds = %if.then157
+ %bk164 = getelementptr inbounds %struct.malloc_tree_chunk* %38, i32 0, i32 3
+ %40 = load %struct.malloc_tree_chunk** %bk164, align 4, !tbaa !0
+ %cmp165 = icmp eq %struct.malloc_tree_chunk* %40, %32
+ br i1 %cmp165, label %land.rhs166, label %if.else176
+
+land.rhs166: ; preds = %land.lhs.true163
+ %fd167 = getelementptr inbounds %struct.malloc_tree_chunk* %36, i32 0, i32 2
+ %41 = load %struct.malloc_tree_chunk** %fd167, align 4, !tbaa !0
+ %cmp168 = icmp eq %struct.malloc_tree_chunk* %41, %32
+ br i1 %cmp168, label %if.then173, label %if.else176, !prof !5
+
+if.then173: ; preds = %land.rhs166
+ store %struct.malloc_tree_chunk* %36, %struct.malloc_tree_chunk** %bk164, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %38, %struct.malloc_tree_chunk** %fd167, align 4, !tbaa !0
+ br label %if.end202
+
+if.else176: ; preds = %land.rhs166, %land.lhs.true163, %if.then157
+ tail call void @abort() #6
+ unreachable
+
+if.else178: ; preds = %if.else154
+ %child.sum = add i32 %and, 20
+ %arrayidx179 = getelementptr inbounds i8* %1, i32 %child.sum
+ %42 = bitcast i8* %arrayidx179 to %struct.malloc_tree_chunk**
+ %43 = load %struct.malloc_tree_chunk** %42, align 4, !tbaa !0
+ %cmp180 = icmp eq %struct.malloc_tree_chunk* %43, null
+ br i1 %cmp180, label %lor.lhs.false, label %while.cond
+
+lor.lhs.false: ; preds = %if.else178
+ %add.ptr.sum3 = add i32 %and, 16
+ %child = getelementptr inbounds i8* %1, i32 %add.ptr.sum3
+ %arrayidx182 = bitcast i8* %child to %struct.malloc_tree_chunk**
+ %44 = load %struct.malloc_tree_chunk** %arrayidx182, align 4, !tbaa !0
+ %cmp183 = icmp eq %struct.malloc_tree_chunk* %44, null
+ br i1 %cmp183, label %if.end202, label %while.cond
+
+while.cond: ; preds = %lor.rhs188, %while.cond, %lor.lhs.false, %if.else178
+ %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx182, %lor.lhs.false ], [ %42, %if.else178 ], [ %arrayidx186, %while.cond ], [ %arrayidx190, %lor.rhs188 ]
+ %R.0 = phi %struct.malloc_tree_chunk* [ %44, %lor.lhs.false ], [ %43, %if.else178 ], [ %45, %while.cond ], [ %46, %lor.rhs188 ]
+ %arrayidx186 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1
+ %45 = load %struct.malloc_tree_chunk** %arrayidx186, align 4, !tbaa !0
+ %cmp187 = icmp eq %struct.malloc_tree_chunk* %45, null
+ br i1 %cmp187, label %lor.rhs188, label %while.cond
+
+lor.rhs188: ; preds = %while.cond
+ %arrayidx190 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0
+ %46 = load %struct.malloc_tree_chunk** %arrayidx190, align 4, !tbaa !0
+ %cmp191 = icmp eq %struct.malloc_tree_chunk* %46, null
+ br i1 %cmp191, label %while.end, label %while.cond
+
+while.end: ; preds = %lor.rhs188
+ %47 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8*
+ %cmp195 = icmp ult i8* %47, %3
+ br i1 %cmp195, label %if.else199, label %if.then198, !prof !6
+
+if.then198: ; preds = %while.end
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0
+ br label %if.end202
+
+if.else199: ; preds = %while.end
+ tail call void @abort() #6
+ unreachable
+
+if.end202: ; preds = %if.then198, %lor.lhs.false, %if.then173
+ %R.1 = phi %struct.malloc_tree_chunk* [ %36, %if.then173 ], [ %R.0, %if.then198 ], [ null, %lor.lhs.false ]
+ %cmp203 = icmp eq %struct.malloc_tree_chunk* %34, null
+ br i1 %cmp203, label %if.end287, label %if.then205
+
+if.then205: ; preds = %if.end202
+ %add.ptr.sum7 = add i32 %and, 28
+ %index = getelementptr inbounds i8* %1, i32 %add.ptr.sum7
+ %48 = bitcast i8* %index to i32*
+ %49 = load i32* %48, align 4, !tbaa !3
+ %arrayidx206 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %49
+ %50 = load %struct.malloc_tree_chunk** %arrayidx206, align 4, !tbaa !0
+ %cmp207 = icmp eq %struct.malloc_tree_chunk* %32, %50
+ br i1 %cmp207, label %if.then209, label %if.else218
+
+if.then209: ; preds = %if.then205
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx206, align 4, !tbaa !0
+ %cond = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cond, label %if.end238.thread, label %if.then241
+
+if.end238.thread: ; preds = %if.then209
+ %shl214 = shl i32 1, %49
+ %neg215 = xor i32 %shl214, -1
+ %51 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and216 = and i32 %51, %neg215
+ store i32 %and216, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end287
+
+if.else218: ; preds = %if.then205
+ %52 = bitcast %struct.malloc_tree_chunk* %34 to i8*
+ %53 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp220 = icmp ult i8* %52, %53
+ br i1 %cmp220, label %if.else236, label %if.then224, !prof !6
+
+if.then224: ; preds = %if.else218
+ %arrayidx226 = getelementptr inbounds %struct.malloc_tree_chunk* %34, i32 0, i32 4, i32 0
+ %54 = load %struct.malloc_tree_chunk** %arrayidx226, align 4, !tbaa !0
+ %cmp227 = icmp eq %struct.malloc_tree_chunk* %54, %32
+ br i1 %cmp227, label %if.then229, label %if.else232
+
+if.then229: ; preds = %if.then224
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx226, align 4, !tbaa !0
+ br label %if.end238
+
+if.else232: ; preds = %if.then224
+ %arrayidx234 = getelementptr inbounds %struct.malloc_tree_chunk* %34, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx234, align 4, !tbaa !0
+ br label %if.end238
+
+if.else236: ; preds = %if.else218
+ tail call void @abort() #6
+ unreachable
+
+if.end238: ; preds = %if.else232, %if.then229
+ %cmp239 = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cmp239, label %if.end287, label %if.then241
+
+if.then241: ; preds = %if.end238, %if.then209
+ %55 = bitcast %struct.malloc_tree_chunk* %R.1 to i8*
+ %56 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp243 = icmp ult i8* %55, %56
+ br i1 %cmp243, label %if.else283, label %if.then247, !prof !6
+
+if.then247: ; preds = %if.then241
+ %parent248 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %34, %struct.malloc_tree_chunk** %parent248, align 4, !tbaa !0
+ %add.ptr.sum8 = add i32 %and, 16
+ %child249 = getelementptr inbounds i8* %1, i32 %add.ptr.sum8
+ %arrayidx250 = bitcast i8* %child249 to %struct.malloc_tree_chunk**
+ %57 = load %struct.malloc_tree_chunk** %arrayidx250, align 4, !tbaa !0
+ %cmp251 = icmp eq %struct.malloc_tree_chunk* %57, null
+ br i1 %cmp251, label %if.end265, label %if.then253
+
+if.then253: ; preds = %if.then247
+ %58 = bitcast %struct.malloc_tree_chunk* %57 to i8*
+ %59 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp255 = icmp ult i8* %58, %59
+ br i1 %cmp255, label %if.else263, label %if.then259, !prof !6
+
+if.then259: ; preds = %if.then253
+ %arrayidx261 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %57, %struct.malloc_tree_chunk** %arrayidx261, align 4, !tbaa !0
+ %parent262 = getelementptr inbounds %struct.malloc_tree_chunk* %57, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent262, align 4, !tbaa !0
+ br label %if.end265
+
+if.else263: ; preds = %if.then253
+ tail call void @abort() #6
+ unreachable
+
+if.end265: ; preds = %if.then259, %if.then247
+ %child249.sum = add i32 %and, 20
+ %arrayidx267 = getelementptr inbounds i8* %1, i32 %child249.sum
+ %60 = bitcast i8* %arrayidx267 to %struct.malloc_tree_chunk**
+ %61 = load %struct.malloc_tree_chunk** %60, align 4, !tbaa !0
+ %cmp268 = icmp eq %struct.malloc_tree_chunk* %61, null
+ br i1 %cmp268, label %if.end287, label %if.then270
+
+if.then270: ; preds = %if.end265
+ %62 = bitcast %struct.malloc_tree_chunk* %61 to i8*
+ %63 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp272 = icmp ult i8* %62, %63
+ br i1 %cmp272, label %if.else280, label %if.then276, !prof !6
+
+if.then276: ; preds = %if.then270
+ %arrayidx278 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %61, %struct.malloc_tree_chunk** %arrayidx278, align 4, !tbaa !0
+ %parent279 = getelementptr inbounds %struct.malloc_tree_chunk* %61, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent279, align 4, !tbaa !0
+ br label %if.end287
+
+if.else280: ; preds = %if.then270
+ tail call void @abort() #6
+ unreachable
+
+if.else283: ; preds = %if.then241
+ tail call void @abort() #6
+ unreachable
+
+if.end287: ; preds = %if.then276, %if.end265, %if.end238, %if.end238.thread, %if.end202, %if.then146, %if.then126
+ %cmp288 = icmp ult i32 %sub110, 16
+ br i1 %cmp288, label %if.then290, label %if.else301
+
+if.then290: ; preds = %if.end287
+ %64 = load i32* %head, align 4, !tbaa !3
+ %and294 = and i32 %64, 1
+ %or295 = or i32 %add105, %and294
+ %or296 = or i32 %or295, 2
+ store i32 %or296, i32* %head, align 4, !tbaa !3
+ %add.ptr298.sum6 = or i32 %add105, 4
+ %head299 = getelementptr inbounds i8* %1, i32 %add.ptr298.sum6
+ %65 = bitcast i8* %head299 to i32*
+ %66 = load i32* %65, align 4, !tbaa !3
+ %or300 = or i32 %66, 1
+ store i32 %or300, i32* %65, align 4, !tbaa !3
+ br label %if.end328
+
+if.else301: ; preds = %if.end287
+ %add.ptr303 = getelementptr inbounds i8* %1, i32 %nb
+ %67 = bitcast i8* %add.ptr303 to %struct.malloc_chunk*
+ %68 = load i32* %head, align 4, !tbaa !3
+ %and305 = and i32 %68, 1
+ %or306 = or i32 %and305, %nb
+ %or307 = or i32 %or306, 2
+ store i32 %or307, i32* %head, align 4, !tbaa !3
+ %add.ptr303.sum = add i32 %nb, 4
+ %head310 = getelementptr inbounds i8* %1, i32 %add.ptr303.sum
+ %69 = bitcast i8* %head310 to i32*
+ %or315 = or i32 %sub110, 3
+ store i32 %or315, i32* %69, align 4, !tbaa !3
+ %add.ptr317.sum5 = or i32 %add105, 4
+ %head318 = getelementptr inbounds i8* %1, i32 %add.ptr317.sum5
+ %70 = bitcast i8* %head318 to i32*
+ %71 = load i32* %70, align 4, !tbaa !3
+ %or319 = or i32 %71, 1
+ store i32 %or319, i32* %70, align 4, !tbaa !3
+ tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %67, i32 %sub110)
+ br label %if.end328
+
+if.else327: ; preds = %land.rhs, %land.lhs.true, %entry
+ tail call void @abort() #6
+ unreachable
+
+if.end328: ; preds = %if.else301, %if.then290, %if.then102, %if.else98, %if.end96, %if.then57, %if.then37, %if.then35, %if.then16, %if.then14, %if.end34.i, %land.lhs.true.i, %if.then12
+ %newp.0 = phi %struct.malloc_chunk* [ %p, %if.then37 ], [ null, %if.then35 ], [ %p, %if.end96 ], [ null, %if.then57 ], [ null, %if.else98 ], [ null, %if.then102 ], [ %p, %if.then16 ], [ %p, %if.then14 ], [ %p, %if.else301 ], [ %p, %if.then290 ], [ null, %if.end34.i ], [ null, %if.then12 ], [ %p, %land.lhs.true.i ]
+ ret %struct.malloc_chunk* %newp.0
+}
+
+; Function Attrs: nounwind
+define weak i8* @realloc_in_place(i8* %oldmem, i32 %bytes) #0 {
+entry:
+ %cmp = icmp eq i8* %oldmem, null
+ br i1 %cmp, label %if.end9, label %if.then
+
+if.then: ; preds = %entry
+ %cmp1 = icmp ugt i32 %bytes, -65
+ br i1 %cmp1, label %if.then2, label %if.else
+
+if.then2: ; preds = %if.then
+ %call = tail call i32* @__errno_location() #7
+ store i32 12, i32* %call, align 4, !tbaa !3
+ br label %if.end9
+
+if.else: ; preds = %if.then
+ %cmp3 = icmp ult i32 %bytes, 11
+ br i1 %cmp3, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.else
+ %add4 = add i32 %bytes, 11
+ %and = and i32 %add4, -8
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.else
+ %cond = phi i32 [ %and, %cond.false ], [ 16, %if.else ]
+ %add.ptr = getelementptr inbounds i8* %oldmem, i32 -8
+ %0 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %call5 = tail call fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %0, i32 %cond)
+ %cmp6 = icmp eq %struct.malloc_chunk* %call5, %0
+ %oldmem. = select i1 %cmp6, i8* %oldmem, i8* null
+ ret i8* %oldmem.
+
+if.end9: ; preds = %if.then2, %entry
+ ret i8* null
+}
+
+; Function Attrs: nounwind
+define weak i8* @memalign(i32 %alignment, i32 %bytes) #0 {
+entry:
+ %cmp = icmp ult i32 %alignment, 9
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ %call = tail call i8* @malloc(i32 %bytes)
+ br label %return
+
+if.end: ; preds = %entry
+ %call1 = tail call fastcc i8* @internal_memalign(i32 %alignment, i32 %bytes)
+ br label %return
+
+return: ; preds = %if.end, %if.then
+ %retval.0 = phi i8* [ %call, %if.then ], [ %call1, %if.end ]
+ ret i8* %retval.0
+}
+
+; Function Attrs: nounwind
+define internal fastcc i8* @internal_memalign(i32 %alignment, i32 %bytes) #0 {
+entry:
+ %cmp = icmp ult i32 %alignment, 16
+ %.alignment = select i1 %cmp, i32 16, i32 %alignment
+ %sub = add i32 %.alignment, -1
+ %and = and i32 %sub, %.alignment
+ %cmp1 = icmp eq i32 %and, 0
+ br i1 %cmp1, label %if.end4, label %while.cond
+
+while.cond: ; preds = %while.cond, %entry
+ %a.0 = phi i32 [ %shl, %while.cond ], [ 16, %entry ]
+ %cmp3 = icmp ult i32 %a.0, %.alignment
+ %shl = shl i32 %a.0, 1
+ br i1 %cmp3, label %while.cond, label %if.end4
+
+if.end4: ; preds = %while.cond, %entry
+ %alignment.addr.1 = phi i32 [ %.alignment, %entry ], [ %a.0, %while.cond ]
+ %sub5 = sub i32 -64, %alignment.addr.1
+ %cmp6 = icmp ugt i32 %sub5, %bytes
+ br i1 %cmp6, label %if.else, label %if.then9
+
+if.then9: ; preds = %if.end4
+ %call = tail call i32* @__errno_location() #7
+ store i32 12, i32* %call, align 4, !tbaa !3
+ br label %if.end96
+
+if.else: ; preds = %if.end4
+ %cmp11 = icmp ult i32 %bytes, 11
+ br i1 %cmp11, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.else
+ %add12 = add i32 %bytes, 11
+ %and13 = and i32 %add12, -8
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.else
+ %cond = phi i32 [ %and13, %cond.false ], [ 16, %if.else ]
+ %add14 = add i32 %alignment.addr.1, 12
+ %sub16 = add i32 %add14, %cond
+ %call17 = tail call i8* @malloc(i32 %sub16)
+ %cmp18 = icmp eq i8* %call17, null
+ br i1 %cmp18, label %if.end96, label %if.then19
+
+if.then19: ; preds = %cond.end
+ %add.ptr = getelementptr inbounds i8* %call17, i32 -8
+ %0 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %1 = ptrtoint i8* %call17 to i32
+ %sub20 = add i32 %alignment.addr.1, -1
+ %and21 = and i32 %1, %sub20
+ %cmp22 = icmp eq i32 %and21, 0
+ br i1 %cmp22, label %if.end64, label %if.then23
+
+if.then23: ; preds = %if.then19
+ %add.ptr25 = getelementptr inbounds i8* %call17, i32 %sub20
+ %2 = ptrtoint i8* %add.ptr25 to i32
+ %sub26 = sub i32 0, %alignment.addr.1
+ %and27 = and i32 %2, %sub26
+ %3 = inttoptr i32 %and27 to i8*
+ %add.ptr28 = getelementptr inbounds i8* %3, i32 -8
+ %sub.ptr.lhs.cast = ptrtoint i8* %add.ptr28 to i32
+ %sub.ptr.rhs.cast = ptrtoint i8* %add.ptr to i32
+ %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
+ %cmp29 = icmp ugt i32 %sub.ptr.sub, 15
+ br i1 %cmp29, label %cond.end33, label %cond.false31
+
+cond.false31: ; preds = %if.then23
+ %add.ptr28.sum = add i32 %alignment.addr.1, -8
+ %add.ptr32 = getelementptr inbounds i8* %3, i32 %add.ptr28.sum
+ br label %cond.end33
+
+cond.end33: ; preds = %cond.false31, %if.then23
+ %cond34 = phi i8* [ %add.ptr32, %cond.false31 ], [ %add.ptr28, %if.then23 ]
+ %4 = bitcast i8* %cond34 to %struct.malloc_chunk*
+ %sub.ptr.lhs.cast35 = ptrtoint i8* %cond34 to i32
+ %sub.ptr.sub37 = sub i32 %sub.ptr.lhs.cast35, %sub.ptr.rhs.cast
+ %head = getelementptr inbounds i8* %call17, i32 -4
+ %5 = bitcast i8* %head to i32*
+ %6 = load i32* %5, align 4, !tbaa !3
+ %and38 = and i32 %6, -8
+ %sub39 = sub i32 %and38, %sub.ptr.sub37
+ %and41 = and i32 %6, 3
+ %cmp42 = icmp eq i32 %and41, 0
+ br i1 %cmp42, label %if.then43, label %if.else47
+
+if.then43: ; preds = %cond.end33
+ %prev_foot = bitcast i8* %add.ptr to i32*
+ %7 = load i32* %prev_foot, align 4, !tbaa !3
+ %add44 = add i32 %7, %sub.ptr.sub37
+ %prev_foot45 = bitcast i8* %cond34 to i32*
+ store i32 %add44, i32* %prev_foot45, align 4, !tbaa !3
+ %head46 = getelementptr inbounds i8* %cond34, i32 4
+ %8 = bitcast i8* %head46 to i32*
+ store i32 %sub39, i32* %8, align 4, !tbaa !3
+ br label %if.end64
+
+if.else47: ; preds = %cond.end33
+ %head48 = getelementptr inbounds i8* %cond34, i32 4
+ %9 = bitcast i8* %head48 to i32*
+ %10 = load i32* %9, align 4, !tbaa !3
+ %and49 = and i32 %10, 1
+ %or = or i32 %sub39, %and49
+ %or50 = or i32 %or, 2
+ store i32 %or50, i32* %9, align 4, !tbaa !3
+ %add.ptr52.sum = add i32 %sub39, 4
+ %head53 = getelementptr inbounds i8* %cond34, i32 %add.ptr52.sum
+ %11 = bitcast i8* %head53 to i32*
+ %12 = load i32* %11, align 4, !tbaa !3
+ %or54 = or i32 %12, 1
+ store i32 %or54, i32* %11, align 4, !tbaa !3
+ %13 = load i32* %5, align 4, !tbaa !3
+ %and56 = and i32 %13, 1
+ %or57 = or i32 %sub.ptr.sub37, %and56
+ %or58 = or i32 %or57, 2
+ store i32 %or58, i32* %5, align 4, !tbaa !3
+ %add.ptr60.sum = add i32 %sub.ptr.sub37, -4
+ %head61 = getelementptr inbounds i8* %call17, i32 %add.ptr60.sum
+ %14 = bitcast i8* %head61 to i32*
+ %15 = load i32* %14, align 4, !tbaa !3
+ %or62 = or i32 %15, 1
+ store i32 %or62, i32* %14, align 4, !tbaa !3
+ tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %0, i32 %sub.ptr.sub37)
+ br label %if.end64
+
+if.end64: ; preds = %if.else47, %if.then43, %if.then19
+ %p.0 = phi %struct.malloc_chunk* [ %0, %if.then19 ], [ %4, %if.else47 ], [ %4, %if.then43 ]
+ %head65 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
+ %16 = load i32* %head65, align 4, !tbaa !3
+ %and66 = and i32 %16, 3
+ %cmp67 = icmp eq i32 %and66, 0
+ br i1 %cmp67, label %if.end93, label %if.then68
+
+if.then68: ; preds = %if.end64
+ %and70 = and i32 %16, -8
+ %add71 = add i32 %cond, 16
+ %cmp72 = icmp ugt i32 %and70, %add71
+ br i1 %cmp72, label %if.then73, label %if.end93
+
+if.then73: ; preds = %if.then68
+ %sub74 = sub i32 %and70, %cond
+ %17 = bitcast %struct.malloc_chunk* %p.0 to i8*
+ %add.ptr75 = getelementptr inbounds i8* %17, i32 %cond
+ %18 = bitcast i8* %add.ptr75 to %struct.malloc_chunk*
+ %and77 = and i32 %16, 1
+ %or78 = or i32 %cond, %and77
+ %or79 = or i32 %or78, 2
+ store i32 %or79, i32* %head65, align 4, !tbaa !3
+ %add.ptr75.sum1 = or i32 %cond, 4
+ %head82 = getelementptr inbounds i8* %17, i32 %add.ptr75.sum1
+ %19 = bitcast i8* %head82 to i32*
+ %or87 = or i32 %sub74, 3
+ store i32 %or87, i32* %19, align 4, !tbaa !3
+ %add.ptr89.sum2 = or i32 %and70, 4
+ %head90 = getelementptr inbounds i8* %17, i32 %add.ptr89.sum2
+ %20 = bitcast i8* %head90 to i32*
+ %21 = load i32* %20, align 4, !tbaa !3
+ %or91 = or i32 %21, 1
+ store i32 %or91, i32* %20, align 4, !tbaa !3
+ tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %18, i32 %sub74)
+ br label %if.end93
+
+if.end93: ; preds = %if.then73, %if.then68, %if.end64
+ %add.ptr94 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
+ %22 = bitcast %struct.malloc_chunk** %add.ptr94 to i8*
+ br label %if.end96
+
+if.end96: ; preds = %if.end93, %cond.end, %if.then9
+ %mem.0 = phi i8* [ null, %if.then9 ], [ %22, %if.end93 ], [ null, %cond.end ]
+ ret i8* %mem.0
+}
+
+; Function Attrs: nounwind
+define weak i32 @posix_memalign(i8** %pp, i32 %alignment, i32 %bytes) #0 {
+entry:
+ %cmp = icmp eq i32 %alignment, 8
+ br i1 %cmp, label %if.then, label %if.else
+
+if.then: ; preds = %entry
+ %call = tail call i8* @malloc(i32 %bytes)
+ br label %if.end15
+
+if.else: ; preds = %entry
+ %div = lshr i32 %alignment, 2
+ %rem = and i32 %alignment, 3
+ %cmp1 = icmp ne i32 %rem, 0
+ %cmp2 = icmp eq i32 %div, 0
+ %or.cond = or i1 %cmp1, %cmp2
+ br i1 %or.cond, label %return, label %lor.lhs.false3
+
+lor.lhs.false3: ; preds = %if.else
+ %sub = add i32 %div, 1073741823
+ %and = and i32 %sub, %div
+ %cmp4 = icmp eq i32 %and, 0
+ br i1 %cmp4, label %if.else6, label %return
+
+if.else6: ; preds = %lor.lhs.false3
+ %sub7 = sub i32 -64, %alignment
+ %cmp8 = icmp ult i32 %sub7, %bytes
+ br i1 %cmp8, label %return, label %if.then9
+
+if.then9: ; preds = %if.else6
+ %cmp10 = icmp ult i32 %alignment, 16
+ %.alignment = select i1 %cmp10, i32 16, i32 %alignment
+ %call12 = tail call fastcc i8* @internal_memalign(i32 %.alignment, i32 %bytes)
+ br label %if.end15
+
+if.end15: ; preds = %if.then9, %if.then
+ %mem.0 = phi i8* [ %call, %if.then ], [ %call12, %if.then9 ]
+ %cmp16 = icmp eq i8* %mem.0, null
+ br i1 %cmp16, label %return, label %if.else18
+
+if.else18: ; preds = %if.end15
+ store i8* %mem.0, i8** %pp, align 4, !tbaa !0
+ br label %return
+
+return: ; preds = %if.else18, %if.end15, %if.else6, %lor.lhs.false3, %if.else
+ %retval.0 = phi i32 [ 0, %if.else18 ], [ 22, %if.else ], [ 22, %lor.lhs.false3 ], [ 12, %if.end15 ], [ 12, %if.else6 ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+define weak i8* @valloc(i32 %bytes) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp = icmp eq i32 %0, 0
+ br i1 %cmp, label %if.then.i, label %lor.end
+
+if.then.i: ; preds = %entry
+ %call.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i = add i32 %call.i, -1
+ %and.i = and i32 %sub.i, %call.i
+ %cmp1.i = icmp eq i32 %and.i, 0
+ br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i
+
+if.then5.i: ; preds = %if.then.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit: ; preds = %if.then.i
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i = tail call i32 @time(i32* null) #1
+ %xor.i = and i32 %call6.i, -16
+ %and7.i = xor i32 %xor.i, 1431655768
+ store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end
+
+lor.end: ; preds = %init_mparams.exit, %entry
+ %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ %call1 = tail call i8* @memalign(i32 %1, i32 %bytes)
+ ret i8* %call1
+}
+
+; Function Attrs: nounwind
+define weak i8* @pvalloc(i32 %bytes) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp = icmp eq i32 %0, 0
+ br i1 %cmp, label %if.then.i, label %lor.end
+
+if.then.i: ; preds = %entry
+ %call.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i = add i32 %call.i, -1
+ %and.i = and i32 %sub.i, %call.i
+ %cmp1.i = icmp eq i32 %and.i, 0
+ br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i
+
+if.then5.i: ; preds = %if.then.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit: ; preds = %if.then.i
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i = tail call i32 @time(i32* null) #1
+ %xor.i = and i32 %call6.i, -16
+ %and7.i = xor i32 %xor.i, 1431655768
+ store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end
+
+lor.end: ; preds = %init_mparams.exit, %entry
+ %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ %add = add i32 %bytes, -1
+ %sub = add i32 %add, %1
+ %neg = sub i32 0, %1
+ %and = and i32 %sub, %neg
+ %call2 = tail call i8* @memalign(i32 %1, i32 %and)
+ ret i8* %call2
+}
+
+; Function Attrs: nounwind
+define weak i8** @independent_calloc(i32 %n_elements, i32 %elem_size, i8** %chunks) #0 {
+entry:
+ %sz = alloca i32, align 4
+ store i32 %elem_size, i32* %sz, align 4, !tbaa !3
+ %call = call fastcc i8** @ialloc(i32 %n_elements, i32* %sz, i32 3, i8** %chunks)
+ ret i8** %call
+}
+
+; Function Attrs: nounwind
+define internal fastcc i8** @ialloc(i32 %n_elements, i32* nocapture %sizes, i32 %opts, i8** %chunks) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp = icmp eq i32 %0, 0
+ br i1 %cmp, label %if.then.i, label %lor.end
+
+if.then.i: ; preds = %entry
+ %call.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i = add i32 %call.i, -1
+ %and.i = and i32 %sub.i, %call.i
+ %cmp1.i = icmp eq i32 %and.i, 0
+ br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i
+
+if.then5.i: ; preds = %if.then.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit: ; preds = %if.then.i
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i = tail call i32 @time(i32* null) #1
+ %xor.i = and i32 %call6.i, -16
+ %and7.i = xor i32 %xor.i, 1431655768
+ store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end
+
+lor.end: ; preds = %init_mparams.exit, %entry
+ %cmp1 = icmp eq i8** %chunks, null
+ %cmp2 = icmp eq i32 %n_elements, 0
+ br i1 %cmp1, label %if.else, label %if.then
+
+if.then: ; preds = %lor.end
+ br i1 %cmp2, label %return, label %if.end11
+
+if.else: ; preds = %lor.end
+ br i1 %cmp2, label %if.then5, label %if.end7
+
+if.then5: ; preds = %if.else
+ %call6 = tail call i8* @malloc(i32 0)
+ %1 = bitcast i8* %call6 to i8**
+ br label %return
+
+if.end7: ; preds = %if.else
+ %mul = shl i32 %n_elements, 2
+ %cmp8 = icmp ult i32 %mul, 11
+ br i1 %cmp8, label %if.end11, label %cond.false
+
+cond.false: ; preds = %if.end7
+ %add10 = add i32 %mul, 11
+ %and = and i32 %add10, -8
+ br label %if.end11
+
+if.end11: ; preds = %cond.false, %if.end7, %if.then
+ %array_size.0 = phi i32 [ 0, %if.then ], [ %and, %cond.false ], [ 16, %if.end7 ]
+ %marray.0 = phi i8** [ %chunks, %if.then ], [ null, %cond.false ], [ null, %if.end7 ]
+ %and12 = and i32 %opts, 1
+ %tobool13 = icmp eq i32 %and12, 0
+ br i1 %tobool13, label %for.cond.preheader, label %if.then14
+
+for.cond.preheader: ; preds = %if.end11
+ br i1 %cmp2, label %if.end36, label %for.body
+
+if.then14: ; preds = %if.end11
+ %2 = load i32* %sizes, align 4, !tbaa !3
+ %cmp15 = icmp ult i32 %2, 11
+ br i1 %cmp15, label %cond.end21, label %cond.false17
+
+cond.false17: ; preds = %if.then14
+ %add19 = add i32 %2, 11
+ %and20 = and i32 %add19, -8
+ br label %cond.end21
+
+cond.end21: ; preds = %cond.false17, %if.then14
+ %cond22 = phi i32 [ %and20, %cond.false17 ], [ 16, %if.then14 ]
+ %mul23 = mul i32 %cond22, %n_elements
+ br label %if.end36
+
+for.body: ; preds = %cond.end33, %for.cond.preheader
+ %i.09 = phi i32 [ %inc, %cond.end33 ], [ 0, %for.cond.preheader ]
+ %contents_size.08 = phi i32 [ %add35, %cond.end33 ], [ 0, %for.cond.preheader ]
+ %arrayidx = getelementptr inbounds i32* %sizes, i32 %i.09
+ %3 = load i32* %arrayidx, align 4, !tbaa !3
+ %cmp26 = icmp ult i32 %3, 11
+ br i1 %cmp26, label %cond.end33, label %cond.false28
+
+cond.false28: ; preds = %for.body
+ %add31 = add i32 %3, 11
+ %and32 = and i32 %add31, -8
+ br label %cond.end33
+
+cond.end33: ; preds = %cond.false28, %for.body
+ %cond34 = phi i32 [ %and32, %cond.false28 ], [ 16, %for.body ]
+ %add35 = add i32 %cond34, %contents_size.08
+ %inc = add i32 %i.09, 1
+ %cmp25 = icmp eq i32 %inc, %n_elements
+ br i1 %cmp25, label %if.end36, label %for.body
+
+if.end36: ; preds = %cond.end33, %cond.end21, %for.cond.preheader
+ %contents_size.1 = phi i32 [ %mul23, %cond.end21 ], [ 0, %for.cond.preheader ], [ %add35, %cond.end33 ]
+ %element_size.0 = phi i32 [ %cond22, %cond.end21 ], [ 0, %for.cond.preheader ], [ 0, %cond.end33 ]
+ %add37 = add i32 %array_size.0, -4
+ %sub = add i32 %add37, %contents_size.1
+ %call39 = tail call i8* @malloc(i32 %sub)
+ %cmp44 = icmp eq i8* %call39, null
+ br i1 %cmp44, label %return, label %if.end46
+
+if.end46: ; preds = %if.end36
+ %add.ptr = getelementptr inbounds i8* %call39, i32 -8
+ %head = getelementptr inbounds i8* %call39, i32 -4
+ %4 = bitcast i8* %head to i32*
+ %5 = load i32* %4, align 4, !tbaa !3
+ %and47 = and i32 %5, -8
+ %and48 = and i32 %opts, 2
+ %tobool49 = icmp eq i32 %and48, 0
+ br i1 %tobool49, label %if.end53, label %if.then50
+
+if.then50: ; preds = %if.end46
+ %sub51 = sub i32 -4, %array_size.0
+ %sub52 = add i32 %sub51, %and47
+ tail call void @llvm.memset.p0i8.i32(i8* %call39, i8 0, i32 %sub52, i32 4, i1 false)
+ br label %if.end53
+
+if.end53: ; preds = %if.then50, %if.end46
+ %cmp54 = icmp eq i8** %marray.0, null
+ br i1 %cmp54, label %if.then55, label %if.end61
+
+if.then55: ; preds = %if.end53
+ %sub57 = sub i32 %and47, %contents_size.1
+ %add.ptr58 = getelementptr inbounds i8* %call39, i32 %contents_size.1
+ %6 = bitcast i8* %add.ptr58 to i8**
+ %or59 = or i32 %sub57, 3
+ %add.ptr56.sum = add i32 %contents_size.1, -4
+ %head60 = getelementptr inbounds i8* %call39, i32 %add.ptr56.sum
+ %7 = bitcast i8* %head60 to i32*
+ store i32 %or59, i32* %7, align 4, !tbaa !3
+ br label %if.end61
+
+if.end61: ; preds = %if.then55, %if.end53
+ %remainder_size.0 = phi i32 [ %contents_size.1, %if.then55 ], [ %and47, %if.end53 ]
+ %marray.1 = phi i8** [ %6, %if.then55 ], [ %marray.0, %if.end53 ]
+ store i8* %call39, i8** %marray.1, align 4, !tbaa !0
+ %sub65 = add i32 %n_elements, -1
+ %cmp662 = icmp eq i32 %sub65, 0
+ br i1 %cmp662, label %if.else87, label %if.then67.lr.ph
+
+if.then67.lr.ph: ; preds = %if.end61
+ %cmp68 = icmp eq i32 %element_size.0, 0
+ br i1 %cmp68, label %if.else70.us, label %if.end81
+
+if.else70.us: ; preds = %if.end81.us, %if.then67.lr.ph
+ %i.15.us = phi i32 [ %inc93.us, %if.end81.us ], [ 0, %if.then67.lr.ph ]
+ %remainder_size.14.us = phi i32 [ %sub82.us, %if.end81.us ], [ %remainder_size.0, %if.then67.lr.ph ]
+ %p.0.in3.us = phi i8* [ %add.ptr86.us, %if.end81.us ], [ %add.ptr, %if.then67.lr.ph ]
+ %arrayidx71.us = getelementptr inbounds i32* %sizes, i32 %i.15.us
+ %8 = load i32* %arrayidx71.us, align 4, !tbaa !3
+ %cmp72.us = icmp ult i32 %8, 11
+ br i1 %cmp72.us, label %if.end81.us, label %cond.false74.us
+
+cond.false74.us: ; preds = %if.else70.us
+ %add77.us = add i32 %8, 11
+ %and78.us = and i32 %add77.us, -8
+ br label %if.end81.us
+
+if.end81.us: ; preds = %cond.false74.us, %if.else70.us
+ %size.0.us = phi i32 [ %and78.us, %cond.false74.us ], [ 16, %if.else70.us ]
+ %sub82.us = sub i32 %remainder_size.14.us, %size.0.us
+ %or84.us = or i32 %size.0.us, 3
+ %head85.us = getelementptr inbounds i8* %p.0.in3.us, i32 4
+ %9 = bitcast i8* %head85.us to i32*
+ store i32 %or84.us, i32* %9, align 4, !tbaa !3
+ %add.ptr86.us = getelementptr inbounds i8* %p.0.in3.us, i32 %size.0.us
+ %inc93.us = add i32 %i.15.us, 1
+ %add.ptr86.us.sum = add i32 %size.0.us, 8
+ %add.ptr63.us = getelementptr inbounds i8* %p.0.in3.us, i32 %add.ptr86.us.sum
+ %arrayidx64.us = getelementptr inbounds i8** %marray.1, i32 %inc93.us
+ store i8* %add.ptr63.us, i8** %arrayidx64.us, align 4, !tbaa !0
+ %cmp66.us = icmp eq i32 %inc93.us, %sub65
+ br i1 %cmp66.us, label %if.else87, label %if.else70.us
+
+if.end81: ; preds = %if.end81, %if.then67.lr.ph
+ %i.15 = phi i32 [ %inc93, %if.end81 ], [ 0, %if.then67.lr.ph ]
+ %remainder_size.14 = phi i32 [ %sub82, %if.end81 ], [ %remainder_size.0, %if.then67.lr.ph ]
+ %p.0.in3 = phi i8* [ %add.ptr86, %if.end81 ], [ %add.ptr, %if.then67.lr.ph ]
+ %sub82 = sub i32 %remainder_size.14, %element_size.0
+ %or84 = or i32 %element_size.0, 3
+ %head85 = getelementptr inbounds i8* %p.0.in3, i32 4
+ %10 = bitcast i8* %head85 to i32*
+ store i32 %or84, i32* %10, align 4, !tbaa !3
+ %add.ptr86 = getelementptr inbounds i8* %p.0.in3, i32 %element_size.0
+ %inc93 = add i32 %i.15, 1
+ %add.ptr86.sum = add i32 %element_size.0, 8
+ %add.ptr63 = getelementptr inbounds i8* %p.0.in3, i32 %add.ptr86.sum
+ %arrayidx64 = getelementptr inbounds i8** %marray.1, i32 %inc93
+ store i8* %add.ptr63, i8** %arrayidx64, align 4, !tbaa !0
+ %cmp66 = icmp eq i32 %inc93, %sub65
+ br i1 %cmp66, label %if.else87, label %if.end81
+
+if.else87: ; preds = %if.end81, %if.end81.us, %if.end61
+ %remainder_size.1.lcssa = phi i32 [ %remainder_size.0, %if.end61 ], [ %sub82.us, %if.end81.us ], [ %sub82, %if.end81 ]
+ %p.0.in.lcssa = phi i8* [ %add.ptr, %if.end61 ], [ %add.ptr86.us, %if.end81.us ], [ %add.ptr86, %if.end81 ]
+ %or89 = or i32 %remainder_size.1.lcssa, 3
+ %head90 = getelementptr inbounds i8* %p.0.in.lcssa, i32 4
+ %11 = bitcast i8* %head90 to i32*
+ store i32 %or89, i32* %11, align 4, !tbaa !3
+ br label %return
+
+return: ; preds = %if.else87, %if.end36, %if.then5, %if.then
+ %retval.0 = phi i8** [ %marray.1, %if.else87 ], [ %1, %if.then5 ], [ %chunks, %if.then ], [ null, %if.end36 ]
+ ret i8** %retval.0
+}
+
+; Function Attrs: nounwind
+define weak i8** @independent_comalloc(i32 %n_elements, i32* %sizes, i8** %chunks) #0 {
+entry:
+ %call = tail call fastcc i8** @ialloc(i32 %n_elements, i32* %sizes, i32 0, i8** %chunks)
+ ret i8** %call
+}
+
+; Function Attrs: nounwind
+define weak i32 @bulk_free(i8** %array, i32 %nelem) #0 {
+entry:
+ %arrayidx.i = getelementptr inbounds i8** %array, i32 %nelem
+ %cmp6.i = icmp eq i32 %nelem, 0
+ br i1 %cmp6.i, label %internal_bulk_free.exit, label %for.body.i
+
+for.body.i: ; preds = %for.inc.i, %entry
+ %a.07.i = phi i8** [ %array, %entry ], [ %incdec.ptr.pre-phi.i, %for.inc.i ]
+ %0 = load i8** %a.07.i, align 4, !tbaa !0
+ %cmp1.i = icmp eq i8* %0, null
+ br i1 %cmp1.i, label %for.body.for.inc_crit_edge.i, label %if.then.i
+
+for.body.for.inc_crit_edge.i: ; preds = %for.body.i
+ %incdec.ptr.pre.i = getelementptr inbounds i8** %a.07.i, i32 1
+ br label %for.inc.i
+
+if.then.i: ; preds = %for.body.i
+ %add.ptr.i = getelementptr inbounds i8* %0, i32 -8
+ %1 = bitcast i8* %add.ptr.i to %struct.malloc_chunk*
+ %head.i = getelementptr inbounds i8* %0, i32 -4
+ %2 = bitcast i8* %head.i to i32*
+ %3 = load i32* %2, align 4, !tbaa !3
+ %and.i = and i32 %3, -8
+ store i8* null, i8** %a.07.i, align 4, !tbaa !0
+ %4 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp2.i = icmp ult i8* %add.ptr.i, %4
+ br i1 %cmp2.i, label %if.else25.i, label %land.rhs.i
+
+land.rhs.i: ; preds = %if.then.i
+ %and4.i = and i32 %3, 3
+ %cmp5.i = icmp eq i32 %and4.i, 1
+ br i1 %cmp5.i, label %if.else25.i, label %if.then6.i, !prof !6
+
+if.then6.i: ; preds = %land.rhs.i
+ %add.ptr7.i = getelementptr inbounds i8** %a.07.i, i32 1
+ %and91.i = add i32 %3, -8
+ %add.ptr.sum.i = and i32 %and91.i, -8
+ %cmp11.i = icmp eq i8** %add.ptr7.i, %arrayidx.i
+ br i1 %cmp11.i, label %if.else.i, label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %if.then6.i
+ %5 = load i8** %add.ptr7.i, align 4, !tbaa !0
+ %add.ptr10.sum.i = add i32 %add.ptr.sum.i, 8
+ %add.ptr12.i = getelementptr inbounds i8* %0, i32 %add.ptr10.sum.i
+ %cmp13.i = icmp eq i8* %5, %add.ptr12.i
+ br i1 %cmp13.i, label %if.then14.i, label %if.else.i
+
+if.then14.i: ; preds = %land.lhs.true.i
+ %add.ptr10.sum23.i = or i32 %add.ptr.sum.i, 4
+ %head15.i = getelementptr inbounds i8* %0, i32 %add.ptr10.sum23.i
+ %6 = bitcast i8* %head15.i to i32*
+ %7 = load i32* %6, align 4, !tbaa !3
+ %and16.i = and i32 %7, -8
+ %add.i = add i32 %and16.i, %and.i
+ %and18.i = and i32 %3, 1
+ %or.i = or i32 %and18.i, %add.i
+ %or19.i = or i32 %or.i, 2
+ store i32 %or19.i, i32* %2, align 4, !tbaa !3
+ %add.ptr21.sum.i = add i32 %add.i, -4
+ %head22.i = getelementptr inbounds i8* %0, i32 %add.ptr21.sum.i
+ %8 = bitcast i8* %head22.i to i32*
+ %9 = load i32* %8, align 4, !tbaa !3
+ %or23.i = or i32 %9, 1
+ store i32 %or23.i, i32* %8, align 4, !tbaa !3
+ store i8* %0, i8** %add.ptr7.i, align 4, !tbaa !0
+ br label %for.inc.i
+
+if.else.i: ; preds = %land.lhs.true.i, %if.then6.i
+ tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %1, i32 %and.i) #1
+ br label %for.inc.i
+
+if.else25.i: ; preds = %land.rhs.i, %if.then.i
+ tail call void @abort() #6
+ unreachable
+
+for.inc.i: ; preds = %if.else.i, %if.then14.i, %for.body.for.inc_crit_edge.i
+ %incdec.ptr.pre-phi.i = phi i8** [ %incdec.ptr.pre.i, %for.body.for.inc_crit_edge.i ], [ %add.ptr7.i, %if.then14.i ], [ %add.ptr7.i, %if.else.i ]
+ %cmp.i = icmp eq i8** %incdec.ptr.pre-phi.i, %arrayidx.i
+ br i1 %cmp.i, label %internal_bulk_free.exit, label %for.body.i
+
+internal_bulk_free.exit: ; preds = %for.inc.i, %entry
+ ret i32 0
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_trim(i32 %pad) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp = icmp eq i32 %0, 0
+ br i1 %cmp, label %if.then.i, label %lor.end.i
+
+if.then.i: ; preds = %entry
+ %call.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i = add i32 %call.i, -1
+ %and.i = and i32 %sub.i, %call.i
+ %cmp1.i = icmp eq i32 %and.i, 0
+ br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i
+
+if.then5.i: ; preds = %if.then.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit: ; preds = %if.then.i
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i = tail call i32 @time(i32* null) #1
+ %xor.i = and i32 %call6.i, -16
+ %and7.i = xor i32 %xor.i, 1431655768
+ store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end.i
+
+lor.end.i: ; preds = %init_mparams.exit, %entry
+ %cmp1.i2 = icmp ult i32 %pad, -64
+ br i1 %cmp1.i2, label %land.lhs.true.i, label %sys_trim.exit
+
+land.lhs.true.i: ; preds = %lor.end.i
+ %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp2.i = icmp eq %struct.malloc_chunk* %1, null
+ br i1 %cmp2.i, label %sys_trim.exit, label %if.then.i3
+
+if.then.i3: ; preds = %land.lhs.true.i
+ %add.i = add i32 %pad, 40
+ %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %cmp3.i = icmp ugt i32 %2, %add.i
+ br i1 %cmp3.i, label %if.then4.i, label %land.lhs.true45.i
+
+if.then4.i: ; preds = %if.then.i3
+ %3 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ %sub6.i = sub i32 -41, %pad
+ %sub.i4 = add i32 %sub6.i, %2
+ %add7.i = add i32 %sub.i4, %3
+ %div.i = udiv i32 %add7.i, %3
+ %4 = bitcast %struct.malloc_chunk* %1 to i8*
+ br label %for.cond.i.i
+
+for.cond.i.i: ; preds = %if.end.i2.i, %if.then4.i
+ %sp.0.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then4.i ], [ %7, %if.end.i2.i ]
+ %base.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 0
+ %5 = load i8** %base.i.i, align 4, !tbaa !0
+ %cmp.i1.i = icmp ugt i8* %5, %4
+ br i1 %cmp.i1.i, label %if.end.i2.i, label %land.lhs.true.i.i
+
+land.lhs.true.i.i: ; preds = %for.cond.i.i
+ %size.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 1
+ %6 = load i32* %size.i.i, align 4, !tbaa !3
+ %add.ptr.i.i = getelementptr inbounds i8* %5, i32 %6
+ %cmp2.i.i = icmp ugt i8* %add.ptr.i.i, %4
+ br i1 %cmp2.i.i, label %segment_holding.exit.i, label %if.end.i2.i
+
+if.end.i2.i: ; preds = %land.lhs.true.i.i, %for.cond.i.i
+ %next.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 2
+ %7 = load %struct.malloc_segment** %next.i.i, align 4, !tbaa !0
+ br label %for.cond.i.i
+
+segment_holding.exit.i: ; preds = %land.lhs.true.i.i
+ %sub8.i = add i32 %div.i, -1
+ %mul.i = mul i32 %sub8.i, %3
+ %sflags.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 3
+ %8 = load i32* %sflags.i, align 4, !tbaa !3
+ %and.i5 = and i32 %8, 8
+ %tobool11.i = icmp eq i32 %and.i5, 0
+ br i1 %tobool11.i, label %if.else.i, label %land.lhs.true45.i
+
+if.else.i: ; preds = %segment_holding.exit.i
+ %call20.i = tail call i8* @sbrk(i32 0) #1
+ %9 = load i8** %base.i.i, align 4, !tbaa !0
+ %10 = load i32* %size.i.i, align 4, !tbaa !3
+ %add.ptr.i = getelementptr inbounds i8* %9, i32 %10
+ %cmp21.i = icmp eq i8* %call20.i, %add.ptr.i
+ br i1 %cmp21.i, label %if.then22.i, label %land.lhs.true45.i
+
+if.then22.i: ; preds = %if.else.i
+ %sub19.i = sub i32 -2147483648, %3
+ %cmp17.i = icmp ugt i32 %mul.i, 2147483646
+ %sub19.mul.i = select i1 %cmp17.i, i32 %sub19.i, i32 %mul.i
+ %sub23.i = sub i32 0, %sub19.mul.i
+ %call24.i = tail call i8* @sbrk(i32 %sub23.i) #1
+ %call25.i = tail call i8* @sbrk(i32 0) #1
+ %cmp26.i = icmp ne i8* %call24.i, inttoptr (i32 -1 to i8*)
+ %cmp28.i = icmp ult i8* %call25.i, %call20.i
+ %or.cond.i = and i1 %cmp26.i, %cmp28.i
+ br i1 %or.cond.i, label %if.end33.i, label %land.lhs.true45.i
+
+if.end33.i: ; preds = %if.then22.i
+ %sub.ptr.lhs.cast.i = ptrtoint i8* %call20.i to i32
+ %sub.ptr.rhs.cast.i = ptrtoint i8* %call25.i to i32
+ %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i
+ %cmp34.i = icmp eq i8* %call20.i, %call25.i
+ br i1 %cmp34.i, label %land.lhs.true45.i, label %if.then35.i
+
+if.then35.i: ; preds = %if.end33.i
+ %11 = load i32* %size.i.i, align 4, !tbaa !3
+ %sub37.i = sub i32 %11, %sub.ptr.sub.i
+ store i32 %sub37.i, i32* %size.i.i, align 4, !tbaa !3
+ %12 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %sub38.i = sub i32 %12, %sub.ptr.sub.i
+ store i32 %sub38.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %13 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %14 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %sub41.i = sub i32 %14, %sub.ptr.sub.i
+ %15 = bitcast %struct.malloc_chunk* %13 to i8*
+ %add.ptr.i3.i = getelementptr inbounds %struct.malloc_chunk* %13, i32 0, i32 2
+ %16 = ptrtoint %struct.malloc_chunk** %add.ptr.i3.i to i32
+ %and.i4.i = and i32 %16, 7
+ %cmp.i5.i = icmp eq i32 %and.i4.i, 0
+ br i1 %cmp.i5.i, label %if.end43.i, label %cond.false.i.i
+
+cond.false.i.i: ; preds = %if.then35.i
+ %17 = sub i32 0, %16
+ %and3.i.i = and i32 %17, 7
+ br label %if.end43.i
+
+if.end43.i: ; preds = %cond.false.i.i, %if.then35.i
+ %cond.i.i = phi i32 [ %and3.i.i, %cond.false.i.i ], [ 0, %if.then35.i ]
+ %add.ptr4.i.i = getelementptr inbounds i8* %15, i32 %cond.i.i
+ %18 = bitcast i8* %add.ptr4.i.i to %struct.malloc_chunk*
+ %sub5.i.i = sub i32 %sub41.i, %cond.i.i
+ store %struct.malloc_chunk* %18, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ store i32 %sub5.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %or.i.i = or i32 %sub5.i.i, 1
+ %add.ptr4.sum.i.i = add i32 %cond.i.i, 4
+ %head.i.i = getelementptr inbounds i8* %15, i32 %add.ptr4.sum.i.i
+ %19 = bitcast i8* %head.i.i to i32*
+ store i32 %or.i.i, i32* %19, align 4, !tbaa !3
+ %add.ptr6.sum.i.i = add i32 %sub41.i, 4
+ %head7.i.i = getelementptr inbounds i8* %15, i32 %add.ptr6.sum.i.i
+ %20 = bitcast i8* %head7.i.i to i32*
+ store i32 40, i32* %20, align 4, !tbaa !3
+ %21 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 %21, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ br label %sys_trim.exit
+
+land.lhs.true45.i: ; preds = %if.end33.i, %if.then22.i, %if.else.i, %segment_holding.exit.i, %if.then.i3
+ %22 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %23 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ %cmp47.i = icmp ugt i32 %22, %23
+ br i1 %cmp47.i, label %if.then48.i, label %sys_trim.exit
+
+if.then48.i: ; preds = %land.lhs.true45.i
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3
+ br label %sys_trim.exit
+
+sys_trim.exit: ; preds = %if.then48.i, %land.lhs.true45.i, %if.end43.i, %land.lhs.true.i, %lor.end.i
+ %released.2.i = phi i32 [ 0, %if.then48.i ], [ 0, %land.lhs.true45.i ], [ 1, %if.end43.i ], [ 0, %land.lhs.true.i ], [ 0, %lor.end.i ]
+ ret i32 %released.2.i
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_footprint() #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ ret i32 %0
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_max_footprint() #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3
+ ret i32 %0
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_footprint_limit() #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3
+ %cmp = icmp eq i32 %0, 0
+ %cond = select i1 %cmp, i32 -1, i32 %0
+ ret i32 %cond
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_set_footprint_limit(i32 %bytes) #0 {
+entry:
+ %cmp2 = icmp eq i32 %bytes, -1
+ br i1 %cmp2, label %if.end9, label %if.else
+
+if.else: ; preds = %entry
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ %sub4 = add i32 %bytes, -1
+ %add5 = add i32 %sub4, %0
+ %neg7 = sub i32 0, %0
+ %and8 = and i32 %add5, %neg7
+ br label %if.end9
+
+if.end9: ; preds = %if.else, %entry
+ %result.0 = phi i32 [ %and8, %if.else ], [ 0, %entry ]
+ store i32 %result.0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3
+ ret i32 %result.0
+}
+
+; Function Attrs: nounwind
+define weak void @mallinfo(%struct.mallinfo* noalias sret %agg.result) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp.i = icmp eq i32 %0, 0
+ br i1 %cmp.i, label %if.then.i.i, label %lor.end.i
+
+if.then.i.i: ; preds = %entry
+ %call.i.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i.i = add i32 %call.i.i, -1
+ %and.i.i = and i32 %sub.i.i, %call.i.i
+ %cmp1.i.i = icmp eq i32 %and.i.i, 0
+ br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i
+
+if.then5.i.i: ; preds = %if.then.i.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit.i: ; preds = %if.then.i.i
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i.i = tail call i32 @time(i32* null) #1
+ %xor.i.i = and i32 %call6.i.i, -16
+ %and7.i.i = xor i32 %xor.i.i, 1431655768
+ store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end.i
+
+lor.end.i: ; preds = %init_mparams.exit.i, %entry
+ %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp1.i = icmp eq %struct.malloc_chunk* %1, null
+ br i1 %cmp1.i, label %internal_mallinfo.exit, label %if.then.i
+
+if.then.i: ; preds = %lor.end.i
+ %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add.i = add i32 %2, 40
+ br label %while.body.i
+
+while.body.i: ; preds = %while.end.i, %if.then.i
+ %s.013.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then.i ], [ %9, %while.end.i ]
+ %sum.012.i = phi i32 [ %add.i, %if.then.i ], [ %sum.1.lcssa.i, %while.end.i ]
+ %mfree.011.i = phi i32 [ %add.i, %if.then.i ], [ %mfree.1.lcssa.i, %while.end.i ]
+ %nfree.010.i = phi i32 [ 1, %if.then.i ], [ %nfree.1.lcssa.i, %while.end.i ]
+ %base.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 0
+ %3 = load i8** %base.i, align 4, !tbaa !0
+ %add.ptr.i = getelementptr inbounds i8* %3, i32 8
+ %4 = ptrtoint i8* %add.ptr.i to i32
+ %and.i = and i32 %4, 7
+ %cmp4.i = icmp eq i32 %and.i, 0
+ br i1 %cmp4.i, label %land.lhs.true.lr.ph.i, label %cond.false.i
+
+cond.false.i: ; preds = %while.body.i
+ %5 = sub i32 0, %4
+ %and8.i = and i32 %5, 7
+ br label %land.lhs.true.lr.ph.i
+
+land.lhs.true.lr.ph.i: ; preds = %cond.false.i, %while.body.i
+ %cond.i = phi i32 [ %and8.i, %cond.false.i ], [ 0, %while.body.i ]
+ %add.ptr9.i = getelementptr inbounds i8* %3, i32 %cond.i
+ %size.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 1
+ %6 = load i32* %size.i, align 4, !tbaa !3
+ %add.ptr14.i = getelementptr inbounds i8* %3, i32 %6
+ br label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %if.end.i, %land.lhs.true.lr.ph.i
+ %q.0.in7.i = phi i8* [ %add.ptr9.i, %land.lhs.true.lr.ph.i ], [ %add.ptr31.i, %if.end.i ]
+ %sum.16.i = phi i32 [ %sum.012.i, %land.lhs.true.lr.ph.i ], [ %add23.i, %if.end.i ]
+ %mfree.15.i = phi i32 [ %mfree.011.i, %land.lhs.true.lr.ph.i ], [ %mfree.2.i, %if.end.i ]
+ %nfree.14.i = phi i32 [ %nfree.010.i, %land.lhs.true.lr.ph.i ], [ %nfree.2.i, %if.end.i ]
+ %q.0.i = bitcast i8* %q.0.in7.i to %struct.malloc_chunk*
+ %cmp15.i = icmp uge i8* %q.0.in7.i, %add.ptr14.i
+ %cmp18.i = icmp eq %struct.malloc_chunk* %q.0.i, %1
+ %or.cond.i = or i1 %cmp15.i, %cmp18.i
+ br i1 %or.cond.i, label %while.end.i, label %land.rhs.i
+
+land.rhs.i: ; preds = %land.lhs.true.i
+ %head.i = getelementptr inbounds i8* %q.0.in7.i, i32 4
+ %7 = bitcast i8* %head.i to i32*
+ %8 = load i32* %7, align 4, !tbaa !3
+ %cmp19.i = icmp eq i32 %8, 7
+ br i1 %cmp19.i, label %while.end.i, label %while.body20.i
+
+while.body20.i: ; preds = %land.rhs.i
+ %and22.i = and i32 %8, -8
+ %add23.i = add i32 %and22.i, %sum.16.i
+ %and25.i = and i32 %8, 3
+ %cmp26.i = icmp eq i32 %and25.i, 1
+ br i1 %cmp26.i, label %if.then27.i, label %if.end.i
+
+if.then27.i: ; preds = %while.body20.i
+ %add28.i = add i32 %and22.i, %mfree.15.i
+ %inc.i = add i32 %nfree.14.i, 1
+ br label %if.end.i
+
+if.end.i: ; preds = %if.then27.i, %while.body20.i
+ %nfree.2.i = phi i32 [ %nfree.14.i, %while.body20.i ], [ %inc.i, %if.then27.i ]
+ %mfree.2.i = phi i32 [ %mfree.15.i, %while.body20.i ], [ %add28.i, %if.then27.i ]
+ %add.ptr31.i = getelementptr inbounds i8* %q.0.in7.i, i32 %and22.i
+ %cmp12.i = icmp ult i8* %add.ptr31.i, %3
+ br i1 %cmp12.i, label %while.end.i, label %land.lhs.true.i
+
+while.end.i: ; preds = %if.end.i, %land.rhs.i, %land.lhs.true.i
+ %sum.1.lcssa.i = phi i32 [ %sum.16.i, %land.rhs.i ], [ %sum.16.i, %land.lhs.true.i ], [ %add23.i, %if.end.i ]
+ %mfree.1.lcssa.i = phi i32 [ %mfree.15.i, %land.rhs.i ], [ %mfree.15.i, %land.lhs.true.i ], [ %mfree.2.i, %if.end.i ]
+ %nfree.1.lcssa.i = phi i32 [ %nfree.14.i, %land.rhs.i ], [ %nfree.14.i, %land.lhs.true.i ], [ %nfree.2.i, %if.end.i ]
+ %next.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 2
+ %9 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0
+ %cmp2.i = icmp eq %struct.malloc_segment* %9, null
+ br i1 %cmp2.i, label %while.end32.i, label %while.body.i
+
+while.end32.i: ; preds = %while.end.i
+ %10 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %sub33.i = sub i32 %10, %sum.1.lcssa.i
+ %11 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3
+ %sub35.i = sub i32 %10, %mfree.1.lcssa.i
+ br label %internal_mallinfo.exit
+
+internal_mallinfo.exit: ; preds = %while.end32.i, %lor.end.i
+ %nm.sroa.6.0.i = phi i32 [ %sub35.i, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.4.0.i = phi i32 [ %11, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.3.0.i = phi i32 [ %sub33.i, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.1.0.i = phi i32 [ %nfree.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.0.0.i = phi i32 [ %sum.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.7.0.i = phi i32 [ %mfree.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.8.0.i = phi i32 [ %2, %while.end32.i ], [ 0, %lor.end.i ]
+ %nm.sroa.0.0.idx.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 0
+ store i32 %nm.sroa.0.0.i, i32* %nm.sroa.0.0.idx.i, align 4
+ %nm.sroa.1.4.idx25.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 1
+ store i32 %nm.sroa.1.0.i, i32* %nm.sroa.1.4.idx25.i, align 4
+ %nm.sroa.2.8.idx.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 2
+ %12 = bitcast i32* %nm.sroa.2.8.idx.i to i64*
+ store i64 0, i64* %12, align 4
+ %nm.sroa.3.16.idx31.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 4
+ store i32 %nm.sroa.3.0.i, i32* %nm.sroa.3.16.idx31.i, align 4
+ %nm.sroa.4.20.idx33.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 5
+ store i32 %nm.sroa.4.0.i, i32* %nm.sroa.4.20.idx33.i, align 4
+ %nm.sroa.5.24.idx35.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 6
+ store i32 0, i32* %nm.sroa.5.24.idx35.i, align 4
+ %nm.sroa.6.28.idx37.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 7
+ store i32 %nm.sroa.6.0.i, i32* %nm.sroa.6.28.idx37.i, align 4
+ %nm.sroa.7.32.idx39.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 8
+ store i32 %nm.sroa.7.0.i, i32* %nm.sroa.7.32.idx39.i, align 4
+ %nm.sroa.8.36.idx41.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 9
+ store i32 %nm.sroa.8.0.i, i32* %nm.sroa.8.36.idx41.i, align 4
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak void @malloc_stats() #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp.i = icmp eq i32 %0, 0
+ br i1 %cmp.i, label %if.then.i.i, label %lor.end.i
+
+if.then.i.i: ; preds = %entry
+ %call.i.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i.i = add i32 %call.i.i, -1
+ %and.i.i = and i32 %sub.i.i, %call.i.i
+ %cmp1.i.i = icmp eq i32 %and.i.i, 0
+ br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i
+
+if.then5.i.i: ; preds = %if.then.i.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit.i: ; preds = %if.then.i.i
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i.i = tail call i32 @time(i32* null) #1
+ %xor.i.i = and i32 %call6.i.i, -16
+ %and7.i.i = xor i32 %xor.i.i, 1431655768
+ store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end.i
+
+lor.end.i: ; preds = %init_mparams.exit.i, %entry
+ %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp1.i = icmp eq %struct.malloc_chunk* %1, null
+ br i1 %cmp1.i, label %internal_malloc_stats.exit, label %if.then.i
+
+if.then.i: ; preds = %lor.end.i
+ %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3
+ %3 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3
+ %4 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add.neg.i = add i32 %3, -40
+ %sub.i = sub i32 %add.neg.i, %4
+ br label %while.body.i
+
+while.body.i: ; preds = %while.end.i, %if.then.i
+ %s.05.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then.i ], [ %11, %while.end.i ]
+ %used.04.i = phi i32 [ %sub.i, %if.then.i ], [ %used.1.lcssa.i, %while.end.i ]
+ %base.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 0
+ %5 = load i8** %base.i, align 4, !tbaa !0
+ %add.ptr.i = getelementptr inbounds i8* %5, i32 8
+ %6 = ptrtoint i8* %add.ptr.i to i32
+ %and.i = and i32 %6, 7
+ %cmp4.i = icmp eq i32 %and.i, 0
+ br i1 %cmp4.i, label %land.lhs.true.lr.ph.i, label %cond.false.i
+
+cond.false.i: ; preds = %while.body.i
+ %7 = sub i32 0, %6
+ %and9.i = and i32 %7, 7
+ br label %land.lhs.true.lr.ph.i
+
+land.lhs.true.lr.ph.i: ; preds = %cond.false.i, %while.body.i
+ %cond.i = phi i32 [ %and9.i, %cond.false.i ], [ 0, %while.body.i ]
+ %add.ptr10.i = getelementptr inbounds i8* %5, i32 %cond.i
+ %size.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 1
+ %8 = load i32* %size.i, align 4, !tbaa !3
+ %add.ptr15.i = getelementptr inbounds i8* %5, i32 %8
+ br label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %while.body21.i, %land.lhs.true.lr.ph.i
+ %q.0.in3.i = phi i8* [ %add.ptr10.i, %land.lhs.true.lr.ph.i ], [ %add.ptr31.i, %while.body21.i ]
+ %used.12.i = phi i32 [ %used.04.i, %land.lhs.true.lr.ph.i ], [ %used.2.i, %while.body21.i ]
+ %q.0.i = bitcast i8* %q.0.in3.i to %struct.malloc_chunk*
+ %cmp16.i = icmp uge i8* %q.0.in3.i, %add.ptr15.i
+ %cmp19.i = icmp eq %struct.malloc_chunk* %q.0.i, %1
+ %or.cond.i = or i1 %cmp16.i, %cmp19.i
+ br i1 %or.cond.i, label %while.end.i, label %land.rhs.i
+
+land.rhs.i: ; preds = %land.lhs.true.i
+ %head.i = getelementptr inbounds i8* %q.0.in3.i, i32 4
+ %9 = bitcast i8* %head.i to i32*
+ %10 = load i32* %9, align 4, !tbaa !3
+ %cmp20.i = icmp eq i32 %10, 7
+ br i1 %cmp20.i, label %while.end.i, label %while.body21.i
+
+while.body21.i: ; preds = %land.rhs.i
+ %and23.i = and i32 %10, 3
+ %cmp24.i = icmp eq i32 %and23.i, 1
+ %and27.i = and i32 %10, -8
+ %sub28.i = select i1 %cmp24.i, i32 %and27.i, i32 0
+ %used.2.i = sub i32 %used.12.i, %sub28.i
+ %add.ptr31.i = getelementptr inbounds i8* %q.0.in3.i, i32 %and27.i
+ %cmp13.i = icmp ult i8* %add.ptr31.i, %5
+ br i1 %cmp13.i, label %while.end.i, label %land.lhs.true.i
+
+while.end.i: ; preds = %while.body21.i, %land.rhs.i, %land.lhs.true.i
+ %used.1.lcssa.i = phi i32 [ %used.12.i, %land.rhs.i ], [ %used.12.i, %land.lhs.true.i ], [ %used.2.i, %while.body21.i ]
+ %next.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 2
+ %11 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0
+ %cmp2.i = icmp eq %struct.malloc_segment* %11, null
+ br i1 %cmp2.i, label %internal_malloc_stats.exit, label %while.body.i
+
+internal_malloc_stats.exit: ; preds = %while.end.i, %lor.end.i
+ %maxfp.0.i = phi i32 [ 0, %lor.end.i ], [ %2, %while.end.i ]
+ %fp.0.i = phi i32 [ 0, %lor.end.i ], [ %3, %while.end.i ]
+ %used.3.i = phi i32 [ 0, %lor.end.i ], [ %used.1.lcssa.i, %while.end.i ]
+ %12 = load %struct._IO_FILE** @stderr, align 4, !tbaa !0
+ %call34.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str49, i32 0, i32 0), i32 %maxfp.0.i) #1
+ %call35.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str150, i32 0, i32 0), i32 %fp.0.i) #1
+ %call36.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str251, i32 0, i32 0), i32 %used.3.i) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak i32 @mallopt(i32 %param_number, i32 %value) #0 {
+entry:
+ %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ %cmp.i = icmp eq i32 %0, 0
+ br i1 %cmp.i, label %if.then.i.i, label %lor.end.i
+
+if.then.i.i: ; preds = %entry
+ %call.i.i = tail call i32 @sysconf(i32 30) #1
+ %sub.i.i = add i32 %call.i.i, -1
+ %and.i.i = and i32 %sub.i.i, %call.i.i
+ %cmp1.i.i = icmp eq i32 %and.i.i, 0
+ br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i
+
+if.then5.i.i: ; preds = %if.then.i.i
+ tail call void @abort() #6
+ unreachable
+
+init_mparams.exit.i: ; preds = %if.then.i.i
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3
+ %call6.i.i = tail call i32 @time(i32* null) #1
+ %xor.i.i = and i32 %call6.i.i, -16
+ %and7.i.i = xor i32 %xor.i.i, 1431655768
+ store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3
+ br label %lor.end.i
+
+lor.end.i: ; preds = %init_mparams.exit.i, %entry
+ switch i32 %param_number, label %change_mparam.exit [
+ i32 -1, label %sw.bb.i
+ i32 -2, label %sw.bb2.i
+ i32 -3, label %sw.bb5.i
+ ]
+
+sw.bb.i: ; preds = %lor.end.i
+ store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3
+ br label %change_mparam.exit
+
+sw.bb2.i: ; preds = %lor.end.i
+ %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3
+ %cmp3.i = icmp ugt i32 %1, %value
+ br i1 %cmp3.i, label %change_mparam.exit, label %land.lhs.true.i
+
+land.lhs.true.i: ; preds = %sw.bb2.i
+ %sub.i = add i32 %value, -1
+ %and.i = and i32 %sub.i, %value
+ %cmp4.i = icmp eq i32 %and.i, 0
+ br i1 %cmp4.i, label %if.then.i, label %change_mparam.exit
+
+if.then.i: ; preds = %land.lhs.true.i
+ store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3
+ br label %change_mparam.exit
+
+sw.bb5.i: ; preds = %lor.end.i
+ store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3
+ br label %change_mparam.exit
+
+change_mparam.exit: ; preds = %sw.bb5.i, %if.then.i, %land.lhs.true.i, %sw.bb2.i, %sw.bb.i, %lor.end.i
+ %retval.0.i = phi i32 [ 1, %sw.bb5.i ], [ 1, %if.then.i ], [ 1, %sw.bb.i ], [ 0, %sw.bb2.i ], [ 0, %land.lhs.true.i ], [ 0, %lor.end.i ]
+ ret i32 %retval.0.i
+}
+
+; Function Attrs: nounwind
+define weak i32 @malloc_usable_size(i8* %mem) #0 {
+entry:
+ %cmp = icmp eq i8* %mem, null
+ br i1 %cmp, label %return, label %if.then
+
+if.then: ; preds = %entry
+ %head = getelementptr inbounds i8* %mem, i32 -4
+ %0 = bitcast i8* %head to i32*
+ %1 = load i32* %0, align 4, !tbaa !3
+ %and = and i32 %1, 3
+ %cmp1 = icmp eq i32 %and, 1
+ br i1 %cmp1, label %return, label %if.then2
+
+if.then2: ; preds = %if.then
+ %and4 = and i32 %1, -8
+ %cmp7 = icmp eq i32 %and, 0
+ %cond = select i1 %cmp7, i32 8, i32 4
+ %sub = sub i32 %and4, %cond
+ br label %return
+
+return: ; preds = %if.then2, %if.then, %entry
+ %retval.0 = phi i32 [ %sub, %if.then2 ], [ 0, %if.then ], [ 0, %entry ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+declare i32 @fprintf(%struct._IO_FILE* nocapture, i8* nocapture, ...) #0
+
+declare i8* @sbrk(i32) #5
+
+; Function Attrs: nounwind
+define internal fastcc void @dispose_chunk(%struct.malloc_chunk* %p, i32 %psize) #0 {
+entry:
+ %0 = bitcast %struct.malloc_chunk* %p to i8*
+ %add.ptr = getelementptr inbounds i8* %0, i32 %psize
+ %1 = bitcast i8* %add.ptr to %struct.malloc_chunk*
+ %head = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 1
+ %2 = load i32* %head, align 4, !tbaa !3
+ %and = and i32 %2, 1
+ %tobool = icmp eq i32 %and, 0
+ br i1 %tobool, label %if.then, label %if.end215
+
+if.then: ; preds = %entry
+ %prev_foot = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 0
+ %3 = load i32* %prev_foot, align 4, !tbaa !3
+ %and2 = and i32 %2, 3
+ %cmp = icmp eq i32 %and2, 0
+ br i1 %cmp, label %if.end649, label %if.end
+
+if.end: ; preds = %if.then
+ %idx.neg = sub i32 0, %3
+ %add.ptr5 = getelementptr inbounds i8* %0, i32 %idx.neg
+ %4 = bitcast i8* %add.ptr5 to %struct.malloc_chunk*
+ %add6 = add i32 %3, %psize
+ %5 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp7 = icmp ult i8* %add.ptr5, %5
+ br i1 %cmp7, label %if.else213, label %if.then9, !prof !6
+
+if.then9: ; preds = %if.end
+ %6 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp10 = icmp eq %struct.malloc_chunk* %4, %6
+ br i1 %cmp10, label %if.else200, label %if.then12
+
+if.then12: ; preds = %if.then9
+ %shr = lshr i32 %3, 3
+ %cmp13 = icmp ult i32 %3, 256
+ br i1 %cmp13, label %if.then15, label %if.else59
+
+if.then15: ; preds = %if.then12
+ %add.ptr5.sum24 = sub i32 8, %3
+ %fd = getelementptr inbounds i8* %0, i32 %add.ptr5.sum24
+ %7 = bitcast i8* %fd to %struct.malloc_chunk**
+ %8 = load %struct.malloc_chunk** %7, align 4, !tbaa !0
+ %add.ptr5.sum25 = sub i32 12, %3
+ %bk = getelementptr inbounds i8* %0, i32 %add.ptr5.sum25
+ %9 = bitcast i8* %bk to %struct.malloc_chunk**
+ %10 = load %struct.malloc_chunk** %9, align 4, !tbaa !0
+ %shl = shl nuw nsw i32 %shr, 1
+ %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl
+ %11 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk*
+ %cmp17 = icmp eq %struct.malloc_chunk* %8, %11
+ br i1 %cmp17, label %if.then27, label %lor.rhs
+
+lor.rhs: ; preds = %if.then15
+ %12 = bitcast %struct.malloc_chunk* %8 to i8*
+ %cmp20 = icmp ult i8* %12, %5
+ br i1 %cmp20, label %if.else57, label %land.rhs
+
+land.rhs: ; preds = %lor.rhs
+ %bk22 = getelementptr inbounds %struct.malloc_chunk* %8, i32 0, i32 3
+ %13 = load %struct.malloc_chunk** %bk22, align 4, !tbaa !0
+ %cmp23 = icmp eq %struct.malloc_chunk* %13, %4
+ br i1 %cmp23, label %if.then27, label %if.else57, !prof !5
+
+if.then27: ; preds = %land.rhs, %if.then15
+ %cmp28 = icmp eq %struct.malloc_chunk* %10, %8
+ br i1 %cmp28, label %if.then30, label %if.else
+
+if.then30: ; preds = %if.then27
+ %shl31 = shl i32 1, %shr
+ %neg = xor i32 %shl31, -1
+ %14 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and32 = and i32 %14, %neg
+ store i32 %and32, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end215
+
+if.else: ; preds = %if.then27
+ %cmp36 = icmp eq %struct.malloc_chunk* %10, %11
+ br i1 %cmp36, label %if.else.if.then51_crit_edge, label %lor.rhs38
+
+if.else.if.then51_crit_edge: ; preds = %if.else
+ %fd53.pre = getelementptr inbounds %struct.malloc_chunk* %10, i32 0, i32 2
+ br label %if.then51
+
+lor.rhs38: ; preds = %if.else
+ %15 = bitcast %struct.malloc_chunk* %10 to i8*
+ %cmp40 = icmp ult i8* %15, %5
+ br i1 %cmp40, label %if.else54, label %land.rhs42
+
+land.rhs42: ; preds = %lor.rhs38
+ %fd43 = getelementptr inbounds %struct.malloc_chunk* %10, i32 0, i32 2
+ %16 = load %struct.malloc_chunk** %fd43, align 4, !tbaa !0
+ %cmp44 = icmp eq %struct.malloc_chunk* %16, %4
+ br i1 %cmp44, label %if.then51, label %if.else54, !prof !5
+
+if.then51: ; preds = %land.rhs42, %if.else.if.then51_crit_edge
+ %fd53.pre-phi = phi %struct.malloc_chunk** [ %fd53.pre, %if.else.if.then51_crit_edge ], [ %fd43, %land.rhs42 ]
+ %bk52 = getelementptr inbounds %struct.malloc_chunk* %8, i32 0, i32 3
+ store %struct.malloc_chunk* %10, %struct.malloc_chunk** %bk52, align 4, !tbaa !0
+ store %struct.malloc_chunk* %8, %struct.malloc_chunk** %fd53.pre-phi, align 4, !tbaa !0
+ br label %if.end215
+
+if.else54: ; preds = %land.rhs42, %lor.rhs38
+ tail call void @abort() #6
+ unreachable
+
+if.else57: ; preds = %land.rhs, %lor.rhs
+ tail call void @abort() #6
+ unreachable
+
+if.else59: ; preds = %if.then12
+ %17 = bitcast i8* %add.ptr5 to %struct.malloc_tree_chunk*
+ %add.ptr5.sum18 = sub i32 24, %3
+ %parent = getelementptr inbounds i8* %0, i32 %add.ptr5.sum18
+ %18 = bitcast i8* %parent to %struct.malloc_tree_chunk**
+ %19 = load %struct.malloc_tree_chunk** %18, align 4, !tbaa !0
+ %add.ptr5.sum19 = sub i32 12, %3
+ %bk60 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum19
+ %20 = bitcast i8* %bk60 to %struct.malloc_tree_chunk**
+ %21 = load %struct.malloc_tree_chunk** %20, align 4, !tbaa !0
+ %cmp61 = icmp eq %struct.malloc_tree_chunk* %21, %17
+ br i1 %cmp61, label %if.else85, label %if.then63
+
+if.then63: ; preds = %if.else59
+ %add.ptr5.sum23 = sub i32 8, %3
+ %fd65 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum23
+ %22 = bitcast i8* %fd65 to %struct.malloc_tree_chunk**
+ %23 = load %struct.malloc_tree_chunk** %22, align 4, !tbaa !0
+ %24 = bitcast %struct.malloc_tree_chunk* %23 to i8*
+ %cmp68 = icmp ult i8* %24, %5
+ br i1 %cmp68, label %if.else83, label %land.lhs.true
+
+land.lhs.true: ; preds = %if.then63
+ %bk70 = getelementptr inbounds %struct.malloc_tree_chunk* %23, i32 0, i32 3
+ %25 = load %struct.malloc_tree_chunk** %bk70, align 4, !tbaa !0
+ %cmp71 = icmp eq %struct.malloc_tree_chunk* %25, %17
+ br i1 %cmp71, label %land.rhs73, label %if.else83
+
+land.rhs73: ; preds = %land.lhs.true
+ %fd74 = getelementptr inbounds %struct.malloc_tree_chunk* %21, i32 0, i32 2
+ %26 = load %struct.malloc_tree_chunk** %fd74, align 4, !tbaa !0
+ %cmp75 = icmp eq %struct.malloc_tree_chunk* %26, %17
+ br i1 %cmp75, label %if.then80, label %if.else83, !prof !5
+
+if.then80: ; preds = %land.rhs73
+ store %struct.malloc_tree_chunk* %21, %struct.malloc_tree_chunk** %bk70, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %23, %struct.malloc_tree_chunk** %fd74, align 4, !tbaa !0
+ br label %if.end114
+
+if.else83: ; preds = %land.rhs73, %land.lhs.true, %if.then63
+ tail call void @abort() #6
+ unreachable
+
+if.else85: ; preds = %if.else59
+ %add.ptr5.sum20 = sub i32 16, %3
+ %child.sum = add i32 %add.ptr5.sum20, 4
+ %arrayidx86 = getelementptr inbounds i8* %0, i32 %child.sum
+ %27 = bitcast i8* %arrayidx86 to %struct.malloc_tree_chunk**
+ %28 = load %struct.malloc_tree_chunk** %27, align 4, !tbaa !0
+ %cmp87 = icmp eq %struct.malloc_tree_chunk* %28, null
+ br i1 %cmp87, label %lor.lhs.false, label %while.cond
+
+lor.lhs.false: ; preds = %if.else85
+ %child = getelementptr inbounds i8* %0, i32 %add.ptr5.sum20
+ %arrayidx90 = bitcast i8* %child to %struct.malloc_tree_chunk**
+ %29 = load %struct.malloc_tree_chunk** %arrayidx90, align 4, !tbaa !0
+ %cmp91 = icmp eq %struct.malloc_tree_chunk* %29, null
+ br i1 %cmp91, label %if.end114, label %while.cond
+
+while.cond: ; preds = %lor.rhs98, %while.cond, %lor.lhs.false, %if.else85
+ %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx90, %lor.lhs.false ], [ %27, %if.else85 ], [ %arrayidx95, %while.cond ], [ %arrayidx100, %lor.rhs98 ]
+ %R.0 = phi %struct.malloc_tree_chunk* [ %29, %lor.lhs.false ], [ %28, %if.else85 ], [ %30, %while.cond ], [ %31, %lor.rhs98 ]
+ %arrayidx95 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1
+ %30 = load %struct.malloc_tree_chunk** %arrayidx95, align 4, !tbaa !0
+ %cmp96 = icmp eq %struct.malloc_tree_chunk* %30, null
+ br i1 %cmp96, label %lor.rhs98, label %while.cond
+
+lor.rhs98: ; preds = %while.cond
+ %arrayidx100 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0
+ %31 = load %struct.malloc_tree_chunk** %arrayidx100, align 4, !tbaa !0
+ %cmp101 = icmp eq %struct.malloc_tree_chunk* %31, null
+ br i1 %cmp101, label %while.end, label %while.cond
+
+while.end: ; preds = %lor.rhs98
+ %32 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8*
+ %cmp106 = icmp ult i8* %32, %5
+ br i1 %cmp106, label %if.else111, label %if.then110, !prof !6
+
+if.then110: ; preds = %while.end
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0
+ br label %if.end114
+
+if.else111: ; preds = %while.end
+ tail call void @abort() #6
+ unreachable
+
+if.end114: ; preds = %if.then110, %lor.lhs.false, %if.then80
+ %R.1 = phi %struct.malloc_tree_chunk* [ %21, %if.then80 ], [ %R.0, %if.then110 ], [ null, %lor.lhs.false ]
+ %cmp115 = icmp eq %struct.malloc_tree_chunk* %19, null
+ br i1 %cmp115, label %if.end215, label %if.then117
+
+if.then117: ; preds = %if.end114
+ %add.ptr5.sum21 = sub i32 28, %3
+ %index = getelementptr inbounds i8* %0, i32 %add.ptr5.sum21
+ %33 = bitcast i8* %index to i32*
+ %34 = load i32* %33, align 4, !tbaa !3
+ %arrayidx118 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %34
+ %35 = load %struct.malloc_tree_chunk** %arrayidx118, align 4, !tbaa !0
+ %cmp119 = icmp eq %struct.malloc_tree_chunk* %17, %35
+ br i1 %cmp119, label %if.then121, label %if.else130
+
+if.then121: ; preds = %if.then117
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx118, align 4, !tbaa !0
+ %cond29 = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cond29, label %if.end150.thread, label %if.then153
+
+if.end150.thread: ; preds = %if.then121
+ %shl126 = shl i32 1, %34
+ %neg127 = xor i32 %shl126, -1
+ %36 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and128 = and i32 %36, %neg127
+ store i32 %and128, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end215
+
+if.else130: ; preds = %if.then117
+ %37 = bitcast %struct.malloc_tree_chunk* %19 to i8*
+ %38 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp132 = icmp ult i8* %37, %38
+ br i1 %cmp132, label %if.else148, label %if.then136, !prof !6
+
+if.then136: ; preds = %if.else130
+ %arrayidx138 = getelementptr inbounds %struct.malloc_tree_chunk* %19, i32 0, i32 4, i32 0
+ %39 = load %struct.malloc_tree_chunk** %arrayidx138, align 4, !tbaa !0
+ %cmp139 = icmp eq %struct.malloc_tree_chunk* %39, %17
+ br i1 %cmp139, label %if.then141, label %if.else144
+
+if.then141: ; preds = %if.then136
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx138, align 4, !tbaa !0
+ br label %if.end150
+
+if.else144: ; preds = %if.then136
+ %arrayidx146 = getelementptr inbounds %struct.malloc_tree_chunk* %19, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx146, align 4, !tbaa !0
+ br label %if.end150
+
+if.else148: ; preds = %if.else130
+ tail call void @abort() #6
+ unreachable
+
+if.end150: ; preds = %if.else144, %if.then141
+ %cmp151 = icmp eq %struct.malloc_tree_chunk* %R.1, null
+ br i1 %cmp151, label %if.end215, label %if.then153
+
+if.then153: ; preds = %if.end150, %if.then121
+ %40 = bitcast %struct.malloc_tree_chunk* %R.1 to i8*
+ %41 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp155 = icmp ult i8* %40, %41
+ br i1 %cmp155, label %if.else195, label %if.then159, !prof !6
+
+if.then159: ; preds = %if.then153
+ %parent160 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %19, %struct.malloc_tree_chunk** %parent160, align 4, !tbaa !0
+ %add.ptr5.sum22 = sub i32 16, %3
+ %child161 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum22
+ %arrayidx162 = bitcast i8* %child161 to %struct.malloc_tree_chunk**
+ %42 = load %struct.malloc_tree_chunk** %arrayidx162, align 4, !tbaa !0
+ %cmp163 = icmp eq %struct.malloc_tree_chunk* %42, null
+ br i1 %cmp163, label %if.end177, label %if.then165
+
+if.then165: ; preds = %if.then159
+ %43 = bitcast %struct.malloc_tree_chunk* %42 to i8*
+ %44 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp167 = icmp ult i8* %43, %44
+ br i1 %cmp167, label %if.else175, label %if.then171, !prof !6
+
+if.then171: ; preds = %if.then165
+ %arrayidx173 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %42, %struct.malloc_tree_chunk** %arrayidx173, align 4, !tbaa !0
+ %parent174 = getelementptr inbounds %struct.malloc_tree_chunk* %42, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent174, align 4, !tbaa !0
+ br label %if.end177
+
+if.else175: ; preds = %if.then165
+ tail call void @abort() #6
+ unreachable
+
+if.end177: ; preds = %if.then171, %if.then159
+ %child161.sum = add i32 %add.ptr5.sum22, 4
+ %arrayidx179 = getelementptr inbounds i8* %0, i32 %child161.sum
+ %45 = bitcast i8* %arrayidx179 to %struct.malloc_tree_chunk**
+ %46 = load %struct.malloc_tree_chunk** %45, align 4, !tbaa !0
+ %cmp180 = icmp eq %struct.malloc_tree_chunk* %46, null
+ br i1 %cmp180, label %if.end215, label %if.then182
+
+if.then182: ; preds = %if.end177
+ %47 = bitcast %struct.malloc_tree_chunk* %46 to i8*
+ %48 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp184 = icmp ult i8* %47, %48
+ br i1 %cmp184, label %if.else192, label %if.then188, !prof !6
+
+if.then188: ; preds = %if.then182
+ %arrayidx190 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %46, %struct.malloc_tree_chunk** %arrayidx190, align 4, !tbaa !0
+ %parent191 = getelementptr inbounds %struct.malloc_tree_chunk* %46, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent191, align 4, !tbaa !0
+ br label %if.end215
+
+if.else192: ; preds = %if.then182
+ tail call void @abort() #6
+ unreachable
+
+if.else195: ; preds = %if.then153
+ tail call void @abort() #6
+ unreachable
+
+if.else200: ; preds = %if.then9
+ %add.ptr.sum = add i32 %psize, 4
+ %head201 = getelementptr inbounds i8* %0, i32 %add.ptr.sum
+ %49 = bitcast i8* %head201 to i32*
+ %50 = load i32* %49, align 4, !tbaa !3
+ %and202 = and i32 %50, 3
+ %cmp203 = icmp eq i32 %and202, 3
+ br i1 %cmp203, label %if.then205, label %if.end215
+
+if.then205: ; preds = %if.else200
+ store i32 %add6, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %51 = load i32* %49, align 4, !tbaa !3
+ %and207 = and i32 %51, -2
+ store i32 %and207, i32* %49, align 4, !tbaa !3
+ %or = or i32 %add6, 1
+ %add.ptr5.sum = sub i32 4, %3
+ %head208 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum
+ %52 = bitcast i8* %head208 to i32*
+ store i32 %or, i32* %52, align 4, !tbaa !3
+ %prev_foot210 = bitcast i8* %add.ptr to i32*
+ store i32 %add6, i32* %prev_foot210, align 4, !tbaa !3
+ br label %if.end649
+
+if.else213: ; preds = %if.end
+ tail call void @abort() #6
+ unreachable
+
+if.end215: ; preds = %if.else200, %if.then188, %if.end177, %if.end150, %if.end150.thread, %if.end114, %if.then51, %if.then30, %entry
+ %psize.addr.0 = phi i32 [ %add6, %if.then30 ], [ %add6, %if.then51 ], [ %add6, %if.then188 ], [ %add6, %if.else200 ], [ %psize, %entry ], [ %add6, %if.end114 ], [ %add6, %if.end150.thread ], [ %add6, %if.end150 ], [ %add6, %if.end177 ]
+ %p.addr.0 = phi %struct.malloc_chunk* [ %4, %if.then30 ], [ %4, %if.then51 ], [ %4, %if.then188 ], [ %4, %if.else200 ], [ %p, %entry ], [ %4, %if.end114 ], [ %4, %if.end150.thread ], [ %4, %if.end150 ], [ %4, %if.end177 ]
+ %53 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp217 = icmp ult i8* %add.ptr, %53
+ br i1 %cmp217, label %if.else648, label %if.then221, !prof !6
+
+if.then221: ; preds = %if.end215
+ %add.ptr.sum1 = add i32 %psize, 4
+ %head222 = getelementptr inbounds i8* %0, i32 %add.ptr.sum1
+ %54 = bitcast i8* %head222 to i32*
+ %55 = load i32* %54, align 4, !tbaa !3
+ %and223 = and i32 %55, 2
+ %tobool224 = icmp eq i32 %and223, 0
+ br i1 %tobool224, label %if.then225, label %if.else493
+
+if.then225: ; preds = %if.then221
+ %56 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %cmp226 = icmp eq %struct.malloc_chunk* %1, %56
+ br i1 %cmp226, label %if.then228, label %if.else240
+
+if.then228: ; preds = %if.then225
+ %57 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ %add229 = add i32 %57, %psize.addr.0
+ store i32 %add229, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0
+ %or231 = or i32 %add229, 1
+ %head232 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1
+ store i32 %or231, i32* %head232, align 4, !tbaa !3
+ %58 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp234 = icmp eq %struct.malloc_chunk* %p.addr.0, %58
+ br i1 %cmp234, label %if.then236, label %if.end649
+
+if.then236: ; preds = %if.then228
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ br label %if.end649
+
+if.else240: ; preds = %if.then225
+ %59 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp242 = icmp eq %struct.malloc_chunk* %1, %59
+ br i1 %cmp242, label %if.then244, label %if.else252
+
+if.then244: ; preds = %if.else240
+ %60 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ %add246 = add i32 %60, %psize.addr.0
+ store i32 %add246, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %or248 = or i32 %add246, 1
+ %head249 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1
+ store i32 %or248, i32* %head249, align 4, !tbaa !3
+ %61 = bitcast %struct.malloc_chunk* %p.addr.0 to i8*
+ %add.ptr250 = getelementptr inbounds i8* %61, i32 %add246
+ %prev_foot251 = bitcast i8* %add.ptr250 to i32*
+ store i32 %add246, i32* %prev_foot251, align 4, !tbaa !3
+ br label %if.end649
+
+if.else252: ; preds = %if.else240
+ %and254 = and i32 %55, -8
+ %add255 = add i32 %and254, %psize.addr.0
+ %shr256 = lshr i32 %55, 3
+ %cmp257 = icmp ult i32 %55, 256
+ br i1 %cmp257, label %if.then259, label %if.else321
+
+if.then259: ; preds = %if.else252
+ %add.ptr.sum15 = add i32 %psize, 8
+ %fd261 = getelementptr inbounds i8* %0, i32 %add.ptr.sum15
+ %62 = bitcast i8* %fd261 to %struct.malloc_chunk**
+ %63 = load %struct.malloc_chunk** %62, align 4, !tbaa !0
+ %add.ptr.sum16 = add i32 %psize, 12
+ %bk263 = getelementptr inbounds i8* %0, i32 %add.ptr.sum16
+ %64 = bitcast i8* %bk263 to %struct.malloc_chunk**
+ %65 = load %struct.malloc_chunk** %64, align 4, !tbaa !0
+ %shl266 = shl nuw nsw i32 %shr256, 1
+ %arrayidx268 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl266
+ %66 = bitcast %struct.malloc_chunk** %arrayidx268 to %struct.malloc_chunk*
+ %cmp269 = icmp eq %struct.malloc_chunk* %63, %66
+ br i1 %cmp269, label %if.then285, label %lor.rhs271
+
+lor.rhs271: ; preds = %if.then259
+ %67 = bitcast %struct.malloc_chunk* %63 to i8*
+ %cmp273 = icmp ult i8* %67, %53
+ br i1 %cmp273, label %if.else319, label %land.rhs275
+
+land.rhs275: ; preds = %lor.rhs271
+ %bk276 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3
+ %68 = load %struct.malloc_chunk** %bk276, align 4, !tbaa !0
+ %cmp277 = icmp eq %struct.malloc_chunk* %68, %1
+ br i1 %cmp277, label %if.then285, label %if.else319, !prof !5
+
+if.then285: ; preds = %land.rhs275, %if.then259
+ %cmp286 = icmp eq %struct.malloc_chunk* %65, %63
+ br i1 %cmp286, label %if.then288, label %if.else293
+
+if.then288: ; preds = %if.then285
+ %shl289 = shl i32 1, %shr256
+ %neg290 = xor i32 %shl289, -1
+ %69 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %and292 = and i32 %69, %neg290
+ store i32 %and292, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ br label %if.end480
+
+if.else293: ; preds = %if.then285
+ %cmp297 = icmp eq %struct.malloc_chunk* %65, %66
+ br i1 %cmp297, label %if.else293.if.then313_crit_edge, label %lor.rhs299
+
+if.else293.if.then313_crit_edge: ; preds = %if.else293
+ %fd315.pre = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2
+ br label %if.then313
+
+lor.rhs299: ; preds = %if.else293
+ %70 = bitcast %struct.malloc_chunk* %65 to i8*
+ %cmp301 = icmp ult i8* %70, %53
+ br i1 %cmp301, label %if.else316, label %land.rhs303
+
+land.rhs303: ; preds = %lor.rhs299
+ %fd304 = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2
+ %71 = load %struct.malloc_chunk** %fd304, align 4, !tbaa !0
+ %cmp305 = icmp eq %struct.malloc_chunk* %71, %1
+ br i1 %cmp305, label %if.then313, label %if.else316, !prof !5
+
+if.then313: ; preds = %land.rhs303, %if.else293.if.then313_crit_edge
+ %fd315.pre-phi = phi %struct.malloc_chunk** [ %fd315.pre, %if.else293.if.then313_crit_edge ], [ %fd304, %land.rhs303 ]
+ %bk314 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3
+ store %struct.malloc_chunk* %65, %struct.malloc_chunk** %bk314, align 4, !tbaa !0
+ store %struct.malloc_chunk* %63, %struct.malloc_chunk** %fd315.pre-phi, align 4, !tbaa !0
+ br label %if.end480
+
+if.else316: ; preds = %land.rhs303, %lor.rhs299
+ tail call void @abort() #6
+ unreachable
+
+if.else319: ; preds = %land.rhs275, %lor.rhs271
+ tail call void @abort() #6
+ unreachable
+
+if.else321: ; preds = %if.else252
+ %72 = bitcast i8* %add.ptr to %struct.malloc_tree_chunk*
+ %add.ptr.sum2 = add i32 %psize, 24
+ %parent324 = getelementptr inbounds i8* %0, i32 %add.ptr.sum2
+ %73 = bitcast i8* %parent324 to %struct.malloc_tree_chunk**
+ %74 = load %struct.malloc_tree_chunk** %73, align 4, !tbaa !0
+ %add.ptr.sum3 = add i32 %psize, 12
+ %bk326 = getelementptr inbounds i8* %0, i32 %add.ptr.sum3
+ %75 = bitcast i8* %bk326 to %struct.malloc_tree_chunk**
+ %76 = load %struct.malloc_tree_chunk** %75, align 4, !tbaa !0
+ %cmp327 = icmp eq %struct.malloc_tree_chunk* %76, %72
+ br i1 %cmp327, label %if.else353, label %if.then329
+
+if.then329: ; preds = %if.else321
+ %add.ptr.sum14 = add i32 %psize, 8
+ %fd331 = getelementptr inbounds i8* %0, i32 %add.ptr.sum14
+ %77 = bitcast i8* %fd331 to %struct.malloc_tree_chunk**
+ %78 = load %struct.malloc_tree_chunk** %77, align 4, !tbaa !0
+ %79 = bitcast %struct.malloc_tree_chunk* %78 to i8*
+ %cmp334 = icmp ult i8* %79, %53
+ br i1 %cmp334, label %if.else351, label %land.lhs.true336
+
+land.lhs.true336: ; preds = %if.then329
+ %bk337 = getelementptr inbounds %struct.malloc_tree_chunk* %78, i32 0, i32 3
+ %80 = load %struct.malloc_tree_chunk** %bk337, align 4, !tbaa !0
+ %cmp338 = icmp eq %struct.malloc_tree_chunk* %80, %72
+ br i1 %cmp338, label %land.rhs340, label %if.else351
+
+land.rhs340: ; preds = %land.lhs.true336
+ %fd341 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 2
+ %81 = load %struct.malloc_tree_chunk** %fd341, align 4, !tbaa !0
+ %cmp342 = icmp eq %struct.malloc_tree_chunk* %81, %72
+ br i1 %cmp342, label %if.then348, label %if.else351, !prof !5
+
+if.then348: ; preds = %land.rhs340
+ store %struct.malloc_tree_chunk* %76, %struct.malloc_tree_chunk** %bk337, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %78, %struct.malloc_tree_chunk** %fd341, align 4, !tbaa !0
+ br label %if.end389
+
+if.else351: ; preds = %land.rhs340, %land.lhs.true336, %if.then329
+ tail call void @abort() #6
+ unreachable
+
+if.else353: ; preds = %if.else321
+ %child355.sum = add i32 %psize, 20
+ %arrayidx356 = getelementptr inbounds i8* %0, i32 %child355.sum
+ %82 = bitcast i8* %arrayidx356 to %struct.malloc_tree_chunk**
+ %83 = load %struct.malloc_tree_chunk** %82, align 4, !tbaa !0
+ %cmp357 = icmp eq %struct.malloc_tree_chunk* %83, null
+ br i1 %cmp357, label %lor.lhs.false359, label %while.cond366
+
+lor.lhs.false359: ; preds = %if.else353
+ %add.ptr.sum4 = add i32 %psize, 16
+ %child355 = getelementptr inbounds i8* %0, i32 %add.ptr.sum4
+ %arrayidx361 = bitcast i8* %child355 to %struct.malloc_tree_chunk**
+ %84 = load %struct.malloc_tree_chunk** %arrayidx361, align 4, !tbaa !0
+ %cmp362 = icmp eq %struct.malloc_tree_chunk* %84, null
+ br i1 %cmp362, label %if.end389, label %while.cond366
+
+while.cond366: ; preds = %lor.rhs371, %while.cond366, %lor.lhs.false359, %if.else353
+ %RP354.0 = phi %struct.malloc_tree_chunk** [ %arrayidx361, %lor.lhs.false359 ], [ %82, %if.else353 ], [ %arrayidx368, %while.cond366 ], [ %arrayidx373, %lor.rhs371 ]
+ %R325.0 = phi %struct.malloc_tree_chunk* [ %84, %lor.lhs.false359 ], [ %83, %if.else353 ], [ %85, %while.cond366 ], [ %86, %lor.rhs371 ]
+ %arrayidx368 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.0, i32 0, i32 4, i32 1
+ %85 = load %struct.malloc_tree_chunk** %arrayidx368, align 4, !tbaa !0
+ %cmp369 = icmp eq %struct.malloc_tree_chunk* %85, null
+ br i1 %cmp369, label %lor.rhs371, label %while.cond366
+
+lor.rhs371: ; preds = %while.cond366
+ %arrayidx373 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.0, i32 0, i32 4, i32 0
+ %86 = load %struct.malloc_tree_chunk** %arrayidx373, align 4, !tbaa !0
+ %cmp374 = icmp eq %struct.malloc_tree_chunk* %86, null
+ br i1 %cmp374, label %while.end379, label %while.cond366
+
+while.end379: ; preds = %lor.rhs371
+ %87 = bitcast %struct.malloc_tree_chunk** %RP354.0 to i8*
+ %cmp381 = icmp ult i8* %87, %53
+ br i1 %cmp381, label %if.else386, label %if.then385, !prof !6
+
+if.then385: ; preds = %while.end379
+ store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP354.0, align 4, !tbaa !0
+ br label %if.end389
+
+if.else386: ; preds = %while.end379
+ tail call void @abort() #6
+ unreachable
+
+if.end389: ; preds = %if.then385, %lor.lhs.false359, %if.then348
+ %R325.1 = phi %struct.malloc_tree_chunk* [ %76, %if.then348 ], [ %R325.0, %if.then385 ], [ null, %lor.lhs.false359 ]
+ %cmp390 = icmp eq %struct.malloc_tree_chunk* %74, null
+ br i1 %cmp390, label %if.end480, label %if.then392
+
+if.then392: ; preds = %if.end389
+ %add.ptr.sum12 = add i32 %psize, 28
+ %index394 = getelementptr inbounds i8* %0, i32 %add.ptr.sum12
+ %88 = bitcast i8* %index394 to i32*
+ %89 = load i32* %88, align 4, !tbaa !3
+ %arrayidx396 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %89
+ %90 = load %struct.malloc_tree_chunk** %arrayidx396, align 4, !tbaa !0
+ %cmp397 = icmp eq %struct.malloc_tree_chunk* %72, %90
+ br i1 %cmp397, label %if.then399, label %if.else409
+
+if.then399: ; preds = %if.then392
+ store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx396, align 4, !tbaa !0
+ %cond30 = icmp eq %struct.malloc_tree_chunk* %R325.1, null
+ br i1 %cond30, label %if.end429.thread, label %if.then432
+
+if.end429.thread: ; preds = %if.then399
+ %shl404 = shl i32 1, %89
+ %neg405 = xor i32 %shl404, -1
+ %91 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %and407 = and i32 %91, %neg405
+ store i32 %and407, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ br label %if.end480
+
+if.else409: ; preds = %if.then392
+ %92 = bitcast %struct.malloc_tree_chunk* %74 to i8*
+ %93 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp411 = icmp ult i8* %92, %93
+ br i1 %cmp411, label %if.else427, label %if.then415, !prof !6
+
+if.then415: ; preds = %if.else409
+ %arrayidx417 = getelementptr inbounds %struct.malloc_tree_chunk* %74, i32 0, i32 4, i32 0
+ %94 = load %struct.malloc_tree_chunk** %arrayidx417, align 4, !tbaa !0
+ %cmp418 = icmp eq %struct.malloc_tree_chunk* %94, %72
+ br i1 %cmp418, label %if.then420, label %if.else423
+
+if.then420: ; preds = %if.then415
+ store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx417, align 4, !tbaa !0
+ br label %if.end429
+
+if.else423: ; preds = %if.then415
+ %arrayidx425 = getelementptr inbounds %struct.malloc_tree_chunk* %74, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx425, align 4, !tbaa !0
+ br label %if.end429
+
+if.else427: ; preds = %if.else409
+ tail call void @abort() #6
+ unreachable
+
+if.end429: ; preds = %if.else423, %if.then420
+ %cmp430 = icmp eq %struct.malloc_tree_chunk* %R325.1, null
+ br i1 %cmp430, label %if.end480, label %if.then432
+
+if.then432: ; preds = %if.end429, %if.then399
+ %95 = bitcast %struct.malloc_tree_chunk* %R325.1 to i8*
+ %96 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp434 = icmp ult i8* %95, %96
+ br i1 %cmp434, label %if.else476, label %if.then438, !prof !6
+
+if.then438: ; preds = %if.then432
+ %parent441 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %74, %struct.malloc_tree_chunk** %parent441, align 4, !tbaa !0
+ %add.ptr.sum13 = add i32 %psize, 16
+ %child442 = getelementptr inbounds i8* %0, i32 %add.ptr.sum13
+ %arrayidx443 = bitcast i8* %child442 to %struct.malloc_tree_chunk**
+ %97 = load %struct.malloc_tree_chunk** %arrayidx443, align 4, !tbaa !0
+ %cmp444 = icmp eq %struct.malloc_tree_chunk* %97, null
+ br i1 %cmp444, label %if.end458, label %if.then446
+
+if.then446: ; preds = %if.then438
+ %98 = bitcast %struct.malloc_tree_chunk* %97 to i8*
+ %99 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp448 = icmp ult i8* %98, %99
+ br i1 %cmp448, label %if.else456, label %if.then452, !prof !6
+
+if.then452: ; preds = %if.then446
+ %arrayidx454 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 4, i32 0
+ store %struct.malloc_tree_chunk* %97, %struct.malloc_tree_chunk** %arrayidx454, align 4, !tbaa !0
+ %parent455 = getelementptr inbounds %struct.malloc_tree_chunk* %97, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %parent455, align 4, !tbaa !0
+ br label %if.end458
+
+if.else456: ; preds = %if.then446
+ tail call void @abort() #6
+ unreachable
+
+if.end458: ; preds = %if.then452, %if.then438
+ %child442.sum = add i32 %psize, 20
+ %arrayidx460 = getelementptr inbounds i8* %0, i32 %child442.sum
+ %100 = bitcast i8* %arrayidx460 to %struct.malloc_tree_chunk**
+ %101 = load %struct.malloc_tree_chunk** %100, align 4, !tbaa !0
+ %cmp461 = icmp eq %struct.malloc_tree_chunk* %101, null
+ br i1 %cmp461, label %if.end480, label %if.then463
+
+if.then463: ; preds = %if.end458
+ %102 = bitcast %struct.malloc_tree_chunk* %101 to i8*
+ %103 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp465 = icmp ult i8* %102, %103
+ br i1 %cmp465, label %if.else473, label %if.then469, !prof !6
+
+if.then469: ; preds = %if.then463
+ %arrayidx471 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 4, i32 1
+ store %struct.malloc_tree_chunk* %101, %struct.malloc_tree_chunk** %arrayidx471, align 4, !tbaa !0
+ %parent472 = getelementptr inbounds %struct.malloc_tree_chunk* %101, i32 0, i32 5
+ store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %parent472, align 4, !tbaa !0
+ br label %if.end480
+
+if.else473: ; preds = %if.then463
+ tail call void @abort() #6
+ unreachable
+
+if.else476: ; preds = %if.then432
+ tail call void @abort() #6
+ unreachable
+
+if.end480: ; preds = %if.then469, %if.end458, %if.end429, %if.end429.thread, %if.end389, %if.then313, %if.then288
+ %or481 = or i32 %add255, 1
+ %head482 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1
+ store i32 %or481, i32* %head482, align 4, !tbaa !3
+ %104 = bitcast %struct.malloc_chunk* %p.addr.0 to i8*
+ %add.ptr483 = getelementptr inbounds i8* %104, i32 %add255
+ %prev_foot484 = bitcast i8* %add.ptr483 to i32*
+ store i32 %add255, i32* %prev_foot484, align 4, !tbaa !3
+ %105 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0
+ %cmp486 = icmp eq %struct.malloc_chunk* %p.addr.0, %105
+ br i1 %cmp486, label %if.then488, label %if.end500
+
+if.then488: ; preds = %if.end480
+ store i32 %add255, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3
+ br label %if.end649
+
+if.else493: ; preds = %if.then221
+ %and495 = and i32 %55, -2
+ store i32 %and495, i32* %54, align 4, !tbaa !3
+ %or496 = or i32 %psize.addr.0, 1
+ %head497 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1
+ store i32 %or496, i32* %head497, align 4, !tbaa !3
+ %106 = bitcast %struct.malloc_chunk* %p.addr.0 to i8*
+ %add.ptr498 = getelementptr inbounds i8* %106, i32 %psize.addr.0
+ %prev_foot499 = bitcast i8* %add.ptr498 to i32*
+ store i32 %psize.addr.0, i32* %prev_foot499, align 4, !tbaa !3
+ br label %if.end500
+
+if.end500: ; preds = %if.else493, %if.end480
+ %psize.addr.1 = phi i32 [ %psize.addr.0, %if.else493 ], [ %add255, %if.end480 ]
+ %shr501 = lshr i32 %psize.addr.1, 3
+ %cmp502 = icmp ult i32 %psize.addr.1, 256
+ br i1 %cmp502, label %if.then504, label %if.else536
+
+if.then504: ; preds = %if.end500
+ %shl508 = shl nuw nsw i32 %shr501, 1
+ %arrayidx510 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl508
+ %107 = bitcast %struct.malloc_chunk** %arrayidx510 to %struct.malloc_chunk*
+ %108 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %shl513 = shl i32 1, %shr501
+ %and514 = and i32 %108, %shl513
+ %tobool515 = icmp eq i32 %and514, 0
+ br i1 %tobool515, label %if.then516, label %if.else520
+
+if.then516: ; preds = %if.then504
+ %or519 = or i32 %108, %shl513
+ store i32 %or519, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3
+ %arrayidx510.sum.pre = add i32 %shl508, 2
+ %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx510.sum.pre
+ br label %if.end531
+
+if.else520: ; preds = %if.then504
+ %arrayidx510.sum11 = add i32 %shl508, 2
+ %109 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx510.sum11
+ %110 = load %struct.malloc_chunk** %109, align 4, !tbaa !0
+ %111 = bitcast %struct.malloc_chunk* %110 to i8*
+ %112 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp523 = icmp ult i8* %111, %112
+ br i1 %cmp523, label %if.else529, label %if.end531, !prof !6
+
+if.else529: ; preds = %if.else520
+ tail call void @abort() #6
+ unreachable
+
+if.end531: ; preds = %if.else520, %if.then516
+ %.pre-phi = phi %struct.malloc_chunk** [ %109, %if.else520 ], [ %.pre, %if.then516 ]
+ %F511.0 = phi %struct.malloc_chunk* [ %110, %if.else520 ], [ %107, %if.then516 ]
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0
+ %bk533 = getelementptr inbounds %struct.malloc_chunk* %F511.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk533, align 4, !tbaa !0
+ %fd534 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2
+ store %struct.malloc_chunk* %F511.0, %struct.malloc_chunk** %fd534, align 4, !tbaa !0
+ %bk535 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3
+ store %struct.malloc_chunk* %107, %struct.malloc_chunk** %bk535, align 4, !tbaa !0
+ br label %if.end649
+
+if.else536: ; preds = %if.end500
+ %113 = bitcast %struct.malloc_chunk* %p.addr.0 to %struct.malloc_tree_chunk*
+ %shr540 = lshr i32 %psize.addr.1, 8
+ %cmp541 = icmp eq i32 %shr540, 0
+ br i1 %cmp541, label %if.end571, label %if.else544
+
+if.else544: ; preds = %if.else536
+ %cmp545 = icmp ugt i32 %psize.addr.1, 16777215
+ br i1 %cmp545, label %if.end571, label %if.else548
+
+if.else548: ; preds = %if.else544
+ %sub = add i32 %shr540, 1048320
+ %shr549 = lshr i32 %sub, 16
+ %and550 = and i32 %shr549, 8
+ %shl551 = shl i32 %shr540, %and550
+ %sub552 = add i32 %shl551, 520192
+ %shr553 = lshr i32 %sub552, 16
+ %and554 = and i32 %shr553, 4
+ %add555 = or i32 %and554, %and550
+ %shl556 = shl i32 %shl551, %and554
+ %sub557 = add i32 %shl556, 245760
+ %shr558 = lshr i32 %sub557, 16
+ %and559 = and i32 %shr558, 2
+ %add560 = or i32 %add555, %and559
+ %sub561 = sub i32 14, %add560
+ %shl562 = shl i32 %shl556, %and559
+ %shr563 = lshr i32 %shl562, 15
+ %add564 = add i32 %sub561, %shr563
+ %shl565 = shl nsw i32 %add564, 1
+ %add566 = add i32 %add564, 7
+ %shr567 = lshr i32 %psize.addr.1, %add566
+ %and568 = and i32 %shr567, 1
+ %add569 = or i32 %and568, %shl565
+ br label %if.end571
+
+if.end571: ; preds = %if.else548, %if.else544, %if.else536
+ %I539.0 = phi i32 [ %add569, %if.else548 ], [ 0, %if.else536 ], [ 31, %if.else544 ]
+ %arrayidx573 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I539.0
+ %index574 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 3
+ %I539.0.c = inttoptr i32 %I539.0 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %I539.0.c, %struct.malloc_chunk** %index574, align 4, !tbaa !3
+ %arrayidx576 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 1
+ store i32 0, i32* %arrayidx576, align 4, !tbaa !0
+ %114 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 0
+ store i32 0, i32* %114, align 4, !tbaa !0
+ %115 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ %shl580 = shl i32 1, %I539.0
+ %and581 = and i32 %115, %shl580
+ %tobool582 = icmp eq i32 %and581, 0
+ br i1 %tobool582, label %if.then583, label %if.else590
+
+if.then583: ; preds = %if.end571
+ %or586 = or i32 %115, %shl580
+ store i32 %or586, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3
+ store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx573, align 4, !tbaa !0
+ %parent587 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2
+ %.c = bitcast %struct.malloc_tree_chunk** %arrayidx573 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c, %struct.malloc_chunk** %parent587, align 4, !tbaa !0
+ %bk588 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk588, align 4, !tbaa !0
+ %fd589 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %fd589, align 4, !tbaa !0
+ br label %if.end649
+
+if.else590: ; preds = %if.end571
+ %116 = load %struct.malloc_tree_chunk** %arrayidx573, align 4, !tbaa !0
+ %cmp592 = icmp eq i32 %I539.0, 31
+ br i1 %cmp592, label %cond.end, label %cond.false
+
+cond.false: ; preds = %if.else590
+ %shr594 = lshr i32 %I539.0, 1
+ %sub597 = sub i32 25, %shr594
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %if.else590
+ %cond = phi i32 [ %sub597, %cond.false ], [ 0, %if.else590 ]
+ %head59932 = getelementptr inbounds %struct.malloc_tree_chunk* %116, i32 0, i32 1
+ %117 = load i32* %head59932, align 4, !tbaa !3
+ %and60033 = and i32 %117, -8
+ %cmp60134 = icmp eq i32 %and60033, %psize.addr.1
+ br i1 %cmp60134, label %if.else624, label %if.then603.lr.ph
+
+if.then603.lr.ph: ; preds = %cond.end
+ %shl598 = shl i32 %psize.addr.1, %cond
+ br label %if.then603
+
+for.cond: ; preds = %if.then603
+ %shl608 = shl i32 %K591.036, 1
+ %head599 = getelementptr inbounds %struct.malloc_tree_chunk* %119, i32 0, i32 1
+ %118 = load i32* %head599, align 4, !tbaa !3
+ %and600 = and i32 %118, -8
+ %cmp601 = icmp eq i32 %and600, %psize.addr.1
+ br i1 %cmp601, label %if.else624, label %if.then603
+
+if.then603: ; preds = %for.cond, %if.then603.lr.ph
+ %K591.036 = phi i32 [ %shl598, %if.then603.lr.ph ], [ %shl608, %for.cond ]
+ %T.035 = phi %struct.malloc_tree_chunk* [ %116, %if.then603.lr.ph ], [ %119, %for.cond ]
+ %shr604 = lshr i32 %K591.036, 31
+ %arrayidx607 = getelementptr inbounds %struct.malloc_tree_chunk* %T.035, i32 0, i32 4, i32 %shr604
+ %119 = load %struct.malloc_tree_chunk** %arrayidx607, align 4, !tbaa !0
+ %cmp609 = icmp eq %struct.malloc_tree_chunk* %119, null
+ br i1 %cmp609, label %if.else612, label %for.cond
+
+if.else612: ; preds = %if.then603
+ %120 = bitcast %struct.malloc_tree_chunk** %arrayidx607 to i8*
+ %121 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp614 = icmp ult i8* %120, %121
+ br i1 %cmp614, label %if.else622, label %if.then618, !prof !6
+
+if.then618: ; preds = %if.else612
+ store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx607, align 4, !tbaa !0
+ %parent619 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2
+ %T.0.c8 = bitcast %struct.malloc_tree_chunk* %T.035 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c8, %struct.malloc_chunk** %parent619, align 4, !tbaa !0
+ %bk620 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk620, align 4, !tbaa !0
+ %fd621 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2
+ store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %fd621, align 4, !tbaa !0
+ br label %if.end649
+
+if.else622: ; preds = %if.else612
+ tail call void @abort() #6
+ unreachable
+
+if.else624: ; preds = %for.cond, %cond.end
+ %T.0.lcssa = phi %struct.malloc_tree_chunk* [ %116, %cond.end ], [ %119, %for.cond ]
+ %fd626 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa, i32 0, i32 2
+ %122 = load %struct.malloc_tree_chunk** %fd626, align 4, !tbaa !0
+ %123 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to i8*
+ %124 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0
+ %cmp628 = icmp ult i8* %123, %124
+ br i1 %cmp628, label %if.else644, label %land.rhs630
+
+land.rhs630: ; preds = %if.else624
+ %125 = bitcast %struct.malloc_tree_chunk* %122 to i8*
+ %cmp632 = icmp ult i8* %125, %124
+ br i1 %cmp632, label %if.else644, label %if.then638, !prof !6
+
+if.then638: ; preds = %land.rhs630
+ %bk639 = getelementptr inbounds %struct.malloc_tree_chunk* %122, i32 0, i32 3
+ store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %bk639, align 4, !tbaa !0
+ store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %fd626, align 4, !tbaa !0
+ %fd641 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2
+ %.c7 = bitcast %struct.malloc_tree_chunk* %122 to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %.c7, %struct.malloc_chunk** %fd641, align 4, !tbaa !0
+ %bk642 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3
+ %T.0.c = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to %struct.malloc_chunk*
+ store %struct.malloc_chunk* %T.0.c, %struct.malloc_chunk** %bk642, align 4, !tbaa !0
+ %parent643 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2
+ store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent643, align 4, !tbaa !0
+ br label %if.end649
+
+if.else644: ; preds = %land.rhs630, %if.else624
+ tail call void @abort() #6
+ unreachable
+
+if.else648: ; preds = %if.end215
+ tail call void @abort() #6
+ unreachable
+
+if.end649: ; preds = %if.then638, %if.then618, %if.then583, %if.end531, %if.then488, %if.then244, %if.then236, %if.then228, %if.then205, %if.then
+ ret void
+}
+
+declare i32 @sysconf(i32) #5
+
+declare i32 @time(i32*) #5
+
+define weak i8* @_Znwj(i32 %size) #5 {
+entry:
+ %cmp = icmp eq i32 %size, 0
+ %.size = select i1 %cmp, i32 1, i32 %size
+ br label %invoke.cont
+
+invoke.cont: ; preds = %if.then3, %entry
+ %call = tail call i8* @malloc(i32 %.size)
+ %cmp1 = icmp eq i8* %call, null
+ br i1 %cmp1, label %while.body, label %while.end
+
+while.body: ; preds = %invoke.cont
+ %0 = atomicrmw add i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 0 seq_cst
+ %tobool = icmp eq i32 %0, 0
+ br i1 %tobool, label %if.else, label %if.then3
+
+if.then3: ; preds = %while.body
+ %1 = inttoptr i32 %0 to void ()*
+ invoke void %1()
+ to label %invoke.cont unwind label %lpad.loopexit
+
+lpad.loopexit: ; preds = %if.then3
+ %lpad.loopexit4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)]
+ br label %lpad
+
+lpad.nonloopexit: ; preds = %if.else
+ %lpad.nonloopexit5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)]
+ br label %lpad
+
+lpad: ; preds = %lpad.nonloopexit, %lpad.loopexit
+ %lpad.phi = phi { i8*, i32 } [ %lpad.loopexit4, %lpad.loopexit ], [ %lpad.nonloopexit5, %lpad.nonloopexit ]
+ %2 = extractvalue { i8*, i32 } %lpad.phi, 1
+ %ehspec.fails = icmp slt i32 %2, 0
+ br i1 %ehspec.fails, label %ehspec.unexpected, label %eh.resume
+
+ehspec.unexpected: ; preds = %lpad
+ %3 = extractvalue { i8*, i32 } %lpad.phi, 0
+ tail call void @__cxa_call_unexpected(i8* %3) #8
+ unreachable
+
+if.else: ; preds = %while.body
+ %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1
+ %4 = bitcast i8* %exception to i32 (...)***
+ store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 4, !tbaa !8
+ invoke void @__cxa_throw(i8* %exception, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*)) #8
+ to label %unreachable unwind label %lpad.nonloopexit
+
+while.end: ; preds = %invoke.cont
+ ret i8* %call
+
+eh.resume: ; preds = %lpad
+ resume { i8*, i32 } %lpad.phi
+
+unreachable: ; preds = %if.else
+ unreachable
+}
+
+declare i32 @__gxx_personality_v0(...)
+
+; Function Attrs: nounwind
+define void ()* @_ZSt15get_new_handlerv() #0 {
+entry:
+ %0 = atomicrmw add i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 0 seq_cst
+ %1 = inttoptr i32 %0 to void ()*
+ ret void ()* %1
+}
+
+declare i8* @__cxa_allocate_exception(i32)
+
+declare void @__cxa_throw(i8*, i8*, i8*)
+
+declare void @__cxa_call_unexpected(i8*)
+
+; Function Attrs: nounwind
+define weak noalias i8* @_ZnwjRKSt9nothrow_t(i32 %size, %"struct.std::nothrow_t"*) #0 {
+entry:
+ %call = invoke noalias i8* @_Znwj(i32 %size)
+ to label %try.cont unwind label %lpad
+
+lpad: ; preds = %entry
+ %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ catch i8* null
+ %2 = extractvalue { i8*, i32 } %1, 0
+ %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1
+ invoke void @__cxa_end_catch()
+ to label %try.cont unwind label %lpad1
+
+try.cont: ; preds = %lpad, %entry
+ %p.0 = phi i8* [ null, %lpad ], [ %call, %entry ]
+ ret i8* %p.0
+
+lpad1: ; preds = %lpad
+ %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ %5 = extractvalue { i8*, i32 } %4, 0
+ tail call void @__cxa_call_unexpected(i8* %5) #6
+ unreachable
+}
+
+declare i8* @__cxa_begin_catch(i8*)
+
+declare void @__cxa_end_catch()
+
+define weak noalias i8* @_Znaj(i32 %size) #5 {
+entry:
+ %call = invoke noalias i8* @_Znwj(i32 %size)
+ to label %invoke.cont unwind label %lpad
+
+invoke.cont: ; preds = %entry
+ ret i8* %call
+
+lpad: ; preds = %entry
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)]
+ %1 = extractvalue { i8*, i32 } %0, 1
+ %ehspec.fails = icmp slt i32 %1, 0
+ br i1 %ehspec.fails, label %ehspec.unexpected, label %eh.resume
+
+ehspec.unexpected: ; preds = %lpad
+ %2 = extractvalue { i8*, i32 } %0, 0
+ tail call void @__cxa_call_unexpected(i8* %2) #8
+ unreachable
+
+eh.resume: ; preds = %lpad
+ resume { i8*, i32 } %0
+}
+
+; Function Attrs: nounwind
+define weak noalias i8* @_ZnajRKSt9nothrow_t(i32 %size, %"struct.std::nothrow_t"*) #0 {
+entry:
+ %call = invoke noalias i8* @_Znaj(i32 %size)
+ to label %try.cont unwind label %lpad
+
+lpad: ; preds = %entry
+ %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ catch i8* null
+ %2 = extractvalue { i8*, i32 } %1, 0
+ %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1
+ invoke void @__cxa_end_catch()
+ to label %try.cont unwind label %lpad1
+
+try.cont: ; preds = %lpad, %entry
+ %p.0 = phi i8* [ null, %lpad ], [ %call, %entry ]
+ ret i8* %p.0
+
+lpad1: ; preds = %lpad
+ %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+ filter [0 x i8*] zeroinitializer
+ %5 = extractvalue { i8*, i32 } %4, 0
+ tail call void @__cxa_call_unexpected(i8* %5) #6
+ unreachable
+}
+
+; Function Attrs: nounwind
+define weak void @_ZdlPv(i8* %ptr) #0 {
+entry:
+ %tobool = icmp eq i8* %ptr, null
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ tail call void @free(i8* %ptr)
+ br label %if.end
+
+if.end: ; preds = %if.then, %entry
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak void @_ZdlPvRKSt9nothrow_t(i8* %ptr, %"struct.std::nothrow_t"*) #0 {
+entry:
+ tail call void @_ZdlPv(i8* %ptr) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak void @_ZdaPv(i8* %ptr) #0 {
+entry:
+ tail call void @_ZdlPv(i8* %ptr) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+define weak void @_ZdaPvRKSt9nothrow_t(i8* %ptr, %"struct.std::nothrow_t"*) #0 {
+entry:
+ tail call void @_ZdaPv(i8* %ptr) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+define void ()* @_ZSt15set_new_handlerPFvvE(void ()* %handler) #0 {
+entry:
+ %0 = ptrtoint void ()* %handler to i32
+ %1 = atomicrmw xchg i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 %0 seq_cst
+ %2 = inttoptr i32 %1 to void ()*
+ ret void ()* %2
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt9bad_allocC2Ev(%"class.std::bad_alloc"* nocapture %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0, i32 0
+ store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8
+ ret void
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt9bad_allocD0Ev(%"class.std::bad_alloc"* %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0
+ tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1
+ %1 = bitcast %"class.std::bad_alloc"* %this to i8*
+ tail call void @_ZdlPv(i8* %1) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt9bad_allocD2Ev(%"class.std::bad_alloc"* %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0
+ tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1
+ ret void
+}
+
+; Function Attrs: nounwind
+declare void @_ZNSt9exceptionD2Ev(%"class.std::exception"*) #0
+
+; Function Attrs: nounwind readnone
+define i8* @_ZNKSt9bad_alloc4whatEv(%"class.std::bad_alloc"* nocapture %this) unnamed_addr #3 align 2 {
+entry:
+ ret i8* getelementptr inbounds ([15 x i8]* @.str352, i32 0, i32 0)
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt20bad_array_new_lengthC2Ev(%"class.std::bad_array_new_length"* nocapture %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_array_new_length"* %this, i32 0, i32 0, i32 0, i32 0
+ store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt20bad_array_new_length, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8
+ ret void
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt20bad_array_new_lengthD0Ev(%"class.std::bad_array_new_length"* %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_array_new_length"* %this, i32 0, i32 0, i32 0
+ tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1
+ %1 = bitcast %"class.std::bad_array_new_length"* %this to i8*
+ tail call void @_ZdlPv(i8* %1) #1
+ ret void
+}
+
+; Function Attrs: nounwind readnone
+define i8* @_ZNKSt16bad_array_length4whatEv(%"class.std::bad_array_length"* nocapture %this) unnamed_addr #3 align 2 {
+entry:
+ ret i8* getelementptr inbounds ([17 x i8]* @.str1453, i32 0, i32 0)
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt16bad_array_lengthC2Ev(%"class.std::bad_array_length"* nocapture %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_array_length"* %this, i32 0, i32 0, i32 0, i32 0
+ store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt16bad_array_length, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8
+ ret void
+}
+
+; Function Attrs: nounwind
+define void @_ZNSt16bad_array_lengthD0Ev(%"class.std::bad_array_length"* %this) unnamed_addr #0 align 2 {
+entry:
+ %0 = getelementptr inbounds %"class.std::bad_array_length"* %this, i32 0, i32 0, i32 0
+ tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1
+ %1 = bitcast %"class.std::bad_array_length"* %this to i8*
+ tail call void @_ZdlPv(i8* %1) #1
+ ret void
+}
+
+; Function Attrs: nounwind readnone
+define i8* @_ZNKSt20bad_array_new_length4whatEv(%"class.std::bad_array_new_length"* nocapture %this) unnamed_addr #3 align 2 {
+entry:
+ ret i8* getelementptr inbounds ([21 x i8]* @.str2554, i32 0, i32 0)
+}
+
+; Function Attrs: noreturn
+define void @_ZSt17__throw_bad_allocv() #4 {
+entry:
+ %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1
+ %0 = bitcast i8* %exception to i32 (...)***
+ store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8
+ tail call void @__cxa_throw(i8* %exception, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*)) #8
+ unreachable
+}
+
+; Function Attrs: nounwind
+define double @__floatscan(%struct._IO_FILE* %f, i32 %prec, i32 %pok) #0 {
+entry:
+ %x.i = alloca [128 x i32], align 4
+ switch i32 %prec, label %return [
+ i32 0, label %while.cond.preheader
+ i32 1, label %sw.bb1
+ i32 2, label %sw.bb3
+ ]
+
+sw.bb1: ; preds = %entry
+ br label %while.cond.preheader
+
+sw.bb3: ; preds = %entry
+ br label %while.cond.preheader
+
+while.cond.preheader: ; preds = %sw.bb3, %sw.bb1, %entry
+ %bits.0.ph = phi i32 [ 24, %entry ], [ 53, %sw.bb1 ], [ 53, %sw.bb3 ]
+ %emin.0.ph = phi i32 [ -149, %entry ], [ -1074, %sw.bb1 ], [ -1074, %sw.bb3 ]
+ %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1
+ %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ br label %while.cond
+
+while.cond: ; preds = %cond.end, %while.cond.preheader
+ %0 = load i8** %rpos, align 4, !tbaa !0
+ %1 = load i8** %shend, align 4, !tbaa !0
+ %cmp = icmp ult i8* %0, %1
+ br i1 %cmp, label %cond.true, label %cond.false
+
+cond.true: ; preds = %while.cond
+ %incdec.ptr = getelementptr inbounds i8* %0, i32 1
+ store i8* %incdec.ptr, i8** %rpos, align 4, !tbaa !0
+ %2 = load i8* %0, align 1, !tbaa !1
+ %conv = zext i8 %2 to i32
+ br label %cond.end
+
+cond.false: ; preds = %while.cond
+ %call = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv, %cond.true ], [ %call, %cond.false ]
+ %call6 = call i32 @isspace(i32 %cond) #1
+ %tobool = icmp eq i32 %call6, 0
+ br i1 %tobool, label %while.end, label %while.cond
+
+while.end: ; preds = %cond.end
+ %cmp9 = icmp eq i32 %cond, 45
+ switch i32 %cond, label %if.end [
+ i32 45, label %if.then
+ i32 43, label %if.then
+ ]
+
+if.then: ; preds = %while.end, %while.end
+ %conv12 = zext i1 %cmp9 to i32
+ %mul = shl nuw nsw i32 %conv12, 1
+ %sub13 = sub nsw i32 1, %mul
+ %3 = load i8** %rpos, align 4, !tbaa !0
+ %4 = load i8** %shend, align 4, !tbaa !0
+ %cmp16 = icmp ult i8* %3, %4
+ br i1 %cmp16, label %cond.true18, label %cond.false22
+
+cond.true18: ; preds = %if.then
+ %incdec.ptr20 = getelementptr inbounds i8* %3, i32 1
+ store i8* %incdec.ptr20, i8** %rpos, align 4, !tbaa !0
+ %5 = load i8* %3, align 1, !tbaa !1
+ %conv21 = zext i8 %5 to i32
+ br label %if.end
+
+cond.false22: ; preds = %if.then
+ %call23 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %if.end
+
+if.end: ; preds = %cond.false22, %cond.true18, %while.end
+ %sign.0 = phi i32 [ 1, %while.end ], [ %sub13, %cond.false22 ], [ %sub13, %cond.true18 ]
+ %c.0 = phi i32 [ %cond, %while.end ], [ %call23, %cond.false22 ], [ %conv21, %cond.true18 ]
+ br label %land.rhs
+
+land.rhs: ; preds = %for.inc, %if.end
+ %c.1154 = phi i32 [ %c.0, %if.end ], [ %c.2, %for.inc ]
+ %i.0153 = phi i32 [ 0, %if.end ], [ %inc, %for.inc ]
+ %or = or i32 %c.1154, 32
+ %arrayidx = getelementptr inbounds [9 x i8]* @.str655, i32 0, i32 %i.0153
+ %6 = load i8* %arrayidx, align 1, !tbaa !1
+ %conv28 = sext i8 %6 to i32
+ %cmp29 = icmp eq i32 %or, %conv28
+ br i1 %cmp29, label %for.body, label %for.end
+
+for.body: ; preds = %land.rhs
+ %cmp31 = icmp ult i32 %i.0153, 7
+ br i1 %cmp31, label %if.then33, label %for.inc
+
+if.then33: ; preds = %for.body
+ %7 = load i8** %rpos, align 4, !tbaa !0
+ %8 = load i8** %shend, align 4, !tbaa !0
+ %cmp36 = icmp ult i8* %7, %8
+ br i1 %cmp36, label %cond.true38, label %cond.false42
+
+cond.true38: ; preds = %if.then33
+ %incdec.ptr40 = getelementptr inbounds i8* %7, i32 1
+ store i8* %incdec.ptr40, i8** %rpos, align 4, !tbaa !0
+ %9 = load i8* %7, align 1, !tbaa !1
+ %conv41 = zext i8 %9 to i32
+ br label %for.inc
+
+cond.false42: ; preds = %if.then33
+ %call43 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.inc
+
+for.inc: ; preds = %cond.false42, %cond.true38, %for.body
+ %c.2 = phi i32 [ %c.1154, %for.body ], [ %conv41, %cond.true38 ], [ %call43, %cond.false42 ]
+ %inc = add i32 %i.0153, 1
+ %cmp26 = icmp ult i32 %inc, 8
+ br i1 %cmp26, label %land.rhs, label %for.end
+
+for.end: ; preds = %for.inc, %land.rhs
+ %c.1.lcssa = phi i32 [ %c.2, %for.inc ], [ %c.1154, %land.rhs ]
+ %i.0.lcssa = phi i32 [ %inc, %for.inc ], [ %i.0153, %land.rhs ]
+ switch i32 %i.0.lcssa, label %lor.lhs.false52 [
+ i32 8, label %if.end83
+ i32 3, label %if.then59
+ ]
+
+lor.lhs.false52: ; preds = %for.end
+ %cmp53 = icmp ult i32 %i.0.lcssa, 4
+ %tobool55 = icmp eq i32 %pok, 0
+ %or.cond = or i1 %cmp53, %tobool55
+ br i1 %or.cond, label %if.end87, label %if.then56
+
+if.then56: ; preds = %lor.lhs.false52
+ %cmp57 = icmp eq i32 %i.0.lcssa, 8
+ br i1 %cmp57, label %if.end83, label %if.then59
+
+if.then59: ; preds = %if.then56, %for.end
+ %10 = load i8** %shend, align 4, !tbaa !0
+ %tobool61 = icmp eq i8* %10, null
+ br i1 %tobool61, label %cond.end66, label %cond.true62
+
+cond.true62: ; preds = %if.then59
+ %11 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr64 = getelementptr inbounds i8* %11, i32 -1
+ store i8* %incdec.ptr64, i8** %rpos, align 4, !tbaa !0
+ br label %cond.end66
+
+cond.end66: ; preds = %cond.true62, %if.then59
+ %notlhs = icmp eq i32 %pok, 0
+ %notrhs = icmp ult i32 %i.0.lcssa, 4
+ %or.cond175.not = or i1 %notrhs, %notlhs
+ %brmerge = or i1 %or.cond175.not, %tobool61
+ br i1 %brmerge, label %if.end83, label %for.inc80
+
+for.inc80: ; preds = %for.inc80, %cond.end66
+ %i.1152 = phi i32 [ %dec, %for.inc80 ], [ %i.0.lcssa, %cond.end66 ]
+ %12 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr77 = getelementptr inbounds i8* %12, i32 -1
+ store i8* %incdec.ptr77, i8** %rpos, align 4, !tbaa !0
+ %dec = add i32 %i.1152, -1
+ %cmp70 = icmp ugt i32 %dec, 3
+ br i1 %cmp70, label %for.inc80, label %if.end83
+
+if.end83: ; preds = %for.inc80, %cond.end66, %if.then56, %for.end
+ %conv84 = sitofp i32 %sign.0 to float
+ %mul85 = fmul float %conv84, 0x7FF0000000000000
+ %conv86 = fpext float %mul85 to double
+ br label %return
+
+if.end87: ; preds = %lor.lhs.false52
+ %tobool88 = icmp eq i32 %i.0.lcssa, 0
+ br i1 %tobool88, label %land.rhs93, label %if.end120
+
+land.rhs93: ; preds = %for.inc117, %if.end87
+ %c.3150 = phi i32 [ %c.4, %for.inc117 ], [ %c.1.lcssa, %if.end87 ]
+ %i.2149 = phi i32 [ %inc118, %for.inc117 ], [ 0, %if.end87 ]
+ %or94 = or i32 %c.3150, 32
+ %arrayidx95 = getelementptr inbounds [4 x i8]* @.str1756, i32 0, i32 %i.2149
+ %13 = load i8* %arrayidx95, align 1, !tbaa !1
+ %conv96 = sext i8 %13 to i32
+ %cmp97 = icmp eq i32 %or94, %conv96
+ br i1 %cmp97, label %for.body100, label %if.end120
+
+for.body100: ; preds = %land.rhs93
+ %cmp101 = icmp ult i32 %i.2149, 2
+ br i1 %cmp101, label %if.then103, label %for.inc117
+
+if.then103: ; preds = %for.body100
+ %14 = load i8** %rpos, align 4, !tbaa !0
+ %15 = load i8** %shend, align 4, !tbaa !0
+ %cmp106 = icmp ult i8* %14, %15
+ br i1 %cmp106, label %cond.true108, label %cond.false112
+
+cond.true108: ; preds = %if.then103
+ %incdec.ptr110 = getelementptr inbounds i8* %14, i32 1
+ store i8* %incdec.ptr110, i8** %rpos, align 4, !tbaa !0
+ %16 = load i8* %14, align 1, !tbaa !1
+ %conv111 = zext i8 %16 to i32
+ br label %for.inc117
+
+cond.false112: ; preds = %if.then103
+ %call113 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.inc117
+
+for.inc117: ; preds = %cond.false112, %cond.true108, %for.body100
+ %c.4 = phi i32 [ %c.3150, %for.body100 ], [ %conv111, %cond.true108 ], [ %call113, %cond.false112 ]
+ %inc118 = add i32 %i.2149, 1
+ %cmp91 = icmp ult i32 %inc118, 3
+ br i1 %cmp91, label %land.rhs93, label %if.end120
+
+if.end120: ; preds = %for.inc117, %land.rhs93, %if.end87
+ %i.3 = phi i32 [ %i.0.lcssa, %if.end87 ], [ %inc118, %for.inc117 ], [ %i.2149, %land.rhs93 ]
+ %c.5 = phi i32 [ %c.1.lcssa, %if.end87 ], [ %c.4, %for.inc117 ], [ %c.3150, %land.rhs93 ]
+ switch i32 %i.3, label %if.then207 [
+ i32 3, label %if.then123
+ i32 0, label %if.end216
+ ]
+
+if.then123: ; preds = %if.end120
+ %17 = load i8** %rpos, align 4, !tbaa !0
+ %18 = load i8** %shend, align 4, !tbaa !0
+ %cmp126 = icmp ult i8* %17, %18
+ br i1 %cmp126, label %cond.true128, label %cond.false132
+
+cond.true128: ; preds = %if.then123
+ %incdec.ptr130 = getelementptr inbounds i8* %17, i32 1
+ store i8* %incdec.ptr130, i8** %rpos, align 4, !tbaa !0
+ %19 = load i8* %17, align 1, !tbaa !1
+ %conv131 = zext i8 %19 to i32
+ br label %cond.end134
+
+cond.false132: ; preds = %if.then123
+ %call133 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end134
+
+cond.end134: ; preds = %cond.false132, %cond.true128
+ %cond135 = phi i32 [ %conv131, %cond.true128 ], [ %call133, %cond.false132 ]
+ %cmp136 = icmp eq i32 %cond135, 40
+ br i1 %cmp136, label %for.cond147, label %if.then138
+
+if.then138: ; preds = %cond.end134
+ %20 = load i8** %shend, align 4, !tbaa !0
+ %tobool140 = icmp eq i8* %20, null
+ br i1 %tobool140, label %return, label %cond.true141
+
+cond.true141: ; preds = %if.then138
+ %21 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr143 = getelementptr inbounds i8* %21, i32 -1
+ store i8* %incdec.ptr143, i8** %rpos, align 4, !tbaa !0
+ br label %return
+
+for.cond147: ; preds = %for.inc203, %cond.end134
+ %i.4 = phi i32 [ %inc204, %for.inc203 ], [ 1, %cond.end134 ]
+ %22 = load i8** %rpos, align 4, !tbaa !0
+ %23 = load i8** %shend, align 4, !tbaa !0
+ %cmp150 = icmp ult i8* %22, %23
+ br i1 %cmp150, label %cond.true152, label %cond.false156
+
+cond.true152: ; preds = %for.cond147
+ %incdec.ptr154 = getelementptr inbounds i8* %22, i32 1
+ store i8* %incdec.ptr154, i8** %rpos, align 4, !tbaa !0
+ %24 = load i8* %22, align 1, !tbaa !1
+ %conv155 = zext i8 %24 to i32
+ br label %cond.end158
+
+cond.false156: ; preds = %for.cond147
+ %call157 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end158
+
+cond.end158: ; preds = %cond.false156, %cond.true152
+ %cond159 = phi i32 [ %conv155, %cond.true152 ], [ %call157, %cond.false156 ]
+ %sub160 = add nsw i32 %cond159, -48
+ %cmp161 = icmp ult i32 %sub160, 10
+ %sub164 = add nsw i32 %cond159, -65
+ %cmp165 = icmp ult i32 %sub164, 26
+ %or.cond81 = or i1 %cmp161, %cmp165
+ br i1 %or.cond81, label %for.inc203, label %lor.lhs.false167
+
+lor.lhs.false167: ; preds = %cond.end158
+ %sub168 = add nsw i32 %cond159, -97
+ %cmp169 = icmp ult i32 %sub168, 26
+ %cmp172 = icmp eq i32 %cond159, 95
+ %or.cond2 = or i1 %cmp169, %cmp172
+ br i1 %or.cond2, label %for.inc203, label %if.end175
+
+if.end175: ; preds = %lor.lhs.false167
+ %cmp176 = icmp eq i32 %cond159, 41
+ br i1 %cmp176, label %return, label %if.end179
+
+if.end179: ; preds = %if.end175
+ %25 = load i8** %shend, align 4, !tbaa !0
+ %tobool181 = icmp eq i8* %25, null
+ br i1 %tobool181, label %cond.end186, label %cond.true182
+
+cond.true182: ; preds = %if.end179
+ %26 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr184 = getelementptr inbounds i8* %26, i32 -1
+ store i8* %incdec.ptr184, i8** %rpos, align 4, !tbaa !0
+ br label %cond.end186
+
+cond.end186: ; preds = %cond.true182, %if.end179
+ br i1 %tobool55, label %if.then188, label %while.cond191.preheader
+
+while.cond191.preheader: ; preds = %cond.end186
+ %tobool193123 = icmp eq i32 %i.4, 0
+ %brmerge176 = or i1 %tobool193123, %tobool181
+ br i1 %brmerge176, label %return, label %while.cond191.backedge
+
+if.then188: ; preds = %cond.end186
+ %call189 = call i32* @__errno_location() #7
+ store i32 22, i32* %call189, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %return
+
+while.cond191.backedge: ; preds = %while.cond191.backedge, %while.cond191.preheader
+ %dec192124.in = phi i32 [ %dec192124, %while.cond191.backedge ], [ %i.4, %while.cond191.preheader ]
+ %dec192124 = add i32 %dec192124.in, -1
+ %27 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr199 = getelementptr inbounds i8* %27, i32 -1
+ store i8* %incdec.ptr199, i8** %rpos, align 4, !tbaa !0
+ %tobool193 = icmp eq i32 %dec192124, 0
+ br i1 %tobool193, label %return, label %while.cond191.backedge
+
+for.inc203: ; preds = %lor.lhs.false167, %cond.end158
+ %inc204 = add i32 %i.4, 1
+ br label %for.cond147
+
+if.then207: ; preds = %if.end120
+ %28 = load i8** %shend, align 4, !tbaa !0
+ %tobool209 = icmp eq i8* %28, null
+ br i1 %tobool209, label %cond.end214, label %cond.true210
+
+cond.true210: ; preds = %if.then207
+ %29 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr212 = getelementptr inbounds i8* %29, i32 -1
+ store i8* %incdec.ptr212, i8** %rpos, align 4, !tbaa !0
+ br label %cond.end214
+
+cond.end214: ; preds = %cond.true210, %if.then207
+ %call215 = call i32* @__errno_location() #7
+ store i32 22, i32* %call215, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %return
+
+if.end216: ; preds = %if.end120
+ %cmp217 = icmp eq i32 %c.5, 48
+ br i1 %cmp217, label %if.then219, label %if.end245
+
+if.then219: ; preds = %if.end216
+ %30 = load i8** %rpos, align 4, !tbaa !0
+ %31 = load i8** %shend, align 4, !tbaa !0
+ %cmp222 = icmp ult i8* %30, %31
+ br i1 %cmp222, label %cond.true224, label %cond.false228
+
+cond.true224: ; preds = %if.then219
+ %incdec.ptr226 = getelementptr inbounds i8* %30, i32 1
+ store i8* %incdec.ptr226, i8** %rpos, align 4, !tbaa !0
+ %32 = load i8* %30, align 1, !tbaa !1
+ %conv227 = zext i8 %32 to i32
+ br label %cond.end230
+
+cond.false228: ; preds = %if.then219
+ %call229 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end230
+
+cond.end230: ; preds = %cond.false228, %cond.true224
+ %cond231 = phi i32 [ %conv227, %cond.true224 ], [ %call229, %cond.false228 ]
+ %or232 = or i32 %cond231, 32
+ %cmp233 = icmp eq i32 %or232, 120
+ br i1 %cmp233, label %if.then235, label %if.end237
+
+if.then235: ; preds = %cond.end230
+ %33 = load i8** %rpos, align 4, !tbaa !0
+ %34 = load i8** %shend, align 4, !tbaa !0
+ %cmp.i = icmp ult i8* %33, %34
+ br i1 %cmp.i, label %cond.true.i, label %cond.false.i
+
+cond.true.i: ; preds = %if.then235
+ %incdec.ptr.i = getelementptr inbounds i8* %33, i32 1
+ store i8* %incdec.ptr.i, i8** %rpos, align 4, !tbaa !0
+ %35 = load i8* %33, align 1, !tbaa !1
+ %conv.i = zext i8 %35 to i32
+ br label %for.cond.i
+
+cond.false.i: ; preds = %if.then235
+ %call.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond.i
+
+for.cond.i: ; preds = %cond.false12.i, %cond.true8.i, %cond.false.i, %cond.true.i
+ %gotdig.0.i = phi i32 [ 0, %cond.true.i ], [ 0, %cond.false.i ], [ 1, %cond.true8.i ], [ 1, %cond.false12.i ]
+ %c.0.i = phi i32 [ %conv.i, %cond.true.i ], [ %call.i, %cond.false.i ], [ %conv11.i, %cond.true8.i ], [ %call13.i, %cond.false12.i ]
+ switch i32 %c.0.i, label %for.cond48.i [
+ i32 48, label %for.body.i
+ i32 46, label %if.then.i
+ ]
+
+for.body.i: ; preds = %for.cond.i
+ %36 = load i8** %rpos, align 4, !tbaa !0
+ %37 = load i8** %shend, align 4, !tbaa !0
+ %cmp6.i = icmp ult i8* %36, %37
+ br i1 %cmp6.i, label %cond.true8.i, label %cond.false12.i
+
+cond.true8.i: ; preds = %for.body.i
+ %incdec.ptr10.i = getelementptr inbounds i8* %36, i32 1
+ store i8* %incdec.ptr10.i, i8** %rpos, align 4, !tbaa !0
+ %38 = load i8* %36, align 1, !tbaa !1
+ %conv11.i = zext i8 %38 to i32
+ br label %for.cond.i
+
+cond.false12.i: ; preds = %for.body.i
+ %call13.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond.i
+
+if.then.i: ; preds = %for.cond.i
+ %39 = load i8** %rpos, align 4, !tbaa !0
+ %40 = load i8** %shend, align 4, !tbaa !0
+ %cmp20.i = icmp ult i8* %39, %40
+ br i1 %cmp20.i, label %cond.true22.i, label %cond.false26.i
+
+cond.true22.i: ; preds = %if.then.i
+ %incdec.ptr24.i = getelementptr inbounds i8* %39, i32 1
+ store i8* %incdec.ptr24.i, i8** %rpos, align 4, !tbaa !0
+ %41 = load i8* %39, align 1, !tbaa !1
+ %conv25.i = zext i8 %41 to i32
+ br label %for.cond30.preheader.i
+
+cond.false26.i: ; preds = %if.then.i
+ %call27.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond30.preheader.i
+
+for.cond30.preheader.i: ; preds = %cond.false26.i, %cond.true22.i
+ %c.1.ph.i = phi i32 [ %conv25.i, %cond.true22.i ], [ %call27.i, %cond.false26.i ]
+ %cmp31107.i = icmp eq i32 %c.1.ph.i, 48
+ br i1 %cmp31107.i, label %for.body33.i, label %for.cond48.i
+
+for.body33.i: ; preds = %cond.end45.i.for.body33.i_crit_edge, %for.cond30.preheader.i
+ %rp.0108.i = phi i64 [ %phitmp.i, %cond.end45.i.for.body33.i_crit_edge ], [ -1, %for.cond30.preheader.i ]
+ %42 = load i8** %rpos, align 4, !tbaa !0
+ %43 = load i8** %shend, align 4, !tbaa !0
+ %cmp37.i = icmp ult i8* %42, %43
+ br i1 %cmp37.i, label %cond.true39.i, label %cond.false43.i
+
+cond.true39.i: ; preds = %for.body33.i
+ %incdec.ptr41.i = getelementptr inbounds i8* %42, i32 1
+ store i8* %incdec.ptr41.i, i8** %rpos, align 4, !tbaa !0
+ %44 = load i8* %42, align 1, !tbaa !1
+ %conv42.i = zext i8 %44 to i32
+ br label %cond.end45.i
+
+cond.false43.i: ; preds = %for.body33.i
+ %call44.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end45.i
+
+cond.end45.i: ; preds = %cond.false43.i, %cond.true39.i
+ %cond46.i = phi i32 [ %conv42.i, %cond.true39.i ], [ %call44.i, %cond.false43.i ]
+ %cmp31.i = icmp eq i32 %cond46.i, 48
+ br i1 %cmp31.i, label %cond.end45.i.for.body33.i_crit_edge, label %for.cond48.i
+
+cond.end45.i.for.body33.i_crit_edge: ; preds = %cond.end45.i
+ %phitmp.i = add i64 %rp.0108.i, -1
+ br label %for.body33.i
+
+for.cond48.i: ; preds = %cond.false100.i, %cond.true96.i, %cond.end45.i, %for.cond30.preheader.i, %for.cond.i
+ %x.0.i = phi i32 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %x.2.i, %cond.true96.i ], [ %x.2.i, %cond.false100.i ]
+ %y.0.i = phi double [ 0.000000e+00, %for.cond.i ], [ 0.000000e+00, %cond.end45.i ], [ 0.000000e+00, %for.cond30.preheader.i ], [ %y.2.i, %cond.true96.i ], [ %y.2.i, %cond.false100.i ]
+ %scale.0.i = phi double [ 1.000000e+00, %for.cond.i ], [ 1.000000e+00, %cond.end45.i ], [ 1.000000e+00, %for.cond30.preheader.i ], [ %scale.2.i, %cond.true96.i ], [ %scale.2.i, %cond.false100.i ]
+ %gottail.0.i = phi i32 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %gottail.2.i, %cond.true96.i ], [ %gottail.2.i, %cond.false100.i ]
+ %gotrad.0.i = phi i32 [ 0, %for.cond.i ], [ 1, %cond.end45.i ], [ 1, %for.cond30.preheader.i ], [ %gotrad.1.i, %cond.true96.i ], [ %gotrad.1.i, %cond.false100.i ]
+ %gotdig.2.i = phi i32 [ %gotdig.0.i, %for.cond.i ], [ 1, %cond.end45.i ], [ %gotdig.0.i, %for.cond30.preheader.i ], [ %gotdig.3.i, %cond.true96.i ], [ %gotdig.3.i, %cond.false100.i ]
+ %rp.1.i = phi i64 [ 0, %for.cond.i ], [ %rp.0108.i, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %rp.2.i, %cond.true96.i ], [ %rp.2.i, %cond.false100.i ]
+ %dc.0.i = phi i64 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %dc.1.i, %cond.true96.i ], [ %dc.1.i, %cond.false100.i ]
+ %c.2.i = phi i32 [ %c.0.i, %for.cond.i ], [ %cond46.i, %cond.end45.i ], [ %c.1.ph.i, %for.cond30.preheader.i ], [ %conv99.i, %cond.true96.i ], [ %call101.i, %cond.false100.i ]
+ %sub.i = add nsw i32 %c.2.i, -48
+ %cmp49.i = icmp ult i32 %sub.i, 10
+ br i1 %cmp49.i, label %if.end69.i, label %lor.lhs.false.i
+
+lor.lhs.false.i: ; preds = %for.cond48.i
+ %or.i = or i32 %c.2.i, 32
+ %sub51.i = add nsw i32 %or.i, -97
+ %cmp52.i = icmp ult i32 %sub51.i, 6
+ %cmp54.i = icmp eq i32 %c.2.i, 46
+ %or.cond.i = or i1 %cmp52.i, %cmp54.i
+ br i1 %or.cond.i, label %for.body56.i, label %for.end104.i
+
+for.body56.i: ; preds = %lor.lhs.false.i
+ br i1 %cmp54.i, label %if.then59.i, label %if.else.i
+
+if.then59.i: ; preds = %for.body56.i
+ %tobool.i = icmp eq i32 %gotrad.0.i, 0
+ br i1 %tobool.i, label %for.inc91.i, label %for.end104.i
+
+if.else.i: ; preds = %for.body56.i
+ %cmp62.i = icmp sgt i32 %c.2.i, 57
+ %sub66.i = add nsw i32 %or.i, -87
+ %sub66.sub.i = select i1 %cmp62.i, i32 %sub66.i, i32 %sub.i
+ br label %if.end69.i
+
+if.end69.i: ; preds = %if.else.i, %for.cond48.i
+ %d.0.i = phi i32 [ %sub.i, %for.cond48.i ], [ %sub66.sub.i, %if.else.i ]
+ %cmp70.i = icmp slt i64 %dc.0.i, 8
+ br i1 %cmp70.i, label %if.then72.i, label %if.else74.i
+
+if.then72.i: ; preds = %if.end69.i
+ %mul.i = shl i32 %x.0.i, 4
+ %add73.i = add i32 %d.0.i, %mul.i
+ br label %if.end89.i
+
+if.else74.i: ; preds = %if.end69.i
+ %cmp75.i = icmp slt i64 %dc.0.i, 14
+ br i1 %cmp75.i, label %if.then77.i, label %if.else81.i
+
+if.then77.i: ; preds = %if.else74.i
+ %conv78.i = sitofp i32 %d.0.i to double
+ %div.i = fmul double %scale.0.i, 6.250000e-02
+ %mul79.i = fmul double %div.i, %conv78.i
+ %add80.i = fadd double %y.0.i, %mul79.i
+ br label %if.end89.i
+
+if.else81.i: ; preds = %if.else74.i
+ %tobool82.i = icmp ne i32 %d.0.i, 0
+ %tobool83.i = icmp eq i32 %gottail.0.i, 0
+ %or.cond89.i = and i1 %tobool82.i, %tobool83.i
+ br i1 %or.cond89.i, label %if.then84.i, label %if.end89.i
+
+if.then84.i: ; preds = %if.else81.i
+ %mul85.i = fmul double %scale.0.i, 5.000000e-01
+ %add86.i = fadd double %y.0.i, %mul85.i
+ br label %if.end89.i
+
+if.end89.i: ; preds = %if.then84.i, %if.else81.i, %if.then77.i, %if.then72.i
+ %x.1.i = phi i32 [ %add73.i, %if.then72.i ], [ %x.0.i, %if.then77.i ], [ %x.0.i, %if.then84.i ], [ %x.0.i, %if.else81.i ]
+ %y.1.i = phi double [ %y.0.i, %if.then72.i ], [ %add80.i, %if.then77.i ], [ %add86.i, %if.then84.i ], [ %y.0.i, %if.else81.i ]
+ %scale.1.i = phi double [ %scale.0.i, %if.then72.i ], [ %div.i, %if.then77.i ], [ %scale.0.i, %if.then84.i ], [ %scale.0.i, %if.else81.i ]
+ %gottail.1.i = phi i32 [ %gottail.0.i, %if.then72.i ], [ %gottail.0.i, %if.then77.i ], [ 1, %if.then84.i ], [ %gottail.0.i, %if.else81.i ]
+ %inc.i = add nsw i64 %dc.0.i, 1
+ br label %for.inc91.i
+
+for.inc91.i: ; preds = %if.end89.i, %if.then59.i
+ %x.2.i = phi i32 [ %x.1.i, %if.end89.i ], [ %x.0.i, %if.then59.i ]
+ %y.2.i = phi double [ %y.1.i, %if.end89.i ], [ %y.0.i, %if.then59.i ]
+ %scale.2.i = phi double [ %scale.1.i, %if.end89.i ], [ %scale.0.i, %if.then59.i ]
+ %gottail.2.i = phi i32 [ %gottail.1.i, %if.end89.i ], [ %gottail.0.i, %if.then59.i ]
+ %gotrad.1.i = phi i32 [ %gotrad.0.i, %if.end89.i ], [ 1, %if.then59.i ]
+ %gotdig.3.i = phi i32 [ 1, %if.end89.i ], [ %gotdig.2.i, %if.then59.i ]
+ %rp.2.i = phi i64 [ %rp.1.i, %if.end89.i ], [ %dc.0.i, %if.then59.i ]
+ %dc.1.i = phi i64 [ %inc.i, %if.end89.i ], [ %dc.0.i, %if.then59.i ]
+ %45 = load i8** %rpos, align 4, !tbaa !0
+ %46 = load i8** %shend, align 4, !tbaa !0
+ %cmp94.i = icmp ult i8* %45, %46
+ br i1 %cmp94.i, label %cond.true96.i, label %cond.false100.i
+
+cond.true96.i: ; preds = %for.inc91.i
+ %incdec.ptr98.i = getelementptr inbounds i8* %45, i32 1
+ store i8* %incdec.ptr98.i, i8** %rpos, align 4, !tbaa !0
+ %47 = load i8* %45, align 1, !tbaa !1
+ %conv99.i = zext i8 %47 to i32
+ br label %for.cond48.i
+
+cond.false100.i: ; preds = %for.inc91.i
+ %call101.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond48.i
+
+for.end104.i: ; preds = %if.then59.i, %lor.lhs.false.i
+ %c.2.lcssa.i = phi i32 [ %c.2.i, %lor.lhs.false.i ], [ 46, %if.then59.i ]
+ %tobool105.i = icmp eq i32 %gotdig.2.i, 0
+ br i1 %tobool105.i, label %if.then106.i, label %if.end137.i
+
+if.then106.i: ; preds = %for.end104.i
+ %48 = load i8** %shend, align 4, !tbaa !0
+ %tobool108.i = icmp eq i8* %48, null
+ br i1 %tobool108.i, label %cond.end113.i, label %cond.true109.i
+
+cond.true109.i: ; preds = %if.then106.i
+ %49 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr111.i = getelementptr inbounds i8* %49, i32 -1
+ store i8* %incdec.ptr111.i, i8** %rpos, align 4, !tbaa !0
+ br label %cond.end113.i
+
+cond.end113.i: ; preds = %cond.true109.i, %if.then106.i
+ br i1 %tobool55, label %if.else133.i, label %if.then115.i
+
+if.then115.i: ; preds = %cond.end113.i
+ br i1 %tobool108.i, label %if.end134.i, label %cond.end122.i
+
+cond.end122.i: ; preds = %if.then115.i
+ %50 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr120.i = getelementptr inbounds i8* %50, i32 -1
+ store i8* %incdec.ptr120.i, i8** %rpos, align 4, !tbaa !0
+ %tobool123.i = icmp eq i32 %gotrad.0.i, 0
+ br i1 %tobool123.i, label %if.end134.i, label %cond.true127.i
+
+cond.true127.i: ; preds = %cond.end122.i
+ %incdec.ptr129.i = getelementptr inbounds i8* %50, i32 -2
+ store i8* %incdec.ptr129.i, i8** %rpos, align 4, !tbaa !0
+ br label %if.end134.i
+
+if.else133.i: ; preds = %cond.end113.i
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %if.end134.i
+
+if.end134.i: ; preds = %if.else133.i, %cond.true127.i, %cond.end122.i, %if.then115.i
+ %conv135.i = sitofp i32 %sign.0 to double
+ %mul136.i = fmul double %conv135.i, 0.000000e+00
+ br label %return
+
+if.end137.i: ; preds = %for.end104.i
+ %tobool138.i = icmp eq i32 %gotrad.0.i, 0
+ %dc.0.rp.1.i = select i1 %tobool138.i, i64 %dc.0.i, i64 %rp.1.i
+ %cmp141103.i = icmp slt i64 %dc.0.i, 8
+ br i1 %cmp141103.i, label %while.body.i, label %while.end.i
+
+while.body.i: ; preds = %while.body.i, %if.end137.i
+ %dc.2105.i = phi i64 [ %inc144.i, %while.body.i ], [ %dc.0.i, %if.end137.i ]
+ %x.3104.i = phi i32 [ %mul143.i, %while.body.i ], [ %x.0.i, %if.end137.i ]
+ %mul143.i = shl i32 %x.3104.i, 4
+ %inc144.i = add nsw i64 %dc.2105.i, 1
+ %cmp141.i = icmp slt i64 %inc144.i, 8
+ br i1 %cmp141.i, label %while.body.i, label %while.end.i
+
+while.end.i: ; preds = %while.body.i, %if.end137.i
+ %x.3.lcssa.i = phi i32 [ %x.0.i, %if.end137.i ], [ %mul143.i, %while.body.i ]
+ %or145.i = or i32 %c.2.lcssa.i, 32
+ %cmp146.i = icmp eq i32 %or145.i, 112
+ br i1 %cmp146.i, label %if.then148.i, label %if.else165.i
+
+if.then148.i: ; preds = %while.end.i
+ %call149.i = call fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #1
+ %cmp150.i = icmp eq i64 %call149.i, -9223372036854775808
+ br i1 %cmp150.i, label %if.then152.i, label %if.end173.i
+
+if.then152.i: ; preds = %if.then148.i
+ br i1 %tobool55, label %if.else162.i, label %if.then154.i
+
+if.then154.i: ; preds = %if.then152.i
+ %51 = load i8** %shend, align 4, !tbaa !0
+ %tobool156.i = icmp eq i8* %51, null
+ br i1 %tobool156.i, label %if.end173.i, label %cond.true157.i
+
+cond.true157.i: ; preds = %if.then154.i
+ %52 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr159.i = getelementptr inbounds i8* %52, i32 -1
+ store i8* %incdec.ptr159.i, i8** %rpos, align 4, !tbaa !0
+ br label %if.end173.i
+
+if.else162.i: ; preds = %if.then152.i
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %return
+
+if.else165.i: ; preds = %while.end.i
+ %53 = load i8** %shend, align 4, !tbaa !0
+ %tobool167.i = icmp eq i8* %53, null
+ br i1 %tobool167.i, label %if.end173.i, label %cond.true168.i
+
+cond.true168.i: ; preds = %if.else165.i
+ %54 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr170.i = getelementptr inbounds i8* %54, i32 -1
+ store i8* %incdec.ptr170.i, i8** %rpos, align 4, !tbaa !0
+ br label %if.end173.i
+
+if.end173.i: ; preds = %cond.true168.i, %if.else165.i, %cond.true157.i, %if.then154.i, %if.then148.i
+ %e2.0.i = phi i64 [ %call149.i, %if.then148.i ], [ 0, %cond.true168.i ], [ 0, %if.else165.i ], [ 0, %if.then154.i ], [ 0, %cond.true157.i ]
+ %mul174.i = shl i64 %dc.0.rp.1.i, 2
+ %sub175.i = add nsw i64 %mul174.i, -32
+ %add176.i = add nsw i64 %sub175.i, %e2.0.i
+ %tobool177.i = icmp eq i32 %x.3.lcssa.i, 0
+ br i1 %tobool177.i, label %if.then178.i, label %if.end181.i
+
+if.then178.i: ; preds = %if.end173.i
+ %conv179.i = sitofp i32 %sign.0 to double
+ %mul180.i = fmul double %conv179.i, 0.000000e+00
+ br label %return
+
+if.end181.i: ; preds = %if.end173.i
+ %sub182.i = sub nsw i32 0, %emin.0.ph
+ %conv183.i120 = zext i32 %sub182.i to i64
+ %cmp184.i = icmp sgt i64 %add176.i, %conv183.i120
+ br i1 %cmp184.i, label %if.then186.i, label %if.end191.i
+
+if.then186.i: ; preds = %if.end181.i
+ %call187.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call187.i, align 4, !tbaa !3
+ %conv188.i = sitofp i32 %sign.0 to double
+ %mul189.i = fmul double %conv188.i, 0x7FEFFFFFFFFFFFFF
+ %mul190.i = fmul double %mul189.i, 0x7FEFFFFFFFFFFFFF
+ br label %return
+
+if.end191.i: ; preds = %if.end181.i
+ %sub192.i = add nsw i32 %emin.0.ph, -106
+ %conv193.i = sext i32 %sub192.i to i64
+ %cmp194.i = icmp slt i64 %add176.i, %conv193.i
+ br i1 %cmp194.i, label %if.then196.i, label %while.cond202.preheader.i
+
+while.cond202.preheader.i: ; preds = %if.end191.i
+ %cmp20397.i = icmp sgt i32 %x.3.lcssa.i, -1
+ br i1 %cmp20397.i, label %while.body205.i, label %while.end218.i
+
+if.then196.i: ; preds = %if.end191.i
+ %call197.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call197.i, align 4, !tbaa !3
+ %conv198.i = sitofp i32 %sign.0 to double
+ %mul199.i = fmul double %conv198.i, 0x10000000000000
+ %mul200.i = fmul double %mul199.i, 0x10000000000000
+ br label %return
+
+while.body205.i: ; preds = %if.end216.i, %while.cond202.preheader.i
+ %e2.1100.i = phi i64 [ %dec217.i, %if.end216.i ], [ %add176.i, %while.cond202.preheader.i ]
+ %y.399.i = phi double [ %y.4.i, %if.end216.i ], [ %y.0.i, %while.cond202.preheader.i ]
+ %x.498.i = phi i32 [ %x.5.i, %if.end216.i ], [ %x.3.lcssa.i, %while.cond202.preheader.i ]
+ %cmp206.i = fcmp ult double %y.399.i, 5.000000e-01
+ %add214.i = shl i32 %x.498.i, 1
+ br i1 %cmp206.i, label %if.end216.i, label %if.then208.i
+
+if.then208.i: ; preds = %while.body205.i
+ %add210115.i = or i32 %add214.i, 1
+ %sub211.i = fadd double %y.399.i, -1.000000e+00
+ br label %if.end216.i
+
+if.end216.i: ; preds = %if.then208.i, %while.body205.i
+ %x.5.i = phi i32 [ %add210115.i, %if.then208.i ], [ %add214.i, %while.body205.i ]
+ %sub211.pn.i = phi double [ %sub211.i, %if.then208.i ], [ %y.399.i, %while.body205.i ]
+ %y.4.i = fadd double %y.399.i, %sub211.pn.i
+ %dec217.i = add nsw i64 %e2.1100.i, -1
+ %cmp203.i = icmp sgt i32 %x.5.i, -1
+ br i1 %cmp203.i, label %while.body205.i, label %while.end218.i
+
+while.end218.i: ; preds = %if.end216.i, %while.cond202.preheader.i
+ %e2.1.lcssa.i = phi i64 [ %add176.i, %while.cond202.preheader.i ], [ %dec217.i, %if.end216.i ]
+ %y.3.lcssa.i = phi double [ %y.0.i, %while.cond202.preheader.i ], [ %y.4.i, %if.end216.i ]
+ %x.4.lcssa.i = phi i32 [ %x.3.lcssa.i, %while.cond202.preheader.i ], [ %x.5.i, %if.end216.i ]
+ %conv219.i121 = zext i32 %bits.0.ph to i64
+ %conv221.i = sext i32 %emin.0.ph to i64
+ %add220.i = sub i64 32, %conv221.i
+ %sub222.i = add i64 %e2.1.lcssa.i, %add220.i
+ %cmp223.i = icmp sgt i64 %conv219.i121, %sub222.i
+ br i1 %cmp223.i, label %if.then225.i, label %if.end234.i
+
+if.then225.i: ; preds = %while.end218.i
+ %conv229.i = trunc i64 %sub222.i to i32
+ %cmp230.i = icmp slt i32 %conv229.i, 0
+ %.conv229.i = select i1 %cmp230.i, i32 0, i32 %conv229.i
+ br label %if.end234.i
+
+if.end234.i: ; preds = %if.then225.i, %while.end218.i
+ %bits.addr.0.i = phi i32 [ %.conv229.i, %if.then225.i ], [ %bits.0.ph, %while.end218.i ]
+ %cmp235.i = icmp slt i32 %bits.addr.0.i, 53
+ br i1 %cmp235.i, label %if.end243.i, label %if.end234.if.end252_crit_edge.i
+
+if.end234.if.end252_crit_edge.i: ; preds = %if.end234.i
+ %conv253.pre.i = sitofp i32 %sign.0 to double
+ br label %if.end252.i
+
+if.end243.i: ; preds = %if.end234.i
+ %sub239.i = sub i32 84, %bits.addr.0.i
+ %call240.i = call double @scalbn(double 1.000000e+00, i32 %sub239.i) #1
+ %conv241.i = sitofp i32 %sign.0 to double
+ %call242.i = call double @copysignl(double %call240.i, double %conv241.i) #7
+ %cmp244.i = icmp slt i32 %bits.addr.0.i, 32
+ %tobool247.i = fcmp une double %y.3.lcssa.i, 0.000000e+00
+ %or.cond90.i = and i1 %cmp244.i, %tobool247.i
+ br i1 %or.cond90.i, label %land.lhs.true248.i, label %if.end252.i
+
+land.lhs.true248.i: ; preds = %if.end243.i
+ %and.i = and i32 %x.4.lcssa.i, 1
+ %tobool249.i = icmp eq i32 %and.i, 0
+ %55 = xor i32 %and.i, 1
+ %inc251.x.4.i = add i32 %55, %x.4.lcssa.i
+ %.y.3.i = select i1 %tobool249.i, double 0.000000e+00, double %y.3.lcssa.i
+ br label %if.end252.i
+
+if.end252.i: ; preds = %land.lhs.true248.i, %if.end243.i, %if.end234.if.end252_crit_edge.i
+ %conv253.pre-phi.i = phi double [ %conv253.pre.i, %if.end234.if.end252_crit_edge.i ], [ %conv241.i, %land.lhs.true248.i ], [ %conv241.i, %if.end243.i ]
+ %bias.096.i = phi double [ 0.000000e+00, %if.end234.if.end252_crit_edge.i ], [ %call242.i, %land.lhs.true248.i ], [ %call242.i, %if.end243.i ]
+ %x.6.i = phi i32 [ %x.4.lcssa.i, %if.end234.if.end252_crit_edge.i ], [ %inc251.x.4.i, %land.lhs.true248.i ], [ %x.4.lcssa.i, %if.end243.i ]
+ %y.5.i = phi double [ %y.3.lcssa.i, %if.end234.if.end252_crit_edge.i ], [ %.y.3.i, %land.lhs.true248.i ], [ %y.3.lcssa.i, %if.end243.i ]
+ %conv254.i = uitofp i32 %x.6.i to double
+ %mul255.i = fmul double %conv253.pre-phi.i, %conv254.i
+ %add256.i = fadd double %bias.096.i, %mul255.i
+ %mul258.i = fmul double %conv253.pre-phi.i, %y.5.i
+ %add259.i = fadd double %mul258.i, %add256.i
+ %sub260.i = fsub double %add259.i, %bias.096.i
+ %tobool261.i = fcmp une double %sub260.i, 0.000000e+00
+ br i1 %tobool261.i, label %if.end264.i, label %if.then262.i
+
+if.then262.i: ; preds = %if.end252.i
+ %call263.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call263.i, align 4, !tbaa !3
+ br label %if.end264.i
+
+if.end264.i: ; preds = %if.then262.i, %if.end252.i
+ %conv265.i = trunc i64 %e2.1.lcssa.i to i32
+ %call266.i = call double @scalbnl(double %sub260.i, i32 %conv265.i) #1
+ br label %return
+
+if.end237: ; preds = %cond.end230
+ %56 = load i8** %shend, align 4, !tbaa !0
+ %tobool239 = icmp eq i8* %56, null
+ br i1 %tobool239, label %if.end245, label %cond.true240
+
+cond.true240: ; preds = %if.end237
+ %57 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr242 = getelementptr inbounds i8* %57, i32 -1
+ store i8* %incdec.ptr242, i8** %rpos, align 4, !tbaa !0
+ br label %if.end245
+
+if.end245: ; preds = %cond.true240, %if.end237, %if.end216
+ %c.6 = phi i32 [ %c.5, %if.end216 ], [ 48, %if.end237 ], [ 48, %cond.true240 ]
+ %58 = bitcast [128 x i32]* %x.i to i8*
+ call void @llvm.lifetime.start(i64 512, i8* %58) #1
+ %sum.i = add i32 %emin.0.ph, %bits.0.ph
+ %sub1.i = sub i32 0, %sum.i
+ br label %for.cond.i85
+
+for.cond.i85: ; preds = %cond.false.i91, %cond.true.i89, %if.end245
+ %gotdig.0.i84 = phi i32 [ 0, %if.end245 ], [ 1, %cond.true.i89 ], [ 1, %cond.false.i91 ]
+ %c.addr.0.i = phi i32 [ %c.6, %if.end245 ], [ %conv.i88, %cond.true.i89 ], [ %call.i90, %cond.false.i91 ]
+ switch i32 %c.addr.0.i, label %if.end.i [
+ i32 48, label %for.body.i86
+ i32 46, label %if.then.i92
+ ]
+
+for.body.i86: ; preds = %for.cond.i85
+ %59 = load i8** %rpos, align 4, !tbaa !0
+ %60 = load i8** %shend, align 4, !tbaa !0
+ %cmp2.i = icmp ult i8* %59, %60
+ br i1 %cmp2.i, label %cond.true.i89, label %cond.false.i91
+
+cond.true.i89: ; preds = %for.body.i86
+ %incdec.ptr.i87 = getelementptr inbounds i8* %59, i32 1
+ store i8* %incdec.ptr.i87, i8** %rpos, align 4, !tbaa !0
+ %61 = load i8* %59, align 1, !tbaa !1
+ %conv.i88 = zext i8 %61 to i32
+ br label %for.cond.i85
+
+cond.false.i91: ; preds = %for.body.i86
+ %call.i90 = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond.i85
+
+if.then.i92: ; preds = %for.cond.i85
+ %62 = load i8** %rpos, align 4, !tbaa !0
+ %63 = load i8** %shend, align 4, !tbaa !0
+ %cmp8.i = icmp ult i8* %62, %63
+ br i1 %cmp8.i, label %cond.true10.i, label %cond.false14.i
+
+cond.true10.i: ; preds = %if.then.i92
+ %incdec.ptr12.i = getelementptr inbounds i8* %62, i32 1
+ store i8* %incdec.ptr12.i, i8** %rpos, align 4, !tbaa !0
+ %64 = load i8* %62, align 1, !tbaa !1
+ %conv13.i = zext i8 %64 to i32
+ br label %for.cond18.preheader.i
+
+cond.false14.i: ; preds = %if.then.i92
+ %call15.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond18.preheader.i
+
+for.cond18.preheader.i: ; preds = %cond.false14.i, %cond.true10.i
+ %c.addr.1.ph.i = phi i32 [ %conv13.i, %cond.true10.i ], [ %call15.i, %cond.false14.i ]
+ %cmp19343.i = icmp eq i32 %c.addr.1.ph.i, 48
+ br i1 %cmp19343.i, label %for.body21.i, label %if.end.i
+
+for.body21.i: ; preds = %for.cond18.backedge.i.for.body21.i_crit_edge, %for.cond18.preheader.i
+ %lrp.0344.i = phi i64 [ %phitmp.i93, %for.cond18.backedge.i.for.body21.i_crit_edge ], [ -1, %for.cond18.preheader.i ]
+ %65 = load i8** %rpos, align 4, !tbaa !0
+ %66 = load i8** %shend, align 4, !tbaa !0
+ %cmp25.i = icmp ult i8* %65, %66
+ br i1 %cmp25.i, label %cond.true27.i, label %cond.false31.i
+
+cond.true27.i: ; preds = %for.body21.i
+ %incdec.ptr29.i = getelementptr inbounds i8* %65, i32 1
+ store i8* %incdec.ptr29.i, i8** %rpos, align 4, !tbaa !0
+ %67 = load i8* %65, align 1, !tbaa !1
+ %conv30.i = zext i8 %67 to i32
+ br label %for.cond18.backedge.i
+
+cond.false31.i: ; preds = %for.body21.i
+ %call32.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond18.backedge.i
+
+for.cond18.backedge.i: ; preds = %cond.false31.i, %cond.true27.i
+ %c.addr.1.be.i = phi i32 [ %call32.i, %cond.false31.i ], [ %conv30.i, %cond.true27.i ]
+ %cmp19.i = icmp eq i32 %c.addr.1.be.i, 48
+ br i1 %cmp19.i, label %for.cond18.backedge.i.for.body21.i_crit_edge, label %if.end.i
+
+for.cond18.backedge.i.for.body21.i_crit_edge: ; preds = %for.cond18.backedge.i
+ %phitmp.i93 = add i64 %lrp.0344.i, -1
+ br label %for.body21.i
+
+if.end.i: ; preds = %for.cond18.backedge.i, %for.cond18.preheader.i, %for.cond.i85
+ %lrp.1.i = phi i64 [ 0, %for.cond18.preheader.i ], [ %lrp.0344.i, %for.cond18.backedge.i ], [ 0, %for.cond.i85 ]
+ %gotdig.2.i94 = phi i32 [ %gotdig.0.i84, %for.cond18.preheader.i ], [ 1, %for.cond18.backedge.i ], [ %gotdig.0.i84, %for.cond.i85 ]
+ %gotrad.0.i95 = phi i32 [ 1, %for.cond18.preheader.i ], [ 1, %for.cond18.backedge.i ], [ 0, %for.cond.i85 ]
+ %c.addr.2.i = phi i32 [ %c.addr.1.ph.i, %for.cond18.preheader.i ], [ %c.addr.1.be.i, %for.cond18.backedge.i ], [ %c.addr.0.i, %for.cond.i85 ]
+ %arrayidx.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 0
+ store i32 0, i32* %arrayidx.i, align 4, !tbaa !3
+ %sub37321.i = add nsw i32 %c.addr.2.i, -48
+ %cmp38322.i = icmp ult i32 %sub37321.i, 10
+ %cmp40323.i = icmp eq i32 %c.addr.2.i, 46
+ %or.cond2324.i = or i1 %cmp38322.i, %cmp40323.i
+ br i1 %or.cond2324.i, label %for.body42.lr.ph.i, label %for.end94.i
+
+for.body42.lr.ph.i: ; preds = %if.end.i
+ %arrayidx77.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 124
+ br label %for.body42.i
+
+for.body42.i: ; preds = %for.cond36.backedge.i, %for.body42.lr.ph.i
+ %cmp40334.i = phi i1 [ %cmp40323.i, %for.body42.lr.ph.i ], [ %cmp40.i, %for.cond36.backedge.i ]
+ %sub37333.i = phi i32 [ %sub37321.i, %for.body42.lr.ph.i ], [ %sub37.i, %for.cond36.backedge.i ]
+ %c.addr.3332.i = phi i32 [ %c.addr.2.i, %for.body42.lr.ph.i ], [ %c.addr.3.be.i, %for.cond36.backedge.i ]
+ %j.0331.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %j.2.i, %for.cond36.backedge.i ]
+ %k.0330.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %k.2.i, %for.cond36.backedge.i ]
+ %gotrad.1329.i = phi i32 [ %gotrad.0.i95, %for.body42.lr.ph.i ], [ %gotrad.2.i, %for.cond36.backedge.i ]
+ %gotdig.3328.i = phi i32 [ %gotdig.2.i94, %for.body42.lr.ph.i ], [ %gotdig.4.i, %for.cond36.backedge.i ]
+ %lnz.0327.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %lnz.2.i, %for.cond36.backedge.i ]
+ %dc.0326.i = phi i64 [ 0, %for.body42.lr.ph.i ], [ %dc.1.i100, %for.cond36.backedge.i ]
+ %lrp.2325.i = phi i64 [ %lrp.1.i, %for.body42.lr.ph.i ], [ %lrp.3.i, %for.cond36.backedge.i ]
+ br i1 %cmp40334.i, label %if.then45.i, label %if.else.i97
+
+if.then45.i: ; preds = %for.body42.i
+ %cond.i = icmp eq i32 %gotrad.1329.i, 0
+ br i1 %cond.i, label %for.inc81.i, label %if.end97.i
+
+if.else.i97: ; preds = %for.body42.i
+ %cmp48.i = icmp slt i32 %k.0330.i, 125
+ %inc.i96 = add nsw i64 %dc.0326.i, 1
+ %cmp51.i = icmp ne i32 %c.addr.3332.i, 48
+ br i1 %cmp48.i, label %if.then50.i, label %if.else72.i
+
+if.then50.i: ; preds = %if.else.i97
+ %conv54.i = trunc i64 %inc.i96 to i32
+ %conv54.lnz.0.i = select i1 %cmp51.i, i32 %conv54.i, i32 %lnz.0327.i
+ %tobool56.i = icmp eq i32 %j.0331.i, 0
+ %arrayidx64.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.0330.i
+ br i1 %tobool56.i, label %if.end65.i, label %if.then57.i
+
+if.then57.i: ; preds = %if.then50.i
+ %68 = load i32* %arrayidx64.i, align 4, !tbaa !3
+ %mul.i98 = mul i32 %68, 10
+ %add59.i = add i32 %c.addr.3332.i, -48
+ %sub60.i = add i32 %add59.i, %mul.i98
+ br label %if.end65.i
+
+if.end65.i: ; preds = %if.then57.i, %if.then50.i
+ %storemerge.i = phi i32 [ %sub60.i, %if.then57.i ], [ %sub37333.i, %if.then50.i ]
+ store i32 %storemerge.i, i32* %arrayidx64.i, align 4, !tbaa !3
+ %inc66.i = add nsw i32 %j.0331.i, 1
+ %cmp67.i = icmp eq i32 %inc66.i, 9
+ %inc70.i = zext i1 %cmp67.i to i32
+ %inc70.k.0.i = add nsw i32 %inc70.i, %k.0330.i
+ %.inc66.i = select i1 %cmp67.i, i32 0, i32 %inc66.i
+ br label %for.inc81.i
+
+if.else72.i: ; preds = %if.else.i97
+ br i1 %cmp51.i, label %if.then76.i, label %for.inc81.i
+
+if.then76.i: ; preds = %if.else72.i
+ %69 = load i32* %arrayidx77.i, align 4, !tbaa !3
+ %or.i99 = or i32 %69, 1
+ store i32 %or.i99, i32* %arrayidx77.i, align 4, !tbaa !3
+ br label %for.inc81.i
+
+for.inc81.i: ; preds = %if.then76.i, %if.else72.i, %if.end65.i, %if.then45.i
+ %lrp.3.i = phi i64 [ %lrp.2325.i, %if.end65.i ], [ %lrp.2325.i, %if.then76.i ], [ %dc.0326.i, %if.then45.i ], [ %lrp.2325.i, %if.else72.i ]
+ %dc.1.i100 = phi i64 [ %inc.i96, %if.end65.i ], [ %inc.i96, %if.then76.i ], [ %dc.0326.i, %if.then45.i ], [ %inc.i96, %if.else72.i ]
+ %lnz.2.i = phi i32 [ %conv54.lnz.0.i, %if.end65.i ], [ %lnz.0327.i, %if.then76.i ], [ %lnz.0327.i, %if.then45.i ], [ %lnz.0327.i, %if.else72.i ]
+ %gotdig.4.i = phi i32 [ 1, %if.end65.i ], [ %gotdig.3328.i, %if.then76.i ], [ %gotdig.3328.i, %if.then45.i ], [ %gotdig.3328.i, %if.else72.i ]
+ %gotrad.2.i = phi i32 [ %gotrad.1329.i, %if.end65.i ], [ %gotrad.1329.i, %if.then76.i ], [ 1, %if.then45.i ], [ %gotrad.1329.i, %if.else72.i ]
+ %k.2.i = phi i32 [ %inc70.k.0.i, %if.end65.i ], [ %k.0330.i, %if.then76.i ], [ %k.0330.i, %if.then45.i ], [ %k.0330.i, %if.else72.i ]
+ %j.2.i = phi i32 [ %.inc66.i, %if.end65.i ], [ %j.0331.i, %if.then76.i ], [ %j.0331.i, %if.then45.i ], [ %j.0331.i, %if.else72.i ]
+ %70 = load i8** %rpos, align 4, !tbaa !0
+ %71 = load i8** %shend, align 4, !tbaa !0
+ %cmp84.i = icmp ult i8* %70, %71
+ br i1 %cmp84.i, label %cond.true86.i, label %cond.false90.i
+
+cond.true86.i: ; preds = %for.inc81.i
+ %incdec.ptr88.i = getelementptr inbounds i8* %70, i32 1
+ store i8* %incdec.ptr88.i, i8** %rpos, align 4, !tbaa !0
+ %72 = load i8* %70, align 1, !tbaa !1
+ %conv89.i = zext i8 %72 to i32
+ br label %for.cond36.backedge.i
+
+cond.false90.i: ; preds = %for.inc81.i
+ %call91.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond36.backedge.i
+
+for.cond36.backedge.i: ; preds = %cond.false90.i, %cond.true86.i
+ %c.addr.3.be.i = phi i32 [ %call91.i, %cond.false90.i ], [ %conv89.i, %cond.true86.i ]
+ %sub37.i = add nsw i32 %c.addr.3.be.i, -48
+ %cmp38.i = icmp ult i32 %sub37.i, 10
+ %cmp40.i = icmp eq i32 %c.addr.3.be.i, 46
+ %or.cond2.i = or i1 %cmp38.i, %cmp40.i
+ br i1 %or.cond2.i, label %for.body42.i, label %for.end94.i
+
+for.end94.i: ; preds = %for.cond36.backedge.i, %if.end.i
+ %c.addr.3.lcssa.i = phi i32 [ %c.addr.2.i, %if.end.i ], [ %c.addr.3.be.i, %for.cond36.backedge.i ]
+ %j.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %j.2.i, %for.cond36.backedge.i ]
+ %k.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %k.2.i, %for.cond36.backedge.i ]
+ %gotrad.1.lcssa.i = phi i32 [ %gotrad.0.i95, %if.end.i ], [ %gotrad.2.i, %for.cond36.backedge.i ]
+ %gotdig.3.lcssa.i = phi i32 [ %gotdig.2.i94, %if.end.i ], [ %gotdig.4.i, %for.cond36.backedge.i ]
+ %lnz.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %lnz.2.i, %for.cond36.backedge.i ]
+ %dc.0.lcssa.i = phi i64 [ 0, %if.end.i ], [ %dc.1.i100, %for.cond36.backedge.i ]
+ %lrp.2.lcssa.i = phi i64 [ %lrp.1.i, %if.end.i ], [ %lrp.3.i, %for.cond36.backedge.i ]
+ %tobool95.i = icmp eq i32 %gotrad.1.lcssa.i, 0
+ %dc.0.lrp.2.i = select i1 %tobool95.i, i64 %dc.0.lcssa.i, i64 %lrp.2.lcssa.i
+ br label %if.end97.i
+
+if.end97.i: ; preds = %for.end94.i, %if.then45.i
+ %c.addr.3320.i = phi i32 [ %c.addr.3.lcssa.i, %for.end94.i ], [ %c.addr.3332.i, %if.then45.i ]
+ %j.0318.i = phi i32 [ %j.0.lcssa.i, %for.end94.i ], [ %j.0331.i, %if.then45.i ]
+ %k.0316.i = phi i32 [ %k.0.lcssa.i, %for.end94.i ], [ %k.0330.i, %if.then45.i ]
+ %gotdig.3313.i = phi i32 [ %gotdig.3.lcssa.i, %for.end94.i ], [ %gotdig.3328.i, %if.then45.i ]
+ %lnz.0311.i = phi i32 [ %lnz.0.lcssa.i, %for.end94.i ], [ %lnz.0327.i, %if.then45.i ]
+ %dc.0309.i = phi i64 [ %dc.0.lcssa.i, %for.end94.i ], [ %dc.0326.i, %if.then45.i ]
+ %lrp.4.i = phi i64 [ %dc.0.lrp.2.i, %for.end94.i ], [ %lrp.2325.i, %if.then45.i ]
+ %tobool98.i = icmp ne i32 %gotdig.3313.i, 0
+ br i1 %tobool98.i, label %land.lhs.true.i, label %if.else120.i
+
+land.lhs.true.i: ; preds = %if.end97.i
+ %or99.i = or i32 %c.addr.3320.i, 32
+ %cmp100.i = icmp eq i32 %or99.i, 101
+ br i1 %cmp100.i, label %if.then102.i, label %if.else120.i
+
+if.then102.i: ; preds = %land.lhs.true.i
+ %call103.i = call fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #1
+ %cmp104.i = icmp eq i64 %call103.i, -9223372036854775808
+ br i1 %cmp104.i, label %if.then106.i101, label %if.end118.i
+
+if.then106.i101: ; preds = %if.then102.i
+ br i1 %tobool55, label %if.else116.i, label %if.then108.i
+
+if.then108.i: ; preds = %if.then106.i101
+ %73 = load i8** %shend, align 4, !tbaa !0
+ %tobool110.i = icmp eq i8* %73, null
+ br i1 %tobool110.i, label %if.end118.i, label %cond.true111.i
+
+cond.true111.i: ; preds = %if.then108.i
+ %74 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr113.i = getelementptr inbounds i8* %74, i32 -1
+ store i8* %incdec.ptr113.i, i8** %rpos, align 4, !tbaa !0
+ br label %if.end118.i
+
+if.else116.i: ; preds = %if.then106.i101
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %return
+
+if.end118.i: ; preds = %cond.true111.i, %if.then108.i, %if.then102.i
+ %e10.0.i = phi i64 [ %call103.i, %if.then102.i ], [ 0, %if.then108.i ], [ 0, %cond.true111.i ]
+ %add119.i = add nsw i64 %e10.0.i, %lrp.4.i
+ br label %if.end132.i
+
+if.else120.i: ; preds = %land.lhs.true.i, %if.end97.i
+ %cmp121.i = icmp sgt i32 %c.addr.3320.i, -1
+ br i1 %cmp121.i, label %if.then123.i, label %if.end132.i
+
+if.then123.i: ; preds = %if.else120.i
+ %75 = load i8** %shend, align 4, !tbaa !0
+ %tobool125.i = icmp eq i8* %75, null
+ br i1 %tobool125.i, label %if.end132.i, label %cond.true126.i
+
+cond.true126.i: ; preds = %if.then123.i
+ %76 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr128.i = getelementptr inbounds i8* %76, i32 -1
+ store i8* %incdec.ptr128.i, i8** %rpos, align 4, !tbaa !0
+ br label %if.end132.i
+
+if.end132.i: ; preds = %cond.true126.i, %if.then123.i, %if.else120.i, %if.end118.i
+ %lrp.5.i = phi i64 [ %add119.i, %if.end118.i ], [ %lrp.4.i, %cond.true126.i ], [ %lrp.4.i, %if.then123.i ], [ %lrp.4.i, %if.else120.i ]
+ br i1 %tobool98.i, label %if.end136.i, label %if.then134.i
+
+if.then134.i: ; preds = %if.end132.i
+ %call135.i = call i32* @__errno_location() #7
+ store i32 22, i32* %call135.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f, i32 0) #1
+ br label %return
+
+if.end136.i: ; preds = %if.end132.i
+ %77 = load i32* %arrayidx.i, align 4, !tbaa !3
+ %tobool138.i102 = icmp eq i32 %77, 0
+ br i1 %tobool138.i102, label %if.then139.i, label %if.end142.i
+
+if.then139.i: ; preds = %if.end136.i
+ %conv140.i = sitofp i32 %sign.0 to double
+ %mul141.i = fmul double %conv140.i, 0.000000e+00
+ br label %return
+
+if.end142.i: ; preds = %if.end136.i
+ %cmp143.i = icmp eq i64 %lrp.5.i, %dc.0309.i
+ %cmp146.i103 = icmp slt i64 %dc.0309.i, 10
+ %or.cond.i104 = and i1 %cmp143.i, %cmp146.i103
+ br i1 %or.cond.i104, label %land.lhs.true148.i, label %if.end159.i
+
+land.lhs.true148.i: ; preds = %if.end142.i
+ %cmp149.i = icmp ugt i32 %bits.0.ph, 30
+ br i1 %cmp149.i, label %if.then154.i106, label %lor.lhs.false.i105
+
+lor.lhs.false.i105: ; preds = %land.lhs.true148.i
+ %shr.i = lshr i32 %77, %bits.0.ph
+ %cmp152.i = icmp eq i32 %shr.i, 0
+ br i1 %cmp152.i, label %if.then154.i106, label %if.end159.i
+
+if.then154.i106: ; preds = %lor.lhs.false.i105, %land.lhs.true148.i
+ %conv155.i = sitofp i32 %sign.0 to double
+ %conv157.i = uitofp i32 %77 to double
+ %mul158.i = fmul double %conv155.i, %conv157.i
+ br label %return
+
+if.end159.i: ; preds = %lor.lhs.false.i105, %if.end142.i
+ %div.i107 = sdiv i32 %emin.0.ph, -2
+ %conv161.i = sext i32 %div.i107 to i64
+ %cmp162.i = icmp sgt i64 %lrp.5.i, %conv161.i
+ br i1 %cmp162.i, label %if.then164.i, label %if.end169.i
+
+if.then164.i: ; preds = %if.end159.i
+ %call165.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call165.i, align 4, !tbaa !3
+ %conv166.i = sitofp i32 %sign.0 to double
+ %mul167.i = fmul double %conv166.i, 0x7FEFFFFFFFFFFFFF
+ %mul168.i = fmul double %mul167.i, 0x7FEFFFFFFFFFFFFF
+ br label %return
+
+if.end169.i: ; preds = %if.end159.i
+ %sub170.i = add nsw i32 %emin.0.ph, -106
+ %conv171.i = sext i32 %sub170.i to i64
+ %cmp172.i = icmp slt i64 %lrp.5.i, %conv171.i
+ br i1 %cmp172.i, label %if.then174.i, label %if.end179.i
+
+if.then174.i: ; preds = %if.end169.i
+ %call175.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call175.i, align 4, !tbaa !3
+ %conv176.i = sitofp i32 %sign.0 to double
+ %mul177.i = fmul double %conv176.i, 0x10000000000000
+ %mul178.i = fmul double %mul177.i, 0x10000000000000
+ br label %return
+
+if.end179.i: ; preds = %if.end169.i
+ %tobool180.i = icmp eq i32 %j.0318.i, 0
+ br i1 %tobool180.i, label %if.end192.i, label %for.cond182.preheader.i
+
+for.cond182.preheader.i: ; preds = %if.end179.i
+ %cmp183304.i = icmp slt i32 %j.0318.i, 9
+ br i1 %cmp183304.i, label %for.body185.lr.ph.i, label %for.end190.i
+
+for.body185.lr.ph.i: ; preds = %for.cond182.preheader.i
+ %arrayidx186.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.0316.i
+ %arrayidx186.promoted.i = load i32* %arrayidx186.i, align 4, !tbaa !3
+ br label %for.body185.i
+
+for.body185.i: ; preds = %for.body185.i, %for.body185.lr.ph.i
+ %mul187306.i = phi i32 [ %arrayidx186.promoted.i, %for.body185.lr.ph.i ], [ %mul187.i, %for.body185.i ]
+ %j.3305.i = phi i32 [ %j.0318.i, %for.body185.lr.ph.i ], [ %inc189.i, %for.body185.i ]
+ %mul187.i = mul i32 %mul187306.i, 10
+ %inc189.i = add nsw i32 %j.3305.i, 1
+ %exitcond.i = icmp eq i32 %inc189.i, 9
+ br i1 %exitcond.i, label %for.cond182.for.end190_crit_edge.i, label %for.body185.i
+
+for.cond182.for.end190_crit_edge.i: ; preds = %for.body185.i
+ store i32 %mul187.i, i32* %arrayidx186.i, align 4, !tbaa !3
+ br label %for.end190.i
+
+for.end190.i: ; preds = %for.cond182.for.end190_crit_edge.i, %for.cond182.preheader.i
+ %inc191.i = add nsw i32 %k.0316.i, 1
+ br label %if.end192.i
+
+if.end192.i: ; preds = %for.end190.i, %if.end179.i
+ %k.3.i = phi i32 [ %inc191.i, %for.end190.i ], [ %k.0316.i, %if.end179.i ]
+ %conv193.i108 = trunc i64 %lrp.5.i to i32
+ %cmp194.i109 = icmp slt i32 %lnz.0311.i, 9
+ br i1 %cmp194.i109, label %land.lhs.true196.i, label %if.end243.i111
+
+land.lhs.true196.i: ; preds = %if.end192.i
+ %cmp197.i = icmp sle i32 %lnz.0311.i, %conv193.i108
+ %cmp200.i = icmp slt i32 %conv193.i108, 18
+ %or.cond1.i = and i1 %cmp197.i, %cmp200.i
+ br i1 %or.cond1.i, label %if.then202.i, label %if.end243.i111
+
+if.then202.i: ; preds = %land.lhs.true196.i
+ %cmp203.i110 = icmp eq i32 %conv193.i108, 9
+ br i1 %cmp203.i110, label %if.then205.i, label %if.end210.i
+
+if.then205.i: ; preds = %if.then202.i
+ %conv206.i = sitofp i32 %sign.0 to double
+ %78 = load i32* %arrayidx.i, align 4, !tbaa !3
+ %conv208.i = uitofp i32 %78 to double
+ %mul209.i = fmul double %conv206.i, %conv208.i
+ br label %return
+
+if.end210.i: ; preds = %if.then202.i
+ %cmp211.i = icmp slt i32 %conv193.i108, 9
+ br i1 %cmp211.i, label %if.then213.i, label %if.end222.i
+
+if.then213.i: ; preds = %if.end210.i
+ %conv214.i = sitofp i32 %sign.0 to double
+ %79 = load i32* %arrayidx.i, align 4, !tbaa !3
+ %conv216.i = uitofp i32 %79 to double
+ %mul217.i = fmul double %conv214.i, %conv216.i
+ %sub218.i = sub nsw i32 8, %conv193.i108
+ %arrayidx219.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub218.i
+ %80 = load i32* %arrayidx219.i, align 4, !tbaa !3
+ %conv220.i = sitofp i32 %80 to double
+ %div221.i = fdiv double %mul217.i, %conv220.i
+ br label %return
+
+if.end222.i: ; preds = %if.end210.i
+ %81 = mul i32 %conv193.i108, -3
+ %mul224.neg.i = add i32 %bits.0.ph, 27
+ %sub225.i = add i32 %mul224.neg.i, %81
+ %cmp226.i = icmp sgt i32 %sub225.i, 30
+ %.pre.i = load i32* %arrayidx.i, align 4, !tbaa !3
+ br i1 %cmp226.i, label %if.then233.i, label %lor.lhs.false228.i
+
+lor.lhs.false228.i: ; preds = %if.end222.i
+ %shr230.i = lshr i32 %.pre.i, %sub225.i
+ %cmp231.i = icmp eq i32 %shr230.i, 0
+ br i1 %cmp231.i, label %if.then233.i, label %if.end243.i111
+
+if.then233.i: ; preds = %lor.lhs.false228.i, %if.end222.i
+ %conv234.i = sitofp i32 %sign.0 to double
+ %conv236.i = uitofp i32 %.pre.i to double
+ %mul237.i = fmul double %conv234.i, %conv236.i
+ %sub238.i = add nsw i32 %conv193.i108, -10
+ %arrayidx239.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub238.i
+ %82 = load i32* %arrayidx239.i, align 4, !tbaa !3
+ %conv240.i = sitofp i32 %82 to double
+ %mul241.i = fmul double %mul237.i, %conv240.i
+ br label %return
+
+if.end243.i111: ; preds = %lor.lhs.false228.i, %land.lhs.true196.i, %if.end192.i
+ %rem.i = srem i32 %conv193.i108, 9
+ %tobool244.i = icmp eq i32 %rem.i, 0
+ br i1 %tobool244.i, label %while.cond.outer.i, label %if.then245.i
+
+if.then245.i: ; preds = %if.end243.i111
+ %cmp246.i = icmp sgt i32 %conv193.i108, -1
+ %add252.i = add nsw i32 %rem.i, 9
+ %cond254.i = select i1 %cmp246.i, i32 %rem.i, i32 %add252.i
+ %sub255.i = sub nsw i32 8, %cond254.i
+ %arrayidx256.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub255.i
+ %83 = load i32* %arrayidx256.i, align 4, !tbaa !3
+ %cmp258296.i = icmp eq i32 %k.3.i, 0
+ br i1 %cmp258296.i, label %if.end285.i, label %for.body260.lr.ph.i
+
+for.body260.lr.ph.i: ; preds = %if.then245.i
+ %div267.i = sdiv i32 1000000000, %83
+ br label %for.body260.i
+
+for.body260.i: ; preds = %for.inc278.i, %for.body260.lr.ph.i
+ %carry.0300.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %mul268.i, %for.inc278.i ]
+ %k.4299.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %add275.i, %for.inc278.i ]
+ %a.0298.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %a.1.i, %for.inc278.i ]
+ %rp.0297.i = phi i32 [ %conv193.i108, %for.body260.lr.ph.i ], [ %rp.1.i113, %for.inc278.i ]
+ %arrayidx261.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.4299.i
+ %84 = load i32* %arrayidx261.i, align 4, !tbaa !3
+ %rem262.i = urem i32 %84, %83
+ %div264.i = udiv i32 %84, %83
+ %add265.i = add i32 %div264.i, %carry.0300.i
+ store i32 %add265.i, i32* %arrayidx261.i, align 4, !tbaa !3
+ %mul268.i = mul i32 %rem262.i, %div267.i
+ %cmp269.i = icmp eq i32 %k.4299.i, %a.0298.i
+ %tobool273.i = icmp eq i32 %add265.i, 0
+ %or.cond223.i = and i1 %cmp269.i, %tobool273.i
+ %add275.i = add nsw i32 %k.4299.i, 1
+ br i1 %or.cond223.i, label %if.then274.i, label %for.inc278.i
+
+if.then274.i: ; preds = %for.body260.i
+ %and.i112 = and i32 %add275.i, 127
+ %sub276.i = add nsw i32 %rp.0297.i, -9
+ br label %for.inc278.i
+
+for.inc278.i: ; preds = %if.then274.i, %for.body260.i
+ %rp.1.i113 = phi i32 [ %sub276.i, %if.then274.i ], [ %rp.0297.i, %for.body260.i ]
+ %a.1.i = phi i32 [ %and.i112, %if.then274.i ], [ %a.0298.i, %for.body260.i ]
+ %cmp258.i = icmp eq i32 %add275.i, %k.3.i
+ br i1 %cmp258.i, label %for.end280.i, label %for.body260.i
+
+for.end280.i: ; preds = %for.inc278.i
+ %tobool281.i = icmp eq i32 %mul268.i, 0
+ br i1 %tobool281.i, label %if.end285.i, label %if.then282.i
+
+if.then282.i: ; preds = %for.end280.i
+ %inc283.i = add nsw i32 %k.3.i, 1
+ %arrayidx284.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.3.i
+ store i32 %mul268.i, i32* %arrayidx284.i, align 4, !tbaa !3
+ br label %if.end285.i
+
+if.end285.i: ; preds = %if.then282.i, %for.end280.i, %if.then245.i
+ %rp.0.lcssa377.i = phi i32 [ %rp.1.i113, %if.then282.i ], [ %rp.1.i113, %for.end280.i ], [ %conv193.i108, %if.then245.i ]
+ %a.0.lcssa376.i = phi i32 [ %a.1.i, %if.then282.i ], [ %a.1.i, %for.end280.i ], [ 0, %if.then245.i ]
+ %z.0.i = phi i32 [ %inc283.i, %if.then282.i ], [ %k.3.i, %for.end280.i ], [ 0, %if.then245.i ]
+ %sub286.i = sub i32 9, %cond254.i
+ %add287.i = add nsw i32 %sub286.i, %rp.0.lcssa377.i
+ br label %while.cond.outer.i
+
+while.cond.outer.i: ; preds = %if.end357.i, %if.end285.i, %if.end243.i111
+ %rp.2.ph247.i = phi i32 [ %add344.i, %if.end357.i ], [ %add287.i, %if.end285.i ], [ %conv193.i108, %if.end243.i111 ]
+ %e2.0.ph.i = phi i32 [ %sub300.lcssa.i, %if.end357.i ], [ 0, %if.end285.i ], [ 0, %if.end243.i111 ]
+ %z.1.ph248.i = phi i32 [ %z.4.i, %if.end357.i ], [ %z.0.i, %if.end285.i ], [ %k.3.i, %if.end243.i111 ]
+ %a.2.ph249.i = phi i32 [ %and346.i, %if.end357.i ], [ %a.0.lcssa376.i, %if.end285.i ], [ 0, %if.end243.i111 ]
+ %cmp289.i = icmp slt i32 %rp.2.ph247.i, 18
+ %arrayidx294.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %a.2.ph249.i
+ br i1 %cmp289.i, label %while.body.us.i, label %while.cond.outer.while.cond.outer.split_crit_edge.i
+
+while.cond.outer.while.cond.outer.split_crit_edge.i: ; preds = %while.cond.outer.i
+ %cmp292.i = icmp eq i32 %rp.2.ph247.i, 18
+ br i1 %cmp292.i, label %land.rhs.us256.i, label %for.cond360.outer.i
+
+while.body.us.i: ; preds = %for.end341.us.i, %while.cond.outer.i
+ %e2.0.us.i = phi i32 [ %sub300.us.i, %for.end341.us.i ], [ %e2.0.ph.i, %while.cond.outer.i ]
+ %z.1.us.i = phi i32 [ %z.3.us.i, %for.end341.us.i ], [ %z.1.ph248.i, %while.cond.outer.i ]
+ %sub301.us.i = add nsw i32 %z.1.us.i, 127
+ br label %for.cond303.us.i
+
+for.cond303.us.i: ; preds = %if.end333.us.i, %while.body.us.i
+ %z.2.us.i = phi i32 [ %z.1.us.i, %while.body.us.i ], [ %z.3.us.i, %if.end333.us.i ]
+ %k.5.in.us.i = phi i32 [ %sub301.us.i, %while.body.us.i ], [ %sub339.us.i, %if.end333.us.i ]
+ %carry299.0.us.i = phi i32 [ 0, %while.body.us.i ], [ %carry299.1.us.i, %if.end333.us.i ]
+ %k.5.us.i = and i32 %k.5.in.us.i, 127
+ %arrayidx306.us.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.5.us.i
+ %85 = load i32* %arrayidx306.us.i, align 4, !tbaa !3
+ %conv307.us.i = zext i32 %85 to i64
+ %shl.us.i = shl nuw nsw i64 %conv307.us.i, 29
+ %conv308.us.i = zext i32 %carry299.0.us.i to i64
+ %add309.us.i = add i64 %shl.us.i, %conv308.us.i
+ %cmp310.us.i = icmp ugt i64 %add309.us.i, 1000000000
+ %extract.t231.us.i = trunc i64 %add309.us.i to i32
+ br i1 %cmp310.us.i, label %if.then312.us.i, label %if.end321.us.i
+
+if.then312.us.i: ; preds = %for.cond303.us.i
+ %div313.us.i = udiv i64 %add309.us.i, 1000000000
+ %conv314.us.i = trunc i64 %div313.us.i to i32
+ %rem315.us.i = urem i64 %add309.us.i, 1000000000
+ %extract.t.us.i = trunc i64 %rem315.us.i to i32
+ br label %if.end321.us.i
+
+if.end321.us.i: ; preds = %if.then312.us.i, %for.cond303.us.i
+ %rem315.sink.off0.us.i = phi i32 [ %extract.t.us.i, %if.then312.us.i ], [ %extract.t231.us.i, %for.cond303.us.i ]
+ %carry299.1.us.i = phi i32 [ %conv314.us.i, %if.then312.us.i ], [ 0, %for.cond303.us.i ]
+ store i32 %rem315.sink.off0.us.i, i32* %arrayidx306.us.i, align 4, !tbaa !3
+ %sub322.us.i = add nsw i32 %z.2.us.i, 127
+ %and323.us.i = and i32 %sub322.us.i, 127
+ %cmp324.us.i = icmp ne i32 %k.5.us.i, %and323.us.i
+ %cmp327.us.i = icmp eq i32 %k.5.us.i, %a.2.ph249.i
+ %or.cond224.us.i = or i1 %cmp324.us.i, %cmp327.us.i
+ br i1 %or.cond224.us.i, label %if.end333.us.i, label %land.lhs.true329.us.i
+
+land.lhs.true329.us.i: ; preds = %if.end321.us.i
+ %tobool331.us.i = icmp eq i32 %rem315.sink.off0.us.i, 0
+ %k.5.z.2.us.i = select i1 %tobool331.us.i, i32 %k.5.us.i, i32 %z.2.us.i
+ br label %if.end333.us.i
+
+if.end333.us.i: ; preds = %land.lhs.true329.us.i, %if.end321.us.i
+ %z.3.us.i = phi i32 [ %z.2.us.i, %if.end321.us.i ], [ %k.5.z.2.us.i, %land.lhs.true329.us.i ]
+ %sub339.us.i = add nsw i32 %k.5.us.i, -1
+ br i1 %cmp327.us.i, label %for.end341.us.i, label %for.cond303.us.i
+
+for.end341.us.i: ; preds = %if.end333.us.i
+ %sub300.us.i = add nsw i32 %e2.0.us.i, -29
+ %tobool342.us.i = icmp eq i32 %carry299.1.us.i, 0
+ br i1 %tobool342.us.i, label %while.body.us.i, label %if.then343.i
+
+land.rhs.us256.i: ; preds = %for.end341.us292.i, %while.cond.outer.while.cond.outer.split_crit_edge.i
+ %e2.0.us253.i = phi i32 [ %e2.0.ph.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ], [ %sub300.us259.i, %for.end341.us292.i ]
+ %z.1.us254.i = phi i32 [ %z.1.ph248.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ], [ %z.3.us290.i, %for.end341.us292.i ]
+ %86 = load i32* %arrayidx294.i, align 4, !tbaa !3
+ %cmp295.us257.i = icmp ult i32 %86, 9007199
+ br i1 %cmp295.us257.i, label %while.body.us258.i, label %for.cond360.outer.i
+
+while.body.us258.i: ; preds = %land.rhs.us256.i
+ %sub301.us260.i = add nsw i32 %z.1.us254.i, 127
+ br label %for.cond303.us261.i
+
+for.cond303.us261.i: ; preds = %if.end333.us289.i, %while.body.us258.i
+ %z.2.us262.i = phi i32 [ %z.1.us254.i, %while.body.us258.i ], [ %z.3.us290.i, %if.end333.us289.i ]
+ %k.5.in.us263.i = phi i32 [ %sub301.us260.i, %while.body.us258.i ], [ %sub339.us291.i, %if.end333.us289.i ]
+ %carry299.0.us264.i = phi i32 [ 0, %while.body.us258.i ], [ %carry299.1.us280.i, %if.end333.us289.i ]
+ %k.5.us265.i = and i32 %k.5.in.us263.i, 127
+ %arrayidx306.us266.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.5.us265.i
+ %87 = load i32* %arrayidx306.us266.i, align 4, !tbaa !3
+ %conv307.us267.i = zext i32 %87 to i64
+ %shl.us268.i = shl nuw nsw i64 %conv307.us267.i, 29
+ %conv308.us269.i = zext i32 %carry299.0.us264.i to i64
+ %add309.us270.i = add i64 %shl.us268.i, %conv308.us269.i
+ %cmp310.us271.i = icmp ugt i64 %add309.us270.i, 1000000000
+ %extract.t231.us272.i = trunc i64 %add309.us270.i to i32
+ br i1 %cmp310.us271.i, label %if.then312.us273.i, label %if.end321.us278.i
+
+if.then312.us273.i: ; preds = %for.cond303.us261.i
+ %div313.us274.i = udiv i64 %add309.us270.i, 1000000000
+ %conv314.us275.i = trunc i64 %div313.us274.i to i32
+ %rem315.us276.i = urem i64 %add309.us270.i, 1000000000
+ %extract.t.us277.i = trunc i64 %rem315.us276.i to i32
+ br label %if.end321.us278.i
+
+if.end321.us278.i: ; preds = %if.then312.us273.i, %for.cond303.us261.i
+ %rem315.sink.off0.us279.i = phi i32 [ %extract.t.us277.i, %if.then312.us273.i ], [ %extract.t231.us272.i, %for.cond303.us261.i ]
+ %carry299.1.us280.i = phi i32 [ %conv314.us275.i, %if.then312.us273.i ], [ 0, %for.cond303.us261.i ]
+ store i32 %rem315.sink.off0.us279.i, i32* %arrayidx306.us266.i, align 4, !tbaa !3
+ %sub322.us281.i = add nsw i32 %z.2.us262.i, 127
+ %and323.us282.i = and i32 %sub322.us281.i, 127
+ %cmp324.us283.i = icmp ne i32 %k.5.us265.i, %and323.us282.i
+ %cmp327.us284.i = icmp eq i32 %k.5.us265.i, %a.2.ph249.i
+ %or.cond224.us285.i = or i1 %cmp324.us283.i, %cmp327.us284.i
+ br i1 %or.cond224.us285.i, label %if.end333.us289.i, label %land.lhs.true329.us286.i
+
+land.lhs.true329.us286.i: ; preds = %if.end321.us278.i
+ %tobool331.us287.i = icmp eq i32 %rem315.sink.off0.us279.i, 0
+ %k.5.z.2.us288.i = select i1 %tobool331.us287.i, i32 %k.5.us265.i, i32 %z.2.us262.i
+ br label %if.end333.us289.i
+
+if.end333.us289.i: ; preds = %land.lhs.true329.us286.i, %if.end321.us278.i
+ %z.3.us290.i = phi i32 [ %z.2.us262.i, %if.end321.us278.i ], [ %k.5.z.2.us288.i, %land.lhs.true329.us286.i ]
+ %sub339.us291.i = add nsw i32 %k.5.us265.i, -1
+ br i1 %cmp327.us284.i, label %for.end341.us292.i, label %for.cond303.us261.i
+
+for.end341.us292.i: ; preds = %if.end333.us289.i
+ %sub300.us259.i = add nsw i32 %e2.0.us253.i, -29
+ %tobool342.us295.i = icmp eq i32 %carry299.1.us280.i, 0
+ br i1 %tobool342.us295.i, label %land.rhs.us256.i, label %if.then343.i
+
+if.then343.i: ; preds = %for.end341.us292.i, %for.end341.us.i
+ %carry299.1.lcssa.lcssa.i = phi i32 [ %carry299.1.us280.i, %for.end341.us292.i ], [ %carry299.1.us.i, %for.end341.us.i ]
+ %z.3.lcssa.lcssa.i = phi i32 [ %z.3.us290.i, %for.end341.us292.i ], [ %z.3.us.i, %for.end341.us.i ]
+ %sub300.lcssa.i = phi i32 [ %sub300.us259.i, %for.end341.us292.i ], [ %sub300.us.i, %for.end341.us.i ]
+ %add344.i = add nsw i32 %rp.2.ph247.i, 9
+ %sub345.i = add nsw i32 %a.2.ph249.i, 127
+ %and346.i = and i32 %sub345.i, 127
+ %cmp347.i = icmp eq i32 %and346.i, %z.3.lcssa.lcssa.i
+ br i1 %cmp347.i, label %if.then349.i, label %if.end357.i
+
+if.then349.i: ; preds = %if.then343.i
+ %sub350.i = add nsw i32 %z.3.lcssa.lcssa.i, 127
+ %and351.i = and i32 %sub350.i, 127
+ %arrayidx352.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and351.i
+ %88 = load i32* %arrayidx352.i, align 4, !tbaa !3
+ %sub353.i = add nsw i32 %z.3.lcssa.lcssa.i, 126
+ %and354.i = and i32 %sub353.i, 127
+ %arrayidx355.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and354.i
+ %89 = load i32* %arrayidx355.i, align 4, !tbaa !3
+ %or356.i = or i32 %89, %88
+ store i32 %or356.i, i32* %arrayidx355.i, align 4, !tbaa !3
+ br label %if.end357.i
+
+if.end357.i: ; preds = %if.then349.i, %if.then343.i
+ %z.4.i = phi i32 [ %and351.i, %if.then349.i ], [ %z.3.lcssa.lcssa.i, %if.then343.i ]
+ %arrayidx358.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and346.i
+ store i32 %carry299.1.lcssa.lcssa.i, i32* %arrayidx358.i, align 4, !tbaa !3
+ br label %while.cond.outer.i
+
+for.cond360.i: ; preds = %for.cond360.i.outer, %if.end396.i
+ %e2.1.i = phi i32 [ %add401.i, %if.end396.i ], [ %e2.1.i.ph, %for.cond360.i.outer ]
+ %a.3.i = phi i32 [ %z.5.ph.i, %if.end396.i ], [ %a.3.i.ph, %for.cond360.i.outer ]
+ br label %for.body367.i
+
+for.cond364.i: ; preds = %if.end378.i
+ %cmp365.i = icmp slt i32 %inc388.i, 2
+ br i1 %cmp365.i, label %for.body367.i, label %for.end389.i
+
+for.body367.i: ; preds = %for.cond364.i, %for.cond360.i
+ %i.0235.i = phi i32 [ 0, %for.cond360.i ], [ %inc388.i, %for.cond364.i ]
+ %add368.i = add nsw i32 %i.0235.i, %a.3.i
+ %and369.i = and i32 %add368.i, 127
+ %cmp370.i = icmp eq i32 %and369.i, %z.5.ph.i
+ br i1 %cmp370.i, label %for.end389.i, label %lor.lhs.false372.i
+
+lor.lhs.false372.i: ; preds = %for.body367.i
+ %arrayidx373.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and369.i
+ %90 = load i32* %arrayidx373.i, align 4, !tbaa !3
+ %arrayidx374.i = getelementptr inbounds [2 x i32]* @decfloat.th, i32 0, i32 %i.0235.i
+ %91 = load i32* %arrayidx374.i, align 4, !tbaa !3
+ %cmp375.i = icmp ult i32 %90, %91
+ br i1 %cmp375.i, label %for.end389.i, label %if.end378.i
+
+if.end378.i: ; preds = %lor.lhs.false372.i
+ %cmp383.i = icmp ugt i32 %90, %91
+ %inc388.i = add nsw i32 %i.0235.i, 1
+ br i1 %cmp383.i, label %for.end389.i, label %for.cond364.i
+
+for.end389.i: ; preds = %if.end378.i, %lor.lhs.false372.i, %for.body367.i, %for.cond364.i
+ %i.1.i = phi i32 [ %i.0235.i, %if.end378.i ], [ %inc388.i, %for.cond364.i ], [ 2, %lor.lhs.false372.i ], [ 2, %for.body367.i ]
+ %cmp390.i = icmp eq i32 %i.1.i, 2
+ %or.cond225.i = and i1 %cmp390.i, %cmp393.i
+ br i1 %or.cond225.i, label %for.cond451.preheader.i, label %if.end396.i
+
+for.cond451.preheader.i: ; preds = %for.end389.i
+ %and456.i = and i32 %a.3.i, 127
+ %cmp457.i = icmp eq i32 %and456.i, %z.5.ph.i
+ br i1 %cmp457.i, label %if.then459.i, label %if.end464.i
+
+if.end396.i: ; preds = %for.end389.i
+ %add401.i = add nsw i32 %..i, %e2.1.i
+ %cmp403236.i = icmp eq i32 %a.3.i, %z.5.ph.i
+ br i1 %cmp403236.i, label %for.cond360.i, label %for.body405.lr.ph.i
+
+for.body405.lr.ph.i: ; preds = %if.end396.i
+ %shl409.i = shl i32 1, %..i
+ %sub410.i = add nsw i32 %shl409.i, -1
+ %shr416.i = lshr i32 1000000000, %..i
+ br label %for.body405.i
+
+for.body405.i: ; preds = %for.body405.i, %for.body405.lr.ph.i
+ %carry362.0241.i = phi i32 [ 0, %for.body405.lr.ph.i ], [ %mul417.i, %for.body405.i ]
+ %k.6239.i = phi i32 [ %a.3.i, %for.body405.lr.ph.i ], [ %and425.i, %for.body405.i ]
+ %a.4238.i = phi i32 [ %a.3.i, %for.body405.lr.ph.i ], [ %a.5.i, %for.body405.i ]
+ %rp.4237.i = phi i32 [ %rp.3.i.ph, %for.body405.lr.ph.i ], [ %rp.5.i, %for.body405.i ]
+ %arrayidx408.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.6239.i
+ %92 = load i32* %arrayidx408.i, align 4, !tbaa !3
+ %and411.i = and i32 %92, %sub410.i
+ %shr413.i = lshr i32 %92, %..i
+ %add414.i = add i32 %shr413.i, %carry362.0241.i
+ store i32 %add414.i, i32* %arrayidx408.i, align 4, !tbaa !3
+ %mul417.i = mul i32 %and411.i, %shr416.i
+ %cmp418.i = icmp eq i32 %k.6239.i, %a.4238.i
+ %tobool422.i = icmp eq i32 %add414.i, 0
+ %or.cond226.i = and i1 %cmp418.i, %tobool422.i
+ %add424.i = add nsw i32 %k.6239.i, 1
+ %and425.i = and i32 %add424.i, 127
+ %sub427.i = add nsw i32 %rp.4237.i, -9
+ %rp.5.i = select i1 %or.cond226.i, i32 %sub427.i, i32 %rp.4237.i
+ %a.5.i = select i1 %or.cond226.i, i32 %and425.i, i32 %a.4238.i
+ %cmp403.i = icmp eq i32 %and425.i, %z.5.ph.i
+ br i1 %cmp403.i, label %for.end432.i, label %for.body405.i
+
+for.end432.i: ; preds = %for.body405.i
+ %tobool433.i = icmp eq i32 %mul417.i, 0
+ br i1 %tobool433.i, label %for.cond360.i.outer, label %if.then434.i
+
+if.then434.i: ; preds = %for.end432.i
+ %cmp437.i = icmp eq i32 %and436.i, %a.5.i
+ br i1 %cmp437.i, label %if.else443.i, label %if.then439.i
+
+if.then439.i: ; preds = %if.then434.i
+ %arrayidx440.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %z.5.ph.i
+ store i32 %mul417.i, i32* %arrayidx440.i, align 4, !tbaa !3
+ br label %for.cond360.outer.i
+
+for.cond360.outer.i: ; preds = %if.then439.i, %land.rhs.us256.i, %while.cond.outer.while.cond.outer.split_crit_edge.i
+ %rp.3.ph244.i = phi i32 [ %rp.5.i, %if.then439.i ], [ 18, %land.rhs.us256.i ], [ %rp.2.ph247.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ]
+ %e2.1.ph.i = phi i32 [ %add401.i, %if.then439.i ], [ %e2.0.us253.i, %land.rhs.us256.i ], [ %e2.0.ph.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ]
+ %z.5.ph.i = phi i32 [ %and436.i, %if.then439.i ], [ %z.1.us254.i, %land.rhs.us256.i ], [ %z.1.ph248.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ]
+ %a.3.ph.i = phi i32 [ %a.5.i, %if.then439.i ], [ %a.2.ph249.i, %land.rhs.us256.i ], [ %a.2.ph249.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ]
+ %add435.i = add nsw i32 %z.5.ph.i, 1
+ %and436.i = and i32 %add435.i, 127
+ %sub444.i = add nsw i32 %z.5.ph.i, 127
+ %and445.i = and i32 %sub444.i, 127
+ %arrayidx446.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and445.i
+ br label %for.cond360.i.outer
+
+for.cond360.i.outer: ; preds = %if.else443.i, %for.cond360.outer.i, %for.end432.i
+ %rp.3.i.ph = phi i32 [ %rp.3.ph244.i, %for.cond360.outer.i ], [ %rp.5.i, %if.else443.i ], [ %rp.5.i, %for.end432.i ]
+ %e2.1.i.ph = phi i32 [ %e2.1.ph.i, %for.cond360.outer.i ], [ %add401.i, %if.else443.i ], [ %add401.i, %for.end432.i ]
+ %a.3.i.ph = phi i32 [ %a.3.ph.i, %for.cond360.outer.i ], [ %a.5.i, %if.else443.i ], [ %a.5.i, %for.end432.i ]
+ %cmp393.i = icmp eq i32 %rp.3.i.ph, 18
+ %cmp397.i = icmp sgt i32 %rp.3.i.ph, 27
+ %..i = select i1 %cmp397.i, i32 9, i32 1
+ br label %for.cond360.i
+
+if.else443.i: ; preds = %if.then434.i
+ %93 = load i32* %arrayidx446.i, align 4, !tbaa !3
+ %or447.i = or i32 %93, 1
+ store i32 %or447.i, i32* %arrayidx446.i, align 4, !tbaa !3
+ br label %for.cond360.i.outer
+
+if.then459.i: ; preds = %for.cond451.preheader.i
+ %sub462.i = add nsw i32 %and436.i, -1
+ %arrayidx463.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %sub462.i
+ store i32 0, i32* %arrayidx463.i, align 4, !tbaa !3
+ br label %if.end464.i
+
+if.end464.i: ; preds = %if.then459.i, %for.cond451.preheader.i
+ %z.7.i = phi i32 [ %and436.i, %if.then459.i ], [ %z.5.ph.i, %for.cond451.preheader.i ]
+ %arrayidx468.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and456.i
+ %94 = load i32* %arrayidx468.i, align 4, !tbaa !3
+ %conv469.i = uitofp i32 %94 to double
+ %add455.1.i = add nsw i32 %a.3.i, 1
+ %and456.1.i = and i32 %add455.1.i, 127
+ %cmp457.1.i = icmp eq i32 %and456.1.i, %z.7.i
+ br i1 %cmp457.1.i, label %if.then459.1.i, label %if.end464.1.i
+
+if.then480.i: ; preds = %if.end464.1.i
+ %cmp483.i = icmp slt i32 %sub477.i, 0
+ %.sub482.i = select i1 %cmp483.i, i32 0, i32 %sub477.i
+ br label %if.end487.i
+
+if.end487.i: ; preds = %if.end464.1.i, %if.then480.i
+ %denormal.0.i = phi i32 [ 1, %if.then480.i ], [ 0, %if.end464.1.i ]
+ %bits.addr.0.i114 = phi i32 [ %.sub482.i, %if.then480.i ], [ %bits.0.ph, %if.end464.1.i ]
+ %cmp488.i = icmp slt i32 %bits.addr.0.i114, 53
+ br i1 %cmp488.i, label %if.then490.i, label %if.end500.i
+
+if.then490.i: ; preds = %if.end487.i
+ %sub492.i = sub i32 105, %bits.addr.0.i114
+ %call493.i = call double @scalbn(double 1.000000e+00, i32 %sub492.i) #1
+ %call494.i = call double @copysignl(double %call493.i, double %mul475.i) #7
+ %sub495.i = sub nsw i32 53, %bits.addr.0.i114
+ %call496.i = call double @scalbn(double 1.000000e+00, i32 %sub495.i) #1
+ %call497.i = call double @fmodl(double %mul475.i, double %call496.i) #1
+ %sub498.i = fsub double %mul475.i, %call497.i
+ %add499.i = fadd double %call494.i, %sub498.i
+ br label %if.end500.i
+
+if.end500.i: ; preds = %if.then490.i, %if.end487.i
+ %y.1.i115 = phi double [ %add499.i, %if.then490.i ], [ %mul475.i, %if.end487.i ]
+ %frac.0.i = phi double [ %call497.i, %if.then490.i ], [ 0.000000e+00, %if.end487.i ]
+ %bias.0.i = phi double [ %call494.i, %if.then490.i ], [ 0.000000e+00, %if.end487.i ]
+ %add501.i = add nsw i32 %a.3.i, 2
+ %and502.i = and i32 %add501.i, 127
+ %cmp503.i = icmp eq i32 %and502.i, %z.7.1.i
+ br i1 %cmp503.i, label %if.end561.i, label %if.then505.i
+
+if.then505.i: ; preds = %if.end500.i
+ %arrayidx509.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and502.i
+ %95 = load i32* %arrayidx509.i, align 4, !tbaa !3
+ %cmp510.i = icmp ult i32 %95, 500000000
+ br i1 %cmp510.i, label %land.lhs.true512.i, label %if.else524.i
+
+land.lhs.true512.i: ; preds = %if.then505.i
+ %tobool513.i = icmp eq i32 %95, 0
+ br i1 %tobool513.i, label %lor.lhs.false514.i, label %if.then520.i
+
+lor.lhs.false514.i: ; preds = %land.lhs.true512.i
+ %add516.i = add nsw i32 %a.3.i, 3
+ %and517.i = and i32 %add516.i, 127
+ %cmp518.i = icmp eq i32 %and517.i, %z.7.1.i
+ br i1 %cmp518.i, label %if.end551.i, label %if.then520.i
+
+if.then520.i: ; preds = %lor.lhs.false514.i, %land.lhs.true512.i
+ %mul522.i = fmul double %conv474.i, 2.500000e-01
+ %add523.i = fadd double %mul522.i, %frac.0.i
+ br label %if.end551.i
+
+if.else524.i: ; preds = %if.then505.i
+ %cmp525.i = icmp ugt i32 %95, 500000000
+ br i1 %cmp525.i, label %if.then527.i, label %if.then534.i
+
+if.then527.i: ; preds = %if.else524.i
+ %mul529.i = fmul double %conv474.i, 7.500000e-01
+ %add530.i = fadd double %mul529.i, %frac.0.i
+ br label %if.end551.i
+
+if.then534.i: ; preds = %if.else524.i
+ %add536.i = add nsw i32 %a.3.i, 3
+ %and537.i = and i32 %add536.i, 127
+ %cmp538.i = icmp eq i32 %and537.i, %z.7.1.i
+ br i1 %cmp538.i, label %if.then540.i, label %if.else544.i
+
+if.then540.i: ; preds = %if.then534.i
+ %mul542.i = fmul double %conv474.i, 5.000000e-01
+ %add543.i = fadd double %mul542.i, %frac.0.i
+ br label %if.end551.i
+
+if.else544.i: ; preds = %if.then534.i
+ %mul546.i = fmul double %conv474.i, 7.500000e-01
+ %add547.i = fadd double %mul546.i, %frac.0.i
+ br label %if.end551.i
+
+if.end551.i: ; preds = %if.else544.i, %if.then540.i, %if.then527.i, %if.then520.i, %lor.lhs.false514.i
+ %frac.1.i = phi double [ %add523.i, %if.then520.i ], [ %add530.i, %if.then527.i ], [ %add543.i, %if.then540.i ], [ %add547.i, %if.else544.i ], [ %frac.0.i, %lor.lhs.false514.i ]
+ %sub552.i = sub nsw i32 53, %bits.addr.0.i114
+ %cmp553.i = icmp sgt i32 %sub552.i, 1
+ br i1 %cmp553.i, label %land.lhs.true555.i, label %if.end561.i
+
+land.lhs.true555.i: ; preds = %if.end551.i
+ %call556.i = call double @fmodl(double %frac.1.i, double 1.000000e+00) #1
+ %tobool557.i = fcmp une double %call556.i, 0.000000e+00
+ br i1 %tobool557.i, label %if.end561.i, label %if.then558.i
+
+if.then558.i: ; preds = %land.lhs.true555.i
+ %inc559.i = fadd double %frac.1.i, 1.000000e+00
+ br label %if.end561.i
+
+if.end561.i: ; preds = %if.then558.i, %land.lhs.true555.i, %if.end551.i, %if.end500.i
+ %frac.2.i = phi double [ %frac.1.i, %land.lhs.true555.i ], [ %inc559.i, %if.then558.i ], [ %frac.1.i, %if.end551.i ], [ %frac.0.i, %if.end500.i ]
+ %add562.i = fadd double %y.1.i115, %frac.2.i
+ %sub563.i = fsub double %add562.i, %bias.0.i
+ %and565.i = and i32 %add476.i, 2147483647
+ %sub566.i = sub i32 -2, %sum.i
+ %cmp567.i = icmp sgt i32 %and565.i, %sub566.i
+ br i1 %cmp567.i, label %if.then569.i, label %if.end595.i
+
+if.then569.i: ; preds = %if.end561.i
+ %call570.i = call double @fabs(double %sub563.i) #7
+ %cmp571.i = fcmp ult double %call570.i, 0x4340000000000000
+ br i1 %cmp571.i, label %if.end584.i, label %if.then573.i
+
+if.then573.i: ; preds = %if.then569.i
+ %tobool574.i = icmp ne i32 %denormal.0.i, 0
+ %cmp578.i = icmp eq i32 %bits.addr.0.i114, %sub477.i
+ %or.cond227.i = and i1 %tobool574.i, %cmp578.i
+ %denormal.1.i = select i1 %or.cond227.i, i32 0, i32 %denormal.0.i
+ %mul582.i = fmul double %sub563.i, 5.000000e-01
+ %inc583.i = add nsw i32 %e2.1.i, 1
+ br label %if.end584.i
+
+if.end584.i: ; preds = %if.then573.i, %if.then569.i
+ %e2.2.i = phi i32 [ %inc583.i, %if.then573.i ], [ %e2.1.i, %if.then569.i ]
+ %denormal.2.i = phi i32 [ %denormal.1.i, %if.then573.i ], [ %denormal.0.i, %if.then569.i ]
+ %y.2.i116 = phi double [ %mul582.i, %if.then573.i ], [ %sub563.i, %if.then569.i ]
+ %96 = add nsw i32 %e2.2.i, 50
+ %cmp586.i = icmp sgt i32 %96, %sub1.i
+ br i1 %cmp586.i, label %if.then592.i, label %lor.lhs.false588.i
+
+lor.lhs.false588.i: ; preds = %if.end584.i
+ %tobool589.i = icmp ne i32 %denormal.2.i, 0
+ %tobool591.i = fcmp une double %frac.2.i, 0.000000e+00
+ %or.cond228.i = and i1 %tobool589.i, %tobool591.i
+ br i1 %or.cond228.i, label %if.then592.i, label %if.end595.i
+
+if.then592.i: ; preds = %lor.lhs.false588.i, %if.end584.i
+ %call593.i = call i32* @__errno_location() #7
+ store i32 34, i32* %call593.i, align 4, !tbaa !3
+ br label %if.end595.i
+
+if.end595.i: ; preds = %if.then592.i, %lor.lhs.false588.i, %if.end561.i
+ %e2.3.i = phi i32 [ %e2.2.i, %if.then592.i ], [ %e2.2.i, %lor.lhs.false588.i ], [ %e2.1.i, %if.end561.i ]
+ %y.3.i = phi double [ %y.2.i116, %if.then592.i ], [ %y.2.i116, %lor.lhs.false588.i ], [ %sub563.i, %if.end561.i ]
+ %call596.i = call double @scalbnl(double %y.3.i, i32 %e2.3.i) #1
+ br label %return
+
+if.then459.1.i: ; preds = %if.end464.i
+ %add460.1.i = add nsw i32 %z.7.i, 1
+ %and461.1.i = and i32 %add460.1.i, 127
+ %sub462.1.i = add nsw i32 %and461.1.i, -1
+ %arrayidx463.1.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %sub462.1.i
+ store i32 0, i32* %arrayidx463.1.i, align 4, !tbaa !3
+ br label %if.end464.1.i
+
+if.end464.1.i: ; preds = %if.then459.1.i, %if.end464.i
+ %z.7.1.i = phi i32 [ %and461.1.i, %if.then459.1.i ], [ %z.7.i, %if.end464.i ]
+ %mul465.1.i = fmul double %conv469.i, 1.000000e+09
+ %arrayidx468.1.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and456.1.i
+ %97 = load i32* %arrayidx468.1.i, align 4, !tbaa !3
+ %conv469.1.i = uitofp i32 %97 to double
+ %add470.1.i = fadd double %mul465.1.i, %conv469.1.i
+ %conv474.i = sitofp i32 %sign.0 to double
+ %mul475.i = fmul double %conv474.i, %add470.1.i
+ %add476.i = add nsw i32 %e2.1.i, 53
+ %sub477.i = sub nsw i32 %add476.i, %emin.0.ph
+ %cmp478.i = icmp slt i32 %sub477.i, %bits.0.ph
+ br i1 %cmp478.i, label %if.then480.i, label %if.end487.i
+
+return: ; preds = %if.end595.i, %if.then233.i, %if.then213.i, %if.then205.i, %if.then174.i, %if.then164.i, %if.then154.i106, %if.then139.i, %if.then134.i, %if.else116.i, %if.end264.i, %if.then196.i, %if.then186.i, %if.then178.i, %if.else162.i, %if.end134.i, %cond.end214, %while.cond191.backedge, %if.then188, %while.cond191.preheader, %if.end175, %cond.true141, %if.then138, %if.end83, %entry
+ %retval.0 = phi double [ %conv86, %if.end83 ], [ 0.000000e+00, %if.then188 ], [ 0.000000e+00, %cond.end214 ], [ 0.000000e+00, %entry ], [ 0x7FF8000000000000, %if.then138 ], [ 0x7FF8000000000000, %cond.true141 ], [ 0x7FF8000000000000, %if.end175 ], [ %mul190.i, %if.then186.i ], [ %mul200.i, %if.then196.i ], [ %call266.i, %if.end264.i ], [ %mul180.i, %if.then178.i ], [ 0.000000e+00, %if.else162.i ], [ %mul136.i, %if.end134.i ], [ %mul158.i, %if.then154.i106 ], [ %mul168.i, %if.then164.i ], [ %mul178.i, %if.then174.i ], [ %mul209.i, %if.then205.i ], [ %div221.i, %if.then213.i ], [ %mul241.i, %if.then233.i ], [ %call596.i, %if.end595.i ], [ %mul141.i, %if.then139.i ], [ 0.000000e+00, %if.then134.i ], [ 0.000000e+00, %if.else116.i ], [ 0x7FF8000000000000, %while.cond191.backedge ], [ 0x7FF8000000000000, %while.cond191.preheader ]
+ ret double %retval.0
+}
+
+declare i32 @isspace(i32) #5
+
+; Function Attrs: nounwind
+declare void @llvm.lifetime.start(i64, i8* nocapture) #1
+
+; Function Attrs: nounwind
+define internal fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #0 {
+entry:
+ %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1
+ %0 = load i8** %rpos, align 4, !tbaa !0
+ %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ %1 = load i8** %shend, align 4, !tbaa !0
+ %cmp = icmp ult i8* %0, %1
+ br i1 %cmp, label %cond.true, label %cond.false
+
+cond.true: ; preds = %entry
+ %incdec.ptr = getelementptr inbounds i8* %0, i32 1
+ store i8* %incdec.ptr, i8** %rpos, align 4, !tbaa !0
+ %2 = load i8* %0, align 1, !tbaa !1
+ %conv = zext i8 %2 to i32
+ br label %cond.end
+
+cond.false: ; preds = %entry
+ %call = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end
+
+cond.end: ; preds = %cond.false, %cond.true
+ %cond = phi i32 [ %conv, %cond.true ], [ %call, %cond.false ]
+ %cmp4 = icmp eq i32 %cond, 45
+ switch i32 %cond, label %if.end30 [
+ i32 45, label %if.then
+ i32 43, label %if.then
+ ]
+
+if.then: ; preds = %cond.end, %cond.end
+ %conv7 = zext i1 %cmp4 to i32
+ %3 = load i8** %rpos, align 4, !tbaa !0
+ %4 = load i8** %shend, align 4, !tbaa !0
+ %cmp10 = icmp ult i8* %3, %4
+ br i1 %cmp10, label %cond.true12, label %cond.false16
+
+cond.true12: ; preds = %if.then
+ %incdec.ptr14 = getelementptr inbounds i8* %3, i32 1
+ store i8* %incdec.ptr14, i8** %rpos, align 4, !tbaa !0
+ %5 = load i8* %3, align 1, !tbaa !1
+ %conv15 = zext i8 %5 to i32
+ br label %cond.end18
+
+cond.false16: ; preds = %if.then
+ %call17 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %cond.end18
+
+cond.end18: ; preds = %cond.false16, %cond.true12
+ %cond19 = phi i32 [ %conv15, %cond.true12 ], [ %call17, %cond.false16 ]
+ %sub = add nsw i32 %cond19, -48
+ %cmp20 = icmp ult i32 %sub, 10
+ %tobool = icmp eq i32 %pok, 0
+ %or.cond = or i1 %cmp20, %tobool
+ br i1 %or.cond, label %if.end30, label %if.then22
+
+if.then22: ; preds = %cond.end18
+ %6 = load i8** %shend, align 4, !tbaa !0
+ %tobool24 = icmp eq i8* %6, null
+ br i1 %tobool24, label %if.end30, label %cond.true25
+
+cond.true25: ; preds = %if.then22
+ %7 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr27 = getelementptr inbounds i8* %7, i32 -1
+ store i8* %incdec.ptr27, i8** %rpos, align 4, !tbaa !0
+ br label %if.end30
+
+if.end30: ; preds = %cond.true25, %if.then22, %cond.end18, %cond.end
+ %c.0 = phi i32 [ %cond19, %cond.true25 ], [ %cond19, %if.then22 ], [ %cond19, %cond.end18 ], [ %cond, %cond.end ]
+ %neg.0 = phi i32 [ %conv7, %cond.true25 ], [ %conv7, %if.then22 ], [ %conv7, %cond.end18 ], [ 0, %cond.end ]
+ %sub31 = add nsw i32 %c.0, -48
+ %cmp32 = icmp ugt i32 %sub31, 9
+ br i1 %cmp32, label %if.then34, label %for.body
+
+if.then34: ; preds = %if.end30
+ %8 = load i8** %shend, align 4, !tbaa !0
+ %tobool36 = icmp eq i8* %8, null
+ br i1 %tobool36, label %return, label %cond.true37
+
+cond.true37: ; preds = %if.then34
+ %9 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr39 = getelementptr inbounds i8* %9, i32 -1
+ store i8* %incdec.ptr39, i8** %rpos, align 4, !tbaa !0
+ br label %return
+
+for.body: ; preds = %for.cond.backedge.for.body_crit_edge, %if.end30
+ %x.043 = phi i32 [ %phitmp47, %for.cond.backedge.for.body_crit_edge ], [ 0, %if.end30 ]
+ %c.142 = phi i32 [ %c.1.be, %for.cond.backedge.for.body_crit_edge ], [ %c.0, %if.end30 ]
+ %add = add i32 %c.142, -48
+ %sub48 = add i32 %add, %x.043
+ %10 = load i8** %rpos, align 4, !tbaa !0
+ %11 = load i8** %shend, align 4, !tbaa !0
+ %cmp51 = icmp ult i8* %10, %11
+ br i1 %cmp51, label %cond.true53, label %cond.false57
+
+cond.true53: ; preds = %for.body
+ %incdec.ptr55 = getelementptr inbounds i8* %10, i32 1
+ store i8* %incdec.ptr55, i8** %rpos, align 4, !tbaa !0
+ %12 = load i8* %10, align 1, !tbaa !1
+ %conv56 = zext i8 %12 to i32
+ br label %for.cond.backedge
+
+cond.false57: ; preds = %for.body
+ %call58 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond.backedge
+
+for.cond.backedge: ; preds = %cond.false57, %cond.true53
+ %c.1.be = phi i32 [ %conv56, %cond.true53 ], [ %call58, %cond.false57 ]
+ %sub43 = add nsw i32 %c.1.be, -48
+ %cmp44 = icmp ult i32 %sub43, 10
+ %cmp46 = icmp slt i32 %sub48, 214748364
+ %cmp46. = and i1 %cmp44, %cmp46
+ br i1 %cmp46., label %for.cond.backedge.for.body_crit_edge, label %for.end
+
+for.cond.backedge.for.body_crit_edge: ; preds = %for.cond.backedge
+ %phitmp47 = mul i32 %sub48, 10
+ br label %for.body
+
+for.end: ; preds = %for.cond.backedge
+ %phitmp = sext i32 %sub48 to i64
+ %sub6335 = add nsw i32 %c.1.be, -48
+ %cmp6436 = icmp ult i32 %sub6335, 10
+ br i1 %cmp6436, label %for.body70, label %for.cond89.preheader
+
+for.cond89.preheader: ; preds = %for.cond62.backedge, %for.end
+ %y.0.lcssa = phi i64 [ %phitmp, %for.end ], [ %sub74, %for.cond62.backedge ]
+ %c.2.lcssa = phi i32 [ %c.1.be, %for.end ], [ %c.2.be, %for.cond62.backedge ]
+ %sub9033 = add nsw i32 %c.2.lcssa, -48
+ %cmp9134 = icmp ult i32 %sub9033, 10
+ br i1 %cmp9134, label %for.inc94, label %for.end107
+
+for.body70: ; preds = %for.cond62.backedge, %for.end
+ %y.038 = phi i64 [ %phitmp, %for.end ], [ %sub74, %for.cond62.backedge ]
+ %c.237 = phi i32 [ %c.1.be, %for.end ], [ %c.2.be, %for.cond62.backedge ]
+ %mul71 = mul nsw i64 %y.038, 10
+ %conv72 = sext i32 %c.237 to i64
+ %add73 = add i64 %conv72, -48
+ %sub74 = add i64 %add73, %mul71
+ %13 = load i8** %rpos, align 4, !tbaa !0
+ %14 = load i8** %shend, align 4, !tbaa !0
+ %cmp78 = icmp ult i8* %13, %14
+ br i1 %cmp78, label %cond.true80, label %cond.false84
+
+cond.true80: ; preds = %for.body70
+ %incdec.ptr82 = getelementptr inbounds i8* %13, i32 1
+ store i8* %incdec.ptr82, i8** %rpos, align 4, !tbaa !0
+ %15 = load i8* %13, align 1, !tbaa !1
+ %conv83 = zext i8 %15 to i32
+ br label %for.cond62.backedge
+
+cond.false84: ; preds = %for.body70
+ %call85 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond62.backedge
+
+for.cond62.backedge: ; preds = %cond.false84, %cond.true80
+ %c.2.be = phi i32 [ %conv83, %cond.true80 ], [ %call85, %cond.false84 ]
+ %sub63 = add nsw i32 %c.2.be, -48
+ %cmp64 = icmp ult i32 %sub63, 10
+ %cmp67 = icmp slt i64 %sub74, 92233720368547758
+ %or.cond32 = and i1 %cmp64, %cmp67
+ br i1 %or.cond32, label %for.body70, label %for.cond89.preheader
+
+for.inc94: ; preds = %for.cond89.backedge, %for.cond89.preheader
+ %16 = load i8** %rpos, align 4, !tbaa !0
+ %17 = load i8** %shend, align 4, !tbaa !0
+ %cmp97 = icmp ult i8* %16, %17
+ br i1 %cmp97, label %cond.true99, label %cond.false103
+
+cond.true99: ; preds = %for.inc94
+ %incdec.ptr101 = getelementptr inbounds i8* %16, i32 1
+ store i8* %incdec.ptr101, i8** %rpos, align 4, !tbaa !0
+ %18 = load i8* %16, align 1, !tbaa !1
+ %conv102 = zext i8 %18 to i32
+ br label %for.cond89.backedge
+
+cond.false103: ; preds = %for.inc94
+ %call104 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1
+ br label %for.cond89.backedge
+
+for.cond89.backedge: ; preds = %cond.false103, %cond.true99
+ %c.3.be = phi i32 [ %conv102, %cond.true99 ], [ %call104, %cond.false103 ]
+ %sub90 = add nsw i32 %c.3.be, -48
+ %cmp91 = icmp ult i32 %sub90, 10
+ br i1 %cmp91, label %for.inc94, label %for.end107
+
+for.end107: ; preds = %for.cond89.backedge, %for.cond89.preheader
+ %19 = load i8** %shend, align 4, !tbaa !0
+ %tobool109 = icmp eq i8* %19, null
+ br i1 %tobool109, label %cond.end114, label %cond.true110
+
+cond.true110: ; preds = %for.end107
+ %20 = load i8** %rpos, align 4, !tbaa !0
+ %incdec.ptr112 = getelementptr inbounds i8* %20, i32 -1
+ store i8* %incdec.ptr112, i8** %rpos, align 4, !tbaa !0
+ br label %cond.end114
+
+cond.end114: ; preds = %cond.true110, %for.end107
+ %tobool115 = icmp ne i32 %neg.0, 0
+ %sub117 = sub nsw i64 0, %y.0.lcssa
+ %cond120 = select i1 %tobool115, i64 %sub117, i64 %y.0.lcssa
+ br label %return
+
+return: ; preds = %cond.end114, %cond.true37, %if.then34
+ %retval.0 = phi i64 [ %cond120, %cond.end114 ], [ -9223372036854775808, %if.then34 ], [ -9223372036854775808, %cond.true37 ]
+ ret i64 %retval.0
+}
+
+; Function Attrs: nounwind readnone
+declare double @copysignl(double, double) #3
+
+declare double @fmodl(double, double) #5
+
+; Function Attrs: nounwind readnone
+declare double @fabs(double) #3
+
+; Function Attrs: nounwind
+define void @__shlim(%struct._IO_FILE* nocapture %f, i32 %lim) #0 {
+entry:
+ %shlim = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 28
+ store i32 %lim, i32* %shlim, align 4, !tbaa !3
+ %rend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 2
+ %0 = load i8** %rend, align 4, !tbaa !0
+ %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1
+ %1 = load i8** %rpos, align 4, !tbaa !0
+ %sub.ptr.lhs.cast = ptrtoint i8* %0 to i32
+ %sub.ptr.rhs.cast = ptrtoint i8* %1 to i32
+ %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
+ %shcnt = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29
+ store i32 %sub.ptr.sub, i32* %shcnt, align 4, !tbaa !3
+ %tobool = icmp ne i32 %lim, 0
+ %cmp = icmp sgt i32 %sub.ptr.sub, %lim
+ %or.cond = and i1 %tobool, %cmp
+ br i1 %or.cond, label %if.then, label %if.else
+
+if.then: ; preds = %entry
+ %add.ptr = getelementptr inbounds i8* %1, i32 %lim
+ %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ store i8* %add.ptr, i8** %shend, align 4, !tbaa !0
+ br label %if.end
+
+if.else: ; preds = %entry
+ %shend4 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ store i8* %0, i8** %shend4, align 4, !tbaa !0
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ ret void
+}
+
+; Function Attrs: nounwind
+define i32 @__shgetc(%struct._IO_FILE* %f) #0 {
+entry:
+ %shlim = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 28
+ %0 = load i32* %shlim, align 4, !tbaa !3
+ %tobool = icmp eq i32 %0, 0
+ br i1 %tobool, label %lor.lhs.false, label %land.lhs.true
+
+land.lhs.true: ; preds = %entry
+ %shcnt = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29
+ %1 = load i32* %shcnt, align 4, !tbaa !3
+ %cmp = icmp slt i32 %1, %0
+ br i1 %cmp, label %lor.lhs.false, label %if.then
+
+lor.lhs.false: ; preds = %land.lhs.true, %entry
+ %call = tail call i32 bitcast (i32 (%struct._IO_FILE.3*)* @__uflow to i32 (%struct._IO_FILE*)*)(%struct._IO_FILE* %f) #1
+ %cmp2 = icmp slt i32 %call, 0
+ br i1 %cmp2, label %if.then, label %if.end
+
+if.then: ; preds = %lor.lhs.false, %land.lhs.true
+ %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ store i8* null, i8** %shend, align 4, !tbaa !0
+ br label %return
+
+if.end: ; preds = %lor.lhs.false
+ %2 = load i32* %shlim, align 4, !tbaa !3
+ %tobool4 = icmp eq i32 %2, 0
+ %rend17.phi.trans.insert = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 2
+ %.pre = load i8** %rend17.phi.trans.insert, align 4, !tbaa !0
+ br i1 %tobool4, label %if.else, label %land.lhs.true5
+
+land.lhs.true5: ; preds = %if.end
+ %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1
+ %3 = load i8** %rpos, align 4, !tbaa !0
+ %sub.ptr.lhs.cast = ptrtoint i8* %.pre to i32
+ %sub.ptr.rhs.cast = ptrtoint i8* %3 to i32
+ %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast
+ %shcnt7 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29
+ %4 = load i32* %shcnt7, align 4, !tbaa !3
+ %sub = sub nsw i32 %2, %4
+ %sub8 = add nsw i32 %sub, -1
+ %cmp9 = icmp sgt i32 %sub.ptr.sub, %sub8
+ br i1 %cmp9, label %if.then10, label %if.else
+
+if.then10: ; preds = %land.lhs.true5
+ %add.ptr = getelementptr inbounds i8* %3, i32 %sub8
+ %shend16 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ store i8* %add.ptr, i8** %shend16, align 4, !tbaa !0
+ br label %if.end19
+
+if.else: ; preds = %land.lhs.true5, %if.end
+ %shend18 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27
+ store i8* %.pre, i8** %shend18, align 4, !tbaa !0
+ br label %if.end19
+
+if.end19: ; preds = %if.else, %if.then10
+ %tobool21 = icmp eq i8* %.pre, null
+ %rpos31.phi.trans.insert = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1
+ %.pre24 = load i8** %rpos31.phi.trans.insert, align 4, !tbaa !0
+ br i1 %tobool21, label %if.end30, label %if.then22
+
+if.then22: ; preds = %if.end19
+ %sub.ptr.lhs.cast25 = ptrtoint i8* %.pre to i32
+ %sub.ptr.rhs.cast26 = ptrtoint i8* %.pre24 to i32
+ %shcnt28 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29
+ %5 = load i32* %shcnt28, align 4, !tbaa !3
+ %sub.ptr.sub27 = add i32 %sub.ptr.lhs.cast25, 1
+ %add = sub i32 %sub.ptr.sub27, %sub.ptr.rhs.cast26
+ %add29 = add i32 %add, %5
+ store i32 %add29, i32* %shcnt28, align 4, !tbaa !3
+ br label %if.end30
+
+if.end30: ; preds = %if.then22, %if.end19
+ %arrayidx = getelementptr inbounds i8* %.pre24, i32 -1
+ %6 = load i8* %arrayidx, align 1, !tbaa !1
+ %conv = zext i8 %6 to i32
+ %cmp32 = icmp eq i32 %conv, %call
+ br i1 %cmp32, label %return, label %if.then34
+
+if.then34: ; preds = %if.end30
+ %conv35 = trunc i32 %call to i8
+ store i8 %conv35, i8* %arrayidx, align 1, !tbaa !1
+ br label %return
+
+return: ; preds = %if.then34, %if.end30, %if.then
+ %retval.0 = phi i32 [ -1, %if.then ], [ %call, %if.end30 ], [ %call, %if.then34 ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind readnone
+define double @scalbn(double %x, i32 %n) #3 {
+entry:
+ %cmp = icmp sgt i32 %n, 1023
+ br i1 %cmp, label %if.then, label %if.else
+
+if.then: ; preds = %entry
+ %mul = fmul double %x, 0x7FE0000000000000
+ %sub = add nsw i32 %n, -1023
+ %cmp1 = icmp sgt i32 %sub, 1023
+ br i1 %cmp1, label %if.then2, label %if.end20
+
+if.then2: ; preds = %if.then
+ %mul3 = fmul double %mul, 0x7FE0000000000000
+ %sub4 = add nsw i32 %n, -2046
+ %cmp5 = icmp sgt i32 %sub4, 1023
+ %.sub4 = select i1 %cmp5, i32 1023, i32 %sub4
+ br label %if.end20
+
+if.else: ; preds = %entry
+ %cmp8 = icmp slt i32 %n, -1022
+ br i1 %cmp8, label %if.then9, label %if.end20
+
+if.then9: ; preds = %if.else
+ %mul10 = fmul double %x, 0x10000000000000
+ %add = add nsw i32 %n, 1022
+ %cmp11 = icmp slt i32 %add, -1022
+ br i1 %cmp11, label %if.then12, label %if.end20
+
+if.then12: ; preds = %if.then9
+ %mul13 = fmul double %mul10, 0x10000000000000
+ %add14 = add nsw i32 %n, 2044
+ %cmp15 = icmp slt i32 %add14, -1022
+ %.add14 = select i1 %cmp15, i32 -1022, i32 %add14
+ br label %if.end20
+
+if.end20: ; preds = %if.then12, %if.then9, %if.else, %if.then2, %if.then
+ %n.addr.0 = phi i32 [ %.sub4, %if.then2 ], [ %sub, %if.then ], [ %.add14, %if.then12 ], [ %add, %if.then9 ], [ %n, %if.else ]
+ %y.0 = phi double [ %mul3, %if.then2 ], [ %mul, %if.then ], [ %mul13, %if.then12 ], [ %mul10, %if.then9 ], [ %x, %if.else ]
+ %add21 = add nsw i32 %n.addr.0, 1023
+ %conv16 = zext i32 %add21 to i64
+ %shl = shl i64 %conv16, 52
+ %0 = bitcast i64 %shl to double
+ %mul22 = fmul double %y.0, %0
+ ret double %mul22
+}
+
+; Function Attrs: nounwind
+define double @scalbnl(double %x, i32 %n) #0 {
+entry:
+ %call = tail call double @scalbn(double %x, i32 %n) #1
+ ret double %call
+}
+
+; Function Attrs: nounwind
+define i32 @__overflow(%struct._IO_FILE* %f, i32 %_c) #0 {
+entry:
+ %c = alloca i8, align 1
+ %conv = trunc i32 %_c to i8
+ store i8 %conv, i8* %c, align 1, !tbaa !1
+ %wend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 4
+ %0 = load i8** %wend, align 4, !tbaa !0
+ %tobool = icmp eq i8* %0, null
+ br i1 %tobool, label %land.lhs.true, label %if.end
+
+land.lhs.true: ; preds = %entry
+ %call = call i32 bitcast (i32 (%struct._IO_FILE.4*)* @__towrite to i32 (%struct._IO_FILE*)*)(%struct._IO_FILE* %f) #1
+ %tobool1 = icmp eq i32 %call, 0
+ br i1 %tobool1, label %land.lhs.true.if.end_crit_edge, label %return
+
+land.lhs.true.if.end_crit_edge: ; preds = %land.lhs.true
+ %.pre = load i8** %wend, align 4, !tbaa !0
+ br label %if.end
+
+if.end: ; preds = %land.lhs.true.if.end_crit_edge, %entry
+ %1 = phi i8* [ %.pre, %land.lhs.true.if.end_crit_edge ], [ %0, %entry ]
+ %wpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 5
+ %2 = load i8** %wpos, align 4, !tbaa !0
+ %cmp = icmp ult i8* %2, %1
+ br i1 %cmp, label %land.lhs.true4, label %if.end12
+
+land.lhs.true4: ; preds = %if.end
+ %3 = load i8* %c, align 1, !tbaa !1
+ %conv5 = zext i8 %3 to i32
+ %lbf = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 20
+ %4 = load i8* %lbf, align 1, !tbaa !1
+ %conv6 = sext i8 %4 to i32
+ %cmp7 = icmp eq i32 %conv5, %conv6
+ br i1 %cmp7, label %if.end12, label %if.then9
+
+if.then9: ; preds = %land.lhs.true4
+ %incdec.ptr = getelementptr inbounds i8* %2, i32 1
+ store i8* %incdec.ptr, i8** %wpos, align 4, !tbaa !0
+ store i8 %3, i8* %2, align 1, !tbaa !1
+ br label %return
+
+if.end12: ; preds = %land.lhs.true4, %if.end
+ %write = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 9
+ %5 = load i32 (%struct._IO_FILE*, i8*, i32)** %write, align 4, !tbaa !0
+ %call13 = call i32 %5(%struct._IO_FILE* %f, i8* %c, i32 1) #1
+ %cmp14 = icmp eq i32 %call13, 1
+ br i1 %cmp14, label %if.end17, label %return
+
+if.end17: ; preds = %if.end12
+ %6 = load i8* %c, align 1, !tbaa !1
+ %conv18 = zext i8 %6 to i32
+ br label %return
+
+return: ; preds = %if.end17, %if.end12, %if.then9, %land.lhs.true
+ %retval.0 = phi i32 [ %conv5, %if.then9 ], [ %conv18, %if.end17 ], [ -1, %land.lhs.true ], [ -1, %if.end12 ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+define i32 @__toread(%struct._IO_FILE.3* %f) #0 {
+entry:
+ %mode = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 19
+ %0 = load i8* %mode, align 1, !tbaa !1
+ %conv = sext i8 %0 to i32
+ %sub = add nsw i32 %conv, 255
+ %or = or i32 %sub, %conv
+ %conv3 = trunc i32 %or to i8
+ store i8 %conv3, i8* %mode, align 1, !tbaa !1
+ %wpos = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 5
+ %1 = load i8** %wpos, align 4, !tbaa !0
+ %buf = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 11
+ %2 = load i8** %buf, align 4, !tbaa !0
+ %cmp = icmp ugt i8* %1, %2
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ %write = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 9
+ %3 = load i32 (%struct._IO_FILE.3*, i8*, i32)** %write, align 4, !tbaa !0
+ %call = tail call i32 %3(%struct._IO_FILE.3* %f, i8* null, i32 0) #1
+ br label %if.end
+
+if.end: ; preds = %if.then, %entry
+ %wend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 4
+ store i8* null, i8** %wend, align 4, !tbaa !0
+ %wbase = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 7
+ store i8* null, i8** %wbase, align 4, !tbaa !0
+ store i8* null, i8** %wpos, align 4, !tbaa !0
+ %flags = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 0
+ %4 = load i32* %flags, align 4, !tbaa !3
+ %and = and i32 %4, 20
+ %tobool = icmp eq i32 %and, 0
+ br i1 %tobool, label %if.end14, label %if.then6
+
+if.then6: ; preds = %if.end
+ %and8 = and i32 %4, 4
+ %tobool9 = icmp eq i32 %and8, 0
+ br i1 %tobool9, label %return, label %if.then10
+
+if.then10: ; preds = %if.then6
+ %or12 = or i32 %4, 32
+ store i32 %or12, i32* %flags, align 4, !tbaa !3
+ br label %return
+
+if.end14: ; preds = %if.end
+ %5 = load i8** %buf, align 4, !tbaa !0
+ %rend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 2
+ store i8* %5, i8** %rend, align 4, !tbaa !0
+ %rpos = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 1
+ store i8* %5, i8** %rpos, align 4, !tbaa !0
+ br label %return
+
+return: ; preds = %if.end14, %if.then10, %if.then6
+ %retval.0 = phi i32 [ 0, %if.end14 ], [ -1, %if.then6 ], [ -1, %if.then10 ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+define i32 @__towrite(%struct._IO_FILE.4* nocapture %f) #0 {
+entry:
+ %mode = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 19
+ %0 = load i8* %mode, align 1, !tbaa !1
+ %conv = sext i8 %0 to i32
+ %sub = add nsw i32 %conv, 255
+ %or = or i32 %sub, %conv
+ %conv3 = trunc i32 %or to i8
+ store i8 %conv3, i8* %mode, align 1, !tbaa !1
+ %flags = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 0
+ %1 = load i32* %flags, align 4, !tbaa !3
+ %and = and i32 %1, 8
+ %tobool = icmp eq i32 %and, 0
+ br i1 %tobool, label %if.end, label %if.then
+
+if.then: ; preds = %entry
+ %or5 = or i32 %1, 32
+ store i32 %or5, i32* %flags, align 4, !tbaa !3
+ br label %return
+
+if.end: ; preds = %entry
+ %rend = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 2
+ store i8* null, i8** %rend, align 4, !tbaa !0
+ %rpos = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 1
+ store i8* null, i8** %rpos, align 4, !tbaa !0
+ %buf = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 11
+ %2 = load i8** %buf, align 4, !tbaa !0
+ %wbase = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 7
+ store i8* %2, i8** %wbase, align 4, !tbaa !0
+ %wpos = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 5
+ store i8* %2, i8** %wpos, align 4, !tbaa !0
+ %buf_size = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 12
+ %3 = load i32* %buf_size, align 4, !tbaa !3
+ %add.ptr = getelementptr inbounds i8* %2, i32 %3
+ %wend = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 4
+ store i8* %add.ptr, i8** %wend, align 4, !tbaa !0
+ br label %return
+
+return: ; preds = %if.end, %if.then
+ %retval.0 = phi i32 [ -1, %if.then ], [ 0, %if.end ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+define i32 @__uflow(%struct._IO_FILE.3* %f) #0 {
+entry:
+ %c = alloca i8, align 1
+ %rend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 2
+ %0 = load i8** %rend, align 4, !tbaa !0
+ %tobool = icmp eq i8* %0, null
+ br i1 %tobool, label %lor.lhs.false, label %land.lhs.true
+
+lor.lhs.false: ; preds = %entry
+ %call = call i32 @__toread(%struct._IO_FILE.3* %f) #1
+ %tobool1 = icmp eq i32 %call, 0
+ br i1 %tobool1, label %land.lhs.true, label %return
+
+land.lhs.true: ; preds = %lor.lhs.false, %entry
+ %read = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 8
+ %1 = load i32 (%struct._IO_FILE.3*, i8*, i32)** %read, align 4, !tbaa !0
+ %call2 = call i32 %1(%struct._IO_FILE.3* %f, i8* %c, i32 1) #1
+ %cmp = icmp eq i32 %call2, 1
+ br i1 %cmp, label %if.then, label %return
+
+if.then: ; preds = %land.lhs.true
+ %2 = load i8* %c, align 1, !tbaa !1
+ %conv = zext i8 %2 to i32
+ br label %return
+
+return: ; preds = %if.then, %land.lhs.true, %lor.lhs.false
+ %retval.0 = phi i32 [ %conv, %if.then ], [ -1, %lor.lhs.false ], [ -1, %land.lhs.true ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind
+define double @atof(i8* %s) #0 {
+entry:
+ %call = tail call double @strtod(i8* %s, i8** null) #1
+ ret double %call
+}
+
+; Function Attrs: nounwind
+define float @strtof(i8* noalias %s, i8** noalias %p) #0 {
+entry:
+ %f.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i, align 4, !tbaa !0
+ %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0
+ %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i, align 4, !tbaa !0
+ %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1
+ %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 0, i32 1) #1
+ %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i
+ %add.i = add nsw i32 %sub.ptr.sub.i, %1
+ %tobool.i = icmp eq i8** %p, null
+ br i1 %tobool.i, label %strtox.exit, label %if.then.i
+
+if.then.i: ; preds = %entry
+ %tobool3.i = icmp eq i32 %add.i, 0
+ br i1 %tobool3.i, label %cond.end.i, label %cond.true.i
+
+cond.true.i: ; preds = %if.then.i
+ %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i
+ br label %cond.end.i
+
+cond.end.i: ; preds = %cond.true.i, %if.then.i
+ %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ]
+ store i8* %cond.i, i8** %p, align 4, !tbaa !0
+ br label %strtox.exit
+
+strtox.exit: ; preds = %cond.end.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ %conv = fptrunc double %call.i to float
+ ret float %conv
+}
+
+; Function Attrs: nounwind
+define double @strtod(i8* noalias %s, i8** noalias %p) #0 {
+entry:
+ %f.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i, align 4, !tbaa !0
+ %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0
+ %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i, align 4, !tbaa !0
+ %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1
+ %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 1, i32 1) #1
+ %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i
+ %add.i = add nsw i32 %sub.ptr.sub.i, %1
+ %tobool.i = icmp eq i8** %p, null
+ br i1 %tobool.i, label %strtox.exit, label %if.then.i
+
+if.then.i: ; preds = %entry
+ %tobool3.i = icmp eq i32 %add.i, 0
+ br i1 %tobool3.i, label %cond.end.i, label %cond.true.i
+
+cond.true.i: ; preds = %if.then.i
+ %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i
+ br label %cond.end.i
+
+cond.end.i: ; preds = %cond.true.i, %if.then.i
+ %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ]
+ store i8* %cond.i, i8** %p, align 4, !tbaa !0
+ br label %strtox.exit
+
+strtox.exit: ; preds = %cond.end.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ ret double %call.i
+}
+
+; Function Attrs: nounwind
+define double @strtold(i8* noalias %s, i8** noalias %p) #0 {
+entry:
+ %f.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i, align 4, !tbaa !0
+ %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0
+ %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i, align 4, !tbaa !0
+ %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1
+ %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 2, i32 1) #1
+ %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i
+ %add.i = add nsw i32 %sub.ptr.sub.i, %1
+ %tobool.i = icmp eq i8** %p, null
+ br i1 %tobool.i, label %strtox.exit, label %if.then.i
+
+if.then.i: ; preds = %entry
+ %tobool3.i = icmp eq i32 %add.i, 0
+ br i1 %tobool3.i, label %cond.end.i, label %cond.true.i
+
+cond.true.i: ; preds = %if.then.i
+ %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i
+ br label %cond.end.i
+
+cond.end.i: ; preds = %cond.true.i, %if.then.i
+ %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ]
+ store i8* %cond.i, i8** %p, align 4, !tbaa !0
+ br label %strtox.exit
+
+strtox.exit: ; preds = %cond.end.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ ret double %call.i
+}
+
+; Function Attrs: nounwind
+define float @strtof_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct* nocapture %loc) #0 {
+entry:
+ %f.i.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0
+ %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0
+ %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i.i, align 4, !tbaa !0
+ %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1
+ %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 0, i32 1) #1
+ %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i
+ %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1
+ %tobool.i.i = icmp eq i8** %p, null
+ br i1 %tobool.i.i, label %strtof.exit, label %if.then.i.i
+
+if.then.i.i: ; preds = %entry
+ %tobool3.i.i = icmp eq i32 %add.i.i, 0
+ br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i
+
+cond.true.i.i: ; preds = %if.then.i.i
+ %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i
+ br label %cond.end.i.i
+
+cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i
+ %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ]
+ store i8* %cond.i.i, i8** %p, align 4, !tbaa !0
+ br label %strtof.exit
+
+strtof.exit: ; preds = %cond.end.i.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ %conv.i = fptrunc double %call.i.i to float
+ ret float %conv.i
+}
+
+; Function Attrs: nounwind
+define double @strtod_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct.0* nocapture %loc) #0 {
+entry:
+ %f.i.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0
+ %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0
+ %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i.i, align 4, !tbaa !0
+ %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1
+ %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 1, i32 1) #1
+ %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i
+ %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1
+ %tobool.i.i = icmp eq i8** %p, null
+ br i1 %tobool.i.i, label %strtod.exit, label %if.then.i.i
+
+if.then.i.i: ; preds = %entry
+ %tobool3.i.i = icmp eq i32 %add.i.i, 0
+ br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i
+
+cond.true.i.i: ; preds = %if.then.i.i
+ %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i
+ br label %cond.end.i.i
+
+cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i
+ %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ]
+ store i8* %cond.i.i, i8** %p, align 4, !tbaa !0
+ br label %strtod.exit
+
+strtod.exit: ; preds = %cond.end.i.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ ret double %call.i.i
+}
+
+; Function Attrs: nounwind
+define double @strtold_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct.1* nocapture %loc) #0 {
+entry:
+ %f.i.i = alloca %struct._IO_FILE, align 4
+ %0 = bitcast %struct._IO_FILE* %f.i.i to i8*
+ call void @llvm.lifetime.start(i64 112, i8* %0) #1
+ call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1
+ %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1
+ store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0
+ %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2
+ store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0
+ %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11
+ store i8* %s, i8** %buf.i.i, align 4, !tbaa !0
+ %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21
+ store i32 -1, i32* %lock.i.i, align 4, !tbaa !3
+ call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1
+ %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 2, i32 1) #1
+ %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29
+ %1 = load i32* %shcnt.i.i, align 4, !tbaa !3
+ %2 = load i8** %rpos.i.i, align 4, !tbaa !0
+ %3 = load i8** %rend.i.i, align 4, !tbaa !0
+ %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32
+ %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32
+ %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i
+ %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1
+ %tobool.i.i = icmp eq i8** %p, null
+ br i1 %tobool.i.i, label %strtold.exit, label %if.then.i.i
+
+if.then.i.i: ; preds = %entry
+ %tobool3.i.i = icmp eq i32 %add.i.i, 0
+ br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i
+
+cond.true.i.i: ; preds = %if.then.i.i
+ %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i
+ br label %cond.end.i.i
+
+cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i
+ %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ]
+ store i8* %cond.i.i, i8** %p, align 4, !tbaa !0
+ br label %strtold.exit
+
+strtold.exit: ; preds = %cond.end.i.i, %entry
+ call void @llvm.lifetime.end(i64 112, i8* %0) #1
+ ret double %call.i.i
+}
+
+; Function Attrs: nounwind
+declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #1
+
+; Function Attrs: nounwind
+declare void @llvm.lifetime.end(i64, i8* nocapture) #1
+
+; Function Attrs: nounwind readonly
+define i32 @memcmp(i8* nocapture %vl, i8* nocapture %vr, i32 %n) #2 {
+entry:
+ %tobool8 = icmp eq i32 %n, 0
+ br i1 %tobool8, label %cond.end, label %land.rhs
+
+land.rhs: ; preds = %for.inc, %entry
+ %r.011 = phi i8* [ %incdec.ptr3, %for.inc ], [ %vr, %entry ]
+ %l.010 = phi i8* [ %incdec.ptr, %for.inc ], [ %vl, %entry ]
+ %n.addr.09 = phi i32 [ %dec, %for.inc ], [ %n, %entry ]
+ %0 = load i8* %l.010, align 1, !tbaa !1
+ %1 = load i8* %r.011, align 1, !tbaa !1
+ %cmp = icmp eq i8 %0, %1
+ br i1 %cmp, label %for.inc, label %cond.true
+
+for.inc: ; preds = %land.rhs
+ %dec = add i32 %n.addr.09, -1
+ %incdec.ptr = getelementptr inbounds i8* %l.010, i32 1
+ %incdec.ptr3 = getelementptr inbounds i8* %r.011, i32 1
+ %tobool = icmp eq i32 %dec, 0
+ br i1 %tobool, label %cond.end, label %land.rhs
+
+cond.true: ; preds = %land.rhs
+ %conv5 = zext i8 %0 to i32
+ %conv6 = zext i8 %1 to i32
+ %sub = sub nsw i32 %conv5, %conv6
+ br label %cond.end
+
+cond.end: ; preds = %cond.true, %for.inc, %entry
+ %cond = phi i32 [ %sub, %cond.true ], [ 0, %for.inc ], [ 0, %entry ]
+ ret i32 %cond
+}
+
+; Function Attrs: nounwind
+define i32 @strcasecmp(i8* nocapture %_l, i8* nocapture %_r) #0 {
+entry:
+ %0 = load i8* %_l, align 1, !tbaa !1
+ %tobool11 = icmp eq i8 %0, 0
+ br i1 %tobool11, label %for.end, label %land.lhs.true.lr.ph
+
+land.lhs.true.lr.ph: ; preds = %entry
+ %conv10 = zext i8 %0 to i32
+ br label %land.lhs.true
+
+land.lhs.true: ; preds = %for.inc, %land.lhs.true.lr.ph
+ %conv15 = phi i32 [ %conv10, %land.lhs.true.lr.ph ], [ %conv, %for.inc ]
+ %1 = phi i8 [ %0, %land.lhs.true.lr.ph ], [ %4, %for.inc ]
+ %r.013 = phi i8* [ %_r, %land.lhs.true.lr.ph ], [ %incdec.ptr11, %for.inc ]
+ %l.012 = phi i8* [ %_l, %land.lhs.true.lr.ph ], [ %incdec.ptr, %for.inc ]
+ %2 = load i8* %r.013, align 1, !tbaa !1
+ %tobool2 = icmp eq i8 %2, 0
+ br i1 %tobool2, label %for.end, label %land.rhs
+
+land.rhs: ; preds = %land.lhs.true
+ %cmp = icmp eq i8 %1, %2
+ br i1 %cmp, label %for.inc, label %lor.rhs
+
+lor.rhs: ; preds = %land.rhs
+ %call = tail call i32 @tolower(i32 %conv15) #1
+ %3 = load i8* %r.013, align 1, !tbaa !1
+ %conv7 = zext i8 %3 to i32
+ %call8 = tail call i32 @tolower(i32 %conv7) #1
+ %cmp9 = icmp eq i32 %call, %call8
+ br i1 %cmp9, label %for.inc, label %lor.rhs.for.endsplit_crit_edge
+
+lor.rhs.for.endsplit_crit_edge: ; preds = %lor.rhs
+ %.pre.pre = load i8* %l.012, align 1, !tbaa !1
+ br label %for.end
+
+for.inc: ; preds = %lor.rhs, %land.rhs
+ %incdec.ptr = getelementptr inbounds i8* %l.012, i32 1
+ %incdec.ptr11 = getelementptr inbounds i8* %r.013, i32 1
+ %4 = load i8* %incdec.ptr, align 1, !tbaa !1
+ %conv = zext i8 %4 to i32
+ %tobool = icmp eq i8 %4, 0
+ br i1 %tobool, label %for.end, label %land.lhs.true
+
+for.end: ; preds = %for.inc, %lor.rhs.for.endsplit_crit_edge, %land.lhs.true, %entry
+ %5 = phi i8 [ 0, %entry ], [ %.pre.pre, %lor.rhs.for.endsplit_crit_edge ], [ %1, %land.lhs.true ], [ 0, %for.inc ]
+ %r.0.lcssa = phi i8* [ %_r, %entry ], [ %r.013, %lor.rhs.for.endsplit_crit_edge ], [ %r.013, %land.lhs.true ], [ %incdec.ptr11, %for.inc ]
+ %conv12 = zext i8 %5 to i32
+ %call13 = tail call i32 @tolower(i32 %conv12) #1
+ %6 = load i8* %r.0.lcssa, align 1, !tbaa !1
+ %conv14 = zext i8 %6 to i32
+ %call15 = tail call i32 @tolower(i32 %conv14) #1
+ %sub = sub nsw i32 %call13, %call15
+ ret i32 %sub
+}
+
+declare i32 @tolower(i32) #5
+
+; Function Attrs: nounwind readonly
+define i32 @strcmp(i8* nocapture %l, i8* nocapture %r) #2 {
+entry:
+ %0 = load i8* %l, align 1, !tbaa !1
+ %1 = load i8* %r, align 1, !tbaa !1
+ %cmp10 = icmp ne i8 %0, %1
+ %tobool11 = icmp eq i8 %0, 0
+ %or.cond12 = or i1 %cmp10, %tobool11
+ %tobool513 = icmp eq i8 %1, 0
+ %or.cond814 = or i1 %or.cond12, %tobool513
+ br i1 %or.cond814, label %for.end, label %for.inc
+
+for.inc: ; preds = %for.inc, %entry
+ %r.addr.016 = phi i8* [ %incdec.ptr6, %for.inc ], [ %r, %entry ]
+ %l.addr.015 = phi i8* [ %incdec.ptr, %for.inc ], [ %l, %entry ]
+ %incdec.ptr = getelementptr inbounds i8* %l.addr.015, i32 1
+ %incdec.ptr6 = getelementptr inbounds i8* %r.addr.016, i32 1
+ %2 = load i8* %incdec.ptr, align 1, !tbaa !1
+ %3 = load i8* %incdec.ptr6, align 1, !tbaa !1
+ %cmp = icmp ne i8 %2, %3
+ %tobool = icmp eq i8 %2, 0
+ %or.cond = or i1 %cmp, %tobool
+ %tobool5 = icmp eq i8 %3, 0
+ %or.cond8 = or i1 %or.cond, %tobool5
+ br i1 %or.cond8, label %for.end, label %for.inc
+
+for.end: ; preds = %for.inc, %entry
+ %.lcssa9 = phi i8 [ %1, %entry ], [ %3, %for.inc ]
+ %.lcssa = phi i8 [ %0, %entry ], [ %2, %for.inc ]
+ %conv7 = zext i8 %.lcssa to i32
+ %conv8 = zext i8 %.lcssa9 to i32
+ %sub = sub nsw i32 %conv7, %conv8
+ ret i32 %sub
+}
+
+; Function Attrs: nounwind
+define i32 @strncasecmp(i8* nocapture %_l, i8* nocapture %_r, i32 %n) #0 {
+entry:
+ %tobool = icmp eq i32 %n, 0
+ br i1 %tobool, label %return, label %for.cond.preheader
+
+for.cond.preheader: ; preds = %entry
+ %0 = load i8* %_l, align 1, !tbaa !1
+ %tobool115 = icmp eq i8 %0, 0
+ br i1 %tobool115, label %for.end, label %land.lhs.true.lr.ph
+
+land.lhs.true.lr.ph: ; preds = %for.cond.preheader
+ %conv14 = zext i8 %0 to i32
+ br label %land.lhs.true
+
+land.lhs.true: ; preds = %for.inc, %land.lhs.true.lr.ph
+ %conv19 = phi i32 [ %conv14, %land.lhs.true.lr.ph ], [ %conv, %for.inc ]
+ %1 = phi i8 [ %0, %land.lhs.true.lr.ph ], [ %4, %for.inc ]
+ %n.addr.018.in = phi i32 [ %n, %land.lhs.true.lr.ph ], [ %n.addr.018, %for.inc ]
+ %r.017 = phi i8* [ %_r, %land.lhs.true.lr.ph ], [ %incdec.ptr14, %for.inc ]
+ %l.016 = phi i8* [ %_l, %land.lhs.true.lr.ph ], [ %incdec.ptr, %for.inc ]
+ %n.addr.018 = add i32 %n.addr.018.in, -1
+ %2 = load i8* %r.017, align 1, !tbaa !1
+ %tobool3 = icmp eq i8 %2, 0
+ %tobool5 = icmp eq i32 %n.addr.018, 0
+ %or.cond = or i1 %tobool3, %tobool5
+ br i1 %or.cond, label %for.end, label %land.rhs
+
+land.rhs: ; preds = %land.lhs.true
+ %cmp = icmp eq i8 %1, %2
+ br i1 %cmp, label %for.inc, label %lor.rhs
+
+lor.rhs: ; preds = %land.rhs
+ %call = tail call i32 @tolower(i32 %conv19) #1
+ %3 = load i8* %r.017, align 1, !tbaa !1
+ %conv10 = zext i8 %3 to i32
+ %call11 = tail call i32 @tolower(i32 %conv10) #1
+ %cmp12 = icmp eq i32 %call, %call11
+ br i1 %cmp12, label %for.inc, label %lor.rhs.for.endsplit_crit_edge
+
+lor.rhs.for.endsplit_crit_edge: ; preds = %lor.rhs
+ %.pre.pre = load i8* %l.016, align 1, !tbaa !1
+ br label %for.end
+
+for.inc: ; preds = %lor.rhs, %land.rhs
+ %incdec.ptr = getelementptr inbounds i8* %l.016, i32 1
+ %incdec.ptr14 = getelementptr inbounds i8* %r.017, i32 1
+ %4 = load i8* %incdec.ptr, align 1, !tbaa !1
+ %conv = zext i8 %4 to i32
+ %tobool1 = icmp eq i8 %4, 0
+ br i1 %tobool1, label %for.end, label %land.lhs.true
+
+for.end: ; preds = %for.inc, %lor.rhs.for.endsplit_crit_edge, %land.lhs.true, %for.cond.preheader
+ %5 = phi i8 [ 0, %for.cond.preheader ], [ %.pre.pre, %lor.rhs.for.endsplit_crit_edge ], [ %1, %land.lhs.true ], [ 0, %for.inc ]
+ %r.0.lcssa = phi i8* [ %_r, %for.cond.preheader ], [ %r.017, %lor.rhs.for.endsplit_crit_edge ], [ %r.017, %land.lhs.true ], [ %incdec.ptr14, %for.inc ]
+ %conv16 = zext i8 %5 to i32
+ %call17 = tail call i32 @tolower(i32 %conv16) #1
+ %6 = load i8* %r.0.lcssa, align 1, !tbaa !1
+ %conv18 = zext i8 %6 to i32
+ %call19 = tail call i32 @tolower(i32 %conv18) #1
+ %sub = sub nsw i32 %call17, %call19
+ br label %return
+
+return: ; preds = %for.end, %entry
+ %retval.0 = phi i32 [ %sub, %for.end ], [ 0, %entry ]
+ ret i32 %retval.0
+}
+
+; Function Attrs: nounwind readonly
+define i32 @strncmp(i8* nocapture %_l, i8* nocapture %_r, i32 %n) #2 {
+entry:
+ %tobool = icmp eq i32 %n, 0
+ br i1 %tobool, label %return, label %for.cond.preheader
+
+for.cond.preheader: ; preds = %entry
+ %0 = load i8* %_l, align 1, !tbaa !1
+ %tobool113 = icmp eq i8 %0, 0
+ br i1 %tobool113, label %for.end, label %land.lhs.true
+
+land.lhs.true: ; preds = %for.inc, %for.cond.preheader
+ %1 = phi i8 [ %3, %for.inc ], [ %0, %for.cond.preheader ]
+ %n.addr.016.in = phi i32 [ %n.addr.016, %for.inc ], [ %n, %for.cond.preheader ]
+ %r.015 = phi i8* [ %incdec.ptr9, %for.inc ], [ %_r, %for.cond.preheader ]
+ %l.014 = phi i8* [ %incdec.ptr, %for.inc ], [ %_l, %for.cond.preheader ]
+ %n.addr.016 = add i32 %n.addr.016.in, -1
+ %2 = load i8* %r.015, align 1, !tbaa !1
+ %notlhs = icmp ne i8 %2, 0
+ %notrhs = icmp ne i32 %n.addr.016, 0
+ %or.cond.not = and i1 %notrhs, %notlhs
+ %cmp = icmp eq i8 %1, %2
+ %or.cond11 = and i1 %or.cond.not, %cmp
+ br i1 %or.cond11, label %for.inc, label %for.end
+
+for.inc: ; preds = %land.lhs.true
+ %incdec.ptr = getelementptr inbounds i8* %l.014, i32 1
+ %incdec.ptr9 = getelementptr inbounds i8* %r.015, i32 1
+ %3 = load i8* %incdec.ptr, align 1, !tbaa !1
+ %tobool1 = icmp eq i8 %3, 0
+ br i1 %tobool1, label %for.end, label %land.lhs.true
+
+for.end: ; preds = %for.inc, %land.lhs.true, %for.cond.preheader
+ %4 = phi i8 [ 0, %for.cond.preheader ], [ %1, %land.lhs.true ], [ 0, %for.inc ]
+ %r.0.lcssa = phi i8* [ %_r, %for.cond.preheader ], [ %r.015, %land.lhs.true ], [ %incdec.ptr9, %for.inc ]
+ %conv11 = zext i8 %4 to i32
+ %5 = load i8* %r.0.lcssa, align 1, !tbaa !1
+ %conv12 = zext i8 %5 to i32
+ %sub = sub nsw i32 %conv11, %conv12
+ br label %return
+
+return: ; preds = %for.end, %entry
+ %retval.0 = phi i32 [ %sub, %for.end ], [ 0, %entry ]
+ ret i32 %retval.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" }
+attributes #1 = { nounwind }
+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 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" }
+attributes #4 = { noreturn "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 #5 = { "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 #6 = { noreturn nounwind }
+attributes #7 = { nounwind readnone }
+attributes #8 = { noreturn }
+
+!0 = metadata !{metadata !"any pointer", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}
+!3 = metadata !{metadata !"int", metadata !1}
+!4 = metadata !{metadata !"short", metadata !1}
+!5 = metadata !{metadata !"branch_weights", i32 64, i32 4}
+!6 = metadata !{metadata !"branch_weights", i32 4, i32 64}
+!7 = metadata !{i64 0, i64 4, metadata !0, i64 4, i64 4, metadata !3, i64 8, i64 4, metadata !0, i64 12, i64 4, metadata !3}
+!8 = metadata !{metadata !"vtable pointer", metadata !2}
diff --git a/tests/cases/i24_ce_fastcomp.txt b/tests/cases/i24_ce_fastcomp.txt
new file mode 100644
index 00000000..12024aa3
--- /dev/null
+++ b/tests/cases/i24_ce_fastcomp.txt
@@ -0,0 +1 @@
+checksum = ADDDE3F6
diff --git a/tests/cases/icmp64.ll b/tests/cases/icmp64.ll
new file mode 100644
index 00000000..440ff6f9
--- /dev/null
+++ b/tests/cases/icmp64.ll
@@ -0,0 +1,32 @@
+; 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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [17 x i8] c"hello, world %d\0A\00", align 1 ; [#uses=1 type=[15 x i8]*]
+
+; [#uses=0]
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ store i32 0, i32* %retval
+ %a0 = add i64 0, 0
+ %a1 = icmp slt i64 %a0, 0
+ %a2 = zext i1 %a1 to i32
+ %calla = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %a2)
+ %b0 = add i64 0, 1
+ %b1 = icmp slt i64 %b0, 0
+ %b2 = zext i1 %b1 to i32
+ %callb = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %b2)
+ %c0 = sub i64 1, 0
+ %c1 = icmp slt i64 %c0, 0
+ %c2 = zext i1 %c1 to i32
+ %callc = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %c2)
+ %d0 = sub i64 0, 1
+ %d1 = icmp slt i64 %d0, 0
+ %d2 = zext i1 %d1 to i32
+ %calld = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %d2)
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/icmp64.txt b/tests/cases/icmp64.txt
new file mode 100644
index 00000000..5e75a06b
--- /dev/null
+++ b/tests/cases/icmp64.txt
@@ -0,0 +1,4 @@
+hello, world 0
+hello, world 0
+hello, world 0
+hello, world 1
diff --git a/tests/cases/returnnan_fastcomp.ll b/tests/cases/returnnan_fastcomp.ll
new file mode 100644
index 00000000..3a6a9f9e
--- /dev/null
+++ b/tests/cases/returnnan_fastcomp.ll
@@ -0,0 +1,34 @@
+; 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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [18 x i8] c"hello, world %f!\0A\00", align 1
+
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4
+ store i32 0, i32* %retval
+ %f = call double @nand()
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %f)
+ %g = call double @zerod()
+ %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %g)
+ %h = call float @zerof()
+ %hd = fpext float %h to double
+ %call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %hd)
+ ret i32 1
+}
+
+define double @nand() unnamed_addr align 2 {
+ ret double 0x7FF8000000000000
+}
+
+define double @zerod() unnamed_addr align 2 {
+ ret double 0x0000000000000000
+}
+
+define float @zerof() unnamed_addr align 2 {
+ ret float 0x0000000000000000
+}
+
+declare i32 @printf(i8*, ...)
+
diff --git a/tests/cases/returnnan_fastcomp.txt b/tests/cases/returnnan_fastcomp.txt
new file mode 100644
index 00000000..f11733ba
--- /dev/null
+++ b/tests/cases/returnnan_fastcomp.txt
@@ -0,0 +1,3 @@
+hello, world nan!
+hello, world 0.000000!
+hello, world 0.000000!
diff --git a/tests/cases/switch64c_ta2.ll b/tests/cases/switch64c_ta2.ll
new file mode 100644
index 00000000..6826a412
--- /dev/null
+++ b/tests/cases/switch64c_ta2.ll
@@ -0,0 +1,68 @@
+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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1
+
+declare i32 @printf(i8*, ...)
+
+define i32 @main() {
+ %a333 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 5)
+ %a400 = zext i32 %a333 to i64
+ %check = trunc i32 %a333 to i1
+ br i1 %check, label %l1, label %l2
+
+l1:
+ %bbb = phi i64 [ %a400, %0 ], [ 10, %l2 ]
+ %bbb32 = trunc i64 %bbb to i32
+ %a333z = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %bbb32)
+ %check2 = trunc i32 %bbb32 to i1
+ br i1 %check2, label %l2, label %label999
+
+l2:
+ %a410 = phi i64 [ %a400, %0 ], [ %bbb, %l1 ]
+ %a444 = udiv i64 %a410, 3
+ switch i64 %a444, label %l1 [
+ i64 1000, label %label9950
+ i64 1001, label %label9951
+ i64 1002, label %label9952
+ i64 1003, label %label9953
+ i64 1004, label %label9954
+ i64 1005, label %label9955
+ i64 1006, label %label9956
+ i64 1007, label %label9957
+ i64 1008, label %label9958
+ i64 1009, label %label9959
+ ]
+
+label9950:
+ %waka = phi i64 [1000, %l2], [0, %label9951], [1, %label9952], [2, %label9953], [3, %label9954], [4, %label9955], [5, %label9956], [6, %label9957], [7, %label9958], [8, %label9959]
+ %waka32 = trunc i64 %waka to i32
+ %a333b = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %waka32)
+ br label %label999
+
+label9951:
+ br label %label9950
+label9952:
+ br label %label9950
+label9953:
+ br label %label9950
+label9954:
+ br label %label9950
+label9955:
+ br label %label9950
+label9956:
+ br label %label9950
+label9957:
+ br label %label9950
+label9958:
+ br label %label9950
+label9959:
+ br label %label9950
+
+label999: ; preds = %555
+ %last = phi i64 [1, %l1], [2, %label9950]
+ %last32 = trunc i64 %last to i32
+ %a333c = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %last32)
+ ret i32 0
+}
+
diff --git a/tests/cases/switch64c_ta2.txt b/tests/cases/switch64c_ta2.txt
new file mode 100644
index 00000000..29999663
--- /dev/null
+++ b/tests/cases/switch64c_ta2.txt
@@ -0,0 +1,3 @@
+hello, world: 5
+hello, world: 10
+hello, world: 1
diff --git a/tests/cases/usenullcall_fastcomp.ll b/tests/cases/usenullcall_fastcomp.ll
new file mode 100644
index 00000000..f0996e08
--- /dev/null
+++ b/tests/cases/usenullcall_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-S128"
+target triple = "asmjs-unknown-emscripten"
+
+@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1
+@.str1 = private unnamed_addr constant [15 x i8] c"hello, worldA\0A\00", align 1
+@.str2 = private unnamed_addr constant [15 x i8] c"hello, worldB\0A\00", align 1
+
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ store i32 0, i32* %retval
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 1)
+ %bad = call zeroext i1 null()
+ %bad2 = call zeroext i1 null(i32 5, float 1.0E2, double 0.02, i64 1000, i1 0, i32* %retval)
+ %bad3 = call zeroext i1 (i32, float, double, i64, i1, i32*)* null(i32 5, float 1.0E2, double 0.02, i64 1000, i1 0, i32* %retval)
+ %bad4 = or i1 %bad, %bad2
+ %bad5 = or i1 %bad3, %bad4
+ br i1 %bad5, label %pre, label %finish
+
+pre:
+ %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str1, i32 0, i32 0), i32 0)
+ ret i32 0
+
+finish:
+ %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str2, i32 0, i32 0), i32 1)
+ ret i32 1
+}
+
+; [#uses=1]
+declare i32 @printf(i8*, ...)
diff --git a/tests/cases/usenullcall_fastcomp.txt b/tests/cases/usenullcall_fastcomp.txt
new file mode 100644
index 00000000..270c611e
--- /dev/null
+++ b/tests/cases/usenullcall_fastcomp.txt
@@ -0,0 +1 @@
+hello, world!
diff --git a/tests/core/test_inlinejs3.in b/tests/core/test_inlinejs3.in
index da720a3d..c3b9b769 100644
--- a/tests/core/test_inlinejs3.in
+++ b/tests/core/test_inlinejs3.in
@@ -1,6 +1,10 @@
#include <stdio.h>
#include <emscripten.h>
+void loop_iter() {
+ EM_ASM(Module.print('loop iter!'));
+}
+
int main(int argc, char **argv) {
EM_ASM(Module.print('hello dere1'));
EM_ASM("Module.print('hello dere2');");
@@ -9,6 +13,7 @@ int main(int argc, char **argv) {
EM_ASM(Module.print('hello dere3'); Module.print('hello dere' + 4););
}
EM_ASM_({ Module.print('hello input ' + $0) }, 123);
+ EM_ASM_ARGS({ Module.print('hello input ' + $0) }, 456);
int sum = 0;
for (int i = 0; i < argc * 3; i++) {
sum += EM_ASM_INT({
@@ -21,5 +26,6 @@ int main(int argc, char **argv) {
sum = 0;
sum = EM_ASM_INT_V({ return globalVar }); // no inputs, just output
printf("sum: %d\n", sum);
+ for (int i = 0; i < argc*2; i++) loop_iter();
return 0;
}
diff --git a/tests/core/test_inlinejs3.out b/tests/core/test_inlinejs3.out
index 1f64a89a..c48cc3c8 100644
--- a/tests/core/test_inlinejs3.out
+++ b/tests/core/test_inlinejs3.out
@@ -7,7 +7,10 @@ hello dere4
hello dere3
hello dere4
hello input 123
+hello input 456
i: 0,0.00
i: 1,0.08
i: 2,0.17
sum: 6
+loop iter!
+loop iter!
diff --git a/tests/dirent/test_readdir_empty.c b/tests/dirent/test_readdir_empty.c
new file mode 100644
index 00000000..00102733
--- /dev/null
+++ b/tests/dirent/test_readdir_empty.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+
+
+int main(int argc, char** argv) {
+ if (mkdir("/tmp", S_IRWXG) != 0 && errno != EEXIST) {
+ printf("Unable to create dir '/tmp'\n");
+ return -1;
+ }
+
+ if (mkdir("/tmp/1", S_IRWXG) != 0 && errno != EEXIST) {
+ printf("Unable to create dir '/tmp/1'\n");
+ return -1;
+ }
+
+ if (mkdir("/tmp/1/", S_IRWXG) != 0 && errno != EEXIST) {
+ printf("Unable to create dir '/tmp/1/'\n");
+ return -1;
+ }
+
+ DIR *dir = opendir("/tmp");
+
+ if (!dir) {
+ printf("Unable to open dir '/tmp'\n");
+ return -2;
+ }
+
+ struct dirent *dirent;
+
+ while ((dirent = readdir(dir)) != 0) {
+ printf("Found '%s'\n", dirent->d_name);
+
+ if (strlen(dirent->d_name) == 0) {
+ printf("Found empty path!\n");
+ return -3;
+ }
+ }
+
+ closedir(dir);
+
+ printf("success\n");
+ return 0;
+}
+
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index 5ca972be..e2160c33 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -1938,10 +1938,84 @@ module({
derived.delete();
// Let the memory leak test superfixture check that no leaks occurred.
});
+
+ BaseFixture.extend("val::as", function() {
+ test("built-ins", function() {
+ assert.equal(true, cm.val_as_bool(true));
+ assert.equal(false, cm.val_as_bool(false));
+ assert.equal(127, cm.val_as_char(127));
+ assert.equal(32767, cm.val_as_short(32767));
+ assert.equal(65536, cm.val_as_int(65536));
+ assert.equal(65536, cm.val_as_long(65536));
+ assert.equal(10.5, cm.val_as_float(10.5));
+ assert.equal(10.5, cm.val_as_double(10.5));
+
+ assert.equal("foo", cm.val_as_string("foo"));
+ assert.equal("foo", cm.val_as_wstring("foo"));
+
+ var obj = {};
+ assert.equal(obj, cm.val_as_val(obj));
+
+ // JS->C++ memory view not implemented
+ //var ab = cm.val_as_memory_view(new ArrayBuffer(13));
+ //assert.equal(13, ab.byteLength);
+ });
+
+ test("value types", function() {
+ var tuple = [1, 2, 3, 4];
+ assert.deepEqual(tuple, cm.val_as_value_array(tuple));
+
+ var struct = {x: 1, y: 2, z: 3, w: 4};
+ assert.deepEqual(struct, cm.val_as_value_object(struct));
+ });
+
+ test("enums", function() {
+ assert.equal(cm.Enum.ONE, cm.val_as_enum(cm.Enum.ONE));
+ });
+ });
+
+ BaseFixture.extend("val::new_", function() {
+ test("variety of types", function() {
+ function factory() {
+ this.arguments = Array.prototype.slice.call(arguments, 0);
+ }
+ var instance = cm.construct_with_6_arguments(factory);
+ assert.deepEqual(
+ [6, -12.5, "a3", {x: 1, y: 2, z: 3, w: 4}, cm.EnumClass.TWO, [-1, -2, -3, -4]],
+ instance.arguments);
+ });
+
+ test("memory view", function() {
+ function factory(before, view, after) {
+ this.before = before;
+ this.view = view;
+ this.after = after;
+ }
+
+ var instance = cm.construct_with_memory_view(factory);
+ assert.equal("before", instance.before);
+ assert.equal(10, instance.view.byteLength);
+ assert.equal("after", instance.after);
+ });
+
+ test("ints_and_float", function() {
+ function factory(a, b, c) {
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ }
+
+ var instance = cm.construct_with_ints_and_float(factory);
+ assert.equal(65537, instance.a);
+ assert.equal(4.0, instance.b);
+ assert.equal(65538, instance.c);
+ });
+ });
});
/* global run_all_tests */
// If running as part of the emscripten test runner suite, and not as part of the IMVU suite,
// we launch the test execution from here. IMVU suite uses its own dedicated mechanism instead of this.
-if (typeof run_all_tests !== "undefined")
+if (typeof run_all_tests !== "undefined") {
run_all_tests();
+}
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 4efc4bd8..d299660a 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -842,7 +842,7 @@ Enum emval_test_take_and_return_Enum(Enum e) {
return e;
}
-enum class EnumClass { ONE, TWO };
+enum class EnumClass : char { ONE, TWO };
EnumClass emval_test_take_and_return_EnumClass(EnumClass e) {
return e;
@@ -2304,3 +2304,60 @@ EMSCRIPTEN_BINDINGS(mixins) {
.constructor<>()
);
}
+
+template<typename T>
+T val_as(const val& v) {
+ return v.as<T>();
+}
+
+EMSCRIPTEN_BINDINGS(val_as) {
+ function("val_as_bool", &val_as<bool>);
+ function("val_as_char", &val_as<char>);
+ function("val_as_short", &val_as<short>);
+ function("val_as_int", &val_as<int>);
+ function("val_as_long", &val_as<long>);
+
+ function("val_as_float", &val_as<float>);
+ function("val_as_double", &val_as<double>);
+
+ function("val_as_string", &val_as<std::string>);
+ function("val_as_wstring", &val_as<std::wstring>);
+ function("val_as_val", &val_as<val>);
+
+ function("val_as_value_object", &val_as<StructVector>);
+ function("val_as_value_array", &val_as<TupleVector>);
+
+ function("val_as_enum", &val_as<Enum>);
+
+ // memory_view is always JS -> C++
+ //function("val_as_memory_view", &val_as<memory_view>);
+}
+
+val construct_with_6(val factory) {
+ unsigned char a1 = 6;
+ double a2 = -12.5;
+ std::string a3("a3");
+ StructVector a4(1, 2, 3, 4);
+ EnumClass a5 = EnumClass::TWO;
+ TupleVector a6(-1, -2, -3, -4);
+ return factory.new_(a1, a2, a3, a4, a5, a6);
+}
+
+val construct_with_memory_view(val factory) {
+ static const char data[11] = "0123456789";
+ return factory.new_(
+ std::string("before"),
+ memory_view(10, data),
+ std::string("after"));
+}
+
+val construct_with_ints_and_float(val factory) {
+ static const char data[11] = "0123456789";
+ return factory.new_(65537, 4.0f, 65538);
+}
+
+EMSCRIPTEN_BINDINGS(val_new_) {
+ function("construct_with_6_arguments", &construct_with_6);
+ function("construct_with_memory_view", &construct_with_memory_view);
+ function("construct_with_ints_and_float", &construct_with_ints_and_float);
+}
diff --git a/tests/fs/test_idbfs_sync.c b/tests/fs/test_idbfs_sync.c
index ff356416..0d8f4d71 100644
--- a/tests/fs/test_idbfs_sync.c
+++ b/tests/fs/test_idbfs_sync.c
@@ -1,8 +1,6 @@
#include <stdio.h>
#include <emscripten.h>
-#define EM_ASM_REEXPAND(x) EM_ASM(x)
-
void success() {
int result = 1;
REPORT_RESULT();
@@ -15,31 +13,35 @@ int main() {
);
#if FIRST
- // store local files to backing IDB
- EM_ASM_REEXPAND(
+ // store local files to backing IDB. Note that we use the JS FS API for everything here, but we
+ // could use normal libc fwrite etc. to do the writing. All we need the JS FS API for is to
+ // mount the filesystem and do syncfs.
+ EM_ASM_ARGS({
FS.writeFile('/working/waka.txt', 'az');
- FS.writeFile('/working/moar.txt', SECRET);
+ FS.writeFile('/working/moar.txt', $0);
FS.syncfs(function (err) {
assert(!err);
- ccall('success', 'v', '', []);
+ ccall('success', 'v');
});
- );
+ }, SECRET);
#else
// load files from backing IDB
- EM_ASM_REEXPAND(
+ EM_ASM_ARGS({
FS.syncfs(true, function (err) {
assert(!err);
var contents = FS.readFile('/working/waka.txt', { encoding: 'utf8' });
- assert(contents === 'az');
+ assert(contents === 'az', 'bad contents ' + contents);
- var secret = FS.readFile('/working/moar.txt', { encoding: 'utf8' });
- assert(secret === SECRET);
+ // note we convert to a number here (using +), since we used writeFile, which writes a
+ // JS string.
+ var secret = +FS.readFile('/working/moar.txt', { encoding: 'utf8' });
+ assert(secret === $0, 'bad secret ' + [secret, $0, typeof secret, typeof $0]);
ccall('success', 'v', '', []);
});
- );
+ }, SECRET);
#endif
emscripten_exit_with_live_runtime();
diff --git a/tests/hello_world.ll b/tests/hello_world.ll
index ab4b199f..7090b732 100644
--- a/tests/hello_world.ll
+++ b/tests/hello_world.ll
@@ -2,16 +2,15 @@
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-S128"
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]*]
+@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1
-; [#uses=0]
define i32 @main() {
entry:
- %retval = alloca i32, align 4 ; [#uses=1 type=i32*]
+ %retval = alloca i32, align 4
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]
+ %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0))
ret i32 1
}
-; [#uses=1]
declare i32 @printf(i8*, ...)
+
diff --git a/tests/runner.py b/tests/runner.py
index 26912f25..87f8a036 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -352,7 +352,7 @@ process(sys.argv[1])
build_dir = self.get_build_dir()
output_dir = self.get_dir()
- cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '')
+ cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '_') + (self.env.get('EMCC_FAST_COMPILER') or '_')
valid_chars = "_%s%s" % (string.ascii_letters, string.digits)
cache_name = ''.join([(c if c in valid_chars else '_') for c in cache_name])
@@ -790,9 +790,9 @@ To run one of those parts, do something like
To run a specific set of tests, you can do things like
- python tests/runner.py o1
+ python tests/runner.py asm2
-(that runs the o1 (-O1) tests). You can run individual tests with
+(that runs the asm2 (asm.js, -O2) tests). You can run individual tests with
python tests/runner.py test_hello_world
diff --git a/tests/sdl_free_screen.cpp b/tests/sdl_free_screen.cpp
new file mode 100644
index 00000000..01a849c5
--- /dev/null
+++ b/tests/sdl_free_screen.cpp
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <SDL/SDL.h>
+
+
+extern "C" int main(int argc, char** argv) {
+
+ SDL_Init(SDL_INIT_VIDEO);
+ SDL_Surface *screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE);
+ printf("freeing screen...\n");
+ SDL_FreeSurface(screen);
+ printf("recreating...\n");
+ screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE);
+ printf("seems ok!\n");
+
+ if (SDL_MUSTLOCK(screen)) SDL_LockSurface(screen);
+ for (int i = 0; i < 256; i++) {
+ for (int j = 0; j < 256; j++) {
+ // alpha component is actually ignored, since this is to the screen
+ *((Uint32*)screen->pixels + i * 256 + j) = SDL_MapRGBA(screen->format, i, j, 255-i, (i+j) % 255);
+ }
+ }
+ if (SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);
+ SDL_Flip(screen);
+
+ SDL_Quit();
+
+ return 0;
+}
+
diff --git a/tests/sockets/p2p/.gitignore b/tests/sockets/p2p/.gitignore
new file mode 100644
index 00000000..065a4ac0
--- /dev/null
+++ b/tests/sockets/p2p/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+ssl
diff --git a/tests/sockets/p2p/broker/p2p-broker.js b/tests/sockets/p2p/broker/p2p-broker.js
new file mode 100644
index 00000000..028eb25b
--- /dev/null
+++ b/tests/sockets/p2p/broker/p2p-broker.js
@@ -0,0 +1,231 @@
+var crypto = require('crypto');
+var fs = require('fs');
+var https = require('https');
+
+var SSL_KEY = 'ssl/ssl.key';
+var SSL_CERT = 'ssl/ssl-unified.crt';
+var PORT = 8080;
+
+var sslSupported = false;
+if(fs.existsSync(SSL_KEY) && fs.existsSync(SSL_CERT) && fs.statSync(SSL_KEY).isFile() && fs.statSync(SSL_CERT).isFile()) {
+ sslSupported = true;
+}
+
+function handler(req, res) {
+ res.writeHead(200);
+ res.end("p2p");
+};
+
+var app, port;
+if(sslSupported) {
+ var sslopts = {
+ key: fs.readFileSync(SSL_KEY),
+ cert: fs.readFileSync(SSL_CERT)
+ };
+ sslopts.agent = new https.Agent(sslopts);
+ app = require('https').createServer(sslopts, handler);
+ port = 8081;
+ console.info('ssl mode enabled');
+} else {
+ app = require('http').createServer(handler);
+ port = 8080;
+ console.info('ssl mode disabled');
+}
+console.info('listening on port', port);
+
+var io = require('socket.io').listen(app, {
+ 'log level': 2
+});
+
+app.listen(port);
+
+var jsMime = {
+ type: 'application/javascript',
+ encoding: 'utf8',
+ gzip: true
+};
+
+io.static.add('/p2p-client.js', {
+ mime: jsMime,
+ file: 'client/p2p-client.js'
+});
+
+/*
+io.static.add('/p2p-client.min.js', {
+ mime: jsMime,
+ file: 'client/p2p-client.min.js'
+});
+*/
+
+function mkguid() {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+ var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
+ return v.toString(16);
+ }).toUpperCase();
+};
+
+var peers = {};
+var hosts = {};
+
+var E = {
+ OK: 'ok'
+ , NOROUTE: 'no such route'
+ , ISNOTHOST: 'peer is not a host'
+};
+
+function Peer(socket) {
+ this.socket = socket;
+ this.host = null;
+};
+
+function Host(options) {
+ this.route = options['route'];
+ this.url = options['url'];
+ this.listed = (undefined !== options['listed']) ? options['listed'] : false;
+ this.metadata = options['metadata'] || {};
+ this.ctime = Date.now();
+ this.mtime = Date.now();
+};
+Host.prototype.update = function update(options) {
+ this.url = options['url'];
+ this.listed = (undefined !== options['listed']) ? options['listed'] : false;
+ this.metadata = options['metadata'] || {};
+ this.mtime = Date.now();
+};
+
+io.of('/peer').on('connection', function(socket) {
+ var route = crypto.createHash('md5').update(socket['id']).digest('hex');
+ socket.emit('route', route);
+
+ socket.on('disconnect', function() {
+ if(hosts[route]) {
+ var host = hosts[route];
+ changeList('remove', host);
+ }
+ delete hosts[route];
+ delete peers[route];
+ });
+
+ socket.on('send', function(message, callback) {
+ var to = message['to'];
+
+ if(!peers.hasOwnProperty(to)) {
+ callback({'error': E.NOROUTE});
+ return;
+ }
+
+ var from = route;
+ var data = message['data'];
+ peers[to].emit('receive', {
+ 'from': from,
+ 'data': data
+ });
+ });
+
+ socket.on('listen', function(options, callback) {
+ options['route'] = route;
+ if(hosts.hasOwnProperty(route)) {
+ hosts[route].update(options);
+ changeList('update', hosts[route]);
+ } else {
+ hosts[route] = new Host(options);
+ changeList('append', hosts[route]);
+ }
+
+ callback();
+ });
+
+ socket.on('ignore', function(message, callback) {
+ if(!hosts.hasOwnProperty(route)) {
+ callback({'error': E.ISNOTHOST});
+ return;
+ }
+
+ var host = hosts[route];
+ delete hosts[route];
+
+ changeList('remove', host);
+
+ callback();
+ });
+
+ peers[route] = socket;
+});
+
+function Filter(socket, options) {
+ this.options = options || {};
+ this.socket = socket;
+};
+Filter.prototype.test = function test(host) {
+ var filter = this.options;
+ var result;
+
+ if(filter['url'] && typeof host['url'] === 'string') {
+ try {
+ result = host['url'].match(filter['url']);
+ if(!result)
+ return true;
+ } catch(e) {
+ return true;
+ }
+ }
+
+ if(filter['metadata'] && host['metadata']) {
+ var metadataFilter = filter['metadata'];
+ var metadataHost = host['metadata'];
+
+ if(metadataFilter['name'] && typeof metadataHost['name'] === 'string') {
+ try {
+ result = metadataHost['name'].match(metadataFilter['name']);
+ if(!result)
+ return true;
+ } catch(e) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+};
+
+var lists = {};
+
+function changeList(operation, host) {
+ var clients = Object.keys(lists);
+ clients.forEach(function(client) {
+ var filter = lists[client];
+ if(!host['listed'])
+ return;
+ if(!filter.test(host)) {
+ var data = operation === 'remove' ? host['route'] : host;
+ filter.socket.emit(operation, data);
+ }
+ });
+};
+
+io.of('/list').on('connection', function(socket) {
+ var id = socket['id'];
+
+ socket.on('disconnect', function() {
+ delete lists[id];
+ });
+
+ socket.on('list', function(options) {
+ var filter = new Filter(socket, options);
+
+ var result = [];
+
+ var hostIds = Object.keys(hosts);
+ hostIds.forEach(function(hostId) {
+ var host = hosts[hostId];
+ if(!host['listed'])
+ return;
+ if(!filter.test(host))
+ result.push(host);
+ });
+
+ lists[id] = filter;
+
+ socket.emit('truncate', result);
+ });
+});
diff --git a/tests/sockets/p2p/client/p2p-client.js b/tests/sockets/p2p/client/p2p-client.js
new file mode 100644
index 00000000..2c660210
--- /dev/null
+++ b/tests/sockets/p2p/client/p2p-client.js
@@ -0,0 +1,4485 @@
+
+;(function(define, global) { 'use strict';
+define(['module'], function(module) {
+
+ /*! Socket.IO.js build:0.9.11, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed
+ Modified to work in-line; Removed Flash transport code */
+ var io = ('undefined' === typeof module ? {} : module.exports);
+ (function() {
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, global) {
+
+ /**
+ * IO namespace.
+ *
+ * @namespace
+ */
+
+ var io = exports;
+
+ /**
+ * Socket.IO version
+ *
+ * @api public
+ */
+
+ io.version = '0.9.11';
+
+ /**
+ * Protocol implemented.
+ *
+ * @api public
+ */
+
+ io.protocol = 1;
+
+ /**
+ * Available transports, these will be populated with the available transports
+ *
+ * @api public
+ */
+
+ io.transports = [];
+
+ /**
+ * Keep track of jsonp callbacks.
+ *
+ * @api private
+ */
+
+ io.j = [];
+
+ /**
+ * Keep track of our io.Sockets
+ *
+ * @api private
+ */
+ io.sockets = {};
+
+
+ /**
+ * Manages connections to hosts.
+ *
+ * @param {String} uri
+ * @Param {Boolean} force creation of new socket (defaults to false)
+ * @api public
+ */
+
+ io.connect = function (host, details) {
+ var uri = io.util.parseUri(host)
+ , uuri
+ , socket;
+
+ if (global && global.location) {
+ uri.protocol = uri.protocol || global.location.protocol.slice(0, -1);
+ uri.host = uri.host || (global.document
+ ? global.document.domain : global.location.hostname);
+ uri.port = uri.port || global.location.port;
+ }
+
+ uuri = io.util.uniqueUri(uri);
+
+ var options = {
+ host: uri.host
+ , secure: 'https' == uri.protocol
+ , port: uri.port || ('https' == uri.protocol ? 443 : 80)
+ , query: uri.query || ''
+ };
+
+ io.util.merge(options, details);
+
+ if (options['force new connection'] || !io.sockets[uuri]) {
+ socket = new io.Socket(options);
+ }
+
+ if (!options['force new connection'] && socket) {
+ io.sockets[uuri] = socket;
+ }
+
+ socket = socket || io.sockets[uuri];
+
+ // if path is different from '' or /
+ return socket.of(uri.path.length > 1 ? uri.path : '');
+ };
+
+ })('object' === typeof module ? module.exports : (io = {}), global);
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, global) {
+
+ /**
+ * Utilities namespace.
+ *
+ * @namespace
+ */
+
+ var util = exports.util = {};
+
+ /**
+ * Parses an URI
+ *
+ * @author Steven Levithan <stevenlevithan.com> (MIT license)
+ * @api public
+ */
+
+ var re = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
+
+ var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password',
+ 'host', 'port', 'relative', 'path', 'directory', 'file', 'query',
+ 'anchor'];
+
+ util.parseUri = function (str) {
+ var m = re.exec(str || '')
+ , uri = {}
+ , i = 14;
+
+ while (i--) {
+ uri[parts[i]] = m[i] || '';
+ }
+
+ return uri;
+ };
+
+ /**
+ * Produces a unique url that identifies a Socket.IO connection.
+ *
+ * @param {Object} uri
+ * @api public
+ */
+
+ util.uniqueUri = function (uri) {
+ var protocol = uri.protocol
+ , host = uri.host
+ , port = uri.port;
+
+ if ('document' in global) {
+ host = host || document.domain;
+ port = port || (protocol == 'https'
+ && document.location.protocol !== 'https:' ? 443 : document.location.port);
+ } else {
+ host = host || 'localhost';
+
+ if (!port && protocol == 'https') {
+ port = 443;
+ }
+ }
+
+ return (protocol || 'http') + '://' + host + ':' + (port || 80);
+ };
+
+ /**
+ * Mergest 2 query strings in to once unique query string
+ *
+ * @param {String} base
+ * @param {String} addition
+ * @api public
+ */
+
+ util.query = function (base, addition) {
+ var query = util.chunkQuery(base || '')
+ , components = [];
+
+ util.merge(query, util.chunkQuery(addition || ''));
+ for (var part in query) {
+ if (query.hasOwnProperty(part)) {
+ components.push(part + '=' + query[part]);
+ }
+ }
+
+ return components.length ? '?' + components.join('&') : '';
+ };
+
+ /**
+ * Transforms a querystring in to an object
+ *
+ * @param {String} qs
+ * @api public
+ */
+
+ util.chunkQuery = function (qs) {
+ var query = {}
+ , params = qs.split('&')
+ , i = 0
+ , l = params.length
+ , kv;
+
+ for (; i < l; ++i) {
+ kv = params[i].split('=');
+ if (kv[0]) {
+ query[kv[0]] = kv[1];
+ }
+ }
+
+ return query;
+ };
+
+ /**
+ * Executes the given function when the page is loaded.
+ *
+ * io.util.load(function () { console.log('page loaded'); });
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+ var pageLoaded = false;
+
+ util.load = function (fn) {
+ if ('document' in global && document.readyState === 'complete' || pageLoaded) {
+ return fn();
+ }
+
+ util.on(global, 'load', fn, false);
+ };
+
+ /**
+ * Adds an event.
+ *
+ * @api private
+ */
+
+ util.on = function (element, event, fn, capture) {
+ if (element.attachEvent) {
+ element.attachEvent('on' + event, fn);
+ } else if (element.addEventListener) {
+ element.addEventListener(event, fn, capture);
+ }
+ };
+
+ /**
+ * Generates the correct `XMLHttpRequest` for regular and cross domain requests.
+ *
+ * @param {Boolean} [xdomain] Create a request that can be used cross domain.
+ * @returns {XMLHttpRequest|false} If we can create a XMLHttpRequest.
+ * @api private
+ */
+
+ util.request = function (xdomain) {
+
+ if (xdomain && 'undefined' != typeof XDomainRequest && !util.ua.hasCORS) {
+ return new XDomainRequest();
+ }
+
+ if ('undefined' != typeof XMLHttpRequest && (!xdomain || util.ua.hasCORS)) {
+ return new XMLHttpRequest();
+ }
+
+ if (!xdomain) {
+ try {
+ return new window[(['Active'].concat('Object').join('X'))]('Microsoft.XMLHTTP');
+ } catch(e) { }
+ }
+
+ return null;
+ };
+
+ /**
+ * XHR based transport constructor.
+ *
+ * @constructor
+ * @api public
+ */
+
+ /**
+ * Change the internal pageLoaded value.
+ */
+
+ if ('undefined' != typeof window) {
+ util.load(function () {
+ pageLoaded = true;
+ });
+ }
+
+ /**
+ * Defers a function to ensure a spinner is not displayed by the browser
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+ util.defer = function (fn) {
+ if (!util.ua.webkit || 'undefined' != typeof importScripts) {
+ return fn();
+ }
+
+ util.load(function () {
+ setTimeout(fn, 100);
+ });
+ };
+
+ /**
+ * Merges two objects.
+ *
+ * @api public
+ */
+
+ util.merge = function merge (target, additional, deep, lastseen) {
+ var seen = lastseen || []
+ , depth = typeof deep == 'undefined' ? 2 : deep
+ , prop;
+
+ for (prop in additional) {
+ if (additional.hasOwnProperty(prop) && util.indexOf(seen, prop) < 0) {
+ if (typeof target[prop] !== 'object' || !depth) {
+ target[prop] = additional[prop];
+ seen.push(additional[prop]);
+ } else {
+ util.merge(target[prop], additional[prop], depth - 1, seen);
+ }
+ }
+ }
+
+ return target;
+ };
+
+ /**
+ * Merges prototypes from objects
+ *
+ * @api public
+ */
+
+ util.mixin = function (ctor, ctor2) {
+ util.merge(ctor.prototype, ctor2.prototype);
+ };
+
+ /**
+ * Shortcut for prototypical and static inheritance.
+ *
+ * @api private
+ */
+
+ util.inherit = function (ctor, ctor2) {
+ function f() {};
+ f.prototype = ctor2.prototype;
+ ctor.prototype = new f;
+ };
+
+ /**
+ * Checks if the given object is an Array.
+ *
+ * io.util.isArray([]); // true
+ * io.util.isArray({}); // false
+ *
+ * @param Object obj
+ * @api public
+ */
+
+ util.isArray = Array.isArray || function (obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+ };
+
+ /**
+ * Intersects values of two arrays into a third
+ *
+ * @api public
+ */
+
+ util.intersect = function (arr, arr2) {
+ var ret = []
+ , longest = arr.length > arr2.length ? arr : arr2
+ , shortest = arr.length > arr2.length ? arr2 : arr;
+
+ for (var i = 0, l = shortest.length; i < l; i++) {
+ if (~util.indexOf(longest, shortest[i]))
+ ret.push(shortest[i]);
+ }
+
+ return ret;
+ };
+
+ /**
+ * Array indexOf compatibility.
+ *
+ * @see bit.ly/a5Dxa2
+ * @api public
+ */
+
+ util.indexOf = function (arr, o, i) {
+
+ for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;
+ i < j && arr[i] !== o; i++) {}
+
+ return j <= i ? -1 : i;
+ };
+
+ /**
+ * Converts enumerables to array.
+ *
+ * @api public
+ */
+
+ util.toArray = function (enu) {
+ var arr = [];
+
+ for (var i = 0, l = enu.length; i < l; i++)
+ arr.push(enu[i]);
+
+ return arr;
+ };
+
+ /**
+ * UA / engines detection namespace.
+ *
+ * @namespace
+ */
+
+ util.ua = {};
+
+ /**
+ * Whether the UA supports CORS for XHR.
+ *
+ * @api public
+ */
+
+ util.ua.hasCORS = 'undefined' != typeof XMLHttpRequest && (function () {
+ try {
+ var a = new XMLHttpRequest();
+ } catch (e) {
+ return false;
+ }
+
+ return a.withCredentials != undefined;
+ })();
+
+ /**
+ * Detect webkit.
+ *
+ * @api public
+ */
+
+ util.ua.webkit = 'undefined' != typeof navigator
+ && /webkit/i.test(navigator.userAgent);
+
+ /**
+ * Detect iPad/iPhone/iPod.
+ *
+ * @api public
+ */
+
+ util.ua.iDevice = 'undefined' != typeof navigator
+ && /iPad|iPhone|iPod/i.test(navigator.userAgent);
+
+ })('undefined' != typeof io ? io : module.exports, global);
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.EventEmitter = EventEmitter;
+
+ /**
+ * Event emitter constructor.
+ *
+ * @api public.
+ */
+
+ function EventEmitter () {};
+
+ /**
+ * Adds a listener
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.on = function (name, fn) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = fn;
+ } else if (io.util.isArray(this.$events[name])) {
+ this.$events[name].push(fn);
+ } else {
+ this.$events[name] = [this.$events[name], fn];
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+ /**
+ * Adds a volatile listener.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.once = function (name, fn) {
+ var self = this;
+
+ function on () {
+ self.removeListener(name, on);
+ fn.apply(this, arguments);
+ };
+
+ on.listener = fn;
+ this.on(name, on);
+
+ return this;
+ };
+
+ /**
+ * Removes a listener.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.removeListener = function (name, fn) {
+ if (this.$events && this.$events[name]) {
+ var list = this.$events[name];
+
+ if (io.util.isArray(list)) {
+ var pos = -1;
+
+ for (var i = 0, l = list.length; i < l; i++) {
+ if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {
+ pos = i;
+ break;
+ }
+ }
+
+ if (pos < 0) {
+ return this;
+ }
+
+ list.splice(pos, 1);
+
+ if (!list.length) {
+ delete this.$events[name];
+ }
+ } else if (list === fn || (list.listener && list.listener === fn)) {
+ delete this.$events[name];
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Removes all listeners for an event.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.removeAllListeners = function (name) {
+ if (name === undefined) {
+ this.$events = {};
+ return this;
+ }
+
+ if (this.$events && this.$events[name]) {
+ this.$events[name] = null;
+ }
+
+ return this;
+ };
+
+ /**
+ * Gets all listeners for a certain event.
+ *
+ * @api publci
+ */
+
+ EventEmitter.prototype.listeners = function (name) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = [];
+ }
+
+ if (!io.util.isArray(this.$events[name])) {
+ this.$events[name] = [this.$events[name]];
+ }
+
+ return this.$events[name];
+ };
+
+ /**
+ * Emits an event.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.emit = function (name) {
+ if (!this.$events) {
+ return false;
+ }
+
+ var handler = this.$events[name];
+
+ if (!handler) {
+ return false;
+ }
+
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ if ('function' == typeof handler) {
+ handler.apply(this, args);
+ } else if (io.util.isArray(handler)) {
+ var listeners = handler.slice();
+
+ for (var i = 0, l = listeners.length; i < l; i++) {
+ listeners[i].apply(this, args);
+ }
+ } else {
+ return false;
+ }
+
+ return true;
+ };
+
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ );
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ /**
+ * Based on JSON2 (http://www.JSON.org/js.html).
+ */
+
+ (function (exports, nativeJSON) {
+ "use strict";
+
+ // use native JSON if it's available
+ if (nativeJSON && nativeJSON.parse){
+ return exports.JSON = {
+ parse: nativeJSON.parse
+ , stringify: nativeJSON.stringify
+ };
+ }
+
+ var JSON = exports.JSON = {};
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ function date(d, key) {
+ return isFinite(d.valueOf()) ?
+ d.getUTCFullYear() + '-' +
+ f(d.getUTCMonth() + 1) + '-' +
+ f(d.getUTCDate()) + 'T' +
+ f(d.getUTCHours()) + ':' +
+ f(d.getUTCMinutes()) + ':' +
+ f(d.getUTCSeconds()) + 'Z' : null;
+ };
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+ // If the string contains no control characters, no quote characters, and no
+ // backslash characters, then we can safely slap some quotes around it.
+ // Otherwise we must also replace the offending characters with safe escape
+ // sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' : '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+ // Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+ // If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value instanceof Date) {
+ value = date(key);
+ }
+
+ // If we were called with a replacer function, then call the replacer to
+ // obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+ // What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+ // JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+ // If the value is a boolean or null, convert it to a string. Note:
+ // typeof null does not produce 'null'. The case is included here in
+ // the remote chance that this gets fixed someday.
+
+ return String(value);
+
+ // If the type is 'object', we might be dealing with an object or an array or
+ // null.
+
+ case 'object':
+
+ // Due to a specification blunder in ECMAScript, typeof null is 'object',
+ // so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+ // Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+ // Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+ // The value is an array. Stringify every element. Use null as a placeholder
+ // for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+ // Join all of the elements together, separated with commas, and wrap them in
+ // brackets.
+
+ v = partial.length === 0 ? '[]' : gap ?
+ '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+ // If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ if (typeof rep[i] === 'string') {
+ k = rep[i];
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+ // Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+ // Join all of the member texts together, separated with commas,
+ // and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' : gap ?
+ '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
+ '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+ // If the JSON object does not yet have a stringify method, give it one.
+
+ JSON.stringify = function (value, replacer, space) {
+
+ // The stringify method takes a value and an optional replacer, and an optional
+ // space parameter, and returns a JSON text. The replacer can be a function
+ // that can replace values, or an array of strings that will select the keys.
+ // A default replacer method can be provided. Use of the space parameter can
+ // produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+ // If the space parameter is a number, make an indent string containing that
+ // many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+ // If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+ // If there is a replacer, it must be a function or an array.
+ // Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+ // Make a fake root object containing our value under the key of ''.
+ // Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+
+ // If the JSON object does not yet have a parse method, give it one.
+
+ JSON.parse = function (text, reviver) {
+ // The parse method takes a text and an optional reviver function, and returns
+ // a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+ // The walk method is used to recursively walk the resulting structure so
+ // that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+ // Parsing happens in four stages. In the first stage, we replace certain
+ // Unicode characters with escape sequences. JavaScript handles many characters
+ // incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+ // In the second stage, we run the text against regular expressions that look
+ // for non-JSON patterns. We are especially concerned with '()' and 'new'
+ // because they can cause invocation, and '=' because it can cause mutation.
+ // But just to be safe, we want to reject all unexpected forms.
+
+ // We split the second stage into 4 regexp operations in order to work around
+ // crippling inefficiencies in IE's and Safari's regexp engines. First we
+ // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+ // replace all simple value tokens with ']' characters. Third, we delete all
+ // open brackets that follow a colon or comma or that begin the text. Finally,
+ // we look to see that the remaining characters are only whitespace or ']' or
+ // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/
+ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+ // In the third stage we use the eval function to compile the text into a
+ // JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+ // in JavaScript: it can begin a block or an object literal. We wrap the text
+ // in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+ // In the optional fourth stage, we recursively walk the new structure, passing
+ // each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+ // If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , typeof JSON !== 'undefined' ? JSON : undefined
+ );
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io) {
+
+ /**
+ * Parser namespace.
+ *
+ * @namespace
+ */
+
+ var parser = exports.parser = {};
+
+ /**
+ * Packet types.
+ */
+
+ var packets = parser.packets = [
+ 'disconnect'
+ , 'connect'
+ , 'heartbeat'
+ , 'message'
+ , 'json'
+ , 'event'
+ , 'ack'
+ , 'error'
+ , 'noop'
+ ];
+
+ /**
+ * Errors reasons.
+ */
+
+ var reasons = parser.reasons = [
+ 'transport not supported'
+ , 'client not handshaken'
+ , 'unauthorized'
+ ];
+
+ /**
+ * Errors advice.
+ */
+
+ var advice = parser.advice = [
+ 'reconnect'
+ ];
+
+ /**
+ * Shortcuts.
+ */
+
+ var JSON = io.JSON
+ , indexOf = io.util.indexOf;
+
+ /**
+ * Encodes a packet.
+ *
+ * @api private
+ */
+
+ parser.encodePacket = function (packet) {
+ var type = indexOf(packets, packet.type)
+ , id = packet.id || ''
+ , endpoint = packet.endpoint || ''
+ , ack = packet.ack
+ , data = null;
+
+ switch (packet.type) {
+ case 'error':
+ var reason = packet.reason ? indexOf(reasons, packet.reason) : ''
+ , adv = packet.advice ? indexOf(advice, packet.advice) : '';
+
+ if (reason !== '' || adv !== '')
+ data = reason + (adv !== '' ? ('+' + adv) : '');
+
+ break;
+
+ case 'message':
+ if (packet.data !== '')
+ data = packet.data;
+ break;
+
+ case 'event':
+ var ev = { name: packet.name };
+
+ if (packet.args && packet.args.length) {
+ ev.args = packet.args;
+ }
+
+ data = JSON.stringify(ev);
+ break;
+
+ case 'json':
+ data = JSON.stringify(packet.data);
+ break;
+
+ case 'connect':
+ if (packet.qs)
+ data = packet.qs;
+ break;
+
+ case 'ack':
+ data = packet.ackId
+ + (packet.args && packet.args.length
+ ? '+' + JSON.stringify(packet.args) : '');
+ break;
+ }
+
+ // construct packet with required fragments
+ var encoded = [
+ type
+ , id + (ack == 'data' ? '+' : '')
+ , endpoint
+ ];
+
+ // data fragment is optional
+ if (data !== null && data !== undefined)
+ encoded.push(data);
+
+ return encoded.join(':');
+ };
+
+ /**
+ * Encodes multiple messages (payload).
+ *
+ * @param {Array} messages
+ * @api private
+ */
+
+ parser.encodePayload = function (packets) {
+ var decoded = '';
+
+ if (packets.length == 1)
+ return packets[0];
+
+ for (var i = 0, l = packets.length; i < l; i++) {
+ var packet = packets[i];
+ decoded += '\ufffd' + packet.length + '\ufffd' + packets[i];
+ }
+
+ return decoded;
+ };
+
+ /**
+ * Decodes a packet
+ *
+ * @api private
+ */
+
+ var regexp = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;
+
+ parser.decodePacket = function (data) {
+ var pieces = data.match(regexp);
+
+ if (!pieces) return {};
+
+ var id = pieces[2] || ''
+ , data = pieces[5] || ''
+ , packet = {
+ type: packets[pieces[1]]
+ , endpoint: pieces[4] || ''
+ };
+
+ // whether we need to acknowledge the packet
+ if (id) {
+ packet.id = id;
+ if (pieces[3])
+ packet.ack = 'data';
+ else
+ packet.ack = true;
+ }
+
+ // handle different packet types
+ switch (packet.type) {
+ case 'error':
+ var pieces = data.split('+');
+ packet.reason = reasons[pieces[0]] || '';
+ packet.advice = advice[pieces[1]] || '';
+ break;
+
+ case 'message':
+ packet.data = data || '';
+ break;
+
+ case 'event':
+ try {
+ var opts = JSON.parse(data);
+ packet.name = opts.name;
+ packet.args = opts.args;
+ } catch (e) { }
+
+ packet.args = packet.args || [];
+ break;
+
+ case 'json':
+ try {
+ packet.data = JSON.parse(data);
+ } catch (e) { }
+ break;
+
+ case 'connect':
+ packet.qs = data || '';
+ break;
+
+ case 'ack':
+ var pieces = data.match(/^([0-9]+)(\+)?(.*)/);
+ if (pieces) {
+ packet.ackId = pieces[1];
+ packet.args = [];
+
+ if (pieces[3]) {
+ try {
+ packet.args = pieces[3] ? JSON.parse(pieces[3]) : [];
+ } catch (e) { }
+ }
+ }
+ break;
+
+ case 'disconnect':
+ case 'heartbeat':
+ break;
+ };
+
+ return packet;
+ };
+
+ /**
+ * Decodes data payload. Detects multiple messages
+ *
+ * @return {Array} messages
+ * @api public
+ */
+
+ parser.decodePayload = function (data) {
+ // IE doesn't like data[i] for unicode chars, charAt works fine
+ if (data.charAt(0) == '\ufffd') {
+ var ret = [];
+
+ for (var i = 1, length = ''; i < data.length; i++) {
+ if (data.charAt(i) == '\ufffd') {
+ ret.push(parser.decodePacket(data.substr(i + 1).substr(0, length)));
+ i += Number(length) + 1;
+ length = '';
+ } else {
+ length += data.charAt(i);
+ }
+ }
+
+ return ret;
+ } else {
+ return [parser.decodePacket(data)];
+ }
+ };
+
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ );
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.Transport = Transport;
+
+ /**
+ * This is the transport template for all supported transport methods.
+ *
+ * @constructor
+ * @api public
+ */
+
+ function Transport (socket, sessid) {
+ this.socket = socket;
+ this.sessid = sessid;
+ };
+
+ /**
+ * Apply EventEmitter mixin.
+ */
+
+ io.util.mixin(Transport, io.EventEmitter);
+
+
+ /**
+ * Indicates whether heartbeats is enabled for this transport
+ *
+ * @api private
+ */
+
+ Transport.prototype.heartbeats = function () {
+ return true;
+ };
+
+ /**
+ * Handles the response from the server. When a new response is received
+ * it will automatically update the timeout, decode the message and
+ * forwards the response to the onMessage function for further processing.
+ *
+ * @param {String} data Response from the server.
+ * @api private
+ */
+
+ Transport.prototype.onData = function (data) {
+ this.clearCloseTimeout();
+
+ // If the connection in currently open (or in a reopening state) reset the close
+ // timeout since we have just received data. This check is necessary so
+ // that we don't reset the timeout on an explicitly disconnected connection.
+ if (this.socket.connected || this.socket.connecting || this.socket.reconnecting) {
+ this.setCloseTimeout();
+ }
+
+ if (data !== '') {
+ // todo: we should only do decodePayload for xhr transports
+ var msgs = io.parser.decodePayload(data);
+
+ if (msgs && msgs.length) {
+ for (var i = 0, l = msgs.length; i < l; i++) {
+ this.onPacket(msgs[i]);
+ }
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Handles packets.
+ *
+ * @api private
+ */
+
+ Transport.prototype.onPacket = function (packet) {
+ this.socket.setHeartbeatTimeout();
+
+ if (packet.type == 'heartbeat') {
+ return this.onHeartbeat();
+ }
+
+ if (packet.type == 'connect' && packet.endpoint == '') {
+ this.onConnect();
+ }
+
+ if (packet.type == 'error' && packet.advice == 'reconnect') {
+ this.isOpen = false;
+ }
+
+ this.socket.onPacket(packet);
+
+ return this;
+ };
+
+ /**
+ * Sets close timeout
+ *
+ * @api private
+ */
+
+ Transport.prototype.setCloseTimeout = function () {
+ if (!this.closeTimeout) {
+ var self = this;
+
+ this.closeTimeout = setTimeout(function () {
+ self.onDisconnect();
+ }, this.socket.closeTimeout);
+ }
+ };
+
+ /**
+ * Called when transport disconnects.
+ *
+ * @api private
+ */
+
+ Transport.prototype.onDisconnect = function () {
+ if (this.isOpen) this.close();
+ this.clearTimeouts();
+ this.socket.onDisconnect();
+ return this;
+ };
+
+ /**
+ * Called when transport connects
+ *
+ * @api private
+ */
+
+ Transport.prototype.onConnect = function () {
+ this.socket.onConnect();
+ return this;
+ };
+
+ /**
+ * Clears close timeout
+ *
+ * @api private
+ */
+
+ Transport.prototype.clearCloseTimeout = function () {
+ if (this.closeTimeout) {
+ clearTimeout(this.closeTimeout);
+ this.closeTimeout = null;
+ }
+ };
+
+ /**
+ * Clear timeouts
+ *
+ * @api private
+ */
+
+ Transport.prototype.clearTimeouts = function () {
+ this.clearCloseTimeout();
+
+ if (this.reopenTimeout) {
+ clearTimeout(this.reopenTimeout);
+ }
+ };
+
+ /**
+ * Sends a packet
+ *
+ * @param {Object} packet object.
+ * @api private
+ */
+
+ Transport.prototype.packet = function (packet) {
+ this.send(io.parser.encodePacket(packet));
+ };
+
+ /**
+ * Send the received heartbeat message back to server. So the server
+ * knows we are still connected.
+ *
+ * @param {String} heartbeat Heartbeat response from the server.
+ * @api private
+ */
+
+ Transport.prototype.onHeartbeat = function (heartbeat) {
+ this.packet({ type: 'heartbeat' });
+ };
+
+ /**
+ * Called when the transport opens.
+ *
+ * @api private
+ */
+
+ Transport.prototype.onOpen = function () {
+ this.isOpen = true;
+ this.clearCloseTimeout();
+ this.socket.onOpen();
+ };
+
+ /**
+ * Notifies the base when the connection with the Socket.IO server
+ * has been disconnected.
+ *
+ * @api private
+ */
+
+ Transport.prototype.onClose = function () {
+ var self = this;
+
+ /* FIXME: reopen delay causing a infinit loop
+ this.reopenTimeout = setTimeout(function () {
+ self.open();
+ }, this.socket.options['reopen delay']);*/
+
+ this.isOpen = false;
+ this.socket.onClose();
+ this.onDisconnect();
+ };
+
+ /**
+ * Generates a connection url based on the Socket.IO URL Protocol.
+ * See <https://github.com/learnboost/socket.io-node/> for more details.
+ *
+ * @returns {String} Connection url
+ * @api private
+ */
+
+ Transport.prototype.prepareUrl = function () {
+ var options = this.socket.options;
+
+ return this.scheme() + '://'
+ + options.host + ':' + options.port + '/'
+ + options.resource + '/' + io.protocol
+ + '/' + this.name + '/' + this.sessid;
+ };
+
+ /**
+ * Checks if the transport is ready to start a connection.
+ *
+ * @param {Socket} socket The socket instance that needs a transport
+ * @param {Function} fn The callback
+ * @api private
+ */
+
+ Transport.prototype.ready = function (socket, fn) {
+ fn.call(this);
+ };
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ );
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io, global) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.Socket = Socket;
+
+ /**
+ * Create a new `Socket.IO client` which can establish a persistent
+ * connection with a Socket.IO enabled server.
+ *
+ * @api public
+ */
+
+ function Socket (options) {
+ this.options = {
+ port: 80
+ , secure: false
+ , document: 'document' in global ? document : false
+ , resource: 'socket.io'
+ , transports: io.transports
+ , 'connect timeout': 10000
+ , 'try multiple transports': true
+ , 'reconnect': true
+ , 'reconnection delay': 500
+ , 'reconnection limit': Infinity
+ , 'reopen delay': 3000
+ , 'max reconnection attempts': 10
+ , 'sync disconnect on unload': false
+ , 'auto connect': true
+ , 'flash policy port': 10843
+ , 'manualFlush': false
+ };
+
+ io.util.merge(this.options, options);
+
+ this.connected = false;
+ this.open = false;
+ this.connecting = false;
+ this.reconnecting = false;
+ this.namespaces = {};
+ this.buffer = [];
+ this.doBuffer = false;
+
+ if (this.options['sync disconnect on unload'] &&
+ (!this.isXDomain() || io.util.ua.hasCORS)) {
+ var self = this;
+ io.util.on(global, 'beforeunload', function () {
+ self.disconnectSync();
+ }, false);
+ }
+
+ if (this.options['auto connect']) {
+ this.connect();
+ }
+ };
+
+ /**
+ * Apply EventEmitter mixin.
+ */
+
+ io.util.mixin(Socket, io.EventEmitter);
+
+ /**
+ * Returns a namespace listener/emitter for this socket
+ *
+ * @api public
+ */
+
+ Socket.prototype.of = function (name) {
+ if (!this.namespaces[name]) {
+ this.namespaces[name] = new io.SocketNamespace(this, name);
+
+ if (name !== '') {
+ this.namespaces[name].packet({ type: 'connect' });
+ }
+ }
+
+ return this.namespaces[name];
+ };
+
+ /**
+ * Emits the given event to the Socket and all namespaces
+ *
+ * @api private
+ */
+
+ Socket.prototype.publish = function () {
+ this.emit.apply(this, arguments);
+
+ var nsp;
+
+ for (var i in this.namespaces) {
+ if (this.namespaces.hasOwnProperty(i)) {
+ nsp = this.of(i);
+ nsp.$emit.apply(nsp, arguments);
+ }
+ }
+ };
+
+ /**
+ * Performs the handshake
+ *
+ * @api private
+ */
+
+ function empty () { };
+
+ Socket.prototype.handshake = function (fn) {
+ var self = this
+ , options = this.options;
+
+ function complete (data) {
+ if (data instanceof Error) {
+ self.connecting = false;
+ self.onError(data.message);
+ } else {
+ fn.apply(null, data.split(':'));
+ }
+ };
+
+ var url = [
+ 'http' + (options.secure ? 's' : '') + ':/'
+ , options.host + ':' + options.port
+ , options.resource
+ , io.protocol
+ , io.util.query(this.options.query, 't=' + +new Date)
+ ].join('/');
+
+ if (this.isXDomain() && !io.util.ua.hasCORS) {
+ var insertAt = document.getElementsByTagName('script')[0]
+ , script = document.createElement('script');
+
+ script.src = url + '&jsonp=' + io.j.length;
+ insertAt.parentNode.insertBefore(script, insertAt);
+
+ io.j.push(function (data) {
+ complete(data);
+ script.parentNode.removeChild(script);
+ });
+ } else {
+ var xhr = io.util.request();
+
+ xhr.open('GET', url, true);
+ if (this.isXDomain()) {
+ xhr.withCredentials = true;
+ }
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState == 4) {
+ xhr.onreadystatechange = empty;
+
+ if (xhr.status == 200) {
+ complete(xhr.responseText);
+ } else if (xhr.status == 403) {
+ self.onError(xhr.responseText);
+ } else {
+ self.connecting = false;
+ !self.reconnecting && self.onError(xhr.responseText);
+ }
+ }
+ };
+ xhr.send(null);
+ }
+ };
+
+ /**
+ * Find an available transport based on the options supplied in the constructor.
+ *
+ * @api private
+ */
+
+ Socket.prototype.getTransport = function (override) {
+ var transports = override || this.transports, match;
+
+ for (var i = 0, transport; transport = transports[i]; i++) {
+ if (io.Transport[transport]
+ && io.Transport[transport].check(this)
+ && (!this.isXDomain() || io.Transport[transport].xdomainCheck(this))) {
+ return new io.Transport[transport](this, this.sessionid);
+ }
+ }
+
+ return null;
+ };
+
+ /**
+ * Connects to the server.
+ *
+ * @param {Function} [fn] Callback.
+ * @returns {io.Socket}
+ * @api public
+ */
+
+ Socket.prototype.connect = function (fn) {
+ if (this.connecting) {
+ return this;
+ }
+
+ var self = this;
+ self.connecting = true;
+
+ this.handshake(function (sid, heartbeat, close, transports) {
+ self.sessionid = sid;
+ self.closeTimeout = close * 1000;
+ self.heartbeatTimeout = heartbeat * 1000;
+ if(!self.transports)
+ self.transports = self.origTransports = (transports ? io.util.intersect(
+ transports.split(',')
+ , self.options.transports
+ ) : self.options.transports);
+
+ self.setHeartbeatTimeout();
+
+ function connect (transports){
+ if (self.transport) self.transport.clearTimeouts();
+
+ self.transport = self.getTransport(transports);
+ if (!self.transport) return self.publish('connect_failed');
+
+ // once the transport is ready
+ self.transport.ready(self, function () {
+ self.connecting = true;
+ self.publish('connecting', self.transport.name);
+ self.transport.open();
+
+ if (self.options['connect timeout']) {
+ self.connectTimeoutTimer = setTimeout(function () {
+ if (!self.connected) {
+ self.connecting = false;
+
+ if (self.options['try multiple transports']) {
+ var remaining = self.transports;
+
+ while (remaining.length > 0 && remaining.splice(0,1)[0] !=
+ self.transport.name) {}
+
+ if (remaining.length){
+ connect(remaining);
+ } else {
+ self.publish('connect_failed');
+ }
+ }
+ }
+ }, self.options['connect timeout']);
+ }
+ });
+ }
+
+ connect(self.transports);
+
+ self.once('connect', function (){
+ clearTimeout(self.connectTimeoutTimer);
+
+ fn && typeof fn == 'function' && fn();
+ });
+ });
+
+ return this;
+ };
+
+ /**
+ * Clears and sets a new heartbeat timeout using the value given by the
+ * server during the handshake.
+ *
+ * @api private
+ */
+
+ Socket.prototype.setHeartbeatTimeout = function () {
+ clearTimeout(this.heartbeatTimeoutTimer);
+ if(this.transport && !this.transport.heartbeats()) return;
+
+ var self = this;
+ this.heartbeatTimeoutTimer = setTimeout(function () {
+ self.transport.onClose();
+ }, this.heartbeatTimeout);
+ };
+
+ /**
+ * Sends a message.
+ *
+ * @param {Object} data packet.
+ * @returns {io.Socket}
+ * @api public
+ */
+
+ Socket.prototype.packet = function (data) {
+ if (this.connected && !this.doBuffer) {
+ this.transport.packet(data);
+ } else {
+ this.buffer.push(data);
+ }
+
+ return this;
+ };
+
+ /**
+ * Sets buffer state
+ *
+ * @api private
+ */
+
+ Socket.prototype.setBuffer = function (v) {
+ this.doBuffer = v;
+
+ if (!v && this.connected && this.buffer.length) {
+ if (!this.options['manualFlush']) {
+ this.flushBuffer();
+ }
+ }
+ };
+
+ /**
+ * Flushes the buffer data over the wire.
+ * To be invoked manually when 'manualFlush' is set to true.
+ *
+ * @api public
+ */
+
+ Socket.prototype.flushBuffer = function() {
+ this.transport.payload(this.buffer);
+ this.buffer = [];
+ };
+
+
+ /**
+ * Disconnect the established connect.
+ *
+ * @returns {io.Socket}
+ * @api public
+ */
+
+ Socket.prototype.disconnect = function () {
+ if (this.connected || this.connecting) {
+ if (this.open) {
+ this.of('').packet({ type: 'disconnect' });
+ }
+
+ // handle disconnection immediately
+ this.onDisconnect('booted');
+ }
+
+ return this;
+ };
+
+ /**
+ * Disconnects the socket with a sync XHR.
+ *
+ * @api private
+ */
+
+ Socket.prototype.disconnectSync = function () {
+ // ensure disconnection
+ var xhr = io.util.request();
+ var uri = [
+ 'http' + (this.options.secure ? 's' : '') + ':/'
+ , this.options.host + ':' + this.options.port
+ , this.options.resource
+ , io.protocol
+ , ''
+ , this.sessionid
+ ].join('/') + '/?disconnect=1';
+
+ xhr.open('GET', uri, false);
+ xhr.send(null);
+
+ // handle disconnection immediately
+ this.onDisconnect('booted');
+ };
+
+ /**
+ * Check if we need to use cross domain enabled transports. Cross domain would
+ * be a different port or different domain name.
+ *
+ * @returns {Boolean}
+ * @api private
+ */
+
+ Socket.prototype.isXDomain = function () {
+
+ var port = global.location.port ||
+ ('https:' == global.location.protocol ? 443 : 80);
+
+ return this.options.host !== global.location.hostname
+ || this.options.port != port;
+ };
+
+ /**
+ * Called upon handshake.
+ *
+ * @api private
+ */
+
+ Socket.prototype.onConnect = function () {
+ if (!this.connected) {
+ this.connected = true;
+ this.connecting = false;
+ if (!this.doBuffer) {
+ // make sure to flush the buffer
+ this.setBuffer(false);
+ }
+ this.emit('connect');
+ }
+ };
+
+ /**
+ * Called when the transport opens
+ *
+ * @api private
+ */
+
+ Socket.prototype.onOpen = function () {
+ this.open = true;
+ };
+
+ /**
+ * Called when the transport closes.
+ *
+ * @api private
+ */
+
+ Socket.prototype.onClose = function () {
+ this.open = false;
+ clearTimeout(this.heartbeatTimeoutTimer);
+ };
+
+ /**
+ * Called when the transport first opens a connection
+ *
+ * @param text
+ */
+
+ Socket.prototype.onPacket = function (packet) {
+ this.of(packet.endpoint).onPacket(packet);
+ };
+
+ /**
+ * Handles an error.
+ *
+ * @api private
+ */
+
+ Socket.prototype.onError = function (err) {
+ if (err && err.advice) {
+ if (err.advice === 'reconnect' && (this.connected || this.connecting)) {
+ this.disconnect();
+ if (this.options.reconnect) {
+ this.reconnect();
+ }
+ }
+ }
+
+ this.publish('error', err && err.reason ? err.reason : err);
+ };
+
+ /**
+ * Called when the transport disconnects.
+ *
+ * @api private
+ */
+
+ Socket.prototype.onDisconnect = function (reason) {
+ var wasConnected = this.connected
+ , wasConnecting = this.connecting;
+
+ this.connected = false;
+ this.connecting = false;
+ this.open = false;
+
+ if (wasConnected || wasConnecting) {
+ this.transport.close();
+ this.transport.clearTimeouts();
+ if (wasConnected) {
+ this.publish('disconnect', reason);
+
+ if ('booted' != reason && this.options.reconnect && !this.reconnecting) {
+ this.reconnect();
+ }
+ }
+ }
+ };
+
+ /**
+ * Called upon reconnection.
+ *
+ * @api private
+ */
+
+ Socket.prototype.reconnect = function () {
+ this.reconnecting = true;
+ this.reconnectionAttempts = 0;
+ this.reconnectionDelay = this.options['reconnection delay'];
+
+ var self = this
+ , maxAttempts = this.options['max reconnection attempts']
+ , tryMultiple = this.options['try multiple transports']
+ , limit = this.options['reconnection limit'];
+
+ function reset () {
+ if (self.connected) {
+ for (var i in self.namespaces) {
+ if (self.namespaces.hasOwnProperty(i) && '' !== i) {
+ self.namespaces[i].packet({ type: 'connect' });
+ }
+ }
+ self.publish('reconnect', self.transport.name, self.reconnectionAttempts);
+ }
+
+ clearTimeout(self.reconnectionTimer);
+
+ self.removeListener('connect_failed', maybeReconnect);
+ self.removeListener('connect', maybeReconnect);
+
+ self.reconnecting = false;
+
+ delete self.reconnectionAttempts;
+ delete self.reconnectionDelay;
+ delete self.reconnectionTimer;
+ delete self.redoTransports;
+
+ self.options['try multiple transports'] = tryMultiple;
+ };
+
+ function maybeReconnect () {
+ if (!self.reconnecting) {
+ return;
+ }
+
+ if (self.connected) {
+ return reset();
+ };
+
+ if (self.connecting && self.reconnecting) {
+ return self.reconnectionTimer = setTimeout(maybeReconnect, 1000);
+ }
+
+ if (self.reconnectionAttempts++ >= maxAttempts) {
+ if (!self.redoTransports) {
+ self.on('connect_failed', maybeReconnect);
+ self.options['try multiple transports'] = true;
+ self.transports = self.origTransports;
+ self.transport = self.getTransport();
+ self.redoTransports = true;
+ self.connect();
+ } else {
+ self.publish('reconnect_failed');
+ reset();
+ }
+ } else {
+ if (self.reconnectionDelay < limit) {
+ self.reconnectionDelay *= 2; // exponential back off
+ }
+
+ self.connect();
+ self.publish('reconnecting', self.reconnectionDelay, self.reconnectionAttempts);
+ self.reconnectionTimer = setTimeout(maybeReconnect, self.reconnectionDelay);
+ }
+ };
+
+ this.options['try multiple transports'] = false;
+ this.reconnectionTimer = setTimeout(maybeReconnect, this.reconnectionDelay);
+
+ this.on('connect', maybeReconnect);
+ };
+
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ , global
+ );
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.SocketNamespace = SocketNamespace;
+
+ /**
+ * Socket namespace constructor.
+ *
+ * @constructor
+ * @api public
+ */
+
+ function SocketNamespace (socket, name) {
+ this.socket = socket;
+ this.name = name || '';
+ this.flags = {};
+ this.json = new Flag(this, 'json');
+ this.ackPackets = 0;
+ this.acks = {};
+ };
+
+ /**
+ * Apply EventEmitter mixin.
+ */
+
+ io.util.mixin(SocketNamespace, io.EventEmitter);
+
+ /**
+ * Copies emit since we override it
+ *
+ * @api private
+ */
+
+ SocketNamespace.prototype.$emit = io.EventEmitter.prototype.emit;
+
+ /**
+ * Creates a new namespace, by proxying the request to the socket. This
+ * allows us to use the synax as we do on the server.
+ *
+ * @api public
+ */
+
+ SocketNamespace.prototype.of = function () {
+ return this.socket.of.apply(this.socket, arguments);
+ };
+
+ /**
+ * Sends a packet.
+ *
+ * @api private
+ */
+
+ SocketNamespace.prototype.packet = function (packet) {
+ packet.endpoint = this.name;
+ this.socket.packet(packet);
+ this.flags = {};
+ return this;
+ };
+
+ /**
+ * Sends a message
+ *
+ * @api public
+ */
+
+ SocketNamespace.prototype.send = function (data, fn) {
+ var packet = {
+ type: this.flags.json ? 'json' : 'message'
+ , data: data
+ };
+
+ if ('function' == typeof fn) {
+ packet.id = ++this.ackPackets;
+ packet.ack = true;
+ this.acks[packet.id] = fn;
+ }
+
+ return this.packet(packet);
+ };
+
+ /**
+ * Emits an event
+ *
+ * @api public
+ */
+
+ SocketNamespace.prototype.emit = function (name) {
+ var args = Array.prototype.slice.call(arguments, 1)
+ , lastArg = args[args.length - 1]
+ , packet = {
+ type: 'event'
+ , name: name
+ };
+
+ if ('function' == typeof lastArg) {
+ packet.id = ++this.ackPackets;
+ packet.ack = 'data';
+ this.acks[packet.id] = lastArg;
+ args = args.slice(0, args.length - 1);
+ }
+
+ packet.args = args;
+
+ return this.packet(packet);
+ };
+
+ /**
+ * Disconnects the namespace
+ *
+ * @api private
+ */
+
+ SocketNamespace.prototype.disconnect = function () {
+ if (this.name === '') {
+ this.socket.disconnect();
+ } else {
+ this.packet({ type: 'disconnect' });
+ this.$emit('disconnect');
+ }
+
+ return this;
+ };
+
+ /**
+ * Handles a packet
+ *
+ * @api private
+ */
+
+ SocketNamespace.prototype.onPacket = function (packet) {
+ var self = this;
+
+ function ack () {
+ self.packet({
+ type: 'ack'
+ , args: io.util.toArray(arguments)
+ , ackId: packet.id
+ });
+ };
+
+ switch (packet.type) {
+ case 'connect':
+ this.$emit('connect');
+ break;
+
+ case 'disconnect':
+ if (this.name === '') {
+ this.socket.onDisconnect(packet.reason || 'booted');
+ } else {
+ this.$emit('disconnect', packet.reason);
+ }
+ break;
+
+ case 'message':
+ case 'json':
+ var params = ['message', packet.data];
+
+ if (packet.ack == 'data') {
+ params.push(ack);
+ } else if (packet.ack) {
+ this.packet({ type: 'ack', ackId: packet.id });
+ }
+
+ this.$emit.apply(this, params);
+ break;
+
+ case 'event':
+ var params = [packet.name].concat(packet.args);
+
+ if (packet.ack == 'data')
+ params.push(ack);
+
+ this.$emit.apply(this, params);
+ break;
+
+ case 'ack':
+ if (this.acks[packet.ackId]) {
+ this.acks[packet.ackId].apply(this, packet.args);
+ delete this.acks[packet.ackId];
+ }
+ break;
+
+ case 'error':
+ if (packet.advice){
+ this.socket.onError(packet);
+ } else {
+ if (packet.reason == 'unauthorized') {
+ this.$emit('connect_failed', packet.reason);
+ } else {
+ this.$emit('error', packet.reason);
+ }
+ }
+ break;
+ }
+ };
+
+ /**
+ * Flag interface.
+ *
+ * @api private
+ */
+
+ function Flag (nsp, name) {
+ this.namespace = nsp;
+ this.name = name;
+ };
+
+ /**
+ * Send a message
+ *
+ * @api public
+ */
+
+ Flag.prototype.send = function () {
+ this.namespace.flags[this.name] = true;
+ this.namespace.send.apply(this.namespace, arguments);
+ };
+
+ /**
+ * Emit an event
+ *
+ * @api public
+ */
+
+ Flag.prototype.emit = function () {
+ this.namespace.flags[this.name] = true;
+ this.namespace.emit.apply(this.namespace, arguments);
+ };
+
+ })(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ );
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io, global) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.websocket = WS;
+
+ /**
+ * The WebSocket transport uses the HTML5 WebSocket API to establish an
+ * persistent connection with the Socket.IO server. This transport will also
+ * be inherited by the FlashSocket fallback as it provides a API compatible
+ * polyfill for the WebSockets.
+ *
+ * @constructor
+ * @extends {io.Transport}
+ * @api public
+ */
+
+ function WS (socket) {
+ io.Transport.apply(this, arguments);
+ };
+
+ /**
+ * Inherits from Transport.
+ */
+
+ io.util.inherit(WS, io.Transport);
+
+ /**
+ * Transport name
+ *
+ * @api public
+ */
+
+ WS.prototype.name = 'websocket';
+
+ /**
+ * Initializes a new `WebSocket` connection with the Socket.IO server. We attach
+ * all the appropriate listeners to handle the responses from the server.
+ *
+ * @returns {Transport}
+ * @api public
+ */
+
+ WS.prototype.open = function () {
+ var query = io.util.query(this.socket.options.query)
+ , self = this
+ , Socket
+
+
+ if (!Socket) {
+ Socket = global.MozWebSocket || global.WebSocket;
+ }
+
+ this.websocket = new Socket(this.prepareUrl() + query);
+
+ this.websocket.onopen = function () {
+ self.onOpen();
+ self.socket.setBuffer(false);
+ };
+ this.websocket.onmessage = function (ev) {
+ self.onData(ev.data);
+ };
+ this.websocket.onclose = function () {
+ self.onClose();
+ self.socket.setBuffer(true);
+ };
+ this.websocket.onerror = function (e) {
+ self.onError(e);
+ };
+
+ return this;
+ };
+
+ /**
+ * Send a message to the Socket.IO server. The message will automatically be
+ * encoded in the correct message format.
+ *
+ * @returns {Transport}
+ * @api public
+ */
+
+ // Do to a bug in the current IDevices browser, we need to wrap the send in a
+ // setTimeout, when they resume from sleeping the browser will crash if
+ // we don't allow the browser time to detect the socket has been closed
+ if (io.util.ua.iDevice) {
+ WS.prototype.send = function (data) {
+ var self = this;
+ setTimeout(function() {
+ self.websocket.send(data);
+ },0);
+ return this;
+ };
+ } else {
+ WS.prototype.send = function (data) {
+ this.websocket.send(data);
+ return this;
+ };
+ }
+
+ /**
+ * Payload
+ *
+ * @api private
+ */
+
+ WS.prototype.payload = function (arr) {
+ for (var i = 0, l = arr.length; i < l; i++) {
+ this.packet(arr[i]);
+ }
+ return this;
+ };
+
+ /**
+ * Disconnect the established `WebSocket` connection.
+ *
+ * @returns {Transport}
+ * @api public
+ */
+
+ WS.prototype.close = function () {
+ this.websocket.close();
+ return this;
+ };
+
+ /**
+ * Handle the errors that `WebSocket` might be giving when we
+ * are attempting to connect or send messages.
+ *
+ * @param {Error} e The error.
+ * @api private
+ */
+
+ WS.prototype.onError = function (e) {
+ this.socket.onError(e);
+ };
+
+ /**
+ * Returns the appropriate scheme for the URI generation.
+ *
+ * @api private
+ */
+ WS.prototype.scheme = function () {
+ return this.socket.options.secure ? 'wss' : 'ws';
+ };
+
+ /**
+ * Checks if the browser has support for native `WebSockets` and that
+ * it's not the polyfill created for the FlashSocket transport.
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+ WS.check = function () {
+ return ('WebSocket' in global && !('__addTask' in WebSocket))
+ || 'MozWebSocket' in global;
+ };
+
+ /**
+ * Check if the `WebSocket` transport support cross domain communications.
+ *
+ * @returns {Boolean}
+ * @api public
+ */
+
+ WS.xdomainCheck = function () {
+ return true;
+ };
+
+ /**
+ * Add the transport to your public io.transports array.
+ *
+ * @api private
+ */
+
+ io.transports.push('websocket');
+
+ })(
+ 'undefined' != typeof io ? io.Transport : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ , global
+ );
+
+ // Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
+ // License: New BSD License
+ // Reference: http://dev.w3.org/html5/websockets/
+ // Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
+
+ (function() {
+
+ if ('undefined' == typeof window || window.WebSocket) return;
+
+ var console = window.console;
+ if (!console || !console.log || !console.error) {
+ console = {log: function(){ }, error: function(){ }};
+ }
+
+ if (!swfobject.hasFlashPlayerVersion("10.0.0")) {
+ console.error("Flash Player >= 10.0.0 is required.");
+ return;
+ }
+ if (location.protocol == "file:") {
+ console.error(
+ "WARNING: web-socket-js doesn't work in file:///... URL " +
+ "unless you set Flash Security Settings properly. " +
+ "Open the page via Web server i.e. http://...");
+ }
+
+ /**
+ * This class represents a faux web socket.
+ * @param {string} url
+ * @param {array or string} protocols
+ * @param {string} proxyHost
+ * @param {int} proxyPort
+ * @param {string} headers
+ */
+ WebSocket = function(url, protocols, proxyHost, proxyPort, headers) {
+ var self = this;
+ self.__id = WebSocket.__nextId++;
+ WebSocket.__instances[self.__id] = self;
+ self.readyState = WebSocket.CONNECTING;
+ self.bufferedAmount = 0;
+ self.__events = {};
+ if (!protocols) {
+ protocols = [];
+ } else if (typeof protocols == "string") {
+ protocols = [protocols];
+ }
+ // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc.
+ // Otherwise, when onopen fires immediately, onopen is called before it is set.
+ setTimeout(function() {
+ WebSocket.__addTask(function() {
+ WebSocket.__flash.create(
+ self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null);
+ });
+ }, 0);
+ };
+
+ /**
+ * Send data to the web socket.
+ * @param {string} data The data to send to the socket.
+ * @return {boolean} True for success, false for failure.
+ */
+ WebSocket.prototype.send = function(data) {
+ if (this.readyState == WebSocket.CONNECTING) {
+ throw "INVALID_STATE_ERR: Web Socket connection has not been established";
+ }
+ // We use encodeURIComponent() here, because FABridge doesn't work if
+ // the argument includes some characters. We don't use escape() here
+ // because of this:
+ // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Functions#escape_and_unescape_Functions
+ // But it looks decodeURIComponent(encodeURIComponent(s)) doesn't
+ // preserve all Unicode characters either e.g. "\uffff" in Firefox.
+ // Note by wtritch: Hopefully this will not be necessary using ExternalInterface. Will require
+ // additional testing.
+ var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data));
+ if (result < 0) { // success
+ return true;
+ } else {
+ this.bufferedAmount += result;
+ return false;
+ }
+ };
+
+ /**
+ * Close this web socket gracefully.
+ */
+ WebSocket.prototype.close = function() {
+ if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) {
+ return;
+ }
+ this.readyState = WebSocket.CLOSING;
+ WebSocket.__flash.close(this.__id);
+ };
+
+ /**
+ * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
+ *
+ * @param {string} type
+ * @param {function} listener
+ * @param {boolean} useCapture
+ * @return void
+ */
+ WebSocket.prototype.addEventListener = function(type, listener, useCapture) {
+ if (!(type in this.__events)) {
+ this.__events[type] = [];
+ }
+ this.__events[type].push(listener);
+ };
+
+ /**
+ * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
+ *
+ * @param {string} type
+ * @param {function} listener
+ * @param {boolean} useCapture
+ * @return void
+ */
+ WebSocket.prototype.removeEventListener = function(type, listener, useCapture) {
+ if (!(type in this.__events)) return;
+ var events = this.__events[type];
+ for (var i = events.length - 1; i >= 0; --i) {
+ if (events[i] === listener) {
+ events.splice(i, 1);
+ break;
+ }
+ }
+ };
+
+ /**
+ * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
+ *
+ * @param {Event} event
+ * @return void
+ */
+ WebSocket.prototype.dispatchEvent = function(event) {
+ var events = this.__events[event.type] || [];
+ for (var i = 0; i < events.length; ++i) {
+ events[i](event);
+ }
+ var handler = this["on" + event.type];
+ if (handler) handler(event);
+ };
+
+ /**
+ * Handles an event from Flash.
+ * @param {Object} flashEvent
+ */
+ WebSocket.prototype.__handleEvent = function(flashEvent) {
+ if ("readyState" in flashEvent) {
+ this.readyState = flashEvent.readyState;
+ }
+ if ("protocol" in flashEvent) {
+ this.protocol = flashEvent.protocol;
+ }
+
+ var jsEvent;
+ if (flashEvent.type == "open" || flashEvent.type == "error") {
+ jsEvent = this.__createSimpleEvent(flashEvent.type);
+ } else if (flashEvent.type == "close") {
+ // TODO implement jsEvent.wasClean
+ jsEvent = this.__createSimpleEvent("close");
+ } else if (flashEvent.type == "message") {
+ var data = decodeURIComponent(flashEvent.message);
+ jsEvent = this.__createMessageEvent("message", data);
+ } else {
+ throw "unknown event type: " + flashEvent.type;
+ }
+
+ this.dispatchEvent(jsEvent);
+ };
+
+ WebSocket.prototype.__createSimpleEvent = function(type) {
+ if (document.createEvent && window.Event) {
+ var event = document.createEvent("Event");
+ event.initEvent(type, false, false);
+ return event;
+ } else {
+ return {type: type, bubbles: false, cancelable: false};
+ }
+ };
+
+ WebSocket.prototype.__createMessageEvent = function(type, data) {
+ if (document.createEvent && window.MessageEvent && !window.opera) {
+ var event = document.createEvent("MessageEvent");
+ event.initMessageEvent("message", false, false, data, null, null, window, null);
+ return event;
+ } else {
+ // IE and Opera, the latter one truncates the data parameter after any 0x00 bytes.
+ return {type: type, data: data, bubbles: false, cancelable: false};
+ }
+ };
+
+ /**
+ * Define the WebSocket readyState enumeration.
+ */
+ WebSocket.CONNECTING = 0;
+ WebSocket.OPEN = 1;
+ WebSocket.CLOSING = 2;
+ WebSocket.CLOSED = 3;
+
+ WebSocket.__flash = null;
+ WebSocket.__instances = {};
+ WebSocket.__tasks = [];
+ WebSocket.__nextId = 0;
+
+ /**
+ * Load a new flash security policy file.
+ * @param {string} url
+ */
+ WebSocket.loadFlashPolicyFile = function(url){
+ WebSocket.__addTask(function() {
+ WebSocket.__flash.loadManualPolicyFile(url);
+ });
+ };
+
+ /**
+ * Loads WebSocketMain.swf and creates WebSocketMain object in Flash.
+ */
+ WebSocket.__initialize = function() {
+ if (WebSocket.__flash) return;
+
+ if (WebSocket.__swfLocation) {
+ // For backword compatibility.
+ window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation;
+ }
+ if (!window.WEB_SOCKET_SWF_LOCATION) {
+ console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");
+ return;
+ }
+ var container = document.createElement("div");
+ container.id = "webSocketContainer";
+ // Hides Flash box. We cannot use display: none or visibility: hidden because it prevents
+ // Flash from loading at least in IE. So we move it out of the screen at (-100, -100).
+ // But this even doesn't work with Flash Lite (e.g. in Droid Incredible). So with Flash
+ // Lite, we put it at (0, 0). This shows 1x1 box visible at left-top corner but this is
+ // the best we can do as far as we know now.
+ container.style.position = "absolute";
+ if (WebSocket.__isFlashLite()) {
+ container.style.left = "0px";
+ container.style.top = "0px";
+ } else {
+ container.style.left = "-100px";
+ container.style.top = "-100px";
+ }
+ var holder = document.createElement("div");
+ holder.id = "webSocketFlash";
+ container.appendChild(holder);
+ document.body.appendChild(container);
+ // See this article for hasPriority:
+ // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html
+ swfobject.embedSWF(
+ WEB_SOCKET_SWF_LOCATION,
+ "webSocketFlash",
+ "1" /* width */,
+ "1" /* height */,
+ "10.0.0" /* SWF version */,
+ null,
+ null,
+ {hasPriority: true, swliveconnect : true, allowScriptAccess: "always"},
+ null,
+ function(e) {
+ if (!e.success) {
+ console.error("[WebSocket] swfobject.embedSWF failed");
+ }
+ });
+ };
+
+ /**
+ * Called by Flash to notify JS that it's fully loaded and ready
+ * for communication.
+ */
+ WebSocket.__onFlashInitialized = function() {
+ // We need to set a timeout here to avoid round-trip calls
+ // to flash during the initialization process.
+ setTimeout(function() {
+ WebSocket.__flash = document.getElementById("webSocketFlash");
+ WebSocket.__flash.setCallerUrl(location.href);
+ WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
+ for (var i = 0; i < WebSocket.__tasks.length; ++i) {
+ WebSocket.__tasks[i]();
+ }
+ WebSocket.__tasks = [];
+ }, 0);
+ };
+
+ /**
+ * Called by Flash to notify WebSockets events are fired.
+ */
+ WebSocket.__onFlashEvent = function() {
+ setTimeout(function() {
+ try {
+ // Gets events using receiveEvents() instead of getting it from event object
+ // of Flash event. This is to make sure to keep message order.
+ // It seems sometimes Flash events don't arrive in the same order as they are sent.
+ var events = WebSocket.__flash.receiveEvents();
+ for (var i = 0; i < events.length; ++i) {
+ WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]);
+ }
+ } catch (e) {
+ console.error(e);
+ }
+ }, 0);
+ return true;
+ };
+
+ // Called by Flash.
+ WebSocket.__log = function(message) {
+ console.log(decodeURIComponent(message));
+ };
+
+ // Called by Flash.
+ WebSocket.__error = function(message) {
+ console.error(decodeURIComponent(message));
+ };
+
+ WebSocket.__addTask = function(task) {
+ if (WebSocket.__flash) {
+ task();
+ } else {
+ WebSocket.__tasks.push(task);
+ }
+ };
+
+ /**
+ * Test if the browser is running flash lite.
+ * @return {boolean} True if flash lite is running, false otherwise.
+ */
+ WebSocket.__isFlashLite = function() {
+ if (!window.navigator || !window.navigator.mimeTypes) {
+ return false;
+ }
+ var mimeType = window.navigator.mimeTypes["application/x-shockwave-flash"];
+ if (!mimeType || !mimeType.enabledPlugin || !mimeType.enabledPlugin.filename) {
+ return false;
+ }
+ return mimeType.enabledPlugin.filename.match(/flashlite/i) ? true : false;
+ };
+
+ if (!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION) {
+ if (window.addEventListener) {
+ window.addEventListener("load", function(){
+ WebSocket.__initialize();
+ }, false);
+ } else {
+ window.attachEvent("onload", function(){
+ WebSocket.__initialize();
+ });
+ }
+ }
+
+ })();
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io, global) {
+
+ /**
+ * Expose constructor.
+ *
+ * @api public
+ */
+
+ exports.XHR = XHR;
+
+ /**
+ * XHR constructor
+ *
+ * @costructor
+ * @api public
+ */
+
+ function XHR (socket) {
+ if (!socket) return;
+
+ io.Transport.apply(this, arguments);
+ this.sendBuffer = [];
+ };
+
+ /**
+ * Inherits from Transport.
+ */
+
+ io.util.inherit(XHR, io.Transport);
+
+ /**
+ * Establish a connection
+ *
+ * @returns {Transport}
+ * @api public
+ */
+
+ XHR.prototype.open = function () {
+ this.socket.setBuffer(false);
+ this.onOpen();
+ this.get();
+
+ // we need to make sure the request succeeds since we have no indication
+ // whether the request opened or not until it succeeded.
+ this.setCloseTimeout();
+
+ return this;
+ };
+
+ /**
+ * Check if we need to send data to the Socket.IO server, if we have data in our
+ * buffer we encode it and forward it to the `post` method.
+ *
+ * @api private
+ */
+
+ XHR.prototype.payload = function (payload) {
+ var msgs = [];
+
+ for (var i = 0, l = payload.length; i < l; i++) {
+ msgs.push(io.parser.encodePacket(payload[i]));
+ }
+
+ this.send(io.parser.encodePayload(msgs));
+ };
+
+ /**
+ * Send data to the Socket.IO server.
+ *
+ * @param data The message
+ * @returns {Transport}
+ * @api public
+ */
+
+ XHR.prototype.send = function (data) {
+ this.post(data);
+ return this;
+ };
+
+ /**
+ * Posts a encoded message to the Socket.IO server.
+ *
+ * @param {String} data A encoded message.
+ * @api private
+ */
+
+ function empty () { };
+
+ XHR.prototype.post = function (data) {
+ var self = this;
+ this.socket.setBuffer(true);
+
+ function stateChange () {
+ if (this.readyState == 4) {
+ this.onreadystatechange = empty;
+ self.posting = false;
+
+ if (this.status == 200){
+ self.socket.setBuffer(false);
+ } else {
+ self.onClose();
+ }
+ }
+ }
+
+ function onload () {
+ this.onload = empty;
+ self.socket.setBuffer(false);
+ };
+
+ this.sendXHR = this.request('POST');
+
+ if (global.XDomainRequest && this.sendXHR instanceof XDomainRequest) {
+ this.sendXHR.onload = this.sendXHR.onerror = onload;
+ } else {
+ this.sendXHR.onreadystatechange = stateChange;
+ }
+
+ this.sendXHR.send(data);
+ };
+
+ /**
+ * Disconnects the established `XHR` connection.
+ *
+ * @returns {Transport}
+ * @api public
+ */
+
+ XHR.prototype.close = function () {
+ this.onClose();
+ return this;
+ };
+
+ /**
+ * Generates a configured XHR request
+ *
+ * @param {String} url The url that needs to be requested.
+ * @param {String} method The method the request should use.
+ * @returns {XMLHttpRequest}
+ * @api private
+ */
+
+ XHR.prototype.request = function (method) {
+ var req = io.util.request(this.socket.isXDomain())
+ , query = io.util.query(this.socket.options.query, 't=' + +new Date);
+
+ req.open(method || 'GET', this.prepareUrl() + query, true);
+
+ if (method == 'POST') {
+ try {
+ if (req.setRequestHeader) {
+ req.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
+ } else {
+ // XDomainRequest
+ req.contentType = 'text/plain';
+ }
+ } catch (e) {}
+ }
+
+ return req;
+ };
+
+ /**
+ * Returns the scheme to use for the transport URLs.
+ *
+ * @api private
+ */
+
+ XHR.prototype.scheme = function () {
+ return this.socket.options.secure ? 'https' : 'http';
+ };
+
+ /**
+ * Check if the XHR transports are supported
+ *
+ * @param {Boolean} xdomain Check if we support cross domain requests.
+ * @returns {Boolean}
+ * @api public
+ */
+
+ XHR.check = function (socket, xdomain) {
+ try {
+ var request = io.util.request(xdomain),
+ usesXDomReq = (global.XDomainRequest && request instanceof XDomainRequest),
+ socketProtocol = (socket && socket.options && socket.options.secure ? 'https:' : 'http:'),
+ isXProtocol = (global.location && socketProtocol != global.location.protocol);
+ if (request && !(usesXDomReq && isXProtocol)) {
+ return true;
+ }
+ } catch(e) {}
+
+ return false;
+ };
+
+ /**
+ * Check if the XHR transport supports cross domain requests.
+ *
+ * @returns {Boolean}
+ * @api public
+ */
+
+ XHR.xdomainCheck = function (socket) {
+ return XHR.check(socket, true);
+ };
+
+ })(
+ 'undefined' != typeof io ? io.Transport : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ , global
+ );
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.htmlfile = HTMLFile;
+
+ /**
+ * The HTMLFile transport creates a `forever iframe` based transport
+ * for Internet Explorer. Regular forever iframe implementations will
+ * continuously trigger the browsers buzy indicators. If the forever iframe
+ * is created inside a `htmlfile` these indicators will not be trigged.
+ *
+ * @constructor
+ * @extends {io.Transport.XHR}
+ * @api public
+ */
+
+ function HTMLFile (socket) {
+ io.Transport.XHR.apply(this, arguments);
+ };
+
+ /**
+ * Inherits from XHR transport.
+ */
+
+ io.util.inherit(HTMLFile, io.Transport.XHR);
+
+ /**
+ * Transport name
+ *
+ * @api public
+ */
+
+ HTMLFile.prototype.name = 'htmlfile';
+
+ /**
+ * Creates a new Ac...eX `htmlfile` with a forever loading iframe
+ * that can be used to listen to messages. Inside the generated
+ * `htmlfile` a reference will be made to the HTMLFile transport.
+ *
+ * @api private
+ */
+
+ HTMLFile.prototype.get = function () {
+ this.doc = new window[(['Active'].concat('Object').join('X'))]('htmlfile');
+ this.doc.open();
+ this.doc.write('<html></html>');
+ this.doc.close();
+ this.doc.parentWindow.s = this;
+
+ var iframeC = this.doc.createElement('div');
+ iframeC.className = 'socketio';
+
+ this.doc.body.appendChild(iframeC);
+ this.iframe = this.doc.createElement('iframe');
+
+ iframeC.appendChild(this.iframe);
+
+ var self = this
+ , query = io.util.query(this.socket.options.query, 't='+ +new Date);
+
+ this.iframe.src = this.prepareUrl() + query;
+
+ io.util.on(window, 'unload', function () {
+ self.destroy();
+ });
+ };
+
+ /**
+ * The Socket.IO server will write script tags inside the forever
+ * iframe, this function will be used as callback for the incoming
+ * information.
+ *
+ * @param {String} data The message
+ * @param {document} doc Reference to the context
+ * @api private
+ */
+
+ HTMLFile.prototype._ = function (data, doc) {
+ this.onData(data);
+ try {
+ var script = doc.getElementsByTagName('script')[0];
+ script.parentNode.removeChild(script);
+ } catch (e) { }
+ };
+
+ /**
+ * Destroy the established connection, iframe and `htmlfile`.
+ * And calls the `CollectGarbage` function of Internet Explorer
+ * to release the memory.
+ *
+ * @api private
+ */
+
+ HTMLFile.prototype.destroy = function () {
+ if (this.iframe){
+ try {
+ this.iframe.src = 'about:blank';
+ } catch(e){}
+
+ this.doc = null;
+ this.iframe.parentNode.removeChild(this.iframe);
+ this.iframe = null;
+
+ CollectGarbage();
+ }
+ };
+
+ /**
+ * Disconnects the established connection.
+ *
+ * @returns {Transport} Chaining.
+ * @api public
+ */
+
+ HTMLFile.prototype.close = function () {
+ this.destroy();
+ return io.Transport.XHR.prototype.close.call(this);
+ };
+
+ /**
+ * Checks if the browser supports this transport. The browser
+ * must have an `Ac...eXObject` implementation.
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+ HTMLFile.check = function (socket) {
+ if (typeof window != "undefined" && (['Active'].concat('Object').join('X')) in window){
+ try {
+ var a = new window[(['Active'].concat('Object').join('X'))]('htmlfile');
+ return a && io.Transport.XHR.check(socket);
+ } catch(e){}
+ }
+ return false;
+ };
+
+ /**
+ * Check if cross domain requests are supported.
+ *
+ * @returns {Boolean}
+ * @api public
+ */
+
+ HTMLFile.xdomainCheck = function () {
+ // we can probably do handling for sub-domains, we should
+ // test that it's cross domain but a subdomain here
+ return false;
+ };
+
+ /**
+ * Add the transport to your public io.transports array.
+ *
+ * @api private
+ */
+
+ io.transports.push('htmlfile');
+
+ })(
+ 'undefined' != typeof io ? io.Transport : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ );
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io, global) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports['xhr-polling'] = XHRPolling;
+
+ /**
+ * The XHR-polling transport uses long polling XHR requests to create a
+ * "persistent" connection with the server.
+ *
+ * @constructor
+ * @api public
+ */
+
+ function XHRPolling () {
+ io.Transport.XHR.apply(this, arguments);
+ };
+
+ /**
+ * Inherits from XHR transport.
+ */
+
+ io.util.inherit(XHRPolling, io.Transport.XHR);
+
+ /**
+ * Merge the properties from XHR transport
+ */
+
+ io.util.merge(XHRPolling, io.Transport.XHR);
+
+ /**
+ * Transport name
+ *
+ * @api public
+ */
+
+ XHRPolling.prototype.name = 'xhr-polling';
+
+ /**
+ * Indicates whether heartbeats is enabled for this transport
+ *
+ * @api private
+ */
+
+ XHRPolling.prototype.heartbeats = function () {
+ return false;
+ };
+
+ /**
+ * Establish a connection, for iPhone and Android this will be done once the page
+ * is loaded.
+ *
+ * @returns {Transport} Chaining.
+ * @api public
+ */
+
+ XHRPolling.prototype.open = function () {
+ var self = this;
+
+ io.Transport.XHR.prototype.open.call(self);
+ return false;
+ };
+
+ /**
+ * Starts a XHR request to wait for incoming messages.
+ *
+ * @api private
+ */
+
+ function empty () {};
+
+ XHRPolling.prototype.get = function () {
+ if (!this.isOpen) return;
+
+ var self = this;
+
+ function stateChange () {
+ if (this.readyState == 4) {
+ this.onreadystatechange = empty;
+
+ if (this.status == 200) {
+ self.onData(this.responseText);
+ self.get();
+ } else {
+ self.onClose();
+ }
+ }
+ };
+
+ function onload () {
+ this.onload = empty;
+ this.onerror = empty;
+ self.retryCounter = 1;
+ self.onData(this.responseText);
+ self.get();
+ };
+
+ function onerror () {
+ self.retryCounter ++;
+ if(!self.retryCounter || self.retryCounter > 3) {
+ self.onClose();
+ } else {
+ self.get();
+ }
+ };
+
+ this.xhr = this.request();
+
+ if (global.XDomainRequest && this.xhr instanceof XDomainRequest) {
+ this.xhr.onload = onload;
+ this.xhr.onerror = onerror;
+ } else {
+ this.xhr.onreadystatechange = stateChange;
+ }
+
+ this.xhr.send(null);
+ };
+
+ /**
+ * Handle the unclean close behavior.
+ *
+ * @api private
+ */
+
+ XHRPolling.prototype.onClose = function () {
+ io.Transport.XHR.prototype.onClose.call(this);
+
+ if (this.xhr) {
+ this.xhr.onreadystatechange = this.xhr.onload = this.xhr.onerror = empty;
+ try {
+ this.xhr.abort();
+ } catch(e){}
+ this.xhr = null;
+ }
+ };
+
+ /**
+ * Webkit based browsers show a infinit spinner when you start a XHR request
+ * before the browsers onload event is called so we need to defer opening of
+ * the transport until the onload event is called. Wrapping the cb in our
+ * defer method solve this.
+ *
+ * @param {Socket} socket The socket instance that needs a transport
+ * @param {Function} fn The callback
+ * @api private
+ */
+
+ XHRPolling.prototype.ready = function (socket, fn) {
+ var self = this;
+
+ io.util.defer(function () {
+ fn.call(self);
+ });
+ };
+
+ /**
+ * Add the transport to your public io.transports array.
+ *
+ * @api private
+ */
+
+ io.transports.push('xhr-polling');
+
+ })(
+ 'undefined' != typeof io ? io.Transport : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ , global
+ );
+
+ /**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+ (function (exports, io, global) {
+ /**
+ * There is a way to hide the loading indicator in Firefox. If you create and
+ * remove a iframe it will stop showing the current loading indicator.
+ * Unfortunately we can't feature detect that and UA sniffing is evil.
+ *
+ * @api private
+ */
+
+ var indicator = global.document && "MozAppearance" in
+ global.document.documentElement.style;
+
+ /**
+ * Expose constructor.
+ */
+
+ exports['jsonp-polling'] = JSONPPolling;
+
+ /**
+ * The JSONP transport creates an persistent connection by dynamically
+ * inserting a script tag in the page. This script tag will receive the
+ * information of the Socket.IO server. When new information is received
+ * it creates a new script tag for the new data stream.
+ *
+ * @constructor
+ * @extends {io.Transport.xhr-polling}
+ * @api public
+ */
+
+ function JSONPPolling (socket) {
+ io.Transport['xhr-polling'].apply(this, arguments);
+
+ this.index = io.j.length;
+
+ var self = this;
+
+ io.j.push(function (msg) {
+ self._(msg);
+ });
+ };
+
+ /**
+ * Inherits from XHR polling transport.
+ */
+
+ io.util.inherit(JSONPPolling, io.Transport['xhr-polling']);
+
+ /**
+ * Transport name
+ *
+ * @api public
+ */
+
+ JSONPPolling.prototype.name = 'jsonp-polling';
+
+ /**
+ * Posts a encoded message to the Socket.IO server using an iframe.
+ * The iframe is used because script tags can create POST based requests.
+ * The iframe is positioned outside of the view so the user does not
+ * notice it's existence.
+ *
+ * @param {String} data A encoded message.
+ * @api private
+ */
+
+ JSONPPolling.prototype.post = function (data) {
+ var self = this
+ , query = io.util.query(
+ this.socket.options.query
+ , 't='+ (+new Date) + '&i=' + this.index
+ );
+
+ if (!this.form) {
+ var form = document.createElement('form')
+ , area = document.createElement('textarea')
+ , id = this.iframeId = 'socketio_iframe_' + this.index
+ , iframe;
+
+ form.className = 'socketio';
+ form.style.position = 'absolute';
+ form.style.top = '0px';
+ form.style.left = '0px';
+ form.style.display = 'none';
+ form.target = id;
+ form.method = 'POST';
+ form.setAttribute('accept-charset', 'utf-8');
+ area.name = 'd';
+ form.appendChild(area);
+ document.body.appendChild(form);
+
+ this.form = form;
+ this.area = area;
+ }
+
+ this.form.action = this.prepareUrl() + query;
+
+ function complete () {
+ initIframe();
+ self.socket.setBuffer(false);
+ };
+
+ function initIframe () {
+ if (self.iframe) {
+ self.form.removeChild(self.iframe);
+ }
+
+ try {
+ // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
+ iframe = document.createElement('<iframe name="'+ self.iframeId +'">');
+ } catch (e) {
+ iframe = document.createElement('iframe');
+ iframe.name = self.iframeId;
+ }
+
+ iframe.id = self.iframeId;
+
+ self.form.appendChild(iframe);
+ self.iframe = iframe;
+ };
+
+ initIframe();
+
+ // we temporarily stringify until we figure out how to prevent
+ // browsers from turning `\n` into `\r\n` in form inputs
+ this.area.value = io.JSON.stringify(data);
+
+ try {
+ this.form.submit();
+ } catch(e) {}
+
+ if (this.iframe.attachEvent) {
+ iframe.onreadystatechange = function () {
+ if (self.iframe.readyState == 'complete') {
+ complete();
+ }
+ };
+ } else {
+ this.iframe.onload = complete;
+ }
+
+ this.socket.setBuffer(true);
+ };
+
+ /**
+ * Creates a new JSONP poll that can be used to listen
+ * for messages from the Socket.IO server.
+ *
+ * @api private
+ */
+
+ JSONPPolling.prototype.get = function () {
+ var self = this
+ , script = document.createElement('script')
+ , query = io.util.query(
+ this.socket.options.query
+ , 't='+ (+new Date) + '&i=' + this.index
+ );
+
+ if (this.script) {
+ this.script.parentNode.removeChild(this.script);
+ this.script = null;
+ }
+
+ script.async = true;
+ script.src = this.prepareUrl() + query;
+ script.onerror = function () {
+ self.onClose();
+ };
+
+ var insertAt = document.getElementsByTagName('script')[0];
+ insertAt.parentNode.insertBefore(script, insertAt);
+ this.script = script;
+
+ if (indicator) {
+ setTimeout(function () {
+ var iframe = document.createElement('iframe');
+ document.body.appendChild(iframe);
+ document.body.removeChild(iframe);
+ }, 100);
+ }
+ };
+
+ /**
+ * Callback function for the incoming message stream from the Socket.IO server.
+ *
+ * @param {String} data The message
+ * @api private
+ */
+
+ JSONPPolling.prototype._ = function (msg) {
+ this.onData(msg);
+ if (this.isOpen) {
+ this.get();
+ }
+ return this;
+ };
+
+ /**
+ * The indicator hack only works after onload
+ *
+ * @param {Socket} socket The socket instance that needs a transport
+ * @param {Function} fn The callback
+ * @api private
+ */
+
+ JSONPPolling.prototype.ready = function (socket, fn) {
+ var self = this;
+ if (!indicator) return fn.call(this);
+
+ io.util.load(function () {
+ fn.call(self);
+ });
+ };
+
+ /**
+ * Checks if browser supports this transport.
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+ JSONPPolling.check = function () {
+ return 'document' in global;
+ };
+
+ /**
+ * Check if cross domain requests are supported
+ *
+ * @returns {Boolean}
+ * @api public
+ */
+
+ JSONPPolling.xdomainCheck = function () {
+ return true;
+ };
+
+ /**
+ * Add the transport to your public io.transports array.
+ *
+ * @api private
+ */
+
+ io.transports.push('jsonp-polling');
+
+ })(
+ 'undefined' != typeof io ? io.Transport : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+ , global
+ );
+
+ if (typeof define === "function" && define.amd) {
+ define([], function () { return io; });
+ }
+ })();
+
+ /* Notes
+ *
+ * - Continue using prefixed names for now.
+ *
+ */
+
+ var webrtcSupported = true;
+
+ var RTCPeerConnection;
+ if(window.mozRTCPeerConnection)
+ RTCPeerConnection = window.mozRTCPeerConnection;
+ else if(window.webkitRTCPeerConnection)
+ RTCPeerConnection = window.webkitRTCPeerConnection;
+ else if(window.RTCPeerConnection)
+ RTCPeerConnection = window.RTCPeerConnection
+ else
+ webrtcSupported = false;
+
+ var RTCSessionDescription;
+ if(window.mozRTCSessionDescription)
+ RTCSessionDescription = window.mozRTCSessionDescription;
+ else if(window.webkitRTCSessionDescription)
+ RTCSessionDescription = window.webkitRTCSessionDescription;
+ else if(window.RTCSessionDescription)
+ RTCSessionDescription = window.RTCSessionDescription
+ else
+ webrtcSupported = false;
+
+ var RTCIceCandidate;
+ if(window.mozRTCIceCandidate)
+ RTCIceCandidate = window.mozRTCIceCandidate;
+ else if(window.webkitRTCIceCandidate)
+ RTCIceCandidate = window.webkitRTCIceCandidate;
+ else if(window.RTCIceCandidate)
+ RTCIceCandidate = window.RTCIceCandidate;
+ else
+ webrtcSupported = false;
+
+ var getUserMedia;
+ if(!navigator.getUserMedia) {
+ if(navigator.mozGetUserMedia)
+ getUserMedia = navigator.mozGetUserMedia.bind(navigator);
+ else if(navigator.webkitGetUserMedia)
+ getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
+ else
+ webrtcSupported = false;
+ } else {
+ getUserMedia = navigator.getUserMedia.bind(navigator);
+ }
+
+ // FIXME: browser detection is gross, but I don't see another way to do this
+ var RTCConnectProtocol;
+ if(window.mozRTCPeerConnection) {
+ RTCConnectProtocol = mozRTCConnectProtocol;
+ } else if(window.webkitRTCPeerConnection) {
+ RTCConnectProtocol = webkitRTCConnectProtocol;
+ } else {
+ webrtcSupported = false;
+ }
+
+ function callback(object, method, args) {
+ if(!Array.isArray(args))
+ args = [args];
+ if(method in object && 'function' === typeof object[method]) {
+ object[method].apply(object, args);
+ }
+ };
+
+ function fail(object, method, error) {
+ if (!(error instanceof Error))
+ error = new Error(error);
+ callback(object, method, [error]);
+ };
+
+ function defer(queue, object, method, args) {
+ if(queue) {
+ queue.push([object, method, args]);
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ function processDeferredQueue(queue) {
+ while(queue.length) {
+ var deferred = queue.shift();
+ callback(deferred[0], deferred[1], deferred[2]);
+ }
+ };
+
+ var ONE_SECOND = 1000; // milliseconds
+ var DEFAULT_CONNECTION_TIMEOUT = 10 * ONE_SECOND;
+ var DEFAULT_PING_TIMEOUT = 1 * ONE_SECOND;
+ var RELIABLE_CHANNEL_OPTIONS = {
+ reliable: false
+ };
+ var UNRELIABLE_CHANNEL_OPTIONS = {
+ outOfOrderAllowed: true,
+ maxRetransmitNum: 0,
+ reliable: false
+ };
+
+ function PendingConnectionAbortError(message) {
+ this.name = "PendingConnectionAbortError";
+ this.message = (message || "");
+ };
+ PendingConnectionAbortError.prototype = Error.prototype;
+
+ function ConnectionFailedError(message) {
+ this.name = "ConnectionFailedError";
+ this.message = (message || "");
+ };
+ ConnectionFailedError.prototype = Error.prototype;
+
+ var E = {
+ PendingConnectionAbortError: PendingConnectionAbortError,
+ ConnectionFailedError: ConnectionFailedError
+ };
+
+ function WebSocketBroker(brokerUrl) {
+ this.brokerUrl = brokerUrl;
+ this.state = WebSocketBroker.OFFLINE;
+
+ this.onstatechange = null;
+ this.onreceive = null;
+ this.onerror = null;
+
+ this.socket = null;
+ this.route = null;
+ };
+
+ // States
+ WebSocketBroker.OFFLINE = 0x01;
+ WebSocketBroker.CONNECTING = 0x02;
+ WebSocketBroker.CONNECTED = 0x04;
+ // Flags
+ WebSocketBroker.ROUTED = 0x10;
+ WebSocketBroker.LISTENING = 0x20;
+
+ WebSocketBroker.prototype.setState = function setState(state, clearFlags) {
+ var clear = clearFlags ? 0x00 : 0xF0;
+ this.state &= clear >>> 0;
+ this.state |= state >>> 0;
+ callback(this, 'onstatechange', [this.state, (state | (clear & 0x0)) >>> 0]);
+ };
+ WebSocketBroker.prototype.setFlag = function setFlag(flag) {
+ this.state = (this.state | flag) >>> 0;
+ callback(this, 'onstatechange', [this.state, flag])
+ };
+ WebSocketBroker.prototype.clearFlag = function clearFlag(flag) {
+ flag = (~flag) >>> 0;
+ this.state = (this.state & flag) >>> 0;
+ callback(this, 'onstatechange', [this.state, flag])
+ };
+ WebSocketBroker.prototype.checkState = function checkState(mask) {
+ return !!(this.state & mask);
+ };
+ WebSocketBroker.prototype.connect = function connect() {
+ var that = this;
+ var socket = io.connect(this.brokerUrl + '/peer', {
+ 'sync disconnect on unload': true // partially fixes 'interrupted while page loading' warning
+ });
+
+ socket.on('connecting', function onconnecting() {
+ that.setState(WebSocketBroker.CONNECTING, true);
+ });
+
+ socket.on('connect', function onconnect() {
+ that.setState(WebSocketBroker.CONNECTED, true);
+ });
+
+ socket.on('connect_failed', function onconnect_failed() {
+ that.setState(WebSocketBroker.OFFLINE, true);
+ });
+
+ socket.on('route', function onroute(route) {
+ that.route = route;
+ that.setFlag(WebSocketBroker.ROUTED);
+ });
+
+ socket.on('disconnect', function ondisconnect() {
+ that.setState(WebSocketBroker.OFFLINE, true);
+ });
+
+ socket.on('error', function onerror(error) {
+ console.error(error);
+ fail(that, 'onerror', error);
+ });
+
+ socket.on('receive', function onreceive(message) {
+ var from = message['from'];
+ var data = message['data'];
+ callback(that, 'onreceive', [from, data]);
+ });
+
+ this.socket = socket;
+ };
+ WebSocketBroker.prototype.disconnect = function disconnect() {
+ if(this.checkState(WebSocketBroker.CONNECTED)) {
+ this.socket.disconnect();
+ this.setState(WebSocketBroker.OFFLINE, true);
+ return true;
+ } else {
+ return false;
+ }
+ };
+ WebSocketBroker.prototype.listen = function listen(options) {
+ var that = this;
+ if(this.checkState(WebSocketBroker.CONNECTED)) {
+ this.socket.emit('listen', options, function onresponse(response) {
+ if(response && response['error']) {
+ var error = new Error(response['error']);
+ fail(that, 'onerror', error);
+ } else {
+ that.setFlag(WebSocketBroker.LISTENING);
+ }
+ });
+ }
+ };
+ WebSocketBroker.prototype.ignore = function ignore() {
+ var that = this;
+ if(this.checkState(WebSocketBroker.CONNECTED)) {
+ this.socket.emit('ignore', null, function onresponse(response) {
+ if(response && response['error']) {
+ var error = new Error(response['error']);
+ fail(that, 'onerror', error)
+ } else {
+ that.clearFlag(WebSocketBroker.LISTENING);
+ }
+ });
+ }
+ };
+ WebSocketBroker.prototype.send = function send(to, message) {
+ var that = this;
+ if(this.checkState(WebSocketBroker.CONNECTED)) {
+ this.socket.emit('send', {'to': to, 'data': message}, function onresponse(response) {
+ if(response && response['error']) {
+ var error = new Error(response['error']);
+ fail(that, 'onerror', error)
+ }
+ });
+ };
+ };
+
+ var dataChannels = {
+ 'reliable': 'RELIABLE',
+ 'unreliable': 'UNRELIABLE',
+ '@control': 'RELIABLE'
+ };
+ var nextDataConnectionPort = 1;
+ function CommonRTCConnectProtocol() {
+ // FIXME: these timeouts should be configurable
+ this.connectionTimeout = 10 * ONE_SECOND;
+ this.pingTimeout = 1 * ONE_SECOND;
+ };
+ CommonRTCConnectProtocol.prototype.process = function process(message) {
+ var that = this;
+
+ var type = message['type'];
+ switch(type) {
+ case 'ice':
+ var candidate = JSON.parse(message['candidate']);
+ if(candidate)
+ this.handleIce(candidate);
+ break;
+
+ case 'offer':
+ that.ports.remote = message['port'];
+ var offer = {
+ 'type': 'offer',
+ 'sdp': message['description']
+ };
+ this.handleOffer(offer);
+ break;
+
+ case 'answer':
+ that.ports.remote = message['port'];
+ var answer = {
+ 'type': 'answer',
+ 'sdp': message['description']
+ };
+ this.handleAnswer(answer);
+ break;
+
+ case 'abort':
+ this.handleAbort();
+ break;
+
+ default:
+ fail(this, 'onerror', 'unknown message');
+ }
+ };
+ CommonRTCConnectProtocol.prototype.handleAbort = function handleAbort() {
+ fail(this, 'onerror', new Error(E.RTCConnectProtocolAbort));
+ };
+ CommonRTCConnectProtocol.prototype.initialize = function initialize(cb) {
+ var that = this;
+
+ if(this.peerConnection)
+ return cb();
+
+ // FIXME: peer connection servers should be configurable
+ this.peerConnection = new RTCPeerConnection(this.connectionServers, this.connectionOptions);
+ this.peerConnection.onicecandidate = function(event) {
+ var message = {
+ 'type': 'ice',
+ 'candidate': JSON.stringify(event.candidate)
+ };
+ callback(that, 'onmessage', message);
+ };
+ this.peerConnection.onaddstream = function(event) {
+ that.streams['remote'] = event.stream;
+ };
+ this.peerConnection.onstatechange = function(event) {
+ console.log(event.target.readyState);
+ };
+
+ function createStream(useFake) {
+ useFake = (!useVideo && !useAudio) ? true : useFake;
+ var useVideo = !!that.options['video'];
+ var useAudio = !!that.options['audio'];
+ var mediaOptions = {
+ video: useVideo,
+ audio: (!useVideo && !useAudio) ? true : useAudio,
+ fake: useFake
+ };
+ getUserMedia(mediaOptions,
+ function(stream) {
+ that.peerConnection.addStream(stream);
+ that.streams['local'] = stream;
+ cb();
+ },
+ function(error) {
+ console.error('!', error);
+ if(!useFake)
+ createStream(true);
+ else
+ fail(that, 'onerror', error);
+ }
+ );
+ }
+
+ createStream();
+ };
+ CommonRTCConnectProtocol.prototype.handleIce = function handleIce(candidate) {
+ var that = this;
+
+ function setIce() {
+ if(!that.peerConnection.remoteDescription) {
+ return
+ }
+ that.peerConnection.addIceCandidate(new RTCIceCandidate(candidate),
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+ };
+
+ this.initialize(setIce);
+ };
+ CommonRTCConnectProtocol.prototype.initiate = function initiate() {
+ var that = this;
+ this.initiator = true;
+
+ function createDataChannels() {
+ var labels = Object.keys(dataChannels);
+ labels.forEach(function(label) {
+ var channelOptions = that.channelOptions[dataChannels[label]];
+ var channel = that._pending[label] = that.peerConnection.createDataChannel(label, channelOptions);
+ channel.binaryType = that.options['binaryType'];
+ channel.onopen = function() {
+ that.channels[label] = channel;
+ delete that._pending[label];
+ if(Object.keys(that.channels).length === labels.length) {
+ that.complete = true;
+ callback(that, 'oncomplete', []);
+ }
+ };
+ channel.onerror = function(error) {
+ console.error(error);
+ fail(that, 'onerror', error);
+ };
+ });
+ createOffer();
+ };
+
+ function createOffer() {
+ that.peerConnection.createOffer(setLocal,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+ };
+
+ function setLocal(description) {
+ that.peerConnection.setLocalDescription(new RTCSessionDescription(description), complete,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+
+ function complete() {
+ var message = {
+ 'type': 'offer',
+ 'description': description['sdp'],
+ 'port': that.ports.local
+ };
+ callback(that, 'onmessage', message);
+ };
+ };
+
+ this.initialize(createDataChannels);
+ };
+ CommonRTCConnectProtocol.prototype.handleOffer = function handleOffer(offer) {
+ var that = this;
+
+ function handleDataChannels() {
+ var labels = Object.keys(dataChannels);
+ that.peerConnection.ondatachannel = function(event) {
+ var channel = event.channel;
+ var label = channel.label;
+ that._pending[label] = channel;
+ channel.binaryType = that.options['binaryType'];
+ channel.onopen = function() {
+ that.channels[label] = channel;
+ delete that._pending[label];
+ if(Object.keys(that.channels).length === labels.length) {
+ that.complete = true;
+ callback(that, 'oncomplete', []);
+ }
+ };
+ channel.onerror = function(error) {
+ console.error(error);
+ fail(that, 'onerror', error);
+ };
+ };
+ setRemote();
+ };
+
+ function setRemote() {
+ that.peerConnection.setRemoteDescription(new RTCSessionDescription(offer), createAnswer,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+ };
+
+ function createAnswer() {
+ that.peerConnection.createAnswer(setLocal,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+ };
+
+ function setLocal(description) {
+ that.peerConnection.setLocalDescription(new RTCSessionDescription(description), complete,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+
+ function complete() {
+ var message = {
+ 'type': 'answer',
+ 'description': description['sdp'],
+ 'port': that.ports.local
+ };
+ callback(that, 'onmessage', message);
+ };
+ };
+
+ this.initialize(handleDataChannels);
+ };
+ CommonRTCConnectProtocol.prototype.handleAnswer = function handleAnswer(answer) {
+ var that = this;
+
+ function setRemote() {
+ that.peerConnection.setRemoteDescription(new RTCSessionDescription(answer), complete,
+ function(error) {
+ fail(that, 'onerror', error);
+ }
+ );
+ };
+
+ function complete() {
+ };
+
+ this.initialize(setRemote);
+ };
+
+ function mozRTCConnectProtocol(options) {
+ this.options = options;
+ this.onmessage = null;
+ this.oncomplete = null;
+ this.onerror = null;
+
+ this.complete = false;
+ this.ports = {
+ local: nextDataConnectionPort ++,
+ remote: null
+ };
+ this.streams = {
+ local: null,
+ remote: null
+ };
+ this.initiator = false;
+
+ this.peerConnection = null;
+ this.channels = {};
+ this._pending = {};
+ this.connectionServers = null;
+ this.connectionOptions = null;
+ this.channelOptions = {
+ RELIABLE: {
+ // defaults
+ },
+ UNRELIABLE: {
+ outOfOrderAllowed: true,
+ maxRetransmitNum: 0
+ }
+ };
+ };
+ mozRTCConnectProtocol.prototype = new CommonRTCConnectProtocol();
+ mozRTCConnectProtocol.prototype.constructor = mozRTCConnectProtocol;
+
+ function webkitRTCConnectProtocol(options) {
+ this.options = options;
+ this.onmessage = null;
+ this.oncomplete = null;
+ this.onerror = null;
+
+ this.complete = false;
+ this.ports = {
+ local: nextDataConnectionPort ++,
+ remote: null
+ };
+ this.streams = {
+ local: null,
+ remote: null
+ };
+ this.initiator = false;
+
+ this.peerConnection = null;
+ this.channels = {};
+ this._pending = {};
+ this.connectionServers = {iceServers:[{url:'stun:23.21.150.121'}]};
+ this.connectionOptions = {
+ 'optional': [{ 'RtpDataChannels': true }]
+ };
+ this.channelOptions = {
+ RELIABLE: {
+ // FIXME: reliable channels do not work in chrome yet
+ reliable: false
+ },
+ UNRELIABLE: {
+ reliable: false
+ }
+ };
+ };
+ webkitRTCConnectProtocol.prototype = new CommonRTCConnectProtocol();
+ webkitRTCConnectProtocol.prototype.constructor = webkitRTCConnectProtocol;
+
+ // FIXME: this could use a cleanup
+ var nextConnectionId = 1;
+ function Connection(options, peerConnection, streams, channels) {
+ var that = this;
+ this.id = nextConnectionId ++;
+ this.streams = streams;
+ this.connected = false;
+ this.messageFlag = false;
+
+ this.onmessage = null;
+ this.ondisconnect = null;
+ this.onerror = null;
+
+ this.peerConnection = peerConnection;
+
+ // DataChannels
+ this.channels = channels;
+
+ this.connectionTimer = null;
+ this.pingTimer = null;
+
+ function handleConnectionTimerExpired() {
+ if(!that.connected)
+ return
+ this.connectionTimer = null;
+ if(false === that.messageFlag) {
+ that.channels['@control'].send('ping');
+ this.pingTimer = window.setTimeout(handlePingTimerExpired, options['pingTimeout']);
+ } else {
+ that.messageFlag = false;
+ this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']);
+ }
+ };
+ function handlePingTimerExpired() {
+ if(!that.connected)
+ return
+ this.pingTimer = null;
+ if(false === that.messageFlag) {
+ that.connected = false;
+ that.close();
+ } else {
+ that.messageFlag = false;
+ this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']);
+ }
+ };
+
+ Object.keys(this.channels).forEach(function(label) {
+ var channel = that.channels[label];
+ if(label.match('^@')) // check for internal channels
+ return;
+
+ channel.onmessage = function onmessage(message) {
+ that.messageFlag = true;
+ callback(that, 'onmessage', [label, message]);
+ };
+ });
+ this.channels['@control'].onmessage = function onmessage(message) {
+ that.messageFlag = true;
+ if(that.connected) {
+ var data = message.data;
+ if('ping' === data) {
+ that.channels['@control'].send('pong');
+ } else if('pong' === data) {
+ // ok
+ } else if('quit' === data) {
+ that.close();
+ }
+ }
+ };
+
+ this.connected = true;
+ this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']);
+ };
+ Connection.prototype.close = function close() {
+ console.log('close connection');
+ if(this.connected) {
+ this.channels['@control'].send('quit');
+ }
+ this.connected = false;
+ this.peerConnection.close();
+ if(this.connectionTimer) {
+ window.clearInterval(this.connectionTimer);
+ this.connectionTimer = null;
+ }
+ if(this.pingTimer) {
+ window.clearInterval(this.pingTimer);
+ this.pingTimer = null;
+ }
+ this.peerConnection = null;
+ callback(this, 'ondisconnect', []);
+ };
+ Connection.prototype.send = function send(label, message) {
+ this.channels[label].send(message);
+ };
+
+ function PendingConnection(route, incoming) {
+ this.route = route;
+ this.incoming = incoming;
+ this.proceed = true;
+ };
+ PendingConnection.prototype.accept = function accept() {
+ this.proceed = true;
+ };
+ PendingConnection.prototype.reject = function reject() {
+ this.proceed = false;
+ };
+
+ function Peer(brokerUrl, options) {
+ if(!webrtcSupported)
+ throw new Error("WebRTC not supported");
+
+ var that = this;
+ this.brokerUrl = brokerUrl;
+ this.options = options = options || {};
+ options['binaryType'] = options['binaryType'] || 'arraybuffer';
+ options['connectionTimeout'] = options['connectionTimeout'] || 10 * ONE_SECOND;
+ options['pingTimeout'] = options['pingTimeout'] || 1 * ONE_SECOND;
+
+ this.onconnection = null;
+ this.onpending = null;
+ this.onroute = null;
+ this.onerror = null;
+
+ this.broker = new WebSocketBroker(brokerUrl);
+ this.broker.onerror = function(error) {
+ fail(that, 'onerror', error);
+ };
+ this.pending = {};
+
+ this.queues = {
+ connected: [],
+ listening: []
+ };
+
+ this.broker.onstatechange = function onstatechange(state, mask) {
+ if(that.queues.connected.length && that.broker.checkState(WebSocketBroker.ROUTED)) {
+ processDeferredQueue(that.queues.connected);
+ if(that.queues.listening.length && that.broker.checkState(WebSocketBroker.LISTENING)) {
+ processDeferredQueue(that.queues.listening);
+ }
+ }
+ if(mask & WebSocketBroker.ROUTED) {
+ callback(that, 'onroute', that.broker.route);
+ }
+ };
+
+ this.broker.onreceive = function onreceive(from, message) {
+ var handshake;
+ if(!that.pending.hasOwnProperty(from)) {
+ if(!that.broker.checkState(WebSocketBroker.LISTENING)) {
+ return;
+ }
+
+ var pendingConnection = new PendingConnection(from, /*incoming*/ true);
+ callback(that, 'onpending', [pendingConnection]);
+ if(!pendingConnection['proceed'])
+ return;
+
+ var handshake = that.pending[from] = new RTCConnectProtocol(that.options);
+ handshake.oncomplete = function() {
+ var connection = new Connection(that.options, handshake.peerConnection, handshake.streams, handshake.channels);
+ connection['route'] = from;
+ delete that.pending[from];
+ callback(that, 'onconnection', [connection]);
+ };
+ handshake.onmessage = function(message) {
+ that.broker.send(from, message);
+ };
+ handshake.onerror = function(error) {
+ delete that.pending[from];
+ callback(that, 'onerror', [error]);
+ };
+ } else {
+ handshake = that.pending[from];
+ }
+ handshake.process(message);
+ };
+
+ this.broker.connect();
+ };
+ Peer.prototype.listen = function listen(options) {
+ if(!this.broker.checkState(WebSocketBroker.ROUTED))
+ return defer(this.queues.connected, this, 'listen', [options]);
+
+ options = options || {};
+ options['url'] = options['url'] || window.location.toString();
+ options['listed'] = (undefined !== options['listed']) ? options['listed'] : true;
+ options['metadata'] = options['metadata'] || {};
+
+ this.broker.listen(options);
+ };
+ Peer.prototype.ignore = function ignore() {
+ throw new Error('not implemented');
+ };
+ Peer.prototype.connect = function connect(route) {
+ if(!this.broker.checkState(WebSocketBroker.ROUTED))
+ return defer(this.queues.connected, this, 'connect', [route]);
+
+ var that = this;
+
+ if(this.pending.hasOwnProperty(route))
+ throw new Error('already connecting to this host'); // FIXME: we can handle this better
+
+ var pendingConnection = new PendingConnection(route, /*incoming*/ false);
+ callback(that, 'onpending', [pendingConnection]);
+ if(!pendingConnection['proceed'])
+ return;
+
+ var handshake = this.pending[route] = new RTCConnectProtocol(this.options);
+ handshake.oncomplete = function() {
+ var connection = new Connection(this.options, handshake.peerConnection, handshake.streams, handshake.channels);
+ connection['route'] = route;
+ delete that.pending[route];
+ callback(that, 'onconnection', [connection]);
+ };
+ handshake.onmessage = function(message) {
+ that.broker.send(route, message);
+ };
+ handshake.onerror = function(error) {
+ delete that.pending[route];
+ fail(that, 'onerror', error);
+ };
+
+ handshake.initiate();
+ };
+ Peer.prototype.close = function close() {
+ this.broker.disconnect();
+ };
+ Peer.E = E;
+
+ return Peer;
+
+});
+})(typeof define == 'function' && define.amd
+? define
+: function (deps, factory) { typeof exports === 'object'
+? (module.exports = factory())
+: (this.Peer = factory());
+},
+// Boilerplate for AMD, Node, and browser global
+this
+); \ No newline at end of file
diff --git a/tests/sockets/p2p/package.json b/tests/sockets/p2p/package.json
new file mode 100644
index 00000000..e94eef45
--- /dev/null
+++ b/tests/sockets/p2p/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "p2p",
+ "version": "0.0.1-21",
+ "private": true,
+ "scripts": {
+ "start": "node broker/p2p-broker.js"
+ },
+ "dependencies": {
+ "lodash": "~1.0.1",
+ "socket.io": "~0.9.13"
+ },
+ "engines": {
+ "node": "0.8.x",
+ "npm": "1.1.x"
+ },
+ "subdomain": "wrtcb"
+}
diff --git a/tests/sockets/webrtc_host.c b/tests/sockets/webrtc_host.c
index e482d4ae..38adb0f2 100644
--- a/tests/sockets/webrtc_host.c
+++ b/tests/sockets/webrtc_host.c
@@ -22,7 +22,7 @@ char buf[BUFLEN];
char expected[] = "emscripten";
struct sockaddr_in si_host,
si_peer;
-struct iovec iov[1];
+struct iovec iov[1];
struct msghdr hdr;
int done = 0;
@@ -38,7 +38,10 @@ void iter() {
close(sock);
#ifdef __EMSCRIPTEN__
- int result = 1;
+ if(strlen((char*)hdr.msg_iov[0].iov_base) == strlen(expected) &&
+ 0 == strncmp((char*)hdr.msg_iov[0].iov_base, expected, strlen(expected))) {
+ result = 1;
+ }
REPORT_RESULT();
exit(EXIT_SUCCESS);
emscripten_cancel_main_loop();
@@ -68,10 +71,10 @@ int main(void)
perror("cannot bind host socket");
exit(EXIT_FAILURE);
}
-
+
iov[0].iov_base = buf;
iov[0].iov_len = sizeof(buf);
-
+
memset (&hdr, 0, sizeof (struct msghdr));
hdr.msg_name = &si_peer;
diff --git a/tests/sockets/webrtc_peer.c b/tests/sockets/webrtc_peer.c
index 327782d6..7b5f3a8a 100644
--- a/tests/sockets/webrtc_peer.c
+++ b/tests/sockets/webrtc_peer.c
@@ -46,7 +46,7 @@ void iter() {
}
int main(void)
-{
+{
memset(&si_host, 0, sizeof(struct sockaddr_in));
si_host.sin_family = AF_INET;
@@ -63,7 +63,7 @@ int main(void)
iov[0].iov_base = buf;
iov[0].iov_len = sizeof(buf);
-
+
memset (&hdr, 0, sizeof (struct msghdr));
hdr.msg_name = &si_host;
diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py
index 2bc34c60..735f0feb 100644
--- a/tests/test_benchmark.py
+++ b/tests/test_benchmark.py
@@ -20,9 +20,10 @@ class Benchmarker:
def __init__(self, name):
self.name = name
- def bench(self, args, output_parser=None):
+ def bench(self, args, output_parser=None, reps=TEST_REPS):
self.times = []
- for i in range(TEST_REPS):
+ self.reps = reps
+ for i in range(reps):
start = time.time()
output = self.run(args)
if not output_parser:
@@ -41,7 +42,7 @@ class Benchmarker:
sorted_times.sort()
median = sum(sorted_times[len(sorted_times)/2 - 1:len(sorted_times)/2 + 1])/2
- print ' %10s: mean: %4.3f (+-%4.3f) secs median: %4.3f range: %4.3f-%4.3f (noise: %4.3f%%) (%d runs)' % (self.name, mean, std, median, min(self.times), max(self.times), 100*std/mean, TEST_REPS),
+ print ' %10s: mean: %4.3f (+-%4.3f) secs median: %4.3f range: %4.3f-%4.3f (noise: %4.3f%%) (%d runs)' % (self.name, mean, std, median, min(self.times), max(self.times), 100*std/mean, self.reps),
if baseline:
mean_baseline = sum(baseline.times)/len(baseline.times)
@@ -110,8 +111,7 @@ process(sys.argv[1])
'-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',
- #'-g2',
+ #'-profiling',
'-o', final] + shared_args + emcc_args + self.extra_args, stdout=PIPE, stderr=PIPE, env=self.env).communicate()
assert os.path.exists(final), 'Failed to compile file: ' + output[0]
self.filename = final
@@ -130,6 +130,7 @@ try:
#NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')),
#NativeBenchmarker('gcc', 'gcc', 'g++'),
JSBenchmarker('sm-f32', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2']),
+ #JSBenchmarker('sm-f32-si', SPIDERMONKEY_ENGINE, ['-profiling', '-s', 'PRECISE_F32=2', '-s', 'SIMPLIFY_IFS=1']),
#JSBenchmarker('sm-f32-aggro', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2', '-s', 'AGGRESSIVE_VARIABLE_ELIMINATION=1']),
#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 }),
@@ -192,7 +193,7 @@ class benchmark(RunnerCore):
print
for b in benchmarkers:
b.build(self, filename, args, shared_args, emcc_args, native_args, native_exec, lib_builder)
- b.bench(args, output_parser)
+ b.bench(args, output_parser, reps)
b.display(benchmarkers[0])
def test_primes(self):
@@ -361,6 +362,51 @@ class benchmark(RunnerCore):
'''
self.do_benchmark('copy', src, 'sum:')
+ def test_ifs(self):
+ src = r'''
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ volatile int x = 0;
+
+ __attribute__ ((noinline)) int calc() {
+ return (x++) & 16384;
+ }
+
+ int main(int argc, char *argv[]) {
+ int arg = argc > 1 ? argv[1][0] - '0' : 3;
+ switch(arg) {
+ case 0: return 0; break;
+ case 1: arg = 75; break;
+ case 2: arg = 625; break;
+ case 3: arg = 1250; break;
+ case 4: arg = 5*1250; break;
+ case 5: arg = 10*1250; break;
+ default: printf("error: %d\\n", arg); return -1;
+ }
+
+ int sum = 0;
+
+ for (int j = 0; j < 27000; j++) {
+ for (int i = 0; i < arg; i++) {
+ if (calc() && calc()) {
+ sum += 17;
+ } else {
+ sum += 19;
+ }
+ if (calc() || calc()) {
+ sum += 23;
+ }
+ }
+ }
+
+ printf("ok\n");
+
+ return sum;
+ }
+ '''
+ self.do_benchmark('ifs', src, 'ok', reps=TEST_REPS*5)
+
def test_fannkuch(self):
src = open(path_from_root('tests', 'fannkuch.cpp'), 'r').read().replace(
'int n = argc > 1 ? atoi(argv[1]) : 0;',
diff --git a/tests/test_browser.py b/tests/test_browser.py
index f0343669..cf893eb5 100644
--- a/tests/test_browser.py
+++ b/tests/test_browser.py
@@ -1587,6 +1587,9 @@ void *getBindBuffer() {
def test_sdl_surface_refcount(self):
self.btest('sdl_surface_refcount.c', expected='1')
+ def test_sdl_free_screen(self):
+ self.btest('sdl_free_screen.cpp', reference='htmltest.png')
+
def test_glbegin_points(self):
shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png'))
self.btest('glbegin_points.c', reference='glbegin_points.png', args=['--preload-file', 'screenshot.png', '-s', 'LEGACY_GL_EMULATION=1'])
diff --git a/tests/test_core.py b/tests/test_core.py
index a954e312..a1fcc3da 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3988,7 +3988,9 @@ def process(filename):
return 0;
}
'''
- 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 clean(out, err):
+ return '\n'.join(filter(lambda line: 'warning' not in line, (out + err).split('\n')))
+ 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, output_nicerizer=clean)
def test_mount(self):
src = open(path_from_root('tests', 'fs', 'test_mount.c'), 'r').read()
@@ -4093,6 +4095,10 @@ def process(filename):
src = open(path_from_root('tests', 'dirent', 'test_readdir.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
+ def test_readdir_empty(self):
+ src = open(path_from_root('tests', 'dirent', 'test_readdir_empty.c'), 'r').read()
+ self.do_run(src, 'success', force_c=True)
+
def test_stat(self):
src = open(path_from_root('tests', 'stat', 'test_stat.c'), 'r').read()
self.do_run(src, 'success', force_c=True)
diff --git a/tests/test_other.py b/tests/test_other.py
index 7585bc2b..59edc7e4 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -65,6 +65,7 @@ Options that are modified or new in %s include:
# emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file
# regression check: -o js should create "js", with bitcode content
for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'src.so'], ['-o', 'js']]:
+ print '-c stuff', args
target = args[1] if len(args) == 2 else 'hello_world.o'
self.clear()
Popen([PYTHON, compiler, path_from_root('tests', 'hello_world' + suffix)] + args, stdout=PIPE, stderr=PIPE).communicate()
@@ -943,11 +944,12 @@ This pointer might make sense in another type signature: i: 0
args=['-I' + path_from_root('tests', 'zlib')], suffix='c')
def test_symlink(self):
+ self.clear()
if os.name == 'nt':
return self.skip('Windows FS does not need to be tested for symlinks support, since it does not have them.')
open(os.path.join(self.get_dir(), 'foobar.xxx'), 'w').write('int main(){ return 0; }')
os.symlink(os.path.join(self.get_dir(), 'foobar.xxx'), os.path.join(self.get_dir(), 'foobar.c'))
- Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate()
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate()
assert os.path.exists(os.path.join(self.get_dir(), 'foobar'))
try_delete(os.path.join(self.get_dir(), 'foobar'))
try_delete(os.path.join(self.get_dir(), 'foobar.xxx'))
@@ -955,7 +957,7 @@ This pointer might make sense in another type signature: i: 0
open(os.path.join(self.get_dir(), 'foobar.c'), 'w').write('int main(){ return 0; }')
os.symlink(os.path.join(self.get_dir(), 'foobar.c'), os.path.join(self.get_dir(), 'foobar.xxx'))
- Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate()
+ Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate()
assert os.path.exists(os.path.join(self.get_dir(), 'foobar'))
try_delete(os.path.join(self.get_dir(), 'foobar'))
try_delete(os.path.join(self.get_dir(), 'foobar.xxx'))
@@ -1586,6 +1588,8 @@ This pointer might make sense in another type signature: i: 0
def test_warn_undefined(self):
open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r'''
#include <stdio.h>
+ #include <SDL.h>
+ #include "SDL/SDL_opengl.h"
extern "C" {
void something();
@@ -1593,6 +1597,7 @@ This pointer might make sense in another type signature: i: 0
}
int main() {
+ printf("%p", SDL_GL_GetProcAddress("glGenTextures")); // pull in gl proc stuff, avoid warnings on emulation funcs
something();
elsey();
return 0;
@@ -1612,6 +1617,7 @@ This pointer might make sense in another type signature: i: 0
self.assertContained('unresolved symbol: something', output[1])
self.assertContained('unresolved symbol: elsey', output[1])
assert os.path.exists('a.out.js')
+ self.assertNotContained('unresolved symbol: emscripten_', output[1])
elif action == 'ERROR' and value:
self.assertContained('unresolved symbol: something', output[1])
self.assertContained('unresolved symbol: elsey', output[1])
@@ -1768,14 +1774,9 @@ This pointer might make sense in another type signature: i: 0
def test_js_optimizer(self):
for input, expected, passes in [
(path_from_root('tools', 'test-js-optimizer.js'), open(path_from_root('tools', 'test-js-optimizer-output.js')).read(),
- ['hoistMultiples', 'loopOptimizer', 'removeAssignsToUndefined', 'simplifyExpressions']),
- (path_from_root('tools', 'test-js-optimizer-t2c.js'), open(path_from_root('tools', 'test-js-optimizer-t2c-output.js')).read(),
- ['simplifyExpressions', 'optimizeShiftsConservative']),
- (path_from_root('tools', 'test-js-optimizer-t2.js'), open(path_from_root('tools', 'test-js-optimizer-t2-output.js')).read(),
- ['simplifyExpressions', 'optimizeShiftsAggressive']),
- # Make sure that optimizeShifts handles functions with shift statements.
- (path_from_root('tools', 'test-js-optimizer-t3.js'), open(path_from_root('tools', 'test-js-optimizer-t3-output.js')).read(),
- ['optimizeShiftsAggressive']),
+ ['hoistMultiples', 'removeAssignsToUndefined', 'simplifyExpressions']),
+ (path_from_root('tools', 'test-js-optimizer-si.js'), open(path_from_root('tools', 'test-js-optimizer-si-output.js')).read(),
+ ['simplifyIfs']),
(path_from_root('tools', 'test-js-optimizer-regs.js'), open(path_from_root('tools', 'test-js-optimizer-regs-output.js')).read(),
['registerize']),
(path_from_root('tools', 'eliminator', 'eliminator-test.js'), open(path_from_root('tools', 'eliminator', 'eliminator-test-output.js')).read(),
@@ -1972,23 +1973,6 @@ seeked= file.
code = open('a.out.js').read()
assert 'SAFE_HEAP' in code, 'valid -s option had an effect'
- def test_jcache_printf(self):
- open(self.in_dir('src.cpp'), 'w').write(r'''
- #include <stdio.h>
- #include <stdint.h>
- #include <emscripten.h>
- int main() {
- emscripten_jcache_printf("hello world\n");
- emscripten_jcache_printf("hello %d world\n", 5);
- emscripten_jcache_printf("hello %.3f world\n", 123.456789123);
- emscripten_jcache_printf("hello %llx world\n", 0x1234567811223344ULL);
- return 0;
- }
- ''')
- Popen([PYTHON, EMCC, self.in_dir('src.cpp')]).communicate()
- output = run_js('a.out.js')
- self.assertIdentical('hello world\nhello 5 world\nhello 123.457 world\nhello 1234567811223300 world\n', output)
-
def test_conftest_s_flag_passing(self):
open(os.path.join(self.get_dir(), 'conftest.c'), 'w').write(r'''
int main() {
@@ -2267,6 +2251,23 @@ int main()
assert 'test.o' in head, 'Invalid dependency target'
assert 'test.cpp' in tail and 'test.hpp' in tail, 'Invalid dependencies generated'
+ def test_dependency_file_2(self):
+ self.clear()
+ shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c')
+ Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c']).communicate()
+ self.assertContained(open('test.d').read(), 'a.o: a.c\n')
+
+ self.clear()
+ shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c')
+ Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c', '-o', 'test.o']).communicate()
+ self.assertContained(open('test.d').read(), 'test.o: a.c\n')
+
+ self.clear()
+ shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c')
+ os.mkdir('obj')
+ Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c', '-o', 'obj/test.o']).communicate()
+ self.assertContained(open('test.d').read(), 'obj/test.o: a.c\n')
+
def test_quoted_js_lib_key(self):
open('lib.js', 'w').write(r'''
mergeInto(LibraryManager.library, {
@@ -2288,11 +2289,16 @@ mergeInto(LibraryManager.library, {
def test_default_obj_ext(self):
outdir = os.path.join(self.get_dir(), 'out_dir') + '/'
+
+ self.clear()
os.mkdir(outdir)
- process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir], stdout=PIPE, stderr=PIPE)
+ process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir])
process.communicate()
assert(os.path.isfile(outdir + 'hello_world.o'))
- process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'], stdout=PIPE, stderr=PIPE)
+
+ self.clear()
+ os.mkdir(outdir)
+ process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'])
process.communicate()
assert(os.path.isfile(outdir + 'hello_world.obj'))
@@ -2558,7 +2564,7 @@ int main()
def test_llvm_lit(self):
llvm_src = LLVM_ROOT
while not os.path.exists(os.path.join(llvm_src, 'emscripten-version.txt')): llvm_src = os.path.dirname(llvm_src)
- cmd = [os.path.join(LLVM_ROOT, 'llvm-lit'), os.path.join(llvm_src, 'test', 'CodeGen', 'JS')]
+ cmd = [os.path.join(LLVM_ROOT, 'llvm-lit'), '-v', os.path.join(llvm_src, 'test', 'CodeGen', 'JS')]
print cmd
p = Popen(cmd)
p.communicate()
@@ -2588,3 +2594,115 @@ int main()
out, err = process.communicate()
assert(warning not in err)
+ def test_simplify_ifs(self):
+ def test(src, nums):
+ open('src.c', 'w').write(src)
+ for opts, ifs in [
+ [['-g2'], nums[0]],
+ [['-profiling'], nums[1]],
+ [['-profiling', '-g2'], nums[2]]
+ ]:
+ print opts, ifs
+ try_delete('a.out.js')
+ Popen([PYTHON, EMCC, 'src.c', '-O2'] + opts, stdout=PIPE).communicate()
+ src = open('a.out.js').read()
+ main = src[src.find('function _main'):src.find('\n}', src.find('function _main'))]
+ actual_ifs = main.count('if (')
+ assert ifs == actual_ifs, main + ' : ' + str([ifs, actual_ifs])
+ #print main
+
+ test(r'''
+ #include <stdio.h>
+ #include <string.h>
+ int main(int argc, char **argv) {
+ if (argc > 5 && strlen(argv[0]) > 1 && strlen(argv[1]) > 2) printf("halp");
+ return 0;
+ }
+ ''', [3, 1, 1])
+
+ test(r'''
+ #include <stdio.h>
+ #include <string.h>
+ int main(int argc, char **argv) {
+ while (argc % 3 == 0) {
+ if (argc > 5 && strlen(argv[0]) > 1 && strlen(argv[1]) > 2) {
+ printf("halp");
+ argc++;
+ } else {
+ while (argc > 0) {
+ printf("%d\n", argc--);
+ }
+ }
+ }
+ return 0;
+ }
+ ''', [8, 5, 5])
+
+ test(r'''
+ #include <stdio.h>
+ #include <string.h>
+ int main(int argc, char **argv) {
+ while (argc % 17 == 0) argc *= 2;
+ if (argc > 5 && strlen(argv[0]) > 10 && strlen(argv[1]) > 20) {
+ printf("halp");
+ argc++;
+ } else {
+ printf("%d\n", argc--);
+ }
+ while (argc % 17 == 0) argc *= 2;
+ return argc;
+ }
+ ''', [6, 3, 3])
+
+ test(r'''
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ int main(int argc, char *argv[]) {
+ if (getenv("A") && getenv("B")) {
+ printf("hello world\n");
+ } else {
+ printf("goodnight moon\n");
+ }
+ printf("and that's that\n");
+ return 0;
+ }
+ ''', [3, 1, 1])
+
+ test(r'''
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ int main(int argc, char *argv[]) {
+ if (getenv("A") || getenv("B")) {
+ printf("hello world\n");
+ }
+ printf("and that's that\n");
+ return 0;
+ }
+ ''', [3, 1, 1])
+
+ def test_symbol_map(self):
+ for m in [0, 1]:
+ self.clear()
+ cmd = [PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-O2']
+ if m: cmd += ['--emit-symbol-map']
+ print cmd
+ stdout, stderr = Popen(cmd, stderr=PIPE).communicate()
+ assert ('''wrote symbol map file''' in stderr) == m, stderr
+ assert (os.path.exists('a.out.js.symbols') == m), stderr
+ if m:
+ symbols = open('a.out.js.symbols').read()
+ assert ':_main' in symbols
+
+ def test_bc_to_bc(self):
+ # emcc should 'process' bitcode to bitcode. build systems can request this if
+ # e.g. they assume our 'executable' extension is bc, and compile an .o to a .bc
+ # (the user would then need to build bc to js of course, but we need to actually
+ # emit the bc)
+ cmd = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c')]).communicate()
+ assert os.path.exists('hello_world.o')
+ cmd = Popen([PYTHON, EMCC, 'hello_world.o', '-o', 'hello_world.bc']).communicate()
+ assert os.path.exists('hello_world.o')
+ assert os.path.exists('hello_world.bc')
+
diff --git a/tests/test_sockets.py b/tests/test_sockets.py
index 3a5555ed..8c2889df 100644
--- a/tests/test_sockets.py
+++ b/tests/test_sockets.py
@@ -345,12 +345,12 @@ class sockets(BrowserCore):
host_outfile = 'host.html'
peer_outfile = 'peer.html'
- host_filepath = path_from_root('tests', 'sockets', host_src)
+ host_filepath = path_from_root('tests', 'sockets', host_src)
temp_host_filepath = os.path.join(self.get_dir(), os.path.basename(host_src))
with open(host_filepath) as f: host_src = f.read()
with open(temp_host_filepath, 'w') as f: f.write(self.with_report_result(host_src))
- peer_filepath = path_from_root('tests', 'sockets', peer_src)
+ peer_filepath = path_from_root('tests', 'sockets', peer_src)
temp_peer_filepath = os.path.join(self.get_dir(), os.path.basename(peer_src))
with open(peer_filepath) as f: peer_src = f.read()
with open(temp_peer_filepath, 'w') as f: f.write(self.with_report_result(peer_src))
@@ -358,7 +358,7 @@ class sockets(BrowserCore):
open(os.path.join(self.get_dir(), 'host_pre.js'), 'w').write('''
var Module = {
webrtc: {
- broker: 'https://mdsw.ch:8080',
+ broker: 'http://localhost:8080',
session: undefined,
onpeer: function(peer, route) {
window.open('http://localhost:8888/peer.html?' + route);
@@ -382,7 +382,7 @@ class sockets(BrowserCore):
open(os.path.join(self.get_dir(), 'peer_pre.js'), 'w').write('''
var Module = {
webrtc: {
- broker: 'https://mdsw.ch:8080',
+ broker: 'http://localhost:8080',
session: window.location.toString().split('?')[1],
onpeer: function(peer, route) {
peer.connect(Module['webrtc']['session']);
@@ -403,9 +403,15 @@ class sockets(BrowserCore):
Popen([PYTHON, EMCC, temp_host_filepath, '-o', host_outfile] + ['-s', 'GL_TESTING=1', '--pre-js', 'host_pre.js', '-s', 'SOCKET_WEBRTC=1', '-s', 'SOCKET_DEBUG=1']).communicate()
Popen([PYTHON, EMCC, temp_peer_filepath, '-o', peer_outfile] + ['-s', 'GL_TESTING=1', '--pre-js', 'peer_pre.js', '-s', 'SOCKET_WEBRTC=1', '-s', 'SOCKET_DEBUG=1']).communicate()
+ # note: you may need to run this manually yourself, if npm is not in the path, or if you need a version that is not in the path
+ Popen(['npm', 'install', path_from_root('tests', 'sockets', 'p2p')]).communicate()
+ broker = Popen(listify(NODE_JS) + [path_from_root('tests', 'sockets', 'p2p', 'broker', 'p2p-broker.js')])
+
expected = '1'
self.run_browser(host_outfile, '.', ['/report_result?' + e for e in expected])
+ broker.kill();
+
def test_nodejs_sockets_echo(self):
# This test checks that sockets work when the client code is run in Node.js
# Run with ./runner.py sockets.test_nodejs_sockets_echo
@@ -414,21 +420,54 @@ class sockets(BrowserCore):
sockets_include = '-I'+path_from_root('tests', 'sockets')
- # Websockify-proxied servers can't run dgram tests
harnesses = [
- # Websockify doesn't seem to like ws.WebSocket clients TODO check if this is a ws issue or Websockify issue
- #(WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 49160), 0),
- (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=0'], 49161), 0),
- (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=1'], 49162), 1)
+ (WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59160), 0),
+ (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=0'], 59162), 0),
+ (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=1'], 59164), 1)
]
+ # Basic test of node client against both a Websockified and compiled echo server.
for harness, datagram in harnesses:
with harness:
- Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', path_from_root('tests', 'sockets', 'client.js'), '-DSOCKK=%d' % harness.listen_port, '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate()
+ Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '-DSOCKK=%d' % harness.listen_port, '-DTEST_DGRAM=%d' % datagram, '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate()
+
+ out = run_js('client.js', engine=NODE_JS, full_output=True)
+ self.assertContained('do_msg_read: read 14 bytes', out)
+
+ # Test against a Websockified server with compile time configured WebSocket subprotocol. We use a Websockified
+ # server because as long as the subprotocol list contains binary it will configure itself to accept binary
+ # This test also checks that the connect url contains the correct subprotocols.
+ print "\nTesting compile time WebSocket configuration.\n"
+ for harness in [
+ WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59166)
+ ]:
+ with harness:
+ Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '-s', 'SOCKET_DEBUG=1', '-s', 'WEBSOCKET_SUBPROTOCOL="base64, binary"', '-DSOCKK=59166', '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate()
+
+ out = run_js('client.js', engine=NODE_JS, full_output=True)
+ self.assertContained('do_msg_read: read 14 bytes', out)
+ self.assertContained('connect: ws://127.0.0.1:59166, base64,binary', out)
+
+ # Test against a Websockified server with runtime WebSocket configuration. We specify both url and subprotocol.
+ # In this test we have *deliberately* used the wrong port '-DSOCKK=12345' to configure the echo_client.c, so
+ # the connection would fail without us specifying a valid WebSocket URL in the configuration.
+ print "\nTesting runtime WebSocket configuration.\n"
+ for harness in [
+ WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59168)
+ ]:
+ with harness:
+ open(os.path.join(self.get_dir(), 'websocket_pre.js'), 'w').write('''
+ var Module = {
+ websocket: {
+ url: 'ws://localhost:59168/testA/testB',
+ subprotocol: 'text, base64, binary',
+ }
+ };
+ ''')
- self.assertContained('do_msg_read: read 14 bytes', run_js(path_from_root('tests', 'sockets', 'client.js'), engine=NODE_JS))
+ Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '--pre-js', 'websocket_pre.js', '-s', 'SOCKET_DEBUG=1', '-DSOCKK=12345', '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate()
- # Tidy up files that might have been created by this test.
- try_delete(path_from_root('tests', 'sockets', 'client.js'))
- try_delete(path_from_root('tests', 'sockets', 'client.js.map'))
+ out = run_js('client.js', engine=NODE_JS, full_output=True)
+ self.assertContained('do_msg_read: read 14 bytes', out)
+ self.assertContained('connect: ws://localhost:59168/testA/testB, text,base64,binary', out)
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js
index 7a8baef2..a3873067 100644
--- a/tools/eliminator/asm-eliminator-test-output.js
+++ b/tools/eliminator/asm-eliminator-test-output.js
@@ -810,4 +810,51 @@ function cute($this, $outImage) {
}
return 0;
}
+function selfAssign() {
+ var i1 = 0;
+ i1 = HEAP32[2] | 0;
+ HEAP32[2] = i1 + 1;
+ if (waka) {
+ return 0;
+ }
+ return i1 & 16384 | 0;
+}
+function elimOneLoopVar($argc, $argv) {
+ $argc = $argc | 0;
+ $argv = $argv | 0;
+ var $arg$0 = 0, $call10 = Math_fround(0), $curri$012 = 0, $inc = 0, $j$010 = 0, $ok$0 = 0, $primes$011 = 0, $retval$0 = 0, $vararg_buffer1 = 0;
+ $curri$012 = 2;
+ $primes$011 = 0;
+ while (1) {
+ $call10 = Math_fround(Math_sqrt(Math_fround(Math_fround($curri$012 | 0))));
+ L15 : do {
+ if ($call10 > Math_fround(+2)) {
+ $j$010 = 2;
+ while (1) {
+ $inc = $j$010 + 1 | 0;
+ if ((($curri$012 | 0) % ($j$010 | 0) & -1 | 0) == 0) {
+ $ok$0 = 0;
+ break L15;
+ }
+ if (Math_fround($inc | 0) < $call10) {
+ $j$010 = $inc;
+ } else {
+ $ok$0 = 1;
+ break;
+ }
+ }
+ } else {
+ $ok$0 = 1;
+ }
+ } while (0);
+ $primes$011 = $ok$0 + $primes$011 | 0;
+ if (($primes$011 | 0) >= ($arg$0 | 0)) {
+ break;
+ } else {
+ $curri$012 = $curri$012 + 1 | 0;
+ }
+ }
+ HEAP32[$vararg_buffer1 >> 2] = $curri$012;
+ return $retval$0 | 0;
+}
diff --git a/tools/eliminator/asm-eliminator-test.js b/tools/eliminator/asm-eliminator-test.js
index ad1ed05e..312e9e2c 100644
--- a/tools/eliminator/asm-eliminator-test.js
+++ b/tools/eliminator/asm-eliminator-test.js
@@ -1027,5 +1027,64 @@ function cute($this, $outImage) {
}
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"]
+function selfAssign() {
+ var i1 = 0;
+ i1 = HEAP32[2] | 0;
+ HEAP32[2] = i1 + 1;
+ if (waka) {
+ return (STACKTOP = STACKTOP, 0);
+ }
+ STACKTOP = STACKTOP;
+ return i1 & 16384 | 0;
+}
+function elimOneLoopVar($argc, $argv) {
+ $argc = $argc | 0;
+ $argv = $argv | 0;
+ var $0 = 0, $1 = 0, $arg$0 = 0, $arrayidx = 0, $call10 = Math_fround(0), $cmp = 0, $cmp11 = 0, $cmp119 = 0, $cmp12 = 0, $cmp7 = 0, $conv = 0, $conv8 = Math_fround(0), $conv9 = Math_fround(0), $curri$012 = 0, $inc = 0, $inc14$primes$0 = 0, $inc16 = 0, $j$010 = 0, $j$010$phi = 0, $ok$0 = 0;
+ var $primes$011 = 0, $rem = 0, $retval$0 = 0, $sub = 0, $vararg_buffer1 = 0, label = 0, sp = 0;
+ $curri$012 = 2;
+ $primes$011 = 0;
+ while (1) {
+ $conv9 = Math_fround($curri$012 | 0);
+ $call10 = Math_fround(Math_sqrt(Math_fround($conv9)));
+ $cmp119 = $call10 > Math_fround(+2);
+ L15 : do {
+ if ($cmp119) {
+ $j$010 = 2;
+ while (1) {
+ $rem = ($curri$012 | 0) % ($j$010 | 0) & -1;
+ $cmp12 = ($rem | 0) == 0;
+ $inc = $j$010 + 1 | 0;
+ if ($cmp12) {
+ $ok$0 = 0;
+ break L15;
+ }
+ $conv8 = Math_fround($inc | 0);
+ $cmp11 = $conv8 < $call10;
+ if ($cmp11) {
+ $j$010$phi = $inc;
+ $j$010 = $j$010$phi;
+ } else {
+ $ok$0 = 1;
+ break;
+ }
+ }
+ } else {
+ $ok$0 = 1;
+ }
+ } while (0);
+ $inc14$primes$0 = $ok$0 + $primes$011 | 0;
+ $inc16 = $curri$012 + 1 | 0;
+ $cmp7 = ($inc14$primes$0 | 0) < ($arg$0 | 0);
+ if ($cmp7) {
+ $curri$012 = $inc16;
+ $primes$011 = $inc14$primes$0;
+ } else {
+ break;
+ }
+ }
+ HEAP32[$vararg_buffer1 >> 2] = $curri$012;
+ return $retval$0 | 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", "selfAssign", "elimOneLoopVar"]
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 81bf8824..086ed30e 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 COMMABLE = set('assign', 'binary', 'unary-prefix', 'unary-postfix', 'name', 'num', 'call', 'seq', 'conditional', 'sub');
+
var FUNCTIONS_THAT_ALWAYS_THROW = set('abort', '___resumeException', '___cxa_throw', '___cxa_rethrow');
var NULL_NODE = ['name', 'null'];
@@ -167,11 +169,11 @@ function astToSrc(ast, minifyWhitespace) {
// Traverses the children of a node. If the traverse function returns an object,
// replaces the child. If it returns true, stop the traversal and return true.
-function traverseChildren(node, traverse, pre, post, stack) {
+function traverseChildren(node, traverse, pre, post) {
for (var i = 0; i < node.length; i++) {
var subnode = node[i];
if (Array.isArray(subnode)) {
- var subresult = traverse(subnode, pre, post, stack);
+ var subresult = traverse(subnode, pre, post);
if (subresult === true) return true;
if (subresult !== null && typeof subresult === 'object') node[i] = subresult;
}
@@ -187,30 +189,24 @@ function traverseChildren(node, traverse, pre, post, stack) {
// it replaces the passed node in the tree. If null is returned, we stop
// traversing the subelements (but continue otherwise).
// @arg post: A callback to call after traversing all children.
-// @arg stack: If true, a stack will be implemented: If pre does not push on
-// the stack, we push a 0. We pop when we leave the node. The
-// stack is passed as a third parameter to the callbacks.
// @returns: If the root node was replaced, the new root node. If the traversal
// was stopped, true. Otherwise undefined.
-function traverse(node, pre, post, stack) {
+function traverse(node, pre, post) {
var type = node[0], result, len;
var relevant = typeof type === 'string';
if (relevant) {
- if (stack) len = stack.length;
- var result = pre(node, type, stack);
+ var result = pre(node, type);
if (result === true) return true;
if (result && result !== null) node = result; // Continue processing on this node
- if (stack && len === stack.length) stack.push(0);
}
if (result !== null) {
- if (traverseChildren(node, traverse, pre, post, stack) === true) return true;
+ if (traverseChildren(node, traverse, pre, post) === true) return true;
}
if (relevant) {
if (post) {
- var postResult = post(node, type, stack);
+ var postResult = post(node, type);
result = result || postResult;
}
- if (stack) stack.pop();
}
return result;
}
@@ -229,38 +225,12 @@ function traverseGeneratedFunctions(ast, callback) {
}
}
-function traverseGenerated(ast, pre, post, stack) {
+function traverseGenerated(ast, pre, post) {
traverseGeneratedFunctions(ast, function(func) {
- traverse(func, pre, post, stack);
+ traverse(func, pre, post);
});
}
-// 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) {
- if (type in FUNCTION) {
- stack.push({ type: 'function', vars: node[2] });
- } else if (type === 'var') {
- // Find our function, add our vars
- var func = stack[stack.length-1];
- if (func) {
- func.vars = func.vars.concat(node[1].map(function(varItem) { return varItem[0] }));
- }
- }
- }, function(node, type, stack) {
- if (type === 'toplevel' || type in FUNCTION) {
- // We know all of the variables that are seen here, proceed to do relevant replacements
- var allVars = stack.map(function(item) { return item ? item.vars : [] }).reduce(concatenator, []); // FIXME dictionary for speed?
- traverse(node, function(node2, type2, stack2) {
- // Be careful not to look into our inner functions. They have already been processed.
- if (sum(stack2) > 1 || (type === 'toplevel' && sum(stack2) === 1)) return;
- if (type2 in FUNCTION) stack2.push(1);
- return callback(node2, type2, allVars);
- }, null, []);
- }
- }, []);
-}
-
function emptyNode() { // XXX do we need to create new nodes here? can't we reuse?
return ['toplevel', []]
}
@@ -290,6 +260,8 @@ function removeEmptySubNodes(node) {
node[3] = filterEmptyNodes(node[3]);
} else if (node[0] === 'block' && node[1]) {
node[1] = filterEmptyNodes(node[1]);
+ } else if (node[0] === 'seq' && isEmptyNode(node[1])) {
+ return node[2];
}
/*
var stats = getStatements(node);
@@ -301,6 +273,16 @@ function removeAllEmptySubNodes(ast) {
traverse(ast, removeEmptySubNodes);
}
+function astCompare(x, y) {
+ if (!Array.isArray(x)) return x === y;
+ if (!Array.isArray(y)) return false;
+ if (x.length !== y.length) return false;
+ for (var i = 0; i < x.length; i++) {
+ if (!astCompare(x[i], y[i])) return false;
+ }
+ return true;
+}
+
// Passes
// Dump the AST. Useful for debugging. For example,
@@ -313,58 +295,6 @@ function dumpSrc(ast) {
printErr(astToSrc(ast));
}
-// Undos closure's creation of global variables with values true, false,
-// undefined, null. These cut down on size, but do not affect gzip size
-// and make JS engine's lives slightly harder (?)
-function unGlobalize(ast) {
-
- throw 'this is deprecated!'; // and does not work with parallel compilation
-
- assert(ast[0] === 'toplevel');
- var values = {};
- // Find global renamings of the relevant values
- ast[1].forEach(function(node, i) {
- if (node[0] != 'var') return;
- node[1] = node[1].filter(function(varItem, j) {
- var ident = varItem[0];
- var value = varItem[1];
- if (!value) return true;
- var possible = false;
- if (jsonCompare(value, NULL_NODE) ||
- jsonCompare(value, UNDEFINED_NODE) ||
- jsonCompare(value, TRUE_NODE) ||
- jsonCompare(value, FALSE_NODE)) {
- possible = true;
- }
- if (!possible) return true;
- // Make sure there are no assignments to this variable. (This isn't fast, we traverse many times..)
- ast[1][i][1][j] = emptyNode();
- var assigned = false;
- traverseWithVariables(ast, function(node, type, allVars) {
- if (type === 'assign' && node[2][0] === 'name' && node[2][1] === ident) assigned = true;
- });
- ast[1][i][1][j] = [ident, value];
- if (!assigned) {
- values[ident] = value;
- return false;
- }
- return true;
- });
-
- if (node[1].length === 0) {
- ast[1][i] = emptyNode();
- }
- });
- traverseWithVariables(ast, function(node, type, allVars) {
- if (type === 'name') {
- var ident = node[1];
- if (ident in values && allVars.indexOf(ident) < 0) {
- return copy(values[ident]);
- }
- }
- });
-}
-
// Closure compiler, when inlining, will insert assignments to
// undefined for the shared variables. However, in compiled code
// - and in library/shell code too! - we should never rely on
@@ -436,7 +366,7 @@ function removeUnneededLabelSettings(ast) {
});
}
-// Various expression simplifications. Pre run before closure (where we still have metadata), Post run after.
+// Various expression simplifications. Happens after elimination, which opens up many of these simplification opportunities.
var USEFUL_BINARY_OPS = set('<<', '>>', '|', '&', '^');
var COMPARE_OPS = set('<', '<=', '>', '>=', '==', '===', '!=', '!==');
@@ -491,10 +421,12 @@ function simplifyExpressions(ast) {
var rerun = true;
while (rerun) {
rerun = false;
- traverse(ast, function process(node, type, stack) {
+ var stack = [];
+ traverse(ast, function process(node, type) {
if (type === 'binary' && node[1] === '|') {
if (node[2][0] === 'num' && node[3][0] === 'num') {
node[2][1] |= node[3][1];
+ stack.push(0);
return node[2];
}
var go = false;
@@ -527,7 +459,7 @@ function simplifyExpressions(ast) {
node[j] = result[j];
}
rerun = true;
- return process(result, result[0], stack);
+ return process(result, result[0]);
} else if (stack[i] === -1) {
break; // Too bad, we can't
}
@@ -543,7 +475,9 @@ function simplifyExpressions(ast) {
} else {
stack.push(-1); // This node is dangerous! Give up if you see this before you see '1'
}
- }, null, []);
+ }, function() {
+ stack.pop();
+ });
}
}
@@ -819,344 +753,165 @@ function simplifyExpressions(ast) {
simplifyIntegerConversions(func);
simplifyBitops(func);
joinAdditions(func);
- // simplifyZeroComp(func); TODO: investigate performance
simplifyNotComps(func);
+ // simplifyZeroComp(func); TODO: investigate performance
});
}
-// In typed arrays mode 2, we can have
-// HEAP[x >> 2]
-// very often. We can in some cases do the shift on the variable itself when it is set,
-// to greatly reduce the number of shift operations.
-// XXX this optimization is deprecated and currently invalid: does not handle overflows
-// or non-aligned (round numbers, x >> 2 is a multiple of 4). Both are ok to assume
-// for pointers (undefined behavior otherwise), but invalid in general, and we do
-// no sufficiently-well distinguish the cases.
-function optimizeShiftsInternal(ast, conservative) {
- var MAX_SHIFTS = 3;
- traverseGeneratedFunctions(ast, function(fun) {
- var funMore = true;
- var funFinished = {};
- while (funMore) {
- funMore = false;
- // Recognize variables and parameters
- var vars = {};
- function newVar(name, param, addUse) {
- if (!vars[name]) {
- vars[name] = {
- param: param,
- defs: addUse ? 1 : 0,
- uses: 0,
- timesShifted: [0, 0, 0, 0], // zero shifts of size 0, 1, 2, 3
- benefit: 0,
- primaryShift: -1
- };
- }
- }
- // params
- if (fun[2]) {
- fun[2].forEach(function(arg) {
- newVar(arg, true, true);
- });
- }
- // vars
- // XXX if var has >>=, ignore it here? That means a previous pass already optimized it
- var hasSwitch = traverse(fun, function(node, type) {
- if (type === 'var') {
- node[1].forEach(function(arg) {
- newVar(arg[0], false, arg[1]);
- });
- } else if (type === 'switch') {
- // The relooper can't always optimize functions, and we currently don't work with
- // switch statements when optimizing shifts. Bail.
- return true;
- }
- });
- if (hasSwitch) {
- break;
- }
- // uses and defs TODO: weight uses by being inside a loop (powers). without that, we
- // optimize for code size, not speed.
- traverse(fun, function(node, type, stack) {
- stack.push(node);
- if (type === 'name' && vars[node[1]] && stack[stack.length-2][0] != 'assign') {
- vars[node[1]].uses++;
- } else if (type === 'assign' && node[2][0] === 'name' && vars[node[2][1]]) {
- vars[node[2][1]].defs++;
- }
- }, null, []);
- // First, break up elements inside a shift. This lets us see clearly what to do next.
- traverse(fun, function(node, type) {
- if (type === 'binary' && node[1] === '>>' && node[3][0] === 'num') {
- var shifts = node[3][1];
- if (shifts <= MAX_SHIFTS) {
- // Push the >> inside the value elements
- function addShift(subNode) {
- if (subNode[0] === 'binary' && subNode[1] === '+') {
- subNode[2] = addShift(subNode[2]);
- subNode[3] = addShift(subNode[3]);
- return subNode;
- }
- if (subNode[0] === 'name' && !subNode[2]) { // names are returned with a shift, but we also note their being shifted
- var name = subNode[1];
- if (vars[name]) {
- vars[name].timesShifted[shifts]++;
- subNode[2] = true;
- }
- }
- return ['binary', '>>', subNode, ['num', shifts]];
- }
- return addShift(node[2]);
+
+function simplifyIfs(ast) {
+ traverseGeneratedFunctions(ast, function(func) {
+ var simplifiedAnElse = false;
+
+ traverse(func, function(node, type) {
+ // simplify if (x) { if (y) { .. } } to if (x ? y : 0) { .. }
+ if (type === 'if') {
+ var body = node[2];
+ // recurse to handle chains
+ while (body[0] === 'block') {
+ var stats = body[1];
+ if (stats.length === 0) break;
+ var other = stats[stats.length-1];
+ if (other[0] !== 'if') {
+ // our if block does not end with an if. perhaps if have an else we can flip
+ if (node[3] && node[3][0] === 'block') {
+ var stats = node[3][1];
+ if (stats.length === 0) break;
+ var other = stats[stats.length-1];
+ if (other[0] === 'if') {
+ // flip node
+ node[1] = flipCondition(node[1]);
+ node[2] = node[3];
+ node[3] = body;
+ body = node[2];
+ } else break;
+ } else break;
}
- }
- });
- traverse(fun, function(node, type) {
- if (node[0] === 'name' && node[2]) {
- return node.slice(0, 2); // clean up our notes
- }
- });
- // At this point, shifted expressions are split up, and we know who the vars are and their info, so we can decide
- // TODO: vars that depend on other vars
- for (var name in vars) {
- var data = vars[name];
- var totalTimesShifted = sum(data.timesShifted);
- if (totalTimesShifted === 0) {
- continue;
- }
- if (totalTimesShifted != Math.max.apply(null, data.timesShifted)) {
- // TODO: Handle multiple different shifts
- continue;
- }
- if (funFinished[name]) continue;
- // We have one shift size (and possible unshifted uses). Consider replacing this variable with a shifted clone. If
- // the estimated benefit is >0, we will do it
- if (data.defs === 1) {
- data.benefit = totalTimesShifted - 2*(data.defs + (data.param ? 1 : 0));
- }
- if (conservative) data.benefit = 0;
- if (data.benefit > 0) {
- funMore = true; // We will reprocess this function
- for (var i = 0; i < 4; i++) {
- if (data.timesShifted[i]) {
- data.primaryShift = i;
+ // we can handle elses, but must be fully identical
+ if (node[3] || other[3]) {
+ if (!node[3]) break;
+ if (!astCompare(node[3], other[3])) {
+ // the elses are different, but perhaps if we flipped a condition we can do better
+ if (astCompare(node[3], other[2])) {
+ // flip other. note that other may not have had an else! add one if so; we will eliminate such things later
+ if (!other[3]) other[3] = ['block', []];
+ other[1] = flipCondition(other[1]);
+ var temp = other[2];
+ other[2] = other[3];
+ other[3] = temp;
+ } else break;
}
}
- }
- }
- //printErr(JSON.stringify(vars));
- function cleanNotes() { // We need to mark 'name' nodes as 'processed' in some passes here; this cleans the notes up
- traverse(fun, function(node, type) {
- if (node[0] === 'name' && node[2]) {
- return node.slice(0, 2);
- }
- });
- }
- cleanNotes();
- // Apply changes
- function needsShift(name) {
- return vars[name] && vars[name].primaryShift >= 0;
- }
- for (var name in vars) { // add shifts for params and var's for all new variables
- var data = vars[name];
- if (needsShift(name)) {
- if (data.param) {
- fun[3].unshift(['var', [[name + '$s' + data.primaryShift, ['binary', '>>', ['name', name], ['num', data.primaryShift]]]]]);
- } else {
- fun[3].unshift(['var', [[name + '$s' + data.primaryShift]]]);
- }
- }
- }
- traverse(fun, function(node, type, stack) { // add shift to assignments
- stack.push(node);
- if (node[0] === 'assign' && node[1] === true && node[2][0] === 'name' && needsShift(node[2][1]) && !node[2][2]) {
- var name = node[2][1];
- var data = vars[name];
- var parent = stack[stack.length-3];
- var statements = getStatements(parent);
- assert(statements, 'Invalid parent for assign-shift: ' + dump(parent));
- var i = statements.indexOf(stack[stack.length-2]);
- statements.splice(i+1, 0, ['stat', ['assign', true, ['name', name + '$s' + data.primaryShift], ['binary', '>>', ['name', name, true], ['num', data.primaryShift]]]]);
- } else if (node[0] === 'var') {
- var args = node[1];
- for (var i = 0; i < args.length; i++) {
- var arg = args[i];
- var name = arg[0];
- var data = vars[name];
- if (arg[1] && needsShift(name)) {
- args.splice(i+1, 0, [name + '$s' + data.primaryShift, ['binary', '>>', ['name', name, true], ['num', data.primaryShift]]]);
+ if (stats.length > 1) {
+ // try to commaify - turn everything between the ifs into a comma operator inside the second if
+ var ok = true;
+ for (var i = 0; i < stats.length-1; i++) {
+ var curr = stats[i];
+ if (curr[0] === 'stat') curr = curr[1];
+ if (!(curr[0] in COMMABLE)) ok = false;
}
+ if (!ok) break;
+ for (var i = stats.length-2; i >= 0; i--) {
+ var curr = stats[i];
+ if (curr[0] === 'stat') curr = curr[1];
+ other[1] = ['seq', curr, other[1]];
+ }
+ stats = body[1] = [other];
}
- return node;
- }
- }, null, []);
- cleanNotes();
- traverse(fun, function(node, type, stack) { // replace shifted name with new variable
- stack.push(node);
- if (node[0] === 'binary' && node[1] === '>>' && node[2][0] === 'name' && needsShift(node[2][1]) && node[3][0] === 'num') {
- var name = node[2][1];
- var data = vars[name];
- var parent = stack[stack.length-2];
- // Don't modify in |x$sN = x >> 2|, in normal assigns and in var assigns
- if (parent[0] === 'assign' && parent[2][0] === 'name' && parent[2][1] === name + '$s' + data.primaryShift) return;
- if (parent[0] === name + '$s' + data.primaryShift) return;
- if (node[3][1] === data.primaryShift) {
- return ['name', name + '$s' + data.primaryShift];
- }
+ if (stats.length !== 1) break;
+ if (node[3]) simplifiedAnElse = true;
+ node[1] = ['conditional', node[1], other[1], ['num', 0]];
+ body = node[2] = other[2];
}
- }, null, []);
- cleanNotes();
- var SIMPLE_SHIFTS = set('<<', '>>');
- var more = true;
- while (more) { // combine shifts in the same direction as an optimization
- more = false;
- traverse(fun, function(node, type) {
- if (node[0] === 'binary' && node[1] in SIMPLE_SHIFTS && node[2][0] === 'binary' && node[2][1] === node[1] &&
- node[3][0] === 'num' && node[2][3][0] === 'num') { // do not turn a << b << c into a << b + c; while logically identical, it is slower
- more = true;
- return ['binary', node[1], node[2][2], ['num', node[3][1] + node[2][3][1]]];
- }
- });
}
- // Before recombining, do some additional optimizations
- traverse(fun, function(node, type) {
- // Apply constant shifts onto constants
- if (type === 'binary' && node[1] === '>>' && node[2][0] === 'num' && node[3][0] === 'num' && node[3][1] <= MAX_SHIFTS) {
- var subNode = node[2];
- var shifts = node[3][1];
- var result = subNode[1] / Math.pow(2, shifts);
- if (result % 1 === 0) {
- subNode[1] = result;
- return subNode;
+ });
+
+ if (simplifiedAnElse) {
+ // there may be fusing opportunities
+
+ // we can only fuse if we remove all uses of the label. if there are
+ // other ones - if the label check can be reached from elsewhere -
+ // we must leave it
+ var abort = false;
+
+ var labelAssigns = {};
+ traverse(func, function(node, type) {
+ if (type === 'assign' && node[2][0] === 'name' && node[2][1] === 'label') {
+ if (node[3][0] === 'num') {
+ var value = node[3][1];
+ labelAssigns[value] = (labelAssigns[value] || 0) + 1;
+ } else {
+ // label is assigned a dynamic value (like from indirectbr), we cannot do anything
+ abort = true;
}
}
- // Optimize the case of ($a*80)>>2 into ($a*20)|0
- if (type === 'binary' && node[1] in SIMPLE_SHIFTS &&
- node[2][0] === 'binary' && node[2][1] === '*') {
- var mulNode = node[2];
- if (mulNode[2][0] === 'num') {
- var temp = mulNode[2];
- mulNode[2] = mulNode[3];
- mulNode[3] = temp;
- }
- if (mulNode[3][0] === 'num') {
- if (node[1] === '<<') {
- mulNode[3][1] *= Math.pow(2, node[3][1]);
- node[1] = '|';
- node[3][1] = 0;
- return node;
- } else {
- if (mulNode[3][1] % Math.pow(2, node[3][1]) === 0) {
- mulNode[3][1] /= Math.pow(2, node[3][1]);
- node[1] = '|';
- node[3][1] = 0;
- return node;
- }
- }
+ });
+ if (abort) return;
+
+ var labelChecks = {};
+ traverse(func, function(node, type) {
+ if (type === 'binary' && node[1] === '==' && node[2][0] === 'binary' && node[2][1] === '|' &&
+ node[2][2][0] === 'name' && node[2][2][1] === 'label') {
+ if (node[3][0] === 'num') {
+ var value = node[3][1];
+ labelChecks[value] = (labelChecks[value] || 0) + 1;
+ } else {
+ // label is checked vs a dynamic value (like from indirectbr), we cannot do anything
+ abort = true;
}
}
- /* XXX - theoretically useful optimization(s), but commented out as not helpful in practice
- // Transform (x << 2) >> 2 into x & mask or something even simpler
- if (type === 'binary' && node[1] === '>>' && node[3][0] === 'num' &&
- node[2][0] === 'binary' && node[2][1] === '<<' && node[2][3][0] === 'num' && node[3][1] === node[2][3][1]) {
- var subNode = node[2];
- var shifts = node[3][1];
- var mask = ((0xffffffff << shifts) >>> shifts) | 0;
- return ['binary', '&', subNode[2], ['num', mask]];
- //return ['binary', '|', subNode[2], ['num', 0]];
- //return subNode[2];
- }
- */
});
- // Re-combine remaining shifts, to undo the breaking up we did before. may require reordering inside +'s
- traverse(fun, function(node, type, stack) {
- stack.push(node);
- if (type === 'binary' && node[1] === '+' && (stack[stack.length-2][0] != 'binary' || stack[stack.length-2][1] !== '+')) {
- // 'Flatten' added items
- var addedItems = [];
- function flatten(node) {
- if (node[0] === 'binary' && node[1] === '+') {
- flatten(node[2]);
- flatten(node[3]);
- } else {
- addedItems.push(node);
- }
- }
- flatten(node);
- var originalOrder = addedItems.slice();
- function key(node) { // a unique value for all relevant shifts for recombining, non-unique for stuff we don't need to bother with
- function originalOrderKey(item) {
- return -originalOrder.indexOf(item);
- }
- if (node[0] === 'binary' && node[1] in SIMPLE_SHIFTS) {
- if (node[3][0] === 'num' && node[3][1] <= MAX_SHIFTS) return 2*node[3][1] + (node[1] === '>>' ? 100 : 0); // 0-106
- return (node[1] === '>>' ? 20000 : 10000) + originalOrderKey(node);
- }
- if (node[0] === 'num') return -20000 + node[1];
- return -10000 + originalOrderKey(node); // Don't modify the original order if we don't modify anything
- }
- for (var i = 0; i < addedItems.length; i++) {
- if (addedItems[i][0] === 'string') return; // this node is not relevant for us
- }
- addedItems.sort(function(node1, node2) {
- return key(node1) - key(node2);
- });
- // Regenerate items, now sorted
- var i = 0;
- while (i < addedItems.length-1) { // re-combine inside addedItems
- var k = key(addedItems[i]), k1 = key(addedItems[i+1]);
- if (k === k1 && k >= 0 && k1 <= 106) {
- addedItems[i] = ['binary', addedItems[i][1], ['binary', '+', addedItems[i][2], addedItems[i+1][2]], addedItems[i][3]];
- addedItems.splice(i+1, 1);
- } else {
- i++;
- }
- }
- var num = 0;
- for (i = 0; i < addedItems.length; i++) { // combine all numbers into one
- if (addedItems[i][0] === 'num') {
- num += addedItems[i][1];
- addedItems.splice(i, 1);
- i--;
- }
- }
- if (num != 0) { // add the numbers into an existing shift, we
- // prefer (x+5)>>7 over (x>>7)+5 , since >>'s result is known to be 32-bit and is more easily optimized.
- // Also, in the former we can avoid the parentheses, which saves a little space (the number will be bigger,
- // so it might take more space, but normally at most one more digit).
- var added = false;
- for (i = 0; i < addedItems.length; i++) {
- if (addedItems[i][0] === 'binary' && addedItems[i][1] === '>>' && addedItems[i][3][0] === 'num' && addedItems[i][3][1] <= MAX_SHIFTS) {
- addedItems[i] = ['binary', '>>', ['binary', '+', addedItems[i][2], ['num', num << addedItems[i][3][1]]], addedItems[i][3]];
- added = true;
+ if (abort) return;
+
+ var inLoop = 0; // when in a loop, we do not emit label = 0; in the relooper as there is no need
+ traverse(func, function(node, type) {
+ if (type === 'while') inLoop++;
+ var stats = getStatements(node);
+ if (stats) {
+ for (var i = 0; i < stats.length-1; i++) {
+ var pre = stats[i];
+ var post = stats[i+1];
+ if (pre[0] === 'if' && pre[3] && post[0] === 'if' && !post[3]) {
+ var postCond = post[1];
+ if (postCond[0] === 'binary' && postCond[1] === '==' &&
+ postCond[2][0] === 'binary' && postCond[2][1] === '|' &&
+ postCond[2][2][0] === 'name' && postCond[2][2][1] === 'label' &&
+ postCond[2][3][0] === 'num' && postCond[2][3][1] === 0 &&
+ postCond[3][0] === 'num') {
+ var postValue = postCond[3][1];
+ var preElse = pre[3];
+ if (labelAssigns[postValue] === 1 && labelChecks[postValue] === 1 && preElse[0] === 'block' && preElse[1] && preElse[1].length === 1) {
+ var preStat = preElse[1][0];
+ if (preStat[0] === 'stat' && preStat[1][0] === 'assign' &&
+ preStat[1][1] === true && preStat[1][2][0] === 'name' && preStat[1][2][1] === 'label' &&
+ preStat[1][3][0] === 'num' && preStat[1][3][1] === postValue) {
+ // Conditions match, just need to make sure the post clears label
+ if (post[2][0] === 'block' && post[2][1] && post[2][1].length > 0) {
+ var postStat = post[2][1][0];
+ var haveClear =
+ postStat[0] === 'stat' && postStat[1][0] === 'assign' &&
+ postStat[1][1] === true && postStat[1][2][0] === 'name' && postStat[1][2][1] === 'label' &&
+ postStat[1][3][0] === 'num' && postStat[1][3][1] === 0;
+ if (!inLoop || haveClear) {
+ // Everything lines up, do it
+ pre[3] = post[2];
+ if (haveClear) pre[3][1].splice(0, 1); // remove the label clearing
+ stats.splice(i+1, 1); // remove the post entirely
+ }
+ }
+ }
+ }
}
}
- if (!added) {
- addedItems.unshift(['num', num]);
- }
- }
- var ret = addedItems.pop();
- while (addedItems.length > 0) { // re-create AST from addedItems
- ret = ['binary', '+', ret, addedItems.pop()];
}
- return ret;
}
- }, null, []);
- // Note finished variables
- for (var name in vars) {
- funFinished[name] = true;
- }
+ }, function(node, type) {
+ if (type === 'while') inLoop--;
+ });
}
});
}
-function optimizeShiftsConservative(ast) {
- optimizeShiftsInternal(ast, true);
-}
-
-function optimizeShiftsAggressive(ast) {
- optimizeShiftsInternal(ast, false);
-}
-
// We often have branchings that are simplified so one end vanishes, and
// we then get
// if (!(x < 5))
@@ -1183,6 +938,10 @@ function simplifyNotCompsDirect(node) {
if (!simplifyNotCompsPass) return node;
}
+function flipCondition(cond) {
+ return simplifyNotCompsDirect(['unary-prefix', '!', cond]);
+}
+
var simplifyNotCompsPass = false;
function simplifyNotComps(ast) {
@@ -1449,7 +1208,7 @@ function hoistMultiples(ast) {
var temp = node[3];
node[3] = node[2];
node[2] = temp;
- node[1] = simplifyNotCompsDirect(['unary-prefix', '!', node[1]]);
+ node[1] = flipCondition(node[1]);
stat1 = node[2][1];
stat2 = node[3][1];
}
@@ -3741,6 +3500,9 @@ function eliminate(ast, memSafe) {
node[0] = 'toplevel';
node[1] = [];
}
+ } else if (type === 'assign' && node[1] === true && node[2][0] === 'name' && node[3][0] === 'name' && node[2][1] === node[3][1]) {
+ // elimination led to X = X, which we can just remove
+ return emptyNode();
}
}, function(node, type) {
// post
@@ -3788,7 +3550,7 @@ function eliminate(ast, memSafe) {
}
}
}
- if (loopers.length < assigns.length) return; // TODO: handle the case where can can just eliminate one. (we can't optimize the break, but we can remove the var at least)
+ if (loopers.length === 0) return;
for (var l = 0; l < loopers.length; l++) {
var looper = loopers[l];
var helper = helpers[l];
@@ -3840,9 +3602,24 @@ function eliminate(ast, memSafe) {
// simplify the if. we remove the if branch, leaving only the else
if (flip) {
last[1] = simplifyNotCompsDirect(['unary-prefix', '!', last[1]]);
+ var temp = last[2];
last[2] = last[3];
+ last[3] = temp;
+ }
+ if (loopers.length === assigns.length) {
+ last.pop();
+ } else {
+ var elseStats = getStatements(last[3]);
+ for (var i = 0; i < elseStats.length; i++) {
+ var stat = elseStats[i];
+ if (stat[0] === 'stat') stat = stat[1];
+ if (stat[0] === 'assign' && stat[2][0] === 'name') {
+ if (loopers.indexOf(stat[2][1]) >= 0) {
+ elseStats[i] = emptyNode();
+ }
+ }
+ }
}
- last.pop();
}
}
}
@@ -5258,12 +5035,10 @@ var passes = {
// passes
dumpAst: dumpAst,
dumpSrc: dumpSrc,
- unGlobalize: unGlobalize,
removeAssignsToUndefined: removeAssignsToUndefined,
//removeUnneededLabelSettings: removeUnneededLabelSettings,
simplifyExpressions: simplifyExpressions,
- optimizeShiftsConservative: optimizeShiftsConservative,
- optimizeShiftsAggressive: optimizeShiftsAggressive,
+ simplifyIfs: simplifyIfs,
hoistMultiples: hoistMultiples,
loopOptimizer: loopOptimizer,
registerize: registerize,
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py
index 4821cc81..d0284528 100644
--- a/tools/js_optimizer.py
+++ b/tools/js_optimizer.py
@@ -32,6 +32,7 @@ class Minifier:
def __init__(self, js, js_engine):
self.js = js
self.js_engine = js_engine
+ self.symbols_file = None
def minify_shell(self, shell, minify_whitespace, source_map=False):
# Run through js-optimizer.js to find and minify the global symbols
@@ -61,6 +62,14 @@ class Minifier:
#print >> sys.stderr, "minified SHELL 3333333333333333", output, "\n44444444444444444444"
code, metadata = output.split('// EXTRA_INFO:')
self.globs = json.loads(metadata)
+
+ if self.symbols_file:
+ mapfile = open(self.symbols_file, 'w')
+ for key, value in self.globs.iteritems():
+ mapfile.write(value + ':' + key + '\n')
+ mapfile.close()
+ print >> sys.stderr, 'wrote symbol map file to', self.symbols_file
+
return code.replace('13371337', '0.0')
@@ -162,6 +171,12 @@ EMSCRIPTEN_FUNCS();
# we assume there is a maximum of one new name per line
minifier = Minifier(js, js_engine)
+ def check_symbol_mapping(p):
+ if p.startswith('symbolMap='):
+ minifier.symbols_file = p.split('=')[1]
+ return False
+ return True
+ passes = filter(check_symbol_mapping, passes)
asm_shell_pre, asm_shell_post = minifier.minify_shell(asm_shell, 'minifyWhitespace' in passes, source_map).split('EMSCRIPTEN_FUNCS();');
asm_shell_post = asm_shell_post.replace('});', '})');
pre += asm_shell_pre + '\n' + start_funcs_marker
diff --git a/tools/shared.py b/tools/shared.py
index 27df83ce..5425d2c1 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -722,14 +722,13 @@ else:
# Engine tweaks
try:
- SPIDERMONKEY_ENGINE = listify(SPIDERMONKEY_ENGINE)
- if 'gcparam' not in str(SPIDERMONKEY_ENGINE):
- new_spidermonkey = SPIDERMONKEY_ENGINE
+ new_spidermonkey = listify(SPIDERMONKEY_ENGINE)
+ if 'gcparam' not in str(new_spidermonkey):
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
- if '-w' not in SPIDERMONKEY_ENGINE:
- SPIDERMONKEY_ENGINE += ['-w']
+ if '-w' not in str(new_spidermonkey):
+ new_spidermonkey += ['-w']
+ JS_ENGINES = map(lambda x: new_spidermonkey if x == SPIDERMONKEY_ENGINE else x, JS_ENGINES)
+ SPIDERMONKEY_ENGINE = new_spidermonkey
except NameError:
pass
@@ -1598,34 +1597,6 @@ class Building:
import gen_struct_info
gen_struct_info.main(['-qo', info_path, path_from_root('src/struct_info.json')])
- @staticmethod
- def preprocess(infile, outfile):
- '''
- Preprocess source C/C++ in some special ways that emscripten needs. Returns
- a filename (potentially the same one if nothing was changed).
-
- Currently this only does emscripten_jcache_printf(..) rewriting.
- '''
- src = open(infile).read() # stack warning on jcacheprintf! in docs # add jcache printf test separatrely, for content of printf
- if 'emscripten_jcache_printf' not in src: return infile
- def fix(m):
- 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') != '0': # fake it in fastcomp
- return text.replace('emscripten_jcache_printf', 'printf')
- start = text.index('(')
- end = text.rindex(')')
- args = text[start+1:end].split(',')
- args = map(lambda x: x.strip(), args)
- if args[0][0] == '"':
- # flatten out
- args = map(lambda x: str(ord(x)), args[0][1:len(args[0])-1]) + ['0'] + args[1:]
- return 'emscripten_jcache_printf_(' + ','.join(args) + ')'
- src = re.sub(r'(emscripten_jcache_printf\([^)]+\))', lambda m: fix(m), src)
- open(outfile, 'w').write(src)
- return outfile
-
# compatibility with existing emcc, etc. scripts
Cache = cache.Cache(debug=DEBUG_CACHE)
JCache = cache.JCache(Cache)
@@ -1834,5 +1805,10 @@ def unsuffixed(name):
def unsuffixed_basename(name):
return os.path.basename(unsuffixed(name))
+def safe_move(src, dst):
+ if os.path.abspath(src) == os.path.abspath(dst):
+ return
+ shutil.move(src, dst)
+
import js_optimizer
diff --git a/tools/test-js-optimizer-output.js b/tools/test-js-optimizer-output.js
index 5e5ff29a..41f79f76 100644
--- a/tools/test-js-optimizer-output.js
+++ b/tools/test-js-optimizer-output.js
@@ -4,25 +4,25 @@ function expr() {
function loopy() {
$while_body$2 : while (1) {
$ok = 1;
- while (1) {
- if ($ok) break;
+ $for_cond$4 : while (1) {
+ if ($ok) break $for_cond$4;
var $inc = $ok + 1;
if ($inc == 9999) break $while_body$2;
}
- continue;
+ continue $while_body$2;
}
next();
- while (1) {
+ b$while_body$2 : while (1) {
$ok = 1;
- while (1) {
- if ($ok) break;
+ b$for_cond$4 : while (1) {
+ if ($ok) break b$for_cond$4;
var $inc = $ok + 1;
}
- continue;
+ continue b$while_body$2;
}
next();
- do {
- if (!$ok) break;
+ $once : do {
+ if (!$ok) break $once;
something();
} while (0);
next();
@@ -33,7 +33,9 @@ function loopy() {
something();
} while (0);
next();
- something();
+ c$once : do {
+ something();
+ } while (0);
}
function bits() {
print(($s & 65535) + ((($f & 65535) << 16 >> 16) * (($f & 65535) << 16 >> 16) | 0) % 256 & 65535);
@@ -68,9 +70,9 @@ function hoisting() {
}
} while (0);
pause(2);
- do {
+ cheez : do {
if ($i < $N) {
- if (callOther()) break;
+ if (callOther()) break cheez;
}
} while (0);
pause(3);
@@ -97,7 +99,7 @@ function hoisting() {
somethingElse();
}
pause(7);
- while (1) {
+ free : while (1) {
if ($i >= $N) {
label = 3;
break;
@@ -110,24 +112,26 @@ function hoisting() {
}
pause(8);
var $cmp95 = $69 == -1;
- do {
+ $if_then96$$if_end110thread_pre_split$48 : do {
if ($cmp95) {
if (!$cmp103) {
label = 38;
- break;
+ break $if_then96$$if_end110thread_pre_split$48;
}
if (!$cmp106) {
label = 38;
- break;
+ break $if_then96$$if_end110thread_pre_split$48;
}
label = 39;
- break;
+ break $if_then96$$if_end110thread_pre_split$48;
}
label = 38;
} while (0);
- if (label == 38) {
- var $79 = $_pr6;
- }
+ $if_end110$$if_end110thread_pre_split$52 : do {
+ if (label == 38) {
+ var $79 = $_pr6;
+ }
+ } while (0);
pause(9);
var $cmp70 = ($call69 | 0) != 0;
pause(10);
@@ -191,24 +195,26 @@ function sleep() {
return 0;
}
function demangle($cmp) {
- do {
+ $if_then$$lor_lhs_false$2 : do {
if (!$cmp) {
if (something()) {
label = 3;
- break;
+ break $if_then$$lor_lhs_false$2;
}
more();
- break;
+ break $if_then$$lor_lhs_false$2;
}
label = 3;
} while (0);
- if (label == 3) {
- final();
- }
+ $if_then$$return$6 : do {
+ if (label == 3) {
+ final();
+ }
+ } while (0);
}
function lua() {
- while (1) {
- do {
+ $5$98 : while (1) {
+ $15$$16$101 : do {
if (!$14) {
var $17 = $i;
var $18 = $3;
@@ -217,7 +223,7 @@ function lua() {
var $21 = $20 + 1 | 0;
var $22 = HEAP8[$21];
var $23 = $22 << 24 >> 24;
- break;
+ break $15$$16$101;
}
} while (0);
}
@@ -236,14 +242,16 @@ function lua() {
}
}
function moreLabels() {
- while (1) {
+ $for_cond$2 : while (1) {
if (!$cmp) {
- break;
+ break $for_cond$2;
}
- if ($cmp1) {
- break;
- }
- inc();
+ $if_then$$for_inc$5 : do {
+ if ($cmp1) {
+ break $for_cond$2;
+ }
+ inc();
+ } while (0);
}
pause(999);
$while_body$$while_end$31 : do {
diff --git a/tools/test-js-optimizer-si-output.js b/tools/test-js-optimizer-si-output.js
new file mode 100644
index 00000000..9ef5171c
--- /dev/null
+++ b/tools/test-js-optimizer-si-output.js
@@ -0,0 +1,197 @@
+function a() {
+ if (x ? y : 0) {
+ g();
+ }
+ if (x) {
+ if (y) {
+ g();
+ } else {
+ h();
+ }
+ }
+ if (x) {
+ if (y) {
+ g();
+ }
+ h();
+ }
+ if (x) {
+ if (y) {
+ g();
+ }
+ } else {
+ h();
+ }
+ if (x) {
+ return;
+ if (y) {
+ g();
+ }
+ }
+ if ((x ? y : 0) ? z : 0) {
+ g();
+ }
+ if (x) {
+ return;
+ if (y ? z : 0) {
+ g();
+ }
+ }
+ if (x ? y : 0) {
+ return;
+ if (z) {
+ g();
+ }
+ }
+ if (x ? y : 0) {
+ if (z) {
+ g();
+ }
+ f();
+ }
+ if (x) {
+ if (y ? z : 0) {
+ g();
+ }
+ f();
+ }
+ if (x ? (f(), x = x + 2 | 0, y) : 0) {
+ g();
+ }
+ if (x) {
+ f();
+ x = x + 2 | 0;
+ return;
+ if (y) {
+ g();
+ }
+ }
+ andNowForElses();
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 5;
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 5;
+ }
+ } else {
+ label = 6;
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 5;
+ }
+ }
+ if (x) {
+ if (y) {
+ f();
+ }
+ } else {
+ label = 5;
+ }
+ if (x) {
+ a = 5;
+ if (y) {
+ f();
+ }
+ } else {
+ label = 5;
+ }
+ fuseElses();
+ if (x ? y : 0) {
+ f();
+ } else {
+ a();
+ }
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 52;
+ }
+ if ((label | 0) == 62) {
+ label = 0;
+ a();
+ }
+ if (x ? y : 0) {
+ f();
+ } else {
+ a();
+ }
+ while (1) {
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 953;
+ }
+ if ((label | 0) == 953) {
+ a();
+ }
+ }
+ if (x ? y : 0) {
+ label = 54;
+ } else {
+ label = 54;
+ }
+ if ((label | 0) == 54) {
+ label = 0;
+ a();
+ }
+}
+function b() {
+ if (x) {
+ a();
+ } else {
+ label = 5;
+ }
+ if ((label | 0) == 5) {
+ label = 0;
+ a();
+ }
+}
+function c() {
+ label = x;
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 151;
+ }
+ if ((label | 0) == 151) {
+ label = 0;
+ a();
+ }
+}
+function d() {
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 251;
+ }
+ if ((label | 0) == 251) {
+ label = 0;
+ a();
+ }
+ if ((label | 0) == 251) {
+ a();
+ }
+}
+function e() {
+ if (x ? y : 0) {
+ f();
+ } else {
+ label = 351;
+ }
+ if ((label | 0) == 351) {
+ label = 0;
+ a();
+ }
+ if ((label | 0) == x) {
+ a();
+ }
+}
+
diff --git a/tools/test-js-optimizer-si.js b/tools/test-js-optimizer-si.js
new file mode 100644
index 00000000..04ceec4a
--- /dev/null
+++ b/tools/test-js-optimizer-si.js
@@ -0,0 +1,258 @@
+function a() {
+ if (x) {
+ if (y) {
+ g();
+ }
+ }
+ if (x) {
+ if (y) {
+ g();
+ } else {
+ h();
+ }
+ }
+ if (x) {
+ if (y) {
+ g();
+ }
+ h();
+ }
+ if (x) {
+ if (y) {
+ g();
+ }
+ } else {
+ h();
+ }
+ if (x) {
+ return;
+ if (y) {
+ g();
+ }
+ }
+ if (x) {
+ if (y) {
+ if (z) {
+ g();
+ }
+ }
+ }
+ if (x) {
+ return;
+ if (y) {
+ if (z) {
+ g();
+ }
+ }
+ }
+ if (x) {
+ if (y) {
+ return;
+ if (z) {
+ g();
+ }
+ }
+ }
+ if (x) {
+ if (y) {
+ if (z) {
+ g();
+ }
+ f();
+ }
+ }
+ if (x) {
+ if (y) {
+ if (z) {
+ g();
+ }
+ }
+ f();
+ }
+ if (x) {
+ f();
+ x = x + 2 | 0;
+ if (y) {
+ g();
+ }
+ }
+ if (x) {
+ f();
+ x = x + 2 | 0;
+ return;
+ if (y) {
+ g();
+ }
+ }
+ andNowForElses();
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 5;
+ }
+ } else {
+ label = 5;
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 5;
+ }
+ } else {
+ label = 6;
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 5;
+ }
+ }
+ if (x) {
+ if (y) {
+ f();
+ }
+ } else {
+ label = 5;
+ }
+ if (x) {
+ a = 5; // do not commify me
+ if (y) {
+ f();
+ }
+ } else {
+ label = 5;
+ }
+ fuseElses();
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 51;
+ }
+ } else {
+ label = 51;
+ }
+ if ((label|0) == 51) {
+ label = 0;
+ a();
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 52;
+ }
+ } else {
+ label = 52;
+ }
+ if ((label|0) == 62) {
+ label = 0;
+ a();
+ }
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 53;
+ }
+ } else {
+ label = 53;
+ }
+ if ((label|0) == 53) {
+ a();
+ }
+ while (1) {
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 953;
+ }
+ } else {
+ label = 953;
+ }
+ if ((label|0) == 953) {
+ a();
+ }
+ }
+ if (x) {
+ if (y) {
+ label = 54; // extra label setting, cannot fuse here
+ } else {
+ label = 54;
+ }
+ } else {
+ label = 54;
+ }
+ if ((label|0) == 54) {
+ label = 0;
+ a();
+ }
+}
+function b() {
+ if (x) { // will not be fused, since we did not eliminate with elses
+ a();
+ } else {
+ label = 5;
+ }
+ if ((label|0) == 5) {
+ label = 0;
+ a();
+ }
+}
+function c() {
+ label = x; // dynamic assign to label, suppresses label removal
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 151;
+ }
+ } else {
+ label = 151;
+ }
+ if ((label|0) == 151) {
+ label = 0;
+ a();
+ }
+}
+function d() {
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 251;
+ }
+ } else {
+ label = 251;
+ }
+ if ((label|0) == 251) {
+ label = 0;
+ a();
+ }
+ if ((label|0) == 251) { // extra check of label, suppresses label removal
+ a();
+ }
+}
+function e() {
+ if (x) {
+ if (y) {
+ f();
+ } else {
+ label = 351;
+ }
+ } else {
+ label = 351;
+ }
+ if ((label|0) == 351) {
+ label = 0;
+ a();
+ }
+ if ((label|0) == x) { // dynamic check of label, suppresses label removal
+ a();
+ }
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "c", "d"]
diff --git a/tools/test-js-optimizer-t2-output.js b/tools/test-js-optimizer-t2-output.js
deleted file mode 100644
index 334d7999..00000000
--- a/tools/test-js-optimizer-t2-output.js
+++ /dev/null
@@ -1,91 +0,0 @@
-function shifty($id2) {
- var $tp$s2;
- var $parameters_addr$s2;
- var $wavelet38$s2;
- var _dwt_norms_real$s2;
- var $a_addr$s2;
- var _idents$s2;
- var $id3$s3;
- var $id2$s1 = $id2 >> 1;
- q(HEAP32[$id >> 2]);
- q(HEAP32[$id + 40 >> 2]);
- q(HEAP32[$id + 80 >> 2]);
- q(HEAP32[unknown1 + unknown2 + $id >> 2]);
- q(HEAP32[unknown1 + $id + unknown2 >> 2]);
- var localUnchanged1 = get(1), localUnchanged2 = get(1);
- q(HEAP32[localUnchanged1 + $id + localUnchanged2 >> 2]);
- q($id >> _something_);
- $id = q("..");
- q($id << _somethingElse_);
- pause(-1);
- q(HEAP32[$id2$s1]);
- q(HEAP32[$id2$s1]);
- q(HEAP32[$id2$s1]);
- q(HEAP32[$id2$s1]);
- q(HEAP32[$id2$s1 + 20]);
- q(HEAP32[$id2$s1 + 40]);
- var $id3 = get(74), $id3$s3 = $id3 >> 3;
- q(HEAP32[$id3$s3]);
- q(HEAP32[$id3$s3 + 5]);
- q(HEAP32[$id3$s3 + 10]);
- q($id3);
- pause(0);
- var _idents = get("abc"), _idents$s2 = _idents >> 2;
- q(HEAP32[HEAP32[_idents$s2] + 8 >> 2]);
- q(HEAP32[HEAP32[_idents$s2] + 8 >> 2]);
- q(HEAP32[HEAP32[_idents$s2] + 8 >> 2]);
- pause(1);
- var $sn_addr = get(12), $a_addr = get(999), $a_addr$s2 = $a_addr >> 2;
- var $i = get(112233);
- q(HEAP32[(($sn_addr - 1 << 1) + 1 << 2 >> 2) + $a_addr$s2]);
- q(HEAP32[(($i - 1 << 1) + 1 << 2 >> 2) + $a_addr$s2]);
- q(HEAP32[($i << 3 >> 2) + $a_addr$s2]);
- q(HEAP32[($i << 2 >> 2) + $a_addr$s2]);
- q($a_addr$s2, z($a_addr$s2));
- pause(2);
- var $level = HEAP[get(322) >> 2];
- var _dwt_norms_real = get("a"), _dwt_norms_real$s2 = _dwt_norms_real >> 2, $orient = get("cheez");
- q(HEAP32[($level << 3 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]);
- q(HEAP32[(($level << 3) + 4 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]);
- q(HEAP32[(($level << 3) + 8 >> 2) + _dwt_norms_real$s2 + ($orient * 20 | 0)]);
- pause(3);
- var $wavelet38 = get(38), $wavelet38$s2 = $wavelet38 >> 2;
- $k = $a_addr;
- q(HEAPF32[HEAP32[$wavelet38$s2] + ($k << 4) + 8 >> 2]);
- q(HEAPF32[HEAP32[$wavelet38$s2] + ($k << 4) + 12 >> 2]);
- q(HEAPF32[HEAP32[$wavelet38$s2] + ($k << 4) + 400 >> 2]);
- pause(4);
- var $p = $k, $parameters_addr = get("burger"), $parameters_addr$s2 = $parameters_addr >> 2;
- q(HEAP32[(($p << 2) + 5624 >> 2) + $parameters_addr$s2]);
- q(HEAP32[(($p << 2) + 5644 >> 2) + $parameters_addr$s2]);
- q(HEAP32[(($p << 2) + 5664 >> 2) + $parameters_addr$s2]);
- pause(5);
- var $res_spec242 = get($real), $cp = get("b"), $tileno = arguments[2];
- q(HEAP32[(($res_spec242 - 1 << 2) + 5624 >> 2) + $parameters_addr$s2]);
- q(HEAP32[(HEAP32[$cp + 108 >> 2] + 420 >> 2) + ($tileno * 1397 | 0)]);
- pause(6);
- q($idx << 3);
- q(1 << $idx << 1);
- print(INDENT + "Entering: _main" + "hi");
- pause(7);
- var $tp = get("tp"), $tp$s2 = $tp >> 2;
- q($tp$s2);
- q($tp$s2);
- q($tp$s2);
- HEAP32[$H400] = $tp;
- HEAP32[$tp] = 5;
- HEAP32[$tp$s2] = 5;
- HEAP32[HEAP[$tp$s2]] = 5;
- HEAP32[HEAP[$tp$s2] >> 2] = 5;
- pause(7);
- q(go() >> 1 << 1);
- q(go() << 1 >> 1);
- q(go() >> 2);
- q(go() << 2);
- q(go() >> 8 << 8);
- q(go() << 8 >> 8);
- q(go() >> 16);
- q(go() << 16);
- q(go() + 2 >> 2);
-}
-
diff --git a/tools/test-js-optimizer-t2.js b/tools/test-js-optimizer-t2.js
deleted file mode 100644
index 8dd82485..00000000
--- a/tools/test-js-optimizer-t2.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// TODO also with >> 1 and >> 3
-// also HEAP*U*, and HEAP8, 16
-function shifty($id2) {
- // $id is a non-ssa, $id2 is a param. both should be replaced with a shifted version
- q(HEAP32[$id >> 2]);
- q(HEAP32[($id + 40) >> 2]);
- q(HEAP32[($id + 80 | 0) >> 2]);
- q(HEAP32[(unknown1 + unknown2 + $id) >> 2]);
- q(HEAP32[(unknown1 + $id + unknown2) >> 2]); // unknowns should be shifted together
- var localUnchanged1 = get(1), localUnchanged2 = get(1);
- q(HEAP32[(localUnchanged1 + $id + localUnchanged2) >> 2]); // unknowns should be shifted together
- q($id >> _something_); // non-fixed shift
- $id = q('..');
- q($id << _somethingElse_); // non-fixed shift
- pause(-1);
- q(HEAP32[$id2 >> 1]);
- q(HEAP32[$id2 >> 1]);
- q(HEAP32[$id2 >> 1]);
- q(HEAP32[$id2 >> 1]);
- q(HEAP32[($id2 + 40) >> 1]);
- q(HEAP32[($id2 + 80 | 0) >> 1]);
- var $id3 = get(74);
- q(HEAP32[$id3 >> 3]);
- q(HEAP32[($id3 + 40) >> 3]);
- q(HEAP32[($id3 + 80 | 0) >> 3]);
- q($id3);
- pause(0);
- // similar, but inside another HEAP
- var _idents = get('abc');
- q(HEAP32[(HEAP32[_idents >> 2] + 8 | 0) >> 2]);
- q(HEAP32[(HEAP32[_idents >> 2] + 8 | 0) >> 2]);
- q(HEAP32[(HEAP32[_idents >> 2] + 8 | 0) >> 2]);
- pause(1);
- // $i's shifts should consolidate (the last should be 0..?
- // since we may have had |0 in the middle!)
- var $sn_addr = get(12), $a_addr = get(999);
- var $i = get(112233);
- q(HEAP32[($a_addr + ((($sn_addr - 1 << 1) + 1 | 0) << 2) | 0) >> 2]);
- q(HEAP32[($a_addr + ((($i - 1 << 1) + 1 | 0) << 2) | 0) >> 2]);
- q(HEAP32[($a_addr + (($i << 1 | 0) << 2) | 0) >> 2]);
- q(HEAP32[($a_addr + ($i << 2)) >> 2]);
- q($a_addr >> 2, z($a_addr >> 2));
- pause(2);
- var $level = HEAP[get(322) >> 2]; // ignore this
- var _dwt_norms_real = get('a'), $orient = get('cheez');
- q(HEAP32[(_dwt_norms_real + $orient * 80 + ($level << 3) | 0) >> 2]);
- q(HEAP32[(_dwt_norms_real + $orient * 80 + ($level << 3) + 4 | 0) >> 2]);
- q(HEAP32[(_dwt_norms_real + $orient * 80 + ($level << 3) + 8 | 0) >> 2]);
- pause(3);
- // reuse $a_addr here
- var $wavelet38 = get(38);
- $k = $a_addr;
- q(HEAPF32[(HEAP32[$wavelet38 >> 2] + ($k << 4) + 8 | 0) >> 2]);
- q(HEAPF32[(HEAP32[$wavelet38 >> 2] + ($k << 4) + 12 | 0) >> 2]);
- q(HEAPF32[(HEAP32[$wavelet38 >> 2] + ($k << 4) + 400 | 0) >> 2]);
- pause(4);
- // reuse $k, which already reuses $a_addr
- var $p = $k, $parameters_addr = get('burger')
- q(HEAP32[($parameters_addr + 5624 + ($p << 2) | 0) >> 2]);
- q(HEAP32[($parameters_addr + 5644 + ($p << 2) | 0) >> 2]);
- q(HEAP32[($parameters_addr + 5664 + ($p << 2) | 0) >> 2]);
- pause(5);
- // loops count as more uses!
- var $res_spec242 = get($real), $cp = get('b'), $tileno = arguments[2];
- q(HEAP32[($parameters_addr + 5624 + (($res_spec242 - 1 | 0) << 2) | 0) >> 2]);
- q(HEAP32[(HEAP32[($cp + 108 | 0) >> 2] + $tileno * 5588 + 420 | 0) >> 2]);
- pause(6);
- q($idx << 1 << 2);
- q(1 << $idx << 1); // Do not turn this into the slower 1 << $idx + 1 (which is identical though)
- print(INDENT + "Entering: _main" + "hi"); // this order should not be modified
- pause(7);
- var $tp = get('tp');
- q($tp >> 2);
- q($tp >> 2);
- q($tp >> 2);
- HEAP32[$H400] = $tp;
- HEAP32[$tp] = 5;
- HEAP32[$tp >> 2] = 5;
- HEAP32[HEAP[$tp >> 2]] = 5;
- HEAP32[HEAP[$tp >> 2] >> 2] = 5;
- pause(7);
- q(go() >> 1 << 1);
- q(go() << 1 >> 1);
- q(go() >> 1 >> 1);
- q(go() << 1 << 1);
- q(go() >> 8 << 8);
- q(go() << 8 >> 8);
- q(go() >> 8 >> 8);
- q(go() << 8 << 8);
- q((go() + 2) >> 2); // the 2 >> 2 can't be simplified
-}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["shifty"]
diff --git a/tools/test-js-optimizer-t2c-output.js b/tools/test-js-optimizer-t2c-output.js
deleted file mode 100644
index 43cdf889..00000000
--- a/tools/test-js-optimizer-t2c-output.js
+++ /dev/null
@@ -1,17 +0,0 @@
-function shifty() {
- $pPage = HEAP32[$pCur_addr + ($26 << 16 >> 16 << 2) + 116 >> 2];
- var $ead_192394 = HEAP32[$pCur_addr + ($26 << 16 >> 16 << 2) + 116 >> 2];
- $pPage2 = HEAP32[($26 << 16 >> 16 << 2) + $pCur_addr + 116];
- var $ead_192394b = HEAP32[($26 << 16 >> 16 << 2) + $pCur_addr + 116];
- $pPage2 = HEAP32[($26 << 16 >> 16) + $pCur_addr + 116];
- var $ead_192394b = HEAP32[($26 << 16 >> 16) + $pCur_addr + 116];
- q(4);
- q($13 + 8 >> 2);
- q($13 + 28 >> 2);
- q($13 + 60 >> 2);
- q($13 + $15 + 12 >> 2);
- q(HEAPF32[$output + ($j37 << 4) + 4 >> 2]);
- q($13 + 13 << 2);
- q(h() >> 2 << 2);
-}
-
diff --git a/tools/test-js-optimizer-t2c.js b/tools/test-js-optimizer-t2c.js
deleted file mode 100644
index 85292ba5..00000000
--- a/tools/test-js-optimizer-t2c.js
+++ /dev/null
@@ -1,18 +0,0 @@
-function shifty() {
- $pPage = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16 << 2) >> 2];
- var $ead_192394 = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16 << 2) >> 2];
- $pPage2 = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16 << 2)];
- var $ead_192394b = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16 << 2)];
- $pPage2 = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16)];
- var $ead_192394b = HEAP32[$pCur_addr + 116 + ($26 << 16 >> 16)];
- // We prefer to do additions then shifts, so the shift happens last, because the shift output is known to be 32-bit. So these should not change
- q(16 >> 2);
- q($13 + 8 >> 2);
- q(28 + $13 >> 2);
- q(48 + $13 + 12 >> 2);
- q($13 + $15 + 12 >> 2);
- q(HEAPF32[$output + ($j37 << 4) + 4 >> 2]);
- q(5 + $13 + 8 << 2);
- q(((h() | 0) >> 2) << 2); // removing the shifts is dangerous
-}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["shifty"]
diff --git a/tools/test-js-optimizer-t3-output.js b/tools/test-js-optimizer-t3-output.js
deleted file mode 100644
index 9a16c2ac..00000000
--- a/tools/test-js-optimizer-t3-output.js
+++ /dev/null
@@ -1,49 +0,0 @@
-function _png_create_write_struct_2($user_png_ver, $error_ptr, $error_fn, $warn_fn, $mem_ptr, $malloc_fn, $free_fn) {
- var $png_ptr$s2;
- var label;
- label = 2;
- var setjmpTable = {
- "2": (function(value) {
- label = 5;
- $call1 = value;
- }),
- dummy: 0
- };
- while (1) try {
- switch (label) {
- case 2:
- var $png_ptr;
- var $call = _png_create_struct(1);
- $png_ptr = $call;
- var $call1 = (HEAP32[$png_ptr >> 2] = label, 0);
- label = 5;
- break;
- case 5:
- var $2 = $png_ptr;
- if (($call1 | 0) == 0) {
- label = 4;
- break;
- } else {
- label = 3;
- break;
- }
- case 3:
- var $4 = HEAP32[($png_ptr >> 2) + (148 >> 2)];
- _png_free($2, $4);
- HEAP32[($png_ptr >> 2) + (148 >> 2)] = 0;
- _png_destroy_struct($png_ptr);
- var $retval_0 = 0;
- label = 4;
- break;
- case 4:
- var $retval_0;
- return $retval_0;
- default:
- assert(0, "bad label: " + label);
- }
- } catch (e) {
- if (!e.longjmp) throw e;
- setjmpTable[e.label](e.value);
- }
-}
-
diff --git a/tools/test-js-optimizer-t3.js b/tools/test-js-optimizer-t3.js
deleted file mode 100644
index 0e02f72b..00000000
--- a/tools/test-js-optimizer-t3.js
+++ /dev/null
@@ -1,50 +0,0 @@
-function _png_create_write_struct_2($user_png_ver, $error_ptr, $error_fn, $warn_fn, $mem_ptr, $malloc_fn, $free_fn) {
- var $png_ptr$s2;
- var label;
- label = 2;
- var setjmpTable = {
- "2": (function(value) {
- label = 5;
- $call1 = value;
- }),
- dummy: 0
- };
- while (1) try {
- switch (label) {
- case 2:
- var $png_ptr;
- var $call = _png_create_struct(1);
- $png_ptr = $call;
- var $call1 = (HEAP32[$png_ptr >> 2] = label, 0);
- label = 5;
- break;
- case 5:
- var $2 = $png_ptr;
- if (($call1 | 0) == 0) {
- label = 4;
- break;
- } else {
- label = 3;
- break;
- }
- case 3:
- var $4 = HEAP32[($png_ptr >> 2) + (148 >> 2)];
- _png_free($2, $4);
- HEAP32[($png_ptr >> 2) + (148 >> 2)] = 0;
- _png_destroy_struct($png_ptr);
- var $retval_0 = 0;
- label = 4;
- break;
- case 4:
- var $retval_0;
- return $retval_0;
- default:
- assert(0, "bad label: " + label);
- }
- } catch (e) {
- if (!e.longjmp) throw e;
- setjmpTable[e.label](e.value);
- }
-}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["_png_create_write_struct_2"]
-