//====================================================================================
// Auto-generated code. Original source + changes are
// sphere flake bvh raytracer (c) 2005, thierry berger-perrin <tbptbp@gmail.com>
// (c) 2010, azakai (Emscripten)
// this code is released under the GNU Public License.
//
// Optimized using Closure Compiler
//====================================================================================
function __globalConstructor__() {
}
var __THREW__ = false, __ATEXIT__ = [];
function assert(b, d) {
if(!b) {
d = "Assertion failed: " + d;
print(d + ":\n" + Error().stack);
this[alert] && alert(d);
throw"Assertion: " + d;
}
}
function Pointer_niceify(b) {
return{slab:HEAP, pos:b}
}
function Pointer_make(b, d, a) {
function c(f) {
if(!f || f.length === undefined || typeof f === "function") {
return[f]
}
return f.map(c).reduce(function(g, h) {
return g.concat(h)
}, [])
}
d = d ? d : 0;
if(b === HEAP) {
return d
}
b = c(b);
a = [_malloc, stackAlloc, staticAlloc][a ? a : ALLOC_STATIC](Math.max(b.length - d, 1));
for(var e = 0;e < b.length - d;e++) {
HEAP[a + e] = b[d + e]
}
return a
}
function Pointer_stringify(b) {
b = Pointer_niceify(b);
for(var d = "", a = 0, c;;) {
if(b.pos + a >= b.slab.length) {
break
}
c = String.fromCharCode(b.slab[b.pos + a]);
if(c == "\u0000") {
break
}
d += c;
a += 1
}
return d
}
ALLOC_NORMAL = 0;
ALLOC_STACK = 1;
ALLOC_STATIC = 2;
function alignMemory(b) {
return Math.ceil(b / 1) * 1
}
PAGE_SIZE = 4096;
function alignMemoryPage(b) {
return Math.ceil(b / PAGE_SIZE) * PAGE_SIZE
}
function stackEnter() {
STACK_STACK.push(STACKTOP)
}
function stackExit() {
STACKTOP = STACK_STACK.pop()
}
function stackAlloc(b) {
b = alignMemory(b);
assert(STACKTOP + b - STACKROOT < TOTAL_STACK, "No room on stack!");
var d = STACKTOP;
STACKTOP += b;
return d
}
function staticAlloc(b) {
b = alignMemory(b);
assert(STATICTOP + b - STATICROOT < TOTAL_STATIC, "No room for static allocation!");
var d = STATICTOP;
STATICTOP += b;
return d
}
if(!this._malloc) {
_malloc = staticAlloc;
_free = function() {
}
}
__Znwm = __Znam = __Znaj = __Znwj = _malloc;
__ZdaPv = __ZdlPv = _free;
function __initializeRuntime__() {
HEAP = intArrayFromString("(null)");
this.TOTAL_STA